!function(){function t(){}function n(t){return t}function e(){return this}function r(){return!0}function i(t){return"function"==typeof t?t:function(){return t}}function o(t,n,e){return function(){var r=e.apply(n,arguments);return arguments.length?t:r}}function u(t){return null!=t&&!isNaN(t)}function a(t){return t.length}function l(t){return null==t}function c(t){return t.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function f(t){for(var n=1;t*n%1;)n*=10;return n}function s(){}function h(n){function e(){for(var t,e=r,i=-1,o=e.length;++i=0?t.substring(n):(n=t.length,""),r=[];n>0;)r.push(t.substring(n-=3,n+3));return r.reverse().join(",")+e}function m(t){return function(n){return n<=0?0:n>=1?1:t(n)}}function y(t){return function(n){return 1-t(1-n)}}function x(t){return function(n){return.5*(n<.5?t(2*n):2-t(2-2*n))}}function b(t){return t}function M(t){return function(n){return Math.pow(n,t)}}function _(t){return 1-Math.cos(t*Math.PI/2)}function w(t){return Math.pow(2,10*(t-1))}function k(t){return 1-Math.sqrt(1-t*t)}function N(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function A(){d3.event.stopPropagation(),d3.event.preventDefault()}function S(){for(var t,n=d3.event;t=n.sourceEvent;)n=t;return n}function T(t){for(var n=new s,e=0,r=arguments.length;++e360?t-=360:t<0&&(t+=360),t<60?o+(u-o)*t/60:t<180?u:t<240?o+(u-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,u;return(t%=360)<0&&(t+=360),n=n<0?0:n>1?1:n,e=e<0?0:e>1?1:e,u=e<=.5?e*(1+n):e+n-e*n,o=2*e-u,D(i(t+120),i(t),i(t-120))}function Y(t){return Oe(t,ar),t}function R(t){return function(){return er(t,this)}}function U(t){return function(){return rr(t,this)}}function V(t,n){function e(){if(n=this.classList)return n.add(t);var n=this.className,e=null!=n.baseVal,r=e?n.baseVal:n;i.lastIndex=0,i.test(r)||(r=c(r+" "+t),e?n.baseVal=r:this.className=r)}function r(){if(n=this.classList)return n.remove(t);var n=this.className,e=null!=n.baseVal,r=e?n.baseVal:n;r=c(r.replace(i," ")),e?n.baseVal=r:this.className=r}var i=new RegExp("(^|\\s+)"+d3.requote(t)+"(\\s+|$)","g");if(arguments.length<2){var o=this.node();if(u=o.classList)return u.contains(t);var u=o.className;return i.lastIndex=0,i.test(null!=u.baseVal?u.baseVal:u)}return this.each("function"==typeof n?function(){(n.apply(this,arguments)?e:r).call(this)}:n?e:r)}function Z(t){return{__data__:t}}function B(t){return function(){return ur(this,t)}}function X(t){return arguments.length||(t=d3.ascending),function(n,e){return t(n&&n.__data__,e&&e.__data__)}}function $(t){return Oe(t,fr),t}function G(n,e,r){Oe(n,hr);var i=new t,o=d3.dispatch("start","end"),u=mr;return n.id=e,n.time=r,n.tween=function(t,e){return arguments.length<2?i.get(t):(null==e?i.remove(t):i.set(t,e),n)},n.ease=function(t){return arguments.length?(u="function"==typeof t?t:d3.ease.apply(d3,arguments),n):u},n.each=function(t,e){return arguments.length<2?W.call(n,t):(o.on(t,e),n)},d3.timer(function(t){return n.each(function(a,l,c){function f(t){return m.active>e?h():(m.active=e,i.forEach(function(t,n){(n=n.call(g,a,l))&&d.push(n)}),o.start.call(g,a,l),s(t)||d3.timer(s,0,r),1)}function s(t){if(m.active!==e)return h();for(var n=(t-p)/v,r=u(n),i=d.length;i>0;)d[--i].call(g,r);return n>=1?(h(),gr=e,o.end.call(g,a,l),gr=0,1):void 0}function h(){return--m.count||delete g.__transition__,1}var d=[],g=this,p=n[c][l].delay,v=n[c][l].duration,m=g.__transition__||(g.__transition__={active:0,count:0});++m.count,p<=t?f(t):d3.timer(f,p,r)}),1},0,r),n}function J(t,n,e){return""!=e&&sr}function K(t,n){var e=C(t);return"function"==typeof n?function(t,r,i){var o=n.call(this,t,r);return null==o?""!=i&&sr:i!=o&&e(i,o)}:null==n?J:(n+="",function(t,r,i){return i!=n&&e(i,n)})}function W(t){var n=gr,e=mr,r=pr,i=vr;gr=this.id,mr=this.ease();for(var o=0,u=this.length;o=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=tt()-n;r>24?(isFinite(r)&&(clearTimeout(xr),xr=setTimeout(Q,r)),yr=0):(yr=1,Mr(Q))}function tt(){for(var t=null,n=br,e=1/0;n;)n.flush?n=t?t.next=n.next:br=n.next:(e=Math.min(e,n.then+n.delay),n=(t=n).next);return e}function nt(t){var n=[t.a,t.b],e=[t.c,t.d],r=rt(n),i=et(n,e),o=rt(it(e,n,-i))||0;n[0]*e[1]2?mt:vt,l=r?q:z;return u=i(t,n,l,e),a=i(n,t,l,d3.interpolate),o}function o(t){return u(t)}var u,a;return o.invert=function(t){return a(t)},o.domain=function(n){return arguments.length?(t=n.map(Number),i()):t},o.range=function(t){return arguments.length?(n=t,i()):n},o.rangeRound=function(t){return o.range(t).interpolate(d3.interpolateRound)},o.clamp=function(t){return arguments.length?(r=t,i()):r},o.interpolate=function(t){return arguments.length?(e=t,i()):e},o.ticks=function(n){return gt(t,n)},o.tickFormat=function(n){return pt(t,n)},o.nice=function(){return lt(t,ht),i()},o.copy=function(){return ft(t,n,e,r)},i()}function st(t,n){return d3.rebind(t,n,"range","rangeRound","interpolate","clamp")}function ht(t){return t=Math.pow(10,Math.round(Math.log(t)/Math.LN10)-1),{floor:function(n){return Math.floor(n/t)*t},ceil:function(n){return Math.ceil(n/t)*t}}}function dt(t,n){var e=ut(t),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/n)/Math.LN10)),o=n/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function gt(t,n){return d3.range.apply(d3,dt(t,n))}function pt(t,n){return d3.format(",."+Math.max(0,-Math.floor(Math.log(dt(t,n)[2])/Math.LN10+.01))+"f")}function vt(t,n,e,r){var i=e(t[0],t[1]),o=r(n[0],n[1]);return function(t){return o(i(t))}}function mt(t,n,e,r){var i=[],o=[],u=0,a=Math.min(t.length,n.length)-1;for(t[a]0;c--)i.push(r(o)*c);else{for(;ol;u--);i=i.slice(o,u)}return i},e.tickFormat=function(t,i){if(arguments.length<2&&(i=kr),arguments.length<1)return i;var o,u=t/e.ticks().length,a=n===bt?(o=-1e-12,Math.floor):(o=1e-12,Math.ceil);return function(t){return t/r(a(n(t)+o))0?0:-t)/Math.LN10}function Mt(t,n){function e(n){return t(r(n))}var r=_t(n),i=_t(1/n);return e.invert=function(n){return i(t.invert(n))},e.domain=function(n){return arguments.length?(t.domain(n.map(r)),e):t.domain().map(i)},e.ticks=function(t){return gt(e.domain(),t)},e.tickFormat=function(t){return pt(e.domain(),t)},e.nice=function(){return e.domain(lt(e.domain(),ht))},e.exponent=function(t){if(!arguments.length)return n;var o=e.domain();return r=_t(n=t),i=_t(1/n),e.domain(o)},e.copy=function(){return Mt(t.copy(),n)},st(e,t)}function _t(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function wt(n,e){function r(t){return u[((o.get(t)||o.set(t,n.push(t)))-1)%u.length]}function i(t,e){return d3.range(n.length).map(function(n){return t+e*n})}var o,u,a;return r.domain=function(i){if(!arguments.length)return n;n=[],o=new t;for(var u,a=-1,l=i.length;++a1){a=n[1],o=t[l],l++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1];for(var c=2;c9&&(i=3*n/Math.sqrt(i),u[a]=i*e,u[a+1]=i*r);for(a=-1;++a<=l;)i=(t[Math.min(l,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+u[a]*u[a])),o.push([i||0,u[a]*i||0]);return o}function Zt(t){for(var n,e,r,i=-1,o=t.length;++i1){for(var r,i,o,u=ut(t.domain()),a=-1,l=n.length,c=(n[1]-n[0])/++e;++a0;)(o=+n[a]-i*c)>=u[0]&&r.push(o);for(--a,i=0;++ii&&(r=e,i=n);return r}function _n(t){return t.reduce(wn,0)}function wn(t,n){return t+n[1]}function kn(t,n){return Nn(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function Nn(t,n){for(var e=-1,r=+t[0],i=(t[1]-r)/n,o=[];++e<=n;)o[e]=i*e+r;return o}function An(t){return[d3.min(t),d3.max(t)]}function Sn(t,n){return d3.rebind(t,n,"sort","children","value"),t.links=qn,t.nodes=function(n){return $r=!0,(t.nodes=t)(n)},t}function Tn(t){return t.children}function Cn(t){return t.value}function zn(t,n){return n.value-t.value}function qn(t){return d3.merge(t.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}function Dn(t,n){return t.value-n.value}function En(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function Pn(t,n){t._pack_next=n,n._pack_prev=t}function Fn(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return i*i-e*e-r*r>.001}function Ln(t){function n(t){a=Math.min(t.x-t.r,a),l=Math.max(t.x+t.r,l),c=Math.min(t.y-t.r,c),f=Math.max(t.y+t.r,f)}var e,r,i,o,u,a=1/0,l=-1/0,c=1/0,f=-1/0,s=t.length;if(t.forEach(jn),e=t[0],e.x=-e.r,e.y=0,n(e),s>1&&(r=t[1],r.x=r.r,r.y=0,n(r),s>2)){Yn(e,r,i=t[2]),n(i),En(e,i),e._pack_prev=i,En(i,r),r=e._pack_next;for(y=3;y0&&(t=r);return t}function Jn(t,n){return t.x-n.x}function Kn(t,n){return n.x-t.x}function Wn(t,n){return t.depth-n.depth}function Qn(t,n){function e(t,r){var i=t.children;if(i&&(u=i.length))for(var o,u,a=null,l=-1;++l=0;)(n=i[o]._tree).prelim+=e,n.mod+=e,e+=n.shift+(r+=n.change)}function ne(t,n,e){t=t._tree;var r=e/((n=n._tree).number-t.number);t.change+=r,n.change-=r,n.shift+=e,n.prelim+=e,n.mod+=e}function ee(t,n,e){return t._tree.ancestor.parent==n.parent?t._tree.ancestor:e}function re(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function ie(t,n){var e=t.x+n[3],r=t.y+n[0],i=t.dx-n[1]-n[3],o=t.dy-n[0]-n[2];return i<0&&(e+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:e,y:r,dx:i,dy:o}}function oe(t){return t.map(ue).join(",")}function ue(t){return/[",\n]/.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}function ae(t,n){return function(e){return e&&t.hasOwnProperty(e.type)?t[e.type](e):n}}function le(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ce(t,n){Jr.hasOwnProperty(t.type)&&Jr[t.type](t,n)}function fe(t,n){for(var e=t.coordinates,r=0,i=e.length;r0}function ve(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function me(t,n,e,r){var i=t[0],o=n[0],u=e[0],a=r[0],l=t[1],c=n[1],f=e[1],s=o-i,h=a-u,d=c-l,g=r[1]-f,p=(h*(l-f)-g*(i-u))/(g*s-h*d);return[i+p*s,l+p*d]}function ye(t,n){var e={list:t.map(function(t,n){return{index:n,x:t[0],y:t[1]}}).sort(function(t,n){return t.yn.y?1:t.xn.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(t,n){return{edge:t,side:n,vertex:null,l:null,r:null}},insert:function(t,n){n.l=t,n.r=t.r,t.r.l=n,t.r=n},leftBound:function(t){var n=r.leftEnd;do{n=n.r}while(n!=r.rightEnd&&i.rightOf(n,t));return n=n.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?e.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?e.bottomSite:t.edge.region[Qr[t.side]]}},i={bisect:function(t,n){var e={region:{l:t,r:n},ep:{l:null,r:null}},r=n.x-t.x,i=n.y-t.y,o=r>0?r:-r,u=i>0?i:-i;return e.c=t.x*r+t.y*i+.5*(r*r+i*i),o>u?(e.a=1,e.b=i/r,e.c/=r):(e.b=1,e.a=r/i,e.c/=i),e},intersect:function(t,n){var e=t.edge,r=n.edge;if(!e||!r||e.region.r==r.region.r)return null;var i=e.a*r.b-e.b*r.a;if(Math.abs(i)<1e-10)return null;var o,u,a=(e.c*r.b-r.c*e.b)/i,l=(r.c*e.a-e.c*r.a)/i,c=e.region.r,f=r.region.r;c.y=u.region.r.x;return s&&"l"===o.side||!s&&"r"===o.side?null:{x:a,y:l}},rightOf:function(t,n){var e=t.edge,r=e.region.r,i=n.x>r.x;if(i&&"l"===t.side)return 1;if(!i&&"r"===t.side)return 0;if(1===e.a){var o=n.y-r.y,u=n.x-r.x,a=0,l=0;if(!i&&e.b<0||i&&e.b>=0?l=a=o>=e.b*u:(l=n.x+n.y*e.b>e.c,e.b<0&&(l=!l),l||(a=1)),!a){var c=r.x-e.region.l.x;l=e.b*(u*u-o*o)h*h+d*d}return"l"===t.side?l:!l},endPoint:function(t,e,r){t.ep[e]=r,t.ep[Qr[e]]&&n(t)},distance:function(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}},o={list:[],insert:function(t,n,e){t.vertex=n,t.ystar=n.y+e;for(var r=0,i=o.list,u=i.length;ra.ystar||t.ystar==a.ystar&&n.x>a.vertex.x))break}i.splice(r,0,t)},del:function(t){for(var n=0,e=o.list,r=e.length;nd.y&&(g=h,h=d,d=g,y="r"),m=i.bisect(h,d),s=r.createHalfEdge(m,y),r.insert(c,s),i.endPoint(m,Qr[y],v),(p=i.intersect(c,s))&&(o.del(c),o.insert(c,p,i.distance(p,h))),(p=i.intersect(s,f))&&o.insert(s,p,i.distance(p,h))}for(a=r.right(r.leftEnd);a!=r.rightEnd;a=r.right(a))n(a.edge)}function xe(t,n,e,r,i,o){if(!t(n,e,r,i,o)){var u=.5*(e+i),a=.5*(r+o),l=n.nodes;l[0]&&xe(t,l[0],e,r,u,a),l[1]&&xe(t,l[1],u,r,i,a),l[2]&&xe(t,l[2],e,a,u,o),l[3]&&xe(t,l[3],u,a,i,o)}}function be(t){return{x:t[0],y:t[1]}}function Me(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function _e(t,n,e,r){for(var i,o,u=0,a=n.length,l=e.length;u=l)return-1;if(37==(i=n.charCodeAt(u++))){if(!(o=ai[n.charAt(u++)])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function we(){return 1e3*~~((new Date).getFullYear()/1e3)}function ke(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function Ne(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}function Ae(t){return t.toISOString()}function Se(t,n,e){function r(n){var e=t(n),r=o(e,1);return n-e1)for(;un?1:t>=n?0:NaN},d3.descending=function(t,n){return nt?1:n>=t?0:NaN},d3.mean=function(t,n){var e,r=t.length,i=0,o=-1,a=0;if(1===arguments.length)for(;++o1&&(t=t.map(n)),t=t.filter(u),t.length?d3.quantile(t.sort(d3.ascending),.5):void 0},d3.min=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++ir&&(e=r)}else{for(;++ir&&(e=r)}return e},d3.max=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++ie&&(e=r)}else{for(;++ie&&(e=r)}return e},d3.extent=function(t,n){var e,r,i,o=-1,u=t.length;if(1===arguments.length){for(;++or&&(e=r),ir&&(e=r),i1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}}},d3.sum=function(t,n){var e,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o>1;t.call(n,n[o],o)>1;e0&&(o=e);return o},d3.last=function(t,n){var e,r=0,i=t.length,o=t[0];for(1===arguments.length&&(n=d3.ascending);++r=u.length)return i?i.call(o,e):r?e.sort(r):e;for(var l,c,f,s=-1,h=e.length,d=u[a++],g=new t,p={};++s=u.length)return t;var r,i=[],o=a[n++];for(r in t)i.push({key:r,values:e(t[r],n)});return o&&i.sort(function(t,n){return o(t.key,n.key)}),i}var r,i,o={},u=[],a=[];return o.map=function(t){return n(t,0)},o.entries=function(t){return e(n(t,0),0)},o.key=function(t){return u.push(t),o},o.sortKeys=function(t){return a[u.length-1]=t,o},o.sortValues=function(t){return r=t,o},o.rollup=function(t){return i=t,o},o},d3.keys=function(t){var n=[];for(var e in t)n.push(e);return n},d3.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},d3.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},d3.permute=function(t,n){for(var e=[],r=-1,i=n.length;++rn;)i.push(r/o);else for(;(r=t+e*++u)=200&&t<300||304===t?r:null)}},r.send(null)},d3.text=function(t,n,e){arguments.length<3&&(e=n,n=null),d3.xhr(t,n,function(t){e(t&&t.responseText)})},d3.json=function(t,n){d3.text(t,"application/json",function(t){n(t?JSON.parse(t):null)})},d3.html=function(t,n){d3.text(t,"text/html",function(t){if(null!=t){var e=document.createRange();e.selectNode(document.body),t=e.createContextualFragment(t)}n(t)})},d3.xml=function(t,n,e){arguments.length<3&&(e=n,n=null),d3.xhr(t,n,function(t){e(t&&t.responseXML)})};var Ze={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:Ze,qualify:function(t){var n=t.indexOf(":"),e=t;return n>=0&&(e=t.substring(0,n),t=t.substring(n+1)),Ze.hasOwnProperty(e)?{space:Ze[e],local:t}:t}},d3.dispatch=function(){for(var t=new s,n=-1,e=arguments.length;++n0&&(r=t.substring(e+1),t=t.substring(0,e)),arguments.length<2?this[t].on(r):this[t].on(r,n)},d3.format=function(t){var n=Be.exec(t),e=n[1]||" ",r=n[3]||"",i=n[5],o=+n[6],u=n[7],a=n[8],l=n[9],c=1,f="",s=!1;switch(a&&(a=+a.substring(1)),i&&(e="0",u&&(o-=Math.floor((o-1)/4))),l){case"n":u=!0,l="g";break;case"%":c=100,f="%",l="f";break;case"p":c=100,f="%",l="r";break;case"d":s=!0,a=0;break;case"s":c=-1,l="r"}return"r"!=l||a||(l="g"),l=Xe.get(l)||p,function(t){if(s&&t%1)return"";var n=t<0&&(t=-t)?"−":r;if(c<0){var h=d3.formatPrefix(t,a);t*=h.scale,f=h.symbol}else t*=c;if(t=l(t,a),i)(d=t.length+n.length)=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Xe=d3.map({g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return d3.round(t,n=g(t,n)).toFixed(Math.max(0,Math.min(20,n)))}}),$e=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(function(t,n){return{scale:Math.pow(10,3*(8-n)),symbol:t}});d3.formatPrefix=function(t,n){var e=0;return t&&(t<0&&(t*=-1),n&&(t=d3.round(t,g(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e<=0?e+1:e-1)/3)))),$e[8+e/3]};var Ge=M(2),Je=M(3),Ke=function(){return b},We=d3.map({linear:Ke,poly:M,quad:function(){return Ge},cubic:function(){return Je},sin:function(){return _},exp:function(){return w},circle:function(){return k},elastic:function(t,n){var e;return arguments.length<2&&(n=.45),arguments.length<1?(t=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/t),function(r){return 1+t*Math.pow(2,10*-r)*Math.sin(2*(r-e)*Math.PI/n)}},back:function(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}},bounce:function(){return N}}),Qe=d3.map({in:b,out:y,"in-out":x,"out-in":function(t){return x(y(t))}});d3.ease=function(t){var n=t.indexOf("-"),e=n>=0?t.substring(0,n):t,r=n>=0?t.substring(n+1):"in";return e=We.get(e)||Ke,r=Qe.get(r)||b,m(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(t,n){for(var e,r=d3.interpolators.length;--r>=0&&!(e=d3.interpolators[r](t,n)););return e},d3.interpolateNumber=function(t,n){return n-=t,function(e){return t+n*e}},d3.interpolateRound=function(t,n){return n-=t,function(e){return Math.round(t+n*e)}},d3.interpolateString=function(t,n){var e,r,i,o,u,a=0,l=[],c=[];for(tr.lastIndex=0,r=0;e=tr.exec(n);++r)e.index&&l.push(n.substring(a,e.index)),c.push({i:l.length,x:e[0]}),l.push(null),a=tr.lastIndex;for(a1){for(;++i=0;)(e=r[i])&&(o&&o!==e.nextSibling&&o.parentNode.insertBefore(e,o),o=e);return this},ar.sort=function(t){t=X.apply(this,arguments);for(var n=-1,e=this.length;++n0&&(t=t.substring(0,i)),arguments.length<2?(i=this.node()[r])&&i._:this.each(function(i,o){function u(t){var e=d3.event;d3.event=t;try{n.call(a,a.__data__,o)}finally{d3.event=e}}var a=this,l=a[r];l&&(a.removeEventListener(t,l,l.$),delete a[r]),n&&(a.addEventListener(t,a[r]=u,u.$=e),u._=n)})},ar.each=function(t){for(var n=-1,e=this.length;++n=zr?t?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":t?"M"+i*f+","+i*s+"A"+i+","+i+" 0 "+c+",1 "+i*h+","+i*d+"L"+t*h+","+t*d+"A"+t+","+t+" 0 "+c+",0 "+t*f+","+t*s+"Z":"M"+i*f+","+i*s+"A"+i+","+i+" 0 "+c+",1 "+i*h+","+i*d+"L0,0Z"}var n=St,e=Tt,r=Ct,o=zt;return t.innerRadius=function(e){return arguments.length?(n=i(e),t):n},t.outerRadius=function(n){return arguments.length?(e=i(n),t):e},t.startAngle=function(n){return arguments.length?(r=i(n),t):r},t.endAngle=function(n){return arguments.length?(o=i(n),t):o},t.centroid=function(){var t=(n.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+o.apply(this,arguments))/2+Cr;return[Math.cos(i)*t,Math.sin(i)*t]},t};var Cr=-Math.PI/2,zr=2*Math.PI-1e-6;d3.svg.line=function(){return qt(n)};var qr="linear",Dr=d3.map({linear:Pt,"step-before":Ft,"step-after":Lt,basis:It,"basis-open":function(t){if(t.length<4)return Pt(t);for(var n,e=[],r=-1,i=t.length,o=[0],u=[0];++r<3;)n=t[r],o.push(n[0]),u.push(n[1]);for(e.push(Ot(Fr,o)+","+Ot(Fr,u)),--r;++rMath.PI)+",1 "+n}function o(t,n,e,r){return"Q 0,0 "+r}var u=Xt,a=$t,l=Gt,c=Ct,f=zt;return t.radius=function(n){return arguments.length?(l=i(n),t):l},t.source=function(n){return arguments.length?(u=i(n),t):u},t.target=function(n){return arguments.length?(a=i(n),t):a},t.startAngle=function(n){return arguments.length?(c=i(n),t):c},t.endAngle=function(n){return arguments.length?(f=i(n),t):f},t},d3.svg.diagonal=function(){function t(t,i){var o=n.call(this,t,i),u=e.call(this,t,i),a=(o.y+u.y)/2,l=[o,{x:o.x,y:a},{x:u.x,y:a},u];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var n=Xt,e=$t,r=Jt;return t.source=function(e){return arguments.length?(n=i(e),t):n},t.target=function(n){return arguments.length?(e=i(n),t):e},t.projection=function(n){return arguments.length?(r=n,t):r},t},d3.svg.diagonal.radial=function(){var t=d3.svg.diagonal(),n=Jt,e=t.projection;return t.projection=function(t){return arguments.length?e(Kt(n=t)):n},t},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function t(t,r){return(Lr.get(n.call(this,t,r))||tn)(e.call(this,t,r))}var n=Qt,e=Wt;return t.type=function(e){return arguments.length?(n=i(e),t):n},t.size=function(n){return arguments.length?(e=i(n),t):e},t};var Lr=d3.map({circle:tn,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*Hr)),e=n*Hr;return"M0,"+-n+"L"+e+",0 0,"+n+" "+-e+",0Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/jr),e=n*jr/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/jr),e=n*jr/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});d3.svg.symbolTypes=Lr.keys();var jr=Math.sqrt(3),Hr=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function t(t){t.each(function(){var t,s=d3.select(this),h=null==c?e.ticks?e.ticks.apply(e,l):e.domain():c,d=null==n?e.tickFormat?e.tickFormat.apply(e,l):String:n,g=rn(e,h,f),p=s.selectAll(".minor").data(g,String),v=p.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),m=d3.transition(p.exit()).style("opacity",1e-6).remove(),y=d3.transition(p).style("opacity",1),x=s.selectAll("g").data(h,String),b=x.enter().insert("g","path").style("opacity",1e-6),M=d3.transition(x.exit()).style("opacity",1e-6).remove(),_=d3.transition(x).style("opacity",1),w=at(e),k=s.selectAll(".domain").data([0]),N=(k.enter().append("path").attr("class","domain"),d3.transition(k)),A=e.copy(),S=this.__chart__||A;switch(this.__chart__=A,b.append("line").attr("class","tick"),b.append("text"),_.select("text").text(d),r){case"bottom":t=nn,v.attr("y2",o),y.attr("x2",0).attr("y2",o),b.select("line").attr("y2",i),b.select("text").attr("y",Math.max(i,0)+a),_.select("line").attr("x2",0).attr("y2",i),_.select("text").attr("x",0).attr("y",Math.max(i,0)+a).attr("dy",".71em").attr("text-anchor","middle"),N.attr("d","M"+w[0]+","+u+"V0H"+w[1]+"V"+u);break;case"top":t=nn,v.attr("y2",-o),y.attr("x2",0).attr("y2",-o),b.select("line").attr("y2",-i),b.select("text").attr("y",-(Math.max(i,0)+a)),_.select("line").attr("x2",0).attr("y2",-i),_.select("text").attr("x",0).attr("y",-(Math.max(i,0)+a)).attr("dy","0em").attr("text-anchor","middle"),N.attr("d","M"+w[0]+","+-u+"V0H"+w[1]+"V"+-u);break;case"left":t=en,v.attr("x2",-o),y.attr("x2",-o).attr("y2",0),b.select("line").attr("x2",-i),b.select("text").attr("x",-(Math.max(i,0)+a)),_.select("line").attr("x2",-i).attr("y2",0),_.select("text").attr("x",-(Math.max(i,0)+a)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),N.attr("d","M"+-u+","+w[0]+"H0V"+w[1]+"H"+-u);break;case"right":t=en,v.attr("x2",o),y.attr("x2",o).attr("y2",0),b.select("line").attr("x2",i),b.select("text").attr("x",Math.max(i,0)+a),_.select("line").attr("x2",i).attr("y2",0),_.select("text").attr("x",Math.max(i,0)+a).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),N.attr("d","M"+u+","+w[0]+"H0V"+w[1]+"H"+u)}if(e.ticks)b.call(t,S),_.call(t,A),M.call(t,A),v.call(t,S),y.call(t,A),m.call(t,A);else{var T=A.rangeBand()/2,C=function(t){return A(t)+T};b.call(t,C),_.call(t,C)}})}var n,e=d3.scale.linear(),r="bottom",i=6,o=6,u=6,a=3,l=[10],c=null,f=0;return t.scale=function(n){return arguments.length?(e=n,t):e},t.orient=function(n){return arguments.length?(r=n,t):r},t.ticks=function(){return arguments.length?(l=arguments,t):l},t.tickValues=function(n){return arguments.length?(c=n,t):c},t.tickFormat=function(e){return arguments.length?(n=e,t):n},t.tickSize=function(n,e,r){if(!arguments.length)return i;var a=arguments.length-1;return i=+n,o=a>1?+e:i,u=a>0?+arguments[a]:i,t},t.tickPadding=function(n){return arguments.length?(a=+n,t):a},t.tickSubdivide=function(n){return arguments.length?(f=+n,t):f},t},d3.svg.brush=function(){function t(o){o.each(function(){var o,u=d3.select(this),f=u.selectAll(".background").data([0]),s=u.selectAll(".extent").data([0]),h=u.selectAll(".resize").data(c,String);u.style("pointer-events","all").on("mousedown.brush",i).on("touchstart.brush",i),f.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),s.enter().append("rect").attr("class","extent").style("cursor","move"),h.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ir[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",t.empty()?"none":null),h.exit().remove(),a&&(o=at(a),f.attr("x",o[0]).attr("width",o[1]-o[0]),e(u)),l&&(o=at(l),f.attr("y",o[0]).attr("height",o[1]-o[0]),r(u)),n(u)})}function n(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)][0]+","+f[+/^s/.test(t)][1]+")"})}function e(t){t.select(".extent").attr("x",f[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1][0]-f[0][0])}function r(t){t.select(".extent").attr("y",f[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1][1]-f[0][1])}function i(){function i(){var t=d3.event.changedTouches;return t?d3.touches(p,t)[0]:d3.mouse(p)}function c(){var t=i(),o=!1;g&&(t[0]+=g[0],t[1]+=g[1]),_||(d3.event.altKey?(d||(d=[(f[0][0]+f[1][0])/2,(f[0][1]+f[1][1])/2]),w[0]=f[+(t[0]0?t:0:t>0&&(f.start({type:"start",alpha:o=t}),d3.timer(c.tick)),c):o},c.start=function(){function t(t,e){for(var r,i=n(),o=-1,u=i.length;++oa&&(a=r),u.push(r)}for(e=0;e0)for(i=-1;++i=f[0]&&a<=f[1]&&((u=l[d3.bisect(s,a,1,d)-1]).y+=g,u.push(t[i]));return l}var n=!0,e=Number,r=An,o=kn;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=i(n),t):r},t.bins=function(n){return arguments.length?(o="number"==typeof n?function(t){return Nn(t,n)}:i(n),t):o},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},d3.layout.hierarchy=function(){function t(n,u,a){var l=i.call(e,n,u),c=$r?n:{data:n};if(c.depth=u,a.push(c),l&&(f=l.length)){for(var f,s=-1,h=c.children=[],g=0,p=u+1;++s0&&(ne(ee(a,t,r),t,i),c+=i,f+=i),s+=a._tree.mod,c+=o._tree.mod,h+=l._tree.mod,f+=u._tree.mod;a&&!$n(u)&&(u._tree.thread=a,u._tree.mod+=s-f),o&&!Xn(l)&&(l._tree.thread=o,l._tree.mod+=c-h,r=t)}return r}var l=n.call(this,t,i),c=l[0];Qn(c,function(t,n){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:n?n._tree.number+1:0}}),o(c),u(c,-c._tree.prelim);var f=Gn(c,Kn),s=Gn(c,Jn),h=Gn(c,Wn),d=f.x-e(f,s)/2,g=s.x+e(s,f)/2,p=h.depth||1;return Qn(c,function(t){t.x=(t.x-d)/(g-d)*r[0],t.y=t.depth/p*r[1],delete t._tree}),l}var n=d3.layout.hierarchy().sort(null).value(null),e=Bn,r=[1,1];return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(r=n,t):r},Sn(t,n)},d3.layout.treemap=function(){function t(t,n){for(var e,r,i=-1,o=t.length;++i0;)f.push(u=h[l-1]),f.area+=u.area,(a=r(f,g))<=d?(h.pop(),d=a):(f.area-=f.pop().area,i(f,g,c,!1),g=Math.min(c.dx,c.dy),f.length=f.area=0,d=1/0);f.length&&(i(f,g,c,!0),f.length=f.area=0),o.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var o,u=s(n),a=r.slice(),l=[];for(t(a,u.dx*u.dy/n.value),l.area=0;o=a.pop();)l.push(o),l.area+=o.area,null!=o.z&&(i(l,o.z?u.dx:u.dy,u,!a.length),l.length=l.area=0);r.forEach(e)}}function r(t,n){for(var e,r=t.area,i=0,o=1/0,u=-1,a=t.length;++ui&&(i=e));return r*=r,n*=n,r?Math.max(n*i*d/r,r/(n*o*d)):1/0}function i(t,n,e,r){var i,o=-1,u=t.length,a=e.x,c=e.y,f=n?l(t.area/n):0;if(n==e.dx){for((r||f>e.dy)&&(f=e.dy);++oe.dx)&&(f=e.dx);++o=t.length)return u;if(i)return i=!1,o;var n=l.lastIndex;if(34===t.charCodeAt(n)){for(var e=n;e++50?e:o<-140?r:u<21?i:n)(t)}var n=d3.geo.albers(),e=d3.geo.albers().origin([-160,60]).parallels([55,65]),r=d3.geo.albers().origin([-160,20]).parallels([8,18]),i=d3.geo.albers().origin([-60,10]).parallels([8,18]);return t.scale=function(o){return arguments.length?(n.scale(o),e.scale(.6*o),r.scale(o),i.scale(1.5*o),t.translate(n.translate())):n.scale()},t.translate=function(o){if(!arguments.length)return n.translate();var u=n.scale()/1e3,a=o[0],l=o[1];return n.translate(o),e.translate([a-400*u,l+170*u]),r.translate([a-190*u,l+200*u]),i.translate([a+580*u,l+430*u]),t},t.scale(n.scale())},d3.geo.bonne=function(){function t(t){var a=t[0]*Gr-n,l=t[1]*Gr-e;if(r){var c=i+r-l,f=a*Math.cos(l)/c;a=c*Math.sin(f),l=c*Math.cos(f)-i}else a*=Math.cos(l),l*=-1;return[o*a+u[0],o*l+u[1]]}var n,e,r,i,o=200,u=[480,250];return t.invert=function(t){var e=(t[0]-u[0])/o,a=(t[1]-u[1])/o;if(r){var l=i+a,c=Math.sqrt(e*e+l*l);a=i+r-c,e=n+c*Math.atan2(e,l)/Math.cos(a)}else a*=-1,e/=Math.cos(a);return[e/Gr,a/Gr]},t.parallel=function(n){return arguments.length?(i=1/Math.tan(r=n*Gr),t):r/Gr},t.origin=function(r){return arguments.length?(n=r[0]*Gr,e=r[1]*Gr,t):[n/Gr,e/Gr]},t.scale=function(n){return arguments.length?(o=+n,t):o},t.translate=function(n){return arguments.length?(u=[+n[0],+n[1]],t):u},t.origin([0,0]).parallel(45)},d3.geo.equirectangular=function(){function t(t){var r=t[0]/360,i=-t[1]/360;return[n*r+e[0],n*i+e[1]]}var n=500,e=[480,250];return t.invert=function(t){return[360*((t[0]-e[0])/n),-360*((t[1]-e[1])/n)]},t.scale=function(e){return arguments.length?(n=+e,t):n},t.translate=function(n){return arguments.length?(e=[+n[0],+n[1]],t):e},t},d3.geo.mercator=function(){function t(t){var r=t[0]/360,i=-Math.log(Math.tan(Math.PI/4+t[1]*Gr/2))/Gr/360;return[n*r+e[0],n*Math.max(-.5,Math.min(.5,i))+e[1]]}var n=500,e=[480,250];return t.invert=function(t){var r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return[360*r,2*Math.atan(Math.exp(-360*i*Gr))/Gr-90]},t.scale=function(e){return arguments.length?(n=+e,t):n},t.translate=function(n){return arguments.length?(e=[+n[0],+n[1]],t):e},t},d3.geo.path=function(){function t(t,n){return"function"==typeof o&&(u=le(o.apply(this,arguments))),l(t)||null}function n(t){return a(t).join(",")}function e(t){for(var n=i(t[0]),e=0,r=t.length;++e0){for(o.push("M");++r0){for(l.push("M");++ur&&(r=t),oi&&(i=o)}),[[n,e],[r,i]]};var Jr={Feature:function(t,n){ce(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=0,i=e.length;r=(o=t[e][0]-t[p][0])*o+(u=t[e][1]-t[p][1])*u?d[n].index=-1:(d[a].index=-1,c=d[n].angle,a=n,l=e):(c=d[n].angle,a=n,l=e);for(g.push(p),n=0,e=0;n<2;++e)-1!==d[e].index&&(g.push(d[e].index),n++);for(f=g.length;e=0?(e=t.ep.r,r=t.ep.l):(e=t.ep.l,r=t.ep.r),1===t.a?(u=e?e.y:-1e6,i=t.c-t.b*u,a=r?r.y:1e6,o=t.c-t.b*a):(i=e?e.x:-1e6,u=t.c-t.a*i,o=r?r.x:1e6,a=t.c-t.a*o);var l=[i,u],c=[o,a];n[t.region.l.index].push(l,c),n[t.region.r.index].push(l,c)}),n.map(function(n,e){var r=t[e][0],i=t[e][1];return n.forEach(function(t){t.angle=Math.atan2(t[0]-r,t[1]-i)}),n.sort(function(t,n){return t.angle-n.angle}).filter(function(t,e){return!e||t.angle-n[e-1].angle>1e-10})})};var Qr={l:"r",r:"l"};d3.geom.delaunay=function(t){var n=t.map(function(){return[]}),e=[];return ye(t,function(e){n[e.region.l.index].push(t[e.region.r.index])}),n.forEach(function(n,r){var i=t[r],o=i[0],u=i[1];n.forEach(function(t){t.angle=Math.atan2(t[0]-o,t[1]-u)}),n.sort(function(t,n){return t.angle-n.angle});for(var a=0,l=n.length-1;a=a,f=n.y>=l,s=(f<<1)+c;t.leaf=!1,t=t.nodes[s]||(t.nodes[s]={leaf:!0,nodes:[],point:null}),c?e=a:i=a,f?r=l:u=l,o(t,n,e,r,i,u)}var a,l=-1,c=t.length;if(c&&isNaN(t[0].x)&&(t=t.map(be)),arguments.length<5)if(3===arguments.length)i=r=e,e=n;else{for(n=e=1/0,r=i=-1/0;++lr&&(r=a.x),a.y>i&&(i=a.y);var f=r-n,s=i-e;f>s?i=e+f:r=n+s}var h={leaf:!0,nodes:[],point:null};return h.add=function(t){o(h,t,n,e,r,i)},h.visit=function(t){xe(t,h,n,e,r,i)},t.forEach(h.add),h},d3.time={};var ti=Date;Me.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(){ni.setUTCDate.apply(this._,arguments)},setDay:function(){ni.setUTCDay.apply(this._,arguments)},setFullYear:function(){ni.setUTCFullYear.apply(this._,arguments)},setHours:function(){ni.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ni.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ni.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ni.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ni.setUTCSeconds.apply(this._,arguments)},setTime:function(){ni.setTime.apply(this._,arguments)}};var ni=Date.prototype;d3.time.format=function(t){function n(n){for(var r,i,o=[],u=-1,a=0;++u=12?"PM":"AM"},S:function(t){return ei(t.getSeconds())},U:function(t){return ei(d3.time.sundayOfYear(t))},w:function(t){return t.getDay()},W:function(t){return ei(d3.time.mondayOfYear(t))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(t){return ei(t.getFullYear()%100)},Y:function(t){return ii(t.getFullYear()%1e4)},Z:function(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+ei(r)+ei(i)},"%":function(t){return"%"}},ai={a:function(t,n,e){return li.test(n.substring(e,e+=3))?e:-1},A:function(t,n,e){ci.lastIndex=0;var r=ci.exec(n.substring(e,e+10));return r?e+=r[0].length:-1},b:function(t,n,e){var r=si.get(n.substring(e,e+=3).toLowerCase());return null==r?-1:(t.m=r,e)},B:function(t,n,e){hi.lastIndex=0;var r=hi.exec(n.substring(e,e+12));return r?(t.m=di.get(r[0].toLowerCase()),e+=r[0].length):-1},c:function(t,n,e){return _e(t,ui.c.toString(),n,e)},d:ke,e:ke,H:Ne,I:Ne,L:function(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1},m:function(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1},M:function(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1},p:function(t,n,e){var r=vi.get(n.substring(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)},S:function(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1},x:function(t,n,e){return _e(t,ui.x.toString(),n,e)},X:function(t,n,e){return _e(t,ui.X.toString(),n,e)},y:function(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+2));return r?(t.y=we()+ +r[0],e+=r[0].length):-1},Y:function(t,n,e){pi.lastIndex=0;var r=pi.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}},li=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,ci=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i,fi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],si=d3.map({jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11}),hi=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/gi,di=d3.map({january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11}),gi=["January","February","March","April","May","June","July","August","September","October","November","December"],pi=/\s*\d+/,vi=d3.map({am:0,pm:1});d3.time.format.utc=function(t){function n(t){try{var n=new(ti=Me);return n._=t,e(n)}finally{ti=Date}}var e=d3.time.format(t);return n.parse=function(t){try{ti=Me;var n=e.parse(t);return n&&n._}finally{ti=Date}},n.toString=e.toString,n};var mi=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?Ae:mi,Ae.parse=function(t){return new Date(t)},Ae.toString=mi.toString,d3.time.second=Se(function(t){return new ti(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=Se(function(t){return new ti(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=Se(function(t){var n=t.getTimezoneOffset()/60;return new ti(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=Se(function(t){return new ti(t.getFullYear(),t.getMonth(),t.getDate())},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(t){var n=d3.time.year(t);return Math.floor((t-n)/864e5-(t.getTimezoneOffset()-n.getTimezoneOffset())/1440)},fi.forEach(function(t,n){t=t.toLowerCase(),n=7-n;var e=d3.time[t]=Se(function(t){return(t=d3.time.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var e=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});d3.time[t+"s"]=e.range,d3.time[t+"s"].utc=e.utc.range,d3.time[t+"OfYear"]=function(t){var e=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(e+n)%7)/7)}}),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=Se(function(t){return new ti(t.getFullYear(),t.getMonth(),1)},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=Se(function(t){return new ti(t.getFullYear(),0,1)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var yi=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],xi=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],bi=[[d3.time.format("%Y"),function(t){return!0}],[d3.time.format("%B"),function(t){return t.getMonth()}],[d3.time.format("%b %d"),function(t){return 1!=t.getDate()}],[d3.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[d3.time.format("%I %p"),function(t){return t.getHours()}],[d3.time.format("%I:%M"),function(t){return t.getMinutes()}],[d3.time.format(":%S"),function(t){return t.getSeconds()}],[d3.time.format(".%L"),function(t){return t.getMilliseconds()}]],Mi=d3.scale.linear(),_i=De(bi);xi.year=function(t,n){return Mi.domain(t.map(Pe)).ticks(n).map(Ee)},d3.time.scale=function(){return Ce(d3.scale.linear(),xi,_i)};var wi=xi.map(function(t){return[t[0].utc,t[1]]}),ki=De([[d3.time.format.utc("%Y"),function(t){return!0}],[d3.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[d3.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[d3.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]]);wi.year=function(t,n){return Mi.domain(t.map(Le)).ticks(n).map(Fe)},d3.time.scale.utc=function(){return Ce(d3.scale.linear(),wi,ki)}}();