Data Visualization · Design & Build
The Words of the Union: 233 years of presidential rhetoric
A scrollytelling data narrative tracing how State of the Union addresses changed in length, theme, sentiment, and global focus from 1790 to 2023.
Open the live website (opens in a new tab)
The question
Two centuries of State of the Union addresses are a rich but unwieldy record: nearly two million words across 233 years. The interesting questions (Are speeches getting longer? Do presidents start to sound alike? What does the nation worry about, and how does its tone shift?) are invisible without aggregation and visualization.
Working with a team, we had two objectives: to unpack this rich dataset, and to learn the principles behind the D3 charting library that companies like The New York Times, GitHub, Airbnb, Netflix, and JPMorganChase use to visuzlize data.
Approach
We structured the site as a guided scrollytelling narrative intended to take the reader on an interactive journey. The text scrolls on the left while a pinned panel on the right swaps and animates with each step. The tech stack is intentionally minimal. It's a static website site with hand-written HTML, CSS, JavaScript and D3.js. A small scroll controller dispatches step events to a display layer that maps each step to a chart and dataset.
To avoid long loading times and keep the website performant, we pre-processed the raw data from the American Presidency Project (UCSB), Project Gutenberg, and the U.S. House Archives offline in Python. This enabled us to format the data into the specific CSV and JSON data shapes that power each visualization.
The deliverable
With the data cleaned and packaged, it was time to plug it in. Ten custom D3 chart modules present the data as interactive visuals that drive the story. The website features a brushable timeline of how addresses were delivered, a racing bar chart of average speech length by president, a cosine-similarity heatmap, policy-theme lines and stacked bars, a sentiment beeswarm, and an interactive rotating globe of the countries presidents named. Readers pick a president, play or reset the animations, and spin the globe directly.
By the numbers
- 233
- Years covered, 1790–2023
- 10
- Custom D3 visualizations
- 89
- Countries mapped
Outcome
A complete interactive essay, live and end to end across sixteen sections. Built as a team capstone with two collaborators; sources and contributors are credited on the website.