map = {
let m = eurostatmap
.map("choropleth")
.stat({
eurostatDatasetCode: "demo_r_d3dens",
unitText: "people/km²",
filters: { time: 2021 }
})
.nutsLevel(3)
.width(800)
.height(700)
.scale("03M")
.colorFun(d3.interpolateOranges)
.classificationMethod("threshold")
.threshold([800, 600, 400, 200, 100, 50].reverse())
.position({
x: countryConfigs[country].geoCenter[0],
y: countryConfigs[country].geoCenter[1],
z: countryConfigs[country].pixSize
})
.legend({
title: "Inhabitants per km²",
labelFormat: d3.format(".1"),
titleFontSize: 13,
x: countryConfigs[country].legendX,
y: countryConfigs[country].legendY
});
if (countryConfigs[country].insets) {
m.insets(countryConfigs[country].insets).insetBoxPosition(
countryConfigs[country].insetBoxPosition
);
}
if (countryConfigs[country].labels) {
m.labels({ labels: countryConfigs[country].labels, shadows: true });
}
if (!showSurrounding) {
m.countriesToShow([countryConfigs[country].countryId]);
}
m.build();
return m;
}