Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Responsive Bar Chart

Public visualization

Viewing a saved revision (read-only)

eaa37561091c4589af1056c101c98dcf

Fork of Responsive Bar Chart

0 stars0🌍 Public
Tt_tannenbaum@coloradocollege.edu
Last edited May 9, 2024
Created on May 7, 2024

This example presents a racing bar chart that animates changes in foreign aid allocations over time, using a responsive design that adapts to screen size. The visualization relies on D3 v7 to bind data, update bar dimensions, and orchestrate transitions between states. It uses `d3.interval` to cycle through dataset years, while `transition` and `duration` handle the smooth movement of bars as values shift. The bars are scaled using `d3.scaleLinear` and `d3.scaleBand`, with axis updates driven by `d3.axisBottom` and `d3.axisLeft`. Data originates from an external CSV loaded via `d3.csv`, and the layout recalculates on window resize via `d3.select` event handlers.

AI-generated description