Published
Edited
Oct 18, 2020
2 stars
Insert cell
Insert cell
x
Insert cell
Insert cell
Insert cell
{
// from https://observablehq.com/@mbostock/views-are-mutable-values
const form = html`<form onsubmit="return false;">
<button name=inc>increment</button>
<button name=dec>decrement</button>
</form>`;
form.inc.onclick = () => {
++viewof x.value;
viewof x.dispatchEvent(new CustomEvent("input"));
};
form.dec.onclick = () => {
--viewof x.value;
viewof x.dispatchEvent(new CustomEvent("input"));
};
return form;
}
Insert cell
Insert cell
Insert cell
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