Unlisted
Edited
Aug 6, 2024
Insert cell
Insert cell
Plot.plot({
margin: 0,
padding: 0,
projection: "albers",
fy: {interval: "10 years"},
marks: [
Plot.geo(statemesh, {strokeOpacity: 0.2}),
Plot.geo(nation),
Plot.geo(walmarts, {fy: "date", r: 1.5, fill: "blue", tip: true, title: "date"}),
Plot.axisFy({frameAnchor: "top", dy: 30, tickFormat: (d) => `${d.getUTCFullYear()}’s`})
]
})
Insert cell
walmarts = ({
type: "FeatureCollection",
features: (await FileAttachment("walmarts.tsv").tsv({typed: true})).map((d) => ({
type: "Feature",
properties: {date: d.date},
geometry: {type: "Point", coordinates: [d.longitude, d.latitude]}
}))
})
Insert cell
us = FileAttachment("us-counties-10m.json").json()
Insert cell
statemesh = topojson.mesh(us, us.objects.states)
Insert cell
nation = topojson.feature(us, us.objects.nation)
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