block by alexmacy 3d3567947868d615c418922ad277aeab

United States of Voronoi Tweening w/ borders

Full Screen

I’ve been wanting a way to show the original state borders after the transition, so I created another layer that appears when transitioning to the voronoi shapes. There’s a bit of a bug with how some of these borders are not appearing - like where “New Wyoming” is above part of old Nebraska.

This seems to be related to the order that the states are rendered…


from micahstubbs‘s version of United States of Voronoi Tweening:

a small iteration on @alexmacy‘s United States of Voronoi Tweening that transitions the colors of the pologons, polygon borders, and state-capitol points

playing with ways to highlight the differences between the geographic shape and the Voronoi shape of each US state


Original README.md


This is another version of the shape tweening from this block. Inspired by Jason Davies’ United States of Voronoi.

The transition I had previously used for shape tweening plots the points along the new shape proportionally to where they were along the original shape. This potentially results in rounded or skipped corners, so I had to figure out a new way to do it.

The new transition used here draws the destination shapes by plotting the points form the old shape equally along each side of the new shape. The result isn’t always as clean of a transition, but it’s still pretty smooth and the resulting shape is free from any rounded or skipped corners.

I also put both transition functions in the standalone file shapeTween.js to be able to easily reuse it later.

index.html

shapeTween.js