Skip to main content
100%

Draggable Voronoi Circles - SVG

✓ Published0🌍 Public
Aalexmacy
Last edited Jun 23, 2017
Created on Jun 23, 2017

A Voronoi diagram partitions the screen into 100 cells, each containing a black point. Inside each cell, a grey circle is drawn using a brute-force algorithm that finds the largest circle fitting within the convex polygon. The points and circles drift and bounce around the SVG canvas, causing the Voronoi cells to continuously update. Dragging any polygon with the mouse moves its corresponding point and highlights the active cell in red.

AI-generated description

A riff on <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/d1d81455dc21e10f742f'>Voronoi Circles</a>. I updated it to d3 v4, ported it to SVG, and added the ability to drag the polygons.

gpl-3.0 Licensed

Similar vizzes