@julien76/js-simplify
v0.2.0
Published
A fork of simplify-js for JavaScript 2D/3D polyline simplification library
Downloads
5
Maintainers
Readme
This is a fork of simply-js with the following changes:
- options to set the xKey and yKey for the points
- use es6 syntax
- Bundle the scripts with microbundle with UMD, module targer
- Add calculation info in addition to return the simplified points
const {
simplifiedPoints,
calculationInfo
} = simplify(points, { highestQuality: true, tolerance: 3.0, xKey: 'x', yKey: 'y' })calculationInfo returns:
{
time: Number // time spent to compute in ms
pointsBefore: Number // Number of points before the simplification
pointsAfter: Number // Number of points after the simplification
info: String // String containing the above info
}Installation
npm i @julien76/data-simplificationor
yarn add @julien76/data-simplification