UniTO/anno3/avrc/assignments/dataviz/static/js/wordcloud-d3.min.js

5 lines
146 KiB
JavaScript
Raw Normal View History

2019-12-05 16:44:41 +01:00
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function r(n){return{left:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;n(t[i],r)<0?e=i+1:u=i}return e},right:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;n(t[i],r)>0?u=i:e=i+1}return e}}}function e(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var r in t)Object.defineProperty(n.prototype,r,{value:t[r],enumerable:!1})}catch(e){n.prototype=t}}function o(){}function a(n){return _a+n in this}function c(n){return n=_a+n,n in this&&delete this[n]}function l(){var n=[];return this.forEach(function(t){n.push(t)}),n}function s(){var n=0;for(var t in this)t.charCodeAt(0)===ba&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===ba)return!1;return!0}function h(){}function g(n,t,r){return function(){var e=r.apply(t,arguments);return e===t?n:e}}function p(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var r=0,e=wa.length;e>r;++r){var u=wa[r]+t;if(u in n)return u}}function v(){}function d(){}function m(n){function t(){for(var t,e=r,u=-1,i=e.length;++u<i;)(t=e[u].on)&&t.apply(this,arguments);return n}var r=[],e=new o;return t.on=function(t,u){var i,o=e.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,i=r.indexOf(o)).concat(r.slice(i+1)),e.remove(t)),u&&r.push(e.set(t,{on:u})),n)},t}function y(){oa.event.preventDefault()}function x(){for(var n,t=oa.event;n=t.sourceEvent;)t=n;return t}function M(n){for(var t=new d,r=0,e=arguments.length;++r<e;)t[arguments[r]]=m(t);return t.of=function(r,e){return function(u){try{var i=u.sourceEvent=oa.event;u.target=n,oa.event=u,t[u.type].apply(r,e)}finally{oa.event=i}}},t}function _(n){return ka(n,La),n}function b(n){return"function"==typeof n?n:function(){return Ea(n,this)}}function w(n){return"function"==typeof n?n:function(){return Na(n,this)}}function S(n,t){function r(){this.removeAttribute(n)}function e(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var r=t.apply(this,arguments);null==r?this.removeAttribute(n):this.setAttribute(n,r)}function a(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,r)}return n=oa.ns.qualify(n),null==t?n.local?e:r:"function"==typeof t?n.local?a:o:n.local?i:u}function k(n){return n.trim().replace(/\s+/g," ")}function E(n){return new RegExp("(?:^|\\s+)"+oa.requote(n)+"(?:\\s+|$)","g")}function N(n){return n.trim().split(/^|\s+/)}function A(n,t){function r(){for(var r=-1;++r<u;)n[r](this,t)}function e(){for(var r=-1,e=t.apply(this,arguments);++r<u;)n[r](this,e)}n=N(n).map(C);var u=n.length;return"function"==typeof t?e:r}function C(n){var t=E(n);return function(r,e){if(u=r.classList)return e?u.add(n):u.remove(n);var u=r.getAttribute("class")||"";e?(t.lastIndex=0,t.test(u)||r.setAttribute("class",k(u+" "+n))):r.setAttribute("class",k(u.replace(t," ")))}}function L(n,t,r){function e(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,r)}function i(){var e=t.apply(this,arguments);null==e?this.style.removeProperty(n):this.style.setProperty(n,e,r)}return null==t?e:"function"==typeof t?i:u}function q(n,t){function r(){delete this[n]}function e(){this[n]=t}function u(){var r=t.apply(this,arguments);null==r?delete this[n]:this[n]=r}return null==t?r:"function"==typeof t?u:e}function T(n){return"function"==typeof n?n:(n=oa.ns.qualify(n)).local?function(){return this.ownerDocument.createElementNS(n.space,n.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,n)}}function z(n){return{__data__:n}}function R(n){return function(){return Ca(this,n)}}function D(t){return arguments.length||(t=n),function(n,r){return n&&r?t(n.__data__,r.__data__):!n-!r}}function P(n,t){for(var r=0,e=n.length;e>r;r++)for(var u,i=n[r],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,r);return n}function U(n){ret
}var t,r;Wc.point=function(e,u){Wc.point=n,ue(t=e,r=u)}}function oe(){Wc.point=ue}function ae(){function n(n,t){var r=n-e,i=t-u,o=Math.sqrt(r*r+i*i);Tc+=o*(e+n)/2,zc+=o*(u+t)/2,Rc+=o,o=u*n-e*t,Dc+=o*(e+n),Pc+=o*(u+t),Uc+=3*o,ue(e=n,u=t)}var t,r,e,u;Wc.point=function(i,o){Wc.point=n,ue(t=e=i,r=u=o)},Wc.lineEnd=function(){n(t,r)}}function ce(n){function t(t,r){n.moveTo(t,r),n.arc(t,r,o,0,ja)}function r(t,r){n.moveTo(t,r),a.point=e}function e(t,r){n.lineTo(t,r)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=r},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:v};return a}function le(n){function t(n){return(a?e:r)(n)}function r(t){return he(t,function(r,e){r=n(r,e),t.point(r[0],r[1])})}function e(t){function r(r,e){r=n(r,e),t.point(r[0],r[1])}function e(){x=0/0,S.point=i,t.lineStart()}function i(r,e){var i=pr([r,e]),o=n(r,e);u(x,M,y,_,b,w,x=o[0],M=o[1],y=r,_=i[0],b=i[1],w=i[2],a,t),t.point(x,M)}function o(){S.point=r,t.lineEnd()}function c(){e(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=x,p=M,v=_,d=b,m=w,S.point=i}function s(){u(x,M,y,_,b,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,x,M,_,b,w,S={point:r,lineStart:e,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=e}};return S}function u(t,r,e,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,x=f-r,M=y*y+x*x;if(M>4*i&&d--){var _=a+g,b=c+p,w=l+v,S=Math.sqrt(_*_+b*b+w*w),k=Math.asin(w/=S),E=Ma(Ma(w)-1)<Fa||Ma(e-h)<Fa?(e+h)/2:Math.atan2(b,_),N=n(E,k),A=N[0],C=N[1],L=A-t,q=C-r,T=x*L-y*q;(T*T/M>i||Ma((y*L+x*q)/M-.5)>.3||o>a*g+c*p+l*v)&&(u(t,r,e,a,c,l,A,C,E,_/=S,b/=S,w,d,m),m.point(A,C),u(A,C,E,_,b,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Ia),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function se(n){var t=le(function(t,r){return n([t*Ya,r*Ya])});return function(n){return ve(t(n))}}function fe(n){this.stream=n}function he(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 ge(n){return pe(function(){return n})()}function pe(n){function t(n){return n=a(n[0]*Ia,n[1]*Ia),[n[0]*h+c,l-n[1]*h]}function r(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Ya,n[1]*Ya]}function e(){a=Gr(o=ye(m,y,x),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=le(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,y=0,x=0,M=Hc,_=Nt,b=null,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=ve(M(o,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(M=null==n?(b=n,Hc):Ir((b=+n)*Ia),u()):b},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zr(n[0][0],n[0][1],n[1][0],n[1][1]):Nt,u()):S},t.scale=function(n){return arguments.length?(h=+n,e()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],e()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Ia,d=n[1]%360*Ia,e()):[v*Ya,d*Ya]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Ia,y=n[1]%360*Ia,x=n.length>2?n[2]%360*Ia:0,e()):[m*Ya,y*Ya,x*Ya]},oa.rebind(t,f,"precision"),t.clipPolygon=function(n){return arguments.length?(b=null,w=n,M=null==n?Hc:Br(n),e()):w},function(){return i=n.apply(this,arguments),t.invert=i.invert&&r,e()}}function ve(n){return he(n,function(t,r){n.point(t*Ia,r*Ia)})}function de(n,t){return[n,t]}function me(n,t){return[n>Ua?n-ja:-Ua>n?n+ja:n,t]}function ye(n,t,r){return n?t||r?Gr(Me(n),_e(t,r)):Me(n):t||r?_e(t,r):me}function xe(n){return function(t,r){return t+=n,[t>Ua?t-ja:-Ua>t?t+ja:t,r]}}function Me(n){var t=xe(n);return t.invert=xe(-n),t}function _e(n,t){function r(n,t){var r=Math.cos(t),a=Math.cos(n)*r,c=Math.sin(n)*r,l=Math.sin(t),s=l*e+a*u;return[Math.atan2(c*i-s*o,a*e-l*u),G(s*i+c*o)]}var e=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);r
for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function Fo(n){return n.length<3?_o(n):n[0]+Co(n,Ho(n))}function Oo(n){for(var t,r,e,u=-1,i=n.length;++u<i;)t=n[u],r=t[0],e=t[1]+Tl,t[0]=r*Math.cos(e),t[1]=r*Math.sin(e);return n}function Io(n){function t(t){function c(){v.push("M",a(n(m),f),s,l(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,x=t.length,M=Et(r),_=Et(u),b=r===e?function(){return g}:Et(e),w=u===i?function(){return p}:Et(i);++y<x;)o.call(this,h=t[y],y)?(d.push([g=+M.call(this,h,y),p=+_.call(this,h,y)]),m.push([+b.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var r=Pe,e=Pe,u=0,i=Ue,o=Cr,a=_o,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(r=e=n,t):e},t.x0=function(n){return arguments.length?(r=n,t):r},t.x1=function(n){return arguments.length?(e=n,t):e},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?(c="function"==typeof n?a=n:(a=Rl.get(n)||_o).key,l=a.reverse||a,s=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Yo(n){return n.radius}function Zo(n){return[n.x,n.y]}function Vo(n){return function(){var t=n.apply(this,arguments),r=t[0],e=t[1]+Tl;return[r*Math.cos(e),r*Math.sin(e)]}}function $o(){return 64}function Xo(){return"circle"}function Bo(n){var t=Math.sqrt(n/Ua);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Jo(n,t){return ka(n,Yl),n.id=t,n}function Wo(n,t,r,e){var u=n.id;return P(n,"function"==typeof r?function(n,i,o){n.__transition__[u].tween.set(t,e(r.call(n,n.__data__,i,o)))}:(r=e(r),function(n){n.__transition__[u].tween.set(t,r)}))}function Go(n){return null==n&&(n=""),function(){this.textContent=n}}function Ko(n,t,r,e){var u=n.__transition__||(n.__transition__={active:0,count:0}),i=u[r];if(!i){var a=e.time;i=u[r]={tween:new o,time:a,ease:e.ease,delay:e.delay,duration:e.duration},++u.count,oa.timer(function(e){function o(e){return u.active>r?l():(u.active=r,i.event&&i.event.start.call(n,s,t),i.tween.forEach(function(r,e){(e=e.call(n,s,t))&&v.push(e)}),oa.timer(function(){return p.c=c(e||1)?Cr:c,1},0,a),void 0)}function c(e){if(u.active!==r)return l();for(var o=e/g,a=f(o),c=v.length;c>0;)v[--c].call(n,a);return o>=1?(i.event&&i.event.end.call(n,s,t),l()):void 0}function l(){return--u.count?delete u[r]:delete n.__transition__,1}var s=n.__data__,f=i.ease,h=i.delay,g=i.duration,p=lc,v=[];return p.t=h+a,e>=h?o(e-h):(p.c=o,void 0)},0,a)}}function Qo(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function na(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function ta(n){return n.toISOString()}function ra(n,t,r){function e(t){return n(t)}function u(n,r){var e=n[1]-n[0],u=e/r,i=oa.bisect(Kl,u);return i==Kl.length?[t.year,ro(n.map(function(n){return n/31536e6}),r)[2]]:i?t[u/Kl[i-1]<Kl[i]/u?i-1:i]:[ts,ro(n,r)[2]]}return e.invert=function(t){return ea(n.invert(t))},e.domain=function(t){return arguments.length?(n.domain(t),e):n.domain().map(ea)},e.nice=function(n,t){function r(r){return!isNaN(r)&&!n.range(r,ea(+r+1),t).length}var i=e.domain(),o=Xi(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),e.domain(Wi(i,t>1?{floor:function(t){for(;r(t=n.floor(t));)t=ea(t-1);return t},ceil:function(t){for(;r(t=n.ceil(t));)t=ea(+t+1);return t}}:n))},e.ticks=function(n,t){var r=Xi(e.domain()),i=null==n?u(r,10):"number"==typeof n?u(r,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(r[0],ea(+r[1]+1),1>t?1:t)},e.tickFormat=function(){return r},e.copy=function(){return ra(n.copy(),t,r)},no(e,n)}function ea(n){return new Date(n)}function ua(n){return JSON.parse(n.responseText)}function ia(n){var t=la.createRange();return t.selectNode(la.body),t.createContextualFragment(n.responseText)}var oa={version:"3.4.4"}
oa.format=Mc.numberFormat,oa.geo={},cr.prototype={s:0,t:0,add:function(n){lr(n,this.t,_c),lr(_c.s,this.s,this),this.s?this.t+=_c.t:this.s=_c.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var _c=new cr;oa.geo.stream=function(n,t){n&&bc.hasOwnProperty(n.type)?bc[n.type](n,t):sr(n,t)};var bc={Feature:function(n,t){sr(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,e=-1,u=r.length;++e<u;)sr(r[e].geometry,t)}},wc={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,e=-1,u=r.length;++e<u;)n=r[e],t.point(n[0],n[1],n[2])},LineString:function(n,t){fr(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,e=-1,u=r.length;++e<u;)fr(r[e],t,0)},Polygon:function(n,t){hr(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,e=-1,u=r.length;++e<u;)hr(r[e],t)},GeometryCollection:function(n,t){for(var r=n.geometries,e=-1,u=r.length;++e<u;)sr(r[e],t)}};oa.geo.area=function(n){return Sc=0,oa.geo.stream(n,Ec),Sc};var Sc,kc=new cr,Ec={sphere:function(){Sc+=4*Ua},point:v,lineStart:v,lineEnd:v,polygonStart:function(){kc.reset(),Ec.lineStart=gr},polygonEnd:function(){var n=2*kc;Sc+=0>n?4*Ua+n:n,Ec.lineStart=Ec.lineEnd=Ec.point=v}};oa.geo.bounds=function(){function n(n,t){x.push(M=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,r){var e=pr([t*Ia,r*Ia]);if(m){var u=dr(m,e),i=[u[1],-u[0],0],o=dr(i,u);xr(o),o=_r(o);var c=t-p,l=c>0?1:-1,v=o[0]*Ya*l,d=Ma(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Ya;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Ya;f>y&&(f=y)}else f>r&&(f=r),r>g&&(g=r);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,r);m=e,p=t}function r(){_.point=t}function e(){M[0]=s,M[1]=h,_.point=n,m=null}function u(n,r){if(m){var e=n-p;y+=Ma(e)>180?e+(e>0?360:-360):e}else v=n,d=r;Ec.point(n,r),t(n,r)}function i(){Ec.lineStart()}function o(){u(v,d),Ec.lineEnd(),Ma(y)>Fa&&(s=-(h=180)),M[0]=s,M[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(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,x,M,_={point:n,lineStart:r,lineEnd:e,polygonStart:function(){_.point=u,_.lineStart=i,_.lineEnd=o,y=0,Ec.polygonStart()},polygonEnd:function(){Ec.polygonEnd(),_.point=n,_.lineStart=r,_.lineEnd=e,0>kc?(s=-(h=180),f=-(g=90)):y>Fa?g=90:-Fa>y&&(f=-90),M[0]=s,M[1]=h}};return function(n){g=h=-(s=f=1/0),x=[],oa.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var r,e=1,u=x[0],i=[u];t>e;++e)r=x[e],l(r[0],u)||l(r[1],u)?(a(u[0],r[1])>a(u[0],u[1])&&(u[1]=r[1]),a(r[0],u[1])>a(u[0],u[1])&&(u[0]=r[0])):i.push(u=r);for(var o,r,p=-1/0,t=i.length-1,e=0,u=i[t];t>=e;u=r,++e)r=i[e],(o=a(u[1],r[0]))>p&&(p=o,s=r[0],h=u[1])}return x=M=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),oa.geo.centroid=function(n){Nc=Ac=Cc=Lc=qc=Tc=zc=Rc=Dc=Pc=Uc=0,oa.geo.stream(n,jc);var t=Dc,r=Pc,e=Uc,u=t*t+r*r+e*e;return Oa>u&&(t=Tc,r=zc,e=Rc,Fa>Ac&&(t=Cc,r=Lc,e=qc),u=t*t+r*r+e*e,Oa>u)?[0/0,0/0]:[Math.atan2(r,t)*Ya,G(e/Math.sqrt(u))*Ya]};var Nc,Ac,Cc,Lc,qc,Tc,zc,Rc,Dc,Pc,Uc,jc={sphere:v,point:Sr,lineStart:Er,lineEnd:Nr,polygonStart:function(){jc.lineStart=Ar},polygonEnd:function(){jc.lineStart=Er}};oa.geo.pointInPolygon=Ur;var Hc=zr(Or,jr,Fr,[-Ua,-Ua/2],Pr),Fc=1e9;oa.geo.clipExtent=function(){var n,t,r,e,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=Zr(n=+a[0][0],t=+a[0][1],r=+a[1][0],e=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[r,e]]}};return o.extent([[0,0],[960,500]])},oa.geo.distance=function(n,t){var r,e=(t[0]-n[0])*Ia,u=n[1]*Ia,i=t[1]*Ia,o=Math.sin(e),a=Math.cos(e),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=l*s-c*f*a)*r),c*s+l*f*a)};var Oc={};(oa.geo.conicEqualArea=function(){return Kr(Qr)}).raw=Qr,oa.geo.albers=function(){return oa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},o
},i.padding=function(n){function t(t){var r=n.call(i,t,t.depth);return null==r?Vi(t):$i(t,"number"==typeof r?[r,r,r,r]:r)}function r(t){return $i(t,n)}if(!arguments.length)return s;var e;return f=null==(s=n)?Vi:"function"==(e=typeof n)?t:"number"===e?(n=[n,n,n,n],r):r,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=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},ii(i,a)},oa.random={normal:function(n,t){var r=arguments.length;return 2>r&&(t=1),1>r&&(n=0),function(){var r,e,u;do r=2*Math.random()-1,e=2*Math.random()-1,u=r*r+e*e;while(!u||u>1);return n+t*r*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=oa.random.normal.apply(oa,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=oa.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,r=0;n>r;r++)t+=Math.random();return t}}},oa.scale={};var Sl={floor:Nt,ceil:Nt};oa.scale.linear=function(){return Qi([0,1],[0,1],ku,!1)};var kl={s:1,g:1,p:1,r:1,e:1};oa.scale.log=function(){return ao(oa.scale.linear().domain([0,1]),10,!0,[1,10])};var El=oa.format(".0e"),Nl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};oa.scale.pow=function(){return co(oa.scale.linear(),1,[0,1])},oa.scale.sqrt=function(){return oa.scale.pow().exponent(.5)},oa.scale.ordinal=function(){return so([],{t:"range",a:[[]]})},oa.scale.category10=function(){return oa.scale.ordinal().range(Al)},oa.scale.category20=function(){return oa.scale.ordinal().range(Cl)},oa.scale.category20b=function(){return oa.scale.ordinal().range(Ll)},oa.scale.category20c=function(){return oa.scale.ordinal().range(ql)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(mt),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(mt),Ll=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(mt),ql=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(mt);oa.scale.quantile=function(){return fo([],[])},oa.scale.quantize=function(){return ho(0,1,[0,1])},oa.scale.threshold=function(){return go([.5],[0,1])},oa.scale.identity=function(){return po([0,1])},oa.svg={},oa.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=r.apply(this,arguments),o=e.apply(this,arguments)+Tl,a=u.apply(this,arguments)+Tl,c=(o>a&&(c=o,o=a,a=c),a-o),l=Ua>c?"0":"1",s=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);return c>=zl?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+l+",0 "+n*s+","+n*f+"Z":"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=vo,r=mo,e=yo,u=xo;return n.innerRadius=function(r){return arguments.length?(t=Et(r),n):t},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.startAngle=function(t){return arguments.length?(e=Et(t),n):e},n.endAngle=function(t){return arguments.length?(u=Et(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+r.apply(this,arguments))/2,i=(e.apply(this,arguments)+u.apply(this,arguments))/2+Tl;return[Math.cos(i)*n,Math.sin(i)*n]},n};var Tl=-Ha,zl=ja-Fa;oa.svg.line=function(){return Mo(Nt)};var Rl=oa.map({linear:_o,"linear-closed":bo,step:wo,"step-before":So,"step-after":ko,basis:qo,"basis-open":To,"basis-closed":zo,bundle:Ro,cardinal:Ao,"cardinal-open":Eo,"cardinal-closed":No,monotone:Fo});Rl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var