Stacked-to-Grouped Police Killings with D3 v4
An interactive bar chart displays police killings from January to June 2015, broken down by race. Users can toggle between stacked and grouped views using radio buttons. The visualization uses D3 v4's `d3.stack`, `d3.scaleBand`, `d3.scaleLinear`, and the ordinal color scheme `d3.schemeCategory20c`. Rectangles animate between layouts via a sequenced `transition()`, preserving object constancy as described by Heer and Robertson. Data comes from a CSV file provided by FiveThirtyEight.
AI-generated descriptionD3 Version 4 implementation of the stacked to grouped bar chart.
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. Colors and data generation inspired by Byron and Wattenberg.
Police killings data for 2015 (up to June) downloaded from FiveThirtyEight
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3943967'>Stacked-to-Grouped Bars</a>
forked from <a href='http://bl.ocks.org/enjalot/'>enjalot</a>'s block: <a href='http://bl.ocks.org/enjalot/2b1446f496c3968f6ecd'>Stacked-to-Grouped Police Killings</a>
forked from <a href='http://bl.ocks.org/Nastasi7/'>Nastasi7</a>'s block: <a href='http://bl.ocks.org/Nastasi7/8e4b032ce21ee9291ee8'>Stacked-to-Grouped Police Killings</a>
forked from <a href='http://bl.ocks.org/mashehu/'>mashehu</a>'s block: <a href='http://bl.ocks.org/mashehu/de923d763a53d523596ba81c6d1f3233'>Stacked-to-Grouped Police Killings with D3 v4</a>