Skip to main content
100%

2d to 1d binned chart

✓ Published0🌍 Public
PPatrick Wojda
Last edited Mar 25, 2019
Created on Jun 19, 2018

This interactive visualization lets viewers collapse a two-dimensional scatterplot of nine colored circles into one-dimensional histograms along either the x-axis or y-axis, or retain the full 2D layout. Buttons trigger animated transitions where circles bounce into their respective bins, which are delimited by dashed reference lines. The code uses d3.v4’s SVG rendering, `d3.scaleQuantize` for positioning, and `d3.histogram` to bin data by chosen coordinates. A custom `transition` with `d3.easeBounceOut` and 500–750ms durations animates the morph, while `d3.scaleOrdinal` assigns distinct fill colors to each point.

AI-generated description

Built with blockbuilder.org

mit Licensed

Similar vizzes