Skip to main content
100%

Voronoi Spirals II

✓ Published0🌍 Public
Mmbostock
Last edited Mar 29, 2016
Created on Mar 29, 2016

A Voronoi diagram partitions a canvas into cells around randomly placed sites; this animation continuously warps those cells by rotating each polygon's vertices, creating a swirling, spiraling effect. The fill color shifts through a smooth spectrum as the animation progresses over five seconds. The code uses d3.voronoi to compute the polygons, d3.timer for the animation loop, and d3.scaleCubehelix to interpolate the cell colors. Each frame, the first vertex of a cell is moved toward the next, shortening the polygon's edge before pushing a new point into the array. The rendering is done via the Canvas 2D API.

AI-generated description

Inspired by Adam Pearce.

gpl-3.0 Licensed

Similar vizzes