US Federal Budget Balance, 1968-2017
This interactive Sankey diagram visualizes the US federal budget balance from 1968 to 2017, showing how revenue sources (corporate tax, customs duties) and spending categories (defense, discretionary) change annually. A draggable slider (d3-simple-slider) lets viewers select a year, triggering a 2-second transition (d3.transition) that repositions nodes and links via sankey.relayout. The visualization is rendered as SVG using d3.csv to load yearly datasets, with node sizes scaled via d3.scaleLinear and data-driven transitions updating rect heights, link paths, and font sizes.
AI-generated descriptionHelp! Sankey labels not transitioning properly
This is the sankey from my working federal budget dashboard. For some reason when I try to apply transitions in the traditional way, the labels dont relocate properly.
I suspect it has something to do with sankey.js realligning the sankey categories by size every time the data is refreshed, but haven't been able to find a solution.
For reference, there are some great blocks demonstrating transitioning sankeys