
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
Hull.js is a JavaScript library that builds concave hull by the set of points.
This library was born in free independent Ukraine. Today not only Ukraine, but the entire international rule-based order is under attack, and you can help to defend it by supporting the Armed Forces of Ukraine via well trusted https://savelife.in.ua/en/ foundation. For other options to help, explore https://ukraine.ua/.
See live examples here.
var points = [ [236, 126], [234, 115], [238, 109], [247, 102], ... ];
hull(points, 50); // returns points of the hull (in clockwise order)
[[x1, y1], [x2, y2], ..., [xn, yn]];1 - thin shape. Infinity - convex hull. By default 20;['.lng', '.lat'] if you have {lng: x, lat: y} points. By default you can use [x, y] points.Let's see step by step what happens when you call hull() function:


`concavity = 80`
`concavity = 40`
`concavity = 20`
This library relies on ES6. The ES6 features used are:
new Set(null), Set#add, Set#haslet, constMath.trunc (if available)You may use polyfills for Set and compile with babel to continue to support old browsers.
npm install # install dependencies
npm test # build dist file and run tests
npm run watch # watch ./src dir and rebuild dist file
If you want to get involved with Hull.js development, just use github flow and feel free to contribute!
concavity adjustment based on density.Introduce fix that avoids hitting stack size limit on large arrays.
Return the first point as the last point when fewer than 4 unique points are provided.
Fix missing "var" declaration.
Add edgeSkipList to increase performance of the highly accurate shapes (with the small concavity number) + refactoring.
Fix bower.json.
Fix bower.json.
Bower support.
Minor fixes (copyrights).
Minor fixes (readme, package.json).
Configurable point formats, now you can use points like {x: 10, y: 10} and {lat: 52, lng: 82}.
Some minor updates (doc, package.json, etc.).
Second version with better performance inspired by this article.
First version based on Delaunay triangulation.
FAQs
JavaScript library that builds concave hulls (shapes) by the set of points
We found that hull.js 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.