bertin.draw({
params: { projection: d3.geoAlbers(), extent: states, margin: 30 },
layers: [
{
type: "header",
text: "Where do people live in the United States?",
background: "#6a82a8",
fill: "white",
fontSize: 30
},
{
type: "text",
position: "bottomright",
fontSize: 11,
text: `Nicolas Lambert, 2022
Source: United States Census Bureau, 2022`,
fill: "#6a82a8"
},
{
type: "dotdensity",
values: "pop2019",
dotvalue: 75000,
symbol_size: 12,
geojson: usa,
leg_title: "Population in the\nUnited States, 2019",
leg_x: 590,
leg_y: 570,
fill: "red",
symbol_shift: overlap ? 1 : 0,
tooltip: ["$NAME", "$pop2019", "inh."]
},
{
geojson: states,
fill: "#e3d48a",
strokeWidth: 1,
stroke: "white"
},
{ type: "shadow", geojson: states },
{
type: "layer",
geojson: world,
fill: "white",
fillOpacity: 0.3
},
{ type: "graticule" },
{ type: "outline" },
{
type: "scalebar"
}
]
})