Published
Edited
Apr 27, 2020
47 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
polylines = topojson.feature(usMap, usMap.objects.counties).features
.filter(d => !isNaN(path.centroid(d)[1]))
.sort((a,b) => path.centroid(a)[1] - path.centroid(b)[1])
Insert cell
index = new Map(confirmedUSLatest.map(d => [d.fips, d]))
Insert cell
nation = topojson.feature(usMap, "nation")
Insert cell
countiesMesh = topojson.mesh(usMap, usMap.objects.counties, (a, b) => a !== b)
Insert cell
statesMesh = topojson.mesh(usMap, usMap.objects.states, (a, b) => a !== b)
Insert cell
counties = topojson.feature(usMap, usMap.objects.counties).features
Insert cell
async function drawUSMap(svg) {
svg
.append("path")
.datum(nation)
.attr("fill", "#f3f3f3")
.attr("d", path);

svg
.append("path")
.datum(countiesMesh)
.attr("fill", "none")
.attr("stroke", '#e6e6e6')
.attr("stroke-width", .5)
.attr("stroke-linejoin", "round")
.attr("d", path);

svg
.append("path")
.datum(statesMesh)
.attr("fill", "none")
.attr("stroke", '#bdbdbd')
.attr("stroke-width", .5)
.attr("stroke-linejoin", "round")
.attr("d", path);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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