Public
Edited
Jan 9, 2024
18 stars
Insert cell
Insert cell
Insert cell
viewof colors = Inputs.checkbox(["red", "green", "blue"], {label: "color"})
Insert cell
colors
Insert cell
html`<div style="display: flex;">${colors.map(color => html`<div style="background-color: ${color}; width: 25px; height: 25px;">`)}`
Insert cell
Insert cell
teams = [
{name: "Lakers", location: "Los Angeles, California"},
{name: "Warriors", location: "San Francisco, California"},
{name: "Celtics", location: "Boston, Massachusetts"},
{name: "Nets", location: "New York City, New York"},
{name: "Raptors", location: "Toronto, Ontario"},
]
Insert cell
viewof watching = Inputs.checkbox(teams, {label: "Watching", format: x => x.name})
Insert cell
watching
Insert cell
Insert cell
viewof vowels = Inputs.checkbox([..."AEIOUY"], {label: "Vowel", disabled: ["Y"]})
Insert cell
vowels
Insert cell
Insert cell
viewof colors2 = Inputs.checkbox(["red", "green", "blue"], {value: ["red"], label: html`<b>Colors</b>`, format: x => html`<span style="text-transform: capitalize; border-bottom: solid 2px ${x}; margin-bottom: -2px;">${x}`})
Insert cell
colors2
Insert cell
Insert cell
viewof sizes = Inputs.checkbox(new Map([["Short", 8], ["Tall", 12], ["Grande", 16], ["Venti", 20]]), {value: [12], label: "Size"})
Insert cell
sizes
Insert cell
Insert cell
viewof size2 = Inputs.checkbox(
new Map([["Short", 8], ["Tall", 12], ["Grande", 16], ["Venti", 20]]),
{value: [12], label: "Size", format: ([name, value]) => `${name} (${value} oz)`}
)
Insert cell
size2
Insert cell
Insert cell
athletes = FileAttachment("athletes.csv").csv({typed: true})
Insert cell
viewof goldAthletes = Inputs.checkbox(d3.group(athletes, d => d.gold), {label: "Gold medal count", sort: "descending", key: [4, 5]})
Insert cell
goldAthletes.flat()
Insert cell
Insert cell
viewof bases = Inputs.checkbox("GATTACA", {sort: true, unique: true})
Insert cell
bases
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