WebCola
Options
All
  • Public
  • Public/Protected
  • All
Menu

Computed Voronoi diagram

The generic refers to the type of the data for the corresponding element.

Type parameters

  • T

Hierarchy

  • VoronoiDiagram

Index

Properties

Methods

Properties

cells

cells: Array<VoronoiCell<T> | null>

Array of Voronoi Cells, one per input point; a cell may be null for a coincident point.

edges

edges: Array<VoronoiEdge<T>>

Array of Voronoi Edges

Methods

find

  • find(x: number, y: number, radius?: number): VoronoiSite<T> | null
  • Return the nearest Voronoi Site to point [x, y]. If radius is specified, only sites within radius distance are considered. If no Voronoi Site can be found (within the specified radius), null is returned.

    Parameters

    • x: number

      x-coordinate

    • y: number

      y-coordinate

    • Optional radius: number

      Optional parameter for search radius around [x, y]

    Returns VoronoiSite<T> | null

links

  • Returns the Delaunay triangulation of the specified data array as an array of links, one for each edge in the mesh. Each link has the following attributes:

    • source (the source node, an element in data)
    • target (the target node, an element in data)

    Since the triangulation is computed as the dual of the Voronoi diagram, and the Voronoi diagram is clipped by the extent, a subset of the Delaunay links is returned.

    Returns Array<VoronoiLink<T>>

polygons

  • Return an array of polygons clipped to the extent, one for each cell in the 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.

    Returns Array<VoronoiPolygon<T>>

triangles

  • Returns the Delaunay triangulation of the specified data array as an array of triangles. Each triangle is a three-element array of elements from data. Since the triangulation is computed as the dual of the Voronoi diagram, and the Voronoi diagram is clipped by the extent, a subset of the Delaunay triangulation is returned.

    Returns Array<VoronoiTriangle>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc