A notebook, driven as a component

This page is not the notebook's built-in UI. It loads the same capacity WASM notebook, then draws its own two panels and speaks to the notebook through the JS client (client/notebook.js). The left panel is a control this page rendered itself; the right panel is a second computation that runs on the notebook's typed output stream — subscribeValues — the thing that was impossible when a scalar crossed the wire as the string "40.24".

loading the notebook…

Input

This page drew this control and calls nb.set("c", …).

80

Typed output

A program computes on subscribeValues — not on our UI.

arrived over the port as:
Annualized fleet cost (hourly × 24 × 365)

Why this is real, not the demo relabeled. The annualized figure is hourlyCost.toFixed()-able arithmetic on a JavaScript number. Before the typed value-out pipe, hourlyCost reached a host only as rendered text — the string "40.24" — and a + would have concatenated, not added. The number chip above is read straight off typeof of what the port delivered; if it ever said string it would turn red. Read the page source: it never calls the notebook's NB.init, and it mounts into its own DOM. ← go-notebook