Public
Edited
Apr 25, 2023
7 forks
Importers
6 stars
Insert cell
Insert cell
Insert cell
Insert cell
viewof sport = Inputs.select(sports, {label: "Sport"})
Insert cell
Insert cell
Insert cell
Inputs.range([0, 100], {label: "Amount", step: 5})
Insert cell
Insert cell
Insert cell
Insert cell
viewof amount = Inputs.range([0, 100], {label: "Amount", step: 1})
Insert cell
Insert cell
Insert cell
Insert cell
viewof button = Inputs.button("Click me")
Insert cell
viewof toggle = Inputs.toggle({label: "Toggle", value: true})
Insert cell
viewof checkboxes = Inputs.checkbox(["A", "B"], {label: "Check boxes", value: ["A"]})
Insert cell
viewof radios = Inputs.radio(["A", "B"], {label: "Radio buttons", value: "A"})
Insert cell
viewof date = Inputs.date({label: "Date", value: "2022-12-22"})
Insert cell
viewof text = Inputs.text({label: "Text"})
Insert cell
Insert cell
viewof letter = Inputs.select(letters, {label: "Favorite letter", value: "O"})
Insert cell
viewof color = Inputs.color({label: "Bars color", value: "#4682b4"})
Insert cell
viewof highlight = Inputs.color({label: "Highlight color", value: "#ffa500"})
Insert cell
letterFrequency = Plot.plot({
marks: [
Plot.barY(alphabet, {x: "letter", y: "frequency",
fill: d => d.letter === letter ? highlight : color,
sort: {x: "y", reverse: true}}),
Plot.ruleY([0])
],
caption: "Frequency of letters in English texts",
ariaLabel: "Frequency of letters in English texts",
ariaDescription: `This bar chart shows the frequency of letters in English texts. We see that the top five most common letters are E, T, A, O and I.`
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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