Comparing version 1.8.1 to 1.9.0
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-geo/ Version 1.8.1. Copyright 2017 Mike Bostock. | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],t):t(n.d3=n.d3||{},n.d3)}(this,function(n,t){"use strict";function r(){this.reset()}function i(n,t,r){var i=n.s=t+r,e=i-t,o=i-e;n.t=t-o+(r-e)}function e(n){return n>1?0:n<-1?Ft:Math.acos(n)}function o(n){return n>1?It:n<-1?-It:Math.asin(n)}function u(n){return(n=$t(n/2))*n}function c(){}function a(n,t){n&&er.hasOwnProperty(n.type)&&er[n.type](n,t)}function l(n,t,r){var i,e=-1,o=n.length-r;for(t.lineStart();++e<o;)i=n[e],t.point(i[0],i[1],i[2]);t.lineEnd()}function f(n,t){var r=-1,i=n.length;for(t.polygonStart();++r<i;)l(n[r],t,1);t.polygonEnd()}function p(){ar.point=h}function s(){g(ut,ct)}function h(n,t){ar.point=g,ut=n,ct=t,at=n*=Xt,lt=Jt(t=(t*=Xt)/2+Bt),ft=$t(t)}function g(n,t){t=(t*=Xt)/2+Bt;var r=(n*=Xt)-at,i=r>=0?1:-1,e=i*r,o=Jt(t),u=$t(t),c=ft*u,a=lt*o+c*Jt(e),l=c*i*$t(e);ur.add(Ht(l,a)),at=n,lt=o,ft=u}function v(n){return[Ht(n[1],n[0]),o(n[2])]}function d(n){var t=n[0],r=n[1],i=Jt(r);return[i*Jt(t),i*$t(t),$t(r)]}function E(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function y(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function S(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function m(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function M(n){var t=tr(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function x(n,t){St.push(mt=[pt=n,ht=n]),t<st&&(st=t),t>gt&&(gt=t)}function _(n,t){var r=d([n*Xt,t*Xt]);if(yt){var i=y(yt,r),e=y([i[1],-i[0],0],i);M(e),e=v(e);var o,u=n-vt,c=u>0?1:-1,a=e[0]*Ut*c,l=Yt(u)>180;l^(c*vt<a&&a<c*n)?(o=e[1]*Ut)>gt&&(gt=o):(a=(a+360)%360-180,l^(c*vt<a&&a<c*n)?(o=-e[1]*Ut)<st&&(st=o):(t<st&&(st=t),t>gt&&(gt=t))),l?n<vt?A(pt,n)>A(pt,ht)&&(ht=n):A(n,ht)>A(pt,ht)&&(pt=n):ht>=pt?(n<pt&&(pt=n),n>ht&&(ht=n)):n>vt?A(pt,n)>A(pt,ht)&&(ht=n):A(n,ht)>A(pt,ht)&&(pt=n)}else St.push(mt=[pt=n,ht=n]);t<st&&(st=t),t>gt&&(gt=t),yt=r,vt=n}function N(){fr.point=_}function w(){mt[0]=pt,mt[1]=ht,fr.point=x,yt=null}function C(n,t){if(yt){var r=n-vt;lr.add(Yt(r)>180?r+(r>0?360:-360):r)}else dt=n,Et=t;ar.point(n,t),_(n,t)}function P(){ar.lineStart()}function R(){C(dt,Et),ar.lineEnd(),Yt(lr)>kt&&(pt=-(ht=180)),mt[0]=pt,mt[1]=ht,yt=null}function A(n,t){return(t-=n)<0?t+360:t}function j(n,t){return n[0]-t[0]}function q(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:t<n[0]||n[1]<t}function z(n,t){n*=Xt;var r=Jt(t*=Xt);b(r*Jt(n),r*$t(n),$t(t))}function b(n,t,r){_t+=(n-_t)/++Mt,Nt+=(t-Nt)/Mt,wt+=(r-wt)/Mt}function L(){pr.point=O}function O(n,t){n*=Xt;var r=Jt(t*=Xt);Lt=r*Jt(n),Ot=r*$t(n),Gt=$t(t),pr.point=G,b(Lt,Ot,Gt)}function G(n,t){n*=Xt;var r=Jt(t*=Xt),i=r*Jt(n),e=r*$t(n),o=$t(t),u=Ht(tr((u=Ot*o-Gt*e)*u+(u=Gt*i-Lt*o)*u+(u=Lt*e-Ot*i)*u),Lt*i+Ot*e+Gt*o);xt+=u,Ct+=u*(Lt+(Lt=i)),Pt+=u*(Ot+(Ot=e)),Rt+=u*(Gt+(Gt=o)),b(Lt,Ot,Gt)}function T(){pr.point=z}function k(){pr.point=I}function F(){B(zt,bt),pr.point=z}function I(n,t){zt=n,bt=t,n*=Xt,t*=Xt,pr.point=B;var r=Jt(t);Lt=r*Jt(n),Ot=r*$t(n),Gt=$t(t),b(Lt,Ot,Gt)}function B(n,t){n*=Xt;var r=Jt(t*=Xt),i=r*Jt(n),e=r*$t(n),u=$t(t),c=Ot*u-Gt*e,a=Gt*i-Lt*u,l=Lt*e-Ot*i,f=tr(c*c+a*a+l*l),p=o(f),s=f&&-p/f;At+=s*c,jt+=s*a,qt+=s*l,xt+=p,Ct+=p*(Lt+(Lt=i)),Pt+=p*(Ot+(Ot=e)),Rt+=p*(Gt+(Gt=u)),b(Lt,Ot,Gt)}function D(n,t){return[n>Ft?n-Dt:n<-Ft?n+Dt:n,t]}function U(n,t,r){return(n%=Dt)?t||r?hr(Y(n),Z(t,r)):Y(n):t||r?Z(t,r):D}function X(n){return function(t,r){return t+=n,[t>Ft?t-Dt:t<-Ft?t+Dt:t,r]}}function Y(n){var t=X(n);return t.invert=X(-n),t}function Z(n,t){function r(n,t){var r=Jt(t),a=Jt(n)*r,l=$t(n)*r,f=$t(t),p=f*i+a*e;return[Ht(l*u-p*c,a*i-f*e),o(p*u+l*c)]}var i=Jt(n),e=$t(n),u=Jt(t),c=$t(t);return r.invert=function(n,t){var r=Jt(t),a=Jt(n)*r,l=$t(n)*r,f=$t(t),p=f*u-l*c;return[Ht(l*u+f*c,a*i+p*e),o(p*i-a*e)]},r}function H(n,t,r,i,e,o){if(r){var u=Jt(t),c=$t(t),a=i*r;null==e?(e=t+i*Dt,o=t-a/2):(e=J(u,e),o=J(u,o),(i>0?e<o:e>o)&&(e+=i*Dt));for(var l,f=e;i>0?f>o:f<o;f-=a)l=v([u,-c*Jt(f),-c*$t(f)]),n.point(l[0],l[1])}}function J(n,t){(t=d(t))[0]-=n,M(t);var r=e(-t[1]);return((-t[2]<0?-r:r)+Dt-kt)%Dt}function K(n,t,r,i){this.x=n,this.z=t,this.o=r,this.e=i,this.v=!1,this.n=this.p=null}function Q(n){if(t=n.length){for(var t,r,i=0,e=n[0];++i<t;)e.n=r=n[i],r.p=e,e=r;e.n=r=n[0],r.p=e}}function V(n){return n.length>1}function W(n,t){return((n=n.x)[0]<0?n[1]-It-kt:It-n[1])-((t=t.x)[0]<0?t[1]-It-kt:It-t[1])}function $(n,t,r,i){var e,o,u=$t(n-r);return Yt(u)>kt?Zt(($t(t)*(o=Jt(i))*$t(r)-$t(i)*(e=Jt(t))*$t(n))/(e*o*u)):(t+i)/2}function nn(n,r,i,e){function o(t,o){return n<=t&&t<=i&&r<=o&&o<=e}function u(t,o,u,a){var f=0,p=0;if(null==t||(f=c(t,u))!==(p=c(o,u))||l(t,o)<0^u>0)do{a.point(0===f||3===f?n:i,f>1?e:r)}while((f=(f+u+4)%4)!==p);else a.point(o[0],o[1])}function c(t,e){return Yt(t[0]-n)<kt?e>0?0:3:Yt(t[0]-i)<kt?e>0?2:1:Yt(t[1]-r)<kt?e>0?1:0:e>0?3:2}function a(n,t){return l(n.x,t.x)}function l(n,t){var r=c(n,1),i=c(t,1);return r!==i?r-i:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}return function(c){function l(n,t){o(n,t)&&_.point(n,t)}function f(){for(var t=0,r=0,i=h.length;r<i;++r)for(var o,u,c=h[r],a=1,l=c.length,f=c[0],p=f[0],s=f[1];a<l;++a)o=p,u=s,p=(f=c[a])[0],s=f[1],u<=e?s>e&&(p-o)*(e-u)>(s-u)*(n-o)&&++t:s<=e&&(p-o)*(e-u)<(s-u)*(n-o)&&--t;return t}function p(t,u){var c=o(t,u);if(h&&g.push([t,u]),M)v=t,d=u,E=c,M=!1,c&&(_.lineStart(),_.point(t,u));else if(c&&m)_.point(t,u);else{var a=[y=Math.max(Gr,Math.min(Or,y)),S=Math.max(Gr,Math.min(Or,S))],l=[t=Math.max(Gr,Math.min(Or,t)),u=Math.max(Gr,Math.min(Or,u))];Lr(a,l,n,r,i,e)?(m||(_.lineStart(),_.point(a[0],a[1])),_.point(l[0],l[1]),c||_.lineEnd(),x=!1):c&&(_.lineStart(),_.point(t,u),x=!1)}y=t,S=u,m=c}var s,h,g,v,d,E,y,S,m,M,x,_=c,N=Cr(),w={point:l,lineStart:function(){w.point=p,h&&h.push(g=[]),M=!0,m=!1,y=S=NaN},lineEnd:function(){s&&(p(v,d),E&&m&&N.rejoin(),s.push(N.result())),w.point=l,m&&_.lineEnd()},polygonStart:function(){_=N,s=[],h=[],x=!0},polygonEnd:function(){var n=f(),r=x&&n,i=(s=t.merge(s)).length;(r||i)&&(c.polygonStart(),r&&(c.lineStart(),u(null,null,1,c),c.lineEnd()),i&&Rr(s,a,n,u,c),c.polygonEnd()),_=c,s=h=g=null}};return w}}function tn(){kr.point=kr.lineEnd=c}function rn(n,t){gr=n*=Xt,vr=$t(t*=Xt),dr=Jt(t),kr.point=en}function en(n,t){n*=Xt;var r=$t(t*=Xt),i=Jt(t),e=Yt(n-gr),o=Jt(e),u=i*$t(e),c=dr*r-vr*i*o,a=vr*r+dr*i*o;Tr.add(Ht(tr(u*u+c*c),a)),gr=n,vr=r,dr=i}function on(n,t){return!(!n||!Xr.hasOwnProperty(n.type))&&Xr[n.type](n,t)}function un(n,t){return 0===Dr(n,t)}function cn(n,t){var r=Dr(n[0],n[1]);return Dr(n[0],t)+Dr(t,n[1])<=r+kt}function an(n,t){return!!jr(n.map(ln),fn(t))}function ln(n){return(n=n.map(fn)).pop(),n}function fn(n){return[n[0]*Xt,n[1]*Xt]}function pn(n,r,i){var e=t.range(n,r-kt,i).concat(r);return function(n){return e.map(function(t){return[n,t]})}}function sn(n,r,i){var e=t.range(n,r-kt,i).concat(r);return function(n){return e.map(function(t){return[t,n]})}}function hn(){function n(){return{type:"MultiLineString",coordinates:r()}}function r(){return t.range(Kt(u/E)*E,o,E).map(h).concat(t.range(Kt(f/y)*y,l,y).map(g)).concat(t.range(Kt(e/v)*v,i,v).filter(function(n){return Yt(n%E)>kt}).map(p)).concat(t.range(Kt(a/d)*d,c,d).filter(function(n){return Yt(n%y)>kt}).map(s))}var i,e,o,u,c,a,l,f,p,s,h,g,v=10,d=v,E=90,y=360,S=2.5;return n.lines=function(){return r().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(g(l).slice(1),h(o).reverse().slice(1),g(f).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.extentMajor(t).extentMinor(t):n.extentMinor()},n.extentMajor=function(t){return arguments.length?(u=+t[0][0],o=+t[1][0],f=+t[0][1],l=+t[1][1],u>o&&(t=u,u=o,o=t),f>l&&(t=f,f=l,l=t),n.precision(S)):[[u,f],[o,l]]},n.extentMinor=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],a=+t[0][1],c=+t[1][1],e>i&&(t=e,e=i,i=t),a>c&&(t=a,a=c,c=t),n.precision(S)):[[e,a],[i,c]]},n.step=function(t){return arguments.length?n.stepMajor(t).stepMinor(t):n.stepMinor()},n.stepMajor=function(t){return arguments.length?(E=+t[0],y=+t[1],n):[E,y]},n.stepMinor=function(t){return arguments.length?(v=+t[0],d=+t[1],n):[v,d]},n.precision=function(t){return arguments.length?(S=+t,p=pn(a,c,90),s=sn(e,i,S),h=pn(f,l,90),g=sn(u,o,S),n):S},n.extentMajor([[-180,-90+kt],[180,90-kt]]).extentMinor([[-180,-80-kt],[180,80+kt]])}function gn(){Jr.point=vn}function vn(n,t){Jr.point=dn,Er=Sr=n,yr=mr=t}function dn(n,t){Hr.add(mr*n-Sr*t),Sr=n,mr=t}function En(){dn(Er,yr)}function yn(n,t){ni+=n,ti+=t,++ri}function Sn(){li.point=mn}function mn(n,t){li.point=Mn,yn(_r=n,Nr=t)}function Mn(n,t){var r=n-_r,i=t-Nr,e=tr(r*r+i*i);ii+=e*(_r+n)/2,ei+=e*(Nr+t)/2,oi+=e,yn(_r=n,Nr=t)}function xn(){li.point=yn}function _n(){li.point=wn}function Nn(){Cn(Mr,xr)}function wn(n,t){li.point=Cn,yn(Mr=_r=n,xr=Nr=t)}function Cn(n,t){var r=n-_r,i=t-Nr,e=tr(r*r+i*i);ii+=e*(_r+n)/2,ei+=e*(Nr+t)/2,oi+=e,ui+=(e=Nr*n-_r*t)*(_r+n),ci+=e*(Nr+t),ai+=3*e,yn(_r=n,Nr=t)}function Pn(n){this._context=n}function Rn(n,t){di.point=An,pi=hi=n,si=gi=t}function An(n,t){hi-=n,gi-=t,vi.add(tr(hi*hi+gi*gi)),hi=n,gi=t}function jn(){this._string=[]}function qn(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function zn(n){return function(t){var r=new bn;for(var i in n)r[i]=n[i];return r.stream=t,r}}function bn(){}function Ln(n,t,r){var i=t[1][0]-t[0][0],e=t[1][1]-t[0][1],o=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),null!=o&&n.clipExtent(null),or(r,n.stream($r));var u=$r.result(),c=Math.min(i/(u[1][0]-u[0][0]),e/(u[1][1]-u[0][1])),a=+t[0][0]+(i-c*(u[1][0]+u[0][0]))/2,l=+t[0][1]+(e-c*(u[1][1]+u[0][1]))/2;return null!=o&&n.clipExtent(o),n.scale(150*c).translate([a,l])}function On(n,t,r){return Ln(n,[[0,0],t],r)}function Gn(n){return zn({point:function(t,r){t=n(t,r),this.stream.point(t[0],t[1])}})}function Tn(n,t){function r(i,e,u,c,a,l,f,p,s,h,g,v,d,E){var y=f-i,S=p-e,m=y*y+S*S;if(m>4*t&&d--){var M=c+h,x=a+g,_=l+v,N=tr(M*M+x*x+_*_),w=o(_/=N),C=Yt(Yt(_)-1)<kt||Yt(u-s)<kt?(u+s)/2:Ht(x,M),P=n(C,w),R=P[0],A=P[1],j=R-i,q=A-e,z=S*j-y*q;(z*z/m>t||Yt((y*j+S*q)/m-.5)>.3||c*h+a*g+l*v<yi)&&(r(i,e,u,c,a,l,R,A,C,M/=N,x/=N,_,d,E),E.point(R,A),r(R,A,C,M,x,_,f,p,s,h,g,v,d,E))}}return function(t){function i(r,i){r=n(r,i),t.point(r[0],r[1])}function e(){y=NaN,_.point=o,t.lineStart()}function o(i,e){var o=d([i,e]),u=n(i,e);r(y,S,E,m,M,x,y=u[0],S=u[1],E=i,m=o[0],M=o[1],x=o[2],Ei,t),t.point(y,S)}function u(){_.point=i,t.lineEnd()}function c(){e(),_.point=a,_.lineEnd=l}function a(n,t){o(f=n,t),p=y,s=S,h=m,g=M,v=x,_.point=o}function l(){r(y,S,E,m,M,x,p,s,f,h,g,v,Ei,t),_.lineEnd=u,u()}var f,p,s,h,g,v,E,y,S,m,M,x,_={point:i,lineStart:e,lineEnd:u,polygonStart:function(){t.polygonStart(),_.lineStart=c},polygonEnd:function(){t.polygonEnd(),_.lineStart=e}};return _}}function kn(n){return zn({point:function(t,r){var i=n(t,r);return this.stream.point(i[0],i[1])}})}function Fn(n){return In(function(){return n})()}function In(n){function t(n){return n=f(n[0]*Xt,n[1]*Xt),[n[0]*d+c,a-n[1]*d]}function r(n){return(n=f.invert((n[0]-c)/d,(a-n[1])/d))&&[n[0]*Ut,n[1]*Ut]}function i(n,t){return n=u(n,t),[n[0]*d+c,a-n[1]*d]}function e(){f=hr(l=U(M,x,_),u);var n=u(S,m);return c=E-n[0]*d,a=y+n[1]*d,o()}function o(){return g=v=null,t}var u,c,a,l,f,p,s,h,g,v,d=150,E=480,y=250,S=0,m=0,M=0,x=0,_=0,N=null,w=zr,C=null,P=Yr,R=.5,A=Si(i,R);return t.stream=function(n){return g&&v===n?g:g=mi(kn(l)(w(A(P(v=n)))))},t.preclip=function(n){return arguments.length?(w=n,N=void 0,o()):w},t.postclip=function(n){return arguments.length?(P=n,C=p=s=h=null,o()):P},t.clipAngle=function(n){return arguments.length?(w=+n?br(N=n*Xt):(N=null,zr),o()):N*Ut},t.clipExtent=function(n){return arguments.length?(P=null==n?(C=p=s=h=null,Yr):nn(C=+n[0][0],p=+n[0][1],s=+n[1][0],h=+n[1][1]),o()):null==C?null:[[C,p],[s,h]]},t.scale=function(n){return arguments.length?(d=+n,e()):d},t.translate=function(n){return arguments.length?(E=+n[0],y=+n[1],e()):[E,y]},t.center=function(n){return arguments.length?(S=n[0]%360*Xt,m=n[1]%360*Xt,e()):[S*Ut,m*Ut]},t.rotate=function(n){return arguments.length?(M=n[0]%360*Xt,x=n[1]%360*Xt,_=n.length>2?n[2]%360*Xt:0,e()):[M*Ut,x*Ut,_*Ut]},t.precision=function(n){return arguments.length?(A=Si(i,R=n*n),o()):tr(R)},t.fitExtent=function(n,r){return Ln(t,n,r)},t.fitSize=function(n,r){return On(t,n,r)},function(){return u=n.apply(this,arguments),t.invert=u.invert&&r,e()}}function Bn(n){var t=0,r=Ft/3,i=In(n),e=i(t,r);return e.parallels=function(n){return arguments.length?i(t=n[0]*Xt,r=n[1]*Xt):[t*Ut,r*Ut]},e}function Dn(n){function t(n,t){return[n*r,$t(t)/r]}var r=Jt(n);return t.invert=function(n,t){return[n/r,o(t*r)]},t}function Un(n,t){function r(n,t){var r=tr(u-2*e*$t(t))/e;return[r*$t(n*=e),c-r*Jt(n)]}var i=$t(n),e=(i+$t(t))/2;if(Yt(e)<kt)return Dn(n);var u=1+i*(2*e-i),c=tr(u)/e;return r.invert=function(n,t){var r=c-t;return[Ht(n,Yt(r))/e*nr(r),o((u-(n*n+r*r)*e*e)/(2*e))]},r}function Xn(n){var t=n.length;return{point:function(r,i){for(var e=-1;++e<t;)n[e].point(r,i)},sphere:function(){for(var r=-1;++r<t;)n[r].sphere()},lineStart:function(){for(var r=-1;++r<t;)n[r].lineStart()},lineEnd:function(){for(var r=-1;++r<t;)n[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<t;)n[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<t;)n[r].polygonEnd()}}}function Yn(n){return function(t,r){var i=Jt(t),e=Jt(r),o=n(i*e);return[o*e*$t(t),o*$t(r)]}}function Zn(n){return function(t,r){var i=tr(t*t+r*r),e=n(i),u=$t(e),c=Jt(e);return[Ht(t*u,i*c),o(i&&r*u/i)]}}function Hn(n,t){return[n,Vt(rr((It+t)/2))]}function Jn(n){function t(){var t=Ft*c(),u=o(wr(o.rotate()).invert([0,0]));return l(null==f?[[u[0]-t,u[1]-t],[u[0]+t,u[1]+t]]:n===Hn?[[Math.max(u[0]-t,f),r],[Math.min(u[0]+t,i),e]]:[[f,Math.max(u[1]-t,r)],[i,Math.min(u[1]+t,e)]])}var r,i,e,o=Fn(n),u=o.center,c=o.scale,a=o.translate,l=o.clipExtent,f=null;return o.scale=function(n){return arguments.length?(c(n),t()):c()},o.translate=function(n){return arguments.length?(a(n),t()):a()},o.center=function(n){return arguments.length?(u(n),t()):u()},o.clipExtent=function(n){return arguments.length?(null==n?f=r=i=e=null:(f=+n[0][0],r=+n[0][1],i=+n[1][0],e=+n[1][1]),t()):null==f?null:[[f,r],[i,e]]},t()}function Kn(n){return rr((It+n)/2)}function Qn(n,t){function r(n,t){o>0?t<-It+kt&&(t=-It+kt):t>It-kt&&(t=It-kt);var r=o/Wt(Kn(t),e);return[r*$t(e*n),o-r*Jt(e*n)]}var i=Jt(n),e=n===t?$t(n):Vt(i/Jt(t))/Vt(Kn(t)/Kn(n)),o=i*Wt(Kn(n),e)/e;return e?(r.invert=function(n,t){var r=o-t,i=nr(e)*tr(n*n+r*r);return[Ht(n,Yt(r))/e*nr(r),2*Zt(Wt(o/i,1/e))-It]},r):Hn}function Vn(n,t){return[n,t]}function Wn(n,t){function r(n,t){var r=o-t,i=e*n;return[r*$t(i),o-r*Jt(i)]}var i=Jt(n),e=n===t?$t(n):(i-Jt(t))/(t-n),o=i/e+n;return Yt(e)<kt?Vn:(r.invert=function(n,t){var r=o-t;return[Ht(n,Yt(r))/e*nr(r),o-nr(e)*tr(n*n+r*r)]},r)}function $n(n,t){var r=Jt(t),i=Jt(n)*r;return[r*$t(n)/i,$t(t)/i]}function nt(n,t,r,i){return 1===n&&1===t&&0===r&&0===i?Yr:zn({point:function(e,o){this.stream.point(e*n+r,o*t+i)}})}function tt(n,t){var r=t*t,i=r*r;return[n*(.8707-.131979*r+i*(i*(.003971*r-.001529*i)-.013791)),t*(1.007226+r*(.015085+i*(.028874*r-.044475-.005916*i)))]}function rt(n,t){return[Jt(t)*$t(n),$t(t)]}function it(n,t){var r=Jt(t),i=1+Jt(n)*r;return[r*$t(n)/i,$t(t)/i]}function et(n,t){return[Vt(rr((It+t)/2)),-n]}var ot=function(){return new r};r.prototype={constructor:r,reset:function(){this.s=this.t=0},add:function(n){i(Tt,n,this.t),i(this,Tt.s,this.s),this.s?this.t+=Tt.t:this.s=Tt.t},valueOf:function(){return this.s}};var ut,ct,at,lt,ft,pt,st,ht,gt,vt,dt,Et,yt,St,mt,Mt,xt,_t,Nt,wt,Ct,Pt,Rt,At,jt,qt,zt,bt,Lt,Ot,Gt,Tt=new r,kt=1e-6,Ft=Math.PI,It=Ft/2,Bt=Ft/4,Dt=2*Ft,Ut=180/Ft,Xt=Ft/180,Yt=Math.abs,Zt=Math.atan,Ht=Math.atan2,Jt=Math.cos,Kt=Math.ceil,Qt=Math.exp,Vt=Math.log,Wt=Math.pow,$t=Math.sin,nr=Math.sign||function(n){return n>0?1:n<0?-1:0},tr=Math.sqrt,rr=Math.tan,ir={Feature:function(n,t){a(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)a(r[i].geometry,t)}},er={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)n=r[i],t.point(n[0],n[1],n[2])},LineString:function(n,t){l(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)l(r[i],t,0)},Polygon:function(n,t){f(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)f(r[i],t)},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)a(r[i],t)}},or=function(n,t){n&&ir.hasOwnProperty(n.type)?ir[n.type](n,t):a(n,t)},ur=ot(),cr=ot(),ar={point:c,lineStart:c,lineEnd:c,polygonStart:function(){ur.reset(),ar.lineStart=p,ar.lineEnd=s},polygonEnd:function(){var n=+ur;cr.add(n<0?Dt+n:n),this.lineStart=this.lineEnd=this.point=c},sphere:function(){cr.add(Dt)}},lr=ot(),fr={point:x,lineStart:N,lineEnd:w,polygonStart:function(){fr.point=C,fr.lineStart=P,fr.lineEnd=R,lr.reset(),ar.polygonStart()},polygonEnd:function(){ar.polygonEnd(),fr.point=x,fr.lineStart=N,fr.lineEnd=w,ur<0?(pt=-(ht=180),st=-(gt=90)):lr>kt?gt=90:lr<-kt&&(st=-90),mt[0]=pt,mt[1]=ht}},pr={sphere:c,point:z,lineStart:L,lineEnd:T,polygonStart:function(){pr.lineStart=k,pr.lineEnd=F},polygonEnd:function(){pr.lineStart=L,pr.lineEnd=T}},sr=function(n){return function(){return n}},hr=function(n,t){function r(r,i){return r=n(r,i),t(r[0],r[1])}return n.invert&&t.invert&&(r.invert=function(r,i){return(r=t.invert(r,i))&&n.invert(r[0],r[1])}),r};D.invert=D;var gr,vr,dr,Er,yr,Sr,mr,Mr,xr,_r,Nr,wr=function(n){function t(t){return t=n(t[0]*Xt,t[1]*Xt),t[0]*=Ut,t[1]*=Ut,t}return n=U(n[0]*Xt,n[1]*Xt,n.length>2?n[2]*Xt:0),t.invert=function(t){return t=n.invert(t[0]*Xt,t[1]*Xt),t[0]*=Ut,t[1]*=Ut,t},t},Cr=function(){var n,t=[];return{point:function(t,r){n.push([t,r])},lineStart:function(){t.push(n=[])},lineEnd:c,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}},Pr=function(n,t){return Yt(n[0]-t[0])<kt&&Yt(n[1]-t[1])<kt},Rr=function(n,t,r,i,e){var o,u,c=[],a=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,r,i=n[0],u=n[t];if(Pr(i,u)){for(e.lineStart(),o=0;o<t;++o)e.point((i=n[o])[0],i[1]);e.lineEnd()}else c.push(r=new K(i,n,null,!0)),a.push(r.o=new K(i,null,r,!1)),c.push(r=new K(u,n,null,!1)),a.push(r.o=new K(u,null,r,!0))}}),c.length){for(a.sort(t),Q(c),Q(a),o=0,u=a.length;o<u;++o)a[o].e=r=!r;for(var l,f,p=c[0];;){for(var s=p,h=!0;s.v;)if((s=s.n)===p)return;l=s.z,e.lineStart();do{if(s.v=s.o.v=!0,s.e){if(h)for(o=0,u=l.length;o<u;++o)e.point((f=l[o])[0],f[1]);else i(s.x,s.n.x,1,e);s=s.n}else{if(h)for(l=s.p.z,o=l.length-1;o>=0;--o)e.point((f=l[o])[0],f[1]);else i(s.x,s.p.x,-1,e);s=s.p}l=(s=s.o).z,h=!h}while(!s.v);e.lineEnd()}}},Ar=ot(),jr=function(n,t){var r=t[0],i=t[1],e=[$t(r),-Jt(r),0],u=0,c=0;Ar.reset();for(var a=0,l=n.length;a<l;++a)if(p=(f=n[a]).length)for(var f,p,s=f[p-1],h=s[0],g=s[1]/2+Bt,v=$t(g),E=Jt(g),S=0;S<p;++S,h=x,v=N,E=w,s=m){var m=f[S],x=m[0],_=m[1]/2+Bt,N=$t(_),w=Jt(_),C=x-h,P=C>=0?1:-1,R=P*C,A=R>Ft,j=v*N;if(Ar.add(Ht(j*P*$t(R),E*w+j*Jt(R))),u+=A?C+P*Dt:C,A^h>=r^x>=r){var q=y(d(s),d(m));M(q);var z=y(e,q);M(z);var b=(A^C>=0?-1:1)*o(z[2]);(i>b||i===b&&(q[0]||q[1]))&&(c+=A^C>=0?1:-1)}}return(u<-kt||u<kt&&Ar<-kt)^1&c},qr=function(n,r,i,e){return function(o){function u(t,r){n(t,r)&&o.point(t,r)}function c(n,t){d.point(n,t)}function a(){m.point=c,d.lineStart()}function l(){m.point=u,d.lineEnd()}function f(n,t){v.push([n,t]),y.point(n,t)}function p(){y.lineStart(),v=[]}function s(){f(v[0][0],v[0][1]),y.lineEnd();var n,t,r,i,e=y.clean(),u=E.result(),c=u.length;if(v.pop(),h.push(v),v=null,c)if(1&e){if(r=u[0],(t=r.length-1)>0){for(S||(o.polygonStart(),S=!0),o.lineStart(),n=0;n<t;++n)o.point((i=r[n])[0],i[1]);o.lineEnd()}}else c>1&&2&e&&u.push(u.pop().concat(u.shift())),g.push(u.filter(V))}var h,g,v,d=r(o),E=Cr(),y=r(E),S=!1,m={point:u,lineStart:a,lineEnd:l,polygonStart:function(){m.point=f,m.lineStart=p,m.lineEnd=s,g=[],h=[]},polygonEnd:function(){m.point=u,m.lineStart=a,m.lineEnd=l,g=t.merge(g);var n=jr(h,e);g.length?(S||(o.polygonStart(),S=!0),Rr(g,W,n,i,o)):n&&(S||(o.polygonStart(),S=!0),o.lineStart(),i(null,null,1,o),o.lineEnd()),S&&(o.polygonEnd(),S=!1),g=h=null},sphere:function(){o.polygonStart(),o.lineStart(),i(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return m}},zr=qr(function(){return!0},function(n){var t,r=NaN,i=NaN,e=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(o,u){var c=o>0?Ft:-Ft,a=Yt(o-r);Yt(a-Ft)<kt?(n.point(r,i=(i+u)/2>0?It:-It),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),n.point(o,i),t=0):e!==c&&a>=Ft&&(Yt(r-e)<kt&&(r-=e*kt),Yt(o-c)<kt&&(o-=c*kt),i=$(r,i,o,u),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),t=0),n.point(r=o,i=u),e=c},lineEnd:function(){n.lineEnd(),r=i=NaN},clean:function(){return 2-t}}},function(n,t,r,i){var e;if(null==n)e=r*It,i.point(-Ft,e),i.point(0,e),i.point(Ft,e),i.point(Ft,0),i.point(Ft,-e),i.point(0,-e),i.point(-Ft,-e),i.point(-Ft,0),i.point(-Ft,e);else if(Yt(n[0]-t[0])>kt){var o=n[0]<t[0]?Ft:-Ft;e=r*o/2,i.point(-o,e),i.point(0,e),i.point(o,e)}else i.point(t[0],t[1])},[-Ft,-It]),br=function(n){function t(n,t){return Jt(n)*Jt(t)>e}function r(n,t,r){var i=[1,0,0],o=y(d(n),d(t)),u=E(o,o),c=o[0],a=u-c*c;if(!a)return!r&&n;var l=e*u/a,f=-e*c/a,p=y(i,o),s=m(i,l);S(s,m(o,f));var h=p,g=E(s,h),M=E(h,h),x=g*g-M*(E(s,s)-1);if(!(x<0)){var _=tr(x),N=m(h,(-g-_)/M);if(S(N,s),N=v(N),!r)return N;var w,C=n[0],P=t[0],R=n[1],A=t[1];P<C&&(w=C,C=P,P=w);var j=P-C,q=Yt(j-Ft)<kt,z=q||j<kt;if(!q&&A<R&&(w=R,R=A,A=w),z?q?R+A>0^N[1]<(Yt(N[0]-C)<kt?R:A):R<=N[1]&&N[1]<=A:j>Ft^(C<=N[0]&&N[0]<=P)){var b=m(h,(-g+_)/M);return S(b,s),[N,v(b)]}}}function i(t,r){var i=u?n:Ft-n,e=0;return t<-i?e|=1:t>i&&(e|=2),r<-i?e|=4:r>i&&(e|=8),e}var e=Jt(n),o=6*Xt,u=e>0,c=Yt(e)>kt;return qr(t,function(n){var e,o,a,l,f;return{lineStart:function(){l=a=!1,f=1},point:function(p,s){var h,g=[p,s],v=t(p,s),d=u?v?0:i(p,s):v?i(p+(p<0?Ft:-Ft),s):0;if(!e&&(l=a=v)&&n.lineStart(),v!==a&&(!(h=r(e,g))||Pr(e,h)||Pr(g,h))&&(g[0]+=kt,g[1]+=kt,v=t(g[0],g[1])),v!==a)f=0,v?(n.lineStart(),h=r(g,e),n.point(h[0],h[1])):(h=r(e,g),n.point(h[0],h[1]),n.lineEnd()),e=h;else if(c&&e&&u^v){var E;d&o||!(E=r(g,e,!0))||(f=0,u?(n.lineStart(),n.point(E[0][0],E[0][1]),n.point(E[1][0],E[1][1]),n.lineEnd()):(n.point(E[1][0],E[1][1]),n.lineEnd(),n.lineStart(),n.point(E[0][0],E[0][1])))}!v||e&&Pr(e,g)||n.point(g[0],g[1]),e=g,a=v,o=d},lineEnd:function(){a&&n.lineEnd(),e=null},clean:function(){return f|(l&&a)<<1}}},function(t,r,i,e){H(e,n,o,i,t,r)},u?[0,-n]:[-Ft,n-Ft])},Lr=function(n,t,r,i,e,o){var u,c=n[0],a=n[1],l=0,f=1,p=t[0]-c,s=t[1]-a;if(u=r-c,p||!(u>0)){if(u/=p,p<0){if(u<l)return;u<f&&(f=u)}else if(p>0){if(u>f)return;u>l&&(l=u)}if(u=e-c,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>l&&(l=u)}else if(p>0){if(u<l)return;u<f&&(f=u)}if(u=i-a,s||!(u>0)){if(u/=s,s<0){if(u<l)return;u<f&&(f=u)}else if(s>0){if(u>f)return;u>l&&(l=u)}if(u=o-a,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>l&&(l=u)}else if(s>0){if(u<l)return;u<f&&(f=u)}return l>0&&(n[0]=c+l*p,n[1]=a+l*s),f<1&&(t[0]=c+f*p,t[1]=a+f*s),!0}}}}},Or=1e9,Gr=-Or,Tr=ot(),kr={sphere:c,point:c,lineStart:function(){kr.point=rn,kr.lineEnd=tn},lineEnd:c,polygonStart:c,polygonEnd:c},Fr=function(n){return Tr.reset(),or(n,kr),+Tr},Ir=[null,null],Br={type:"LineString",coordinates:Ir},Dr=function(n,t){return Ir[0]=n,Ir[1]=t,Fr(Br)},Ur={Feature:function(n,t){return on(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)if(on(r[i].geometry,t))return!0;return!1}},Xr={Sphere:function(){return!0},Point:function(n,t){return un(n.coordinates,t)},MultiPoint:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(un(r[i],t))return!0;return!1},LineString:function(n,t){return cn(n.coordinates,t)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(cn(r[i],t))return!0;return!1},Polygon:function(n,t){return an(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(an(r[i],t))return!0;return!1},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)if(on(r[i],t))return!0;return!1}},Yr=function(n){return n},Zr=ot(),Hr=ot(),Jr={point:c,lineStart:c,lineEnd:c,polygonStart:function(){Jr.lineStart=gn,Jr.lineEnd=En},polygonEnd:function(){Jr.lineStart=Jr.lineEnd=Jr.point=c,Zr.add(Yt(Hr)),Hr.reset()},result:function(){var n=Zr/2;return Zr.reset(),n}},Kr=1/0,Qr=Kr,Vr=-Kr,Wr=Vr,$r={point:function(n,t){n<Kr&&(Kr=n),n>Vr&&(Vr=n),t<Qr&&(Qr=t),t>Wr&&(Wr=t)},lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c,result:function(){var n=[[Kr,Qr],[Vr,Wr]];return Vr=Wr=-(Qr=Kr=1/0),n}},ni=0,ti=0,ri=0,ii=0,ei=0,oi=0,ui=0,ci=0,ai=0,li={point:yn,lineStart:Sn,lineEnd:xn,polygonStart:function(){li.lineStart=_n,li.lineEnd=Nn},polygonEnd:function(){li.point=yn,li.lineStart=Sn,li.lineEnd=xn},result:function(){var n=ai?[ui/ai,ci/ai]:oi?[ii/oi,ei/oi]:ri?[ni/ri,ti/ri]:[NaN,NaN];return ni=ti=ri=ii=ei=oi=ui=ci=ai=0,n}};Pn.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._context.moveTo(n,t),this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Dt)}},result:c};var fi,pi,si,hi,gi,vi=ot(),di={point:c,lineStart:function(){di.point=Rn},lineEnd:function(){fi&&An(pi,si),di.point=c},polygonStart:function(){fi=!0},polygonEnd:function(){fi=null},result:function(){var n=+vi;return vi.reset(),n}};jn.prototype={_radius:4.5,_circle:qn(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._string.push("M",n,",",t),this._point=1;break;case 1:this._string.push("L",n,",",t);break;default:null==this._circle&&(this._circle=qn(this._radius)),this._string.push("M",n,",",t,this._circle)}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}return null}};bn.prototype={constructor:bn,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ei=16,yi=Jt(30*Xt),Si=function(n,t){return+t?Tn(n,t):Gn(n)},mi=zn({point:function(n,t){this.stream.point(n*Xt,t*Xt)}}),Mi=function(){return Bn(Un).scale(155.424).center([0,33.6442])},xi=function(){return Mi().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},_i=Yn(function(n){return tr(2/(1+n))});_i.invert=Zn(function(n){return 2*o(n/2)});var Ni=Yn(function(n){return(n=e(n))&&n/$t(n)});Ni.invert=Zn(function(n){return n});Hn.invert=function(n,t){return[n,2*Zt(Qt(t))-It]};Vn.invert=Vn;$n.invert=Zn(Zt);tt.invert=function(n,t){var r,i=t,e=25;do{var o=i*i,u=o*o;i-=r=(i*(1.007226+o*(.015085+u*(.028874*o-.044475-.005916*u)))-t)/(1.007226+o*(.045255+u*(.259866*o-.311325-.005916*11*u)))}while(Yt(r)>kt&&--e>0);return[n/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]};rt.invert=Zn(o);it.invert=Zn(function(n){return 2*Zt(n)});et.invert=function(n,t){return[-t,2*Zt(Qt(n))-It]};n.geoArea=function(n){return cr.reset(),or(n,ar),2*cr},n.geoBounds=function(n){var t,r,i,e,o,u,c;if(gt=ht=-(pt=st=1/0),St=[],or(n,fr),r=St.length){for(St.sort(j),t=1,o=[i=St[0]];t<r;++t)q(i,(e=St[t])[0])||q(i,e[1])?(A(i[0],e[1])>A(i[0],i[1])&&(i[1]=e[1]),A(e[0],i[1])>A(i[0],i[1])&&(i[0]=e[0])):o.push(i=e);for(u=-1/0,t=0,i=o[r=o.length-1];t<=r;i=e,++t)e=o[t],(c=A(i[1],e[0]))>u&&(u=c,pt=e[0],ht=i[1])}return St=mt=null,pt===1/0||st===1/0?[[NaN,NaN],[NaN,NaN]]:[[pt,st],[ht,gt]]},n.geoCentroid=function(n){Mt=xt=_t=Nt=wt=Ct=Pt=Rt=At=jt=qt=0,or(n,pr);var t=At,r=jt,i=qt,e=t*t+r*r+i*i;return e<1e-12&&(t=Ct,r=Pt,i=Rt,xt<kt&&(t=_t,r=Nt,i=wt),(e=t*t+r*r+i*i)<1e-12)?[NaN,NaN]:[Ht(r,t)*Ut,o(i/tr(e))*Ut]},n.geoCircle=function(){function n(){var n=i.apply(this,arguments),c=e.apply(this,arguments)*Xt,a=o.apply(this,arguments)*Xt;return t=[],r=U(-n[0]*Xt,-n[1]*Xt,0).invert,H(u,c,a,1),n={type:"Polygon",coordinates:[t]},t=r=null,n}var t,r,i=sr([0,0]),e=sr(90),o=sr(6),u={point:function(n,i){t.push(n=r(n,i)),n[0]*=Ut,n[1]*=Ut}};return n.center=function(t){return arguments.length?(i="function"==typeof t?t:sr([+t[0],+t[1]]),n):i},n.radius=function(t){return arguments.length?(e="function"==typeof t?t:sr(+t),n):e},n.precision=function(t){return arguments.length?(o="function"==typeof t?t:sr(+t),n):o},n},n.geoClipAntimeridian=zr,n.geoClipCircle=br,n.geoClipExtent=function(){var n,t,r,i=0,e=0,o=960,u=500;return r={stream:function(r){return n&&t===r?n:n=nn(i,e,o,u)(t=r)},extent:function(c){return arguments.length?(i=+c[0][0],e=+c[0][1],o=+c[1][0],u=+c[1][1],n=t=null,r):[[i,e],[o,u]]}}},n.geoClipRectangle=nn,n.geoContains=function(n,t){return(n&&Ur.hasOwnProperty(n.type)?Ur[n.type]:on)(n,t)},n.geoDistance=Dr,n.geoGraticule=hn,n.geoGraticule10=function(){return hn()()},n.geoInterpolate=function(n,t){var r=n[0]*Xt,i=n[1]*Xt,e=t[0]*Xt,c=t[1]*Xt,a=Jt(i),l=$t(i),f=Jt(c),p=$t(c),s=a*Jt(r),h=a*$t(r),g=f*Jt(e),v=f*$t(e),d=2*o(tr(u(c-i)+a*f*u(e-r))),E=$t(d),y=d?function(n){var t=$t(n*=d)/E,r=$t(d-n)/E,i=r*s+t*g,e=r*h+t*v,o=r*l+t*p;return[Ht(e,i)*Ut,Ht(o,tr(i*i+e*e))*Ut]}:function(){return[r*Ut,i*Ut]};return y.distance=d,y},n.geoLength=Fr,n.geoPath=function(n,t){function r(n){return n&&("function"==typeof o&&e.pointRadius(+o.apply(this,arguments)),or(n,i(e))),e.result()}var i,e,o=4.5;return r.area=function(n){return or(n,i(Jr)),Jr.result()},r.measure=function(n){return or(n,i(di)),di.result()},r.bounds=function(n){return or(n,i($r)),$r.result()},r.centroid=function(n){return or(n,i(li)),li.result()},r.projection=function(t){return arguments.length?(i=null==t?(n=null,Yr):(n=t).stream,r):n},r.context=function(n){return arguments.length?(e=null==n?(t=null,new jn):new Pn(t=n),"function"!=typeof o&&e.pointRadius(o),r):t},r.pointRadius=function(n){return arguments.length?(o="function"==typeof n?n:(e.pointRadius(+n),+n),r):o},r.projection(n).context(t)},n.geoAlbers=xi,n.geoAlbersUsa=function(){function n(n){var t=n[0],r=n[1];return c=null,e.point(t,r),c||(o.point(t,r),c)||(u.point(t,r),c)}function t(){return r=i=null,n}var r,i,e,o,u,c,a=xi(),l=Mi().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=Mi().rotate([157,0]).center([-3,19.9]).parallels([8,18]),p={point:function(n,t){c=[n,t]}};return n.invert=function(n){var t=a.scale(),r=a.translate(),i=(n[0]-r[0])/t,e=(n[1]-r[1])/t;return(e>=.12&&e<.234&&i>=-.425&&i<-.214?l:e>=.166&&e<.234&&i>=-.214&&i<-.115?f:a).invert(n)},n.stream=function(n){return r&&i===n?r:r=Xn([a.stream(i=n),l.stream(n),f.stream(n)])},n.precision=function(n){return arguments.length?(a.precision(n),l.precision(n),f.precision(n),t()):a.precision()},n.scale=function(t){return arguments.length?(a.scale(t),l.scale(.35*t),f.scale(t),n.translate(a.translate())):a.scale()},n.translate=function(n){if(!arguments.length)return a.translate();var r=a.scale(),i=+n[0],c=+n[1];return e=a.translate(n).clipExtent([[i-.455*r,c-.238*r],[i+.455*r,c+.238*r]]).stream(p),o=l.translate([i-.307*r,c+.201*r]).clipExtent([[i-.425*r+kt,c+.12*r+kt],[i-.214*r-kt,c+.234*r-kt]]).stream(p),u=f.translate([i-.205*r,c+.212*r]).clipExtent([[i-.214*r+kt,c+.166*r+kt],[i-.115*r-kt,c+.234*r-kt]]).stream(p),t()},n.fitExtent=function(t,r){return Ln(n,t,r)},n.fitSize=function(t,r){return On(n,t,r)},n.scale(1070)},n.geoAzimuthalEqualArea=function(){return Fn(_i).scale(124.75).clipAngle(179.999)},n.geoAzimuthalEqualAreaRaw=_i,n.geoAzimuthalEquidistant=function(){return Fn(Ni).scale(79.4188).clipAngle(179.999)},n.geoAzimuthalEquidistantRaw=Ni,n.geoConicConformal=function(){return Bn(Qn).scale(109.5).parallels([30,30])},n.geoConicConformalRaw=Qn,n.geoConicEqualArea=Mi,n.geoConicEqualAreaRaw=Un,n.geoConicEquidistant=function(){return Bn(Wn).scale(131.154).center([0,13.9389])},n.geoConicEquidistantRaw=Wn,n.geoEquirectangular=function(){return Fn(Vn).scale(152.63)},n.geoEquirectangularRaw=Vn,n.geoGnomonic=function(){return Fn($n).scale(144.049).clipAngle(60)},n.geoGnomonicRaw=$n,n.geoIdentity=function(){function n(){return e=o=null,u}var t,r,i,e,o,u,c=1,a=0,l=0,f=1,p=1,s=Yr,h=null,g=Yr;return u={stream:function(n){return e&&o===n?e:e=s(g(o=n))},postclip:function(e){return arguments.length?(g=e,h=t=r=i=null,n()):g},clipExtent:function(e){return arguments.length?(g=null==e?(h=t=r=i=null,Yr):nn(h=+e[0][0],t=+e[0][1],r=+e[1][0],i=+e[1][1]),n()):null==h?null:[[h,t],[r,i]]},scale:function(t){return arguments.length?(s=nt((c=+t)*f,c*p,a,l),n()):c},translate:function(t){return arguments.length?(s=nt(c*f,c*p,a=+t[0],l=+t[1]),n()):[a,l]},reflectX:function(t){return arguments.length?(s=nt(c*(f=t?-1:1),c*p,a,l),n()):f<0},reflectY:function(t){return arguments.length?(s=nt(c*f,c*(p=t?-1:1),a,l),n()):p<0},fitExtent:function(n,t){return Ln(u,n,t)},fitSize:function(n,t){return On(u,n,t)}}},n.geoProjection=Fn,n.geoProjectionMutator=In,n.geoMercator=function(){return Jn(Hn).scale(961/Dt)},n.geoMercatorRaw=Hn,n.geoNaturalEarth1=function(){return Fn(tt).scale(175.295)},n.geoNaturalEarth1Raw=tt,n.geoOrthographic=function(){return Fn(rt).scale(249.5).clipAngle(90+kt)},n.geoOrthographicRaw=rt,n.geoStereographic=function(){return Fn(it).scale(250).clipAngle(142)},n.geoStereographicRaw=it,n.geoTransverseMercator=function(){var n=Jn(et),t=n.center,r=n.rotate;return n.center=function(n){return arguments.length?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return arguments.length?r([n[0],n[1],n.length>2?n[2]+90:90]):(n=r(),[n[0],n[1],n[2]-90])},r([0,0,90]).scale(159.155)},n.geoTransverseMercatorRaw=et,n.geoRotation=wr,n.geoStream=or,n.geoTransform=function(n){return{stream:zn(n)}},Object.defineProperty(n,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-geo/ Version 1.9.0. Copyright 2017 Mike Bostock. | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],t):t(n.d3=n.d3||{},n.d3)}(this,function(n,t){"use strict";function r(){this.reset()}function i(n,t,r){var i=n.s=t+r,e=i-t,o=i-e;n.t=t-o+(r-e)}function e(n){return n>1?0:n<-1?Wt:Math.acos(n)}function o(n){return n>1?Bt:n<-1?-Bt:Math.asin(n)}function u(n){return(n=rr(n/2))*n}function c(){}function a(n,t){n&&cr.hasOwnProperty(n.type)&&cr[n.type](n,t)}function l(n,t,r){var i,e=-1,o=n.length-r;for(t.lineStart();++e<o;)i=n[e],t.point(i[0],i[1],i[2]);t.lineEnd()}function f(n,t){var r=-1,i=n.length;for(t.polygonStart();++r<i;)l(n[r],t,1);t.polygonEnd()}function s(){sr.point=h}function p(){g(lt,ft)}function h(n,t){sr.point=g,lt=n,ft=t,st=n*=Yt,pt=Qt(t=(t*=Yt)/2+Dt),ht=rr(t)}function g(n,t){t=(t*=Yt)/2+Dt;var r=(n*=Yt)-st,i=r>=0?1:-1,e=i*r,o=Qt(t),u=rr(t),c=ht*u,a=pt*o+c*Qt(e),l=c*i*rr(e);lr.add(Kt(l,a)),st=n,pt=o,ht=u}function v(n){return[Kt(n[1],n[0]),o(n[2])]}function d(n){var t=n[0],r=n[1],i=Qt(r);return[i*Qt(t),i*rr(t),rr(r)]}function E(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function y(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function S(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function m(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function M(n){var t=er(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function x(n,t){xt.push(_t=[gt=n,dt=n]),t<vt&&(vt=t),t>Et&&(Et=t)}function _(n,t){var r=d([n*Yt,t*Yt]);if(Mt){var i=y(Mt,r),e=y([i[1],-i[0],0],i);M(e),e=v(e);var o,u=n-yt,c=u>0?1:-1,a=e[0]*Xt*c,l=Zt(u)>180;l^(c*yt<a&&a<c*n)?(o=e[1]*Xt)>Et&&(Et=o):(a=(a+360)%360-180,l^(c*yt<a&&a<c*n)?(o=-e[1]*Xt)<vt&&(vt=o):(t<vt&&(vt=t),t>Et&&(Et=t))),l?n<yt?A(gt,n)>A(gt,dt)&&(dt=n):A(n,dt)>A(gt,dt)&&(gt=n):dt>=gt?(n<gt&&(gt=n),n>dt&&(dt=n)):n>yt?A(gt,n)>A(gt,dt)&&(dt=n):A(n,dt)>A(gt,dt)&&(gt=n)}else xt.push(_t=[gt=n,dt=n]);t<vt&&(vt=t),t>Et&&(Et=t),Mt=r,yt=n}function N(){hr.point=_}function w(){_t[0]=gt,_t[1]=dt,hr.point=x,Mt=null}function C(n,t){if(Mt){var r=n-yt;pr.add(Zt(r)>180?r+(r>0?360:-360):r)}else St=n,mt=t;sr.point(n,t),_(n,t)}function P(){sr.lineStart()}function R(){C(St,mt),sr.lineEnd(),Zt(pr)>It&&(gt=-(dt=180)),_t[0]=gt,_t[1]=dt,Mt=null}function A(n,t){return(t-=n)<0?t+360:t}function j(n,t){return n[0]-t[0]}function q(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:t<n[0]||n[1]<t}function z(n,t){n*=Yt;var r=Qt(t*=Yt);b(r*Qt(n),r*rr(n),rr(t))}function b(n,t,r){Ct+=(n-Ct)/++Nt,Pt+=(t-Pt)/Nt,Rt+=(r-Rt)/Nt}function L(){gr.point=O}function O(n,t){n*=Yt;var r=Qt(t*=Yt);Tt=r*Qt(n),kt=r*rr(n),Ft=rr(t),gr.point=G,b(Tt,kt,Ft)}function G(n,t){n*=Yt;var r=Qt(t*=Yt),i=r*Qt(n),e=r*rr(n),o=rr(t),u=Kt(er((u=kt*o-Ft*e)*u+(u=Ft*i-Tt*o)*u+(u=Tt*e-kt*i)*u),Tt*i+kt*e+Ft*o);wt+=u,At+=u*(Tt+(Tt=i)),jt+=u*(kt+(kt=e)),qt+=u*(Ft+(Ft=o)),b(Tt,kt,Ft)}function T(){gr.point=z}function k(){gr.point=H}function F(){I(Ot,Gt),gr.point=z}function H(n,t){Ot=n,Gt=t,n*=Yt,t*=Yt,gr.point=I;var r=Qt(t);Tt=r*Qt(n),kt=r*rr(n),Ft=rr(t),b(Tt,kt,Ft)}function I(n,t){n*=Yt;var r=Qt(t*=Yt),i=r*Qt(n),e=r*rr(n),u=rr(t),c=kt*u-Ft*e,a=Ft*i-Tt*u,l=Tt*e-kt*i,f=er(c*c+a*a+l*l),s=o(f),p=f&&-s/f;zt+=p*c,bt+=p*a,Lt+=p*l,wt+=s,At+=s*(Tt+(Tt=i)),jt+=s*(kt+(kt=e)),qt+=s*(Ft+(Ft=u)),b(Tt,kt,Ft)}function W(n,t){return[n>Wt?n-Ut:n<-Wt?n+Ut:n,t]}function B(n,t,r){return(n%=Ut)?t||r?dr(U(n),X(t,r)):U(n):t||r?X(t,r):W}function D(n){return function(t,r){return t+=n,[t>Wt?t-Ut:t<-Wt?t+Ut:t,r]}}function U(n){var t=D(n);return t.invert=D(-n),t}function X(n,t){function r(n,t){var r=Qt(t),a=Qt(n)*r,l=rr(n)*r,f=rr(t),s=f*i+a*e;return[Kt(l*u-s*c,a*i-f*e),o(s*u+l*c)]}var i=Qt(n),e=rr(n),u=Qt(t),c=rr(t);return r.invert=function(n,t){var r=Qt(t),a=Qt(n)*r,l=rr(n)*r,f=rr(t),s=f*u-l*c;return[Kt(l*u+f*c,a*i+s*e),o(s*i-a*e)]},r}function Y(n,t,r,i,e,o){if(r){var u=Qt(t),c=rr(t),a=i*r;null==e?(e=t+i*Ut,o=t-a/2):(e=Z(u,e),o=Z(u,o),(i>0?e<o:e>o)&&(e+=i*Ut));for(var l,f=e;i>0?f>o:f<o;f-=a)l=v([u,-c*Qt(f),-c*rr(f)]),n.point(l[0],l[1])}}function Z(n,t){(t=d(t))[0]-=n,M(t);var r=e(-t[1]);return((-t[2]<0?-r:r)+Ut-It)%Ut}function J(n,t,r,i){this.x=n,this.z=t,this.o=r,this.e=i,this.v=!1,this.n=this.p=null}function K(n){if(t=n.length){for(var t,r,i=0,e=n[0];++i<t;)e.n=r=n[i],r.p=e,e=r;e.n=r=n[0],r.p=e}}function Q(n){return n.length>1}function V(n,t){return((n=n.x)[0]<0?n[1]-Bt-It:Bt-n[1])-((t=t.x)[0]<0?t[1]-Bt-It:Bt-t[1])}function $(n,t,r,i){var e,o,u=rr(n-r);return Zt(u)>It?Jt((rr(t)*(o=Qt(i))*rr(r)-rr(i)*(e=Qt(t))*rr(n))/(e*o*u)):(t+i)/2}function nn(n,r,i,e){function o(t,o){return n<=t&&t<=i&&r<=o&&o<=e}function u(t,o,u,a){var f=0,s=0;if(null==t||(f=c(t,u))!==(s=c(o,u))||l(t,o)<0^u>0)do{a.point(0===f||3===f?n:i,f>1?e:r)}while((f=(f+u+4)%4)!==s);else a.point(o[0],o[1])}function c(t,e){return Zt(t[0]-n)<It?e>0?0:3:Zt(t[0]-i)<It?e>0?2:1:Zt(t[1]-r)<It?e>0?1:0:e>0?3:2}function a(n,t){return l(n.x,t.x)}function l(n,t){var r=c(n,1),i=c(t,1);return r!==i?r-i:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}return function(c){function l(n,t){o(n,t)&&_.point(n,t)}function f(){for(var t=0,r=0,i=h.length;r<i;++r)for(var o,u,c=h[r],a=1,l=c.length,f=c[0],s=f[0],p=f[1];a<l;++a)o=s,u=p,s=(f=c[a])[0],p=f[1],u<=e?p>e&&(s-o)*(e-u)>(p-u)*(n-o)&&++t:p<=e&&(s-o)*(e-u)<(p-u)*(n-o)&&--t;return t}function s(t,u){var c=o(t,u);if(h&&g.push([t,u]),M)v=t,d=u,E=c,M=!1,c&&(_.lineStart(),_.point(t,u));else if(c&&m)_.point(t,u);else{var a=[y=Math.max(Fr,Math.min(kr,y)),S=Math.max(Fr,Math.min(kr,S))],l=[t=Math.max(Fr,Math.min(kr,t)),u=Math.max(Fr,Math.min(kr,u))];Tr(a,l,n,r,i,e)?(m||(_.lineStart(),_.point(a[0],a[1])),_.point(l[0],l[1]),c||_.lineEnd(),x=!1):c&&(_.lineStart(),_.point(t,u),x=!1)}y=t,S=u,m=c}var p,h,g,v,d,E,y,S,m,M,x,_=c,N=Ar(),w={point:l,lineStart:function(){w.point=s,h&&h.push(g=[]),M=!0,m=!1,y=S=NaN},lineEnd:function(){p&&(s(v,d),E&&m&&N.rejoin(),p.push(N.result())),w.point=l,m&&_.lineEnd()},polygonStart:function(){_=N,p=[],h=[],x=!0},polygonEnd:function(){var n=f(),r=x&&n,i=(p=t.merge(p)).length;(r||i)&&(c.polygonStart(),r&&(c.lineStart(),u(null,null,1,c),c.lineEnd()),i&&qr(p,a,n,u,c),c.polygonEnd()),_=c,p=h=g=null}};return w}}function tn(){Ir.point=Ir.lineEnd=c}function rn(n,t){Er=n*=Yt,yr=rr(t*=Yt),Sr=Qt(t),Ir.point=en}function en(n,t){n*=Yt;var r=rr(t*=Yt),i=Qt(t),e=Zt(n-Er),o=Qt(e),u=i*rr(e),c=Sr*r-yr*i*o,a=yr*r+Sr*i*o;Hr.add(Kt(er(u*u+c*c),a)),Er=n,yr=r,Sr=i}function on(n,t){return!(!n||!Yr.hasOwnProperty(n.type))&&Yr[n.type](n,t)}function un(n,t){return 0===Ur(n,t)}function cn(n,t){var r=Ur(n[0],n[1]);return Ur(n[0],t)+Ur(t,n[1])<=r+It}function an(n,t){return!!br(n.map(ln),fn(t))}function ln(n){return(n=n.map(fn)).pop(),n}function fn(n){return[n[0]*Yt,n[1]*Yt]}function sn(n,r,i){var e=t.range(n,r-It,i).concat(r);return function(n){return e.map(function(t){return[n,t]})}}function pn(n,r,i){var e=t.range(n,r-It,i).concat(r);return function(n){return e.map(function(t){return[t,n]})}}function hn(){function n(){return{type:"MultiLineString",coordinates:r()}}function r(){return t.range(Vt(u/E)*E,o,E).map(h).concat(t.range(Vt(f/y)*y,l,y).map(g)).concat(t.range(Vt(e/v)*v,i,v).filter(function(n){return Zt(n%E)>It}).map(s)).concat(t.range(Vt(a/d)*d,c,d).filter(function(n){return Zt(n%y)>It}).map(p))}var i,e,o,u,c,a,l,f,s,p,h,g,v=10,d=v,E=90,y=360,S=2.5;return n.lines=function(){return r().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(g(l).slice(1),h(o).reverse().slice(1),g(f).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.extentMajor(t).extentMinor(t):n.extentMinor()},n.extentMajor=function(t){return arguments.length?(u=+t[0][0],o=+t[1][0],f=+t[0][1],l=+t[1][1],u>o&&(t=u,u=o,o=t),f>l&&(t=f,f=l,l=t),n.precision(S)):[[u,f],[o,l]]},n.extentMinor=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],a=+t[0][1],c=+t[1][1],e>i&&(t=e,e=i,i=t),a>c&&(t=a,a=c,c=t),n.precision(S)):[[e,a],[i,c]]},n.step=function(t){return arguments.length?n.stepMajor(t).stepMinor(t):n.stepMinor()},n.stepMajor=function(t){return arguments.length?(E=+t[0],y=+t[1],n):[E,y]},n.stepMinor=function(t){return arguments.length?(v=+t[0],d=+t[1],n):[v,d]},n.precision=function(t){return arguments.length?(S=+t,s=sn(a,c,90),p=pn(e,i,S),h=sn(f,l,90),g=pn(u,o,S),n):S},n.extentMajor([[-180,-90+It],[180,90-It]]).extentMinor([[-180,-80-It],[180,80+It]])}function gn(){Qr.point=vn}function vn(n,t){Qr.point=dn,mr=xr=n,Mr=_r=t}function dn(n,t){Kr.add(_r*n-xr*t),xr=n,_r=t}function En(){dn(mr,Mr)}function yn(n,t){ii+=n,ei+=t,++oi}function Sn(){pi.point=mn}function mn(n,t){pi.point=Mn,yn(Cr=n,Pr=t)}function Mn(n,t){var r=n-Cr,i=t-Pr,e=er(r*r+i*i);ui+=e*(Cr+n)/2,ci+=e*(Pr+t)/2,ai+=e,yn(Cr=n,Pr=t)}function xn(){pi.point=yn}function _n(){pi.point=wn}function Nn(){Cn(Nr,wr)}function wn(n,t){pi.point=Cn,yn(Nr=Cr=n,wr=Pr=t)}function Cn(n,t){var r=n-Cr,i=t-Pr,e=er(r*r+i*i);ui+=e*(Cr+n)/2,ci+=e*(Pr+t)/2,ai+=e,li+=(e=Pr*n-Cr*t)*(Cr+n),fi+=e*(Pr+t),si+=3*e,yn(Cr=n,Pr=t)}function Pn(n){this._context=n}function Rn(n,t){Si.point=An,gi=di=n,vi=Ei=t}function An(n,t){di-=n,Ei-=t,yi.add(er(di*di+Ei*Ei)),di=n,Ei=t}function jn(){this._string=[]}function qn(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function zn(n){return function(t){var r=new bn;for(var i in n)r[i]=n[i];return r.stream=t,r}}function bn(){}function Ln(n,t,r){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),ar(r,n.stream(ri)),t(ri.result()),null!=i&&n.clipExtent(i),n}function On(n,t,r){return Ln(n,function(r){var i=t[1][0]-t[0][0],e=t[1][1]-t[0][1],o=Math.min(i/(r[1][0]-r[0][0]),e/(r[1][1]-r[0][1])),u=+t[0][0]+(i-o*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(e-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([u,c])},r)}function Gn(n,t,r){return On(n,[[0,0],t],r)}function Tn(n,t,r){return Ln(n,function(r){var i=+t,e=i/(r[1][0]-r[0][0]),o=(i-e*(r[1][0]+r[0][0]))/2,u=-e*r[0][1];n.scale(150*e).translate([o,u])},r)}function kn(n,t,r){return Ln(n,function(r){var i=+t,e=i/(r[1][1]-r[0][1]),o=-e*r[0][0],u=(i-e*(r[1][1]+r[0][1]))/2;n.scale(150*e).translate([o,u])},r)}function Fn(n){return zn({point:function(t,r){t=n(t,r),this.stream.point(t[0],t[1])}})}function Hn(n,t){function r(i,e,u,c,a,l,f,s,p,h,g,v,d,E){var y=f-i,S=s-e,m=y*y+S*S;if(m>4*t&&d--){var M=c+h,x=a+g,_=l+v,N=er(M*M+x*x+_*_),w=o(_/=N),C=Zt(Zt(_)-1)<It||Zt(u-p)<It?(u+p)/2:Kt(x,M),P=n(C,w),R=P[0],A=P[1],j=R-i,q=A-e,z=S*j-y*q;(z*z/m>t||Zt((y*j+S*q)/m-.5)>.3||c*h+a*g+l*v<Mi)&&(r(i,e,u,c,a,l,R,A,C,M/=N,x/=N,_,d,E),E.point(R,A),r(R,A,C,M,x,_,f,s,p,h,g,v,d,E))}}return function(t){function i(r,i){r=n(r,i),t.point(r[0],r[1])}function e(){y=NaN,_.point=o,t.lineStart()}function o(i,e){var o=d([i,e]),u=n(i,e);r(y,S,E,m,M,x,y=u[0],S=u[1],E=i,m=o[0],M=o[1],x=o[2],mi,t),t.point(y,S)}function u(){_.point=i,t.lineEnd()}function c(){e(),_.point=a,_.lineEnd=l}function a(n,t){o(f=n,t),s=y,p=S,h=m,g=M,v=x,_.point=o}function l(){r(y,S,E,m,M,x,s,p,f,h,g,v,mi,t),_.lineEnd=u,u()}var f,s,p,h,g,v,E,y,S,m,M,x,_={point:i,lineStart:e,lineEnd:u,polygonStart:function(){t.polygonStart(),_.lineStart=c},polygonEnd:function(){t.polygonEnd(),_.lineStart=e}};return _}}function In(n){return zn({point:function(t,r){var i=n(t,r);return this.stream.point(i[0],i[1])}})}function Wn(n){return Bn(function(){return n})()}function Bn(n){function t(n){return n=f(n[0]*Yt,n[1]*Yt),[n[0]*d+c,a-n[1]*d]}function r(n){return(n=f.invert((n[0]-c)/d,(a-n[1])/d))&&[n[0]*Xt,n[1]*Xt]}function i(n,t){return n=u(n,t),[n[0]*d+c,a-n[1]*d]}function e(){f=dr(l=B(M,x,_),u);var n=u(S,m);return c=E-n[0]*d,a=y+n[1]*d,o()}function o(){return g=v=null,t}var u,c,a,l,f,s,p,h,g,v,d=150,E=480,y=250,S=0,m=0,M=0,x=0,_=0,N=null,w=Or,C=null,P=Zr,R=.5,A=xi(i,R);return t.stream=function(n){return g&&v===n?g:g=_i(In(l)(w(A(P(v=n)))))},t.preclip=function(n){return arguments.length?(w=n,N=void 0,o()):w},t.postclip=function(n){return arguments.length?(P=n,C=s=p=h=null,o()):P},t.clipAngle=function(n){return arguments.length?(w=+n?Gr(N=n*Yt):(N=null,Or),o()):N*Xt},t.clipExtent=function(n){return arguments.length?(P=null==n?(C=s=p=h=null,Zr):nn(C=+n[0][0],s=+n[0][1],p=+n[1][0],h=+n[1][1]),o()):null==C?null:[[C,s],[p,h]]},t.scale=function(n){return arguments.length?(d=+n,e()):d},t.translate=function(n){return arguments.length?(E=+n[0],y=+n[1],e()):[E,y]},t.center=function(n){return arguments.length?(S=n[0]%360*Yt,m=n[1]%360*Yt,e()):[S*Xt,m*Xt]},t.rotate=function(n){return arguments.length?(M=n[0]%360*Yt,x=n[1]%360*Yt,_=n.length>2?n[2]%360*Yt:0,e()):[M*Xt,x*Xt,_*Xt]},t.precision=function(n){return arguments.length?(A=xi(i,R=n*n),o()):er(R)},t.fitExtent=function(n,r){return On(t,n,r)},t.fitSize=function(n,r){return Gn(t,n,r)},t.fitWidth=function(n,r){return Tn(t,n,r)},t.fitHeight=function(n,r){return kn(t,n,r)},function(){return u=n.apply(this,arguments),t.invert=u.invert&&r,e()}}function Dn(n){var t=0,r=Wt/3,i=Bn(n),e=i(t,r);return e.parallels=function(n){return arguments.length?i(t=n[0]*Yt,r=n[1]*Yt):[t*Xt,r*Xt]},e}function Un(n){function t(n,t){return[n*r,rr(t)/r]}var r=Qt(n);return t.invert=function(n,t){return[n/r,o(t*r)]},t}function Xn(n,t){function r(n,t){var r=er(u-2*e*rr(t))/e;return[r*rr(n*=e),c-r*Qt(n)]}var i=rr(n),e=(i+rr(t))/2;if(Zt(e)<It)return Un(n);var u=1+i*(2*e-i),c=er(u)/e;return r.invert=function(n,t){var r=c-t;return[Kt(n,Zt(r))/e*ir(r),o((u-(n*n+r*r)*e*e)/(2*e))]},r}function Yn(n){var t=n.length;return{point:function(r,i){for(var e=-1;++e<t;)n[e].point(r,i)},sphere:function(){for(var r=-1;++r<t;)n[r].sphere()},lineStart:function(){for(var r=-1;++r<t;)n[r].lineStart()},lineEnd:function(){for(var r=-1;++r<t;)n[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<t;)n[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<t;)n[r].polygonEnd()}}}function Zn(n){return function(t,r){var i=Qt(t),e=Qt(r),o=n(i*e);return[o*e*rr(t),o*rr(r)]}}function Jn(n){return function(t,r){var i=er(t*t+r*r),e=n(i),u=rr(e),c=Qt(e);return[Kt(t*u,i*c),o(i&&r*u/i)]}}function Kn(n,t){return[n,nr(or((Bt+t)/2))]}function Qn(n){function t(){var t=Wt*c(),u=o(Rr(o.rotate()).invert([0,0]));return l(null==f?[[u[0]-t,u[1]-t],[u[0]+t,u[1]+t]]:n===Kn?[[Math.max(u[0]-t,f),r],[Math.min(u[0]+t,i),e]]:[[f,Math.max(u[1]-t,r)],[i,Math.min(u[1]+t,e)]])}var r,i,e,o=Wn(n),u=o.center,c=o.scale,a=o.translate,l=o.clipExtent,f=null;return o.scale=function(n){return arguments.length?(c(n),t()):c()},o.translate=function(n){return arguments.length?(a(n),t()):a()},o.center=function(n){return arguments.length?(u(n),t()):u()},o.clipExtent=function(n){return arguments.length?(null==n?f=r=i=e=null:(f=+n[0][0],r=+n[0][1],i=+n[1][0],e=+n[1][1]),t()):null==f?null:[[f,r],[i,e]]},t()}function Vn(n){return or((Bt+n)/2)}function $n(n,t){function r(n,t){o>0?t<-Bt+It&&(t=-Bt+It):t>Bt-It&&(t=Bt-It);var r=o/tr(Vn(t),e);return[r*rr(e*n),o-r*Qt(e*n)]}var i=Qt(n),e=n===t?rr(n):nr(i/Qt(t))/nr(Vn(t)/Vn(n)),o=i*tr(Vn(n),e)/e;return e?(r.invert=function(n,t){var r=o-t,i=ir(e)*er(n*n+r*r);return[Kt(n,Zt(r))/e*ir(r),2*Jt(tr(o/i,1/e))-Bt]},r):Kn}function nt(n,t){return[n,t]}function tt(n,t){function r(n,t){var r=o-t,i=e*n;return[r*rr(i),o-r*Qt(i)]}var i=Qt(n),e=n===t?rr(n):(i-Qt(t))/(t-n),o=i/e+n;return Zt(e)<It?nt:(r.invert=function(n,t){var r=o-t;return[Kt(n,Zt(r))/e*ir(r),o-ir(e)*er(n*n+r*r)]},r)}function rt(n,t){var r=Qt(t),i=Qt(n)*r;return[r*rr(n)/i,rr(t)/i]}function it(n,t,r,i){return 1===n&&1===t&&0===r&&0===i?Zr:zn({point:function(e,o){this.stream.point(e*n+r,o*t+i)}})}function et(n,t){var r=t*t,i=r*r;return[n*(.8707-.131979*r+i*(i*(.003971*r-.001529*i)-.013791)),t*(1.007226+r*(.015085+i*(.028874*r-.044475-.005916*i)))]}function ot(n,t){return[Qt(t)*rr(n),rr(t)]}function ut(n,t){var r=Qt(t),i=1+Qt(n)*r;return[r*rr(n)/i,rr(t)/i]}function ct(n,t){return[nr(or((Bt+t)/2)),-n]}var at=function(){return new r};r.prototype={constructor:r,reset:function(){this.s=this.t=0},add:function(n){i(Ht,n,this.t),i(this,Ht.s,this.s),this.s?this.t+=Ht.t:this.s=Ht.t},valueOf:function(){return this.s}};var lt,ft,st,pt,ht,gt,vt,dt,Et,yt,St,mt,Mt,xt,_t,Nt,wt,Ct,Pt,Rt,At,jt,qt,zt,bt,Lt,Ot,Gt,Tt,kt,Ft,Ht=new r,It=1e-6,Wt=Math.PI,Bt=Wt/2,Dt=Wt/4,Ut=2*Wt,Xt=180/Wt,Yt=Wt/180,Zt=Math.abs,Jt=Math.atan,Kt=Math.atan2,Qt=Math.cos,Vt=Math.ceil,$t=Math.exp,nr=Math.log,tr=Math.pow,rr=Math.sin,ir=Math.sign||function(n){return n>0?1:n<0?-1:0},er=Math.sqrt,or=Math.tan,ur={Feature:function(n,t){a(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)a(r[i].geometry,t)}},cr={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)n=r[i],t.point(n[0],n[1],n[2])},LineString:function(n,t){l(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)l(r[i],t,0)},Polygon:function(n,t){f(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)f(r[i],t)},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)a(r[i],t)}},ar=function(n,t){n&&ur.hasOwnProperty(n.type)?ur[n.type](n,t):a(n,t)},lr=at(),fr=at(),sr={point:c,lineStart:c,lineEnd:c,polygonStart:function(){lr.reset(),sr.lineStart=s,sr.lineEnd=p},polygonEnd:function(){var n=+lr;fr.add(n<0?Ut+n:n),this.lineStart=this.lineEnd=this.point=c},sphere:function(){fr.add(Ut)}},pr=at(),hr={point:x,lineStart:N,lineEnd:w,polygonStart:function(){hr.point=C,hr.lineStart=P,hr.lineEnd=R,pr.reset(),sr.polygonStart()},polygonEnd:function(){sr.polygonEnd(),hr.point=x,hr.lineStart=N,hr.lineEnd=w,lr<0?(gt=-(dt=180),vt=-(Et=90)):pr>It?Et=90:pr<-It&&(vt=-90),_t[0]=gt,_t[1]=dt}},gr={sphere:c,point:z,lineStart:L,lineEnd:T,polygonStart:function(){gr.lineStart=k,gr.lineEnd=F},polygonEnd:function(){gr.lineStart=L,gr.lineEnd=T}},vr=function(n){return function(){return n}},dr=function(n,t){function r(r,i){return r=n(r,i),t(r[0],r[1])}return n.invert&&t.invert&&(r.invert=function(r,i){return(r=t.invert(r,i))&&n.invert(r[0],r[1])}),r};W.invert=W;var Er,yr,Sr,mr,Mr,xr,_r,Nr,wr,Cr,Pr,Rr=function(n){function t(t){return t=n(t[0]*Yt,t[1]*Yt),t[0]*=Xt,t[1]*=Xt,t}return n=B(n[0]*Yt,n[1]*Yt,n.length>2?n[2]*Yt:0),t.invert=function(t){return t=n.invert(t[0]*Yt,t[1]*Yt),t[0]*=Xt,t[1]*=Xt,t},t},Ar=function(){var n,t=[];return{point:function(t,r){n.push([t,r])},lineStart:function(){t.push(n=[])},lineEnd:c,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}},jr=function(n,t){return Zt(n[0]-t[0])<It&&Zt(n[1]-t[1])<It},qr=function(n,t,r,i,e){var o,u,c=[],a=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,r,i=n[0],u=n[t];if(jr(i,u)){for(e.lineStart(),o=0;o<t;++o)e.point((i=n[o])[0],i[1]);e.lineEnd()}else c.push(r=new J(i,n,null,!0)),a.push(r.o=new J(i,null,r,!1)),c.push(r=new J(u,n,null,!1)),a.push(r.o=new J(u,null,r,!0))}}),c.length){for(a.sort(t),K(c),K(a),o=0,u=a.length;o<u;++o)a[o].e=r=!r;for(var l,f,s=c[0];;){for(var p=s,h=!0;p.v;)if((p=p.n)===s)return;l=p.z,e.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(o=0,u=l.length;o<u;++o)e.point((f=l[o])[0],f[1]);else i(p.x,p.n.x,1,e);p=p.n}else{if(h)for(l=p.p.z,o=l.length-1;o>=0;--o)e.point((f=l[o])[0],f[1]);else i(p.x,p.p.x,-1,e);p=p.p}l=(p=p.o).z,h=!h}while(!p.v);e.lineEnd()}}},zr=at(),br=function(n,t){var r=t[0],i=t[1],e=[rr(r),-Qt(r),0],u=0,c=0;zr.reset();for(var a=0,l=n.length;a<l;++a)if(s=(f=n[a]).length)for(var f,s,p=f[s-1],h=p[0],g=p[1]/2+Dt,v=rr(g),E=Qt(g),S=0;S<s;++S,h=x,v=N,E=w,p=m){var m=f[S],x=m[0],_=m[1]/2+Dt,N=rr(_),w=Qt(_),C=x-h,P=C>=0?1:-1,R=P*C,A=R>Wt,j=v*N;if(zr.add(Kt(j*P*rr(R),E*w+j*Qt(R))),u+=A?C+P*Ut:C,A^h>=r^x>=r){var q=y(d(p),d(m));M(q);var z=y(e,q);M(z);var b=(A^C>=0?-1:1)*o(z[2]);(i>b||i===b&&(q[0]||q[1]))&&(c+=A^C>=0?1:-1)}}return(u<-It||u<It&&zr<-It)^1&c},Lr=function(n,r,i,e){return function(o){function u(t,r){n(t,r)&&o.point(t,r)}function c(n,t){d.point(n,t)}function a(){m.point=c,d.lineStart()}function l(){m.point=u,d.lineEnd()}function f(n,t){v.push([n,t]),y.point(n,t)}function s(){y.lineStart(),v=[]}function p(){f(v[0][0],v[0][1]),y.lineEnd();var n,t,r,i,e=y.clean(),u=E.result(),c=u.length;if(v.pop(),h.push(v),v=null,c)if(1&e){if(r=u[0],(t=r.length-1)>0){for(S||(o.polygonStart(),S=!0),o.lineStart(),n=0;n<t;++n)o.point((i=r[n])[0],i[1]);o.lineEnd()}}else c>1&&2&e&&u.push(u.pop().concat(u.shift())),g.push(u.filter(Q))}var h,g,v,d=r(o),E=Ar(),y=r(E),S=!1,m={point:u,lineStart:a,lineEnd:l,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=p,g=[],h=[]},polygonEnd:function(){m.point=u,m.lineStart=a,m.lineEnd=l,g=t.merge(g);var n=br(h,e);g.length?(S||(o.polygonStart(),S=!0),qr(g,V,n,i,o)):n&&(S||(o.polygonStart(),S=!0),o.lineStart(),i(null,null,1,o),o.lineEnd()),S&&(o.polygonEnd(),S=!1),g=h=null},sphere:function(){o.polygonStart(),o.lineStart(),i(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return m}},Or=Lr(function(){return!0},function(n){var t,r=NaN,i=NaN,e=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(o,u){var c=o>0?Wt:-Wt,a=Zt(o-r);Zt(a-Wt)<It?(n.point(r,i=(i+u)/2>0?Bt:-Bt),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),n.point(o,i),t=0):e!==c&&a>=Wt&&(Zt(r-e)<It&&(r-=e*It),Zt(o-c)<It&&(o-=c*It),i=$(r,i,o,u),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),t=0),n.point(r=o,i=u),e=c},lineEnd:function(){n.lineEnd(),r=i=NaN},clean:function(){return 2-t}}},function(n,t,r,i){var e;if(null==n)e=r*Bt,i.point(-Wt,e),i.point(0,e),i.point(Wt,e),i.point(Wt,0),i.point(Wt,-e),i.point(0,-e),i.point(-Wt,-e),i.point(-Wt,0),i.point(-Wt,e);else if(Zt(n[0]-t[0])>It){var o=n[0]<t[0]?Wt:-Wt;e=r*o/2,i.point(-o,e),i.point(0,e),i.point(o,e)}else i.point(t[0],t[1])},[-Wt,-Bt]),Gr=function(n){function t(n,t){return Qt(n)*Qt(t)>e}function r(n,t,r){var i=[1,0,0],o=y(d(n),d(t)),u=E(o,o),c=o[0],a=u-c*c;if(!a)return!r&&n;var l=e*u/a,f=-e*c/a,s=y(i,o),p=m(i,l);S(p,m(o,f));var h=s,g=E(p,h),M=E(h,h),x=g*g-M*(E(p,p)-1);if(!(x<0)){var _=er(x),N=m(h,(-g-_)/M);if(S(N,p),N=v(N),!r)return N;var w,C=n[0],P=t[0],R=n[1],A=t[1];P<C&&(w=C,C=P,P=w);var j=P-C,q=Zt(j-Wt)<It,z=q||j<It;if(!q&&A<R&&(w=R,R=A,A=w),z?q?R+A>0^N[1]<(Zt(N[0]-C)<It?R:A):R<=N[1]&&N[1]<=A:j>Wt^(C<=N[0]&&N[0]<=P)){var b=m(h,(-g+_)/M);return S(b,p),[N,v(b)]}}}function i(t,r){var i=u?n:Wt-n,e=0;return t<-i?e|=1:t>i&&(e|=2),r<-i?e|=4:r>i&&(e|=8),e}var e=Qt(n),o=6*Yt,u=e>0,c=Zt(e)>It;return Lr(t,function(n){var e,o,a,l,f;return{lineStart:function(){l=a=!1,f=1},point:function(s,p){var h,g=[s,p],v=t(s,p),d=u?v?0:i(s,p):v?i(s+(s<0?Wt:-Wt),p):0;if(!e&&(l=a=v)&&n.lineStart(),v!==a&&(!(h=r(e,g))||jr(e,h)||jr(g,h))&&(g[0]+=It,g[1]+=It,v=t(g[0],g[1])),v!==a)f=0,v?(n.lineStart(),h=r(g,e),n.point(h[0],h[1])):(h=r(e,g),n.point(h[0],h[1]),n.lineEnd()),e=h;else if(c&&e&&u^v){var E;d&o||!(E=r(g,e,!0))||(f=0,u?(n.lineStart(),n.point(E[0][0],E[0][1]),n.point(E[1][0],E[1][1]),n.lineEnd()):(n.point(E[1][0],E[1][1]),n.lineEnd(),n.lineStart(),n.point(E[0][0],E[0][1])))}!v||e&&jr(e,g)||n.point(g[0],g[1]),e=g,a=v,o=d},lineEnd:function(){a&&n.lineEnd(),e=null},clean:function(){return f|(l&&a)<<1}}},function(t,r,i,e){Y(e,n,o,i,t,r)},u?[0,-n]:[-Wt,n-Wt])},Tr=function(n,t,r,i,e,o){var u,c=n[0],a=n[1],l=0,f=1,s=t[0]-c,p=t[1]-a;if(u=r-c,s||!(u>0)){if(u/=s,s<0){if(u<l)return;u<f&&(f=u)}else if(s>0){if(u>f)return;u>l&&(l=u)}if(u=e-c,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>l&&(l=u)}else if(s>0){if(u<l)return;u<f&&(f=u)}if(u=i-a,p||!(u>0)){if(u/=p,p<0){if(u<l)return;u<f&&(f=u)}else if(p>0){if(u>f)return;u>l&&(l=u)}if(u=o-a,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>l&&(l=u)}else if(p>0){if(u<l)return;u<f&&(f=u)}return l>0&&(n[0]=c+l*s,n[1]=a+l*p),f<1&&(t[0]=c+f*s,t[1]=a+f*p),!0}}}}},kr=1e9,Fr=-kr,Hr=at(),Ir={sphere:c,point:c,lineStart:function(){Ir.point=rn,Ir.lineEnd=tn},lineEnd:c,polygonStart:c,polygonEnd:c},Wr=function(n){return Hr.reset(),ar(n,Ir),+Hr},Br=[null,null],Dr={type:"LineString",coordinates:Br},Ur=function(n,t){return Br[0]=n,Br[1]=t,Wr(Dr)},Xr={Feature:function(n,t){return on(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)if(on(r[i].geometry,t))return!0;return!1}},Yr={Sphere:function(){return!0},Point:function(n,t){return un(n.coordinates,t)},MultiPoint:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(un(r[i],t))return!0;return!1},LineString:function(n,t){return cn(n.coordinates,t)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(cn(r[i],t))return!0;return!1},Polygon:function(n,t){return an(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(an(r[i],t))return!0;return!1},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)if(on(r[i],t))return!0;return!1}},Zr=function(n){return n},Jr=at(),Kr=at(),Qr={point:c,lineStart:c,lineEnd:c,polygonStart:function(){Qr.lineStart=gn,Qr.lineEnd=En},polygonEnd:function(){Qr.lineStart=Qr.lineEnd=Qr.point=c,Jr.add(Zt(Kr)),Kr.reset()},result:function(){var n=Jr/2;return Jr.reset(),n}},Vr=1/0,$r=Vr,ni=-Vr,ti=ni,ri={point:function(n,t){n<Vr&&(Vr=n),n>ni&&(ni=n),t<$r&&($r=t),t>ti&&(ti=t)},lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c,result:function(){var n=[[Vr,$r],[ni,ti]];return ni=ti=-($r=Vr=1/0),n}},ii=0,ei=0,oi=0,ui=0,ci=0,ai=0,li=0,fi=0,si=0,pi={point:yn,lineStart:Sn,lineEnd:xn,polygonStart:function(){pi.lineStart=_n,pi.lineEnd=Nn},polygonEnd:function(){pi.point=yn,pi.lineStart=Sn,pi.lineEnd=xn},result:function(){var n=si?[li/si,fi/si]:ai?[ui/ai,ci/ai]:oi?[ii/oi,ei/oi]:[NaN,NaN];return ii=ei=oi=ui=ci=ai=li=fi=si=0,n}};Pn.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._context.moveTo(n,t),this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Ut)}},result:c};var hi,gi,vi,di,Ei,yi=at(),Si={point:c,lineStart:function(){Si.point=Rn},lineEnd:function(){hi&&An(gi,vi),Si.point=c},polygonStart:function(){hi=!0},polygonEnd:function(){hi=null},result:function(){var n=+yi;return yi.reset(),n}};jn.prototype={_radius:4.5,_circle:qn(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._string.push("M",n,",",t),this._point=1;break;case 1:this._string.push("L",n,",",t);break;default:null==this._circle&&(this._circle=qn(this._radius)),this._string.push("M",n,",",t,this._circle)}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}return null}};bn.prototype={constructor:bn,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var mi=16,Mi=Qt(30*Yt),xi=function(n,t){return+t?Hn(n,t):Fn(n)},_i=zn({point:function(n,t){this.stream.point(n*Yt,t*Yt)}}),Ni=function(){return Dn(Xn).scale(155.424).center([0,33.6442])},wi=function(){return Ni().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},Ci=Zn(function(n){return er(2/(1+n))});Ci.invert=Jn(function(n){return 2*o(n/2)});var Pi=Zn(function(n){return(n=e(n))&&n/rr(n)});Pi.invert=Jn(function(n){return n});Kn.invert=function(n,t){return[n,2*Jt($t(t))-Bt]};nt.invert=nt;rt.invert=Jn(Jt);et.invert=function(n,t){var r,i=t,e=25;do{var o=i*i,u=o*o;i-=r=(i*(1.007226+o*(.015085+u*(.028874*o-.044475-.005916*u)))-t)/(1.007226+o*(.045255+u*(.259866*o-.311325-.005916*11*u)))}while(Zt(r)>It&&--e>0);return[n/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]};ot.invert=Jn(o);ut.invert=Jn(function(n){return 2*Jt(n)});ct.invert=function(n,t){return[-t,2*Jt($t(n))-Bt]};n.geoArea=function(n){return fr.reset(),ar(n,sr),2*fr},n.geoBounds=function(n){var t,r,i,e,o,u,c;if(Et=dt=-(gt=vt=1/0),xt=[],ar(n,hr),r=xt.length){for(xt.sort(j),t=1,o=[i=xt[0]];t<r;++t)q(i,(e=xt[t])[0])||q(i,e[1])?(A(i[0],e[1])>A(i[0],i[1])&&(i[1]=e[1]),A(e[0],i[1])>A(i[0],i[1])&&(i[0]=e[0])):o.push(i=e);for(u=-1/0,t=0,i=o[r=o.length-1];t<=r;i=e,++t)e=o[t],(c=A(i[1],e[0]))>u&&(u=c,gt=e[0],dt=i[1])}return xt=_t=null,gt===1/0||vt===1/0?[[NaN,NaN],[NaN,NaN]]:[[gt,vt],[dt,Et]]},n.geoCentroid=function(n){Nt=wt=Ct=Pt=Rt=At=jt=qt=zt=bt=Lt=0,ar(n,gr);var t=zt,r=bt,i=Lt,e=t*t+r*r+i*i;return e<1e-12&&(t=At,r=jt,i=qt,wt<It&&(t=Ct,r=Pt,i=Rt),(e=t*t+r*r+i*i)<1e-12)?[NaN,NaN]:[Kt(r,t)*Xt,o(i/er(e))*Xt]},n.geoCircle=function(){function n(){var n=i.apply(this,arguments),c=e.apply(this,arguments)*Yt,a=o.apply(this,arguments)*Yt;return t=[],r=B(-n[0]*Yt,-n[1]*Yt,0).invert,Y(u,c,a,1),n={type:"Polygon",coordinates:[t]},t=r=null,n}var t,r,i=vr([0,0]),e=vr(90),o=vr(6),u={point:function(n,i){t.push(n=r(n,i)),n[0]*=Xt,n[1]*=Xt}};return n.center=function(t){return arguments.length?(i="function"==typeof t?t:vr([+t[0],+t[1]]),n):i},n.radius=function(t){return arguments.length?(e="function"==typeof t?t:vr(+t),n):e},n.precision=function(t){return arguments.length?(o="function"==typeof t?t:vr(+t),n):o},n},n.geoClipAntimeridian=Or,n.geoClipCircle=Gr,n.geoClipExtent=function(){var n,t,r,i=0,e=0,o=960,u=500;return r={stream:function(r){return n&&t===r?n:n=nn(i,e,o,u)(t=r)},extent:function(c){return arguments.length?(i=+c[0][0],e=+c[0][1],o=+c[1][0],u=+c[1][1],n=t=null,r):[[i,e],[o,u]]}}},n.geoClipRectangle=nn,n.geoContains=function(n,t){return(n&&Xr.hasOwnProperty(n.type)?Xr[n.type]:on)(n,t)},n.geoDistance=Ur,n.geoGraticule=hn,n.geoGraticule10=function(){return hn()()},n.geoInterpolate=function(n,t){var r=n[0]*Yt,i=n[1]*Yt,e=t[0]*Yt,c=t[1]*Yt,a=Qt(i),l=rr(i),f=Qt(c),s=rr(c),p=a*Qt(r),h=a*rr(r),g=f*Qt(e),v=f*rr(e),d=2*o(er(u(c-i)+a*f*u(e-r))),E=rr(d),y=d?function(n){var t=rr(n*=d)/E,r=rr(d-n)/E,i=r*p+t*g,e=r*h+t*v,o=r*l+t*s;return[Kt(e,i)*Xt,Kt(o,er(i*i+e*e))*Xt]}:function(){return[r*Xt,i*Xt]};return y.distance=d,y},n.geoLength=Wr,n.geoPath=function(n,t){function r(n){return n&&("function"==typeof o&&e.pointRadius(+o.apply(this,arguments)),ar(n,i(e))),e.result()}var i,e,o=4.5;return r.area=function(n){return ar(n,i(Qr)),Qr.result()},r.measure=function(n){return ar(n,i(Si)),Si.result()},r.bounds=function(n){return ar(n,i(ri)),ri.result()},r.centroid=function(n){return ar(n,i(pi)),pi.result()},r.projection=function(t){return arguments.length?(i=null==t?(n=null,Zr):(n=t).stream,r):n},r.context=function(n){return arguments.length?(e=null==n?(t=null,new jn):new Pn(t=n),"function"!=typeof o&&e.pointRadius(o),r):t},r.pointRadius=function(n){return arguments.length?(o="function"==typeof n?n:(e.pointRadius(+n),+n),r):o},r.projection(n).context(t)},n.geoAlbers=wi,n.geoAlbersUsa=function(){function n(n){var t=n[0],r=n[1];return c=null,e.point(t,r),c||(o.point(t,r),c)||(u.point(t,r),c)}function t(){return r=i=null,n}var r,i,e,o,u,c,a=wi(),l=Ni().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=Ni().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(n,t){c=[n,t]}};return n.invert=function(n){var t=a.scale(),r=a.translate(),i=(n[0]-r[0])/t,e=(n[1]-r[1])/t;return(e>=.12&&e<.234&&i>=-.425&&i<-.214?l:e>=.166&&e<.234&&i>=-.214&&i<-.115?f:a).invert(n)},n.stream=function(n){return r&&i===n?r:r=Yn([a.stream(i=n),l.stream(n),f.stream(n)])},n.precision=function(n){return arguments.length?(a.precision(n),l.precision(n),f.precision(n),t()):a.precision()},n.scale=function(t){return arguments.length?(a.scale(t),l.scale(.35*t),f.scale(t),n.translate(a.translate())):a.scale()},n.translate=function(n){if(!arguments.length)return a.translate();var r=a.scale(),i=+n[0],c=+n[1];return e=a.translate(n).clipExtent([[i-.455*r,c-.238*r],[i+.455*r,c+.238*r]]).stream(s),o=l.translate([i-.307*r,c+.201*r]).clipExtent([[i-.425*r+It,c+.12*r+It],[i-.214*r-It,c+.234*r-It]]).stream(s),u=f.translate([i-.205*r,c+.212*r]).clipExtent([[i-.214*r+It,c+.166*r+It],[i-.115*r-It,c+.234*r-It]]).stream(s),t()},n.fitExtent=function(t,r){return On(n,t,r)},n.fitSize=function(t,r){return Gn(n,t,r)},n.fitWidth=function(t,r){return Tn(n,t,r)},n.fitHeight=function(t,r){return kn(n,t,r)},n.scale(1070)},n.geoAzimuthalEqualArea=function(){return Wn(Ci).scale(124.75).clipAngle(179.999)},n.geoAzimuthalEqualAreaRaw=Ci,n.geoAzimuthalEquidistant=function(){return Wn(Pi).scale(79.4188).clipAngle(179.999)},n.geoAzimuthalEquidistantRaw=Pi,n.geoConicConformal=function(){return Dn($n).scale(109.5).parallels([30,30])},n.geoConicConformalRaw=$n,n.geoConicEqualArea=Ni,n.geoConicEqualAreaRaw=Xn,n.geoConicEquidistant=function(){return Dn(tt).scale(131.154).center([0,13.9389])},n.geoConicEquidistantRaw=tt,n.geoEquirectangular=function(){return Wn(nt).scale(152.63)},n.geoEquirectangularRaw=nt,n.geoGnomonic=function(){return Wn(rt).scale(144.049).clipAngle(60)},n.geoGnomonicRaw=rt,n.geoIdentity=function(){function n(){return e=o=null,u}var t,r,i,e,o,u,c=1,a=0,l=0,f=1,s=1,p=Zr,h=null,g=Zr;return u={stream:function(n){return e&&o===n?e:e=p(g(o=n))},postclip:function(e){return arguments.length?(g=e,h=t=r=i=null,n()):g},clipExtent:function(e){return arguments.length?(g=null==e?(h=t=r=i=null,Zr):nn(h=+e[0][0],t=+e[0][1],r=+e[1][0],i=+e[1][1]),n()):null==h?null:[[h,t],[r,i]]},scale:function(t){return arguments.length?(p=it((c=+t)*f,c*s,a,l),n()):c},translate:function(t){return arguments.length?(p=it(c*f,c*s,a=+t[0],l=+t[1]),n()):[a,l]},reflectX:function(t){return arguments.length?(p=it(c*(f=t?-1:1),c*s,a,l),n()):f<0},reflectY:function(t){return arguments.length?(p=it(c*f,c*(s=t?-1:1),a,l),n()):s<0},fitExtent:function(n,t){return On(u,n,t)},fitSize:function(n,t){return Gn(u,n,t)},fitWidth:function(n,t){return Tn(u,n,t)},fitHeight:function(n,t){return kn(u,n,t)}}},n.geoProjection=Wn,n.geoProjectionMutator=Bn,n.geoMercator=function(){return Qn(Kn).scale(961/Ut)},n.geoMercatorRaw=Kn,n.geoNaturalEarth1=function(){return Wn(et).scale(175.295)},n.geoNaturalEarth1Raw=et,n.geoOrthographic=function(){return Wn(ot).scale(249.5).clipAngle(90+It)},n.geoOrthographicRaw=ot,n.geoStereographic=function(){return Wn(ut).scale(250).clipAngle(142)},n.geoStereographicRaw=ut,n.geoTransverseMercator=function(){var n=Qn(ct),t=n.center,r=n.rotate;return n.center=function(n){return arguments.length?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return arguments.length?r([n[0],n[1],n.length>2?n[2]+90:90]):(n=r(),[n[0],n[1],n[2]-90])},r([0,0,90]).scale(159.155)},n.geoTransverseMercatorRaw=ct,n.geoRotation=Rr,n.geoStream=ar,n.geoTransform=function(n){return{stream:zn(n)}},Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-geo", | ||
"version": "1.8.1", | ||
"version": "1.9.0", | ||
"description": "Shapes and calculators for spherical coordinates.", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"test": "tape 'test/**/*-test.js' && mkdir -p test/output && eslint index.js src", | ||
"prepare": "npm run test && test/compare-images && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" build/d3-geo.js -c -m -o build/d3-geo.min.js", | ||
"prepublishOnly": "npm run test && test/compare-images && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" build/d3-geo.js -c -m -o build/d3-geo.min.js", | ||
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-geo/build/d3-geo.js d3-geo.v1.js && cp ../d3-geo/build/d3-geo.min.js d3-geo.v1.min.js && git add d3-geo.v1.js d3-geo.v1.min.js && git commit -m \"d3-geo ${npm_package_version}\" && git push && cd - && zip -j build/d3-geo.zip -- LICENSE README.md build/d3-geo.js build/d3-geo.min.js" | ||
@@ -31,0 +31,0 @@ }, |
@@ -220,2 +220,10 @@ # d3-geo | ||
<a href="#projection_fitWidth" name="projection_fitWidth">#</a> <i>projection</i>.<b>fitWidth</b>(<i>width</i>, <i>object</i>) [<>](https://github.com/d3/d3-geo/blob/master/src/projection/index.js#L105 "Source") | ||
A convenience method for [*projection*.fitSize](#projection_fitSize) where the height is automatically chosen from the aspect ratio of *object* and the given constraint on *width*. | ||
<a href="#projection_fitHeight" name="projection_fitHeight">#</a> <i>projection</i>.<b>fitHeight</b>(<i>height</i>, <i>object</i>) [<>](https://github.com/d3/d3-geo/blob/master/src/projection/index.js#L109 "Source") | ||
A convenience method for [*projection*.fitSize](#projection_fitSize) where the width is automatically chosen from the aspect ratio of *object* and the given contraint on *height*. | ||
#### Azimuthal Projections | ||
@@ -625,3 +633,3 @@ | ||
The identity transform can be used to scale, translate and clip planar geometry. It implements [*projection*.scale](#projection_scale), [*projection*.translate](#projection_translate), [*projection*.fitExtent](#projection_fitExtent), [*projection*.fitSize](#projection_fitSize) and [*projection*.clipExtent](#projection_clipExtent). | ||
The identity transform can be used to scale, translate and clip planar geometry. It implements [*projection*.scale](#projection_scale), [*projection*.translate](#projection_translate), [*projection*.fitExtent](#projection_fitExtent), [*projection*.fitSize](#projection_fitSize), [*projection*.fitWidth](#projection_fitWidth), [*projection*.fitHeight](#projection_fitHeight) and [*projection*.clipExtent](#projection_clipExtent). | ||
@@ -656,10 +664,10 @@ <a href="#identity_reflectX" name="identity_reflectX">#</a> <i>identity</i>.<b>reflectX</b>([<i>reflect</i>]) | ||
Returns a stream where geometries (lines or polygons) that cross the antimeridian line are cut in two, one on each side. Typically used for pre-clipping. | ||
A clipping function which transforms a stream such that geometries (lines or polygons) that cross the antimeridian line are cut in two, one on each side. Typically used for pre-clipping. | ||
<a name="geoClipCircle" href="#geoClipCircle">#</a> d3.<b>geoClipCircle</b>(<i>angle</i>) | ||
Returns a stream where geometries are bounded by a small circle of radius *angle* around the projection’s [center](#projection_center). Typically used for pre-clipping. | ||
Generates a clipping function which transforms a stream such that geometries are bounded by a small circle of radius *angle* around the projection’s [center](#projection_center). Typically used for pre-clipping. | ||
<a name="geoClipRectangle" href="#geoClipRectangle">#</a> d3.<b>geoClipRectangle</b>(<i>x0</i>, <i>y0</i>, <i>x1</i>, <i>y1</i>) | ||
Returns a stream where geometries are bounded by a rectangle of coordinates [[<i>x0</i>, <i>y0</i>], [<i>x1</i>, <i>y1</i>]]. Typically used for post-clipping. | ||
Generates a clipping function which transforms a stream such that geometries are bounded by a rectangle of coordinates [[<i>x0</i>, <i>y0</i>], [<i>x1</i>, <i>y1</i>]]. Typically used for post-clipping. |
import {epsilon} from "../math"; | ||
import albers from "./albers"; | ||
import conicEqualArea from "./conicEqualArea"; | ||
import {fitExtent, fitSize} from "./fit"; | ||
import {fitExtent, fitSize, fitWidth, fitHeight} from "./fit"; | ||
@@ -97,2 +97,10 @@ // The projections must have mutually exclusive clip regions on the sphere, | ||
albersUsa.fitWidth = function(width, object) { | ||
return fitWidth(albersUsa, width, object); | ||
}; | ||
albersUsa.fitHeight = function(height, object) { | ||
return fitHeight(albersUsa, height, object); | ||
}; | ||
function reset() { | ||
@@ -99,0 +107,0 @@ cache = cacheStream = null; |
import {default as geoStream} from "../stream"; | ||
import boundsStream from "../path/bounds"; | ||
export function fitExtent(projection, extent, object) { | ||
var w = extent[1][0] - extent[0][0], | ||
h = extent[1][1] - extent[0][1], | ||
clip = projection.clipExtent && projection.clipExtent(); | ||
projection | ||
.scale(150) | ||
.translate([0, 0]); | ||
function fit(projection, fitBounds, object) { | ||
var clip = projection.clipExtent && projection.clipExtent(); | ||
projection.scale(150).translate([0, 0]); | ||
if (clip != null) projection.clipExtent(null); | ||
geoStream(object, projection.stream(boundsStream)); | ||
var b = boundsStream.result(), | ||
k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), | ||
x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, | ||
y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2; | ||
fitBounds(boundsStream.result()); | ||
if (clip != null) projection.clipExtent(clip); | ||
return projection; | ||
} | ||
return projection | ||
.scale(k * 150) | ||
.translate([x, y]); | ||
export function fitExtent(projection, extent, object) { | ||
return fit(projection, function(b) { | ||
var w = extent[1][0] - extent[0][0], | ||
h = extent[1][1] - extent[0][1], | ||
k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), | ||
x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, | ||
y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2; | ||
projection.scale(150 * k).translate([x, y]); | ||
}, object); | ||
} | ||
@@ -32,1 +28,21 @@ | ||
} | ||
export function fitWidth(projection, width, object) { | ||
return fit(projection, function(b) { | ||
var w = +width, | ||
k = w / (b[1][0] - b[0][0]), | ||
x = (w - k * (b[1][0] + b[0][0])) / 2, | ||
y = -k * b[0][1]; | ||
projection.scale(150 * k).translate([x, y]); | ||
}, object); | ||
} | ||
export function fitHeight(projection, height, object) { | ||
return fit(projection, function(b) { | ||
var h = +height, | ||
k = h / (b[1][1] - b[0][1]), | ||
x = -k * b[0][0], | ||
y = (h - k * (b[1][1] + b[0][1])) / 2; | ||
projection.scale(150 * k).translate([x, y]); | ||
}, object); | ||
} |
import clipRectangle from "../clip/rectangle"; | ||
import identity from "../identity"; | ||
import {transformer} from "../transform"; | ||
import {fitExtent, fitSize} from "./fit"; | ||
import {fitExtent, fitSize, fitWidth, fitHeight} from "./fit"; | ||
@@ -54,4 +54,10 @@ function scaleTranslate(kx, ky, tx, ty) { | ||
return fitSize(projection, size, object); | ||
}, | ||
fitWidth: function(width, object) { | ||
return fitWidth(projection, width, object); | ||
}, | ||
fitHeight: function(height, object) { | ||
return fitHeight(projection, height, object); | ||
} | ||
}; | ||
} |
@@ -9,3 +9,3 @@ import clipAntimeridian from "../clip/antimeridian"; | ||
import {transformer} from "../transform"; | ||
import {fitExtent, fitSize} from "./fit"; | ||
import {fitExtent, fitSize, fitWidth, fitHeight} from "./fit"; | ||
import resample from "./resample"; | ||
@@ -106,2 +106,10 @@ | ||
projection.fitWidth = function(width, object) { | ||
return fitWidth(projection, width, object); | ||
}; | ||
projection.fitHeight = function(height, object) { | ||
return fitHeight(projection, height, object); | ||
}; | ||
function recenter() { | ||
@@ -108,0 +116,0 @@ projectRotate = compose(rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma), project); |
Sorry, the diff of this file is too big to display
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
1879677
5384
671