map = {
const m = eurostatmap
.map("choropleth")
.width(width)
.height(height)
.title("Custom geometries test")
.subtitle("Unemployment rate, municipality level, 2023")
.geometries([
{
id: "regions",
class: "regions",
statisticalRegions: true,
features: municipalGeometries.features
},
{
id: "borders",
features: borderGeometries.features,
class: "borders"
}
])
.classificationMethod("threshold")
.thresholds([1, 3, 4, 5, 6, 7, 8, 9])
.colorFunction(d3.interpolateYlGnBu)
.zoomExtent([1, 10])
.projectionFunction(projection)
.legend({
title: "Unemployment %",
x: 5,
y: 180,
boxOpacity: 0.8,
decimals: 0
})
.footnote(
'Source: <a href="https://datos.gob.es/en/catalogo/ea0021425-paro-registrado-por-municipios">datos.gob.es</a>'
)
.insetBoxPosition([5, 490])
.insets([
{
projectionFunction: canariesProjection,
title: "Canarias",
geometries: [
{
id: "canaries",
class: "canaries",
statisticalRegions: true,
features: canariesFeatures
}
],
width: canariesWidth,
height: canariesHeight,
x: 0,
y: 0,
zoomExtent: [1, 10]
},
{
projectionFunction: melillaProjection,
title: "Melilla",
geometries: [
{
id: "melilla",
class: "melilla",
statisticalRegions: true,
features: melillaFeatures
}
],
width: melillaWidth,
height: melillaHeight,
x: 350,
y: 0,
zoomExtent: [1, 10]
}
]);
m.statData().setData(statisticalData);
m.build();
return m;
}