UNPKG

d3-delaunay

Version:

Compute the Voronoi diagram of a set of two-dimensional points.

18 lines (17 loc) 278 B
export default class Polygon { constructor() { this._ = []; } moveTo(x, y) { this._.push([x, y]); } closePath() { this._.push(this._[0].slice()); } lineTo(x, y) { this._.push([x, y]); } value() { return this._.length ? this._ : null; } }