{"name":"d3-polygon","version":"1.0.5","description":"Operations for two-dimensional polygons.","keywords":["d3","d3-module","polygon","hull","geometry","graphics"],"homepage":"https://d3js.org/d3-polygon/","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"http://bost.ocks.org/mike"},"main":"dist/d3-polygon.js","unpkg":"dist/d3-polygon.min.js","jsdelivr":"dist/d3-polygon.min.js","module":"src/index.js","repository":{"type":"git","url":"git+https://github.com/d3/d3-polygon.git"},"scripts":{"pretest":"rollup -c","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}.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"},"devDependencies":{"eslint":"5","rollup":"0.64","rollup-plugin-terser":"1","tape":"4"},"gitHead":"0805786b0e4138f27282f53ba10e1834834e7348","bugs":{"url":"https://github.com/d3/d3-polygon/issues"},"_id":"d3-polygon@1.0.5","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"integrity":"sha512-RHhh1ZUJZfhgoqzWWuRhzQJvO7LavchhitSTHGu9oj6uuLFzYZVeBzaWTQ2qSO6bz2w55RMoOCf0MsLCDB6e0w==","shasum":"9a645a0a64ff6cbf9efda96ee0b4a6909184c363","tarball":"http://registry-npm.ywwl.com/d3-polygon/download/d3-polygon-1.0.5.tgz","fileCount":15,"unpackedSize":48587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbgHX2CRA9TVsSAnZWagAAjTIP/RsHskJGH6WfIrgMEukg\navGBL2ZVBnSVyn3yF+dqv/9XalYzJGLwvl3gNZDmcC5mUeE/e9ahH9xKcg+b\nTcxQ9iEB9Lt8hiDaOCIIPJJHT3qq82wjhYtY6GIREyBUiESZvM4kvM2EKjmt\nAwtyQZZiAgZmyEuRxiOPMLn/0XjJC1oHUbNfCjqFLuIQvVD5j375p33nadRc\n/UkRzE2hTLAaA3s0566jCdfYNUvhi9mfemqyPObrEa4LUaOl7hxRlWG0KZGn\nJ5o/p1MvXy3CBTq4GuDtAUbOQYPB2cUKTvSykqqJarQdtfs8vCMJzBdsfKmw\n6Q+4Nn25frG1i19uPJxRq34rWT5DMnBcp5WINGAL3J/T9Lnb8unp7fGPo3xR\nn3N7rzL1Td3OYZGgVvxMLYewAJRUzEaLp1dqJAadbRZJA3a8nawVsKIO5nKO\n5vFxhUqdhzvMduRo6MrJRnMs03sxDQdKSFI2fH1Jvh0Uly7Jvlk05J3wo5lj\nma9j5lkmy/5+KNSSczcfzDiBF7EqUFHzaHd4JUxYmD0CBQV/oIBqrqsSzdJ2\njSLJukCTi+nE6mrCO19XzjdOaTdwa+4aCPxtaqxk1tkS1bvY2wiOjTvEk3bF\nSfZk0pPmqW+2z8QO+VdYVRr6huThpAHBw+l5VLcLejDVz8u4G2AvkN/Tf2Di\nHc2t\r\n=wYwu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDGil9f9Slrdl744V3pXBiHURrzRMAFECIWdIvv71xpiAiBeA0kVpnb5pwkeSKArnO4h9Jv4boUE2lU9q7NAdKbvUw=="}],"size":15711,"noattachment":false,"key":"/d3-polygon/-/d3-polygon-1.0.5.tgz"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/d3-polygon_1.0.5_1535145462232_0.18502851243664664"},"_hasShrinkwrap":false,"readme":"# d3-polygon\n\nThis module provides a few basic geometric operations for two-dimensional polygons. Each polygon is represented as an array of two-element arrays [​[<i>x1</i>, <i>y1</i>], [<i>x2</i>, <i>y2</i>], …], and may either be closed (wherein the first and last point are the same) or open (wherein they are not). Typically polygons are in counterclockwise order, assuming a coordinate system where the origin ⟨0,0⟩ is in the top-left corner.\n\n## Installing\n\nIf you use npm, `npm install d3-polygon`. You can also download the [latest release on GitHub](https://github.com/d3/d3-polygon/releases/latest). For vanilla HTML in modern browsers, import d3-polygon from Skypack:\n\n```html\n<script type=\"module\">\n\nimport {polygonHull} from \"https://cdn.skypack.dev/d3-polygon@3\";\n\nconst hull = polygonHull(points);\n\n</script>\n```\n\nFor legacy environments, you can load d3-polygon’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported:\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/d3-polygon@3\"></script>\n<script>\n\nconst hull = d3.polygonHull(points);\n\n</script>\n```\n\n## API Reference\n\n<a href=\"#polygonArea\" name=\"polygonArea\">#</a> d3.<b>polygonArea</b>(<i>polygon</i>) [<>](https://github.com/d3/d3-polygon/blob/master/src/area.js \"Source Code\")\n\nReturns the signed area of the specified *polygon*. If the vertices of the polygon are in counterclockwise order (assuming a coordinate system where the origin ⟨0,0⟩ is in the top-left corner), the returned area is positive; otherwise it is negative, or zero.\n\n<a href=\"#polygonCentroid\" name=\"polygonCentroid\">#</a> d3.<b>polygonCentroid</b>(<i>polygon</i>) [<>](https://github.com/d3/d3-polygon/blob/master/src/centroid.js \"Source Code\")\n\nReturns the [centroid](https://en.wikipedia.org/wiki/Centroid) of the specified *polygon*.\n\n<a href=\"#polygonHull\" name=\"polygonHull\">#</a> d3.<b>polygonHull</b>(<i>points</i>) [<>](https://github.com/d3/d3-polygon/blob/master/src/hull.js#L23 \"Source Code\")\n\n<a href=\"http://bl.ocks.org/mbostock/6f14f7b7f267a85f7cdc\"><img src=\"https://raw.githubusercontent.com/d3/d3-polygon/master/img/hull.png\" width=\"250\" height=\"250\"></a>\n\nReturns the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) of the specified *points* using [Andrew’s monotone chain algorithm](http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain). The returned hull is represented as an array containing a subset of the input *points* arranged in counterclockwise order. Returns null if *points* has fewer than three elements.\n\n<a href=\"#polygonContains\" name=\"polygonContains\">#</a> d3.<b>polygonContains</b>(<i>polygon</i>, <i>point</i>) [<>](https://github.com/d3/d3-polygon/blob/master/src/contains.js \"Source Code\")\n\nReturns true if and only if the specified *point* is inside the specified *polygon*.\n\n<a href=\"#polygonLength\" name=\"polygonLength\">#</a> d3.<b>polygonLength</b>(<i>polygon</i>) [<>](https://github.com/d3/d3-polygon/blob/master/src/length.js \"Source Code\")\n\nReturns the length of the perimeter of the specified *polygon*.\n","publish_time":1535145462346,"_cnpm_publish_time":1535145462346,"dist-tags":{"latest":"3.0.2"}}