Public
Edited
Nov 6, 2023
Insert cell
Insert cell
Plot.plot({
style: "overflow: visible;",
y: {grid: true},
marks: [
Plot.ruleY([0]),
Plot.ruleX([1990]),
Plot.lineY(co2, {x: "Year", y: "CO2", stroke: "Symbol", tip:true}),
Plot.text(co2, Plot.selectLast({x: "Year", y: "CO2", z: "Symbol", text: "Symbol", textAnchor: "start", dx: 5}
))
]
})
Insert cell
Insert cell
co2 = [
["US", await FileAttachment("US_Transport@1.csv").csv({typed: true})],
["NZL", await FileAttachment("NewZeland_Transport.csv").csv({typed: true})],
["CHN", await FileAttachment("China_Transport.csv").csv({typed: true})],
["RUS", await FileAttachment("Russia_Transport.csv").csv({typed: true=
["IND", await FileAttachment("India_Transport.csv").csv({typed: true})],
["MEX", await FileAttachment("Mexico_Transport.csv").csv({typed: true})],
["FRA", await FileAttachment("France_Transport.csv").csv({typed: true})],
["CAN", await FileAttachment("Canada_Tranport@1.csv").csv({typed: true})]
].flatMap(([Symbol, values]) => values.map(d => ({Symbol, ...d})))
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