Skip to main content

Voronoi - voronoi.findAll()

✓ Published0🌍 Public
Aandrew-reid
Last edited May 8, 2018
Created on Mar 13, 2018

A Voronoi diagram of 200 normally distributed points demonstrates an extended `voronoi.findAll(x, y, radius)` method that returns every site within a circular search radius. An animated circle expands from the center, transitioning its radius via `transition.attrTween`, updating the highlighted set of sites in orange as it grows. The static d3.svg rendering uses steelblue circles for all sites, while the black ring shows the current search boundary.

AI-generated description

This bl.ock uses a modified version of d3.voronoi (see here) to demonstrate a potential method to find all sites within a given distance of a point.

Essentially, it the same as voronoi.find(x,y,radius) except:

*returns all sites within the search radius
*requires a radius parameter