Public
Edited
Jul 29, 2022
Importers
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
({icu: icu_csv[580], episari: episari_subset_csv[32]})
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
date_to_iso = d3.timeFormat("%Y-%m-%d");
Insert cell
Plot = require("@observablehq/plot@0.1.0/dist/plot.umd.min.js")
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
age_colors = {
const arr = ['#FFEEBA','#FFDA6B','#E9B825','#AEEFDB','#52C4A2','#33AB87','#189A73','#F4B2E0','#D559B0','#B01C83'].map(c => d3.hsl(c).darker(2).formatHex());
const ret = {};
arr.forEach((a, i) => ret[age_classes[i]] = a);
return ret;
}
Insert cell
Insert cell
episari_counts_15_34 = episari_counts.filter(a => a.age == '15-24' || a.age == '25-34')
Insert cell
Reducers = ({sum: 'sum', count: 'count', proportion: 'proportion'});
Insert cell
Plot.groupX({y: "count"}, {x: "date_to", fill: "sex"})
Insert cell
Insert cell
function number_or_nan(a) {
return (a || a===0) ? a : NaN;
}
Insert cell
function array_to_lookup(arr, keyFun, valFun = (a => a)) {
const ret = {};
arr.forEach(a => {
ret[keyFun(a)] = valFun(a)
})
return ret;
}
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