Class: Voronoi

Voronoi(data)

new Voronoi(data)

Initialize the voronoi with the data given.
Parameters:
Name Type Description
data Array.<Object> Array of points.
Source:

Methods

data(data) → {Voronoi}

Sets the data to voronoi
Parameters:
Name Type Description
data Array.<Object> Array of objects.
Source:
Returns:
Instance of voronoi.
Type
Voronoi

find(x, y, radius) → {Object}

Finds the closest point to the x and y position given.
Parameters:
Name Type Description
x number x value
y number y value
radius number search radius.
Source:
Returns:
Details of the nearest point.
Type
Object

Voronoi()

new Voronoi()

This class creates a d3 voronoi for retrieving the nearest neighbour of any point from a set of two dimensional points
Source:

Methods

data(data) → {Voronoi}

Sets the data to voronoi
Parameters:
Name Type Description
data Array.<Object> Array of objects.
Source:
Returns:
Instance of voronoi.
Type
Voronoi

find(x, y, radius) → {Object}

Finds the closest point to the x and y position given.
Parameters:
Name Type Description
x number x value
y number y value
radius number search radius.
Source:
Returns:
Details of the nearest point.
Type
Object