Plot.plot({
width: 1200,
height: 1200,
projection: {
type: "mercator",
domain: torontoCtInCma
},
color: {
n: 10,
type: "sequential",
domain: [0, 10000],
scheme: "PuRd",
label: "Population Density",
legend: true
},
marks: [
Plot.geo(torontoCtInCma, Plot.centroid({
fill: (d) => (d.properties.Population / d.properties.Area),
stroke: "white",
tip: true,
channels: {
ctuid: d => d.properties.ctuid
}
})),
Plot.geo(torontoCsdInCma, Plot.centroid({
stroke: "black"
})
),
Plot.geo(torontoCma, {
stroke: "black",
strokeWidth: 2
}),
Plot.text(
torontoCsdInCma.features,
Plot.centroid({
text: (d) => d.properties.CSDNAME,
fontSize: 12,
fill: "black",
stroke: "white",
frameAnchor: "middle",
dx: 0
})
)
]
})