Platform
Resources
Pricing
Sign in
Get started
Gapminder
Workspace
Fork
Public
By
Angie Hjort
Edited
Jun 15, 2023
Insert cell
Insert cell
Insert cell
Insert cell
data
=
read
(
"https://docs.google.com/spreadsheets/d/1i9qlua8afjJRmwwtkTfD8p5ole7im87NckpmOJFgZHg/edit#gid=1171100423"
,
"output1"
)
Insert cell
Insert cell
import
{
aq
,
op
}
from
"@uwdata/arquero"
Insert cell
Insert cell
folded
=
aq
.
from
(
data
)
.
fold
(
aq
.
not
(
"year"
,
""
)
)
.
objects
(
)
Insert cell
Insert cell
refugeePopulationByOriginYear
=
folded
.
map
(
m
=>
(
{
year
:
new
Date
(
m
.
year
)
,
origin
:
m
.
key
.
replace
(
"SUM of "
,
""
)
,
population
:
+
m
.
value
}
)
)
Insert cell
refugeePopulationByOriginYear
Clear All
Swap X/Y
Customize
X
year
Y
population
Color
origin
Size
—
Facet X
—
Facet Y
—
Mark
area
Type Chart, then Shift-Enter. Ctrl-space for more options.
Insert cell
refugeePopulationByOriginYear
Clear All
Swap X/Y
Customize
X
year
Y
population
Color
origin
Size
population
Facet X
—
Facet Y
origin
Mark
area
Type Chart, then Shift-Enter. Ctrl-space for more options.
Insert cell
import
{
AreaChartWithDifferentFacetHeight
}
from
"@angiehjort/area-chart-with-different-facet-height"
Insert cell
Insert cell
AreaChartWithDifferentFacetHeight
(
refugeePopulationByOriginYear
,
{
x
:
d
=>
d
.
year
,
y
:
d
=>
d
.
population
,
z
:
d
=>
d
.
origin
,
padding
:
20
,
marginBottom
:
30
,
curve
:
d3
.
curveBasis
,
width
:
width
,
height
:
1600
,
strokeColor
:
"#fff"
}
)
Insert cell
import
{
HorizonChart
}
from
"@angiehjort/horizon-chart"
Insert cell
Insert cell
Insert cell
Insert cell
chart
=
HorizonChart
(
refugeePopulationByOriginYear
,
{
x
:
d
=>
d
.
year
,
y
:
d
=>
d
.
population
,
z
:
d
=>
d
.
origin
,
marginTop
:
25
,
bands
,
width
,
size
:
30
,
curve
:
d3
.
curveBasis
,
scheme
,
bottomLineColor
:
"#444"
}
)
Insert cell
width
=
1000
;
Insert cell
html`
<
style
type
=
"text/css"
>
.
horizon
text
{
font-size
:
16
px
}
</
style
>
`
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
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
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
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
table
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
folded
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
refugeePopulationByOriginYear
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
refugeePopulationByOriginYear
File attachments
Customize
Clear
Title
Subtitle
Caption
Height
Width
Auto
Full
Margin
Top
Right
Bottom
Left
Inset
Legend
Auto
None
X label
X scale
Auto
Scale
Auto
linear
log
sqrt
symlog
point
band
X options
Grid
Reverse
Y label
Y scale
Auto
Scale
Auto
linear
log
sqrt
symlog
point
band
Y options
Grid
Reverse
Color scheme
Auto
Color scheme
Auto
Default color schemes
Sequential
Diverging
Cyclical
Categorical
Sequential color schemes
Blues
Greens
Greys
Oranges
Purples
Reds
Turbo
Viridis
Inferno
Magma
Plasma
Cividis
Warm
Cool
BuGn
BuPu
GnBu
OrRd
PuBuGn
PuBu
PuRd
RdPu
YlGnBu
YlGn
YlOrBr
YlOrRd
Diverging color schemes
BrBG
PRGn
PiYG
PuOr
RdBu
RdGy
RdYlBu
RdYlGn
Spectral
Cyclical color schemes
Sinebow
Turbo
Categorical color schemes
Category10
Accent
Dark2
Paired
Pastel1
Pastel2
Set1
Set2
Set3
Tableau10
Color scale
Auto
Scale
Auto
linear
log
sqrt
symlog
categorical
ordinal
Color options
Reverse
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Field
—
Field
—
Mark
Auto
bar
dot
line
area
rule
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
refugeePopulationByOriginYear
File attachments
Customize
Clear
Title
Subtitle
Caption
Height
Width
Auto
Full
Margin
Top
Right
Bottom
Left
Inset
Legend
Auto
None
X label
X scale
Auto
Scale
Auto
linear
log
sqrt
symlog
point
band
X options
Grid
Reverse
Y label
Y scale
Auto
Scale
Auto
linear
log
sqrt
symlog
point
band
Y options
Grid
Reverse
Color scheme
Auto
Color scheme
Auto
Default color schemes
Sequential
Diverging
Cyclical
Categorical
Sequential color schemes
Blues
Greens
Greys
Oranges
Purples
Reds
Turbo
Viridis
Inferno
Magma
Plasma
Cividis
Warm
Cool
BuGn
BuPu
GnBu
OrRd
PuBuGn
PuBu
PuRd
RdPu
YlGnBu
YlGn
YlOrBr
YlOrRd
Diverging color schemes
BrBG
PRGn
PiYG
PuOr
RdBu
RdGy
RdYlBu
RdYlGn
Spectral
Cyclical color schemes
Sinebow
Turbo
Categorical color schemes
Category10
Accent
Dark2
Paired
Pastel1
Pastel2
Set1
Set2
Set3
Tableau10
Color scale
Auto
Scale
Auto
linear
log
sqrt
symlog
categorical
ordinal
Color options
Reverse
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Reducer
—
Auto
—
count
distinct
sum
min
max
mean
median
mode
Field
—
Field
—
Field
—
Mark
Auto
bar
dot
line
area
rule
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
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bands
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
scheme
Edit
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
chart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
width
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML