Computes the Voronoi diagram for the specified data points.
The generic refers to the type of the data for the corresponding element.
Array of data elements
Returns the current clip extent which defaults to null.
The extent bounds are specified as an array [[x0, y0], [x1, y1]], where x0 is the left side of the extent, y0 is the top, x1 is the right and y1 is the bottom.
A clip extent is required when using voronoi.polygons.
Set the clip extent of the Voronoi layout to the specified bounds and return the layout.
A clip extent is required when using voronoi.polygons.
The extent bounds are specified as an array [[x0, y0], [x1, y1]], where x0 is the left side of the extent, y0 is the top, x1 is the right and y1 is the bottom.
Return the Delaunay triangulation of the specified data array as an array of links. Each link has source and target attributes referring to elements in data.
Array of data points.
Return an array of polygons clipped to the extent, one for each input point in the specified data points, corresponding to the cells in the computed Voronoi diagram.
Each polygon is represented as an array of points [x, y] where x and y are the point coordinates, and a data field that refers to the corresponding element in data. Polygons are open: they do not contain a closing point that duplicates the first point; a triangle, for example, is an array of three points. Polygons are also counterclockwise, assuming the origin ⟨0,0⟩ is in the top-left corner.
If the cell’s site is coincident with an earlier site, the associated polygon is null.
Important: Using polygon requires the extent to be set for the layout.
Array of data points.
Get the clip size of the Voronoi layout. Size is an alias for voronoi.extent where the minimum x and y of the extent are ⟨0,0⟩.
Set the clip size and return the layout.
Size is an alias for voronoi.extent where the minimum x and y of the extent are ⟨0,0⟩.
An array representing the x- and y-size of the clip extent, where the minimum x and y of the extent are ⟨0,0⟩.
Return the Delaunay triangulation of the specified data array as an array of triangles. Each triangle is a three-element array of elements from data.
Array of data points.
Return the current x-coordinate accessor, which defaults to accessing the first element of an array (i.e. at index 0).
Set the x-coordinate accessor and return the layout.
An accessor function which takes a data element as input and return a numeric value for the x-coordinate.
Return the current y-coordinate accessor, which defaults to accessing the second element of an array (i.e. at index 1).
Set the y-coordinate accessor and return the layout.
An accessor function which takes a data element as input and return a numeric value for the y-coordinate.
Generated using TypeDoc
A Voronoi Layout.
The generic refers to the type of the data for the corresponding element.