Projects · Data Visualization · Feb 2026

World Health & Wealth

Five linked D3 views on how wealth relates to health across 165 countries.

Wealth and health, 165 countries

GDP per person against life expectancy at birth, 2022. One dot per country.

20406080 years $1k$10k$100k GDP per person, log scale Central African Rep. 18.8Japan 84.1Qatar 81.9UAE 80.5 20406080 years $1k$10k$100k GDP per person, log scale Central African Rep. 18.8Japan 84.1Qatar 81.9UAE 80.5

Source: Our World in Data, 2022, as cleaned for the World of Data dashboard (world_data.csv). The Central African Republic value matches the published OWID figure for 2022.

Two histograms, a scatter plot and two maps over Our World in Data's 2022 figures. Brush any one of them and the other four follow.

The Problem

How strongly is wealth connected to health across countries? Static charts answer one slice of that at a time. I wanted distributions, correlation and geography visible together, so that selecting a group in one view shows where it sits in all the others.

What I Built

An interactive dashboard over three Our World in Data measures for 2022: GDP per person, life expectancy at birth, and under-five mortality. Before writing any code I sketched the layout so every related view would be on screen at once, because brushing and linking only feel natural when nothing has to scroll.

The layout: two histograms for distributions, a central scatter plot for correlation, two choropleth maps for geography, dropdowns to switch measures, and an information panel linked to the current selection.

How It Works

  1. Preprocess in PythonFilter each CSV to the most recent common year, merge on country code, drop non-country entries, and keep only valid three-letter ISO codes so rows line up with the world GeoJSON.
  2. One selection stateEvery view reads from and writes to a single shared selection. When it changes, all views redraw.
  3. HistogramsBrush horizontally to select a value range. Hover a bar for its range and country count.
  4. Scatter plotDrag a rectangle to select many countries, click to select one, hover for exact values.
  5. MapsSequential scales with meaning: blue for GDP, green for life expectancy, deeper red for higher child mortality. Click a country to select it everywhere.

Results

Three patterns stand out once you start brushing. GDP per person and life expectancy rise together, with wealthier countries in the upper right of the scatter plot. GDP and under-five mortality move in opposite directions, which is clearest when you brush the low-GDP range and watch the maps. And the clusters are regional: many Sub-Saharan African countries sit in the low-GDP, high-mortality corner, while Western Europe and North America cluster at high income and high life expectancy.

The hardest part was the interaction logic in the scatter plot. The brush overlay kept swallowing clicks, and fixing it meant restructuring the event handling. Aligning country codes between the data and the GeoJSON was the other.

Limitations

  • One year only. The data is a 2022 snapshot, so the dashboard shows relationships, not change over time.
  • Linear GDP scale. GDP per person spans more than two orders of magnitude; a log scale would separate the low-income countries that bunch together on the left. The chart on this page uses one.
  • No color legend on the maps, and the layout is not yet tuned for small screens.
  • One outlier is real, not a bug. The Central African Republic sits at a life expectancy of 18.8 years, far below every other country. That is the figure Our World in Data publishes for 2022 (it reports 50.6 for 2020 and 57.4 for 2023), so the dashboard shows the source faithfully. A single-year snapshot cannot show that context.
  • AI tools helped debug D3 interactions and refine the layout. The data processing, design decisions and final integration were mine.

What I’d Do Next

  1. Add time, so the selection can be replayed across years.
  2. Add a log-scale toggle for GDP and a color legend on each map.
  3. Make it work on a phone.