Public
Edited
Oct 27, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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
})
)
]
})
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