Public
Edited
Jul 4, 2023
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
day = days[dayIndex]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
smiWholeAdmin0Daily = d3.tsvParse((await FileAttachment("all_admin-0@6.tsv").text()), d3.autoType).map(parseTsv)
Insert cell
smiWholeAdmin0Monthly = d3.tsvParse((await FileAttachment("all_admin-0@4.tsv").text()), d3.autoType).map(parseTsv)
Insert cell
Insert cell
smiWholeAdmin2Daily = d3.tsvParse((await FileAttachment("all_admin-2@4.tsv").text()), d3.autoType).map(parseTsv)
Insert cell
Insert cell
smiTopAdmin0Daily = d3.tsvParse((await FileAttachment("all_admin-0@2.tsv").text()), d3.autoType).map(parseTsv)
Insert cell
smiWholeAdmin0DailyBins = expandBins(smiWholeAdmin0Daily)
Insert cell
smiTopAdmin0DailyBins = expandBins(smiTopAdmin0Daily)
Insert cell
smiTopAdmin2Daily = d3.tsvParse((await FileAttachment("all_admin-2@2.tsv").text()), d3.autoType).map(parseTsv)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
parseTsv = (row) => ({...row, year: row.time.getFullYear(), bins: JSON.parse(row.bins)})
Insert cell
expandBins = (rows) => rows.reduce((memo, d) => ([...memo, ...d.bins.map((value, bin) => ({id: d.id, time: d.time, year: d.year, value, bin: smiCategories[bin]}))]), [])
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