Public
Edited
Feb 25, 2024
4 forks
1 star
Insert cell
Insert cell
Plot.plot({
projection: "albers-usa",
marks: [
Plot.geo(countymesh, {strokeWidth: 0.1}),
Plot.geo(statemesh, {strokeWidth: 0.5}),
Plot.dot(
counties,
Plot.centroid({
filter: (d) => d.properties.name.match(/^V/),
fill: "currentColor",
stroke: "white"
})
),
Plot.text(
counties,
Plot.centroid({
filter: (d) => d.properties.name.match(/^V/),
text: (d) => d.properties.name,
fill: "currentColor",
stroke: "white",
textAnchor: "start",
dx: 6
})
)
]
})
Insert cell
us = FileAttachment("us-counties-10m.json").json()
Insert cell
counties = topojson.feature(us, us.objects.counties).features
Insert cell
countymesh = topojson.mesh(us, us.objects.counties)
Insert cell
statemesh = topojson.mesh(us, us.objects.states)
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