Voronoi-based point picker (revisited)
This example demonstrates a Voronoi diagram where each point’s interactive zone is limited by a maximum radius, adjusted via a slider. It shows how hovering over a polygon highlights the corresponding data point. The visualization uses the `d3.distanceLimitedVoronoi` plugin to compute these clipped regions, replacing the need for clip paths. The code generates 100 random vertices, renders the polygons and circles using D3.js v4, and redraws the diagram in response to slider input.
AI-generated descriptionThis block is based on Voronoi-based point picker from njvack
This block uses the d3.distanceLimitedVoronoi d3 plugin I made. This plugin produces the appropriate interactive zones, depending on the Voronoï tesselation and a maximum distance from each datum.
Compared to the original block, there is no need to produce and bind clipPathes, making the code (and usage) simpler.
Acknowledgments to:
- <a href='https://d3js.org/'>D3.js</a> (v4)
- <a href='http://bl.ocks.org'>blockbuilder.org</a>
- Voronoi-based point picker