Published
Edited
Sep 2, 2022
1 fork
Importers
37 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof selection = Inputs.input([200, 300])
Insert cell
selection
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
x = d3.scaleLinear([0, 1000], [margin.left, width - margin.right])
Insert cell
margin = ({ left: 0, top: 5, right: 0, bottom: 10 })
Insert cell
height = 150
Insert cell
Insert cell
Insert cell
bind = (target, source, update, invalidation = Inputs.disposal(target)) => {
// Call Inputs.bind before update so that target.value is set when we initialize.
Inputs.bind(target, source, invalidation);
if (update) {
// The initial call has no arguments; future calls are passed the input event.
update();
// Add an input event listener to the source
source.addEventListener("input", update);
// Remove the listener when the target is invalidated
invalidation.then(() => source.removeEventListener("input", update));
}
return target;
}
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