{
const chart = Plot.plot({
r: { range: [0, 22] },
color: {
scheme: 'Reds',
legend: true,
type: 'quantile',
n: 6,
label: 'Densité de population (hb/km2)',
tickFormat: '.0f',
},
height: 400,
projection: { type: "conic-conformal", domain: quartiersParis },
marks: [
Plot.geo(quartiersParis, {
stroke: 'darkgrey',
fill: 'rgb(244, 244, 244)'
}),
Plot.dot(quartiersParis.features, Plot.centroid({
fill: d => (d.properties.P12_POP / d.properties.surface) * 1000000,
stroke: "black",
r: (d) => d.properties.P12_POP,
tip: true,
channels: {
'Nom': d => d.properties.l_qu,
'Population 2012': d => d.properties.P12_POP,
'Code arrondissement': d => d.properties.c_ar,
}
})),
]
});
return html`<div>
${legendRadius(chart.scale("r"), { ticks: 4, label: "Population 2012" })}
${chart}
</div>`;
}