Published
Edited
Aug 19, 2022
4 forks
16 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
deaths.filter(d => d.DEATHS === 0)
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
projections = {
return {
Mon: [0, 0.43, 0.96, 0.98, 0.98],
Tue: [0, 0.50, 0.96, 0.99, 0.98],
Wed: [0, 0.49, 0.96, 0.99, 0.98],
Thu: [0, 0.50, 0.96, 0.98, 0.98],
Fri: [0, 0.49, 0.94, 0.97, 0.98],
Sat: [0, 0.50, 0.94, 0.98, 0.98],
Sun: [0, 0.45, 0.99, 0.99, 0.99]
};
}
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
percent = {
const p = projected_cases.filter(c => c.PROVINCE === "België").filter(d => d.DATE > "2021-08-01").filter(d => d.DATE < d_1);
const result = [];
for (let i = 7; i < p.length; i++) {
const t = Object.assign({}, p[i]);
//if (t.DATE === "2021-11-27") t.CASES = 11539;
//if (t.DATE === "2021-11-28") t.CASES = 7024;
//if (t.DATE === "2021-11-29") t.CASES = 26000;
t.RATIO = t.CASES / p[i-7].CASES;
t.DAY = d3.timeFormat("%A")(new Date(t.DATE));
t.WEEKEND = t.DAY === "Saturday" || t.DAY === "Sunday";
result.push(t);
}
return result;
}
Insert cell
vl.markCircle()
.encode(
vl.x().fieldT("DATE").title(false),
vl.y().fieldQ("RATIO").scale({domainMax: 3}).axis({format: "%"}).title(false),
vl.color().field("WEEKEND").legend(false)
)
.title("Procentueel verschil dagcijfers, week over week")
.data(
percent
.filter(d => d.DATE !== "2021-11-01")
.filter(d => d.DATE !== "2021-11-11")
.filter(d => d.DATE !== "2021-11-08")
.filter(d => d.DATE !== "2021-11-18")
)
.render()
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