Commit 3e503b20 authored by Mike Bostock's avatar Mike Bostock


parent c826bce6
......@@ -1096,17 +1096,13 @@ TODO
## [Voronoi Diagrams (d3-voronoi)](
The d3.geom.voronoi method has been renamed to [d3.voronoi](, and the *voronoi*.clipExtent method has been renamed to [*voronoi*.extent]( The undocumented *polygon*.point property in 3.x, which is the *i*th element in the input *data*, has now been renamed to *polygon*.data for consistency.
Calling [*voronoi*]( now returns the full [Voronoi diagram](, which includes topological information: each Voronoi edge exposes *edge*.left and *edge*.right specifying the sites on either side of the edge, and each Voronoi cell is an array of edges. The Voronoi diagram can be used to efficiently compute both the Voronoi and Delaunay tessellations for a site of points: [*diagram*.polygons](, [*diagram*.links](, and [*diagram*.triangles]( The topology is also useful in conjunction with TopoJSON; see the [Voronoi topology example](
The [*voronoi*.polygons]( and [*diagram*.polygons]( now require an [extent](; there is no longer an implicit extent of ±1e6. The [*voronoi*.links](, [*voronoi*.triangles](, [*diagram*.links]( and [*diagram*.triangles]( are now affected by the clip extent: as the Delaunay is computed as the dual of the Voronoi, two sites are only linked if the clipped cells are touching. To compute the Delaunay triangulation without respect to clipping, set the extent to null.
* d3.geom.voronoi ↦ d3.voronoi
* *voronoi*.clipExtent ↦ *voronoi*.extent
* *voronoi* now returns the full Voronoi diagram
* new *voronoi*.polygons returns clipped polygons
* *voronoi*.polygons and *diagram*.polygons require an extent
* the diagram can be used to compute Voronoi & Delaunay simultaneously
* the diagram also exposes topology, which is useful for TopoJSON applications
* well-defined behavior for coincident vertices: subsequent cells are null
* input data exposed as *polygon*.data, not *polygon*.point
The Voronoi generator finally has well-defined behavior for coincident vertices: the first of a set of coincident points has a defined cell, while the subsequent duplicate points have null cells. The returned array of polygons is sparse, so by using *array*.forEach or *array*.map, you can easily skip undefined cells. The Voronoi generator also now correctly handles the case where no cell edges intersect the extent.
## [Zooming (d3-zoom)](
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment