Show the code
mydata = FileAttachment("WorldBankData.csv").csv({ typed: true })Andy Grogan-Kaylor
October 10, 2026
Using Observable JavaScript in Quarto, I have worked to build an example motion chart of the World Bank Data similar to those in this example.
Plot.plot({
grid: true,
color: {legend: false},
symbol: {legend: true},
x: { type: "log" },
marks: [
Plot.dot(mydata.filter(mydata=> mydata.year === YEAR),
{x: "GDP",
y: "life_expectancy",
fill: "region",
r: "population",
channels: {name: "country", year: "year"},
tip: true}),
Plot.linearRegressionY(mydata.filter(mydata=> mydata.year === YEAR),
{ x: "GDP", y: "life_expectancy", stroke: "red" })
]
})