d3-geo-106fc929.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import{m as n}from"./d3-array-d83825ab.js";
  2. // Adds floating point numbers with twice the normal precision.
  3. // Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and
  4. // Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3)
  5. // 305–363 (1997).
  6. // Code adapted from GeographicLib by Charles F. F. Karney,
  7. // http://geographiclib.sourceforge.net/
  8. function t(){return new i}function i(){this.reset()}i.prototype={constructor:i,reset:function(){this.s=// rounded value
  9. this.t=0;// exact error
  10. },add:function(n){o(r,n,this.t),o(this,r.s,this.s),this.s?this.t+=r.t:this.s=r.t},valueOf:function(){return this.s}};var r=new i;function o(n,t,i){var r=n.s=t+i,o=r-t,e=r-o;n.t=t-e+(i-o)}var e=1e-6,u=Math.PI,f=u/2,l=u/4,a=2*u,c=180/u,p=u/180,s=Math.abs,v=Math.atan,h=Math.atan2,g=Math.cos,d=Math.sin,E=Math.sqrt;function S(n){return n>1?0:n<-1?u:Math.acos(n)}function y(n){return n>1?f:n<-1?-f:Math.asin(n)}function m(){}function M(n,t){n&&N.hasOwnProperty(n.type)&&N[n.type](n,t)}var x={Feature:function(n,t){M(n.geometry,t)},FeatureCollection:function(n,t){for(var i=n.features,r=-1,o=i.length;++r<o;)M(i[r].geometry,t)}},N={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 i=n.coordinates,r=-1,o=i.length;++r<o;)n=i[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){w(n.coordinates,t,0)},MultiLineString:function(n,t){for(var i=n.coordinates,r=-1,o=i.length;++r<o;)w(i[r],t,0)},Polygon:function(n,t){P(n.coordinates,t)},MultiPolygon:function(n,t){for(var i=n.coordinates,r=-1,o=i.length;++r<o;)P(i[r],t)},GeometryCollection:function(n,t){for(var i=n.geometries,r=-1,o=i.length;++r<o;)M(i[r],t)}};function w(n,t,i){var r,o=-1,e=n.length-i;for(t.lineStart();++o<e;)r=n[o],t.point(r[0],r[1],r[2]);t.lineEnd()}function P(n,t){var i=-1,r=n.length;for(t.polygonStart();++i<r;)w(n[i],t,1);t.polygonEnd()}function z(n){return[h(n[1],n[0]),y(n[2])]}function j(n){var t=n[0],i=n[1],r=g(i);return[r*g(t),r*d(t),d(i)]}function I(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function O(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]]}
  11. // TODO return a
  12. function A(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function C(n,t){return[n[0]*t,n[1]*t,n[2]*t]}
  13. // TODO return d
  14. function F(n){var t=E(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function L(n,t){function i(i,r){return i=n(i,r),t(i[0],i[1])}return n.invert&&t.invert&&(i.invert=function(i,r){return(i=t.invert(i,r))&&n.invert(i[0],i[1])}),i}function b(n,t){return[n>u?n-a:n<-u?n+a:n,t]}function q(n){return function(t,i){return[(t+=n)>u?t-a:t<-u?t+a:t,i]}}function G(n){var t=q(n);return t.invert=q(-n),t}function k(n,t){var i=g(n),r=d(n),o=g(t),e=d(t);function u(n,t){var u=g(t),f=g(n)*u,l=d(n)*u,a=d(t),c=a*i+f*r;return[h(l*o-c*e,f*i-a*r),y(c*o+l*e)]}return u.invert=function(n,t){var u=g(t),f=g(n)*u,l=d(n)*u,a=d(t),c=a*o-l*e;return[h(l*o+a*e,f*i+c*r),y(c*i-f*r)]},u}
  15. // Generates a circle centered at [0°, 0°], with a given radius and precision.
  16. // Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].
  17. function B(n,t){(t=j(t))[0]-=n,F(t);var i=S(-t[1]);return((-t[2]<0?-i:i)+a-e)%a}function D(){var n,t=[];return{point:function(t,i){n.push([t,i])},lineStart:function(){t.push(n=[])},lineEnd:m,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var i=t;return t=[],n=null,i}}}function H(n,t){return s(n[0]-t[0])<e&&s(n[1]-t[1])<e}function J(n,t,i,r){this.x=n,this.z=t,this.o=i,// another intersection
  18. this.e=r,// is an entry?
  19. this.v=!1,// visited
  20. this.n=this.p=null}
  21. // A generalized polygon clipping algorithm: given a polygon that has been cut
  22. // into its visible line segments, and rejoins the segments by interpolating
  23. // along the clip edge.
  24. function K(n,t,i,r,o){var e,u,f=[],l=[];if(n.forEach((function(n){if(!((t=n.length-1)<=0)){var t,i,r=n[0],u=n[t];
  25. // If the first and last points of a segment are coincident, then treat as a
  26. // closed ring. TODO if all rings are closed, then the winding order of the
  27. // exterior ring should be checked.
  28. if(H(r,u)){for(o.lineStart(),e=0;e<t;++e)o.point((r=n[e])[0],r[1]);o.lineEnd()}else f.push(i=new J(r,n,null,!0)),l.push(i.o=new J(r,null,i,!1)),f.push(i=new J(u,n,null,!1)),l.push(i.o=new J(u,null,i,!0))}})),f.length){for(l.sort(t),Q(f),Q(l),e=0,u=l.length;e<u;++e)l[e].e=i=!i;for(var a,c,p=f[0];;){for(
  29. // Find first unvisited intersection.
  30. var s=p,v=!0;s.v;)if((s=s.n)===p)return;a=s.z,o.lineStart();do{if(s.v=s.o.v=!0,s.e){if(v)for(e=0,u=a.length;e<u;++e)o.point((c=a[e])[0],c[1]);else r(s.x,s.n.x,1,o);s=s.n}else{if(v)for(a=s.p.z,e=a.length-1;e>=0;--e)o.point((c=a[e])[0],c[1]);else r(s.x,s.p.x,-1,o);s=s.p}a=(s=s.o).z,v=!v}while(!s.v);o.lineEnd()}}}function Q(n){if(t=n.length){for(var t,i,r=0,o=n[0];++r<t;)o.n=i=n[r],i.p=o,o=i;o.n=i=n[0],i.p=o}}t(),t(),t(),b.invert=b;var R=1e9,T=-R;
  31. // TODO Use d3-polygon’s polygonContains here for the ring check?
  32. // TODO Eliminate duplicate buffering in clipBuffer and polygon.push?
  33. function U(t,i,r,o){function u(n,e){return t<=n&&n<=r&&i<=e&&e<=o}function f(n,e,u,f){var a=0,p=0;if(null==n||(a=l(n,u))!==(p=l(e,u))||c(n,e)<0^u>0)do{f.point(0===a||3===a?t:r,a>1?o:i)}while((a=(a+u+4)%4)!==p);else f.point(e[0],e[1])}function l(n,o){return s(n[0]-t)<e?o>0?0:3:s(n[0]-r)<e?o>0?2:1:s(n[1]-i)<e?o>0?1:0:o>0?3:2;// abs(p[1] - y1) < epsilon
  34. }function a(n,t){return c(n.x,t.x)}function c(n,t){var i=l(n,1),r=l(t,1);return i!==r?i-r:0===i?t[1]-n[1]:1===i?n[0]-t[0]:2===i?n[1]-t[1]:t[0]-n[0]}return function(e){var l,c,p,s,v,h,// first point
  35. g,d,E,// previous point
  36. S,y,m=e,M=D(),x={point:N,lineStart:function(){x.point=w,c&&c.push(p=[]);S=!0,E=!1,g=d=NaN}
  37. // TODO rather than special-case polygons, simply handle them separately.
  38. // Ideally, coincident intersection points should be jittered to avoid
  39. // clipping issues.
  40. ,lineEnd:function(){l&&(w(s,v),h&&E&&M.rejoin(),l.push(M.result()));x.point=N,E&&m.lineEnd()},polygonStart:
  41. // Buffer geometry within a polygon and then clip it en masse.
  42. function(){m=M,l=[],c=[],y=!0},polygonEnd:function(){var i=function(){for(var n=0,i=0,r=c.length;i<r;++i)for(var e,u,f=c[i],l=1,a=f.length,p=f[0],s=p[0],v=p[1];l<a;++l)e=s,u=v,s=(p=f[l])[0],v=p[1],u<=o?v>o&&(s-e)*(o-u)>(v-u)*(t-e)&&++n:v<=o&&(s-e)*(o-u)<(v-u)*(t-e)&&--n;return n}(),r=y&&i,u=(l=n(l)).length;(r||u)&&(e.polygonStart(),r&&(e.lineStart(),f(null,null,1,e),e.lineEnd()),u&&K(l,a,i,f,e),e.polygonEnd());m=e,l=c=p=null}};function N(n,t){u(n,t)&&m.point(n,t)}function w(n,e){var f=u(n,e);if(c&&p.push([n,e]),S)s=n,v=e,h=f,S=!1,f&&(m.lineStart(),m.point(n,e));else if(f&&E)m.point(n,e);else{var l=[g=Math.max(T,Math.min(R,g)),d=Math.max(T,Math.min(R,d))],a=[n=Math.max(T,Math.min(R,n)),e=Math.max(T,Math.min(R,e))];!function(n,t,i,r,o,e){var u,f=n[0],l=n[1],a=0,c=1,p=t[0]-f,s=t[1]-l;if(u=i-f,p||!(u>0)){if(u/=p,p<0){if(u<a)return;u<c&&(c=u)}else if(p>0){if(u>c)return;u>a&&(a=u)}if(u=o-f,p||!(u<0)){if(u/=p,p<0){if(u>c)return;u>a&&(a=u)}else if(p>0){if(u<a)return;u<c&&(c=u)}if(u=r-l,s||!(u>0)){if(u/=s,s<0){if(u<a)return;u<c&&(c=u)}else if(s>0){if(u>c)return;u>a&&(a=u)}if(u=e-l,s||!(u<0)){if(u/=s,s<0){if(u>c)return;u>a&&(a=u)}else if(s>0){if(u<a)return;u<c&&(c=u)}return a>0&&(n[0]=f+a*p,n[1]=l+a*s),c<1&&(t[0]=f+c*p,t[1]=l+c*s),!0}}}}}(l,a,t,i,r,o)?f&&(m.lineStart(),m.point(n,e),y=!1):(E||(m.lineStart(),m.point(l[0],l[1])),m.point(a[0],a[1]),f||m.lineEnd(),y=!1)}g=n,d=e,E=f}return x}}var V=t();function W(n){return n}t(),t(),t();var X=Infinity,Y=X,Z=-X,$=Z,_={point:function(n,t){n<X&&(X=n);n>Z&&(Z=n);t<Y&&(Y=t);t>$&&($=t)},lineStart:m,lineEnd:m,polygonStart:m,polygonEnd:m,result:function(){var n=[[X,Y],[Z,$]];return Z=$=-(Y=X=Infinity),n}};function nn(t,i,r,o){return function(f,c){var p,s,v,E=i(c),S=f.invert(o[0],o[1]),m=D(),M=i(m),x=!1,N={point:w,lineStart:z,lineEnd:I,polygonStart:function(){N.point=A,N.lineStart=C,N.lineEnd=L,s=[],p=[]},polygonEnd:function(){N.point=w,N.lineStart=z,N.lineEnd=I,s=n(s);var t=function(n,t){var i=t[0],r=t[1],o=[d(i),-g(i),0],f=0,c=0;V.reset();for(var p=0,s=n.length;p<s;++p)if(E=(v=n[p]).length)for(var v,E,S=v[E-1],m=S[0],M=S[1]/2+l,x=d(M),N=g(M),w=0;w<E;++w,m=z,x=A,N=C,S=P){var P=v[w],z=P[0],I=P[1]/2+l,A=d(I),C=g(I),L=z-m,b=L>=0?1:-1,q=b*L,G=q>u,k=x*A;
  43. // Are the longitudes either side of the point’s meridian (lambda),
  44. // and are the latitudes smaller than the parallel (phi)?
  45. if(V.add(h(k*b*d(q),N*C+k*g(q))),f+=G?L+b*a:L,G^m>=i^z>=i){var B=O(j(S),j(P));F(B);var D=O(o,B);F(D);var H=(G^L>=0?-1:1)*y(D[2]);(r>H||r===H&&(B[0]||B[1]))&&(c+=G^L>=0?1:-1)}}
  46. // First, determine whether the South pole is inside or outside:
  47. // It is inside if:
  48. // * the polygon winds around it in a clockwise direction.
  49. // * the polygon does not (cumulatively) wind around it, but has a negative
  50. // (counter-clockwise) area.
  51. // Second, count the (signed) number of times a segment crosses a lambda
  52. // from the point to the South pole. If it is zero, then the point is the
  53. // same side as the South pole.
  54. return(f<-e||f<e&&V<-e)^1&c}(p,S);s.length?(x||(c.polygonStart(),x=!0),K(s,rn,t,r,c)):t&&(x||(c.polygonStart(),x=!0),c.lineStart(),r(null,null,1,c),c.lineEnd()),x&&(c.polygonEnd(),x=!1),s=p=null},sphere:function(){c.polygonStart(),c.lineStart(),r(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function w(n,i){var r=f(n,i);t(n=r[0],i=r[1])&&c.point(n,i)}function P(n,t){var i=f(n,t);E.point(i[0],i[1])}function z(){N.point=P,E.lineStart()}function I(){N.point=w,E.lineEnd()}function A(n,t){v.push([n,t]);var i=f(n,t);M.point(i[0],i[1])}function C(){M.lineStart(),v=[]}function L(){A(v[0][0],v[0][1]),M.lineEnd();var n,t,i,r,o=M.clean(),e=m.result(),u=e.length;if(v.pop(),p.push(v),v=null,u)
  55. // No intersections.
  56. if(1&o){if((t=(i=e[0]).length-1)>0){for(x||(c.polygonStart(),x=!0),c.lineStart(),n=0;n<t;++n)c.point((r=i[n])[0],r[1]);c.lineEnd()}}else
  57. // Rejoin connected segments.
  58. // TODO reuse ringBuffer.rejoin()?
  59. u>1&&2&o&&e.push(e.pop().concat(e.shift())),s.push(e.filter(tn))}return N}}function tn(n){return n.length>1}
  60. // Intersections are sorted along the clip edge. For both antimeridian cutting
  61. // and circle clipping, the same comparison is used.
  62. function rn(n,t){return((n=n.x)[0]<0?n[1]-f-e:f-n[1])-((t=t.x)[0]<0?t[1]-f-e:f-t[1])}t();const on=nn((function(){return!0}),(
  63. // Takes a line and cuts into visible segments. Return values: 0 - there were
  64. // intersections or the line was empty; 1 - no intersections; 2 - there were
  65. // intersections, and the first and last segments should be rejoined.
  66. function(n){var t,i=NaN,r=NaN,o=NaN;// no intersections
  67. return{lineStart:function(){n.lineStart(),t=1},point:function(l,a){var c=l>0?u:-u,p=s(l-i);s(p-u)<e?(// line crosses a pole
  68. n.point(i,r=(r+a)/2>0?f:-f),n.point(o,r),n.lineEnd(),n.lineStart(),n.point(c,r),n.point(l,r),t=0):o!==c&&p>=u&&(// line crosses antimeridian
  69. s(i-o)<e&&(i-=o*e),// handle degeneracies
  70. s(l-c)<e&&(l-=c*e),r=function(n,t,i,r){var o,u,f=d(n-i);return s(f)>e?v((d(t)*(u=g(r))*d(i)-d(r)*(o=g(t))*d(n))/(o*u*f)):(t+r)/2}(i,r,l,a),n.point(o,r),n.lineEnd(),n.lineStart(),n.point(c,r),t=0),n.point(i=l,r=a),o=c},lineEnd:function(){n.lineEnd(),i=r=NaN},clean:function(){return 2-t;// if intersections, rejoin first and last segments
  71. }}}),(function(n,t,i,r){var o;if(null==n)o=i*f,r.point(-u,o),r.point(0,o),r.point(u,o),r.point(u,0),r.point(u,-o),r.point(0,-o),r.point(-u,-o),r.point(-u,0),r.point(-u,o);else if(s(n[0]-t[0])>e){var l=n[0]<t[0]?u:-u;o=i*l/2,r.point(-l,o),r.point(0,o),r.point(l,o)}else r.point(t[0],t[1])}),[-u,-f]);function en(n,t){var i=g(n),r=i>0,o=s(i)>e;// TODO optimise for this common case
  72. function f(n,t){return g(n)*g(t)>i}
  73. // Takes a line and cuts into visible segments. Return values used for polygon
  74. // clipping: 0 - there were intersections or the line was empty; 1 - no
  75. // intersections 2 - there were intersections, and the first and last segments
  76. // should be rejoined.
  77. // Intersects the great circle between a and b with the clip circle.
  78. function l(n,t,r){var o=[1,0,0],// normal
  79. f=O(j(n),j(t)),l=I(f,f),a=f[0],// cartesianDot(n1, n2),
  80. c=l-a*a;
  81. // We have two planes, n1.p = d1 and n2.p = d2.
  82. // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).
  83. // Two polar points.
  84. if(!c)return!r&&n;var p=i*l/c,v=-i*a/c,h=O(o,f),g=C(o,p);A(g,C(f,v));
  85. // Solve |p(t)|^2 = 1.
  86. var d=h,S=I(g,d),y=I(d,d),m=S*S-y*(I(g,g)-1);if(!(m<0)){var M=E(m),x=C(d,(-S-M)/y);if(A(x,g),x=z(x),!r)return x;
  87. // Two intersection points.
  88. var N,w=n[0],P=t[0],F=n[1],L=t[1];P<w&&(N=w,w=P,P=N);var b=P-w,q=s(b-u)<e;
  89. // Check that the first point is between a and b.
  90. if(!q&&L<F&&(N=F,F=L,L=N),q||b<e?q?F+L>0^x[1]<(s(x[0]-w)<e?F:L):F<=x[1]&&x[1]<=L:b>u^(w<=x[0]&&x[0]<=P)){var G=C(d,(-S+M)/y);return A(G,g),[x,z(G)]}}}
  91. // Generates a 4-bit vector representing the location of a point relative to
  92. // the small circle's bounding box.
  93. function c(t,i){var o=r?n:u-n,e=0;// above
  94. return t<-o?e|=1:t>o&&(e|=2),// right
  95. i<-o?e|=4:i>o&&(e|=8),e}return nn(f,(function(n){var t,// previous point
  96. i,// code for previous point
  97. a,// visibility of previous point
  98. p,// visibility of first point
  99. s;// no intersections
  100. return{lineStart:function(){p=a=!1,s=1},point:function(v,h){var g,d=[v,h],E=f(v,h),S=r?E?0:c(v,h):E?c(v+(v<0?u:-u),h):0;if(!t&&(p=a=E)&&n.lineStart(),
  101. // Handle degeneracies.
  102. // TODO ignore if not clipping polygons.
  103. E!==a&&(!(g=l(t,d))||H(t,g)||H(d,g))&&(d[0]+=e,d[1]+=e,E=f(d[0],d[1])),E!==a)s=0,E?(
  104. // outside going in
  105. n.lineStart(),g=l(d,t),n.point(g[0],g[1])):(
  106. // inside going out
  107. g=l(t,d),n.point(g[0],g[1]),n.lineEnd()),t=g;else if(o&&t&&r^E){var y;
  108. // If the codes for two points are different, or are both zero,
  109. // and there this segment intersects with the small circle.
  110. S&i||!(y=l(d,t,!0))||(s=0,r?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!E||t&&H(t,d)||n.point(d[0],d[1]),t=d,a=E,i=S},lineEnd:function(){a&&n.lineEnd(),t=null},
  111. // Rejoin first and last segments if there were intersections and the first
  112. // and last points were visible.
  113. clean:function(){return s|(p&&a)<<1}}}),(function(i,r,o,e){!function(n,t,i,r,o,e){if(i){var u=g(t),f=d(t),l=r*i;null==o?(o=t+r*a,e=t-l/2):(o=B(u,o),e=B(u,e),(r>0?o<e:o>e)&&(o+=r*a));for(var c,p=o;r>0?p>e:p<e;p-=l)c=z([u,-f*g(p),-f*d(p)]),n.point(c[0],c[1])}}(e,n,t,o,i,r)}),r?[0,-n]:[-u,n-u])}function un(n){return function(t){var i=new fn;for(var r in n)i[r]=n[r];return i.stream=t,i}}function fn(){}function ln(n,t,i){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],e=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),null!=e&&n.clipExtent(null),function(n,t){n&&x.hasOwnProperty(n.type)?x[n.type](n,t):M(n,t)}(i,n.stream(_));var u=_.result(),f=Math.min(r/(u[1][0]-u[0][0]),o/(u[1][1]-u[0][1])),l=+t[0][0]+(r-f*(u[1][0]+u[0][0]))/2,a=+t[0][1]+(o-f*(u[1][1]+u[0][1]))/2;return null!=e&&n.clipExtent(e),n.scale(150*f).translate([l,a])}fn.prototype={constructor:fn,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// maximum depth of subdivision
  114. an=g(30*p);// cos(minimum angular distance)
  115. function cn(n,t){return+t?function(n,t){function i(r,o,u,f,l,a,c,p,v,g,d,S,m,M){var x=c-r,N=p-o,w=x*x+N*N;if(w>4*t&&m--){var P=f+g,z=l+d,j=a+S,I=E(P*P+z*z+j*j),O=y(j/=I),A=s(s(j)-1)<e||s(u-v)<e?(u+v)/2:h(z,P),C=n(A,O),F=C[0],L=C[1],b=F-r,q=L-o,G=N*b-x*q;(G*G/w>t||s((x*b+N*q)/w-.5)>.3||f*g+l*d+a*S<an)&&(// angular distance
  116. i(r,o,u,f,l,a,F,L,A,P/=I,z/=I,j,m,M),M.point(F,L),i(F,L,A,P,z,j,c,p,v,g,d,S,m,M))}}return function(t){var r,o,e,u,f,l,// first point
  117. a,c,p,s,v,h,g={point:d,lineStart:E,lineEnd:y,polygonStart:function(){t.polygonStart(),g.lineStart=m},polygonEnd:function(){t.polygonEnd(),g.lineStart=E}};// previous point
  118. function d(i,r){i=n(i,r),t.point(i[0],i[1])}function E(){c=NaN,g.point=S,t.lineStart()}function S(r,o){var e=j([r,o]),u=n(r,o);i(c,p,a,s,v,h,c=u[0],p=u[1],a=r,s=e[0],v=e[1],h=e[2],16,t),t.point(c,p)}function y(){g.point=d,t.lineEnd()}function m(){E(),g.point=M,g.lineEnd=x}function M(n,t){S(r=n,t),o=c,e=p,u=s,f=v,l=h,g.point=S}function x(){i(c,p,a,s,v,h,o,e,r,u,f,l,16,t),g.lineEnd=y,y()}return g}}(n,t):function(n){return un({point:function(t,i){t=n(t,i),this.stream.point(t[0],t[1])}})}(n)}var pn=un({point:function(n,t){this.stream.point(n*p,t*p)}});function sn(n){return function(n){var t,// translate
  119. i,r,o,e,u,f,l,// precision
  120. s,v,h=150,// scale
  121. g=480,d=250,S=0,y=0,// center
  122. m=0,M=0,x=0,// rotate
  123. N=null,w=on,// clip angle
  124. P=null,z=W,// clip extent
  125. j=.5,I=cn(C,j);function O(n){return[(n=e(n[0]*p,n[1]*p))[0]*h+i,r-n[1]*h]}function A(n){return(n=e.invert((n[0]-i)/h,(r-n[1])/h))&&[n[0]*c,n[1]*c]}function C(n,o){return[(n=t(n,o))[0]*h+i,r-n[1]*h]}function F(){e=L(o=function(n,t,i){return(n%=a)?t||i?L(G(n),k(t,i)):G(n):t||i?k(t,i):b}(m,M,x),t);var n=t(S,y);return i=g-n[0]*h,r=d+n[1]*h,q()}function q(){return s=v=null,O}return O.stream=function(n){return s&&v===n?s:s=pn(w(o,I(z(v=n))))},O.clipAngle=function(n){return arguments.length?(w=+n?en(N=n*p,6*p):(N=null,on),q()):N*c},O.clipExtent=function(n){return arguments.length?(z=null==n?(P=u=f=l=null,W):U(P=+n[0][0],u=+n[0][1],f=+n[1][0],l=+n[1][1]),q()):null==P?null:[[P,u],[f,l]]},O.scale=function(n){return arguments.length?(h=+n,F()):h},O.translate=function(n){return arguments.length?(g=+n[0],d=+n[1],F()):[g,d]},O.center=function(n){return arguments.length?(S=n[0]%360*p,y=n[1]%360*p,F()):[S*c,y*c]},O.rotate=function(n){return arguments.length?(m=n[0]%360*p,M=n[1]%360*p,x=n.length>2?n[2]%360*p:0,F()):[m*c,M*c,x*c]},O.precision=function(n){return arguments.length?(I=cn(C,j=n*n),q()):E(j)},O.fitExtent=function(n,t){return ln(O,n,t)},O.fitSize=function(n,t){return function(n,t,i){return ln(n,[[0,0],t],i)}(O,n,t)},function(){return t=n.apply(this,arguments),O.invert=t.invert&&A,F()}}((function(){return n}))()}function vn(n){return function(t,i){var r=g(t),o=g(i),e=n(r*o);return[e*o*d(t),e*d(i)]}}function hn(n){return function(t,i){var r=E(t*t+i*i),o=n(r),e=d(o),u=g(o);return[h(t*e,r*u),y(r&&i*e/r)]}}vn((function(n){return E(2/(1+n))})).invert=hn((function(n){return 2*y(n/2)}));var gn=vn((function(n){return(n=S(n))&&n/d(n)}));function dn(){return sn(gn).scale(79.4188).clipAngle(179.999)}function En(n,t){return[n,t]}gn.invert=hn((function(n){return n})),En.invert=En;export{dn as g};
  126. //# sourceMappingURL=d3-geo-106fc929.js.map