Published
Edited
Apr 10, 2022
2 stars
Also listed in…
Map of Japan
Insert cell
Insert cell
Insert cell
Insert cell
getDataOfDate = (date) =>
data.filter((d) => d.date.getTime() === date.getTime())
Insert cell
d3.group(data, (d) => d.pref)
Insert cell
data.slice(-1)
Insert cell
dates = [...d3.group(data, (d) => d.date).keys()]
Insert cell
data = (await d3.csv(uri, d3.autoType)).map((d) => ({
date: new Date(d.日付),
pref: d.都道府県名.replace(/[都府県]$/, ""),
cases: d.各地の感染者数_1日ごとの発表数,
deaths: d.各地の死者数_1日ごとの発表数,
movingAvg: d.各地の直近1週間の人口10万人あたりの感染者数 || 0,
...d
}))
// .filter((d) => d.日付 === "2021/5/10")
Insert cell
uri = `https://www3.nhk.or.jp/n-data/opendata/coronavirus/nhk_news_covid19_prefectures_daily_data.csv`
Insert cell
exampleData = japan.map((d) => ({
value: Math.random() * 100,
...d
}))
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