Skip to main content
100%

United States of Voronoi Area Ranking

✓ Published0🌍 Public
Aalexmacy
Last edited May 10, 2018
Created on Mar 28, 2018

This example animates a transition between U.S. state shapes and a Voronoi diagram generated from state capitals, while ranking states by area. A hidden SVG renders state polygons, which are then captured via html2canvas and analyzed with Canvas `getImageData` to compute each state’s pixel area before and after the transition. The visible map uses d3.voronoi and d3.geoAlbersUsa, with d3 transitions morphing polygon points and updating a sorted list of area differences. Color scale reflects proportional area changes.

AI-generated description

An update to this block that calculates the area of each state before and after transitioning to the voronoi diagram. This is done by rendering a hidden svg element, creating a canvas snapshot of it, and then getting the image data from the canvas context.

mit Licensed

Similar vizzes