Public
Edited
Feb 5, 2024
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// This named cell is used to overload the API URLs in other notebooks. It is used for testing/debugging.
apiUrls = [
// Try to load local script for test purposes.
// "http://127.0.0.1:5500/packages/webrun-devtools/dist/webrun-devtools.js",

// The last client version on CDN
"https://unpkg.com/@statewalker/webrun-devtools",
// Used with the first version of the WebRunDevTools extension published on the GoogleChrome Store.
"https://unpkg.com/@statewalker/webrun-devtools@0.0.12"
]
Insert cell
Insert cell
Insert cell
inputApiKey = newApiKeyInput()
Insert cell
Insert cell
api = loadApi({
input: inputApiKey,
invalidation
})
Insert cell
Insert cell
Insert cell
async function* listenForm(
form,
{
validate = (d) => true,
value = (d) => d,
submit = (d) => d?.submit || 0
} = {}
) {
let prevSubmit = 0;
for await (const d of Generators.input(form)) {
const newSubmit = submit(d);
if (!d || newSubmit === prevSubmit) continue;
prevSubmit = newSubmit;
if (validate(d)) yield await value(d);
}
}
Insert cell
Insert cell
Insert cell
import { toc } from "@nebrius/indented-toc" // This component generates the Table of Contents
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more