map = Plot.plot({
projection: "albers-usa",
width: 900,
color: {
type: "quantile",
scheme: "blues",
label: "Density (population per square mile)",
tickFormat: Math.round,
legend: true
},
marks: [
Plot.geo(stateShapes, {
stroke: "black",
fill: (s) => state_to_density.get(s.properties.name),
title: (s) =>
`${s.properties.name}: ${state_to_density.get(s.properties.name)}`
})
]
})