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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more