Public
Edited
Jun 1, 2023
Fork of Trials
Insert cell
Insert cell
migration-flows.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
geo = require("geotoolbox@latest")
Insert cell
migration-flows.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
newworld = migrationFlows.filter((d) => d.Country == "Russia")
Insert cell
import {slider} from "@jashkenas/inputs"
Insert cell
viewof year = slider({
min: 1990,
max: 2020,
value: 2014,
step: 1,
title: "Year"
})
Insert cell
viewof year1 = Inputs.range([1990, 2020], {label:"year", step: 5})
Insert cell
// res = migrationFlows.filter((migrationFlows) => (migrationFlows.Year == year1) &&
// (migrationFlows.Country == 'Russia'))
Insert cell
res = migrationFlows.filter((migrationFlows) => (migrationFlows.Year == year1)&&
(migrationFlows['Emigrants from Russia'] > 100000)
)
Insert cell
Plot.plot(
{marks: [
Plot.barY(res, {x: 'Country', y: 'Emigrants from Russia', fill: 'steelblue'}),
Plot.ruleY([0])
]
}
)
Insert cell
res1 = migrationFlows.filter((migrationFlows) => (migrationFlows.Year == year1)&&
(migrationFlows['Immigrants to Russia'] > 0)
)

Insert cell
Plot.plot(
{marks: [
Plot.barY(res1, {x: 'Country', y: 'Immigrants to Russia', fill: 'steelblue'}),
Plot.ruleY([0])
]
}
)
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