Public
Edited
Jun 5, 2023
4 forks
1 star
Insert cell
Insert cell
Plot.plot({
width: 928,
height: 1200,
y: {label: null},
x: {axis: "top", tickFormat: "s"},
color: {scheme: "Spectral", legend: "ramp", width: 340, label: "Age (years)"},
marks: [
Plot.barX(tidy, {
y: "state",
x: "population",
fill: "age",
sort: {color: null, y: "-x"}
})
]
})
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