You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
34 KiB
2 lines
34 KiB
5 years ago
|
// https://d3js.org/d3-geo/ Version 1.9.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?Gt:Math.acos(n)}function o(n){return n>1?Tt:n<-1?-Tt:Math.asin(n)}function u(n){return(n=Kt(n/2))*n}function c(){}function a(n,t){n&&tr.hasOwnProperty(n.type)&&tr[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(){or.point=h}function p(){g(it,et)}function h(n,t){or.point=g,it=n,et=t,ot=n*=It,ut=Ut(t=(t*=It)/2+kt),ct=Kt(t)}function g(n,t){t=(t*=It)/2+kt;var r=(n*=It)-ot,i=r>=0?1:-1,e=i*r,o=Ut(t),u=Kt(t),c=ct*u,a=ut*o+c*Ut(e),l=c*i*Kt(e);ir.add(Dt(l,a)),ot=n,ut=o,ct=u}function v(n){return[Dt(n[1],n[0]),o(n[2])]}function d(n){var t=n[0],r=n[1],i=Ut(r);return[i*Ut(t),i*Kt(t),Kt(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=Vt(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){dt.push(Et=[at=n,ft=n]),t<lt&&(lt=t),t>st&&(st=t)}function _(n,t){var r=d([n*It,t*It]);if(vt){var i=y(vt,r),e=y([i[1],-i[0],0],i);M(e),e=v(e);var o,u=n-pt,c=u>0?1:-1,a=e[0]*Ht*c,l=Wt(u)>180;l^(c*pt<a&&a<c*n)?(o=e[1]*Ht)>st&&(st=o):(a=(a+360)%360-180,l^(c*pt<a&&a<c*n)?(o=-e[1]*Ht)<lt&&(lt=o):(t<lt&&(lt=t),t>st&&(st=t))),l?n<pt?A(at,n)>A(at,ft)&&(ft=n):A(n,ft)>A(at,ft)&&(at=n):ft>=at?(n<at&&(at=n),n>ft&&(ft=n)):n>pt?A(at,n)>A(at,ft)&&(ft=n):A(n,ft)>A(at,ft)&&(at=n)}else dt.push(Et=[at=n,ft=n]);t<lt&&(lt=t),t>st&&(st=t),vt=r,pt=n}function N(){cr.point=_}function w(){Et[0]=at,Et[1]=ft,cr.point=x,vt=null}function C(n,t){if(vt){var r=n-pt;ur.add(Wt(r)>180?r+(r>0?360:-360):r)}else ht=n,gt=t;or.point(n,t),_(n,t)}function P(){or.lineStart()}function R(){C(ht,gt),or.lineEnd(),Wt(ur)>Ot&&(at=-(ft=180)),Et[0]=at,Et[1]=ft,vt=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*=It;var r=Ut(t*=It);b(r*Ut(n),r*Kt(n),Kt(t))}function b(n,t,r){mt+=(n-mt)/++yt,Mt+=(t-Mt)/yt,xt+=(r-xt)/yt}function L(){ar.point=O}function O(n,t){n*=It;var r=Ut(t*=It);qt=r*Ut(n),zt=r*Kt(n),bt=Kt(t),ar.point=G,b(qt,zt,bt)}function G(n,t){n*=It;var r=Ut(t*=It),i=r*Ut(n),e=r*Kt(n),o=Kt(t),u=Dt(Vt((u=zt*o-bt*e)*u+(u=bt*i-qt*o)*u+(u=qt*e-zt*i)*u),qt*i+zt*e+bt*o);St+=u,_t+=u*(qt+(qt=i)),Nt+=u*(zt+(zt=e)),wt+=u*(bt+(bt=o)),b(qt,zt,bt)}function T(){ar.point=z}function k(){ar.point=H}function F(){I(At,jt),ar.point=z}function H(n,t){At=n,jt=t,n*=It,t*=It,ar.point=I;var r=Ut(t);qt=r*Ut(n),zt=r*Kt(n),bt=Kt(t),b(qt,zt,bt)}function I(n,t){n*=It;var r=Ut(t*=It),i=r*Ut(n),e=r*Kt(n),u=Kt(t),c=zt*u-bt*e,a=bt*i-qt*u,l=qt*e-zt*i,f=Vt(c*c+a*a+l*l),s=o(f),p=f&&-s/f;Ct+=p*c,Pt+=p*a,Rt+=p*l,St+=s,_t+=s*(qt+(qt=i)),Nt+=s*(zt+(zt=e)),wt+=s*(bt+(bt=u)),b(qt,zt,bt)}function W(n,t){return[n>Gt?n-Ft:n<-Gt?n+Ft:n,t]}function B(n,t,r){return(n%=Ft)?t||r?fr(U(n),X(t,r)):U(n):t||r?X(t,r):W}function D(n){return function(t,r){return t+=n,[t>Gt?t-Ft:t<-Gt?t+Ft: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=Ut(t),a=Ut(n)*r,l=Kt(n)*r,f=Kt(t),s=f*i+a*e;return[Dt(l*u-s*c,a*i-f*e),o(s*u+l*c)]}var i=Ut(n),e=Kt(n),u=Ut(t),c=Kt(t);return r.invert=function(n,t){var r=Ut(t),a=Ut(n)*r,l=Kt(n)*r,f=Kt(t),s=f*u-l*c;return[Dt(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=Ut(t),c=Kt(t),a=i*r;null==e?(e=t+i*Ft,o=t-a/2):(e=Z(u,e),o=Z(u,o),(i>0?e<o:e>o)&&(e+=i*Ft));for(var l,f=e;i>0?f>o:f<o;f-=a)l=v([u,-c*Ut(f),-c*Kt(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)+Ft-Ot)%Ft}function J(n,t,r,i
|