Skip to main content
100%

How d3.voronoi().extent() affects triangles() and links()

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Sep 21, 2016
Created on Aug 17, 2016

This example illustrates how adding an `extent()` to the voronoi layout changes the triangulation and link generation. It renders two overlaid sets of Delaunay triangles and links from 100 random points: one set computed without an extent (shown in blue) and another with a clipped extent (shown in yellow and red). The code uses `d3.voronoi()` from d3.v4 with `.triangles()` and `.links()` methods, drawing the polygons, triangles, and links as SVG paths and lines. The visualization highlights the difference in edge behavior near the boundary caused by the extent constraint.

AI-generated description

See Issue #11 : .triangles() crashing when there is an extent().

Forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/4341156'>Delaunay Triangulation</a>

gpl-3.0 Licensed

Similar vizzes