Public
Edited
Apr 7
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
us = d3.json("https://cdn.jsdelivr.net/npm/us-atlas@3/counties-10m.json")
Insert cell
states = topojson.feature(us, us.objects.states)
Insert cell
nation = topojson.feature(us, us.objects.nation)
Insert cell
Insert cell
Plot.plot({
projection: "albers-usa",
marks: [Plot.geo(states, { strokeOpacity: 0.4 })]
})
Insert cell
Insert cell
nhgis0001_ds12_1850_state.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
nhgis0001_ds12_1850_state_codebook = FileAttachment("nhgis0001_ds12_1850_state_codebook.txt").text()
Insert cell
Insert cell
freeblackpop1850Lookup = {
const k = "STATE";
const v = "AGN004";
return new Map(freeblackpop1850.map((x) => [x[k], +x[v]]));
}
Insert cell
Insert cell
freeblackpop1850Lookup.get("Virginia")
Insert cell
Plot.plot({
projection: "albers-usa",
color: {
type: "sequential",
scheme: "OrRd",
legend: true
},
title: "Free Black Population in 1850",
marks: [
Plot.geo(states, {
fill: (d) => freeblackpop1850Lookup.get(d.properties.name),
stroke: "lightgray"
}),
Plot.geo(nation, { stroke: "black" })
]
})
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