Public
Edited
Nov 5, 2024
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

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