pax_global_header 0000666 0000000 0000000 00000000064 13060564314 0014514 g ustar 00root root 0000000 0000000 52 comment=1bfcdc8b63578b936c785639fa73cec566713c45
d3-polygon-1.0.3/ 0000775 0000000 0000000 00000000000 13060564314 0013510 5 ustar 00root root 0000000 0000000 d3-polygon-1.0.3/.eslintrc 0000664 0000000 0000000 00000000147 13060564314 0015336 0 ustar 00root root 0000000 0000000 parserOptions:
sourceType: module
extends:
"eslint:recommended"
rules:
no-cond-assign: 0
d3-polygon-1.0.3/.gitignore 0000664 0000000 0000000 00000000100 13060564314 0015467 0 ustar 00root root 0000000 0000000 *.sublime-workspace
.DS_Store
build/
node_modules
npm-debug.log
d3-polygon-1.0.3/.npmignore 0000664 0000000 0000000 00000000036 13060564314 0015506 0 ustar 00root root 0000000 0000000 *.sublime-*
build/*.zip
test/
d3-polygon-1.0.3/LICENSE 0000664 0000000 0000000 00000002703 13060564314 0014517 0 ustar 00root root 0000000 0000000 Copyright 2010-2016 Mike Bostock
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
d3-polygon-1.0.3/README.md 0000664 0000000 0000000 00000006125 13060564314 0014773 0 ustar 00root root 0000000 0000000 # d3-polygon
This module provides a few basic geometric operations for two-dimensional polygons. Each polygon is represented as an array of two-element arrays [[x1, y1], [x2, y2], …], 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.
## Installing
If you use NPM, `npm install d3-polygon`. Otherwise, download the [latest release](https://github.com/d3/d3-polygon/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-polygon.v1.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
```html
```
[Try d3-polygon in your browser.](https://tonicdev.com/npm/d3-polygon)
## API Reference
# d3.polygonArea(polygon) [<>](https://github.com/d3/d3-polygon/blob/master/src/area.js#L1 "Source Code")
Returns 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.
# d3.polygonCentroid(polygon) [<>](https://github.com/d3/d3-polygon/blob/master/src/centroid.js#L1 "Source Code")
Returns the [centroid](https://en.wikipedia.org/wiki/Centroid) of the specified *polygon*.
# d3.polygonHull(points) [<>](https://github.com/d3/d3-polygon/blob/master/src/hull.js#L23 "Source Code")
Returns 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.
# d3.polygonContains(polygon, point) [<>](https://github.com/d3/d3-polygon/blob/master/src/contains.js#L1 "Source Code")
Returns true if and only if the specified *point* is [inside the specified *polygon*](https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html).
# d3.polygonLength(polygon) [<>](https://github.com/d3/d3-polygon/blob/master/src/length.js#L1 "Source Code")
Returns the length of the perimeter of the specified *polygon*.
d3-polygon-1.0.3/d3-polygon.sublime-project 0000664 0000000 0000000 00000000271 13060564314 0020531 0 ustar 00root root 0000000 0000000 {
"folders": [
{
"path": ".",
"file_exclude_patterns": [
"*.sublime-workspace"
],
"folder_exclude_patterns": [
"build"
]
}
]
}
d3-polygon-1.0.3/img/ 0000775 0000000 0000000 00000000000 13060564314 0014264 5 ustar 00root root 0000000 0000000 d3-polygon-1.0.3/img/hull.png 0000664 0000000 0000000 00000025753 13060564314 0015752 0 ustar 00root root 0000000 0000000 PNG
IHDR /
iCCPICC Profile HPSϽBc**!JbG\*"TV",*X#}o{3ߜ||䜙 _f i,A=*:
8 )a2AA w}l_%Nd !d!|
_ 5VegyAg3-?ϽssB d
8 ~GlCF#lcsy["Jb"됑g0--} Ou8/drD<-s{p35vo
PG$ ]ٳt?.0=,' }lS])X|[`Az>/u~C b,pNRXgs#.pfJwQ^ (}cZbo,ZYIa>=Da'xxp|~&?5hToQ>3;Tnr8X'H? VϞ+_#r-I3x,cC wn'}OKb. $Y15 | bNrvpf%df:fi TFXa ,Ҁ f
n
pԁhyp \6xx&G0
A@THR O
8 !BEP)T C?Cy
4݇FqFdXVav0x9́38 U1
>_o+xP$
2B٢QT"Jڀ*@PM.T&jEStG
Rt
AOc(%Da8U|L1ӊ|b4냍&cbw`a!(vp@Ý>IxU9sY
s4AE'5]jB:a0M$adfb xD"H$.iBL!}&KX\K&'P(J%RO@yB$F3c6{#Nw_!#^,~Rk SbDD]IIdd+/pRRRl*TU'U>s/2tWz*KPSRQU
M먇7? jj$jјT\٨@eu@OkJ[G;R{v9NN#]nn-=^!A}XJ?ILl`m58d0d13V5"e5ӌsۍߘhĘ13njejZmL,읹9˼bE[KÖVV[zYXm4mlmJlshw} ?R^,Yzɨ#ӱq؉tiY͙\EÅRU57S7[۔znGǀgg/u/WׄZneQϘ]G+{/
| %\,,d]H_(5tehC0]auÅ=SEQ&Q룮E+Ds;bp1151<_6k{g˯PXJ̕'0qq
q_*d<#<~:zvac'8&%u}aM_pܫlҮ*>=}YuDuO?(|ׅ7(5jb
8dTLk.l-?|߉'Ni*oAmk&ړڇ;;:};{Z132gv%;;s.d7yў=/D];pK^.x+Wm_oկmmw
v
-:{7/bܺv{;wݍ;|}od?~QcOT[OF_ױggU0qzk|岗c_!G7t"jb̻~34c驂O>~%u}h&mf0
81w P0 Ql s9YP@&