Published unlisted
Edited
Apr 21, 2021
Insert cell
Insert cell
pure_output = html`This is not yet content: `
Insert cell
// Cell 3 - a Button with an event listener
{
let btn = Button("Wait for Random");
btn.onclick = function() {
d3.select(pure_output).text(`${prefix} ${rand()}`);
};
return btn;
}
Insert cell
prefix = "This is content (try changing it): "
Insert cell
rand = () => Math.floor(Math.random() * 5000) + 1
Insert cell
import { Button } from "@observablehq/inputs"
Insert cell
d3 = require('d3-selection@2')
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