Public
Edited
Jun 5
Insert cell
Insert cell
emissions.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
vegaEmbed = require("vega-embed@6")

Insert cell
data = FileAttachment("emissions.csv").csv()
Insert cell
filtered = data
.filter(d => d["POLLUTANT"] === "GHG" && d["TIME_PERIOD"] === "2021")
.map(d => ({
country: d["Reference area"],
value: +d["OBS_VALUE"]
}))

Insert cell
top10 = filtered.sort((a, b) => b.value - a.value).slice(0, 10)
Insert cell
vegaEmbed({
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
title: "Top 10 Countries by Per Capita Greenhouse Gas Emissions in 2021",
data: {values: top10},
mark: "bar",
encoding: {
x: {field: "value", type: "quantitative", title: "Emissions (kg CO₂e per person)"},
y: {field: "country", type: "nominal", sort: "-x", title: "Country"},
color: {field: "value", type: "quantitative", scale: {scheme: "reds"}}
}
})
Insert cell
md`## Top 10 Countries by Per Capita Greenhouse Gas Emissions in 2021

I wanted to explore which countries produced the most greenhouse gas emissions per person in 2021. This chart helps answer that by showing the top 10 countries with the highest per capita emissions, using data from the OECD. It gives a sense of how much greenhouse gas each person contributes on average in these countries.

To prepare the chart, I used the pollutant category “GHG” (greenhouse gases) and filtered for the year 2021. I only kept the values measured in kilograms of CO2-equivalent per person. Then I sorted the results by value and took the top 10 countries with the highest numbers.

I chose a horizontal bar chart to make it easier to read the country names, and I sorted the bars from highest to lowest emissions. The red color scale shows the intensity of emissions, so it's clear which countries are contributing the most per person. It’s a simple but effective way to highlight the data.

One thing this chart doesn’t show is the total emissions or the size of each country’s population. Some countries might have high per person emissions because they have smaller populations and more industrial output. So while this chart is useful for spotting individual responsibility, it doesn’t tell the whole story about national impact.`

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