Unlisted
Edited
Mar 19, 2023
Insert cell
Insert cell
options = Object.entries({
one: "Label one",
two: "Label two" ,
three: "Label three"
})
Insert cell
// Accessor functions that we'll use for all our widgets.
widgetOptions = ({valueof: d => d[0], format: d => d[1]})
Insert cell
Insert cell
Insert cell
Insert cell
singleSelection
Insert cell
viewof singleSelection = select(options, {...widgetOptions, value: "two"})
Insert cell
Inputs.bind(Inputs.radio(options, widgetOptions), viewof singleSelection)
Insert cell
Insert cell
multiSelection
Insert cell
viewof multiSelection = select(options, {...widgetOptions, multiple: true, value: ["two", "three"]})
Insert cell
Inputs.bind(Inputs.checkbox(options, widgetOptions), viewof multiSelection)
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