Triangulation morphing #2
This animation morphs between U.S. state polygons using triangulation, cycling through all 48 contiguous states in a continuous sequence. It starts by showing a single state, then gradually subdivides it into many smaller polygons before merging them into the next state. The process uses the earcut library to triangulate polygons and TopoJSON for topology operations, while d3’s `transition.attrTween` and `interpolateString` handle the smooth path interpolation. Each state’s fill color shifts through a cool color palette during the transition.
AI-generated descriptionTweening between one and many polygons with an approach that's faster and more robust than this Voronoi jigsaw attempt.
This approach uses earcut and some artisanal TopoJSON to triangulate the polygon and successively merge the triangles into the desired number of pieces, and then adds/rewinds points for smoother transitions (see this demo for a better look at what's happening behind the scenes).
See also: Triangulation morphing, Jigsaw morphing, Smoother polygon transitions
forked from <a href='http://bl.ocks.org/veltman/'>veltman</a>'s block: <a href='http://bl.ocks.org/veltman/14b65b88156d4f5772c285ee7d78403b'>Triangulation morphing #2</a>