Published
Edited
Jun 5, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md `Quelle der Karte: https://ld.geo.admin.ch/sparql/# (Linked Data, danke für die Hilfe mit der Query, @p1d1d1)`
Insert cell
Insert cell
Insert cell
nestedDataKt = d3
.nest(data)
.key(d => d.abbreviation_canton_and_fl)
.entries(data)
Insert cell
Insert cell
endPoint = "https://ld.geo.admin.ch/query"
Insert cell
Insert cell
mappinkCtBfs = d3.csv('https://raw.githubusercontent.com/openZH/covid_19/master/mappingCanton_BFS.csv');
Insert cell
Insert cell
Insert cell
maxDatePerCt = maxDateCt()
Insert cell
function maxDateCt() {
let maxDatePerCt = [];
for (let i=0;i<nestedDataKt.length;i++) {
let maxCtObj = {};
maxCtObj.key = nestedDataKt[i].key;
maxCtObj.maxDate = d3.max(nestedDataKt[i].values, d => d.date);
maxDatePerCt.push(maxCtObj);
}
return maxDatePerCt;
}
Insert cell
maxTestedPosPerCapita = d3.max(mapData, d => +d.properties.tested_posPerCapita)
Insert cell
colorScale = d3.scaleLinear()
.domain([0,maxTestedPosPerCapita])
.range(['steelblue','tomato'])
.interpolate(d3.interpolateLab)
Insert cell
Insert cell
Insert cell
Insert cell
maxAktCanton_testedPos = d3.max(
dataCantonMax.abbreviation_canton_and_fl,
function(d) {
if (d.abbreviation_canton_and_fl != "CH") {
return +d.tested_pos;
}
}
)
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

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