Reverb.Runtime
0.1.1
dotnet add package Reverb.Runtime --version 0.1.1
NuGet\Install-Package Reverb.Runtime -Version 0.1.1
<PackageReference Include="Reverb.Runtime" Version="0.1.1" />
<PackageVersion Include="Reverb.Runtime" Version="0.1.1" />
<PackageReference Include="Reverb.Runtime" />
paket add Reverb.Runtime --version 0.1.1
#r "nuget: Reverb.Runtime, 0.1.1"
#:package Reverb.Runtime@0.1.1
#addin nuget:?package=Reverb.Runtime&version=0.1.1
#tool nuget:?package=Reverb.Runtime&version=0.1.1
Reverb.Runtime
The library that Reverb notebooks reference: Dump, Markdown and HTML output, widgets and charts. It has no dependencies.
You don't usually add it yourself. reverb new writes this line at the top of every notebook:
#:package Reverb.Runtime@0.1.1
To create and edit notebooks, install the tool, Reverb.Notebooks:
dotnet tool install -g Reverb.Notebooks
Two modes
- In the Reverb editor, output is rich (tables, charts, HTML) and widgets are live.
- With
dotnet run, there's no editor. Output prints to the console as text, and widgets use their default values. The same notebook works both ways.
Output
using Reverb;
using static Reverb.Notebook;
orders.Dump(); // a table for collections, a property list for objects
orders.Dump("Big orders"); // with a title; Dump returns its argument
Md($"**{orders.Count}** orders"); // Markdown
Html("<em>hi</em>"); // raw HTML
Control how your own types display:
Formatters.Register<Money>(m => Output.FromHtml($"<b>{m.Amount:C}</b>", text: $"{m.Amount:C}"));
Widgets
A widget is a variable. In the editor, any cell that reads .Value runs again when the widget changes.
| Widget | .Value |
|---|---|
Ui.Slider("Size", min: 0, max: 100, value: 50, step: 5) |
double |
Ui.Dropdown("Region", ["West", "East"], value: "East") |
the selected item |
Ui.Text("Name", value: "Ada") |
string |
Ui.Checkbox("Show totals", value: true) |
bool |
Ui.Number("Years", 30, min: 1, max: 40) |
the number type you passed |
Ui.Button("Refresh") |
how many times it's been clicked |
Charts
Chart.Line(sales, x: s => s.Date, y: s => s.Revenue);
Chart.Bar(byProduct, x: p => p.Product, y: p => p.Units, title: "Units by product");
Chart.Scatter(points, x: p => p.Height, y: p => p.Weight, series: p => p.Species);
Chart.VegaLite(json); // any Vega-Lite spec
Under dotnet run, charts print a one-line summary.
Other helpers
var path = Path.Combine(Notebook.Folder, "data.csv"); // a file next to the notebook
await Task.Delay(5000, Notebook.CancellationToken); // stops when you press Interrupt
The full guide is at github.com/muneeb-devp/reverb. MIT licensed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.