Public
Edited
Sep 23, 2024
14 forks
3 stars
Insert cell
Insert cell
Plot.plot({
width: 928,
height: 500,
x: {label: null},
y: {tickFormat: "s", tickSpacing: 50},
color: {scheme: "Spectral", legend: "ramp", width: 340, label: "Age (years)"},
marks: [
Plot.barY(tidy, {
x: "state",
y: "population",
fill: "age",
sort: {color: null, x: "-y"}
})
]
})
Insert cell
population = FileAttachment("us-population-state-age.csv").csv({typed: true})
Insert cell
Insert cell
tidy = population.columns.slice(1).flatMap((age) => population.map(d => ({state: d.name, age, population: d[age]})))
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