Public
Edited
Mar 9, 2023
Insert cell
Insert cell
data = FileAttachment("city_populations_flat.csv").csv({ typed: true })
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(data, { x: "year", y: "population", z: "city", stroke: "city" })
]
})
Insert cell
Plot.plot({
marks: [
Plot.barX(
data.filter((x) => x.year == year),
{
x: "population",
y: "city",
sort: { y: "y", reverse: true },
fill: "city"
}
),
Plot.ruleX([0])
]
})
Insert cell
import { Scrubber } from "@mbostock/scrubber"
Insert cell
viewof year = Scrubber(
data.reverse().map((x) => x.year),
{ autoplay: false, loop: false, delay: 100 }
)
Insert cell
year
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