Voronoi Sorting
A Voronoi diagram of 500 randomly placed points continuously sorts its cells by area. Each polygon’s fill color encodes its area on a logarithmic scale, and cells slide horizontally into size order before the diagram recalculates from their new positions. The process repeats indefinitely, redrawing shapes and colors as areas change. Built with D3 v4, it uses `d3.voronoi` for tessellation, `d3.scaleLog` and `d3.scaleSequential` for mapping, and SVG `path` transitions with `d3.timeout` to loop the animation.
AI-generated descriptionThis is an experiment with sorting the polygons of a voronoi diagram. They sort on a logarithmic scale because a linear scale was causing them to cluster all to one side in a progressively more compact way. The sorting is by the area of the shape - which is also represented by color. After moving to the new location, the sort is re-calculated based on the new shapes and the shapes move again. This was the result of reading <a href="http://bl.ocks.org/mbostock">Mike Bostock's</a> article on <a href="http://bost.ocks.org/mike/algorithms/">Visualizing Algorithms</a>.
The previous versions are here: <a href='http://bl.ocks.org/alexmacy/07389b74c1a83b589c1d9c67c6cef14c'>Voronoi Shuffling v1</a>, <a href='http://bl.ocks.org/alexmacy/1944e5d8967453e1f7c128b7d668761f'>Voronoi Shuffling v2</a>, & <a href='http://bl.ocks.org/alexmacy/5f9ba684d2c9ec68392dee86ff9636bb'>Voronoi Shuffling v3</a>