Public
Edited
Jan 8
Paused
7 forks
34 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
interpolatePalette = (colors) => {
return (t) =>
d3.piecewise(d3.interpolateLab, colors)(Math.min(Math.max(0, t), 1));
}
Insert cell
// Helper function to convert hex color to RGB
function hexToRgb(hex) {
let bigint = parseInt(hex.replace("#", ""), 16);
return [(bigint >> 16) & 255, (bigint >> 8) & 255, bigint & 255];
}
Insert cell
// Helper function to calculate relative luminance
function relativeLuminance([r, g, b]) {
[r, g, b] = [r, g, b].map((v) => {
v /= 255;
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
});
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
}
Insert cell
// Helper function to calculate contrast ratio
function contrastRatio(luminance1, luminance2) {
let lighter = Math.max(luminance1, luminance2);
let darker = Math.min(luminance1, luminance2);
return (lighter + 0.05) / (darker + 0.05);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
eurostatmap = require("eurostat-map")
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more