site/node_modules/d3-delaunay/src/polygon.js
2024-10-14 08:09:33 +02:00

17 lines
278 B
JavaScript

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;
}
}