d3-polygon
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-polygon/ v1.0.4 Copyright 2018 Mike Bostock | ||
// https://d3js.org/d3-polygon/ v1.0.5 Copyright 2018 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/ v1.0.4 Copyright 2018 Mike Bostock | ||
// https://d3js.org/d3-polygon/ v1.0.5 Copyright 2018 Mike Bostock | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})}(this,function(n){"use strict";function e(n,e){return n[0]-e[0]||n[1]-e[1]}function r(n){for(var e,r,t,o=n.length,f=[0,1],u=2,l=2;l<o;++l){for(;u>1&&(e=n[f[u-2]],r=n[f[u-1]],t=n[l],(r[0]-e[0])*(t[1]-e[1])-(r[1]-e[1])*(t[0]-e[0])<=0);)--u;f[u++]=l}return f.slice(0,u)}n.polygonArea=function(n){for(var e,r=-1,t=n.length,o=n[t-1],f=0;++r<t;)e=o,o=n[r],f+=e[1]*o[0]-e[0]*o[1];return f/2},n.polygonCentroid=function(n){for(var e,r,t=-1,o=n.length,f=0,u=0,l=n[o-1],i=0;++t<o;)e=l,l=n[t],i+=r=e[0]*l[1]-l[0]*e[1],f+=(e[0]+l[0])*r,u+=(e[1]+l[1])*r;return[f/(i*=3),u/i]},n.polygonHull=function(n){if((o=n.length)<3)return null;var t,o,f=new Array(o),u=new Array(o);for(t=0;t<o;++t)f[t]=[+n[t][0],+n[t][1],t];for(f.sort(e),t=0;t<o;++t)u[t]=[f[t][0],-f[t][1]];var l=r(f),i=r(u),g=i[0]===l[0],h=i[i.length-1]===l[l.length-1],a=[];for(t=l.length-1;t>=0;--t)a.push(n[f[l[t]][2]]);for(t=+g;t<i.length-h;++t)a.push(n[f[i[t]][2]]);return a},n.polygonContains=function(n,e){for(var r,t,o=n.length,f=n[o-1],u=e[0],l=e[1],i=f[0],g=f[1],h=!1,a=0;a<o;++a)r=(f=n[a])[0],(t=f[1])>l!=g>l&&u<(i-r)*(l-t)/(g-t)+r&&(h=!h),i=r,g=t;return h},n.polygonLength=function(n){for(var e,r,t=-1,o=n.length,f=n[o-1],u=f[0],l=f[1],i=0;++t<o;)e=u,r=l,e-=u=(f=n[t])[0],r-=l=f[1],i+=Math.sqrt(e*e+r*r);return i},Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-polygon", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Operations for two-dimensional polygons.", | ||
@@ -19,5 +19,6 @@ "keywords": [ | ||
}, | ||
"main": "dist/d3-polygon.min.js", | ||
"module": "index", | ||
"jsnext:main": "index", | ||
"main": "dist/d3-polygon.js", | ||
"unpkg": "dist/d3-polygon.min.js", | ||
"jsdelivr": "dist/d3-polygon.min.js", | ||
"module": "src/index.js", | ||
"repository": { | ||
@@ -29,5 +30,5 @@ "type": "git", | ||
"pretest": "rollup -c", | ||
"test": "tape 'test/**/*-test.js' && eslint index.js src test", | ||
"test": "tape 'test/**/*-test.js' && eslint src test", | ||
"prepublishOnly": "rm -rf dist && yarn test", | ||
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v1.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v1.min.js && git add ${npm_package_name}.v1.js ${npm_package_name}.v1.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js" | ||
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js" | ||
}, | ||
@@ -34,0 +35,0 @@ "devDependencies": { |
@@ -5,4 +5,4 @@ import {terser} from "rollup-plugin-terser"; | ||
const config = { | ||
input: "index.js", | ||
external: Object.keys(meta.dependencies || {}), | ||
input: "src/index.js", | ||
external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)), | ||
output: { | ||
@@ -15,3 +15,3 @@ file: `dist/${meta.name}.js`, | ||
banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`, | ||
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).map(key => ({[key]: "d3"}))) | ||
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"}))) | ||
}, | ||
@@ -18,0 +18,0 @@ plugins: [] |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
48587
15