Stacked-to-Grouped | JSON Data, Horizontal Bars
This example shows a horizontal bar chart that toggles between stacked and grouped layouts using sequenced transitions, preserving object constancy so viewers can track data across views. It loads JSON data with an inline numeric key per entry, then uses d3.stack and d3.scaleBand to position bars. Radio buttons trigger transitionGrouped and transitionStacked, which animate bar positions and sizes via chained transition calls. The chart uses static data and SVG rendering, with a green color scale from d3.schemeCategory20c.
AI-generated descriptionswitch between stacked and grouped layouts using sequenced transitions ✨
animations preserve object constancy and allow the user to follow the data across views
animation design by Heer and Robertson inspired by Byron and Wattenberg
this iteration draws horizontal bars from static data
an ES2015 implementation in something like the airbnb style
inspired by Stacked-to-Grouped Bars from @mbostock
custom radio buttons from the codepen Pure CSS & HTML cross-browser elegant Radio Buttons from knitevision1
you can also view this set of experiments in github repo form
👏 to @alexmacy for wading through a few thousand transition errors to help me find the data-prep 🐛 causing them all
Stacked-to-Grouped | Generated Data, Vertical Bars
Stacked-to-Grouped | JSON Data, Vertical Bars
Stacked-to-Grouped | Generated Data, Horizontal Bars
Stacked-to-Grouped | JSON Data, Horizontal Bars
Stacked-to-Grouped | JSON Data, Horizontal Bars, String Series Names
forked from <a href='http://bl.ocks.org/micahstubbs/'>micahstubbs</a>'s block: <a href='http://bl.ocks.org/micahstubbs/501e578009b75738910e47b86b493168'>Stacked-to-Grouped | JSON Data, Horizontal Bars</a>