All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.libs.d3.d3.v3.min.js Maven / Gradle / Ivy

The newest version!
!function(){var n={version:"3.5.5"},t=[].slice,e=function(n){return t.call(n)},r=this.document;function i(n){return n&&(n.ownerDocument||n.document||n).documentElement}function u(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}if(r)try{e(r.documentElement.childNodes)[0].nodeType}catch(n){e=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),r)try{r.createElement("DIV").style.setProperty("opacity",0,"")}catch(n){var o=this.Element.prototype,a=o.setAttribute,l=o.setAttributeNS,c=this.CSSStyleDeclaration.prototype,f=c.setProperty;o.setAttribute=function(n,t){a.call(this,n,t+"")},o.setAttributeNS=function(n,t,e){l.call(this,n,t,e+"")},c.setProperty=function(n,t,e){f.call(this,n,t+"",e)}}function s(n,t){return nt?1:n>=t?0:NaN}function h(n){return null===n?NaN:+n}function p(n){return!isNaN(n)}function g(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}n.ascending=s,n.descending=function(n,t){return tn?1:t>=n?0:NaN},n.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},n.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},n.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=r){e=i=r;break}for(;++ur&&(e=r),i=r){e=i=r;break}for(;++ur&&(e=r),i1)return o/(l-1)},n.deviation=function(){var t=n.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(s);function d(n){return n.length}n.bisectLeft=v.left,n.bisect=n.bisectRight=v.right,n.bisector=function(n){return g(1===n.length?function(t,e){return s(n(t),e)}:n)},n.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,u<2&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},n.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},n.pairs=function(n){for(var t=0,e=n.length-1,r=n[0],i=new Array(e<0?0:e);t=0;)for(t=(r=n[i]).length;--t>=0;)e[--o]=r[t];return e};var y=Math.abs;function m(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function M(){this._=Object.create(null)}n.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e==1/0)throw new Error("infinite range");var r,i=[],u=function(n){var t=1;for(;n*t%1;)t*=10;return t}(y(e)),o=-1;if(n*=u,t*=u,(e*=u)<0)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)=i.length)return e?e.call(r,u):t?u.sort(t):u;for(var l,c,f,s,h=-1,p=u.length,g=i[a++],v=new M;++h=i.length)return t;var r=[],o=u[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),o?r.sort(function(n,t){return o(n.key,t.key)}):r}(o(n.map,t,0),0)},r.key=function(n){return i.push(n),r},r.sortKeys=function(n){return u[i.length-1]=n,r},r.sortValues=function(n){return t=n,r},r.rollup=function(n){return e=n,r},r},n.set=function(n){var t=new C;if(n)for(var e=0,r=n.length;e=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},n.event=null,n.requote=function(n){return n.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,O={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]};function I(n){return O(n,X),n}var Y=function(n,t){return t.querySelector(n)},Z=function(n,t){return t.querySelectorAll(n)},V=function(n,t){var e=n.matches||n[L(n,"matchesSelector")];return(V=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Y=function(n,t){return Sizzle(n,t)[0]||null},Z=Sizzle,V=Sizzle.matchesSelector),n.selection=function(){return n.select(r.documentElement)};var X=n.selection.prototype=[];function $(n){return"function"==typeof n?n:function(){return Y(n,this)}}function B(n){return"function"==typeof n?n:function(){return Z(n,this)}}X.select=function(n){var t,e,r,i,u=[];n=$(n);for(var o=-1,a=this.length;++o=0&&(e=n.slice(0,t),n=n.slice(t+1)),W.hasOwnProperty(e)?{space:W[e],local:n}:n}},X.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=n.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(J(e,t[e]));return this}return this.each(J(t,e))},X.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=Q(n)).length,i=-1;if(t=e.classList){for(;++i=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},X.sort=function(n){n=function(n){arguments.length||(n=s);return function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}.apply(this,arguments);for(var t=-1,e=this.length;++t0&&(t=t.slice(0,o));var l=pn.get(t);function c(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}return l&&(t=l,a=vn),o?r?function(){var n=a(r,e(arguments));c.call(this),this.addEventListener(t,this[u]=n,n.$=i),n._=r}:c:r?R:function(){var e,r=new RegExp("^__on([^.]+)"+n.requote(t)+"$");for(var i in this)if(e=i.match(r)){var u=this[i];this.removeEventListener(e[1],u,u.$),delete this[i]}}}n.selection.enter=fn,n.selection.enter.prototype=sn,sn.append=X.append,sn.empty=X.empty,sn.node=X.node,sn.call=X.call,sn.size=X.size,sn.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a=r&&(r=t+1);!(o=a[r])&&++r0?1:n<0?-1:0}function qn(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function Ln(n){return n>1?0:n<-1?Sn:Math.acos(n)}function Tn(n){return n>1?En:n<-1?-En:Math.asin(n)}function Rn(n){return((n=Math.exp(n))+1/n)/2}function Dn(n){return(n=Math.sin(n/2))*n}var Pn=Math.SQRT2,Un=2;n.interpolateZoom=function(n,t){var e=n[0],r=n[1],i=n[2],u=t[0],o=t[1],a=t[2],l=u-e,c=o-r,f=l*l+c*c,s=Math.sqrt(f),h=(a*a-i*i+4*f)/(2*i*Un*s),p=(a*a-i*i-4*f)/(2*a*Un*s),g=Math.log(Math.sqrt(h*h+1)-h),v=Math.log(Math.sqrt(p*p+1)-p)-g,d=(v||Math.log(a/i))/Pn;function y(n){var t,u,o=n*d;if(v){var a=Rn(g),f=i/(Un*s)*(a*(u=Pn*o+g,((u=Math.exp(2*u))-1)/(u+1))-(t=g,((t=Math.exp(t))-1/t)/2));return[e+f*l,r+f*c,i*a/Rn(Pn*o+g)]}return[e+n*l,r+n*c,i*Math.exp(Pn*o)]}return y.duration=1e3*d,y},n.behavior.zoom=function(){var t,e,i,o,a,l,c,f,s,h={x:0,y:0,k:1},p=[960,500],g=Hn,v=250,d=0,y="mousedown.zoom",m="mousemove.zoom",M="mouseup.zoom",x="touchstart.zoom",b=F(_,"zoomstart","zoom","zoomend");function _(n){n.on(y,q).on(Fn+".zoom",T).on("dblclick.zoom",R).on(x,L)}function w(n){return[(n[0]-h.x)/h.k,(n[1]-h.y)/h.k]}function S(n){h.k=Math.max(g[0],Math.min(g[1],n))}function k(n,t){var e;t=[(e=t)[0]*h.k+h.x,e[1]*h.k+h.y],h.x+=n[0]-t[0],h.y+=n[1]-t[1]}function N(t,r,i,u){t.__chart__={x:h.x,y:h.y,k:h.k},S(Math.pow(2,u)),k(e=r,i),t=n.select(t),v>0&&(t=t.transition().duration(v)),t.call(_.event)}function E(){c&&c.domain(l.range().map(function(n){return(n-h.x)/h.k}).map(l.invert)),s&&s.domain(f.range().map(function(n){return(n-h.y)/h.k}).map(f.invert))}function A(n){d++||n({type:"zoomstart"})}function C(n){E(),n({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function z(n){--d||n({type:"zoomend"}),e=null}function q(){var t=this,e=n.event.target,r=b.of(t,arguments),i=0,o=n.select(u(t)).on(m,function(){i=1,k(n.mouse(t),a),C(r)}).on(M,function(){o.on(m,null).on(M,null),l(i&&n.event.target===e),z(r)}),a=w(n.mouse(t)),l=mn(t);ea.call(t),A(r)}function L(){var t,e=this,r=b.of(e,arguments),i={},u=0,o=".zoom-"+n.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,f=[],s=n.select(e),p=mn(e);function g(){var r=n.touches(e);return t=h.k,r.forEach(function(n){n.identifier in i&&(i[n.identifier]=w(n))}),r}function v(){var t=n.event.target;n.select(t).on(l,d).on(c,m),f.push(t);for(var r=n.event.changedTouches,o=0,s=r.length;o1){y=p[0];var M=p[1],x=y[0]-M[0],b=y[1]-M[1];u=x*x+b*b}}function d(){var o,l,c,f,s=n.touches(e);ea.call(e);for(var h=0,p=s.length;h360?t-=360:t<0&&(t+=360),t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r));var t}return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:t<0?0:t>1?1:t,r=2*(e=e<0?0:e>1?1:e)-(i=e<=.5?e*(1+t):e+t-e*t),new ut(u(n+120),u(n),u(n-120))}function Vn(t,e,r){return this instanceof Vn?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Vn?new Vn(t.h,t.c,t.l):tt(t instanceof Bn?t.l:(t=ht((t=n.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Vn(t,e,r)}Yn.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,this.l/n)},Yn.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,n*this.l)},Yn.rgb=function(){return Zn(this.h,this.s,this.l)},n.hcl=Vn;var Xn=Vn.prototype=new On;function $n(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new Bn(e,Math.cos(n*=An)*t,Math.sin(n)*t)}function Bn(n,t,e){return this instanceof Bn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof Bn?new Bn(n.l,n.a,n.b):n instanceof Vn?$n(n.h,n.c,n.l):ht((n=ut(n)).r,n.g,n.b):new Bn(n,t,e)}Xn.brighter=function(n){return new Vn(this.h,this.c,Math.min(100,this.l+Wn*(arguments.length?n:1)))},Xn.darker=function(n){return new Vn(this.h,this.c,Math.max(0,this.l-Wn*(arguments.length?n:1)))},Xn.rgb=function(){return $n(this.h,this.c,this.l).rgb()},n.lab=Bn;var Wn=18,Jn=.95047,Gn=1,Kn=1.08883,Qn=Bn.prototype=new On;function nt(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return new ut(it(3.2404542*(i=et(i)*Jn)-1.5371385*(r=et(r)*Gn)-.4985314*(u=et(u)*Kn)),it(-.969266*i+1.8760108*r+.041556*u),it(.0556434*i-.2040259*r+1.0572252*u))}function tt(n,t,e){return n>0?new Vn(Math.atan2(e,t)*Cn,Math.sqrt(t*t+e*e),n):new Vn(NaN,NaN,n)}function et(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function rt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function it(n){return Math.round(255*(n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n,t,e){return this instanceof ut?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof ut?new ut(n.r,n.g,n.b):ft(""+n,ut,Zn):new ut(n,t,e)}function ot(n){return new ut(n>>16,n>>8&255,255&n)}function at(n){return ot(n)+""}Qn.brighter=function(n){return new Bn(Math.min(100,this.l+Wn*(arguments.length?n:1)),this.a,this.b)},Qn.darker=function(n){return new Bn(Math.max(0,this.l-Wn*(arguments.length?n:1)),this.a,this.b)},Qn.rgb=function(){return nt(this.l,this.a,this.b)},n.rgb=ut;var lt=ut.prototype=new On;function ct(n){return n<16?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function ft(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(gt(i[0]),gt(i[1]),gt(i[2]))}return(u=vt.get(n.toLowerCase()))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o|=o>>4,a=240&u,a|=a>>4,l=15&u,l|=l<<4):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function st(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=l<.5?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(t0&&l<1?0:r),new In(r,i,l)}function ht(n,t,e){var r=rt((.4124564*(n=pt(n))+.3575761*(t=pt(t))+.1804375*(e=pt(e)))/Jn),i=rt((.2126729*n+.7151522*t+.072175*e)/Gn);return Bn(116*i-16,500*(r-i),200*(i-rt((.0193339*n+.119192*t+.9503041*e)/Kn)))}function pt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}lt.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b;return t||e||r?(t&&t<30&&(t=30),e&&e<30&&(e=30),r&&r<30&&(r=30),new ut(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new ut(30,30,30)},lt.darker=function(n){return new ut((n=Math.pow(.7,arguments.length?n:1))*this.r,n*this.g,n*this.b)},lt.hsl=function(){return st(this.r,this.g,this.b)},lt.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var vt=n.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function dt(n){return"function"==typeof n?n:function(){return n}}function yt(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),mt(t,e,n,r)}}function mt(t,r,i,u){var o,a={},l=n.dispatch("beforesend","progress","load","error"),c={},f=new XMLHttpRequest,s=null;function h(){var n,t,e,r=f.status;if(!r&&((e=(t=f).responseType)&&"text"!==e?t.response:t.responseText)||r>=200&&r<300||304===r){try{n=i.call(a,f)}catch(n){return void l.error.call(a,n)}l.load.call(a,n)}else l.error.call(a,f)}return!this.XDomainRequest||"withCredentials"in f||!/^(http(s)?:)?\/\//.test(t)||(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=h:f.onreadystatechange=function(){f.readyState>3&&h()},f.onprogress=function(t){var e=n.event;n.event=t;try{l.progress.call(a,f)}finally{n.event=e}},a.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?c[n]:(null==t?delete c[n]:c[n]=t+"",a)},a.mimeType=function(n){return arguments.length?(r=null==n?null:n+"",a):r},a.responseType=function(n){return arguments.length?(s=n,a):s},a.response=function(n){return i=n,a},["get","post"].forEach(function(n){a[n]=function(){return a.send.apply(a,[n].concat(e(arguments)))}}),a.send=function(n,e,i){if(2===arguments.length&&"function"==typeof e&&(i=e,e=null),f.open(n,t,!0),null==r||"accept"in c||(c.accept=r+",*/*"),f.setRequestHeader)for(var u in c)f.setRequestHeader(u,c[u]);return null!=r&&f.overrideMimeType&&f.overrideMimeType(r),null!=s&&(f.responseType=s),null!=i&&a.on("error",i).on("load",function(n){i(null,n)}),l.beforesend.call(a,f),f.send(null==e?null:e),a},a.abort=function(){return f.abort(),a},n.rebind(a,l,"on"),null==u?a:a.get(1===(o=u).length?function(n,t){o(null==n?t:null)}:o)}vt.forEach(function(n,t){vt.set(n,ot(t))}),n.functor=dt,n.xhr=yt(z),n.dsv=function(n,t){var e=new RegExp('["'+n+"\n]"),r=n.charCodeAt(0);function i(n,e,r){arguments.length<3&&(r=e,e=null);var i=mt(n,t,null==e?u:o(e),r);return i.row=function(n){return arguments.length?i.response(null==(e=n)?u:o(n)):e},i}function u(n){return i.parse(n.responseText)}function o(n){return function(t){return i.parse(t.responseText,n)}}function a(t){return t.map(l).join(n)}function l(n){return e.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}return i.parse=function(n,t){var e;return i.parseRows(n,function(n,r){if(e)return e(n,r-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");e=t?function(n,e){return t(i(n),e)}:i})},i.parseRows=function(n,t){var e,i,u={},o={},a=[],l=n.length,c=0,f=0;function s(){if(c>=l)return o;if(i)return i=!1,u;var t=c;if(34===n.charCodeAt(t)){for(var e=t;e++24?(isFinite(t)&&(clearTimeout(_t),_t=setTimeout(kt,t)),bt=0):(bt=1,St(kt))}function Nt(){var n=Date.now();for(wt=Mt;wt;)n>=wt.t&&(wt.f=wt.c(n-wt.t)),wt=wt.n;return n}function Et(){for(var n,t=Mt,e=1/0;t;)t.f?t=n?n.n=t.n:Mt=t.n:(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}});n.formatPrefix=function(t,e){var r=0;return t&&(t<0&&(t*=-1),e&&(t=n.round(t,At(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Ct[8+r/3]};var zt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,qt=n.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(t,e){return(t=n.round(t,At(t,e))).toFixed(Math.max(0,Math.min(20,At(t*(1+1e-15),e))))}});function Lt(n){return n+""}var Tt=n.time={},Rt=Date;function Dt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Dt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Pt.setUTCDate.apply(this._,arguments)},setDay:function(){Pt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Pt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Pt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Pt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Pt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Pt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Pt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Pt.setTime.apply(this._,arguments)}};var Pt=Date.prototype;function Ut(n,t,e){function r(t){var e=n(t),r=u(e,1);return t-e1)for(;o68?1900:2e3),e+i[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Kt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Qt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function ne(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function te(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ee(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function re(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=y(t)/60|0,i=y(t)%60;return e+It(r,"0",2)+It(i,"0",2)}function ue(n,t,e){Ot.lastIndex=0;var r=Ot.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function oe(n){for(var t=n.length,e=-1;++e0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),r.push(n.substring(e-=a,e+a)),!((l+=a+1)>t));)a=u[o=(o+1)%u.length];return r.reverse().join(i)}:z,function(t){var e=zt.exec(t),i=e[1]||" ",u=e[2]||">",l=e[3]||"-",c=e[4]||"",f=e[5],s=+e[6],h=e[7],p=e[8],g=e[9],v=1,d="",y="",m=!1,M=!0;switch(p&&(p=+p.substring(1)),(f||"0"===i&&"="===u)&&(f=i="0",u="="),g){case"n":h=!0,g="g";break;case"%":v=100,y="%",g="f";break;case"p":v=100,y="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(d="0"+g.toLowerCase());case"c":M=!1;case"d":m=!0,p=0;break;case"s":v=-1,g="r"}"$"===c&&(d=o[0],y=o[1]),"r"!=g||p||(g="g"),null!=p&&("g"==g?p=Math.max(1,Math.min(21,p)):"e"!=g&&"f"!=g||(p=Math.max(0,Math.min(20,p)))),g=qt.get(g)||Lt;var x=f&&h;return function(t){var e=y;if(m&&t%1)return"";var o=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(v<0){var c=n.formatPrefix(t,p);t=c.scale(t),e=c.symbol+y}else t*=v;var b,_,w=(t=g(t,p)).lastIndexOf(".");if(w<0){var S=M?t.lastIndexOf("e"):-1;S<0?(b=t,_=""):(b=t.substring(0,S),_=t.substring(S))}else b=t.substring(0,w),_=r+t.substring(w+1);!f&&h&&(b=a(b,1/0));var k=d.length+b.length+_.length+(x?0:o.length),N=k"===u?N+o+t:"^"===u?N.substring(0,k>>=1)+o+t+N.substring(k):o+(x?t:N+t))+e}}),timeFormat:function(t){var e=t.dateTime,r=t.date,i=t.time,u=t.periods,o=t.days,a=t.shortDays,l=t.months,c=t.shortMonths;function f(n){var t=n.length;function e(e){for(var r,i,u,o=[],a=-1,l=0;++a=c)return-1;if(37===(i=t.charCodeAt(a++))){if(o=t.charAt(a++),!(u=_[o in Ft?t.charAt(a++):o])||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}f.utc=function(n){var t=f(n);function e(n){try{var e=new(Rt=Dt);return e._=n,t(e)}finally{Rt=Date}}return e.parse=function(n){try{Rt=Dt;var e=t.parse(n);return e&&e._}finally{Rt=Date}},e.toString=t.toString,e},f.multi=f.utc.multi=oe;var h=n.map(),p=Yt(o),g=Zt(o),v=Yt(a),d=Zt(a),y=Yt(l),m=Zt(l),M=Yt(c),x=Zt(c);u.forEach(function(n,t){h.set(n.toLowerCase(),t)});var b={a:function(n){return a[n.getDay()]},A:function(n){return o[n.getDay()]},b:function(n){return c[n.getMonth()]},B:function(n){return l[n.getMonth()]},c:f(e),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+Tt.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return u[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(Tt.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(Tt.mondayOfYear(n),t,2)},x:f(r),X:f(i),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},_={a:function(n,t,e){v.lastIndex=0;var r=v.exec(t.slice(e));return r?(n.w=d.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(n,t,e){p.lastIndex=0;var r=p.exec(t.slice(e));return r?(n.w=g.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(n,t,e){M.lastIndex=0;var r=M.exec(t.slice(e));return r?(n.m=x.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(n,t,e){y.lastIndex=0;var r=y.exec(t.slice(e));return r?(n.m=m.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(n,t,e){return s(n,b.c.toString(),t,e)},d:Kt,e:Kt,H:ne,I:ne,j:Qt,L:re,m:Gt,M:te,p:function(n,t,e){var r=h.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)},S:ee,U:Xt,w:Vt,W:$t,x:function(n,t,e){return s(n,b.x.toString(),t,e)},X:function(n,t,e){return s(n,b.X.toString(),t,e)},y:Wt,Y:Bt,Z:Jt,"%":ue};return f}(t)};var e,r,i,u,o,a};var ae=n.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function le(){}n.format=ae.numberFormat,n.geo={},le.prototype={s:0,t:0,add:function(n){fe(n,this.t,ce),fe(ce.s,this.s,this),this.s?this.t+=ce.t:this.s=ce.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ce=new le;function fe(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function se(n,t){n&&pe.hasOwnProperty(n.type)&&pe[n.type](n,t)}n.geo.stream=function(n,t){n&&he.hasOwnProperty(n.type)?he[n.type](n,t):se(n,t)};var he={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r=0?1:-1,a=o*u,l=Math.cos(t),c=Math.sin(t),f=i*c,s=r*l+f*Math.cos(a),h=f*o*Math.sin(a);Ae.add(Math.atan2(h,s)),e=n,r=l,i=c}Ce.point=function(o,a){Ce.point=u,e=(n=o)*An,r=Math.cos(a=(t=a)*An/2+Sn/4),i=Math.sin(a)},Ce.lineEnd=function(){u(n,t)}}function qe(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function Le(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function Te(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 Re(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function De(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Pe(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function Ue(n){return[Math.atan2(n[1],n[0]),Tn(n[2])]}function je(n,t){return y(n[0]-t[0])<_n&&y(n[1]-t[1])<_n}n.geo.bounds=function(){var t,e,r,i,u,o,a,l,c,f,s,h={point:p,lineStart:v,lineEnd:d,polygonStart:function(){h.point=m,h.lineStart=M,h.lineEnd=x,c=0,Ce.polygonStart()},polygonEnd:function(){Ce.polygonEnd(),h.point=p,h.lineStart=v,h.lineEnd=d,Ae<0?(t=-(r=180),e=-(i=90)):c>_n?i=90:c<-_n&&(e=-90),s[0]=t,s[1]=r}};function p(n,u){f.push(s=[t=n,r=n]),ui&&(i=u)}function g(n,o){var a=qe([n*An,o*An]);if(l){var c=Te(l,a),f=Te([c[1],-c[0],0],c);Pe(f),f=Ue(f);var s=n-u,h=s>0?1:-1,g=f[0]*Cn*h,v=y(s)>180;if(v^(h*ui&&(i=d);else if(g=(g+360)%360-180,v^(h*ui&&(i=o);v?nb(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n):r>=t?(nr&&(r=n)):n>u?b(t,n)>b(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n)}else p(n,o);l=a,u=n}function v(){h.point=g}function d(){s[0]=t,s[1]=r,h.point=p,l=null}function m(n,t){if(l){var e=n-u;c+=y(e)>180?e+(e>0?360:-360):e}else o=n,a=t;Ce.point(n,t),g(n,t)}function M(){Ce.lineStart()}function x(){m(o,a),Ce.lineEnd(),y(c)>_n&&(t=-(r=180)),s[0]=t,s[1]=r,l=null}function b(n,t){return(t-=n)<0?t+360:t}function _(n,t){return n[0]-t[0]}function w(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nb(v[0],v[1])&&(v[1]=p[1]),b(p[0],v[1])>b(v[0],v[1])&&(v[0]=p[0])):a.push(v=p);for(var l,c,p,g=-1/0,v=(o=0,a[c=a.length-1]);o<=c;v=p,++o)p=a[o],(l=b(v[1],p[0]))>g&&(g=l,t=p[0],r=v[1])}return f=s=null,t===1/0||e===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,e],[r,i]]}}(),n.geo.centroid=function(t){ye=me=Me=xe=be=_e=we=Se=ke=Ne=Ee=0,n.geo.stream(t,Fe);var e=ke,r=Ne,i=Ee,u=e*e+r*r+i*i;return u=0;--a)i.point((s=f[a])[0],s[1]);else r(p.x,p.p.x,-1,i);p=p.p}f=(p=p.o).z,g=!g}while(!p.v);i.lineEnd()}}}function Be(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r=0?1:-1,w=_*b,S=w>Sn,k=g*M;if(Ae.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*kn:b,S^h>=e^y>=e){var N=Te(qe(s),qe(n));Pe(N);var E=Te(i,N);Pe(E);var A=(S^b>=0?-1:1)*Tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(u<-_n||u<_n&&Ae<0)^1&o}(c,v);a.length?(M||(o.polygonStart(),M=!0),$e(a,Qe,t,r,o)):t&&(M||(o.polygonStart(),M=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),M&&(o.polygonEnd(),M=!1),a=v=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function s(n,e){var r=u(n,e);t(n=r[0],e=r[1])&&o.point(n,e)}function h(n,t){var e=u(n,t);l.point(e[0],e[1])}function p(){f.point=h,l.lineStart()}function g(){f.point=s,l.lineEnd()}var v,d,y=Ke(),m=e(y),M=!1;function x(n,t){d.push([n,t]);var e=u(n,t);m.point(e[0],e[1])}function b(){m.lineStart(),d=[]}function _(){x(d[0][0],d[0][1]),m.lineEnd();var n,t=m.clean(),e=y.buffer(),r=e.length;if(d.pop(),v.push(d),d=null,r)if(1&t){var i,u=-1;if((r=(n=e[0]).length-1)>0){for(M||(o.polygonStart(),M=!0),o.lineStart();++u1&&2&t&&e.push(e.pop().concat(e.shift())),a.push(e.filter(Ge))}return f}}function Ge(n){return n.length>1}function Ke(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:R,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Qe(n,t){return((n=n.x)[0]<0?n[1]-En-_n:En-n[1])-((t=t.x)[0]<0?t[1]-En-_n:En-t[1])}var nr=Je(Xe,function(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a,l,c,f,s,h,p,g=u>0?Sn:-Sn,v=y(u-e);y(v-Sn)<_n?(n.point(e,r=(r+o)/2>0?En:-En),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(g,r),n.point(u,r),t=0):i!==g&&v>=Sn&&(y(e-i)<_n&&(e-=i*_n),y(u-g)<_n&&(u-=g*_n),a=e,l=r,c=u,f=o,p=Math.sin(a-c),r=y(p)>_n?Math.atan((Math.sin(l)*(h=Math.cos(f))*Math.sin(c)-Math.sin(f)*(s=Math.cos(l))*Math.sin(a))/(s*h*p)):(l+f)/2,n.point(i,r),n.lineEnd(),n.lineStart(),n.point(g,r),t=0),n.point(e=u,r=o),i=g},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}},function(n,t,e,r){var i;if(null==n)i=e*En,r.point(-Sn,i),r.point(0,i),r.point(Sn,i),r.point(Sn,0),r.point(Sn,-i),r.point(0,-i),r.point(-Sn,-i),r.point(-Sn,0),r.point(-Sn,i);else if(y(n[0]-t[0])>_n){var u=n[0]0)){if(u/=h,h<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=e-l,h||!(u<0)){if(u/=h,h<0){if(u>s)return;u>f&&(f=u)}else if(h>0){if(u0)){if(u/=p,p<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=r-c,p||!(u<0)){if(u/=p,p<0){if(u>s)return;u>f&&(f=u)}else if(p>0){if(u0&&(i.a={x:l+f*h,y:c+f*p}),s<1&&(i.b={x:l+s*h,y:c+s*p}),i}}}}}}var er=1e9;function rr(t,e,r,i){return function(l){var c,f,s,h,p,g,v,d,y,m,M,x=l,b=Ke(),_=tr(t,e,r,i),w={point:N,lineStart:function(){w.point=E,f&&f.push(s=[]);m=!0,y=!1,v=d=NaN},lineEnd:function(){c&&(E(h,p),g&&y&&b.rejoin(),c.push(b.buffer()));w.point=N,y&&l.lineEnd()},polygonStart:function(){l=b,c=[],f=[],M=!0},polygonEnd:function(){l=x,c=n.merge(c);var e=function(n){for(var t=0,e=f.length,r=n[1],i=0;ir&&qn(c,u,n)>0&&++t:u[1]<=r&&qn(c,u,n)<0&&--t,c=u;return 0!==t}([t,i]),r=M&&e,u=c.length;(r||u)&&(l.polygonStart(),r&&(l.lineStart(),S(null,null,1,l),l.lineEnd()),u&&$e(c,o,e,S,l),l.polygonEnd()),c=f=s=null}};function S(n,o,l,c){var f=0,s=0;if(null==n||(f=u(n,l))!==(s=u(o,l))||a(n,o)<0^l>0)do{c.point(0===f||3===f?t:r,f>1?i:e)}while((f=(f+l+4)%4)!==s);else c.point(o[0],o[1])}function k(n,u){return t<=n&&n<=r&&e<=u&&u<=i}function N(n,t){k(n,t)&&l.point(n,t)}function E(n,t){var e=k(n=Math.max(-er,Math.min(er,n)),t=Math.max(-er,Math.min(er,t)));if(f&&s.push([n,t]),m)h=n,p=t,g=e,m=!1,e&&(l.lineStart(),l.point(n,t));else if(e&&y)l.point(n,t);else{var r={a:{x:v,y:d},b:{x:n,y:t}};_(r)?(y||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),e||l.lineEnd(),M=!1):e&&(l.lineStart(),l.point(n,t),M=!1)}v=n,d=t,y=e}return w};function u(n,i){return y(n[0]-t)<_n?i>0?0:3:y(n[0]-r)<_n?i>0?2:1:y(n[1]-e)<_n?i>0?1:0:i>0?3:2}function o(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}}function ir(n){var t=0,e=Sn/3,r=Nr(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Sn/180,e=n[1]*Sn/180):[t/Sn*180,e/Sn*180]},i}function ur(n,t){var e=Math.sin(n),r=(e+Math.sin(t))/2,i=1+e*(2*r-e),u=Math.sqrt(i)/r;function o(n,t){var e=Math.sqrt(i-2*r*Math.sin(t))/r;return[e*Math.sin(n*=r),u-e*Math.cos(n)]}return o.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/r,Tn((i-(n*n+e*e)*r*r)/(2*r))]},o}n.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),(i=u(n)).valid=!0,i},extent:function(a){return arguments.length?(u=rr(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(n.geo.conicEqualArea=function(){return ir(ur)}).raw=ur,n.geo.albers=function(){return n.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},n.geo.albersUsa=function(){var t,e,r,i,u=n.geo.albers(),o=n.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=n.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};function c(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}return c.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?a:u).invert(n)},c.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},c.precision=function(n){return arguments.length?(u.precision(n),o.precision(n),a.precision(n),c):u.precision()},c.scale=function(n){return arguments.length?(u.scale(n),o.scale(.35*n),a.scale(n),c.translate(u.translate())):u.scale()},c.translate=function(n){if(!arguments.length)return u.translate();var t=u.scale(),f=+n[0],s=+n[1];return e=u.translate(n).clipExtent([[f-.455*t,s-.238*t],[f+.455*t,s+.238*t]]).stream(l).point,r=o.translate([f-.307*t,s+.201*t]).clipExtent([[f-.425*t+_n,s+.12*t+_n],[f-.214*t-_n,s+.234*t-_n]]).stream(l).point,i=a.translate([f-.205*t,s+.212*t]).clipExtent([[f-.214*t+_n,s+.166*t+_n],[f-.115*t-_n,s+.234*t-_n]]).stream(l).point,c},c.scale(1070)};var or,ar,lr,cr,fr,sr,hr={point:R,lineStart:R,lineEnd:R,polygonStart:function(){ar=0,hr.lineStart=pr},polygonEnd:function(){hr.lineStart=hr.lineEnd=hr.point=R,or+=y(ar/2)}};function pr(){var n,t,e,r;function i(n,t){ar+=r*n-e*t,e=n,r=t}hr.point=function(u,o){hr.point=i,n=e=u,t=r=o},hr.lineEnd=function(){i(n,t)}}var gr={point:function(n,t){nfr&&(fr=n);tsr&&(sr=t)},lineStart:R,lineEnd:R,polygonStart:R,polygonEnd:R};function vr(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}var dr,yr={point:mr,lineStart:Mr,lineEnd:xr,polygonStart:function(){yr.lineStart=br},polygonEnd:function(){yr.point=mr,yr.lineStart=Mr,yr.lineEnd=xr}};function mr(n,t){Me+=n,xe+=t,++be}function Mr(){var n,t;function e(e,r){var i=e-n,u=r-t,o=Math.sqrt(i*i+u*u);_e+=o*(n+e)/2,we+=o*(t+r)/2,Se+=o,mr(n=e,t=r)}yr.point=function(r,i){yr.point=e,mr(n=r,t=i)}}function xr(){yr.point=mr}function br(){var n,t,e,r;function i(n,t){var i=n-e,u=t-r,o=Math.sqrt(i*i+u*u);_e+=o*(e+n)/2,we+=o*(r+t)/2,Se+=o,ke+=(o=r*n-e*t)*(e+n),Ne+=o*(r+t),Ee+=3*o,mr(e=n,r=t)}yr.point=function(u,o){yr.point=i,mr(n=e=u,t=r=o)},yr.lineEnd=function(){i(n,t)}}function _r(n){var t=.5,e=Math.cos(30*An),r=16;function i(t){return(r?function(t){var e,i,o,a,l,c,f,s,h,p,g,v,d={point:y,lineStart:m,lineEnd:x,polygonStart:function(){t.polygonStart(),d.lineStart=b},polygonEnd:function(){t.polygonEnd(),d.lineStart=m}};function y(e,r){e=n(e,r),t.point(e[0],e[1])}function m(){s=NaN,d.point=M,t.lineStart()}function M(e,i){var o=qe([e,i]),a=n(e,i);u(s,h,f,p,g,v,s=a[0],h=a[1],f=e,p=o[0],g=o[1],v=o[2],r,t),t.point(s,h)}function x(){d.point=y,t.lineEnd()}function b(){m(),d.point=_,d.lineEnd=w}function _(n,t){M(e=n,t),i=s,o=h,a=p,l=g,c=v,d.point=M}function w(){u(s,h,f,p,g,v,i,o,e,a,l,c,r,t),d.lineEnd=x,x()}return d}:function(t){return Sr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})})(t)}function u(r,i,o,a,l,c,f,s,h,p,g,v,d,m){var M=f-r,x=s-i,b=M*M+x*x;if(b>4*t&&d--){var _=a+p,w=l+g,S=c+v,k=Math.sqrt(_*_+w*w+S*S),N=Math.asin(S/=k),E=y(y(S)-1)<_n||y(o-h)<_n?(o+h)/2:Math.atan2(w,_),A=n(E,N),C=A[0],z=A[1],q=C-r,L=z-i,T=x*q-M*L;(T*T/b>t||y((M*q+x*L)/b-.5)>.3||a*p+l*g+c*v0&&16,i):Math.sqrt(t)},i}function wr(n){this.stream=n}function Sr(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 kr(n){return Nr(function(){return n})()}function Nr(t){var e,r,i,u,o,a,l=_r(function(n,t){return[(n=e(n,t))[0]*c+u,o-n[1]*c]}),c=150,f=480,s=250,h=0,p=0,g=0,v=0,d=0,m=nr,M=z,x=null,b=null;function _(n){return[(n=i(n[0]*An,n[1]*An))[0]*c+u,o-n[1]*c]}function w(n){return(n=i.invert((n[0]-u)/c,(o-n[1])/c))&&[n[0]*Cn,n[1]*Cn]}function S(){i=Ve(r=zr(g,v,d),e);var n=e(h,p);return u=f-n[0]*c,o=s+n[1]*c,k()}function k(){return a&&(a.valid=!1,a=null),_}return _.stream=function(n){return a&&(a.valid=!1),(a=Er(m(r,l(M(n))))).valid=!0,a},_.clipAngle=function(n){return arguments.length?(m=null==n?(x=n,nr):function(n){var t=Math.cos(n),e=t>0,r=y(t)>_n;return Je(i,function(n){var t,a,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=i(s,h),d=e?v?0:o(s,h):v?o(s+(s<0?Sn:-Sn),h):0;if(!t&&(c=l=v)&&n.lineStart(),v!==l&&(p=u(t,g),(je(t,p)||je(g,p))&&(g[0]+=_n,g[1]+=_n,v=i(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=u(g,t),n.point(p[0],p[1])):(p=u(t,g),n.point(p[0],p[1]),n.lineEnd()),t=p;else if(r&&t&&e^v){var y;d&a||!(y=u(g,t,!0))||(f=0,e?(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])))}!v||t&&je(t,g)||n.point(g[0],g[1]),t=g,l=v,a=d},lineEnd:function(){l&&n.lineEnd(),t=null},clean:function(){return f|(c&&l)<<1}}},Rr(n,6*An),e?[0,-n]:[-Sn,n-Sn]);function i(n,e){return Math.cos(n)*Math.cos(e)>t}function u(n,e,r){var i=[1,0,0],u=Te(qe(n),qe(e)),o=Le(u,u),a=u[0],l=o-a*a;if(!l)return!r&&n;var c=t*o/l,f=-t*a/l,s=Te(i,u),h=De(i,c);Re(h,De(u,f));var p=s,g=Le(h,p),v=Le(p,p),d=g*g-v*(Le(h,h)-1);if(!(d<0)){var m=Math.sqrt(d),M=De(p,(-g-m)/v);if(Re(M,h),M=Ue(M),!r)return M;var x,b=n[0],_=e[0],w=n[1],S=e[1];_0^M[1]<(y(M[0]-b)<_n?w:S):w<=M[1]&&M[1]<=S:k>Sn^(b<=M[0]&&M[0]<=_)){var E=De(p,(-g+m)/v);return Re(E,h),[M,Ue(E)]}}}function o(t,r){var i=e?n:Sn-n,u=0;return t<-i?u|=1:t>i&&(u|=2),r<-i?u|=4:r>i&&(u|=8),u}}((x=+n)*An),k()):x},_.clipExtent=function(n){return arguments.length?(b=n,M=n?rr(n[0][0],n[0][1],n[1][0],n[1][1]):z,k()):b},_.scale=function(n){return arguments.length?(c=+n,S()):c},_.translate=function(n){return arguments.length?(f=+n[0],s=+n[1],S()):[f,s]},_.center=function(n){return arguments.length?(h=n[0]%360*An,p=n[1]%360*An,S()):[h*Cn,p*Cn]},_.rotate=function(n){return arguments.length?(g=n[0]%360*An,v=n[1]%360*An,d=n.length>2?n[2]%360*An:0,S()):[g*Cn,v*Cn,d*Cn]},n.rebind(_,l,"precision"),function(){return e=t.apply(this,arguments),_.invert=e.invert&&w,S()}}function Er(n){return Sr(n,function(t,e){n.point(t*An,e*An)})}function Ar(n,t){return[n,t]}function Cr(n,t){return[n>Sn?n-kn:n<-Sn?n+kn:n,t]}function zr(n,t,e){return n?t||e?Ve(Lr(n),Tr(t,e)):Lr(n):t||e?Tr(t,e):Cr}function qr(n){return function(t,e){return[(t+=n)>Sn?t-kn:t<-Sn?t+kn:t,e]}}function Lr(n){var t=qr(n);return t.invert=qr(-n),t}function Tr(n,t){var e=Math.cos(n),r=Math.sin(n),i=Math.cos(t),u=Math.sin(t);function o(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*e+a*r;return[Math.atan2(l*i-f*u,a*e-c*r),Tn(f*i+l*u)]}return o.invert=function(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*i-l*u;return[Math.atan2(l*i+c*u,a*e+f*r),Tn(f*e-a*r)]},o}function Rr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=Dr(e,i),u=Dr(e,u),(o>0?iu)&&(i+=o*kn)):(i=n+o*kn,u=n-.5*l);for(var c,f=i;o>0?f>u:f2?n[2]*An:0),t.invert=function(t){return(t=n.invert(t[0]*An,t[1]*An))[0]*=Cn,t[1]*=Cn,t},t},Cr.invert=Ar,n.geo.circle=function(){var n,t,e=[0,0],r=6;function i(){var n="function"==typeof e?e.apply(this,arguments):e,r=zr(-n[0]*An,-n[1]*An,0).invert,i=[];return t(null,null,1,{point:function(n,t){i.push(n=r(n,t)),n[0]*=Cn,n[1]*=Cn}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(n){return arguments.length?(e=n,i):e},i.angle=function(e){return arguments.length?(t=Rr((n=+e)*An,r*An),i):n},i.precision=function(e){return arguments.length?(t=Rr(n*An,(r=+e)*An),i):r},i.angle(90)},n.geo.distance=function(n,t){var e,r=(t[0]-n[0])*An,i=n[1]*An,u=t[1]*An,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},n.geo.graticule=function(){var t,e,r,i,u,o,a,l,c,f,s,h,p=10,g=p,v=90,d=360,m=2.5;function M(){return{type:"MultiLineString",coordinates:x()}}function x(){return n.range(Math.ceil(i/v)*v,r,v).map(s).concat(n.range(Math.ceil(l/d)*d,a,d).map(h)).concat(n.range(Math.ceil(e/p)*p,t,p).filter(function(n){return y(n%v)>_n}).map(c)).concat(n.range(Math.ceil(o/g)*g,u,g).filter(function(n){return y(n%d)>_n}).map(f))}return M.lines=function(){return x().map(function(n){return{type:"LineString",coordinates:n}})},M.outline=function(){return{type:"Polygon",coordinates:[s(i).concat(h(a).slice(1),s(r).reverse().slice(1),h(l).reverse().slice(1))]}},M.extent=function(n){return arguments.length?M.majorExtent(n).minorExtent(n):M.minorExtent()},M.majorExtent=function(n){return arguments.length?(i=+n[0][0],r=+n[1][0],l=+n[0][1],a=+n[1][1],i>r&&(n=i,i=r,r=n),l>a&&(n=l,l=a,a=n),M.precision(m)):[[i,l],[r,a]]},M.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],u=+n[1][1],e>t&&(n=e,e=t,t=n),o>u&&(n=o,o=u,u=n),M.precision(m)):[[e,o],[t,u]]},M.step=function(n){return arguments.length?M.majorStep(n).minorStep(n):M.minorStep()},M.majorStep=function(n){return arguments.length?(v=+n[0],d=+n[1],M):[v,d]},M.minorStep=function(n){return arguments.length?(p=+n[0],g=+n[1],M):[p,g]},M.precision=function(n){return arguments.length?(m=+n,c=Pr(o,u,90),f=Ur(e,t,m),s=Pr(l,a,90),h=Ur(i,r,m),M):m},M.majorExtent([[-180,-90+_n],[180,90-_n]]).minorExtent([[-180,-80-_n],[180,80+_n]])},n.geo.greatArc=function(){var t,e,r=jr,i=Fr;function u(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}return u.distance=function(){return n.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},u.source=function(n){return arguments.length?(r=n,t="function"==typeof n?null:n,u):r},u.target=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,u):i},u.precision=function(){return arguments.length?u:0},u},n.geo.interpolate=function(n,t){return e=n[0]*An,r=n[1]*An,i=t[0]*An,u=t[1]*An,o=Math.cos(r),a=Math.sin(r),l=Math.cos(u),c=Math.sin(u),f=o*Math.cos(e),s=o*Math.sin(e),h=l*Math.cos(i),p=l*Math.sin(i),g=2*Math.asin(Math.sqrt(Dn(u-r)+o*l*Dn(i-e))),v=1/Math.sin(g),(d=g?function(n){var t=Math.sin(n*=g)*v,e=Math.sin(g-n)*v,r=e*f+t*h,i=e*s+t*p,u=e*a+t*c;return[Math.atan2(i,r)*Cn,Math.atan2(u,Math.sqrt(r*r+i*i))*Cn]}:function(){return[e*Cn,r*Cn]}).distance=g,d;var e,r,i,u,o,a,l,c,f,s,h,p,g,v,d},n.geo.length=function(t){return dr=0,n.geo.stream(t,Hr),dr};var Hr={sphere:R,point:R,lineStart:function(){var n,t,e;function r(r,i){var u=Math.sin(i*=An),o=Math.cos(i),a=y((r*=An)-n),l=Math.cos(a);dr+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=e*u-t*o*l)*a),t*u+e*o*l),n=r,t=u,e=o}Hr.point=function(i,u){n=i*An,t=Math.sin(u*=An),e=Math.cos(u),Hr.point=r},Hr.lineEnd=function(){Hr.point=Hr.lineEnd=R}},lineEnd:R,polygonStart:R,polygonEnd:R};function Or(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}var Ir=Or(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(n.geo.azimuthalEqualArea=function(){return kr(Ir)}).raw=Ir;var Yr=Or(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},z);function Zr(n,t){var e=Math.cos(n),r=function(n){return Math.tan(Sn/4+n/2)},i=n===t?Math.sin(n):Math.log(e/Math.cos(t))/Math.log(r(t)/r(n)),u=e*Math.pow(r(n),i)/i;if(!i)return $r;function o(n,t){u>0?t<-En+_n&&(t=-En+_n):t>En-_n&&(t=En-_n);var e=u/Math.pow(r(t),i);return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}return o.invert=function(n,t){var e=u-t,r=zn(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(u/r,1/i))-En]},o}function Vr(n,t){var e=Math.cos(n),r=n===t?Math.sin(n):(e-Math.cos(t))/(t-n),i=e/r+n;if(y(r)<_n)return Ar;function u(n,t){var e=i-t;return[e*Math.sin(r*n),i-e*Math.cos(r*n)]}return u.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/r,i-zn(r)*Math.sqrt(n*n+e*e)]},u}(n.geo.azimuthalEquidistant=function(){return kr(Yr)}).raw=Yr,(n.geo.conicConformal=function(){return ir(Zr)}).raw=Zr,(n.geo.conicEquidistant=function(){return ir(Vr)}).raw=Vr;var Xr=Or(function(n){return 1/n},Math.atan);function $r(n,t){return[n,Math.log(Math.tan(Sn/4+t/2))]}function Br(n){var t,e=kr(n),r=e.scale,i=e.translate,u=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=i.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=u.apply(e,arguments);if(o===e){if(t=null==n){var a=Sn*r(),l=i();u([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}(n.geo.gnomonic=function(){return kr(Xr)}).raw=Xr,$r.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-En]},(n.geo.mercator=function(){return Br($r)}).raw=$r;var Wr=Or(function(){return 1},Math.asin);(n.geo.orthographic=function(){return kr(Wr)}).raw=Wr;var Jr=Or(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});function Gr(n,t){return[Math.log(Math.tan(Sn/4+t/2)),-n]}function Kr(n){return n[0]}function Qr(n){return n[1]}function ni(n){for(var t=n.length,e=[0,1],r=2,i=2;i1&&qn(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function ti(n,t){return n[0]-t[0]||n[1]-t[1]}(n.geo.stereographic=function(){return kr(Jr)}).raw=Jr,Gr.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-En]},(n.geo.transverseMercator=function(){var n=Br(Gr),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):[(n=t())[1],-n[0]]},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):[(n=e())[0],n[1],n[2]-90]},e([0,0,90])}).raw=Gr,n.geom={},n.geom.hull=function(n){var t=Kr,e=Qr;if(arguments.length)return r(n);function r(n){if(n.length<3)return[];var r,i=dt(t),u=dt(e),o=n.length,a=[],l=[];for(r=0;r=0;--r)p.push(n[a[c[r]][2]]);for(r=+s;r_n)a=a.L;else{if(!((i=u-mi(a,o))>_n)){r>-_n?(t=a.P,e=a):i>-_n?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=pi(n);if(li.insert(t,l),t||e){if(t===e)return _i(t),e=pi(t.site),li.insert(l,e),l.edge=e.edge=ki(t.site,l.site),bi(t),void bi(e);if(e){_i(t),_i(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};Ni(e.edge,c,g,x),l.edge=ki(c,n,null,x),e.edge=ki(n,g,null,x),bi(t),bi(e)}else l.edge=ki(t.site,l.site)}}function yi(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-1/0;var a=(e=o.site).x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function mi(n,t){var e=n.N;if(e)return yi(e,t);var r=n.site;return r.y===t?r.x:1/0}function Mi(n){this.site=n,this.edges=[]}function xi(n,t){return t.angle-n.angle}function bi(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=2*(l*(d=u.y-a)-c*f);if(!(s>=-wn)){var h=l*l+c*c,p=f*f+d*d,g=(d*h-c*p)/s,v=(l*p-f*h)/s,d=v+a,y=hi.pop()||new function(){Ci(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=n,y.site=i,y.x=g+o,y.y=d+Math.sqrt(g*g+v*v),y.cy=d,n.circle=y;for(var m=null,M=fi._;M;)if(y.y=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.x_n||y(i-e)>_n)&&(a.splice(o,0,new Ei((m=u.site,M=f,x=y(r-s)<_n&&g-i>_n?{x:s,y:y(t-s)<_n?e:g}:y(i-g)<_n&&h-r>_n?{x:y(e-g)<_n?t:h,y:g}:y(r-h)<_n&&i-p>_n?{x:h,y:y(t-h)<_n?e:p}:y(i-p)<_n&&r-s>_n?{x:y(e-p)<_n?t:s,y:p}:null,b=void 0,b=new Si(m,null),b.a=M,b.b=x,oi.push(b),b),u.site,null)),++l);var m,M,x,b}(t));var o={cells:ai,edges:oi};return li=fi=oi=ai=null,o}function Ri(n,t){return t.y-n.y||t.x-n.x}Mi.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)(n=t[e].edge).b&&n.a||t.splice(e,1);return t.sort(xi),t.length},Ei.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Ai.prototype={insert:function(n,t){var e,r,i;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=Li(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.R&&(zi(this,e),e=(n=e).U),e.C=!1,r.C=!0,qi(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.L&&(qi(this,e),e=(n=e).U),e.C=!1,r.C=!0,zi(this,r)),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,i=n.U,u=n.L,o=n.R;if(e=u?o?Li(o):u:o,i?i.L===n?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=n.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=n.U,n=e.R,i.L=n,e.R=o,o.U=e):(e.U=i,i=e,n=e.R)):(r=n.C,n=e),n&&(n.U=i),!r)if(n&&n.C)n.C=!1;else{do{if(n===this._)break;if(n===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,zi(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,qi(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,zi(this,i),n=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,qi(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,zi(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,qi(this,i),n=this._;break}t.C=!0,n=i,i=i.U}while(!n.C);n&&(n.C=!1)}}},n.geom.voronoi=function(n){var t=Kr,e=Qr,r=t,i=e,u=Di;if(n)return o(n);function o(n){var t=new Array(n.length),e=u[0][0],r=u[0][1],i=u[1][0],o=u[1][1];return Ti(a(n),u).cells.forEach(function(u,a){var l=u.edges,c=u.site;(t[a]=l.length?l.map(function(n){var t=n.start();return[t.x,t.y]}):c.x>=e&&c.x<=i&&c.y>=r&&c.y<=o?[[e,o],[i,o],[i,r],[e,r]]:[]).point=n[a]}),t}function a(n){return n.map(function(n,t){return{x:Math.round(r(n,t)/_n)*_n,y:Math.round(i(n,t)/_n)*_n,i:t}})}return o.links=function(n){return Ti(a(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},o.triangles=function(n){var t=[];return Ti(a(n)).cells.forEach(function(e,r){for(var i,u,o,a,l=e.site,c=e.edges.sort(xi),f=-1,s=c.length,h=c[s-1].edge,p=h.l===l?h.r:h.l;++fu&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:Hi(e,r)})),u=Yi.lastIndex;return uv&&(v=l.x),l.y>d&&(d=l.y),c.push(l.x),f.push(l.y);else for(s=0;sv&&(v=x),b>d&&(d=b),c.push(x),f.push(b)}var _=v-p,w=d-g;function S(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,c=n.y;if(null!=l)if(y(l-e)+y(c-r)<.01)k(n,t,e,r,i,u,o,a);else{var f=n.point;n.x=n.y=n.point=null,k(n,f,l,c,i,u,o,a),k(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else k(n,t,e,r,i,u,o,a)}function k(n,t,e,r,i,u,o,a){var l=.5*(i+o),c=.5*(u+a),f=e>=l,s=r>=c,h=s<<1|f;n.leaf=!1,n=n.nodes[h]||(n.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),f?i=l:o=l,s?u=c:a=c,S(n,t,e,r,i,u,o,a)}_>w?d=g+_:v=p+w;var N={leaf:!0,nodes:[],point:null,x:null,y:null};if(N.add=function(n){S(N,n,+m(n,++s),+M(n,s),p,g,v,d)},N.visit=function(n){!function n(t,e,r,i,u,o){if(!t(e,r,i,u,o)){var a=.5*(r+u),l=.5*(i+o),c=e.nodes;c[0]&&n(t,c[0],r,i,a,l),c[1]&&n(t,c[1],a,i,u,l),c[2]&&n(t,c[2],r,l,a,o),c[3]&&n(t,c[3],a,l,u,o)}}(n,N,p,g,v,d)},N.find=function(n){return t=N,e=n[0],r=n[1],c=1/0,function n(t,f,s,h,p){if(!(f>o||s>a||h=b)<<1|e>=x,w=_+4;_=0&&!(r=n.interpolators[i](t,e)););return r}function Vi(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;e=1)return 1;var t=n*n,e=t*n;return 4*(n<.5?e:3*(n-t)+e-.75)}function nu(n){return 1-Math.cos(n*En)}function tu(n){return Math.pow(2,10*(n-1))}function eu(n){return 1-Math.sqrt(1-n*n)}function ru(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function iu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function uu(n){var t,e,r,i=[n.a,n.b],u=[n.c,n.d],o=au(i),a=ou(i,u),l=au(((t=u)[0]+=(r=-a)*(e=i)[0],t[1]+=r*e[1],t))||0;i[0]*u[1]=0?n.slice(0,r):n,u=r>=0?n.slice(r+1):"in";return i=$i.get(i)||Xi,u=Bi.get(u)||z,e=u(i.apply(null,t.call(arguments,1))),function(n){return n<=0?0:n>=1?1:e(n)}},n.interpolateHcl=function(t,e){t=n.hcl(t),e=n.hcl(e);var r=t.h,i=t.c,u=t.l,o=e.h-r,a=e.c-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.c:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return $n(r+o*n,i+a*n,u+l*n)+""}},n.interpolateHsl=function(t,e){t=n.hsl(t),e=n.hsl(e);var r=t.h,i=t.s,u=t.l,o=e.h-r,a=e.s-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.s:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return Zn(r+o*n,i+a*n,u+l*n)+""}},n.interpolateLab=function(t,e){t=n.lab(t),e=n.lab(e);var r=t.l,i=t.a,u=t.b,o=e.l-r,a=e.a-i,l=e.b-u;return function(n){return nt(r+o*n,i+a*n,u+l*n)+""}},n.interpolateRound=iu,n.transform=function(t){var e=r.createElementNS(n.ns.prefix.svg,"g");return(n.transform=function(n){if(null!=n){e.setAttribute("transform",n);var t=e.transform.baseVal.consolidate()}return new uu(t?t.matrix:lu)})(t)},uu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var lu={a:1,b:0,c:0,d:1,e:0,f:0};function cu(t,e){var r,i=[],u=[],o=n.transform(t),a=n.transform(e),l=o.translate,c=a.translate,f=o.rotate,s=a.rotate,h=o.skew,p=a.skew,g=o.scale,v=a.scale;return l[0]!=c[0]||l[1]!=c[1]?(i.push("translate(",null,",",null,")"),u.push({i:1,x:Hi(l[0],c[0])},{i:3,x:Hi(l[1],c[1])})):c[0]||c[1]?i.push("translate("+c+")"):i.push(""),f!=s?(f-s>180?s+=360:s-f>180&&(f+=360),u.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:Hi(f,s)})):s&&i.push(i.pop()+"rotate("+s+")"),h!=p?u.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:Hi(h,p)}):p&&i.push(i.pop()+"skewX("+p+")"),g[0]!=v[0]||g[1]!=v[1]?(r=i.push(i.pop()+"scale(",null,",",null,")"),u.push({i:r-4,x:Hi(g[0],v[0])},{i:r-2,x:Hi(g[1],v[1])})):1==v[0]&&1==v[1]||i.push(i.pop()+"scale("+v+")"),r=u.length,function(n){for(var t,e=-1;++e0?t:0:t>0&&(a.start({type:"start",alpha:e=t}),n.timer(o.tick)),o):e},o.start=function(){var n,t,e,a=d.length,c=y.length,p=l[0],g=l[1];for(n=0;n=0;)e.push(i[r])}function wu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;e&&(u.value=0),u.children=c}else e&&(u.value=+e.call(r,u,u.depth)||0),delete u.children;return wu(i,function(t){var r,i;n&&(r=t.children)&&r.sort(n),e&&(i=t.parent)&&(i.value+=t.value)}),a}return r.sort=function(t){return arguments.length?(n=t,r):n},r.children=function(n){return arguments.length?(t=n,r):t},r.value=function(n){return arguments.length?(e=n,r):e},r.revalue=function(n){return e&&(_u(n,function(n){n.children&&(n.value=0)}),wu(n,function(n){var t;n.children||(n.value=+e.call(r,n,n.depth)||0),(t=n.parent)&&(t.value+=n.value)})),n},r},n.layout.partition=function(){var t=n.layout.hierarchy(),e=[1,1];function r(n,r){var i=t.call(this,n,r);return function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++ca&&(a=r),o.push(r)}for(e=0;ei&&(r=e,i=t);return r}function Uu(n){return n.reduce(ju,0)}function ju(n,t){return n+t[1]}function Fu(n,t){return Hu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Hu(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function Ou(t){return[n.min(t),n.max(t)]}function Iu(n,t){return n.value-t.value}function Yu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Zu(n,t){n._pack_next=t,t._pack_prev=n}function Vu(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Xu(n){if((t=n.children)&&(l=t.length)){var t,e,r,i,u,o,a,l,c=1/0,f=-1/0,s=1/0,h=-1/0;if(t.forEach($u),(e=t[0]).x=-e.r,e.y=0,M(e),l>1&&((r=t[1]).x=r.r,r.y=0,M(r),l>2))for(Wu(e,r,i=t[2]),M(i),Yu(e,i),e._pack_prev=i,Yu(i,r),r=e._pack_next,u=3;u0)for(o=-1;++o=s[0]&&l<=s[1]&&((a=c[n.bisect(h,l,1,g)-1]).y+=v,a.push(u[o]));return c}return u.value=function(n){return arguments.length?(e=n,u):e},u.range=function(n){return arguments.length?(r=dt(n),u):r},u.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return Hu(t,n)}:dt(n),u):i},u.frequency=function(n){return arguments.length?(t=!!n,u):t},u},n.layout.pack=function(){var t,e=n.layout.hierarchy().sort(Iu),r=0,i=[1,1];function u(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,wu(a,function(n){n.r=+f(n.value)}),wu(a,Xu),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;wu(a,function(n){n.r+=s}),wu(a,Xu),wu(a,function(n){n.r-=s})}return function n(t,e,r,i){var u=t.children;t.x=e+=i*t.x;t.y=r+=i*t.y;t.r*=i;if(u)for(var o=-1,a=u.length;++op.x&&(p=n),n.depth>g.depth&&(g=n)});var v=e(h,p)/2-h.x,d=r[0]/(p.x+e(p,h)/2+v),y=r[1]/(g.depth||1);_u(f,function(n){n.x=(n.x+v)*d,n.y=n.depth*y})}return c}function o(n){var t=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(t.length){!function(n){var t,e=0,r=0,i=n.children,u=i.length;for(;--u>=0;)(t=i[u]).z+=e,t.m+=e,e+=t.s+(r+=t.c)}(n);var u=(t[0].z+t[t.length-1].z)/2;i?(n.z=i.z+e(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+e(n._,i._));n.parent.A=function(n,t,r){if(t){for(var i,u=n,o=n,a=t,l=u.parent.children[0],c=u.m,f=o.m,s=a.m,h=l.m;a=Ku(a),u=Gu(u),a&&u;)l=Gu(l),(o=Ku(o)).a=n,(i=a.z+s-u.z-c+e(a._,u._))>0&&(Qu((g=n,v=r,(p=a).a.parent===g.parent?p.a:v),n,i),c+=i,f+=i),s+=a.m,c+=u.m,h+=l.m,f+=o.m;a&&!Ku(o)&&(o.t=a,o.m+=s-f),u&&!Gu(l)&&(l.t=u,l.m+=c-h,r=n)}var p,g,v;return r}(n,i,n.parent.A||r[0])}function a(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function l(n){n.x*=r[0],n.y=n.depth*r[1]}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n)?l:null,u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null==(r=n)?null:l,u):i?r:null},bu(u,t)},n.layout.cluster=function(){var t=n.layout.hierarchy().sort(null).value(null),e=Ju,r=[1,1],i=!1;function u(u,o){var a,l=t.call(this,u,o),c=l[0],f=0;wu(c,function(t){var r,i,u=t.children;u&&u.length?(t.x=(i=u).reduce(function(n,t){return n+t.x},0)/i.length,t.y=(r=u,1+n.max(r,function(n){return n.y}))):(t.x=a?f+=e(t,a):0,t.y=0,a=t)});var s=function n(t){var e=t.children;return e&&e.length?n(e[0]):t}(c),h=function n(t){var e,r=t.children;return r&&(e=r.length)?n(r[e-1]):t}(c),p=s.x-e(s,h)/2,g=h.x+e(h,s)/2;return wu(c,i?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-p)/(g-p)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),l}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n),u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null!=(r=n),u):i?r:null},bu(u,t)},n.layout.treemap=function(){var t,e=n.layout.hierarchy(),r=Math.round,i=[1,1],u=null,o=no,a=!1,l="squarify",c=.5*(1+Math.sqrt(5));function f(n,t){for(var e,r,i=-1,u=n.length;++i0;)a.push(e=c[i-1]),a.area+=e.area,"squarify"!==l||(r=p(a,v))<=h?(c.pop(),h=r):(a.area-=a.pop().area,g(a,v,u,!1),v=Math.min(u.dx,u.dy),a.length=a.area=0,h=1/0);a.length&&(g(a,v,u,!0),a.length=a.area=0),t.forEach(s)}}function h(n){var t=n.children;if(t&&t.length){var e,r=o(n),i=t.slice(),u=[];for(f(i,r.dx*r.dy/n.value),u.area=0;e=i.pop();)u.push(e),u.area+=e.area,null!=e.z&&(g(u,e.z?r.dx:r.dy,r,!i.length),u.length=u.area=0);t.forEach(h)}}function p(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oi&&(i=e));return t*=t,(r*=r)?Math.max(t*i*c/r,r/(t*u*c)):1/0}function g(n,t,e,i){var u,o=-1,a=n.length,l=e.x,c=e.y,f=t?r(n.area/t):0;if(t==e.dx){for((i||f>e.dy)&&(f=e.dy);++oe.dx)&&(f=e.dx);++o1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=n.random.normal.apply(n,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=n.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(n){return function(){for(var t=0,e=0;e2?ao:io,a=i?su:fu;return u=n(t,e,a,r),o=n(e,t,a,Zi),l}function l(n){return u(n)}l.invert=function(n){return o(n)};l.domain=function(n){return arguments.length?(t=n.map(Number),a()):t};l.range=function(n){return arguments.length?(e=n,a()):e};l.rangeRound=function(n){return l.range(n).interpolate(iu)};l.clamp=function(n){return arguments.length?(i=n,a()):i};l.interpolate=function(n){return arguments.length?(r=n,a()):r};l.ticks=function(n){return so(t,n)};l.tickFormat=function(n,e){return ho(t,n,e)};l.nice=function(n){return co(t,n),a()};l.copy=function(){return n(t,e,r,i)};return a()}([0,1],[0,1],Zi,!1)};var po={s:1,g:1,p:1,r:1,e:1};function go(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}n.scale.log=function(){return function t(e,r,i,u){function o(n){return(i?Math.log(n<0?0:n):-Math.log(n>0?0:-n))/Math.log(r)}function a(n){return i?Math.pow(r,n):-Math.pow(r,-n)}function l(n){return e(o(n))}l.invert=function(n){return a(e.invert(n))};l.domain=function(n){return arguments.length?(i=n[0]>=0,e.domain((u=n.map(Number)).map(o)),l):u};l.base=function(n){return arguments.length?(r=+n,e.domain(u.map(o)),l):r};l.nice=function(){var n=uo(u.map(o),i?Math:yo);return e.domain(n),u=n.map(a),l};l.ticks=function(){var n=eo(u),t=[],e=n[0],l=n[1],c=Math.floor(o(e)),f=Math.ceil(o(l)),s=r%1?2:r;if(isFinite(f-c)){if(i){for(;c0;h--)t.push(a(c)*h);for(c=0;t[c]l;f--);t=t.slice(c,f)}return t};l.tickFormat=function(t,e){if(!arguments.length)return vo;arguments.length<2?e=vo:"function"!=typeof e&&(e=n.format(e));var r,u=Math.max(.1,t/l.ticks().length),c=i?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/a(c(o(n)+r))<=u?e(n):""}};l.copy=function(){return t(e.copy(),r,i,u)};return lo(l,e)}(n.scale.linear().domain([0,1]),10,!0,[1,10])};var vo=n.format(".0e"),yo={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};function mo(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}n.scale.pow=function(){return function n(t,e,r){var i=mo(e),u=mo(1/e);function o(n){return t(i(n))}o.invert=function(n){return u(t.invert(n))};o.domain=function(n){return arguments.length?(t.domain((r=n.map(Number)).map(i)),o):r};o.ticks=function(n){return so(r,n)};o.tickFormat=function(n,t){return ho(r,n,t)};o.nice=function(n){return o.domain(co(r,n))};o.exponent=function(n){return arguments.length?(i=mo(e=n),u=mo(1/e),t.domain(r.map(i)),o):e};o.copy=function(){return n(t.copy(),e,r)};return lo(o,t)}(n.scale.linear(),1,[0,1])},n.scale.sqrt=function(){return n.scale.pow().exponent(.5)},n.scale.ordinal=function(){return function t(e,r){var i,u,o;function a(n){return u[((i.get(n)||("range"===r.t?i.set(n,e.push(n)):NaN))-1)%u.length]}function l(t,r){return n.range(e.length).map(function(n){return t+r*n})}a.domain=function(n){if(!arguments.length)return e;e=[],i=new M;for(var t,u=-1,o=n.length;++u0?i[n-1]:e[0],ns?0:1;if(c=Nn)return l(c,p)+(a?l(a,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+o.apply(this,arguments)||0)/2)&&(d=r===So?Math.sqrt(a*a+c*c):+r.apply(this,arguments),p||(E*=-1),c&&(E=Tn(d/c*Math.sin(y))),a&&(N=Tn(d/a*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Sn?0:1;if(E&&zo(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(a){_=a*Math.cos(s-N),w=a*Math.sin(s-N),S=a*Math.cos(f+N),k=a*Math.sin(f+N);var q=Math.abs(f-s+2*N)<=Sn?0:1;if(N&&zo(_,w,S,k)===1-p^q){var L=(f+s)/2;_=a*Math.cos(L),w=a*Math.sin(L),S=k=null}}else _=w=0;if((g=Math.min(Math.abs(c-a)/2,+e.apply(this,arguments)))>.001){v=a0?0:1}function qo(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(y<0?-1:1)*Math.sqrt(M*M*m-x*x),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Lo(n){var t=Kr,e=Qr,r=Xe,i=Ro,u=i.key,o=.7;function a(u){var a,l=[],c=[],f=-1,s=u.length,h=dt(t),p=dt(e);function g(){l.push("M",i(n(c),o))}for(;++f1&&i.push("H",r[0]);return i.join("")},"step-before":Do,"step-after":Po,basis:Fo,"basis-open":function(n){if(n.length<4)return Ro(n);var t,e=[],r=-1,i=n.length,u=[0],o=[0];for(;++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);e.push(Ho(Yo,u)+","+Ho(Yo,o)),--r;for(;++r9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));a=-1;for(;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}(n))}});function Ro(n){return n.join("L")}function Do(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;cSn)+",1 "+t}function l(n,t,e,r){return"Q 0,0 "+r}return u.radius=function(n){return arguments.length?(e=dt(n),u):e},u.source=function(t){return arguments.length?(n=dt(t),u):n},u.target=function(n){return arguments.length?(t=dt(n),u):t},u.startAngle=function(n){return arguments.length?(r=dt(n),u):r},u.endAngle=function(n){return arguments.length?(i=dt(n),u):i},u},n.svg.diagonal=function(){var n=jr,t=Fr,e=Wo;function r(r,i){var u=n.call(this,r,i),o=t.call(this,r,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return"M"+(l=l.map(e))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(n=dt(t),r):n},r.target=function(n){return arguments.length?(t=dt(n),r):t},r.projection=function(n){return arguments.length?(e=n,r):e},r},n.svg.diagonal.radial=function(){var t=n.svg.diagonal(),e=Wo,r=t.projection;return t.projection=function(n){return arguments.length?r((t=e=n,function(){var n=t.apply(this,arguments),e=n[0],r=n[1]-En;return[e*Math.cos(r),e*Math.sin(r)]})):e;var t},t},n.svg.symbol=function(){var n=Go,t=Jo;function e(e,r){return(Qo.get(n.call(this,e,r))||Ko)(t.call(this,e,r))}return e.type=function(t){return arguments.length?(n=dt(t),e):n},e.size=function(n){return arguments.length?(t=dt(n),e):t},e};var Qo=n.map({circle:Ko,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*ta)),e=t*ta;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/na),e=t*na/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/na),e=t*na/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});n.svg.symbolTypes=Qo.keys();var na=Math.sqrt(3),ta=Math.tan(30*An);X.transition=function(n){for(var t,e,r=ua||++la,i=sa(n),u=[],o=oa||{time:Date.now(),ease:Qi,delay:0,duration:250},a=-1,l=this.length;++ai)return d();var u=o[o.active];u&&(--o.count,delete o[o.active],u.event&&u.event.interrupt.call(t,t.__data__,u.index)),o.active=i,a.event&&a.event.start.call(t,t.__data__,e),a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&p.push(r)}),f=a.ease,c=a.duration,n.timer(function(){return h.c=v(r||1)?Xe:v,1},0,l)}function v(n){if(o.active!==i)return 1;for(var r=n/c,u=f(r),l=p.length;l>0;)p[--l].call(t,u);return r>=1?(a.event&&a.event.end.call(t,t.__data__,e),d()):void 0}function d(){return--o.count?delete o[i]:delete t[r],1}h.c=g},0,l)}}aa.call=X.call,aa.empty=X.empty,aa.node=X.node,aa.size=X.size,n.transition=function(t,e){return t&&t.transition?ua?t.transition(e):t:n.selection().transition(t)},n.transition.prototype=aa,aa.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=$(n);for(var a=-1,l=this.length;++arect,.s>rect").attr("width",a[1]-a[0])}function v(n){n.select(".extent").attr("y",l[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function d(){var s,d,y=this,m=n.select(n.event.target),M=r.of(y,arguments),x=n.select(y),b=m.datum(),_=!/^(n|s)$/.test(b)&&i,w=!/^(e|w)$/.test(b)&&o,S=m.classed("extent"),k=mn(y),N=n.mouse(y),E=n.select(u(y)).on("keydown.brush",function(){32==n.event.keyCode&&(S||(s=null,N[0]-=a[1],N[1]-=l[1],S=2),U())}).on("keyup.brush",function(){32==n.event.keyCode&&2==S&&(N[0]+=a[1],N[1]+=l[1],S=0,U())});if(n.event.changedTouches?E.on("touchmove.brush",z).on("touchend.brush",L):E.on("mousemove.brush",z).on("mouseup.brush",L),x.interrupt().selectAll("*").interrupt(),S)N[0]=a[0]-N[0],N[1]=l[0]-N[1];else if(b){var A=+/w$/.test(b),C=+/^n/.test(b);d=[a[1-A]-N[0],l[1-C]-N[1]],N[0]=a[A],N[1]=l[C]}else n.event.altKey&&(s=N.slice());function z(){var t=n.mouse(y),e=!1;d&&(t[0]+=d[0],t[1]+=d[1]),S||(n.event.altKey?(s||(s=[(a[0]+a[1])/2,(l[0]+l[1])/2]),N[0]=a[+(t[0]1?{floor:function(t){for(;a(t=n.floor(t));)t=Sa(t-1);return t},ceil:function(t){for(;a(t=n.ceil(t));)t=Sa(+t+1);return t}}:n))},i.ticks=function(n,t){var e=eo(i.domain()),r=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return r&&(n=r[0],t=r[1]),n.range(e[0],Sa(+e[1]+1),t<1?1:t)},i.tickFormat=function(){return r},i.copy=function(){return wa(t.copy(),e,r)},lo(i,t)}function Sa(n){return new Date(n)}Ma.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?_a:ba,_a.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},_a.toString=ba.toString,Tt.second=Ut(function(n){return new Rt(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Tt.seconds=Tt.second.range,Tt.seconds.utc=Tt.second.utc.range,Tt.minute=Ut(function(n){return new Rt(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Tt.minutes=Tt.minute.range,Tt.minutes.utc=Tt.minute.utc.range,Tt.hour=Ut(function(n){var t=n.getTimezoneOffset()/60;return new Rt(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Tt.hours=Tt.hour.range,Tt.hours.utc=Tt.hour.utc.range,Tt.month=Ut(function(n){return(n=Tt.day(n)).setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Tt.months=Tt.month.range,Tt.months.utc=Tt.month.utc.range;var ka=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Na=[[Tt.second,1],[Tt.second,5],[Tt.second,15],[Tt.second,30],[Tt.minute,1],[Tt.minute,5],[Tt.minute,15],[Tt.minute,30],[Tt.hour,1],[Tt.hour,3],[Tt.hour,6],[Tt.hour,12],[Tt.day,1],[Tt.day,2],[Tt.week,1],[Tt.month,1],[Tt.month,3],[Tt.year,1]],Ea=Ma.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Xe]]),Aa={range:function(t,e,r){return n.range(Math.ceil(t/r)*r,+e,r).map(Sa)},floor:z,ceil:z};Na.year=Tt.year,Tt.scale=function(){return wa(n.scale.linear(),Na,Ea)};var Ca=Na.map(function(n){return[n[0].utc,n[1]]}),za=xa.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Xe]]);function qa(n){return JSON.parse(n.responseText)}function La(n){var t=r.createRange();return t.selectNode(r.body),t.createContextualFragment(n.responseText)}Ca.year=Tt.year.utc,Tt.scale.utc=function(){return wa(n.scale.linear(),Ca,za)},n.text=yt(function(n){return n.responseText}),n.json=function(n,t){return mt(n,"application/json",qa,t)},n.html=function(n,t){return mt(n,"text/html",La,t)},n.xml=yt(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(n):"object"==typeof module&&module.exports&&(module.exports=n),this.d3=n}();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy