Skip to main content
100%

Shape Tweening

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 10, 2012

A loop animates the state of California morphing between its natural geographic shape and a circle. The tweening moves vertices along straight-line paths in a projected 2D plane, with the circle generated by redistributing points based on the polygon's perimeter distances. The code uses the d3.geo Albers projection, d3.geom.polygon for area and centroid calculations, and SVG path transitions with a 5000ms duration. The state boundary comes from the included california.json GeoJSON file.

AI-generated description

See also the linear path tweening example.

gpl-3.0 Licensed

Similar vizzes