Public
Edited
Dec 15
1 fork
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bivariateMap = eurostatmap
.map("chbi")
.width(width / 1.3)
.svgId("bivariate")
.title("Unemployment and population density")
.subtitle(
"% share of unemployed persons aged 20-64 years & inhabitants per km²"
)
.titleFontSize(24)
.subtitleFontSize(16)
.nutsLvl(1)
.nutsYear(2016)
.stat("v1", { eurostatDatasetCode: "demo_r_d3dens", unitText: "inh./km²" })
.stat("v2", {
eurostatDatasetCode: "lfst_r_lfu3rt",
filters: { age: "Y20-64", sex: "T", unit: "PC", time: 2019 },
unitText: "% unemployed"
})

.classToFillStyle((i, j) => {
if (i == 0 && j == 2) return colors[6];
if (i == 1 && j == 2) return colors[7];
if (i == 2 && j == 2) return colors[8];

if (i == 0 && j == 1) return colors[3];
if (i == 1 && j == 1) return colors[4];
if (i == 2 && j == 1) return colors[5];

if (i == 0 && j == 0) return colors[0];
if (i == 1 && j == 0) return colors[1];
if (i == 2 && j == 0) return colors[2];
return "gray";
})
// .startColor("#e8e8e8")
// .color1("#be64ac")
// .color2("#5ac8c8")
Insert cell
Insert cell
schemes = [
{
name: "BuPu",
colors: [
"#e8e8e8",
"#ace4e4",
"#5ac8c8",
"#dfb0d6",
"#a5add3",
"#5698b9",
"#be64ac",
"#8c62aa",
"#3b4994"
]
},
{
name: "CH01M03 - PalA",
colors: [
"#17256B",
"#2644A7",
"#738CE5",
"#9CC1FA",
"#FF8080",
"#EFD18C",
"#C6AF5D",
"#B09120",
"#866110"
]
},
{
name: "CH02M03 - PalB",
colors: [
"#E9E9E9",
"#91B8E1",
"#388AE2",
"#CDA0D0",
Insert cell
eurostatmap = require("eurostat-map@3.6.40")
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