Published
Edited
Oct 1, 2022
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
viewof params = Inputs.form({
angle: transform(Inputs.range([-180,180], { step: .1, label: "angle" }),
x => x / 180 * Math.PI,
x => x / Math.PI * 180),
value: Inputs.range([0,1], { step: .01, label: "value" })
})
Insert cell
params
Insert cell
Insert cell
transform = {
const identity = x => x;
return (input, forward = identity, backward = identity) => {
const form = htl.html`<form onsubmit="event.preventDefault();">${input}</form>`;
Object.defineProperty(form, "value", {
get: () => forward(input.value),
set: value => input.value = backward(value, input.value)
});
return form;
};
}
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