d3-polygon
Advanced tools
Comparing version 2.0.0-rc.1 to 2.0.0
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-polygon/ v2.0.0-rc.1 Copyright 2020 Mike Bostock | ||
// https://d3js.org/d3-polygon/ v2.0.0 Copyright 2020 Mike Bostock | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-polygon/ v2.0.0-rc.1 Copyright 2020 Mike Bostock | ||
// https://d3js.org/d3-polygon/ v2.0.0 Copyright 2020 Mike Bostock | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n=n||self).d3=n.d3||{})}(this,function(n){"use strict";function e(n,e){return n[0]-e[0]||n[1]-e[1]}function t(n){const e=n.length,t=[0,1];let r,o=2;for(r=2;r<e;++r){for(;o>1&&(f=n[t[o-2]],u=n[t[o-1]],l=n[r],(u[0]-f[0])*(l[1]-f[1])-(u[1]-f[1])*(l[0]-f[0])<=0);)--o;t[o++]=r}var f,u,l;return t.slice(0,o)}n.polygonArea=function(n){for(var e,t=-1,r=n.length,o=n[r-1],f=0;++t<r;)e=o,o=n[t],f+=e[1]*o[0]-e[0]*o[1];return f/2},n.polygonCentroid=function(n){for(var e,t,r=-1,o=n.length,f=0,u=0,l=n[o-1],i=0;++r<o;)e=l,l=n[r],i+=t=e[0]*l[1]-l[0]*e[1],f+=(e[0]+l[0])*t,u+=(e[1]+l[1])*t;return[f/(i*=3),u/i]},n.polygonContains=function(n,e){for(var t,r,o=n.length,f=n[o-1],u=e[0],l=e[1],i=f[0],g=f[1],h=!1,c=0;c<o;++c)t=(f=n[c])[0],(r=f[1])>l!=g>l&&u<(i-t)*(l-r)/(g-r)+t&&(h=!h),i=t,g=r;return h},n.polygonHull=function(n){if((o=n.length)<3)return null;var r,o,f=new Array(o),u=new Array(o);for(r=0;r<o;++r)f[r]=[+n[r][0],+n[r][1],r];for(f.sort(e),r=0;r<o;++r)u[r]=[f[r][0],-f[r][1]];var l=t(f),i=t(u),g=i[0]===l[0],h=i[i.length-1]===l[l.length-1],c=[];for(r=l.length-1;r>=0;--r)c.push(n[f[l[r]][2]]);for(r=+g;r<i.length-h;++r)c.push(n[f[i[r]][2]]);return c},n.polygonLength=function(n){for(var e,t,r=-1,o=n.length,f=n[o-1],u=f[0],l=f[1],i=0;++r<o;)e=u,t=l,e-=u=(f=n[r])[0],t-=l=f[1],i+=Math.hypot(e,t);return i},Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-polygon", | ||
"version": "2.0.0-rc.1", | ||
"publishConfig": { | ||
"tag": "next" | ||
}, | ||
"version": "2.0.0", | ||
"description": "Operations for two-dimensional polygons.", | ||
@@ -8,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
0
15382