Platform
Resources
Pricing
Sign in
Get started
Jon E. Froehlich
UW CS Professor in HCI. Director of the Makeability Lab. Co-founder of Project Sidewalk.
Workspace
Fork
Public
By
Jon E. Froehlich
Edited
May 5, 2023
1
Insert cell
Insert cell
Insert cell
socialDevelopmentFile
=
FileAttachment
(
"social-development-wrangled@1.csv"
)
Insert cell
sdData
=
socialDevelopmentFile
.
csv
(
{
typed
:
true
}
)
.
then
(
(
data
)
=>
data
.
map
(
(
d
)
=>
(
{
...
d
,
Year
:
new
Date
(
d
.
Year
,
0
)
}
)
)
)
// this correctly parses the dates
Insert cell
Insert cell
printTableTypes
(
sdData
)
Insert cell
Insert cell
plot
=
vl
.
markLine
(
)
.
data
(
sdData
)
.
transform
(
vl
.
filter
(
'datum.country_code == "USA"'
)
)
.
encode
(
vl
.
x
(
)
.
fieldT
(
'Year'
)
.
timeUnit
(
'year'
)
,
vl
.
y
(
)
.
fieldQ
(
'average_adolescent_fertility_rate'
)
)
.
width
(
800
)
Insert cell
printVegaLiteJSON
(
plot
)
Insert cell
plot2
=
vl
.
markLine
(
)
.
data
(
sdData
)
.
transform
(
vl
.
filter
(
'datum.country_code == "USA"'
)
)
.
encode
(
vl
.
x
(
)
.
fieldN
(
'Year'
)
,
vl
.
y
(
)
.
fieldQ
(
'average_adolescent_fertility_rate'
)
)
.
width
(
800
)
Insert cell
Insert cell
plot
.
render
(
)
Insert cell
plot2
.
render
(
)
Insert cell
Insert cell
import
{
vl
}
from
'@vega/vega-lite-api-v5'
Insert cell
import
{
printTable
}
from
'@jonfroehlich/data-utilities'
Insert cell
import
{
printTableTypes
}
from
'@jonfroehlich/data-utilities'
Insert cell
import
{
printVegaLiteJSON
}
from
"@jonfroehlich/vega-lite-utilities"
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
socialDevelopmentFile
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sdData
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plot
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plot2
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML