
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Fast continuous level of detail geometry simplification using the Visvalingam area approach. Provides methods for simplifying to a target point count or percentage in addition to point-area significance.
dwindle ˈdwɪnd(ə)l
verb
This is a geometry simplification tool I've wanted to write for a while cos the Visvalingam algorithm is just cool, basically. It accepts a list of 2d coordinates, which could be the outline of a complex polygon or a line-string (like a route) and simplifies the data in the most visually pleasing and acceptable manor i.e. by retaining the important and 'significant' data where possible.
It uses the Visvalingam method which is algorithmically clearer, easier to implement and I believe more effective and consistent than the classic Douglas-Peucker approach.
Install via npm
$ npm install dwindle
Instantiate the object. Dwindle expects an array of coordinate-pair arrays as input:
var Dwindle = require('dwindle');
let points = [[0,0], [100, 0], [100,100], ... [0, 100]];
let myshape = new Dwindle(points);
There are three choices when reducing the data;
let reduced = myshape.simplify({target: 1000}); // reduce to 1000 points
let reduced = myshape.simplify({percent:50}); // reduce set by half
let reduced = myshape.simplify({area:0.01}); // by minimum area
The .simplify() method returns an array of coordinate-pair arrays, same as the input.
Note that if your points array (the one you pass to the Dwindle constructor) changes and you want the simplifcations to reflect these changes, then you will need to rebuild the index by calling:
myshape.rebuild(newpoints);
Rebuilding is fast and can be called multiple times no problem.
FAQs
Fast continuous level of detail geometry simplification using the Visvalingam area approach. Provides methods for simplifying to a target point count or percentage in addition to point-area significance.
We found that dwindle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.