Unlisted
Edited
Apr 21, 2023
Insert cell
Insert cell
Plot.plot({
y: {
grid: true,
label: "↑ Travelers per day (millions)",
transform: (d) => d / 1e6 // convert to millions
},
marks: [
Plot.ruleY([0]),
Plot.line(travelers, {x: "date", y: "previous", strokeOpacity: 0.5}),
Plot.line(travelers, {x: "date", y: "current"}),
Plot.text(travelers, Plot.selectFirst({x: "date", y: "previous", text: ["2019"], fillOpacity: 0.5, lineAnchor: "bottom", dy: -6})),
Plot.text(travelers, Plot.selectFirst({x: "date", y: "current", text: ["2020"], lineAnchor: "top", dy: 6}))
]
})
Insert cell
travelers = FileAttachment("travelers.csv").csv({typed: true})
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