{
let values = new Map(choropleth_data.objects().map(({ags, rate}) => [ags, rate]))
return Plot.plot({
projection: {
type: "mercator",
domain: choropleth_regions
},
marks: [
Plot.geo(choropleth_regions, {
fill: (d) => values.get(d.properties['AGS']),
}),
Plot.geo(choropleth_regions, {
stroke: 'grey',
strokeWidth: 0.5
})
],
color: {
scheme: "blues",
type: "linear",
legend: true,
label: "Studierende pro 10.000 Einwohner"
}
})
}