Public
Edited
Jan 21
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
turkey = {
let map = eurostatmap
.map("ch")
.stat({
eurostatDatasetCode: "demo_r_d3dens",
unitText: "people/km²",
filters: { time: 2021 }
})
.projectionFunction(projection)
.svgId("turkey")
.nutsLvl(2)
.width(width)
.height(height)
.scale("03M")
.pixSize(0.021) //zoom level
.geoCenter([showSurrounding ? 35.5 : 38.5, 38])
.labelling(true)
.labelsToShow(["countries", "values"])
.labelShadow(true)
.labelShadowWidth({ seas: 3, countries: 3, cc: 3, values: 3 })
.labelsConfig(labels)
.cntrgFillStyle("none")
.bordersToShow(["eu", "efta", "cc", "oth", "co"])
.cntbnStroke({ oth: "grey", co: "grey" })
.cntbnStrokeWidth({ oth: 1 });

if (!showSurrounding) {
map.countriesToShow(["TR"]).bordersToShow(["TR"]);
}

return map.build();
}
Insert cell
Insert cell
projection = d3.geoMercator()
Insert cell
Insert cell
Insert cell
d3 = require("d3-array@2", "d3-geo@2", "d3-geo-projection@3", "d3-geo-polygon@1.8", "d3-scale-chromatic")
Insert cell
eurostatmap = require("eurostat-map@3.6.45")
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