Public
Edited
Sep 29, 2022
1 fork
1 star
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
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
euCountryMigrants = fluxMigrants.sort((a, b) => b.EU_27 - a.EU_27).slice(0, 25)
Insert cell
schengenCountryMigrants = fluxMigrants.filter((d) => d.EU_Schengen)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

/*viewof select_année = radio({
options: ['2015', '2019'],
description: 'Sélectionner l\année de la source de données',
value: '2015'
})

/*/

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function buildEuropeProjection(scale) {
let _projectionMode = d3.geoConicConformal();
if (mapProjection==="Azimuthale") _projectionMode = d3.geoOrthographic().scale(scale * 1.2).center([0, 52]);
if (mapProjection==="Conique") _projectionMode = d3.geoConicConformal().parallels([32, 65]).scale(scale * 1).center([0,55]);
if (mapProjection==="Cylindrique") _projectionMode = d3.geoMercator().scale(scale * 0.55).center([0, 58]);
if (mapProjection==="Equal Earth") _projectionMode = d3.geoEqualEarth().scale(scale * 1.2).center([-7, 52]);
return _projectionMode;
}
Insert cell
function buildEMEAProjection(scale) {
let _projectionMode = d3.geoConicConformal();
if (mapProjection==="Azimuthale") _projectionMode = d3.geoOrthographic().scale(scale * 1.4).center([10, 45]);
if (mapProjection==="Conique") _projectionMode = d3.geoConicConformal().scale(scale * 1.7).center([15,45]);;
if (mapProjection==="Cylindrique") _projectionMode = d3.geoMercator().scale(scale * 1.3).center([10, 46]);
if (mapProjection==="Equal Earth") _projectionMode = d3.geoEqualEarth().scale(scale * 1.6).center([10, 42]);;
return _projectionMode;
}
Insert cell
Insert cell
Insert cell
Insert cell
nbMaxRéfugiés = function (inSchengen) {
let countryLabels = fluxMigrants;
if (inSchengen) {
countryLabels = fluxMigrants.sort((a, b) => b.EU_27 - a.EU_27).slice(0, 16);
}
return d3.max(countryLabels, (d) => +d["Nombre de migrants"]);
}
Insert cell
nbMaxRéfugiés(false);

Insert cell
nbMaxRéfugiés(true)
Insert cell
roundLog10 = function (value) {
return Math.pow(10, Math.ceil(Math.log10(value)));
}
Insert cell
roundLog10(1024)
Insert cell
roundMostSignificant = function (value) {
const ceilLog10 = Math.pow(10, Math.floor(Math.log10(value)));
return ceilLog10 * Math.ceil(value / ceilLog10);
}
Insert cell
roundMostSignificant(1234)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { colorOpacity } from "@mootari/color-opacity"
Insert cell
import { mode } from "@d3/dark-mode"
Insert cell
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