Published
Edited
Jun 19, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
zoomVar = 1
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
map.update(mergeData(data_day_cases.filter(x => x.key == date)[0].values))
Insert cell
Insert cell
// returns the name of the country by code
nameByID = y =>
countries.filter(x => x.code == y)[0] != null
? countries.filter(x => x.code == y)[0].name
: ""
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
mergeData = arr_data => {
let arr = [];
for (let el of arr_data) {
let val = {
key: el.key,
cases: el.values[0].cases,
deaths: el.values[0].deaths
};
arr.push(val);
}
return arr;
}
Insert cell
data_day_cases = d3
.nest()
.key(function(d) {
return d.dateRep;
})
.key(function(d) {
return d.countriesAndTerritories;
})
.entries(filedata)
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

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