Platform
Resources
Pricing
Sign in
Get started
Visnu Pitiyanuvath
Workspace
Fork
Published
Covid
By
Visnu Pitiyanuvath
Edited
Nov 3, 2021
Importers
5 stars
Covid
San Francisco COVID-19 Data
COVID-19 cases vs. deaths (US)
Restaurants during COVID-19 social distancing
San Francisco COVID-19 Dashboard
Loki’s Schedule
Insert cell
Insert cell
Insert cell
cases
=
d3
.
csv
(
'https://data.sfgov.org/resource/gyr2-k29z.csv?$limit=5000'
,
d3
.
autoType
)
Insert cell
Insert cell
Insert cell
deaths
=
d3
.
csv
(
'https://data.sfgov.org/resource/g2di-xufg.csv?$limit=5000'
,
d3
.
autoType
)
Insert cell
Insert cell
Insert cell
Insert cell
tests
=
d3
.
csv
(
'https://data.sfgov.org/resource/nfpa-mg4g.csv?$limit=5000'
,
d3
.
autoType
)
Insert cell
Insert cell
testsTidy
=
tests
.
flatMap
(
(
{
specimen_collection_date
,
pct
,
tests
,
last_updated_at
,
data_loaded_at
,
...
rest
}
)
=>
{
return
Object
.
entries
(
rest
)
.
map
(
(
[
result
,
specimens
]
)
=>
(
{
specimen_collection_date
,
result
,
specimens
:
+
specimens
}
)
)
}
)
Insert cell
Insert cell
Insert cell
Insert cell
hospitalizations
=
d3
.
csv
(
'https://data.sfgov.org/resource/nxjg-bhem.csv?$limit=5000'
,
d3
.
autoType
)
Insert cell
Insert cell
Insert cell
Insert cell
vaccinations
=
d3
.
csv
(
'https://data.sfgov.org/resource/bqge-2y7k.csv?$limit=5000'
,
d3
.
autoType
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
domain
=
[
d3
.
min
(
[
d3
.
min
(
cases
,
(
d
)
=>
d
.
specimen_collection_date
)
,
d3
.
min
(
tests
,
(
d
)
=>
d
.
specimen_collection_date
)
,
d3
.
min
(
hospitalizations
,
(
d
)
=>
d
.
reportdate
)
]
)
,
d3
.
timeDay
.
ceil
(
new
Date
(
)
)
]
Insert cell
options
=
(
{
width
,
height
:
Math
.
min
(
width
/
1.8
,
250
)
,
y
:
{
axis
:
"right"
}
,
x
:
{
domain
,
ticks
:
6
}
,
marginLeft
:
0
,
marginRight
:
50
}
)
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cases
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
deaths
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tests
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
testsTidy
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
hospitalizations
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
vaccinations
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
domain
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
options
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML