Public
Edited
Nov 5
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plotLines = selection.map((country) =>
Plot.lineY(filteredData, {
x: "Year",
y: firstDataColumn,
stroke: "Entity"
})
)
Insert cell
selection = metadata.chart.selection
Insert cell
yAxisLabel = metadata.columns[firstDataColumn].titleShort
Insert cell
firstDataColumn = Object.keys(metadata.columns)[0]
Insert cell
metadata = fetch(
"https://ourworldindata.org/grapher/life-expectancy.metadata.json?useColumnShortNames=true"
).then((response) => response.json())
Insert cell
filteredData = data
.params({ selection })
.filter((d) => aq.op.includes(selection, d.Entity))
Insert cell
data = aq.loadCSV(
"https://ourworldindata.org/grapher/life-expectancy.csv?useColumnShortNames=true"
)
Insert cell
import { removeMarkdownLinks } from "@owid/api"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more