d3/d3.min.js

5 строки
148 KiB
JavaScript
Исходник Постоянная ссылка Обычный вид История

2015-11-10 05:39:17 +03:00
!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function s(n){return(n+="")===ya||n[0]===Ma?Ma+n:n}function f(n){return(n+="")[0]===Ma?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=xa.length;r>e;++e){var u=xa[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function S(){ia.event.preventDefault()}function k(){for(var n,t=ia.event;n=t.sourceEvent;)t=n;return t}function E(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=ia.event;u.target=n,ia.event=u,t[u.type].apply(e,r)}finally{ia.event=i}}},t}function A(n){return _a(n,Ea),n}function N(n){return"function"==typeof n?n:function(){return wa(n,this)}}function C(n){return"function"==typeof n?n:function(){return Sa(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ia.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+ia.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=T(n).map(D);var u=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",L(u+" "+n))):e.setAttribute("class",L(u.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function j(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function U(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e?t.createElementNS(e,n):t.createElement(n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ia.
}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,l,c,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=l+p,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=ma(ma(w)-1)<Ta||ma(r-h)<Ta?(r+h)/2:Math.atan2(_,b),A=n(E,k),N=A[0],C=A[1],z=N-t,L=C-e,q=M*z-y*L;(q*q/x>i||ma((y*z+M*L)/x-.5)>.3||o>a*g+l*p+c*v)&&(u(t,e,r,a,l,c,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Fa),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function er(n){var t=tr(function(t,e){return n([t*Ha,e*Ha])});return function(n){return ar(t(n))}}function rr(n){this.stream=n}function ur(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ir(n){return or(function(){return n})()}function or(n){function t(n){return n=a(n[0]*Fa,n[1]*Fa),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Ha,n[1]*Ha]}function r(){a=Ne(o=sr(m,M,x),i);var n=i(v,d);return l=g-n[0]*h,c=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,l,c,s,f=tr(function(n,t){return n=i(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Dl,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=ar(b(o,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Dl):Oe((w=+n)*Fa),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Ye(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Fa,d=n[1]%360*Fa,r()):[v*Ha,d*Ha]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Fa,M=n[1]%360*Fa,x=n.length>2?n[2]%360*Fa:0,r()):[m*Ha,M*Ha,x*Ha]},ia.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function ar(n){return ur(n,function(t,e){n.point(t*Fa,e*Fa)})}function lr(n,t){return[n,t]}function cr(n,t){return[n>Da?n-Pa:-Da>n?n+Pa:n,t]}function sr(n,t,e){return n?t||e?Ne(hr(n),gr(t,e)):hr(n):t||e?gr(t,e):cr}function fr(n){return function(t,e){return t+=n,[t>Da?t-Pa:-Da>t?t+Pa:t,e]}}function hr(n){var t=fr(n);return t.invert=fr(-n),t}function gr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*r+a*u;return[Math.atan2(l*i-s*o,a*r-c*u),tt(s*i+l*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*i-l*o;return[Math.atan2(l*i+c*o,a*r+s*u),tt(s*r-a*u)]},e}function pr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var l=o*t;null!=u?(u=vr(e,u),i=vr(e,i),(o>0?i>u:u>i)&&(u+=o*Pa)):(u=n+o*Pa,i=n-.5*l);for(var c,s=u;o>0?s>i:i>s;s-=l)a.point((c=be([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],c[1])}}function vr(n,t){var e=ve(t);e[0]-=n,xe(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ta)%(2*Math.PI)}function dr(n,t,e){var r=ia.range(n,t-Ta,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function mr(n,t,e){var r=ia.range(n,t-Ta,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function yr(n){return n.source}function Mr(n){return n.target}function xr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=u*Math.cos(n),c=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*l+t*s,u=e*c+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ha,Math.atan2(o,Math.sqrt(r*r+u*u))*Ha]}:function(){return[n*Ha,t*Ha]};return p.distance=h,p}function br(){function n(n,u){var i=Math.sin(u*=Fa),o=Math.cos
}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=Et(e),b=Et(u),_=e===r?function(){return g}:Et(r),w=u===i?function(){return p}:Et(i);++y<M;)o.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(l(),d=[],m=[]);return d.length&&l(),v.length?v.join(""):null}var e=Nr,r=Nr,u=0,i=Cr,o=Ce,a=xo,l=a.key,c=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?a=n:(a=Cc.get(n)||xo).key,c=a.reverse||a,s=a.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Ho(n){return n.radius}function Oo(n){return[n.x,n.y]}function Io(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Ua;return[e*Math.cos(r),e*Math.sin(r)]}}function Yo(){return 64}function Zo(){return"circle"}function Vo(n){var t=Math.sqrt(n/Da);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Xo(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=0/0,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function $o(n,t,e){return _a(n,Fc),n.namespace=t,n.id=e,n}function Bo(n,t,e,r){var u=n.id,i=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[i][u].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Wo(n){return null==n&&(n=""),function(){this.textContent=n}}function Jo(n){return null==n?"__transition__":"__transition_"+n+"__"}function Go(n,t,e,r,u){function i(u){function i(e){var u=o.active,i=o[u];i&&(i.timer.c=null,i.timer.t=0/0,--o.count,delete o[u],i.event&&i.event.interrupt.call(n,n.__data__,i.index));for(var g in o)if(r>+g){var v=o[g];v.timer.c=null,v.timer.t=0/0,--o.count,delete o[g]}o.active=r,a.event&&a.event.start.call(n,n.__data__,t),a.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=a.ease,f=a.duration,s.c=c,Lt(function(){return s.c&&c(e||1)&&(s.c=null,s.t=0/0),1},0,l)}function c(u){for(var i=u/f,l=h(i),c=p.length;c>0;)p[--c].call(n,l);return i>=1?(a.event&&a.event.end.call(n,n.__data__,t),--o.count?delete o[r]:delete n[e],1):void 0}var f,h,g=a.delay,p=[];return s.t=g+l,u>=g?i(u-g):void(s.c=i)}var o=n[e]||(n[e]={active:0,count:0}),a=o[r];if(!a){var l=u.time,s=Lt(i,0,l);a=o[r]={tween:new c,time:l,timer:s,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++o.count}}function Ko(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Qo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function na(n){return n.toISOString()}function ta(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ia.bisect(Bc,u);return i==Bc.length?[t.year,Gi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Bc[i-1]<Bc[i]/u?i-1:i]:[Gc,Gi(n,e)[2]]}return r.invert=function(t){return ea(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(ea)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,ea(+e+1),t).length}var i=r.domain(),o=Ii(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Vi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=ea(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ea(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Ii(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ea(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ta(n.copy(),t,e)},Wi(r,n)}function ea(n){return new Date(n)}function ra(n){return JSON.parse(n.responseText)}function ua(n){va
ia.format=dl.numberFormat,ia.geo={},ce.prototype={s:0,t:0,add:function(n){se(n,this.t,ml),se(ml.s,this.s,this),this.s?this.t+=ml.t:this.s=ml.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ml=new ce;ia.geo.stream=function(n,t){n&&yl.hasOwnProperty(n.type)?yl[n.type](n,t):fe(n,t)};var yl={Feature:function(n,t){fe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)fe(e[r].geometry,t)}},Ml={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 e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){he(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)he(e[r],t,0)},Polygon:function(n,t){ge(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ge(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)fe(e[r],t)}};ia.geo.area=function(n){return xl=0,ia.geo.stream(n,_l),xl};var xl,bl=new ce,_l={sphere:function(){xl+=4*Da},point:b,lineStart:b,lineEnd:b,polygonStart:function(){bl.reset(),_l.lineStart=pe},polygonEnd:function(){var n=2*bl;xl+=0>n?4*Da+n:n,_l.lineStart=_l.lineEnd=_l.point=b}};ia.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=ve([t*Fa,e*Fa]);if(m){var u=me(m,r),i=[u[1],-u[0],0],o=me(i,u);xe(o),o=be(o);var l=t-p,c=l>0?1:-1,v=o[0]*Ha*c,d=ma(l)>180;if(d^(v>c*p&&c*t>v)){var y=o[1]*Ha;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>c*p&&c*t>v)){var y=-o[1]*Ha;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ma(r)>180?r+(r>0?360:-360):r}else v=n,d=e;_l.point(n,e),t(n,e)}function i(){_l.lineStart()}function o(){u(v,d),_l.lineEnd(),ma(y)>Ta&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,_l.polygonStart()},polygonEnd:function(){_l.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>bl?(s=-(h=180),f=-(g=90)):y>Ta?g=90:-Ta>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ia.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],c(e[0],u)||c(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ia.geo.centroid=function(n){wl=Sl=kl=El=Al=Nl=Cl=zl=Ll=ql=Tl=0,ia.geo.stream(n,Rl);var t=Ll,e=ql,r=Tl,u=t*t+e*e+r*r;return Ra>u&&(t=Nl,e=Cl,r=zl,Ta>Sl&&(t=kl,e=El,r=Al),u=t*t+e*e+r*r,Ra>u)?[0/0,0/0]:[Math.atan2(e,t)*Ha,tt(r/Math.sqrt(u))*Ha]};var wl,Sl,kl,El,Al,Nl,Cl,zl,Ll,ql,Tl,Rl={sphere:b,point:we,lineStart:ke,lineEnd:Ee,polygonStart:function(){Rl.lineStart=Ae},polygonEnd:function(){Rl.lineStart=ke}},Dl=Te(Ce,je,Fe,[-Da,-Da/2]),Pl=1e9;ia.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ye(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ia.geo.conicEqualArea=function(){return Ze(Ve)}).raw=Ve,ia.geo.albers=function(){return ia.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ia.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ia.geo.albers(),o=ia.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ia.geo.conicEqualArea().rotate([157,0]).center([-3
u.z=!1,u.dy+=e.y+e.dy-c,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=i.y=0,i.value?(i.dx=c[0],i.dy=c[1]):i.dx=i.dy=0,o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=ia.layout.hierarchy(),l=Math.round,c=[1,1],s=null,f=Hi,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(c=n,i):c},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Hi(t):Oi(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Oi(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Hi:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(l=n?Math.round:Number,i):l!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},ri(i,a)},ia.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ia.random.normal.apply(ia,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ia.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ia.scale={};var xc={floor:y,ceil:y};ia.scale.linear=function(){return Bi([0,1],[0,1],yu,!1)};var bc={s:1,g:1,p:1,r:1,e:1};ia.scale.log=function(){return eo(ia.scale.linear().domain([0,1]),10,!0,[1,10])};var _c=ia.format(".0e"),wc={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ia.scale.pow=function(){return ro(ia.scale.linear(),1,[0,1])},ia.scale.sqrt=function(){return ia.scale.pow().exponent(.5)},ia.scale.ordinal=function(){return io([],{t:"range",a:[[]]})},ia.scale.category10=function(){return ia.scale.ordinal().range(Sc)},ia.scale.category20=function(){return ia.scale.ordinal().range(kc)},ia.scale.category20b=function(){return ia.scale.ordinal().range(Ec)},ia.scale.category20c=function(){return ia.scale.ordinal().range(Ac)};var Sc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),kc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),Ec=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Ac=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ia.scale.quantile=function(){return oo([],[])},ia.scale.quantize=function(){return ao(0,1,[0,1])},ia.scale.threshold=function(){return lo([.5],[0,1])},ia.scale.identity=function(){return co([0,1])},ia.svg={},ia.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-Ua,f=a.apply(this,arguments)-Ua,h=Math.abs(f-s),g=s>f?0:1;if(n>c&&(p=c,c=n,n=p),h>=ja)return t(c,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+l.apply(this,arguments)||0)/2)&&(d=i===Nc?Math.sqrt(n*n+c*c):+i.apply(this,arguments),g||(A*=-1),c&&(A=tt(d/c*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),c){y=c*Math.cos(s+A),M=c*Math.sin(s+A),x=c*Math.cos(f-A),b=c*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=Da?0:1;if(A&&mo(y,M,x,b)===g^C){var z=(s+f)/2;y=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var L=Math.abs(s-f+2*E)<=Da?0:1;if(E&&mo(_,w,S,k)===1-g^L){var q=(s+f)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Ta&&(p=Math.min(Math.abs(c-n)/2,+u.apply(this,arguments)))>.001){v=c>n^g?0:1;var T=p,R=p;if(Da>h){var D=null==S?[_,w]:null==x?[y,M]:Tr([y,M],[S,k],[x,b],[_,w]),P=y-D[0],j=M-D[1],U=x-D[0],F=b-D[1]