UNPKG

d3-er

Version:

Custom d3 module created using some d3 modules and custom functions

2 lines 96.5 kB
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("d3",["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t){return function(n,e){return Vr(t(n),e)}}function e(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=oi?i*=10:a>=ui?i*=5:a>=ci&&(i*=2),n<t?-i:i}function r(t){return t.length}function i(t,n,e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"}function a(t,n,e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"}function o(t){var n=t.bandwidth()/2;return t.round()&&(n=Math.round(n)),function(e){return t(e)+n}}function u(){return!this.__axis}function c(t,n){function e(e){var d,p=null==c?n.ticks?n.ticks.apply(n,r):n.domain():c,g=null==f?n.tickFormat?n.tickFormat.apply(n,r):Ci:f,m=Math.max(l,0)+h,y=t===Si||t===Ui?i:a,v=n.range(),b=v[0]+.5,_=v[v.length-1]+.5,w=(n.bandwidth?o:Ci)(n.copy()),x=e.selection?e.selection():e,M=x.selectAll(".domain").data([null]),k=x.selectAll(".tick").data(p,n).order(),T=k.exit(),A=k.enter().append("g").attr("class","tick"),N=k.select("line"),C=k.select("text"),S=t===Si||t===Ei?-1:1,D=t===Ei||t===Di?(d="x","y"):(d="y","x");M=M.merge(M.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),k=k.merge(A),N=N.merge(A.append("line").attr("stroke","#000").attr(d+"2",S*l).attr(D+"1",.5).attr(D+"2",.5)),C=C.merge(A.append("text").attr("fill","#000").attr(d,S*m).attr(D,.5).attr("dy",t===Si?"0em":t===Ui?"0.71em":"0.32em")),e!==x&&(M=M.transition(e),k=k.transition(e),N=N.transition(e),C=C.transition(e),T=T.transition(e).attr("opacity",Fi).attr("transform",function(t){return y(w,this.parentNode.__axis||w,t)}),A.attr("opacity",Fi).attr("transform",function(t){return y(this.parentNode.__axis||w,w,t)})),T.remove(),M.attr("d",t===Ei||t==Di?"M"+S*s+","+b+"H0.5V"+_+"H"+S*s:"M"+b+","+S*s+"V0.5H"+_+"V"+S*s),k.attr("opacity",1).attr("transform",function(t){return y(w,w,t)}),N.attr(d+"2",S*l),C.attr(d,S*m).text(g),x.filter(u).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Di?"start":t===Ei?"end":"middle"),x.each(function(){this.__axis=w})}var r=[],c=null,f=null,l=6,s=6,h=3;return e.scale=function(t){return arguments.length?(n=t,e):n},e.ticks=function(){return r=Ni.call(arguments),e},e.tickArguments=function(t){return arguments.length?(r=null==t?[]:Ni.call(t),e):r.slice()},e.tickValues=function(t){return arguments.length?(c=null==t?null:Ni.call(t),e):c&&c.slice()},e.tickFormat=function(t){return arguments.length?(f=t,e):f},e.tickSize=function(t){return arguments.length?(l=s=+t,e):l},e.tickSizeInner=function(t){return arguments.length?(l=+t,e):l},e.tickSizeOuter=function(t){return arguments.length?(s=+t,e):s},e.tickPadding=function(t){return arguments.length?(h=+t,e):h},e}function f(t){return c(Si,t)}function l(t){return c(Di,t)}function s(t){return c(Ui,t)}function h(t){return c(Ei,t)}function d(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Pi&&n.documentElement.namespaceURI===Pi?n.createElement(t):n.createElementNS(e,t)}}function p(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function g(){return new m}function m(){this._="@"+(++Oi).toString(36)}function y(t,n,e){return t=v(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function v(n,e,r){return function(i){var a=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=a}}}function b(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function _(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,a=n.length;r<a;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function w(t,n,e){var r=ji.hasOwnProperty(t.type)?y:v;return function(i,a,o){var u,c=this.__on,f=r(n,a,o);if(c)for(var l=0,s=c.length;l<s;++l)if((u=c[l]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=f,u.capture=e),void(u.value=n);this.addEventListener(t.type,f,e),u={type:t.type,name:t.name,value:n,listener:f,capture:e},c?c.push(u):this.__on=[u]}}function x(n,e,r,i){var a=t.event;n.sourceEvent=t.event,t.event=n;try{return e.apply(r,i)}finally{t.event=a}}function M(){}function k(){return[]}function T(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function A(t,n,e,r,i,a){for(var o,u=0,c=n.length,f=a.length;u<f;++u)(o=n[u])?(o.__data__=a[u],r[u]=o):e[u]=new T(t,a[u]);for(;u<c;++u)(o=n[u])&&(i[u]=o)}function N(t,n,e,r,i,a,o){var u,c,f,l={},s=n.length,h=a.length,d=new Array(s);for(u=0;u<s;++u)(c=n[u])&&(d[u]=f=ra+o.call(c,c.__data__,u,n),f in l?i[u]=c:l[f]=c);for(u=0;u<h;++u)f=ra+o.call(t,a[u],u,a),(c=l[f])?(r[u]=c,c.__data__=a[u],l[f]=null):e[u]=new T(t,a[u]);for(u=0;u<s;++u)(c=n[u])&&l[d[u]]===c&&(i[u]=c)}function C(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function S(t){return function(){this.removeAttribute(t)}}function D(t){return function(){this.removeAttributeNS(t.space,t.local)}}function U(t,n){return function(){this.setAttribute(t,n)}}function E(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function F(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function P(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Y(t){return function(){this.style.removeProperty(t)}}function L(t,n,e){return function(){this.style.setProperty(t,n,e)}}function H(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function O(t){return function(){delete this[t]}}function z(t,n){return function(){this[t]=n}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function I(t){return t.trim().split(/^|\s+/)}function X(t){return t.classList||new j(t)}function j(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function V(t,n){for(var e=X(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function R(t,n){for(var e=X(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function $(t){return function(){V(this,t)}}function Z(t){return function(){R(this,t)}}function B(t,n){return function(){(n.apply(this,arguments)?V:R)(this,t)}}function W(){this.textContent=""}function J(t){return function(){this.textContent=t}}function G(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function Q(){this.innerHTML=""}function K(t){return function(){this.innerHTML=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function nt(){this.nextSibling&&this.parentNode.appendChild(this)}function et(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rt(){return null}function it(){var t=this.parentNode;t&&t.removeChild(this)}function at(t,n,e){var r=ma(t),i=r.CustomEvent;i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function ot(t,n){return function(){return at(this,t,n)}}function ut(t,n){return function(){return at(this,t,n.apply(this,arguments))}}function ct(t,n){this._groups=t,this._parents=n}function ft(){return new ct([[document.documentElement]],Sa)}function lt(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new st(r)}function st(t){this._=t}function ht(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function dt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function pt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=Pa,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function gt(){return Xa||(Ra(mt),Xa=Va.now()+ja)}function mt(){Xa=0}function yt(){this._call=this._time=this._next=null}function vt(t,n,e){var r=new yt;return r.restart(t,n,e),r}function bt(){gt(),++Ha;for(var t,n=Ya;n;)(t=Xa-n._time)>=0&&n._call.call(null,t),n=n._next;--Ha}function _t(){Xa=(Ia=Va.now())+ja,Ha=Oa=0;try{bt()}finally{Ha=0,xt(),Xa=0}}function wt(){var t=Va.now(),n=t-Ia;n>qa&&(ja-=n,Ia=t)}function xt(){for(var t,n,e=Ya,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ya=n);La=t,Mt(r)}function Mt(t){if(!Ha){Oa&&(Oa=clearTimeout(Oa));var n=t-Xa;n>24?(t<1/0&&(Oa=setTimeout(_t,n)),za&&(za=clearInterval(za))):(za||(za=setInterval(wt,qa)),Ha=1,Ra(_t))}}function kt(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Ja)throw new Error("too late");return e}function Tt(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Qa)throw new Error("too late");return e}function At(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function Nt(t,n,e){function r(t){e.state=Ga,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var f,l,s,h;if(e.state!==Ga)return o();for(f in c)if(h=c[f],h.name===e.name){if(h.state===Ka)return $a(i);h.state===to?(h.state=eo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete c[f]):+f<n&&(h.state=eo,h.timer.stop(),delete c[f])}if($a(function(){e.state===Ka&&(e.state=to,e.timer.restart(a,e.delay,e.time),a(r))}),e.state=Qa,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Qa){for(e.state=Ka,u=new Array(s=e.tween.length),f=0,l=-1;f<s;++f)(h=e.tween[f].value.call(t,t.__data__,e.index,e.group))&&(u[++l]=h);u.length=l+1}}function a(n){for(var r=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(o),e.state=no,1),i=-1,a=u.length;++i<a;)u[i].call(null,r);e.state===no&&(e.on.call("end",t,t.__data__,e.index,e.group),o())}function o(){e.state=eo,e.timer.stop(),delete c[n];for(var r in c)return;delete t.__transition}var u,c=t.__transition;c[n]=e,e.timer=vt(r,0,e.time)}function Ct(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function St(){}function Dt(t){var n;return t=(t+"").trim().toLowerCase(),(n=ho.exec(t))?(n=parseInt(n[1],16),new Yt(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=po.exec(t))?Ut(parseInt(n[1],16)):(n=go.exec(t))?new Yt(n[1],n[2],n[3],1):(n=mo.exec(t))?new Yt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=yo.exec(t))?Et(n[1],n[2],n[3],n[4]):(n=vo.exec(t))?Et(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=bo.exec(t))?Lt(n[1],n[2]/100,n[3]/100,1):(n=_o.exec(t))?Lt(n[1],n[2]/100,n[3]/100,n[4]):wo.hasOwnProperty(t)?Ut(wo[t]):"transparent"===t?new Yt(NaN,NaN,NaN,0):null}function Ut(t){return new Yt(t>>16&255,t>>8&255,255&t,1)}function Et(t,n,e,r){return r<=0&&(t=n=e=NaN),new Yt(t,n,e,r)}function Ft(t){return t instanceof St||(t=Dt(t)),t?(t=t.rgb(),new Yt(t.r,t.g,t.b,t.opacity)):new Yt}function Pt(t,n,e,r){return 1===arguments.length?Ft(t):new Yt(t,n,e,null==r?1:r)}function Yt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Lt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new zt(t,n,e,r)}function Ht(t){if(t instanceof zt)return new zt(t.h,t.s,t.l,t.opacity);if(t instanceof St||(t=Dt(t)),!t)return new zt;if(t instanceof zt)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),a=Math.max(n,e,r),o=NaN,u=a-i,c=(a+i)/2;return u?(o=n===a?(e-r)/u+6*(e<r):e===a?(r-n)/u+2:(n-e)/u+4,u/=c<.5?a+i:2-a-i,o*=60):u=c>0&&c<1?0:o,new zt(o,u,c,t.opacity)}function Ot(t,n,e,r){return 1===arguments.length?Ht(t):new zt(t,n,e,null==r?1:r)}function zt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function qt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function It(t){if(t instanceof jt)return new jt(t.l,t.a,t.b,t.opacity);if(t instanceof Jt){var n=t.h*xo;return new jt(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Yt||(t=Ft(t));var e=Zt(t.r),r=Zt(t.g),i=Zt(t.b),a=Vt((.4124564*e+.3575761*r+.1804375*i)/To),o=Vt((.2126729*e+.7151522*r+.072175*i)/Ao),u=Vt((.0193339*e+.119192*r+.9503041*i)/No);return new jt(116*o-16,500*(a-o),200*(o-u),t.opacity)}function Xt(t,n,e,r){return 1===arguments.length?It(t):new jt(t,n,e,null==r?1:r)}function jt(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Vt(t){return t>Uo?Math.pow(t,1/3):t/Do+Co}function Rt(t){return t>So?t*t*t:Do*(t-Co)}function $t(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Bt(t){if(t instanceof Jt)return new Jt(t.h,t.c,t.l,t.opacity);t instanceof jt||(t=It(t));var n=Math.atan2(t.b,t.a)*Mo;return new Jt(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Wt(t,n,e,r){return 1===arguments.length?Bt(t):new Jt(t,n,e,null==r?1:r)}function Jt(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Gt(t){if(t instanceof Kt)return new Kt(t.h,t.s,t.l,t.opacity);t instanceof Yt||(t=Ft(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(zo*r+Ho*n-Oo*e)/(zo+Ho-Oo),a=r-i,o=(Lo*(e-i)-Po*a)/Yo,u=Math.sqrt(o*o+a*a)/(Lo*i*(1-i)),c=u?Math.atan2(o,a)*Mo-120:NaN;return new Kt(c<0?c+360:c,u,i,t.opacity)}function Qt(t,n,e,r){return 1===arguments.length?Gt(t):new Kt(t,n,e,null==r?1:r)}function Kt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function tn(t,n){return function(e){return t+e*n}}function nn(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function en(t,n){var e=n-t;return e?tn(t,e>180||e<-180?e-360*Math.round(e/360):e):Vo(isNaN(t)?n:t)}function rn(t){return 1===(t=+t)?an:function(n,e){return e-n?nn(n,e,t):Vo(isNaN(n)?e:n)}}function an(t,n){var e=n-t;return e?tn(t,e):Vo(isNaN(t)?n:t)}function on(t){return function(){return t}}function un(t){return function(n){return t(n)+""}}function cn(t){return"none"===t?eu:(qo||(qo=document.createElement("DIV"),Io=document.documentElement,Xo=document.defaultView),qo.style.transform=t,t=Xo.getComputedStyle(Io.appendChild(qo),null).getPropertyValue("transform"),Io.removeChild(qo),t=t.slice(7,-1).split(","),ru(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function fn(t){return null==t?eu:(jo||(jo=document.createElementNS("http://www.w3.org/2000/svg","g")),jo.setAttribute("transform",t),(t=jo.transform.baseVal.consolidate())?(t=t.matrix,ru(t.a,t.b,t.c,t.d,t.e,t.f)):eu)}function ln(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function a(t,r,i,a,o,u){if(t!==i||r!==a){var c=o.push("translate(",null,n,null,e);u.push({i:c-4,x:Bo(t,i)},{i:c-2,x:Bo(r,a)})}else(i||a)&&o.push("translate("+i+n+a+e)}function o(t,n,e,a){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),a.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Bo(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function u(t,n,e,a){t!==n?a.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Bo(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function c(t,n,e,r,a,o){if(t!==e||n!==r){var u=a.push(i(a)+"scale(",null,",",null,")");o.push({i:u-4,x:Bo(t,e)},{i:u-2,x:Bo(n,r)})}else 1===e&&1===r||a.push(i(a)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),a(n.translateX,n.translateY,e.translateX,e.translateY,r,i),o(n.rotate,e.rotate,r,i),u(n.skewX,e.skewX,r,i),c(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,a=i.length;++e<a;)r[(n=i[e]).i]=n.x(t);return r.join("")}}}function sn(t){return function n(e){function r(n,r){var i=t((n=Qt(n)).h,(r=Qt(r)).h),a=an(n.s,r.s),o=an(n.l,r.l),u=an(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=a(t),n.l=o(Math.pow(t,e)),n.opacity=u(t),n+""}}return e=+e,r.gamma=n,r}(1)}function hn(t,n){var e,r;return function(){var i=Tt(this,t),a=i.tween;if(a!==e){r=e=a;for(var o=0,u=r.length;o<u;++o)if(r[o].name===n){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function dn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var a=Tt(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:n,value:e},c=0,f=i.length;c<f;++c)if(i[c].name===n){i[c]=u;break}c===f&&i.push(u)}a.tween=i}}function pn(t,n,e){var r=t._id;return t.each(function(){var t=Tt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return At(t,r).value[n]}}function gn(t){return function(){this.removeAttribute(t)}}function mn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yn(t,n,e){var r,i;return function(){var a=this.getAttribute(t);return a===e?null:a===r?i:i=n(r=a,e)}}function vn(t,n,e){var r,i;return function(){var a=this.getAttributeNS(t.space,t.local);return a===e?null:a===r?i:i=n(r=a,e)}}function bn(t,n,e){var r,i,a;return function(){var o,u=e(this);return null==u?void this.removeAttribute(t):(o=this.getAttribute(t),o===u?null:o===r&&u===i?a:a=n(r=o,i=u))}}function _n(t,n,e){var r,i,a;return function(){var o,u=e(this);return null==u?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),o===u?null:o===r&&u===i?a:a=n(r=o,i=u))}}function wn(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function xn(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function Mn(t,n){return function(){kt(this,t).delay=+n.apply(this,arguments)}}function kn(t,n){return n=+n,function(){kt(this,t).delay=n}}function Tn(t,n){return function(){Tt(this,t).duration=+n.apply(this,arguments)}}function An(t,n){return n=+n,function(){Tt(this,t).duration=n}}function Nn(t,n){if("function"!=typeof n)throw new Error;return function(){Tt(this,t).ease=n}}function Cn(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function Sn(t,n,e){var r,i,a=Cn(n)?kt:Tt;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(n,e),o.on=i}}function Dn(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Un(t,n){var e,r,i;return function(){var a=ma(this).getComputedStyle(this,null),o=a.getPropertyValue(t),u=(this.style.removeProperty(t),a.getPropertyValue(t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}function En(t){return function(){this.style.removeProperty(t)}}function Fn(t,n,e){var r,i;return function(){var a=ma(this).getComputedStyle(this,null).getPropertyValue(t);return a===e?null:a===r?i:i=n(r=a,e)}}function Pn(t,n,e){var r,i,a;return function(){var o=ma(this).getComputedStyle(this,null),u=o.getPropertyValue(t),c=e(this);return null==c&&(this.style.removeProperty(t),c=o.getPropertyValue(t)),u===c?null:u===r&&c===i?a:a=n(r=u,i=c)}}function Yn(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function Ln(t){return function(){this.textContent=t}}function Hn(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function On(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function zn(t){return ft().transition(t)}function qn(){return++Au}function In(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function Xn(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return Fu.time=gt(),Fu;return e}function jn(){}function Vn(t,n){var e=new jn;if(t instanceof jn)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==n)for(;++i<a;)e.set(i,t[i]);else for(;++i<a;)e.set(n(r=t[i],i,t),r)}else if(t)for(var o in t)e.set(o,t[o]);return e}function Rn(){}function $n(t,n){var e=new Rn;if(t instanceof Rn)t.each(function(t){e.add(t)});else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}function Zn(t){function n(n){var a=n+"",o=e.get(a);if(!o){if(i!==ju)return i;e.set(a,o=r.push(n))}return t[(o-1)%t.length]}var e=Vn(),r=[],i=ju;return t=null==t?[]:Xu.call(t),n.domain=function(t){if(!arguments.length)return r.slice();r=[],e=Vn();for(var i,a,o=-1,u=t.length;++o<u;)e.has(a=(i=t[o])+"")||e.set(a,r.push(i));return n},n.range=function(e){return arguments.length?(t=Xu.call(e),n):t.slice()},n.unknown=function(t){return arguments.length?(i=t,n):i},n.copy=function(){return Zn().domain(r).range(t).unknown(i)},n}function Bn(){function t(){var t=i().length,r=o[1]<o[0],s=o[r-0],h=o[1-r];n=(h-s)/Math.max(1,t-c+2*f),u&&(n=Math.floor(n)),s+=(h-s-n*(t-c))*l,e=n*(1-c),u&&(s=Math.round(s),e=Math.round(e));var d=ai(t).map(function(t){return s+n*t});return a(r?d.reverse():d)}var n,e,r=Zn().unknown(void 0),i=r.domain,a=r.range,o=[0,1],u=!1,c=0,f=0,l=.5;return delete r.unknown,r.domain=function(n){return arguments.length?(i(n),t()):i()},r.range=function(n){return arguments.length?(o=[+n[0],+n[1]],t()):o.slice()},r.rangeRound=function(n){return o=[+n[0],+n[1]],u=!0,t()},r.bandwidth=function(){return e},r.step=function(){return n},r.round=function(n){return arguments.length?(u=!!n,t()):u},r.padding=function(n){return arguments.length?(c=f=Math.max(0,Math.min(1,n)),t()):c},r.paddingInner=function(n){return arguments.length?(c=Math.max(0,Math.min(1,n)),t()):c},r.paddingOuter=function(n){return arguments.length?(f=Math.max(0,Math.min(1,n)),t()):f},r.align=function(n){return arguments.length?(l=Math.max(0,Math.min(1,n)),t()):l},r.copy=function(){return Bn().domain(i()).range(o).round(u).paddingInner(c).paddingOuter(f).align(l)},t()}function Wn(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Wn(n())},t}function Jn(){return Wn(Bn().paddingInner(1))}function Gn(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:Vu(n)}function Qn(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}function Kn(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function te(t,n,e,r){var i=t[0],a=t[1],o=n[0],u=n[1];return a<i?(i=e(a,i),o=r(u,o)):(i=e(i,a),o=r(o,u)),function(t){return o(i(t))}}function ne(t,n,e,r){var i=Math.min(t.length,n.length)-1,a=new Array(i),o=new Array(i),u=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++u<i;)a[u]=e(t[u],t[u+1]),o[u]=r(n[u],n[u+1]);return function(n){var e=Zr(t,n,1,i)-1;return o[e](a[e](n))}}function ee(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function re(t,n){function e(){return i=Math.min(u.length,c.length)>2?ne:te,a=o=null,r}function r(n){return(a||(a=i(u,c,l?Qn(t):t,f)))(+n)}var i,a,o,u=$u,c=$u,f=Ko,l=!1;return r.invert=function(t){return(o||(o=i(c,u,Gn,l?Kn(n):n)))(+t)},r.domain=function(t){return arguments.length?(u=Iu.call(t,Ru),e()):u.slice()},r.range=function(t){return arguments.length?(c=Xu.call(t),e()):c.slice()},r.rangeRound=function(t){return c=Xu.call(t),f=tu,e()},r.clamp=function(t){return arguments.length?(l=!!t,e()):l},r.interpolate=function(t){return arguments.length?(f=t,e()):f},e()}function ie(t){if(!(n=tc.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",a=n[4]||"",o=!!n[5],u=n[6]&&+n[6],c=!!n[7],f=n[8]&&+n[8].slice(1),l=n[9]||"";"n"===l?(c=!0,l="g"):Ku[l]||(l=""),(o||"0"===e&&"="===r)&&(o=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=a,this.zero=o,this.width=u,this.comma=c,this.precision=f,this.type=l}function ae(t){return t}function oe(t){return ec=oc(t),rc=ec.format,ic=ec.formatPrefix,ec}function ue(t){var n=t.domain;return t.ticks=function(t){var e=n();return fi(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return lc(n(),t,e)},t.nice=function(r){var i=n(),a=i.length-1,o=null==r?10:r,u=i[0],c=i[a],f=e(u,c,o);return f&&(f=e(Math.floor(u/f)*f,Math.ceil(c/f)*f,o),i[0]=Math.floor(u/f)*f,i[a]=Math.ceil(c/f)*f,n(i)),t},t}function ce(){var t=re(Gn,Bo);return t.copy=function(){return ee(t,ce())},ue(t)}function fe(){function t(t){return+t}var n=[0,1];return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=Iu.call(e,Ru),t):n.slice()},t.copy=function(){return fe().domain(n)},ue(t)}function le(t,n){return(n=Math.log(n/t))?function(e){return Math.log(e/t)/n}:Vu(n)}function se(t,n){return t<0?function(e){return-Math.pow(-n,e)*Math.pow(-t,1-e)}:function(e){return Math.pow(n,e)*Math.pow(t,1-e)}}function he(t){return isFinite(t)?+("1e"+t):t<0?0:t}function de(t){return 10===t?he:t===Math.E?Math.exp:function(n){return Math.pow(t,n)}}function pe(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(n){return Math.log(n)/t})}function ge(t){return function(n){return-t(-n)}}function me(){function t(){return i=pe(r),a=de(r),e()[0]<0&&(i=ge(i),a=ge(a)),n}var n=re(le,se).domain([1,10]),e=n.domain,r=10,i=pe(10),a=de(10);return n.base=function(n){return arguments.length?(r=+n,t()):r},n.domain=function(n){return arguments.length?(e(n),t()):e()},n.ticks=function(t){var n,o=e(),u=o[0],c=o[o.length-1];(n=c<u)&&(h=u,u=c,c=h);var f,l,s,h=i(u),d=i(c),p=null==t?10:+t,g=[];if(!(r%1)&&d-h<p){if(h=Math.round(h)-1,d=Math.round(d)+1,u>0){for(;h<d;++h)for(l=1,f=a(h);l<r;++l)if(s=f*l,!(s<u)){if(s>c)break;g.push(s)}}else for(;h<d;++h)for(l=r-1,f=a(h);l>=1;--l)if(s=f*l,!(s<u)){if(s>c)break;g.push(s)}}else g=fi(h,d,Math.min(d-h,p)).map(a);return n?g.reverse():g},n.tickFormat=function(t,e){if(null==e&&(e=10===r?".0e":","),"function"!=typeof e&&(e=rc(e)),t===1/0)return e;null==t&&(t=10);var o=Math.max(1,r*t/n.ticks().length);return function(t){var n=t/a(Math.round(i(t)));return n*r<r-.5&&(n*=r),n<=o?e(t):""}},n.nice=function(){return e(sc(e(),{floor:function(t){return a(Math.floor(i(t)))},ceil:function(t){return a(Math.ceil(i(t)))}}))},n.copy=function(){return ee(n,me().base(r))},n}function ye(t,n){return t<0?-Math.pow(-t,n):Math.pow(t,n)}function ve(){function t(t,n){return(n=ye(n,e)-(t=ye(t,e)))?function(r){return(ye(r,e)-t)/n}:Vu(n)}function n(t,n){return n=ye(n,e)-(t=ye(t,e)),function(r){return ye(t+n*r,1/e)}}var e=1,r=re(t,n),i=r.domain;return r.exponent=function(t){return arguments.length?(e=+t,i(i())):e},r.copy=function(){return ee(r,ve().exponent(e))},ue(r)}function be(){return ve().exponent(.5)}function _e(){function t(){var t=0,a=Math.max(1,r.length);for(i=new Array(a-1);++t<a;)i[t-1]=hi(e,t/a);return n}function n(t){if(!isNaN(t=+t))return r[Zr(i,t)]}var e=[],r=[],i=[];return n.invertExtent=function(t){var n=r.indexOf(t);return n<0?[NaN,NaN]:[n>0?i[n-1]:e[0],n<i.length?i[n]:e[e.length-1]]},n.domain=function(n){if(!arguments.length)return e.slice();e=[];for(var r,i=0,a=n.length;i<a;++i)r=n[i],null==r||isNaN(r=+r)||e.push(r);return e.sort(Vr),t()},n.range=function(n){return arguments.length?(r=Xu.call(n),t()):r.slice()},n.quantiles=function(){return i.slice()},n.copy=function(){return _e().domain(e).range(r)},n}function we(){function t(t){if(t<=t)return o[Zr(a,t,0,i)]}function n(){var n=-1;for(a=new Array(i);++n<i;)a[n]=((n+1)*r-(n-i)*e)/(i+1);return t}var e=0,r=1,i=1,a=[.5],o=[0,1];return t.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n()):[e,r]},t.range=function(t){return arguments.length?(i=(o=Xu.call(t)).length-1,n()):o.slice()},t.invertExtent=function(t){var n=o.indexOf(t);return n<0?[NaN,NaN]:n<1?[e,a[0]]:n>=i?[a[i-1],r]:[a[n-1],a[n]]},t.copy=function(){return we().domain([e,r]).range(o)},ue(t)}function xe(){function t(t){if(t<=t)return e[Zr(n,t,0,r)]}var n=[.5],e=[0,1],r=1;return t.domain=function(i){return arguments.length?(n=Xu.call(i),r=Math.min(n.length,e.length-1),t):n.slice()},t.range=function(i){return arguments.length?(e=Xu.call(i),r=Math.min(n.length,e.length-1),t):e.slice()},t.invertExtent=function(t){var r=e.indexOf(t);return[n[r-1],n[r]]},t.copy=function(){return xe().domain(n).range(e)},t}function Me(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,a){var o=[];if(e=i.ceil(e),a=null==a?1:Math.floor(a),!(e<r&&a>0))return o;do o.push(new Date(+e));while(n(e,a),t(e),e<r);return o},i.filter=function(e){return Me(function(n){if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return hc.setTime(+n),dc.setTime(+r),t(hc),t(dc),Math.floor(e(hc,dc))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t===0}:function(n){return i.count(0,n)%t===0}):i:null}),i}function ke(t){return Me(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*mc)/bc})}function Te(t){return Me(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/bc})}function Ae(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ne(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ce(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Se(t){function n(t,n){return function(e){var r,i,a,o=[],u=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++u<f;)37===t.charCodeAt(u)&&(o.push(t.slice(c,u)),null!=(i=Lc[r=t.charAt(++u)])?r=t.charAt(++u):i="e"===r?" ":"0",(a=n[r])&&(r=a(e,i)),o.push(r),c=u+1);return o.push(t.slice(c,u)),o.join("")}}function e(t,n){return function(e){var i=Ce(1900),a=r(i,t,e+="",0);if(a!=e.length)return null;if("p"in i&&(i.H=i.H%12+12*i.p),"W"in i||"U"in i){"w"in i||(i.w="W"in i?1:0);var o="Z"in i?Ne(Ce(i.y)).getUTCDay():n(Ce(i.y)).getDay();i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7}return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,Ne(i)):n(i)}}function r(t,n,e,r){for(var i,a,o=0,u=n.length,c=e.length;o<u;){if(r>=c)return-1;if(i=n.charCodeAt(o++),37===i){if(i=n.charAt(o++),a=X[i in Lc?n.charAt(o++):i],!a||(r=a(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=D.exec(n.slice(e));return r?(t.p=U[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=P.exec(n.slice(e));return r?(t.w=Y[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=E.exec(n.slice(e));return r?(t.w=F[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=O.exec(n.slice(e));return r?(t.m=z[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){var r=L.exec(n.slice(e));return r?(t.m=H[r[0].toLowerCase()],e+r[0].length):-1}function f(t,n,e){return r(t,x,n,e)}function l(t,n,e){return r(t,M,n,e)}function s(t,n,e){return r(t,k,n,e)}function h(t){return N[t.getDay()]}function d(t){return A[t.getDay()]}function p(t){return S[t.getMonth()]}function g(t){return C[t.getMonth()]}function m(t){return T[+(t.getHours()>=12)]}function y(t){return N[t.getUTCDay()]}function v(t){return A[t.getUTCDay()]}function b(t){return S[t.getUTCMonth()]}function _(t){return C[t.getUTCMonth()]}function w(t){return T[+(t.getUTCHours()>=12)]}var x=t.dateTime,M=t.date,k=t.time,T=t.periods,A=t.days,N=t.shortDays,C=t.months,S=t.shortMonths,D=Ee(T),U=Fe(T),E=Ee(A),F=Fe(A),P=Ee(N),Y=Fe(N),L=Ee(C),H=Fe(C),O=Ee(S),z=Fe(S),q={a:h,A:d,b:p,B:g,c:null,d:Be,e:Be,H:We,I:Je,j:Ge,L:Qe,m:Ke,M:tr,p:m,S:nr,U:er,w:rr,W:ir,x:null,X:null,y:ar,Y:or,Z:ur,"%":xr},I={a:y,A:v,b:b,B:_,c:null,d:cr,e:cr,H:fr,I:lr,j:sr,L:hr,m:dr,M:pr,p:w,S:gr,U:mr,w:yr,W:vr,x:null,X:null,y:br,Y:_r,Z:wr,"%":xr},X={a:a,A:o,b:u,B:c,c:f,d:Ie,e:Ie,H:je,I:je,j:Xe,L:$e,m:qe,M:Ve,p:i,S:Re,U:Ye,w:Pe,W:Le,x:l,X:s,y:Oe,Y:He,Z:ze,"%":Ze};return q.x=n(M,q),q.X=n(k,q),q.c=n(x,q),I.x=n(M,I),I.X=n(k,I),I.c=n(x,I), {format:function(t){var e=n(t+="",q);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",Ae);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",I);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,Ne);return n.toString=function(){return t},n}}}function De(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<e?new Array(e-a+1).join(n)+i:i)}function Ue(t){return t.replace(zc,"\\$&")}function Ee(t){return new RegExp("^(?:"+t.map(Ue).join("|")+")","i")}function Fe(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function Pe(t,n,e){var r=Hc.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Ye(t,n,e){var r=Hc.exec(n.slice(e));return r?(t.U=+r[0],e+r[0].length):-1}function Le(t,n,e){var r=Hc.exec(n.slice(e));return r?(t.W=+r[0],e+r[0].length):-1}function He(t,n,e){var r=Hc.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function Oe(t,n,e){var r=Hc.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function ze(t,n,e){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function qe(t,n,e){var r=Hc.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Ie(t,n,e){var r=Hc.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Xe(t,n,e){var r=Hc.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function je(t,n,e){var r=Hc.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Ve(t,n,e){var r=Hc.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Re(t,n,e){var r=Hc.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function $e(t,n,e){var r=Hc.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Ze(t,n,e){var r=Oc.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Be(t,n){return De(t.getDate(),n,2)}function We(t,n){return De(t.getHours(),n,2)}function Je(t,n){return De(t.getHours()%12||12,n,2)}function Ge(t,n){return De(1+Mc.count(Nc(t),t),n,3)}function Qe(t,n){return De(t.getMilliseconds(),n,3)}function Ke(t,n){return De(t.getMonth()+1,n,2)}function tr(t,n){return De(t.getMinutes(),n,2)}function nr(t,n){return De(t.getSeconds(),n,2)}function er(t,n){return De(kc.count(Nc(t),t),n,2)}function rr(t){return t.getDay()}function ir(t,n){return De(Tc.count(Nc(t),t),n,2)}function ar(t,n){return De(t.getFullYear()%100,n,2)}function or(t,n){return De(t.getFullYear()%1e4,n,4)}function ur(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+De(n/60|0,"0",2)+De(n%60,"0",2)}function cr(t,n){return De(t.getUTCDate(),n,2)}function fr(t,n){return De(t.getUTCHours(),n,2)}function lr(t,n){return De(t.getUTCHours()%12||12,n,2)}function sr(t,n){return De(1+Dc.count(Pc(t),t),n,3)}function hr(t,n){return De(t.getUTCMilliseconds(),n,3)}function dr(t,n){return De(t.getUTCMonth()+1,n,2)}function pr(t,n){return De(t.getUTCMinutes(),n,2)}function gr(t,n){return De(t.getUTCSeconds(),n,2)}function mr(t,n){return De(Uc.count(Pc(t),t),n,2)}function yr(t){return t.getUTCDay()}function vr(t,n){return De(Ec.count(Pc(t),t),n,2)}function br(t,n){return De(t.getUTCFullYear()%100,n,2)}function _r(t,n){return De(t.getUTCFullYear()%1e4,n,4)}function wr(){return"+0000"}function xr(){return"%"}function Mr(n){return Yc=Se(n),t.timeFormat=Yc.format,t.timeParse=Yc.parse,t.utcFormat=Yc.utcFormat,t.utcParse=Yc.utcParse,Yc}function kr(t){return t.toISOString()}function Tr(t){var n=new Date(t);return isNaN(n)?null:n}function Ar(t){return new Date(t)}function Nr(t){return t instanceof Date?+t:+new Date(+t)}function Cr(t,n,r,i,a,o,u,c,f){function l(e){return(u(e)<e?g:o(e)<e?m:a(e)<e?y:i(e)<e?v:n(e)<e?r(e)<e?b:_:t(e)<e?w:x)(e)}function s(n,r,i,a){if(null==n&&(n=10),"number"==typeof n){var o=Math.abs(i-r)/n,u=Rr(function(t){return t[2]}).right(M,o);u===M.length?(a=e(r/Wc,i/Wc,n),n=t):u?(u=M[o/M[u-1][2]<M[u][2]/o?u-1:u],a=u[1],n=u[0]):(a=e(r,i,n),n=c)}return null==a?n:n.every(a)}var h=re(Gn,Bo),d=h.invert,p=h.domain,g=f(".%L"),m=f(":%S"),y=f("%I:%M"),v=f("%I %p"),b=f("%a %d"),_=f("%b %d"),w=f("%B"),x=f("%Y"),M=[[u,1,jc],[u,5,5*jc],[u,15,15*jc],[u,30,30*jc],[o,1,Vc],[o,5,5*Vc],[o,15,15*Vc],[o,30,30*Vc],[a,1,Rc],[a,3,3*Rc],[a,6,6*Rc],[a,12,12*Rc],[i,1,$c],[i,2,2*$c],[r,1,Zc],[n,1,Bc],[n,3,3*Bc],[t,1,Wc]];return h.invert=function(t){return new Date(d(t))},h.domain=function(t){return arguments.length?p(Iu.call(t,Nr)):p().map(Ar)},h.ticks=function(t,n){var e,r=p(),i=r[0],a=r[r.length-1],o=a<i;return o&&(e=i,i=a,a=e),e=s(t,i,a,n),e=e?e.range(i,a+1):[],o?e.reverse():e},h.tickFormat=function(t,n){return null==n?l:f(n)},h.nice=function(t,n){var e=p();return(t=s(t,e[0],e[e.length-1],n))?p(sc(e,t)):h},h.copy=function(){return ee(h,Cr(t,n,r,i,a,o,u,c,f))},h}function Sr(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}function Dr(t){function n(n){var a=(n-e)/(r-e);return t(i?Math.max(0,Math.min(1,a)):a)}var e=0,r=1,i=!1;return n.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n):[e,r]},n.clamp=function(t){return arguments.length?(i=!!t,n):i},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Dr(t).domain([e,r]).clamp(i)},ue(n)}function Ur(t){if(!arguments.length)return null;var n=Da(t).append("svg");return n.attr("width","100%"),n.attr("height",100),n}function Er(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Fr(){return new Er}function Pr(t){this._context=t}function Yr(t){return t[0]}function Lr(t){return t[1]}function Hr(t){return t<0?-1:1}function Or(t,n,e){var r=t._x1-t._x0,i=n-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(e-t._y1)/(i||r<0&&-0),u=(a*i+o*r)/(r+i);return(Hr(a)+Hr(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function zr(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function qr(t,n,e){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,u=(a-r)/3;t._context.bezierCurveTo(r+u,i+u*n,a-u,o-u*e,a,o)}function Ir(t){this._context=t}function Xr(t){this._context=new jr(t)}function jr(t){this._context=t}var Vr=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN},Rr=function(t){return 1===t.length&&(t=n(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var a=r+i>>>1;t(n[a],e)<0?r=a+1:i=a}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var a=r+i>>>1;t(n[a],e)>0?i=a:r=a+1}return r}}},$r=Rr(Vr),Zr=$r.right,Br=$r.left,Wr=function(t,n){return n<t?-1:n>t?1:n>=t?0:NaN},Jr=function(t){return null===t?NaN:+t},Gr=function(t,n){var e,r,i=t.length,a=0,o=0,u=-1,c=0;if(null==n)for(;++u<i;)isNaN(e=Jr(t[u]))||(r=e-a,a+=r/++c,o+=r*(e-a));else for(;++u<i;)isNaN(e=Jr(n(t[u],u,t)))||(r=e-a,a+=r/++c,o+=r*(e-a));if(c>1)return o/(c-1)},Qr=function(t,n){var e=Gr(t,n);return e?Math.sqrt(e):e},Kr=function(t,n){var e,r,i,a=-1,o=t.length;if(null==n){for(;++a<o;)if(null!=(r=t[a])&&r>=r){e=i=r;break}for(;++a<o;)null!=(r=t[a])&&(e>r&&(e=r),i<r&&(i=r))}else{for(;++a<o;)if(null!=(r=n(t[a],a,t))&&r>=r){e=i=r;break}for(;++a<o;)null!=(r=n(t[a],a,t))&&(e>r&&(e=r),i<r&&(i=r))}return[e,i]},ti=Array.prototype,ni=ti.slice,ei=ti.map,ri=function(t){return function(){return t}},ii=function(t){return t},ai=function(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),a=new Array(i);++r<i;)a[r]=t+r*e;return a},oi=Math.sqrt(50),ui=Math.sqrt(10),ci=Math.sqrt(2),fi=function(t,n,r){var i=e(t,n,r);return ai(Math.ceil(t/i)*i,Math.floor(n/i)*i+i/2,i)},li=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},si=function(){function t(t){var i,a,o=t.length,u=new Array(o);for(i=0;i<o;++i)u[i]=n(t[i],i,t);var c=e(u),f=c[0],l=c[1],s=r(u,f,l);Array.isArray(s)||(s=fi(f,l,s));for(var h=s.length;s[0]<=f;)s.shift(),--h;for(;s[h-1]>=l;)s.pop(),--h;var d,p=new Array(h+1);for(i=0;i<=h;++i)d=p[i]=[],d.x0=i>0?s[i-1]:f,d.x1=i<h?s[i]:l;for(i=0;i<o;++i)a=u[i],f<=a&&a<=l&&p[Zr(s,a,0,h)].push(t[i]);return p}var n=ii,e=Kr,r=li;return t.value=function(e){return arguments.length?(n="function"==typeof e?e:ri(e),t):n},t.domain=function(n){return arguments.length?(e="function"==typeof n?n:ri([n[0],n[1]]),t):e},t.thresholds=function(n){return arguments.length?(r="function"==typeof n?n:ri(Array.isArray(n)?ni.call(n):n),t):r},t},hi=function(t,n,e){if(null==e&&(e=Jr),r=t.length){if((n=+n)<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,a=Math.floor(i),o=+e(t[a],a,t),u=+e(t[a+1],a+1,t);return o+(u-o)*(i-a)}},di=function(t,n,e){return t=ei.call(t,Jr).sort(Vr),Math.ceil((e-n)/(2*(hi(t,.75)-hi(t,.25))*Math.pow(t.length,-1/3)))},pi=function(t,n,e){return Math.ceil((e-n)/(3.5*Qr(t)*Math.pow(t.length,-1/3)))},gi=function(t,n){var e,r,i=-1,a=t.length;if(null==n){for(;++i<a;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<a;)null!=(r=t[i])&&r>e&&(e=r)}else{for(;++i<a;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<a;)null!=(r=n(t[i],i,t))&&r>e&&(e=r)}return e},mi=function(t,n){var e,r=0,i=t.length,a=-1,o=i;if(null==n)for(;++a<i;)isNaN(e=Jr(t[a]))?--o:r+=e;else for(;++a<i;)isNaN(e=Jr(n(t[a],a,t)))?--o:r+=e;if(o)return r/o},yi=function(t,n){var e,r=[],i=t.length,a=-1;if(null==n)for(;++a<i;)isNaN(e=Jr(t[a]))||r.push(e);else for(;++a<i;)isNaN(e=Jr(n(t[a],a,t)))||r.push(e);return hi(r.sort(Vr),.5)},vi=function(t){for(var n,e,r,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(e=new Array(o);--i>=0;)for(r=t[i],n=r.length;--n>=0;)e[--o]=r[n];return e},bi=function(t,n){var e,r,i=-1,a=t.length;if(null==n){for(;++i<a;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<a;)null!=(r=t[i])&&e>r&&(e=r)}else{for(;++i<a;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<a;)null!=(r=n(t[i],i,t))&&e>r&&(e=r)}return e},_i=function(t){for(var n=0,e=t.length-1,r=t[0],i=new Array(e<0?0:e);n<e;)i[n]=[r,r=t[++n]];return i},wi=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},xi=function(t,n){if(e=t.length){var e,r,i=0,a=0,o=t[a];for(n||(n=Vr);++i<e;)(n(r=t[i],o)<0||0!==n(o,o))&&(o=r,a=i);return 0===n(o,o)?a:void 0}},Mi=function(t,n,e){for(var r,i,a=(null==e?t.length:e)-(n=null==n?0:+n);a;)i=Math.random()*a--|0,r=t[a+n],t[a+n]=t[i+n],t[i+n]=r;return t},ki=function(t,n){var e,r=0,i=t.length,a=-1;if(null==n)for(;++a<i;)(e=+t[a])&&(r+=e);else for(;++a<i;)(e=+n(t[a],a,t))&&(r+=e);return r},Ti=function(t){if(!(a=t.length))return[];for(var n=-1,e=bi(t,r),i=new Array(e);++n<e;)for(var a,o=-1,u=i[n]=new Array(a);++o<a;)u[o]=t[o][n];return i},Ai=function(){return Ti(arguments)},Ni=Array.prototype.slice,Ci=function(t){return t},Si=1,Di=2,Ui=3,Ei=4,Fi=1e-6,Pi="http://www.w3.org/1999/xhtml",Yi={svg:"http://www.w3.org/2000/svg",xhtml:Pi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Li=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Yi.hasOwnProperty(n)?{space:Yi[n],local:t}:t},Hi=function(t){var n=Li(t);return(n.local?p:d)(n)},Oi=0;m.prototype=g.prototype={constructor:m,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var zi=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var qi=document.documentElement;if(!qi.matches){var Ii=qi.webkitMatchesSelector||qi.msMatchesSelector||qi.mozMatchesSelector||qi.oMatchesSelector;zi=function(t){return function(){return Ii.call(this,t)}}}}var Xi=zi,ji={};if(t.event=null,"undefined"!=typeof document){var Vi=document.documentElement;"onmouseenter"in Vi||(ji={mouseenter:"mouseover",mouseleave:"mouseout"})}var Ri=function(t,n,e){var r,i,a=b(t+""),o=a.length;{if(!(arguments.length<2)){for(u=n?w:_,null==e&&(e=!1),r=0;r<o;++r)this.each(u(a[r],n,e));return this}var u=this.node().__on;if(u)for(var c,f=0,l=u.length;f<l;++f)for(r=0,c=u[f];r<o;++r)if((i=a[r]).type===c.type&&i.name===c.name)return c.value}},$i=function(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e},Zi=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},Bi=function(t){var n=$i();return n.changedTouches&&(n=n.changedTouches[0]),Zi(t,n)},Wi=function(t){return null==t?M:function(){return this.querySelector(t)}},Ji=function(t){"function"!=typeof t&&(t=Wi(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var a,o,u=n[i],c=u.length,f=r[i]=new Array(c),l=0;l<c;++l)(a=u[l])&&(o=t.call(a,a.__data__,l,u))&&("__data__"in a&&(o.__data__=a.__data__),f[l]=o);return new ct(r,this._parents)},Gi=function(t){return null==t?k:function(){return this.querySelectorAll(t)}},Qi=function(t){"function"!=typeof t&&(t=Gi(t));for(var n=this._groups,e=n.length,r=[],i=[],a=0;a<e;++a)for(var o,u=n[a],c=u.length,f=0;f<c;++f)(o=u[f])&&(r.push(t.call(o,o.__data__,f,u)),i.push(o));return new ct(r,i)},Ki=function(t){"function"!=typeof t&&(t=Xi(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var a,o=n[i],u=o.length,c=r[i]=[],f=0;f<u;++f)(a=o[f])&&t.call(a,a.__data__,f,o)&&c.push(a);return new ct(r,this._parents)},ta=function(t){return new Array(t.length)},na=function(){return new ct(this._enter||this._groups.map(ta),this._parents)};T.prototype={constructor:T,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ea=function(t){return function(){return t}},ra="$",ia=function(t,n){if(!t)return d=new Array(this.size()),f=-1,this.each(function(t){d[++f]=t}),d;var e=n?N:A,r=this._parents,i=this._groups;"function"!=typeof t&&(t=ea(t));for(var a=i.length,o=new Array(a),u=new Array(a),c=new Array(a),f=0;f<a;++f){var l=r[f],s=i[f],h=s.length,d=t.call(l,l&&l.__data__,f,r),p=d.length,g=u[f]=new Array(p),m=o[f]=new Array(p),y=c[f]=new Array(h);e(l,s,g,m,y,d,n);for(var v,b,_=0,w=0;_<p;++_)if(v=g[_]){for(_>=w&&(w=_+1);!(b=m[w])&&++w<p;);v._next=b||null}}return o=new ct(o,r),o._enter=u,o._exit=c,o},aa=function(){return new ct(this._exit||this._groups.map(ta),this._parents)},oa=function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var c,f=n[u],l=e[u],s=f.length,h=o[u]=new Array(s),d=0;d<s;++d)(c=f[d]||l[d])&&(h[d]=c);for(;u<r;++u)o[u]=n[u];return new ct(o,this._parents)},ua=function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},ca=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=C);for(var e=this._groups,r=e.length,i=new Array(r),a=0;a<r;++a){for(var o,u=e[a],c=u.length,f=i[a]=new Array(c),l=0;l<c;++l)(o=u[l])&&(f[l]=o);f.sort(n)}return new ct(i,this._parents).order()},fa=function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},la=function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},sa=function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null},ha=function(){var t=0;return this.each(function(){++t}),t},da=function(){return!this.node()},pa=function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,a=n[e],o=0,u=a.length;o<u;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},ga=function(t,n){var e=Li(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?D:S:"function"==typeof n?e.local?P:F:e.local?E:U)(e,n))},ma=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView},ya=function(t,n,e){var r;return arguments.length>1?this.each((null==n?Y:"function"==typeof n?H:L)(t,n,null==e?"":e)):ma(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},va=function(t,n){return arguments.length>1?this.each((null==n?O:"function"==typeof n?q:z)(t,n)):this.node()[t]};j.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ba=function(t,n){var e=I(t+"");if(arguments.length<2){for(var r=X(this.node()),i=-1,a=e.length;++i<a;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?B:n?$:Z)(e,n))},_a=function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?G:J)(t)):this.node().textContent},wa=function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?tt:K)(t)):this.node().innerHTML},xa=function(){return this.each(nt)},Ma=function(){return this.each(et)},ka=function(t){var n="function"==typeof t?t:Hi(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},Ta=function(t,n){var e="function"==typeof t?t:Hi(t),r=null==n?rt:"function"==typeof n?n:Wi(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},Aa=function(){return this.each(it)},Na=function(t){return arguments.length?this.property("__data__",t):this.node().__data__},Ca=function(t,n){return this.each(("function"==typeof n?ut:ot)(t,n))},Sa=[null];ct.prototype=ft.prototype={constructor:ct,select:Ji,selectAll:Qi,filter:Ki,data:ia,enter:na,exit:aa,merge:oa,order:ua,sort:ca,call:fa,nodes:la,node:sa,size:ha,empty:da,each:pa,attr:ga,style:ya,property:va,classed:ba,text:_a,html:wa,raise:xa,lower:Ma,append:ka,insert:Ta,remove:Aa,datum:Na,on:Ri,dispatch:Ca};var Da=function(t){return"string"==