Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-polygon

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-polygon - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

8

build/d3-polygon.js

@@ -1,6 +0,6 @@

// https://d3js.org/d3-polygon/ Version 1.0.2. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-polygon/ Version 1.0.3. Copyright 2017 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {})));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {})));
}(this, (function (exports) { 'use strict';

@@ -7,0 +7,0 @@

@@ -1,2 +0,2 @@

// https://d3js.org/d3-polygon/ Version 1.0.2. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-polygon/ Version 1.0.3. Copyright 2017 Mike Bostock.
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.d3=n.d3||{})}(this,function(n){"use strict";function r(n,r){return n[0]-r[0]||n[1]-r[1]}function e(n){for(var r=n.length,e=[0,1],t=2,o=2;o<r;++o){for(;t>1&&f(n[e[t-2]],n[e[t-1]],n[o])<=0;)--t;e[t++]=o}return e.slice(0,t)}var t=function(n){for(var r,e=-1,t=n.length,o=n[t-1],f=0;++e<t;)r=o,o=n[e],f+=r[1]*o[0]-r[0]*o[1];return f/2},o=function(n){for(var r,e,t=-1,o=n.length,f=0,u=0,l=n[o-1],i=0;++t<o;)r=l,l=n[t],i+=e=r[0]*l[1]-l[0]*r[1],f+=(r[0]+l[0])*e,u+=(r[1]+l[1])*e;return i*=3,[f/i,u/i]},f=function(n,r,e){return(r[0]-n[0])*(e[1]-n[1])-(r[1]-n[1])*(e[0]-n[0])},u=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(r),t=0;t<o;++t)u[t]=[f[t][0],-f[t][1]];var l=e(f),i=e(u),g=i[0]===l[0],a=i[i.length-1]===l[l.length-1],c=[];for(t=l.length-1;t>=0;--t)c.push(n[f[l[t]][2]]);for(t=+g;t<i.length-a;++t)c.push(n[f[i[t]][2]]);return c},l=function(n,r){for(var e,t,o=n.length,f=n[o-1],u=r[0],l=r[1],i=f[0],g=f[1],a=!1,c=0;c<o;++c)f=n[c],e=f[0],t=f[1],t>l!=g>l&&u<(i-e)*(l-t)/(g-t)+e&&(a=!a),i=e,g=t;return a},i=function(n){for(var r,e,t=-1,o=n.length,f=n[o-1],u=f[0],l=f[1],i=0;++t<o;)r=u,e=l,f=n[t],u=f[0],l=f[1],r-=u,e-=l,i+=Math.sqrt(r*r+e*e);return i};n.polygonArea=t,n.polygonCentroid=o,n.polygonHull=u,n.polygonContains=l,n.polygonLength=i,Object.defineProperty(n,"__esModule",{value:!0})});
{
"name": "d3-polygon",
"version": "1.0.2",
"version": "1.0.3",
"description": "Operations for two-dimensional polygons.",

@@ -30,3 +30,3 @@ "keywords": [

"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-polygon.js -c -m -o build/d3-polygon.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-polygon/build/d3-polygon.js d3-polygon.v1.js && cp ../d3-polygon/build/d3-polygon.min.js d3-polygon.v1.min.js && git add d3-polygon.v1.js d3-polygon.v1.min.js && git commit -m \"d3-polygon ${VERSION}\" && git push && cd - && zip -j build/d3-polygon.zip -- LICENSE README.md build/d3-polygon.js build/d3-polygon.min.js"
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-polygon/build/d3-polygon.js d3-polygon.v1.js && cp ../d3-polygon/build/d3-polygon.min.js d3-polygon.v1.min.js && git add d3-polygon.v1.js d3-polygon.v1.min.js && git commit -m \"d3-polygon ${npm_package_version}\" && git push && cd - && zip -j build/d3-polygon.zip -- LICENSE README.md build/d3-polygon.js build/d3-polygon.min.js"
},

@@ -36,6 +36,6 @@ "devDependencies": {

"package-preamble": "0.0",
"rollup": "0.36",
"rollup": "0.41",
"tape": "4",
"uglify-js": "2"
"uglify-js": "^2.8.11"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc