Public
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
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
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: 16px
}

</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.
Learn more