Skip to main content
100%

Stacked-to-Grouped | JSON Data, Vertical Bars

✓ Published0🌍 Public
TThanaporn-sk
Last edited Apr 22, 2017
Created on Apr 22, 2017

This example shows vertical bars that switch between stacked and grouped layouts. Visitors can toggle the view using custom radio buttons, with a sequenced transition animating the bars while preserving object constancy. The visualization loads JSON data via `d3.json` and renders SVG elements using d3.v4. It applies `d3.stack()` for the stacked view, `d3.scaleBand` and `d3.scaleLinear` for positioning, and `transition` methods with staggered delays to animate between states. The color scale uses `d3.schemeCategory20c`.

AI-generated description

switch 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 vertical 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

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/c71d79c0ee2a1f73827c32f3a2972181'>Stacked-to-Grouped | JSON Data, Vertical Bars</a>

mit Licensed

Similar vizzes