Public
Edited
Mar 7
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
map = {
const map = eurostatmap
.map("choropleth")
.title("Grid cartogram")
.subtitle("test")
.stat({
eurostatDatasetCode: "nama_10r_3gdp",
unitText: "euro per inhabitant",
filters: { TIME: "2021", UNIT: "EUR_HAB" }
})
.gridCartogram(true)
.gridCartogramShape("hexagon")
.gridCartogramCellPadding(8)
//.gridCartogramMargins(110)
.gridCartogramPositions(
`
,IS, , , ,NO,SE,FI, , , , ,
, , , , , , , ,EE, , , ,
, , , , , , , ,LV, , , ,
,IE,UK, , ,DK, ,LT, , , , ,
, , , ,NL,DE,PL, , , , , ,
, , ,BE,LU,CZ,SK,UA, , , , ,
, ,FR,CH,LI,AT,HU,RO,MD, , , ,
,PT,ES, ,IT,SI,HR,RS,BG, , , ,
, , , , , ,BA,ME,MK, , , ,
, , , , , , ,AL,EL,TR, , ,
, , , ,MT, , , , ,CY, , , `
)
.numberOfClasses(6)
.nutsLevel(0)
.legend({ x: 10, y: 120, title: "Test", boxOpacity: 0, barChart: false })
.build();
}
Insert cell
eurostatmap = require("eurostat-map@4.1.30")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function grid() {
const positionById = new Map;
d3.csvParseRows(String.raw.apply(String, arguments).replace(/^\n|\n$/g, ""), (row, j) => {
row.forEach((id, i) => {
if (id = id.trim()) {
positionById.set(id, [i, j]);
}
});
});
return positionById;
}
Insert cell
gridWidth = d3.max(position, ([, [i]]) => i) + 1
Insert cell
gridHeight = d3.max(position, ([, [, j]]) => j) + 1
Insert cell
Insert cell
Insert cell
import {select} from "@jashkenas/inputs"
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