Public
Edited
May 9, 2023
3 forks
Importers
2 stars
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: "albers-usa",
marks: [
Plot.geo(statemesh, {strokeOpacity: 0.4}),
Plot.dot(counties, Plot.geoCentroid({
r: (d) => d.properties.population,
fill: "currentColor",
stroke: "white",
strokeWidth: 1,
sort: sorted
? {channel: "r", order: "descending"} // explicitly sort “by descending radius”, which is the default
: null // draw points in input order
}))
]
})
Insert cell
Insert cell
us = FileAttachment("us-counties-10m.json").json()
Insert cell
statemesh = topojson.mesh(us, us.objects.states)
Insert cell
Insert cell
counties = {
const counties = topojson.feature(us, us.objects.counties);
const pop = await FileAttachment("us-county-population.csv").csv();
const map = new Map(pop.map((d) => [`${d.state}${d.county}`, +d.population]));
counties.features.forEach((g) => {
g.properties.population = map.get(g.id);
});
return counties.features;
}
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