vega-projection
Advanced tools
Comparing version 1.4.5 to 1.5.0
@@ -1,2 +0,2 @@ | ||
var vega=function(n){"use strict";class t{constructor(){this._partials=new Float64Array(32),this._n=0}add(n){const t=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const e=t[i],o=n+e,u=Math.abs(n)<Math.abs(e)?n-(o-e):e-(o-n);u&&(t[r++]=u),n=o}return t[r]=n,this._n=r+1,this}valueOf(){const n=this._partials;let t,r,i,e=this._n,o=0;if(e>0){for(o=n[--e];e>0&&(t=o,r=n[--e],o=t+r,i=r-(o-t),!i););e>0&&(i<0&&n[e-1]<0||i>0&&n[e-1]>0)&&(r=2*i,t=o+r,r==t-o&&(o=t))}return o}}function r(n){return Array.from(function*(n){for(const t of n)yield*t}(n))}var i=1e-6,e=Math.PI,o=e/2,u=e/4,c=2*e,a=180/e,l=e/180,f=Math.abs,s=Math.atan,p=Math.atan2,h=Math.cos,v=Math.exp,g=Math.log,d=Math.pow,E=Math.sin,S=Math.sign||function(n){return n>0?1:n<0?-1:0},y=Math.sqrt,m=Math.tan;function _(n){return n>1?0:n<-1?e:Math.acos(n)}function M(n){return n>1?o:n<-1?-o:Math.asin(n)}function x(){}function w(n,t){n&&b.hasOwnProperty(n.type)&&b[n.type](n,t)}var N={Feature:function(n,t){w(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)w(r[i].geometry,t)}},b={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){P(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)P(r[i],t,0)},Polygon:function(n,t){j(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)j(r[i],t)},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)w(r[i],t)}};function P(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 j(n,t){var r=-1,i=n.length;for(t.polygonStart();++r<i;)P(n[r],t,1);t.polygonEnd()}function z(n,t){n&&N.hasOwnProperty(n.type)?N[n.type](n,t):w(n,t)}function A(n){return[p(n[1],n[0]),M(n[2])]}function q(n){var t=n[0],r=n[1],i=h(r);return[i*h(t),i*E(t),E(r)]}function R(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function k(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 L(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]}function F(n){var t=y(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function H(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}function O(n,t){return[f(n)>e?n+Math.round(-n/c)*c:n,t]}function T(n,t,r){return(n%=c)?t||r?H(X(n),Y(t,r)):X(n):t||r?Y(t,r):O}function W(n){return function(t,r){return[(t+=n)>e?t-c:t<-e?t+c:t,r]}}function X(n){var t=W(n);return t.invert=W(-n),t}function Y(n,t){var r=h(n),i=E(n),e=h(t),o=E(t);function u(n,t){var u=h(t),c=h(n)*u,a=E(n)*u,l=E(t),f=l*r+c*i;return[p(a*e-f*o,c*r-l*i),M(f*e+a*o)]}return u.invert=function(n,t){var u=h(t),c=h(n)*u,a=E(n)*u,l=E(t),f=l*e-a*o;return[p(a*e+l*o,c*r+f*i),M(f*r-c*i)]},u}function I(n,t){(t=q(t))[0]-=n,F(t);var r=_(-t[1]);return((-t[2]<0?-r:r)+c-i)%c}function G(){var n,t=[];return{point:function(t,r,i){n.push([t,r,i])},lineStart:function(){t.push(n=[])},lineEnd:x,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}}function Z(n,t){return f(n[0]-t[0])<i&&f(n[1]-t[1])<i}function B(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 D(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(Z(i,u)){if(!i[2]&&!u[2]){for(e.lineStart(),o=0;o<t;++o)e.point((i=n[o])[0],i[1]);return void e.lineEnd()}u[0]+=2e-6}c.push(r=new B(i,n,null,!0)),a.push(r.o=new B(i,null,r,!1)),c.push(r=new B(u,n,null,!1)),a.push(r.o=new B(u,null,r,!0))}})),c.length){for(a.sort(t),J(c),J(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()}}}function J(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 K(n){return f(n[0])<=e?n[0]:S(n[0])*((f(n[0])+e)%c-e)}function Q(n,a,l,f){return function(s){var v,g,d,S=a(s),y=G(),m=a(y),_=!1,x={point:w,lineStart:b,lineEnd:P,polygonStart:function(){x.point=j,x.lineStart=z,x.lineEnd=A,g=[],v=[]},polygonEnd:function(){x.point=w,x.lineStart=b,x.lineEnd=P,g=r(g);var n=function(n,r){var a=K(r),l=r[1],f=E(l),s=[E(a),-h(a),0],v=0,g=0,d=new t;1===f?l=o+i:-1===f&&(l=-o-i);for(var S=0,y=n.length;S<y;++S)if(_=(m=n[S]).length)for(var m,_,x=m[_-1],w=K(x),N=x[1]/2+u,b=E(N),P=h(N),j=0;j<_;++j,w=A,b=L,P=C,x=z){var z=m[j],A=K(z),R=z[1]/2+u,L=E(R),C=h(R),H=A-w,O=H>=0?1:-1,T=O*H,W=T>e,X=b*L;if(d.add(p(X*O*E(T),P*C+X*h(T))),v+=W?H+O*c:H,W^w>=a^A>=a){var Y=k(q(x),q(z));F(Y);var I=k(s,Y);F(I);var G=(W^H>=0?-1:1)*M(I[2]);(l>G||l===G&&(Y[0]||Y[1]))&&(g+=W^H>=0?1:-1)}}return(v<-i||v<i&&d<-1e-12)^1&g}(v,f);g.length?(_||(s.polygonStart(),_=!0),D(g,V,n,l,s)):n&&(_||(s.polygonStart(),_=!0),s.lineStart(),l(null,null,1,s),s.lineEnd()),_&&(s.polygonEnd(),_=!1),g=v=null},sphere:function(){s.polygonStart(),s.lineStart(),l(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function w(t,r){n(t,r)&&s.point(t,r)}function N(n,t){S.point(n,t)}function b(){x.point=N,S.lineStart()}function P(){x.point=w,S.lineEnd()}function j(n,t){d.push([n,t]),m.point(n,t)}function z(){m.lineStart(),d=[]}function A(){j(d[0][0],d[0][1]),m.lineEnd();var n,t,r,i,e=m.clean(),o=y.result(),u=o.length;if(d.pop(),v.push(d),d=null,u)if(1&e){if((t=(r=o[0]).length-1)>0){for(_||(s.polygonStart(),_=!0),s.lineStart(),n=0;n<t;++n)s.point((i=r[n])[0],i[1]);s.lineEnd()}}else u>1&&2&e&&o.push(o.pop().concat(o.shift())),g.push(o.filter(U))}return x}}function U(n){return n.length>1}function V(n,t){return((n=n.x)[0]<0?n[1]-o-i:o-n[1])-((t=t.x)[0]<0?t[1]-o-i:o-t[1])}O.invert=O;var $=Q((function(){return!0}),(function(n){var t,r=NaN,u=NaN,c=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(a,l){var p=a>0?e:-e,v=f(a-r);f(v-e)<i?(n.point(r,u=(u+l)/2>0?o:-o),n.point(c,u),n.lineEnd(),n.lineStart(),n.point(p,u),n.point(a,u),t=0):c!==p&&v>=e&&(f(r-c)<i&&(r-=c*i),f(a-p)<i&&(a-=p*i),u=function(n,t,r,e){var o,u,c=E(n-r);return f(c)>i?s((E(t)*(u=h(e))*E(r)-E(e)*(o=h(t))*E(n))/(o*u*c)):(t+e)/2}(r,u,a,l),n.point(c,u),n.lineEnd(),n.lineStart(),n.point(p,u),t=0),n.point(r=a,u=l),c=p},lineEnd:function(){n.lineEnd(),r=u=NaN},clean:function(){return 2-t}}}),(function(n,t,r,u){var c;if(null==n)c=r*o,u.point(-e,c),u.point(0,c),u.point(e,c),u.point(e,0),u.point(e,-c),u.point(0,-c),u.point(-e,-c),u.point(-e,0),u.point(-e,c);else if(f(n[0]-t[0])>i){var a=n[0]<t[0]?e:-e;c=r*a/2,u.point(-a,c),u.point(0,c),u.point(a,c)}else u.point(t[0],t[1])}),[-e,-o]);function nn(n){var t=h(n),r=6*l,o=t>0,u=f(t)>i;function a(n,r){return h(n)*h(r)>t}function s(n,r,o){var u=[1,0,0],c=k(q(n),q(r)),a=R(c,c),l=c[0],s=a-l*l;if(!s)return!o&&n;var p=t*a/s,h=-t*l/s,v=k(u,c),g=C(u,p);L(g,C(c,h));var d=v,E=R(g,d),S=R(d,d),m=E*E-S*(R(g,g)-1);if(!(m<0)){var _=y(m),M=C(d,(-E-_)/S);if(L(M,g),M=A(M),!o)return M;var x,w=n[0],N=r[0],b=n[1],P=r[1];N<w&&(x=w,w=N,N=x);var j=N-w,z=f(j-e)<i;if(!z&&P<b&&(x=b,b=P,P=x),z||j<i?z?b+P>0^M[1]<(f(M[0]-w)<i?b:P):b<=M[1]&&M[1]<=P:j>e^(w<=M[0]&&M[0]<=N)){var F=C(d,(-E+_)/S);return L(F,g),[M,A(F)]}}}function p(t,r){var i=o?n:e-n,u=0;return t<-i?u|=1:t>i&&(u|=2),r<-i?u|=4:r>i&&(u|=8),u}return Q(a,(function(n){var t,r,i,c,l;return{lineStart:function(){c=i=!1,l=1},point:function(f,h){var v,g=[f,h],d=a(f,h),E=o?d?0:p(f,h):d?p(f+(f<0?e:-e),h):0;if(!t&&(c=i=d)&&n.lineStart(),d!==i&&(!(v=s(t,g))||Z(t,v)||Z(g,v))&&(g[2]=1),d!==i)l=0,d?(n.lineStart(),v=s(g,t),n.point(v[0],v[1])):(v=s(t,g),n.point(v[0],v[1],2),n.lineEnd()),t=v;else if(u&&t&&o^d){var S;E&r||!(S=s(g,t,!0))||(l=0,o?(n.lineStart(),n.point(S[0][0],S[0][1]),n.point(S[1][0],S[1][1]),n.lineEnd()):(n.point(S[1][0],S[1][1]),n.lineEnd(),n.lineStart(),n.point(S[0][0],S[0][1],3)))}!d||t&&Z(t,g)||n.point(g[0],g[1]),t=g,i=d,r=E},lineEnd:function(){i&&n.lineEnd(),t=null},clean:function(){return l|(c&&i)<<1}}}),(function(t,i,e,o){!function(n,t,r,i,e,o){if(r){var u=h(t),a=E(t),l=i*r;null==e?(e=t+i*c,o=t-l/2):(e=I(u,e),o=I(u,o),(i>0?e<o:e>o)&&(e+=i*c));for(var f,s=e;i>0?s>o:s<o;s-=l)f=A([u,-a*h(s),-a*E(s)]),n.point(f[0],f[1])}}(o,n,r,e,t,i)}),o?[0,-n]:[-e,n-e])}var tn=1e9,rn=-tn;function en(n,t,e,o){function u(r,i){return n<=r&&r<=e&&t<=i&&i<=o}function c(r,i,u,c){var l=0,f=0;if(null==r||(l=a(r,u))!==(f=a(i,u))||s(r,i)<0^u>0)do{c.point(0===l||3===l?n:e,l>1?o:t)}while((l=(l+u+4)%4)!==f);else c.point(i[0],i[1])}function a(r,o){return f(r[0]-n)<i?o>0?0:3:f(r[0]-e)<i?o>0?2:1:f(r[1]-t)<i?o>0?1:0:o>0?3:2}function l(n,t){return s(n.x,t.x)}function s(n,t){var r=a(n,1),i=a(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(i){var a,f,s,p,h,v,g,d,E,S,y,m=i,_=G(),M={point:x,lineStart:function(){M.point=w,f&&f.push(s=[]);S=!0,E=!1,g=d=NaN},lineEnd:function(){a&&(w(p,h),v&&E&&_.rejoin(),a.push(_.result()));M.point=x,E&&m.lineEnd()},polygonStart:function(){m=_,a=[],f=[],y=!0},polygonEnd:function(){var t=function(){for(var t=0,r=0,i=f.length;r<i;++r)for(var e,u,c=f[r],a=1,l=c.length,s=c[0],p=s[0],h=s[1];a<l;++a)e=p,u=h,p=(s=c[a])[0],h=s[1],u<=o?h>o&&(p-e)*(o-u)>(h-u)*(n-e)&&++t:h<=o&&(p-e)*(o-u)<(h-u)*(n-e)&&--t;return t}(),e=y&&t,u=(a=r(a)).length;(e||u)&&(i.polygonStart(),e&&(i.lineStart(),c(null,null,1,i),i.lineEnd()),u&&D(a,l,t,c,i),i.polygonEnd());m=i,a=f=s=null}};function x(n,t){u(n,t)&&m.point(n,t)}function w(r,i){var c=u(r,i);if(f&&s.push([r,i]),S)p=r,h=i,v=c,S=!1,c&&(m.lineStart(),m.point(r,i));else if(c&&E)m.point(r,i);else{var a=[g=Math.max(rn,Math.min(tn,g)),d=Math.max(rn,Math.min(tn,d))],l=[r=Math.max(rn,Math.min(tn,r)),i=Math.max(rn,Math.min(tn,i))];!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}}}}}(a,l,n,t,e,o)?c&&(m.lineStart(),m.point(r,i),y=!1):(E||(m.lineStart(),m.point(a[0],a[1])),m.point(l[0],l[1]),c||m.lineEnd(),y=!1)}g=r,d=i,E=c}return M}}var on,un,cn,an,ln=n=>n,fn=new t,sn=new t,pn={point:x,lineStart:x,lineEnd:x,polygonStart:function(){pn.lineStart=hn,pn.lineEnd=dn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=x,fn.add(f(sn)),sn=new t},result:function(){var n=fn/2;return fn=new t,n}};function hn(){pn.point=vn}function vn(n,t){pn.point=gn,on=cn=n,un=an=t}function gn(n,t){sn.add(an*n-cn*t),cn=n,an=t}function dn(){gn(on,un)}var En=1/0,Sn=En,yn=-En,mn=yn,_n={point:function(n,t){n<En&&(En=n);n>yn&&(yn=n);t<Sn&&(Sn=t);t>mn&&(mn=t)},lineStart:x,lineEnd:x,polygonStart:x,polygonEnd:x,result:function(){var n=[[En,Sn],[yn,mn]];return yn=mn=-(Sn=En=1/0),n}};var Mn,xn,wn,Nn,bn=0,Pn=0,jn=0,zn=0,An=0,qn=0,Rn=0,kn=0,Ln=0,Cn={point:Fn,lineStart:Hn,lineEnd:Wn,polygonStart:function(){Cn.lineStart=Xn,Cn.lineEnd=Yn},polygonEnd:function(){Cn.point=Fn,Cn.lineStart=Hn,Cn.lineEnd=Wn},result:function(){var n=Ln?[Rn/Ln,kn/Ln]:qn?[zn/qn,An/qn]:jn?[bn/jn,Pn/jn]:[NaN,NaN];return bn=Pn=jn=zn=An=qn=Rn=kn=Ln=0,n}};function Fn(n,t){bn+=n,Pn+=t,++jn}function Hn(){Cn.point=On}function On(n,t){Cn.point=Tn,Fn(wn=n,Nn=t)}function Tn(n,t){var r=n-wn,i=t-Nn,e=y(r*r+i*i);zn+=e*(wn+n)/2,An+=e*(Nn+t)/2,qn+=e,Fn(wn=n,Nn=t)}function Wn(){Cn.point=Fn}function Xn(){Cn.point=In}function Yn(){Gn(Mn,xn)}function In(n,t){Cn.point=Gn,Fn(Mn=wn=n,xn=Nn=t)}function Gn(n,t){var r=n-wn,i=t-Nn,e=y(r*r+i*i);zn+=e*(wn+n)/2,An+=e*(Nn+t)/2,qn+=e,Rn+=(e=Nn*n-wn*t)*(wn+n),kn+=e*(Nn+t),Ln+=3*e,Fn(wn=n,Nn=t)}function Zn(n){this._context=n}Zn.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,c)}},result:x};var Bn,Dn,Jn,Kn,Qn,Un=new t,Vn={point:x,lineStart:function(){Vn.point=$n},lineEnd:function(){Bn&&nt(Dn,Jn),Vn.point=x},polygonStart:function(){Bn=!0},polygonEnd:function(){Bn=null},result:function(){var n=+Un;return Un=new t,n}};function $n(n,t){Vn.point=nt,Dn=Kn=n,Jn=Qn=t}function nt(n,t){Kn-=n,Qn-=t,Un.add(y(Kn*Kn+Qn*Qn)),Kn=n,Qn=t}function tt(){this._string=[]}function rt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function it(n,t){var r,i,e=4.5;function o(n){return n&&("function"==typeof e&&i.pointRadius(+e.apply(this,arguments)),z(n,r(i))),i.result()}return o.area=function(n){return z(n,r(pn)),pn.result()},o.measure=function(n){return z(n,r(Vn)),Vn.result()},o.bounds=function(n){return z(n,r(_n)),_n.result()},o.centroid=function(n){return z(n,r(Cn)),Cn.result()},o.projection=function(t){return arguments.length?(r=null==t?(n=null,ln):(n=t).stream,o):n},o.context=function(n){return arguments.length?(i=null==n?(t=null,new tt):new Zn(t=n),"function"!=typeof e&&i.pointRadius(e),o):t},o.pointRadius=function(n){return arguments.length?(e="function"==typeof n?n:(i.pointRadius(+n),+n),o):e},o.projection(n).context(t)}function et(n){return function(t){var r=new ot;for(var i in n)r[i]=n[i];return r.stream=t,r}}function ot(){}function ut(n,t,r){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),z(r,n.stream(_n)),t(_n.result()),null!=i&&n.clipExtent(i),n}function ct(n,t,r){return ut(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 at(n,t,r){return ct(n,[[0,0],t],r)}function lt(n,t,r){return ut(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 ft(n,t,r){return ut(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)}tt.prototype={_radius:4.5,_circle:rt(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=rt(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}},ot.prototype={constructor:ot,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 st=h(30*l);function pt(n,t){return+t?function(n,t){function r(e,o,u,c,a,l,s,h,v,g,d,E,S,m){var _=s-e,x=h-o,w=_*_+x*x;if(w>4*t&&S--){var N=c+g,b=a+d,P=l+E,j=y(N*N+b*b+P*P),z=M(P/=j),A=f(f(P)-1)<i||f(u-v)<i?(u+v)/2:p(b,N),q=n(A,z),R=q[0],k=q[1],L=R-e,C=k-o,F=x*L-_*C;(F*F/w>t||f((_*L+x*C)/w-.5)>.3||c*g+a*d+l*E<st)&&(r(e,o,u,c,a,l,R,k,A,N/=j,b/=j,P,S,m),m.point(R,k),r(R,k,A,N,b,P,s,h,v,g,d,E,S,m))}}return function(t){var i,e,o,u,c,a,l,f,s,p,h,v,g={point:d,lineStart:E,lineEnd:y,polygonStart:function(){t.polygonStart(),g.lineStart=m},polygonEnd:function(){t.polygonEnd(),g.lineStart=E}};function d(r,i){r=n(r,i),t.point(r[0],r[1])}function E(){f=NaN,g.point=S,t.lineStart()}function S(i,e){var o=q([i,e]),u=n(i,e);r(f,s,l,p,h,v,f=u[0],s=u[1],l=i,p=o[0],h=o[1],v=o[2],16,t),t.point(f,s)}function y(){g.point=d,t.lineEnd()}function m(){E(),g.point=_,g.lineEnd=M}function _(n,t){S(i=n,t),e=f,o=s,u=p,c=h,a=v,g.point=S}function M(){r(f,s,l,p,h,v,e,o,i,u,c,a,16,t),g.lineEnd=y,y()}return g}}(n,t):function(n){return et({point:function(t,r){t=n(t,r),this.stream.point(t[0],t[1])}})}(n)}var ht=et({point:function(n,t){this.stream.point(n*l,t*l)}});function vt(n,t,r,i,e,o){if(!o)return function(n,t,r,i,e){function o(o,u){return[t+n*(o*=i),r-n*(u*=e)]}return o.invert=function(o,u){return[(o-t)/n*i,(r-u)/n*e]},o}(n,t,r,i,e);var u=h(o),c=E(o),a=u*n,l=c*n,f=u/n,s=c/n,p=(c*r-u*t)/n,v=(c*t+u*r)/n;function g(n,o){return[a*(n*=i)-l*(o*=e)+t,r-l*n-a*o]}return g.invert=function(n,t){return[i*(f*n-s*t+p),e*(v-s*n-f*t)]},g}function gt(n){return dt((function(){return n}))()}function dt(n){var t,r,i,e,o,u,c,f,s,p,h=150,v=480,g=250,d=0,E=0,S=0,m=0,_=0,M=0,x=1,w=1,N=null,b=$,P=null,j=ln,z=.5;function A(n){return f(n[0]*l,n[1]*l)}function q(n){return(n=f.invert(n[0],n[1]))&&[n[0]*a,n[1]*a]}function R(){var n=vt(h,0,0,x,w,M).apply(null,t(d,E)),i=vt(h,v-n[0],g-n[1],x,w,M);return r=T(S,m,_),c=H(t,i),f=H(r,c),u=pt(c,z),k()}function k(){return s=p=null,A}return A.stream=function(n){return s&&p===n?s:s=ht(function(n){return et({point:function(t,r){var i=n(t,r);return this.stream.point(i[0],i[1])}})}(r)(b(u(j(p=n)))))},A.preclip=function(n){return arguments.length?(b=n,N=void 0,k()):b},A.postclip=function(n){return arguments.length?(j=n,P=i=e=o=null,k()):j},A.clipAngle=function(n){return arguments.length?(b=+n?nn(N=n*l):(N=null,$),k()):N*a},A.clipExtent=function(n){return arguments.length?(j=null==n?(P=i=e=o=null,ln):en(P=+n[0][0],i=+n[0][1],e=+n[1][0],o=+n[1][1]),k()):null==P?null:[[P,i],[e,o]]},A.scale=function(n){return arguments.length?(h=+n,R()):h},A.translate=function(n){return arguments.length?(v=+n[0],g=+n[1],R()):[v,g]},A.center=function(n){return arguments.length?(d=n[0]%360*l,E=n[1]%360*l,R()):[d*a,E*a]},A.rotate=function(n){return arguments.length?(S=n[0]%360*l,m=n[1]%360*l,_=n.length>2?n[2]%360*l:0,R()):[S*a,m*a,_*a]},A.angle=function(n){return arguments.length?(M=n%360*l,R()):M*a},A.reflectX=function(n){return arguments.length?(x=n?-1:1,R()):x<0},A.reflectY=function(n){return arguments.length?(w=n?-1:1,R()):w<0},A.precision=function(n){return arguments.length?(u=pt(c,z=n*n),k()):y(z)},A.fitExtent=function(n,t){return ct(A,n,t)},A.fitSize=function(n,t){return at(A,n,t)},A.fitWidth=function(n,t){return lt(A,n,t)},A.fitHeight=function(n,t){return ft(A,n,t)},function(){return t=n.apply(this,arguments),A.invert=t.invert&&q,R()}}function Et(n){var t=0,r=e/3,i=dt(n),o=i(t,r);return o.parallels=function(n){return arguments.length?i(t=n[0]*l,r=n[1]*l):[t*a,r*a]},o}function St(n,t){var r=E(n),o=(r+E(t))/2;if(f(o)<i)return function(n){var t=h(n);function r(n,r){return[n*t,E(r)/t]}return r.invert=function(n,r){return[n/t,M(r*t)]},r}(n);var u=1+r*(2*o-r),c=y(u)/o;function a(n,t){var r=y(u-2*o*E(t))/o;return[r*E(n*=o),c-r*h(n)]}return a.invert=function(n,t){var r=c-t,i=p(n,f(r))*S(r);return r*o<0&&(i-=e*S(n)*S(r)),[i/o,M((u-(n*n+r*r)*o*o)/(2*o))]},a}function yt(){return Et(St).scale(155.424).center([0,33.6442])}function mt(){return yt().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function _t(n){return function(t,r){var i=h(t),e=h(r),o=n(i*e);return o===1/0?[2,0]:[o*e*E(t),o*E(r)]}}function Mt(n){return function(t,r){var i=y(t*t+r*r),e=n(i),o=E(e),u=h(e);return[p(t*o,i*u),M(i&&r*o/i)]}}var xt=_t((function(n){return y(2/(1+n))}));xt.invert=Mt((function(n){return 2*M(n/2)}));var wt=_t((function(n){return(n=_(n))&&n/E(n)}));function Nt(n,t){return[n,g(m((o+t)/2))]}function bt(n){var t,r,i,o=gt(n),u=o.center,c=o.scale,f=o.translate,s=o.clipExtent,p=null;function h(){var u=e*c(),f=o(function(n){function t(t){return(t=n(t[0]*l,t[1]*l))[0]*=a,t[1]*=a,t}return n=T(n[0]*l,n[1]*l,n.length>2?n[2]*l:0),t.invert=function(t){return(t=n.invert(t[0]*l,t[1]*l))[0]*=a,t[1]*=a,t},t}(o.rotate()).invert([0,0]));return s(null==p?[[f[0]-u,f[1]-u],[f[0]+u,f[1]+u]]:n===Nt?[[Math.max(f[0]-u,p),t],[Math.min(f[0]+u,r),i]]:[[p,Math.max(f[1]-u,t)],[r,Math.min(f[1]+u,i)]])}return o.scale=function(n){return arguments.length?(c(n),h()):c()},o.translate=function(n){return arguments.length?(f(n),h()):f()},o.center=function(n){return arguments.length?(u(n),h()):u()},o.clipExtent=function(n){return arguments.length?(null==n?p=t=r=i=null:(p=+n[0][0],t=+n[0][1],r=+n[1][0],i=+n[1][1]),h()):null==p?null:[[p,t],[r,i]]},h()}function Pt(n){return m((o+n)/2)}function jt(n,t){var r=h(n),u=n===t?E(n):g(r/h(t))/g(Pt(t)/Pt(n)),c=r*d(Pt(n),u)/u;if(!u)return Nt;function a(n,t){c>0?t<-o+i&&(t=-o+i):t>o-i&&(t=o-i);var r=c/d(Pt(t),u);return[r*E(u*n),c-r*h(u*n)]}return a.invert=function(n,t){var r=c-t,i=S(u)*y(n*n+r*r),a=p(n,f(r))*S(r);return r*u<0&&(a-=e*S(n)*S(r)),[a/u,2*s(d(c/i,1/u))-o]},a}function zt(n,t){return[n,t]}function At(n,t){var r=h(n),o=n===t?E(n):(r-h(t))/(t-n),u=r/o+n;if(f(o)<i)return zt;function c(n,t){var r=u-t,i=o*n;return[r*E(i),u-r*h(i)]}return c.invert=function(n,t){var r=u-t,i=p(n,f(r))*S(r);return r*o<0&&(i-=e*S(n)*S(r)),[i/o,u-S(o)*y(n*n+r*r)]},c}wt.invert=Mt((function(n){return n})),Nt.invert=function(n,t){return[n,2*s(v(t))-o]},zt.invert=zt;var qt=1.340264,Rt=-.081106,kt=893e-6,Lt=.003796,Ct=y(3)/2;function Ft(n,t){var r=M(Ct*E(t)),i=r*r,e=i*i*i;return[n*h(r)/(Ct*(qt+3*Rt*i+e*(7*kt+9*Lt*i))),r*(qt+Rt*i+e*(kt+Lt*i))]}function Ht(n,t){var r=h(t),i=h(n)*r;return[r*E(n)/i,E(t)/i]}function Ot(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 Tt(n,t){return[h(t)*E(n),E(t)]}function Wt(n,t){var r=h(t),i=1+h(n)*r;return[r*E(n)/i,E(t)/i]}function Xt(n,t){return[g(m((o+t)/2)),-n]}Ft.invert=function(n,t){for(var r,i=t,e=i*i,o=e*e*e,u=0;u<12&&(o=(e=(i-=r=(i*(qt+Rt*e+o*(kt+Lt*e))-t)/(qt+3*Rt*e+o*(7*kt+9*Lt*e)))*i)*e*e,!(f(r)<1e-12));++u);return[Ct*n*(qt+3*Rt*e+o*(7*kt+9*Lt*e))/h(i),M(E(i)/Ct)]},Ht.invert=Mt(s),Ot.invert=function(n,t){var r,e=t,o=25;do{var u=e*e,c=u*u;e-=r=(e*(1.007226+u*(.015085+c*(.028874*u-.044475-.005916*c)))-t)/(1.007226+u*(.045255+c*(.259866*u-.311325-.005916*11*c)))}while(f(r)>i&&--o>0);return[n/(.8707+(u=e*e)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),e]},Tt.invert=Mt(M),Wt.invert=Mt((function(n){return 2*s(n)})),Xt.invert=function(n,t){return[-t,2*s(v(n))-o]};var Yt,It=Math.abs,Gt=Math.cos,Zt=Math.sin,Bt=Math.PI,Dt=Bt/2,Jt=(Yt=2)>0?Math.sqrt(Yt):0;function Kt(n){return n>1?Dt:n<-1?-Dt:Math.asin(n)}function Qt(n,t){var r,i=n*Zt(t),e=30;do{t-=r=(t+Zt(t)-i)/(1+Gt(t))}while(It(r)>1e-6&&--e>0);return t/2}var Ut=function(n,t,r){function i(i,e){return[n*i*Gt(e=Qt(r,e)),t*Zt(e)]}return i.invert=function(i,e){return e=Kt(e/t),[i/(n*Gt(e)),Kt((2*e+Zt(2*e))/r)]},i}(Jt/Dt,Jt,Bt);const Vt=it(),$t=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function nr(n,t){return function r(){const i=t();return i.type=n,i.path=it().projection(i),i.copy=i.copy||function(){const n=r();return $t.forEach(t=>{i[t]&&n[t](i[t]())}),n.path.pointRadius(i.path.pointRadius()),n},i}}function tr(n,t){if(!n||"string"!=typeof n)throw new Error("Projection type must be a name string.");return n=n.toLowerCase(),arguments.length>1?(rr[n]=nr(n,t),this):rr[n]||null}const rr={albers:mt,albersusa:function(){var n,t,r,e,o,u,c=mt(),a=yt().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=yt().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f={point:function(n,t){u=[n,t]}};function s(n){var t=n[0],i=n[1];return u=null,r.point(t,i),u||(e.point(t,i),u)||(o.point(t,i),u)}function p(){return n=t=null,s}return s.invert=function(n){var t=c.scale(),r=c.translate(),i=(n[0]-r[0])/t,e=(n[1]-r[1])/t;return(e>=.12&&e<.234&&i>=-.425&&i<-.214?a:e>=.166&&e<.234&&i>=-.214&&i<-.115?l:c).invert(n)},s.stream=function(r){return n&&t===r?n:(i=[c.stream(t=r),a.stream(r),l.stream(r)],e=i.length,n={point:function(n,t){for(var r=-1;++r<e;)i[r].point(n,t)},sphere:function(){for(var n=-1;++n<e;)i[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)i[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)i[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)i[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)i[n].polygonEnd()}});var i,e},s.precision=function(n){return arguments.length?(c.precision(n),a.precision(n),l.precision(n),p()):c.precision()},s.scale=function(n){return arguments.length?(c.scale(n),a.scale(.35*n),l.scale(n),s.translate(c.translate())):c.scale()},s.translate=function(n){if(!arguments.length)return c.translate();var t=c.scale(),u=+n[0],s=+n[1];return r=c.translate(n).clipExtent([[u-.455*t,s-.238*t],[u+.455*t,s+.238*t]]).stream(f),e=a.translate([u-.307*t,s+.201*t]).clipExtent([[u-.425*t+i,s+.12*t+i],[u-.214*t-i,s+.234*t-i]]).stream(f),o=l.translate([u-.205*t,s+.212*t]).clipExtent([[u-.214*t+i,s+.166*t+i],[u-.115*t-i,s+.234*t-i]]).stream(f),p()},s.fitExtent=function(n,t){return ct(s,n,t)},s.fitSize=function(n,t){return at(s,n,t)},s.fitWidth=function(n,t){return lt(s,n,t)},s.fitHeight=function(n,t){return ft(s,n,t)},s.scale(1070)},azimuthalequalarea:function(){return gt(xt).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return gt(wt).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return Et(jt).scale(109.5).parallels([30,30])},conicequalarea:yt,conicequidistant:function(){return Et(At).scale(131.154).center([0,13.9389])},equalEarth:function(){return gt(Ft).scale(177.158)},equirectangular:function(){return gt(zt).scale(152.63)},gnomonic:function(){return gt(Ht).scale(144.049).clipAngle(60)},identity:function(){var n,t,r,i,e,o,u,c=1,f=0,s=0,p=1,v=1,g=0,d=null,S=1,y=1,m=et({point:function(n,t){var r=x([n,t]);this.stream.point(r[0],r[1])}}),_=ln;function M(){return S=c*p,y=c*v,o=u=null,x}function x(r){var i=r[0]*S,e=r[1]*y;if(g){var o=e*n-i*t;i=i*n+e*t,e=o}return[i+f,e+s]}return x.invert=function(r){var i=r[0]-f,e=r[1]-s;if(g){var o=e*n+i*t;i=i*n-e*t,e=o}return[i/S,e/y]},x.stream=function(n){return o&&u===n?o:o=m(_(u=n))},x.postclip=function(n){return arguments.length?(_=n,d=r=i=e=null,M()):_},x.clipExtent=function(n){return arguments.length?(_=null==n?(d=r=i=e=null,ln):en(d=+n[0][0],r=+n[0][1],i=+n[1][0],e=+n[1][1]),M()):null==d?null:[[d,r],[i,e]]},x.scale=function(n){return arguments.length?(c=+n,M()):c},x.translate=function(n){return arguments.length?(f=+n[0],s=+n[1],M()):[f,s]},x.angle=function(r){return arguments.length?(t=E(g=r%360*l),n=h(g),M()):g*a},x.reflectX=function(n){return arguments.length?(p=n?-1:1,M()):p<0},x.reflectY=function(n){return arguments.length?(v=n?-1:1,M()):v<0},x.fitExtent=function(n,t){return ct(x,n,t)},x.fitSize=function(n,t){return at(x,n,t)},x.fitWidth=function(n,t){return lt(x,n,t)},x.fitHeight=function(n,t){return ft(x,n,t)},x},mercator:function(){return bt(Nt).scale(961/c)},mollweide:function(){return gt(Ut).scale(169.529)},naturalEarth1:function(){return gt(Ot).scale(175.295)},orthographic:function(){return gt(Tt).scale(249.5).clipAngle(90.000001)},stereographic:function(){return gt(Wt).scale(250).clipAngle(142)},transversemercator:function(){var n=bt(Xt),t=n.center,r=n.rotate;return n.center=function(n){return arguments.length?t([-n[1],n[0]]):[(n=t())[1],-n[0]]},n.rotate=function(n){return arguments.length?r([n[0],n[1],n.length>2?n[2]+90:90]):[(n=r())[0],n[1],n[2]-90]},r([0,0,90]).scale(159.155)}};for(const n in rr)tr(n,rr[n]);return n.getProjectionPath=function(n){return n&&n.path||Vt},n.projection=tr,n.projectionProperties=$t,n}({}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).vega={})}(this,(function(n){"use strict";class t{constructor(){this._partials=new Float64Array(32),this._n=0}add(n){const t=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const e=t[i],o=n+e,u=Math.abs(n)<Math.abs(e)?n-(o-e):e-(o-n);u&&(t[r++]=u),n=o}return t[r]=n,this._n=r+1,this}valueOf(){const n=this._partials;let t,r,i,e=this._n,o=0;if(e>0){for(o=n[--e];e>0&&(t=o,r=n[--e],o=t+r,i=r-(o-t),!i););e>0&&(i<0&&n[e-1]<0||i>0&&n[e-1]>0)&&(r=2*i,t=o+r,r==t-o&&(o=t))}return o}}function r(n){return Array.from(function*(n){for(const t of n)yield*t}(n))}var i=1e-6,e=Math.PI,o=e/2,u=e/4,l=2*e,c=180/e,a=e/180,f=Math.abs,s=Math.atan,p=Math.atan2,h=Math.cos,v=Math.exp,g=Math.log,d=Math.pow,E=Math.sin,y=Math.sign||function(n){return n>0?1:n<0?-1:0},S=Math.sqrt,m=Math.tan;function _(n){return n>1?0:n<-1?e:Math.acos(n)}function x(n){return n>1?o:n<-1?-o:Math.asin(n)}function M(){}function w(n,t){n&&b.hasOwnProperty(n.type)&&b[n.type](n,t)}var N={Feature:function(n,t){w(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)w(r[i].geometry,t)}},b={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){P(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)P(r[i],t,0)},Polygon:function(n,t){j(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)j(r[i],t)},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)w(r[i],t)}};function P(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 j(n,t){var r=-1,i=n.length;for(t.polygonStart();++r<i;)P(n[r],t,1);t.polygonEnd()}function z(n,t){n&&N.hasOwnProperty(n.type)?N[n.type](n,t):w(n,t)}function A(n){return[p(n[1],n[0]),x(n[2])]}function q(n){var t=n[0],r=n[1],i=h(r);return[i*h(t),i*E(t),E(r)]}function R(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function T(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 k(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function L(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function O(n){var t=S(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function C(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}function F(n,t){return[f(n)>e?n+Math.round(-n/l)*l:n,t]}function H(n,t,r){return(n%=l)?t||r?C(X(n),Y(t,r)):X(n):t||r?Y(t,r):F}function W(n){return function(t,r){return[(t+=n)>e?t-l:t<-e?t+l:t,r]}}function X(n){var t=W(n);return t.invert=W(-n),t}function Y(n,t){var r=h(n),i=E(n),e=h(t),o=E(t);function u(n,t){var u=h(t),l=h(n)*u,c=E(n)*u,a=E(t),f=a*r+l*i;return[p(c*e-f*o,l*r-a*i),x(f*e+c*o)]}return u.invert=function(n,t){var u=h(t),l=h(n)*u,c=E(n)*u,a=E(t),f=a*e-c*o;return[p(c*e+a*o,l*r+f*i),x(f*r-l*i)]},u}function I(n,t){(t=q(t))[0]-=n,O(t);var r=_(-t[1]);return((-t[2]<0?-r:r)+l-i)%l}function G(){var n,t=[];return{point:function(t,r,i){n.push([t,r,i])},lineStart:function(){t.push(n=[])},lineEnd:M,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}}function Z(n,t){return f(n[0]-t[0])<i&&f(n[1]-t[1])<i}function B(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 D(n,t,r,i,e){var o,u,l=[],c=[];if(n.forEach((function(n){if(!((t=n.length-1)<=0)){var t,r,i=n[0],u=n[t];if(Z(i,u)){if(!i[2]&&!u[2]){for(e.lineStart(),o=0;o<t;++o)e.point((i=n[o])[0],i[1]);return void e.lineEnd()}u[0]+=2e-6}l.push(r=new B(i,n,null,!0)),c.push(r.o=new B(i,null,r,!1)),l.push(r=new B(u,n,null,!1)),c.push(r.o=new B(u,null,r,!0))}})),l.length){for(c.sort(t),J(l),J(c),o=0,u=c.length;o<u;++o)c[o].e=r=!r;for(var a,f,s=l[0];;){for(var p=s,h=!0;p.v;)if((p=p.n)===s)return;a=p.z,e.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(o=0,u=a.length;o<u;++o)e.point((f=a[o])[0],f[1]);else i(p.x,p.n.x,1,e);p=p.n}else{if(h)for(a=p.p.z,o=a.length-1;o>=0;--o)e.point((f=a[o])[0],f[1]);else i(p.x,p.p.x,-1,e);p=p.p}a=(p=p.o).z,h=!h}while(!p.v);e.lineEnd()}}}function J(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 K(n){return f(n[0])<=e?n[0]:y(n[0])*((f(n[0])+e)%l-e)}function Q(n,c,a,f){return function(s){var v,g,d,y=c(s),S=G(),m=c(S),_=!1,M={point:w,lineStart:b,lineEnd:P,polygonStart:function(){M.point=j,M.lineStart=z,M.lineEnd=A,g=[],v=[]},polygonEnd:function(){M.point=w,M.lineStart=b,M.lineEnd=P,g=r(g);var n=function(n,r){var c=K(r),a=r[1],f=E(a),s=[E(c),-h(c),0],v=0,g=0,d=new t;1===f?a=o+i:-1===f&&(a=-o-i);for(var y=0,S=n.length;y<S;++y)if(_=(m=n[y]).length)for(var m,_,M=m[_-1],w=K(M),N=M[1]/2+u,b=E(N),P=h(N),j=0;j<_;++j,w=A,b=k,P=L,M=z){var z=m[j],A=K(z),R=z[1]/2+u,k=E(R),L=h(R),C=A-w,F=C>=0?1:-1,H=F*C,W=H>e,X=b*k;if(d.add(p(X*F*E(H),P*L+X*h(H))),v+=W?C+F*l:C,W^w>=c^A>=c){var Y=T(q(M),q(z));O(Y);var I=T(s,Y);O(I);var G=(W^C>=0?-1:1)*x(I[2]);(a>G||a===G&&(Y[0]||Y[1]))&&(g+=W^C>=0?1:-1)}}return(v<-1e-6||v<i&&d<-1e-12)^1&g}(v,f);g.length?(_||(s.polygonStart(),_=!0),D(g,V,n,a,s)):n&&(_||(s.polygonStart(),_=!0),s.lineStart(),a(null,null,1,s),s.lineEnd()),_&&(s.polygonEnd(),_=!1),g=v=null},sphere:function(){s.polygonStart(),s.lineStart(),a(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function w(t,r){n(t,r)&&s.point(t,r)}function N(n,t){y.point(n,t)}function b(){M.point=N,y.lineStart()}function P(){M.point=w,y.lineEnd()}function j(n,t){d.push([n,t]),m.point(n,t)}function z(){m.lineStart(),d=[]}function A(){j(d[0][0],d[0][1]),m.lineEnd();var n,t,r,i,e=m.clean(),o=S.result(),u=o.length;if(d.pop(),v.push(d),d=null,u)if(1&e){if((t=(r=o[0]).length-1)>0){for(_||(s.polygonStart(),_=!0),s.lineStart(),n=0;n<t;++n)s.point((i=r[n])[0],i[1]);s.lineEnd()}}else u>1&&2&e&&o.push(o.pop().concat(o.shift())),g.push(o.filter(U))}return M}}function U(n){return n.length>1}function V(n,t){return((n=n.x)[0]<0?n[1]-o-i:o-n[1])-((t=t.x)[0]<0?t[1]-o-i:o-t[1])}F.invert=F;var $=Q((function(){return!0}),(function(n){var t,r=NaN,u=NaN,l=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(c,a){var p=c>0?e:-e,v=f(c-r);f(v-e)<i?(n.point(r,u=(u+a)/2>0?o:-o),n.point(l,u),n.lineEnd(),n.lineStart(),n.point(p,u),n.point(c,u),t=0):l!==p&&v>=e&&(f(r-l)<i&&(r-=l*i),f(c-p)<i&&(c-=p*i),u=function(n,t,r,e){var o,u,l=E(n-r);return f(l)>i?s((E(t)*(u=h(e))*E(r)-E(e)*(o=h(t))*E(n))/(o*u*l)):(t+e)/2}(r,u,c,a),n.point(l,u),n.lineEnd(),n.lineStart(),n.point(p,u),t=0),n.point(r=c,u=a),l=p},lineEnd:function(){n.lineEnd(),r=u=NaN},clean:function(){return 2-t}}}),(function(n,t,r,u){var l;if(null==n)l=r*o,u.point(-e,l),u.point(0,l),u.point(e,l),u.point(e,0),u.point(e,-l),u.point(0,-l),u.point(-e,-l),u.point(-e,0),u.point(-e,l);else if(f(n[0]-t[0])>i){var c=n[0]<t[0]?e:-e;l=r*c/2,u.point(-c,l),u.point(0,l),u.point(c,l)}else u.point(t[0],t[1])}),[-e,-o]);function nn(n){var t=h(n),r=6*a,o=t>0,u=f(t)>i;function c(n,r){return h(n)*h(r)>t}function s(n,r,o){var u=[1,0,0],l=T(q(n),q(r)),c=R(l,l),a=l[0],s=c-a*a;if(!s)return!o&&n;var p=t*c/s,h=-t*a/s,v=T(u,l),g=L(u,p);k(g,L(l,h));var d=v,E=R(g,d),y=R(d,d),m=E*E-y*(R(g,g)-1);if(!(m<0)){var _=S(m),x=L(d,(-E-_)/y);if(k(x,g),x=A(x),!o)return x;var M,w=n[0],N=r[0],b=n[1],P=r[1];N<w&&(M=w,w=N,N=M);var j=N-w,z=f(j-e)<i;if(!z&&P<b&&(M=b,b=P,P=M),z||j<i?z?b+P>0^x[1]<(f(x[0]-w)<i?b:P):b<=x[1]&&x[1]<=P:j>e^(w<=x[0]&&x[0]<=N)){var O=L(d,(-E+_)/y);return k(O,g),[x,A(O)]}}}function p(t,r){var i=o?n:e-n,u=0;return t<-i?u|=1:t>i&&(u|=2),r<-i?u|=4:r>i&&(u|=8),u}return Q(c,(function(n){var t,r,i,l,a;return{lineStart:function(){l=i=!1,a=1},point:function(f,h){var v,g=[f,h],d=c(f,h),E=o?d?0:p(f,h):d?p(f+(f<0?e:-e),h):0;if(!t&&(l=i=d)&&n.lineStart(),d!==i&&(!(v=s(t,g))||Z(t,v)||Z(g,v))&&(g[2]=1),d!==i)a=0,d?(n.lineStart(),v=s(g,t),n.point(v[0],v[1])):(v=s(t,g),n.point(v[0],v[1],2),n.lineEnd()),t=v;else if(u&&t&&o^d){var y;E&r||!(y=s(g,t,!0))||(a=0,o?(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],3)))}!d||t&&Z(t,g)||n.point(g[0],g[1]),t=g,i=d,r=E},lineEnd:function(){i&&n.lineEnd(),t=null},clean:function(){return a|(l&&i)<<1}}}),(function(t,i,e,o){!function(n,t,r,i,e,o){if(r){var u=h(t),c=E(t),a=i*r;null==e?(e=t+i*l,o=t-a/2):(e=I(u,e),o=I(u,o),(i>0?e<o:e>o)&&(e+=i*l));for(var f,s=e;i>0?s>o:s<o;s-=a)f=A([u,-c*h(s),-c*E(s)]),n.point(f[0],f[1])}}(o,n,r,e,t,i)}),o?[0,-n]:[-e,n-e])}var tn=1e9,rn=-tn;function en(n,t,e,o){function u(r,i){return n<=r&&r<=e&&t<=i&&i<=o}function l(r,i,u,l){var a=0,f=0;if(null==r||(a=c(r,u))!==(f=c(i,u))||s(r,i)<0^u>0)do{l.point(0===a||3===a?n:e,a>1?o:t)}while((a=(a+u+4)%4)!==f);else l.point(i[0],i[1])}function c(r,o){return f(r[0]-n)<i?o>0?0:3:f(r[0]-e)<i?o>0?2:1:f(r[1]-t)<i?o>0?1:0:o>0?3:2}function a(n,t){return s(n.x,t.x)}function s(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(i){var c,f,s,p,h,v,g,d,E,y,S,m=i,_=G(),x={point:M,lineStart:function(){x.point=w,f&&f.push(s=[]);y=!0,E=!1,g=d=NaN},lineEnd:function(){c&&(w(p,h),v&&E&&_.rejoin(),c.push(_.result()));x.point=M,E&&m.lineEnd()},polygonStart:function(){m=_,c=[],f=[],S=!0},polygonEnd:function(){var t=function(){for(var t=0,r=0,i=f.length;r<i;++r)for(var e,u,l=f[r],c=1,a=l.length,s=l[0],p=s[0],h=s[1];c<a;++c)e=p,u=h,p=(s=l[c])[0],h=s[1],u<=o?h>o&&(p-e)*(o-u)>(h-u)*(n-e)&&++t:h<=o&&(p-e)*(o-u)<(h-u)*(n-e)&&--t;return t}(),e=S&&t,u=(c=r(c)).length;(e||u)&&(i.polygonStart(),e&&(i.lineStart(),l(null,null,1,i),i.lineEnd()),u&&D(c,a,t,l,i),i.polygonEnd());m=i,c=f=s=null}};function M(n,t){u(n,t)&&m.point(n,t)}function w(r,i){var l=u(r,i);if(f&&s.push([r,i]),y)p=r,h=i,v=l,y=!1,l&&(m.lineStart(),m.point(r,i));else if(l&&E)m.point(r,i);else{var c=[g=Math.max(rn,Math.min(tn,g)),d=Math.max(rn,Math.min(tn,d))],a=[r=Math.max(rn,Math.min(tn,r)),i=Math.max(rn,Math.min(tn,i))];!function(n,t,r,i,e,o){var u,l=n[0],c=n[1],a=0,f=1,s=t[0]-l,p=t[1]-c;if(u=r-l,s||!(u>0)){if(u/=s,s<0){if(u<a)return;u<f&&(f=u)}else if(s>0){if(u>f)return;u>a&&(a=u)}if(u=e-l,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>a&&(a=u)}else if(s>0){if(u<a)return;u<f&&(f=u)}if(u=i-c,p||!(u>0)){if(u/=p,p<0){if(u<a)return;u<f&&(f=u)}else if(p>0){if(u>f)return;u>a&&(a=u)}if(u=o-c,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>a&&(a=u)}else if(p>0){if(u<a)return;u<f&&(f=u)}return a>0&&(n[0]=l+a*s,n[1]=c+a*p),f<1&&(t[0]=l+f*s,t[1]=c+f*p),!0}}}}}(c,a,n,t,e,o)?l&&(m.lineStart(),m.point(r,i),S=!1):(E||(m.lineStart(),m.point(c[0],c[1])),m.point(a[0],a[1]),l||m.lineEnd(),S=!1)}g=r,d=i,E=l}return x}}var on,un,ln,cn,an=n=>n,fn=new t,sn=new t,pn={point:M,lineStart:M,lineEnd:M,polygonStart:function(){pn.lineStart=hn,pn.lineEnd=dn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=M,fn.add(f(sn)),sn=new t},result:function(){var n=fn/2;return fn=new t,n}};function hn(){pn.point=vn}function vn(n,t){pn.point=gn,on=ln=n,un=cn=t}function gn(n,t){sn.add(cn*n-ln*t),ln=n,cn=t}function dn(){gn(on,un)}var En=pn,yn=1/0,Sn=yn,mn=-yn,_n=mn,xn={point:function(n,t){n<yn&&(yn=n);n>mn&&(mn=n);t<Sn&&(Sn=t);t>_n&&(_n=t)},lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M,result:function(){var n=[[yn,Sn],[mn,_n]];return mn=_n=-(Sn=yn=1/0),n}};var Mn,wn,Nn,bn,Pn=xn,jn=0,zn=0,An=0,qn=0,Rn=0,Tn=0,kn=0,Ln=0,On=0,Cn={point:Fn,lineStart:Hn,lineEnd:Yn,polygonStart:function(){Cn.lineStart=In,Cn.lineEnd=Gn},polygonEnd:function(){Cn.point=Fn,Cn.lineStart=Hn,Cn.lineEnd=Yn},result:function(){var n=On?[kn/On,Ln/On]:Tn?[qn/Tn,Rn/Tn]:An?[jn/An,zn/An]:[NaN,NaN];return jn=zn=An=qn=Rn=Tn=kn=Ln=On=0,n}};function Fn(n,t){jn+=n,zn+=t,++An}function Hn(){Cn.point=Wn}function Wn(n,t){Cn.point=Xn,Fn(Nn=n,bn=t)}function Xn(n,t){var r=n-Nn,i=t-bn,e=S(r*r+i*i);qn+=e*(Nn+n)/2,Rn+=e*(bn+t)/2,Tn+=e,Fn(Nn=n,bn=t)}function Yn(){Cn.point=Fn}function In(){Cn.point=Zn}function Gn(){Bn(Mn,wn)}function Zn(n,t){Cn.point=Bn,Fn(Mn=Nn=n,wn=bn=t)}function Bn(n,t){var r=n-Nn,i=t-bn,e=S(r*r+i*i);qn+=e*(Nn+n)/2,Rn+=e*(bn+t)/2,Tn+=e,kn+=(e=bn*n-Nn*t)*(Nn+n),Ln+=e*(bn+t),On+=3*e,Fn(Nn=n,bn=t)}var Dn=Cn;function Jn(n){this._context=n}Jn.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,l)}},result:M};var Kn,Qn,Un,Vn,$n,nt=new t,tt={point:M,lineStart:function(){tt.point=rt},lineEnd:function(){Kn&&it(Qn,Un),tt.point=M},polygonStart:function(){Kn=!0},polygonEnd:function(){Kn=null},result:function(){var n=+nt;return nt=new t,n}};function rt(n,t){tt.point=it,Qn=Vn=n,Un=$n=t}function it(n,t){Vn-=n,$n-=t,nt.add(S(Vn*Vn+$n*$n)),Vn=n,$n=t}var et=tt;function ot(){this._string=[]}function ut(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function lt(n,t){var r,i,e=4.5;function o(n){return n&&("function"==typeof e&&i.pointRadius(+e.apply(this,arguments)),z(n,r(i))),i.result()}return o.area=function(n){return z(n,r(En)),En.result()},o.measure=function(n){return z(n,r(et)),et.result()},o.bounds=function(n){return z(n,r(Pn)),Pn.result()},o.centroid=function(n){return z(n,r(Dn)),Dn.result()},o.projection=function(t){return arguments.length?(r=null==t?(n=null,an):(n=t).stream,o):n},o.context=function(n){return arguments.length?(i=null==n?(t=null,new ot):new Jn(t=n),"function"!=typeof e&&i.pointRadius(e),o):t},o.pointRadius=function(n){return arguments.length?(e="function"==typeof n?n:(i.pointRadius(+n),+n),o):e},o.projection(n).context(t)}function ct(n){return function(t){var r=new at;for(var i in n)r[i]=n[i];return r.stream=t,r}}function at(){}function ft(n,t,r){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),z(r,n.stream(Pn)),t(Pn.result()),null!=i&&n.clipExtent(i),n}function st(n,t,r){return ft(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,l=+t[0][1]+(e-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([u,l])}),r)}function pt(n,t,r){return st(n,[[0,0],t],r)}function ht(n,t,r){return ft(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 vt(n,t,r){return ft(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)}ot.prototype={_radius:4.5,_circle:ut(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=ut(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}},at.prototype={constructor:at,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 gt=h(30*a);function dt(n,t){return+t?function(n,t){function r(e,o,u,l,c,a,s,h,v,g,d,E,y,m){var _=s-e,M=h-o,w=_*_+M*M;if(w>4*t&&y--){var N=l+g,b=c+d,P=a+E,j=S(N*N+b*b+P*P),z=x(P/=j),A=f(f(P)-1)<i||f(u-v)<i?(u+v)/2:p(b,N),q=n(A,z),R=q[0],T=q[1],k=R-e,L=T-o,O=M*k-_*L;(O*O/w>t||f((_*k+M*L)/w-.5)>.3||l*g+c*d+a*E<gt)&&(r(e,o,u,l,c,a,R,T,A,N/=j,b/=j,P,y,m),m.point(R,T),r(R,T,A,N,b,P,s,h,v,g,d,E,y,m))}}return function(t){var i,e,o,u,l,c,a,f,s,p,h,v,g={point:d,lineStart:E,lineEnd:S,polygonStart:function(){t.polygonStart(),g.lineStart=m},polygonEnd:function(){t.polygonEnd(),g.lineStart=E}};function d(r,i){r=n(r,i),t.point(r[0],r[1])}function E(){f=NaN,g.point=y,t.lineStart()}function y(i,e){var o=q([i,e]),u=n(i,e);r(f,s,a,p,h,v,f=u[0],s=u[1],a=i,p=o[0],h=o[1],v=o[2],16,t),t.point(f,s)}function S(){g.point=d,t.lineEnd()}function m(){E(),g.point=_,g.lineEnd=x}function _(n,t){y(i=n,t),e=f,o=s,u=p,l=h,c=v,g.point=y}function x(){r(f,s,a,p,h,v,e,o,i,u,l,c,16,t),g.lineEnd=S,S()}return g}}(n,t):function(n){return ct({point:function(t,r){t=n(t,r),this.stream.point(t[0],t[1])}})}(n)}var Et=ct({point:function(n,t){this.stream.point(n*a,t*a)}});function yt(n,t,r,i,e,o){if(!o)return function(n,t,r,i,e){function o(o,u){return[t+n*(o*=i),r-n*(u*=e)]}return o.invert=function(o,u){return[(o-t)/n*i,(r-u)/n*e]},o}(n,t,r,i,e);var u=h(o),l=E(o),c=u*n,a=l*n,f=u/n,s=l/n,p=(l*r-u*t)/n,v=(l*t+u*r)/n;function g(n,o){return[c*(n*=i)-a*(o*=e)+t,r-a*n-c*o]}return g.invert=function(n,t){return[i*(f*n-s*t+p),e*(v-s*n-f*t)]},g}function St(n){return mt((function(){return n}))()}function mt(n){var t,r,i,e,o,u,l,f,s,p,h=150,v=480,g=250,d=0,E=0,y=0,m=0,_=0,x=0,M=1,w=1,N=null,b=$,P=null,j=an,z=.5;function A(n){return f(n[0]*a,n[1]*a)}function q(n){return(n=f.invert(n[0],n[1]))&&[n[0]*c,n[1]*c]}function R(){var n=yt(h,0,0,M,w,x).apply(null,t(d,E)),i=yt(h,v-n[0],g-n[1],M,w,x);return r=H(y,m,_),l=C(t,i),f=C(r,l),u=dt(l,z),T()}function T(){return s=p=null,A}return A.stream=function(n){return s&&p===n?s:s=Et(function(n){return ct({point:function(t,r){var i=n(t,r);return this.stream.point(i[0],i[1])}})}(r)(b(u(j(p=n)))))},A.preclip=function(n){return arguments.length?(b=n,N=void 0,T()):b},A.postclip=function(n){return arguments.length?(j=n,P=i=e=o=null,T()):j},A.clipAngle=function(n){return arguments.length?(b=+n?nn(N=n*a):(N=null,$),T()):N*c},A.clipExtent=function(n){return arguments.length?(j=null==n?(P=i=e=o=null,an):en(P=+n[0][0],i=+n[0][1],e=+n[1][0],o=+n[1][1]),T()):null==P?null:[[P,i],[e,o]]},A.scale=function(n){return arguments.length?(h=+n,R()):h},A.translate=function(n){return arguments.length?(v=+n[0],g=+n[1],R()):[v,g]},A.center=function(n){return arguments.length?(d=n[0]%360*a,E=n[1]%360*a,R()):[d*c,E*c]},A.rotate=function(n){return arguments.length?(y=n[0]%360*a,m=n[1]%360*a,_=n.length>2?n[2]%360*a:0,R()):[y*c,m*c,_*c]},A.angle=function(n){return arguments.length?(x=n%360*a,R()):x*c},A.reflectX=function(n){return arguments.length?(M=n?-1:1,R()):M<0},A.reflectY=function(n){return arguments.length?(w=n?-1:1,R()):w<0},A.precision=function(n){return arguments.length?(u=dt(l,z=n*n),T()):S(z)},A.fitExtent=function(n,t){return st(A,n,t)},A.fitSize=function(n,t){return pt(A,n,t)},A.fitWidth=function(n,t){return ht(A,n,t)},A.fitHeight=function(n,t){return vt(A,n,t)},function(){return t=n.apply(this,arguments),A.invert=t.invert&&q,R()}}function _t(n){var t=0,r=e/3,i=mt(n),o=i(t,r);return o.parallels=function(n){return arguments.length?i(t=n[0]*a,r=n[1]*a):[t*c,r*c]},o}function xt(n,t){var r=E(n),o=(r+E(t))/2;if(f(o)<i)return function(n){var t=h(n);function r(n,r){return[n*t,E(r)/t]}return r.invert=function(n,r){return[n/t,x(r*t)]},r}(n);var u=1+r*(2*o-r),l=S(u)/o;function c(n,t){var r=S(u-2*o*E(t))/o;return[r*E(n*=o),l-r*h(n)]}return c.invert=function(n,t){var r=l-t,i=p(n,f(r))*y(r);return r*o<0&&(i-=e*y(n)*y(r)),[i/o,x((u-(n*n+r*r)*o*o)/(2*o))]},c}function Mt(){return _t(xt).scale(155.424).center([0,33.6442])}function wt(){return Mt().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Nt(n){return function(t,r){var i=h(t),e=h(r),o=n(i*e);return o===1/0?[2,0]:[o*e*E(t),o*E(r)]}}function bt(n){return function(t,r){var i=S(t*t+r*r),e=n(i),o=E(e),u=h(e);return[p(t*o,i*u),x(i&&r*o/i)]}}var Pt=Nt((function(n){return S(2/(1+n))}));Pt.invert=bt((function(n){return 2*x(n/2)}));var jt=Nt((function(n){return(n=_(n))&&n/E(n)}));function zt(n,t){return[n,g(m((o+t)/2))]}function At(n){var t,r,i,o=St(n),u=o.center,l=o.scale,f=o.translate,s=o.clipExtent,p=null;function h(){var u=e*l(),f=o(function(n){function t(t){return(t=n(t[0]*a,t[1]*a))[0]*=c,t[1]*=c,t}return n=H(n[0]*a,n[1]*a,n.length>2?n[2]*a:0),t.invert=function(t){return(t=n.invert(t[0]*a,t[1]*a))[0]*=c,t[1]*=c,t},t}(o.rotate()).invert([0,0]));return s(null==p?[[f[0]-u,f[1]-u],[f[0]+u,f[1]+u]]:n===zt?[[Math.max(f[0]-u,p),t],[Math.min(f[0]+u,r),i]]:[[p,Math.max(f[1]-u,t)],[r,Math.min(f[1]+u,i)]])}return o.scale=function(n){return arguments.length?(l(n),h()):l()},o.translate=function(n){return arguments.length?(f(n),h()):f()},o.center=function(n){return arguments.length?(u(n),h()):u()},o.clipExtent=function(n){return arguments.length?(null==n?p=t=r=i=null:(p=+n[0][0],t=+n[0][1],r=+n[1][0],i=+n[1][1]),h()):null==p?null:[[p,t],[r,i]]},h()}function qt(n){return m((o+n)/2)}function Rt(n,t){var r=h(n),u=n===t?E(n):g(r/h(t))/g(qt(t)/qt(n)),l=r*d(qt(n),u)/u;if(!u)return zt;function c(n,t){l>0?t<-o+i&&(t=-o+i):t>o-i&&(t=o-i);var r=l/d(qt(t),u);return[r*E(u*n),l-r*h(u*n)]}return c.invert=function(n,t){var r=l-t,i=y(u)*S(n*n+r*r),c=p(n,f(r))*y(r);return r*u<0&&(c-=e*y(n)*y(r)),[c/u,2*s(d(l/i,1/u))-o]},c}function Tt(n,t){return[n,t]}function kt(n,t){var r=h(n),o=n===t?E(n):(r-h(t))/(t-n),u=r/o+n;if(f(o)<i)return Tt;function l(n,t){var r=u-t,i=o*n;return[r*E(i),u-r*h(i)]}return l.invert=function(n,t){var r=u-t,i=p(n,f(r))*y(r);return r*o<0&&(i-=e*y(n)*y(r)),[i/o,u-y(o)*S(n*n+r*r)]},l}jt.invert=bt((function(n){return n})),zt.invert=function(n,t){return[n,2*s(v(t))-o]},Tt.invert=Tt;var Lt=1.340264,Ot=-.081106,Ct=893e-6,Ft=.003796,Ht=S(3)/2;function Wt(n,t){var r=x(Ht*E(t)),i=r*r,e=i*i*i;return[n*h(r)/(Ht*(Lt+3*Ot*i+e*(7*Ct+9*Ft*i))),r*(Lt+Ot*i+e*(Ct+Ft*i))]}function Xt(n,t){var r=h(t),i=h(n)*r;return[r*E(n)/i,E(t)/i]}function Yt(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 It(n,t){return[h(t)*E(n),E(t)]}function Gt(n,t){var r=h(t),i=1+h(n)*r;return[r*E(n)/i,E(t)/i]}function Zt(n,t){return[g(m((o+t)/2)),-n]}Wt.invert=function(n,t){for(var r,i=t,e=i*i,o=e*e*e,u=0;u<12&&(o=(e=(i-=r=(i*(Lt+Ot*e+o*(Ct+Ft*e))-t)/(Lt+3*Ot*e+o*(7*Ct+9*Ft*e)))*i)*e*e,!(f(r)<1e-12));++u);return[Ht*n*(Lt+3*Ot*e+o*(7*Ct+9*Ft*e))/h(i),x(E(i)/Ht)]},Xt.invert=bt(s),Yt.invert=function(n,t){var r,e=t,o=25;do{var u=e*e,l=u*u;e-=r=(e*(1.007226+u*(.015085+l*(.028874*u-.044475-.005916*l)))-t)/(1.007226+u*(.045255+l*(.259866*u-.311325-.005916*11*l)))}while(f(r)>i&&--o>0);return[n/(.8707+(u=e*e)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),e]},It.invert=bt(x),Gt.invert=bt((function(n){return 2*s(n)})),Zt.invert=function(n,t){return[-t,2*s(v(n))-o]};var Bt,Dt=Math.abs,Jt=Math.cos,Kt=Math.sin,Qt=Math.PI,Ut=Qt/2,Vt=(Bt=2)>0?Math.sqrt(Bt):0;function $t(n){return n>1?Ut:n<-1?-Ut:Math.asin(n)}function nr(n,t){var r,i=n*Kt(t),e=30;do{t-=r=(t+Kt(t)-i)/(1+Jt(t))}while(Dt(r)>1e-6&&--e>0);return t/2}var tr=function(n,t,r){function i(i,e){return[n*i*Jt(e=nr(r,e)),t*Kt(e)]}return i.invert=function(i,e){return e=$t(e/t),[i/(n*Jt(e)),$t((2*e+Kt(2*e))/r)]},i}(Vt/Ut,Vt,Qt);const rr=lt(),ir=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function er(n,t){return function r(){const i=t();return i.type=n,i.path=lt().projection(i),i.copy=i.copy||function(){const n=r();return ir.forEach((t=>{i[t]&&n[t](i[t]())})),n.path.pointRadius(i.path.pointRadius()),n},i}}function or(n,t){if(!n||"string"!=typeof n)throw new Error("Projection type must be a name string.");return n=n.toLowerCase(),arguments.length>1?(ur[n]=er(n,t),this):ur[n]||null}const ur={albers:wt,albersusa:function(){var n,t,r,e,o,u,l=wt(),c=Mt().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=Mt().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f={point:function(n,t){u=[n,t]}};function s(n){var t=n[0],i=n[1];return u=null,r.point(t,i),u||(e.point(t,i),u)||(o.point(t,i),u)}function p(){return n=t=null,s}return s.invert=function(n){var t=l.scale(),r=l.translate(),i=(n[0]-r[0])/t,e=(n[1]-r[1])/t;return(e>=.12&&e<.234&&i>=-.425&&i<-.214?c:e>=.166&&e<.234&&i>=-.214&&i<-.115?a:l).invert(n)},s.stream=function(r){return n&&t===r?n:(i=[l.stream(t=r),c.stream(r),a.stream(r)],e=i.length,n={point:function(n,t){for(var r=-1;++r<e;)i[r].point(n,t)},sphere:function(){for(var n=-1;++n<e;)i[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)i[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)i[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)i[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)i[n].polygonEnd()}});var i,e},s.precision=function(n){return arguments.length?(l.precision(n),c.precision(n),a.precision(n),p()):l.precision()},s.scale=function(n){return arguments.length?(l.scale(n),c.scale(.35*n),a.scale(n),s.translate(l.translate())):l.scale()},s.translate=function(n){if(!arguments.length)return l.translate();var t=l.scale(),u=+n[0],s=+n[1];return r=l.translate(n).clipExtent([[u-.455*t,s-.238*t],[u+.455*t,s+.238*t]]).stream(f),e=c.translate([u-.307*t,s+.201*t]).clipExtent([[u-.425*t+i,s+.12*t+i],[u-.214*t-i,s+.234*t-i]]).stream(f),o=a.translate([u-.205*t,s+.212*t]).clipExtent([[u-.214*t+i,s+.166*t+i],[u-.115*t-i,s+.234*t-i]]).stream(f),p()},s.fitExtent=function(n,t){return st(s,n,t)},s.fitSize=function(n,t){return pt(s,n,t)},s.fitWidth=function(n,t){return ht(s,n,t)},s.fitHeight=function(n,t){return vt(s,n,t)},s.scale(1070)},azimuthalequalarea:function(){return St(Pt).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return St(jt).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return _t(Rt).scale(109.5).parallels([30,30])},conicequalarea:Mt,conicequidistant:function(){return _t(kt).scale(131.154).center([0,13.9389])},equalEarth:function(){return St(Wt).scale(177.158)},equirectangular:function(){return St(Tt).scale(152.63)},gnomonic:function(){return St(Xt).scale(144.049).clipAngle(60)},identity:function(){var n,t,r,i,e,o,u,l=1,f=0,s=0,p=1,v=1,g=0,d=null,y=1,S=1,m=ct({point:function(n,t){var r=M([n,t]);this.stream.point(r[0],r[1])}}),_=an;function x(){return y=l*p,S=l*v,o=u=null,M}function M(r){var i=r[0]*y,e=r[1]*S;if(g){var o=e*n-i*t;i=i*n+e*t,e=o}return[i+f,e+s]}return M.invert=function(r){var i=r[0]-f,e=r[1]-s;if(g){var o=e*n+i*t;i=i*n-e*t,e=o}return[i/y,e/S]},M.stream=function(n){return o&&u===n?o:o=m(_(u=n))},M.postclip=function(n){return arguments.length?(_=n,d=r=i=e=null,x()):_},M.clipExtent=function(n){return arguments.length?(_=null==n?(d=r=i=e=null,an):en(d=+n[0][0],r=+n[0][1],i=+n[1][0],e=+n[1][1]),x()):null==d?null:[[d,r],[i,e]]},M.scale=function(n){return arguments.length?(l=+n,x()):l},M.translate=function(n){return arguments.length?(f=+n[0],s=+n[1],x()):[f,s]},M.angle=function(r){return arguments.length?(t=E(g=r%360*a),n=h(g),x()):g*c},M.reflectX=function(n){return arguments.length?(p=n?-1:1,x()):p<0},M.reflectY=function(n){return arguments.length?(v=n?-1:1,x()):v<0},M.fitExtent=function(n,t){return st(M,n,t)},M.fitSize=function(n,t){return pt(M,n,t)},M.fitWidth=function(n,t){return ht(M,n,t)},M.fitHeight=function(n,t){return vt(M,n,t)},M},mercator:function(){return At(zt).scale(961/l)},mollweide:function(){return St(tr).scale(169.529)},naturalEarth1:function(){return St(Yt).scale(175.295)},orthographic:function(){return St(It).scale(249.5).clipAngle(90.000001)},stereographic:function(){return St(Gt).scale(250).clipAngle(142)},transversemercator:function(){var n=At(Zt),t=n.center,r=n.rotate;return n.center=function(n){return arguments.length?t([-n[1],n[0]]):[(n=t())[1],-n[0]]},n.rotate=function(n){return arguments.length?r([n[0],n[1],n.length>2?n[2]+90:90]):[(n=r())[0],n[1],n[2]-90]},r([0,0,90]).scale(159.155)}};for(const n in ur)or(n,ur[n]);n.getProjectionPath=function(n){return n&&n.path||rr},n.projection=or,n.projectionProperties=ir,Object.defineProperty(n,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=vega-projection.min.js.map |
{ | ||
"name": "vega-projection", | ||
"version": "1.4.5", | ||
"version": "1.5.0", | ||
"description": "Projections for cartographic mapping.", | ||
@@ -24,6 +24,6 @@ "keywords": [ | ||
"dependencies": { | ||
"d3-geo": "^2.0.1", | ||
"d3-geo-projection": "^3.0.0" | ||
"d3-geo": "^3.0.1", | ||
"d3-geo-projection": "^4.0.0" | ||
}, | ||
"gitHead": "4affcbedb9d14815dbb6d3b250ed231b54fc95c0" | ||
"gitHead": "9a3faca4395cade9ecdfde90af98f1c53e9916b2" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
250823
2460
1
+ Addedcommander@7.2.0(transitive)
+ Addedd3-array@3.2.4(transitive)
+ Addedd3-geo@3.1.1(transitive)
+ Addedd3-geo-projection@4.0.0(transitive)
+ Addedinternmap@2.0.3(transitive)
- Removedcommander@2.20.3(transitive)
- Removedd3-array@2.12.1(transitive)
- Removedd3-geo@2.0.2(transitive)
- Removedd3-geo-projection@3.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternmap@1.0.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedresolve@1.22.8(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
Updatedd3-geo@^3.0.1
Updatedd3-geo-projection@^4.0.0