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-simplification
or
yarn add @julien76/data-simplification