JSPM

voronoi-diagram

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 83
  • Score
    100M100P100Q97187F
  • License MIT

Constructs a Voronoi diagram for a collection of points

Package Exports

  • voronoi-diagram

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (voronoi-diagram) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

voronoi-diagram

Construct a voronoi diagram for a collection of points. Works in any dimension in both node.js and in a web browser

testling badge

build status

Example

var voronoi = require("voronoi-diagram")

var points = [
  [1, 0],
  [0, 1],
  [0, 0]
]

console.log(voronoi(points))

Install

npm install voronoi-diagram

API

require("voronoi-diagram")(points)

Constructs a voronoi diagram for a collection of points.

  • points is an array of points in n-dimensional space

Returns An object with two properties

  • positions an array of points representing the location of the voronoi sites
  • cells an array of indices with the same length as points representing the voronoi sites. -1 indicates a point at infinity. In 2D the cells are oriented clockwise, while in 3D they are sorted lexicographically.

Credits

(c) 2013 Mikola Lysenko. MIT License