Skip to content

emeeks/d3.geom.concaveHull

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

d3.geom.concaveHull

D3 already includes convex hulls with d3.geom.hull. This brings together several methods developed by Jason Davies, Gregor Aisch and Ian Johnson to expose a simple way to generate concave hulls from an array of data.

Simple Example

Complex Example with Geodata

d3.geom.concaveHull

npm install d3-geom-concavehull

#concaveHull(data) Returns an array of arrays, each of which contains an array of points for the shape bounding the points in data according to the set distance.

#concaveHull.distance Sets or gets a function calculating the maximum distance of a point can be from another point before they're treated as being separated. The default is to calculate the length of the edges of all triangles and set the cutoff at mean + standard deviation. You could also set it to a number if you know the distance you want.

#concaveHull.padding (Broken) Sets or gets a number (positive or negative) to grow or shrink the created hulls in pixels. Negative numbers will shrink the hulls, positive numbers will grow them.

About

Calculate concave hull(s) from an array of points

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published