Plot.carto({
projection: d3.geoAlbersUsa(),
r: { domain: [30000, 1e5], type: "log" },
color: { type: "log", scheme: "rdbu" },
marks: [
Plot.feature(topojson.feature(us, us.objects.nation)),
Plot.feature(topojson.feature(us, us.objects.counties), {
strokeWidth: 0.15
}),
Plot.feature(topojson.feature(us, us.objects.states), { strokeWidth: 0.5 }),
Plot.points(largeCities.filter(d => d.country === "United States"), {
lonLat: d => [d.lng, d.lat],
fill: "population",
fillOpacity: 0.7,
title: "city",
r: "population"
})
],
width,
height: width * 0.5,
marginLeft: 0,
marginRight: 0,
marginTop: 0,
marginBottom: 0
})