Quite good looking graph derived from d3.js http://c3js.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

3 lines
82 KiB

!function(a){"use strict";function b(a){return a||0===a}function c(a){return"undefined"==typeof a}function d(a){return"undefined"!=typeof a}function e(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+s)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,k);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);return d.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=m.copy();return b&&(a=m.domain(),c.domain([a[0],a[1]-1])),c}function h(a){return j?j(a):a}function i(i){i.each(function(){function i(a){var b=m(a)+s;return B[0]<b&&b<B[1]?o:0}var j,k,t=a.select(this),u=this.__chart__||m,v=this.__chart__=g(),w=r?r:f(v),x=t.selectAll(".tick").data(w,v),y=x.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),z=x.exit().remove(),A=a.transition(x).style("opacity",1),B=m.rangeExtent?m.rangeExtent():e(m.range()),C=t.selectAll(".domain").data([0]),D=(C.enter().append("path").attr("class","domain"),a.transition(C));y.append("line"),y.append("text");var E=y.select("line"),F=A.select("line"),G=x.select("text").text(h),H=y.select("text"),I=A.select("text");switch(b?(s=Math.ceil((v(1)-v(0))/2),k=l?0:s):s=k=0,n){case"bottom":j=c,E.attr("y2",o),H.attr("y",Math.max(o,0)+q),F.attr("x1",k).attr("x2",k).attr("y2",i),I.attr("x",0).attr("y",Math.max(o,0)+q),G.attr("dy",".71em").style("text-anchor","middle"),D.attr("d","M"+B[0]+","+p+"V0H"+B[1]+"V"+p);break;case"top":j=c,E.attr("y2",-o),H.attr("y",-(Math.max(o,0)+q)),F.attr("x2",0).attr("y2",-o),I.attr("x",0).attr("y",-(Math.max(o,0)+q)),G.attr("dy","0em").style("text-anchor","middle"),D.attr("d","M"+B[0]+","+-p+"V0H"+B[1]+"V"+-p);break;case"left":j=d,E.attr("x2",-o),H.attr("x",-(Math.max(o,0)+q)),F.attr("x2",-o).attr("y2",0),I.attr("x",-(Math.max(o,0)+q)).attr("y",s),G.attr("dy",".32em").style("text-anchor","end"),D.attr("d","M"+-p+","+B[0]+"H0V"+B[1]+"H"+-p);break;case"right":j=d,E.attr("x2",o),H.attr("x",Math.max(o,0)+q),F.attr("x2",o).attr("y2",0),I.attr("x",Math.max(o,0)+q).attr("y",0),G.attr("dy",".32em").style("text-anchor","start"),D.attr("d","M"+p+","+B[0]+"H0V"+B[1]+"H"+p)}if(v.rangeBand){var J=v,K=J.rangeBand()/2;u=v=function(a){return J(a)+K}}else u.rangeBand?u=v:z.call(j,v);y.call(j,u),A.call(j,v)})}var j,k,l,m=a.scale.linear(),n="bottom",o=6,p=6,q=3,r=null,s=0,t=!0;return i.scale=function(a){return arguments.length?(m=a,i):m},i.orient=function(a){return arguments.length?(n=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",i):n},i.tickFormat=function(a){return arguments.length?(j=a,i):j},i.tickCentered=function(a){return arguments.length?(l=a,i):l},i.tickOffset=function(){return s},i.ticks=function(){return arguments.length?(k=arguments,i):k},i.tickCulling=function(a){return arguments.length?(t=a,i):t},i.tickValues=function(a){return arguments.length?(r=a,i):r},i}var f={version:"0.2.3"},g={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};f.generate=function(f){function h(a,b){if(!(a in f))throw Error(b)}function i(a,b){var c,d,e,g=f;for(c=0;c<a.length;c++){if("object"==typeof g&&!(a[c]in g))return b;if(d=c===a.length-1,e=g[a[c]],!d&&"object"!=typeof e)return b;g=e}return g}function j(b){var c=a.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"}function k(a){return Math.ceil(a)+.5}function l(a,b){var c,d,e;b&&b.axisX?c=b.axisX:(c=Dk.select("."+g.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=Dk.select("."+g.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=Dk.select("."+g.axisY2),a&&(e=e.transition())),(a?Dk.transition():Dk).attr("transform",mk.main),c.attr("transform",mk.x),d.attr("transform",mk.y),e.attr("transform",mk.y2),Dk.select("."+g.chartArcs).attr("transform",mk.arc)}function m(a,b){var c;b&&b.axisSubX?c=b.axisSubX:(c=Ek.select("."+g.axisX),a&&(c=c.transition())),Ek.attr("transform",mk.context),c.attr("transform",mk.subx)}function n(a){(a?Fk.transition():Fk).attr("transform",mk.legend)}function o(a,b){l(a,b),Rh&&m(a,b),n(a)}function p(){var a=V(),b=U(),c=nk||ok?0:a,d=we(ng.data.targets),e=di||d?0:A("x"),f=Rh&&!d?Sh+e:0;Mg=t(),Ng=u(),di?(Fg={top:A("y2")+v(),right:d?0:y(),bottom:A("y")+c+w(),left:f+(d?0:x())},Gg={top:Fg.top,right:0/0,bottom:20+c,left:wk}):(Fg={top:4+v(),right:d?0:y(),bottom:e+f+c+w(),left:d?0:x()},Gg={top:Ng-f-c,right:0/0,bottom:e+c,left:Fg.left});var g={top:pk?v()+Zh+5.5:Ng-a-w()-Zh,left:qk?x()+Yh+.5:Mg-b-y()-Yh+.5};Hg={top:nk?0:ok?g.top:Ng-a,right:0/0,bottom:0,left:nk?Mg-b:ok?g.left:0},Ig=Mg-Fg.left-Fg.right,Kg=Ng-Fg.top-Fg.bottom,0>Ig&&(Ig=0),0>Kg&&(Kg=0),Jg=di?Fg.left-wk-xk:Ig,Lg=di?Kg:Ng-Gg.top-Gg.bottom,0>Jg&&(Jg=0),0>Lg&&(Lg=0),Rg=Ig-(nk?b+10:0),Sg=Kg-(nk?0:10),r(),nk&&d&&(Hg.left=Rg/2+1.1*Pg)}function q(){Dk.select("line."+g.xgridFocus).attr("x1",di?0:-10).attr("x2",di?Ig:-10).attr("y1",di?-10:Fg.top).attr("y2",di?-10:Kg)}function r(){var a;Pg=Math.min(Rg,Sg)/2,Og=.95*Pg,a=tj?(Og-tj)/Og:.6,Qg=ve(ng.data.targets)||ue(ng.data.targets)?Og*a:0}function s(){var a=di?g.axisX:g.axisY,b=Dk.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Hk.node().getBoundingClientRect(),e=we(ng.data.targets),f=c.right-d.left-(e?0:x());return f>0?f:0}function t(){return qg?qg:C()}function u(){var a=rg?rg:D();return a>0?a:320}function v(){return ug?ug:0}function w(){return vg?vg:0}function x(){return sg?sg:di?ei?Math.max($e(z("x")),40):1:!wi||Bi?1:$e(z("y"))}function y(){var a=10,b=nk?U()+20:0;return tg?tg:di?a+b:(!Fi||Ki?a:$e(z("y2")))+b}function z(a){var b=pb(a);return b.isInner?20+Ib(a):40+Ib(a)}function A(a){return"x"!==a||ei?"x"===a&&ti?ti:"y"!==a||wi?"y2"!==a||Fi?(pb(a).isInner?30:40)+("y2"===a?-10:0):yk:!Vh||nk||ok?1:10:0}function B(a){for(var b,c=Hk.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b}function C(){return B("width")}function D(){var a=Hk.style("height");return a.indexOf("px")>0?+a.replace("px",""):0}function E(a){return a?-31:-(Fg.left-1)}function F(a){return a?-20:-4}function G(){return E(!di)}function H(){return F(!di)}function I(){return E(di)}function J(){return F(di)}function K(a){return a?Ig+2+30+30:Fg.left+20}function L(a){return a?(ti?ti:0)+80:Kg+8}function M(){return K(!di)}function N(){return L(!di)}function O(){return K(di)}function P(){return L(di)}function Q(){var a,b,c,d,e,f,g=Oc(ng.data.targets);return g?(a=g.values[0],b=g.values[g.values.length-1],c=dh(b.x)-dh(a.x),0===c?di?Kg:Ig:(d=Nc(),e=re(ng.data.targets)?(d-(Uj?.25:1))/d:1,f=d>1?c*e/(d-1):c,1>f?1:f)):0}function R(a){rk=a}function S(a){sk=a}function T(a){tk=a}function U(){return Vh?nk||ok?sk*(rk+1):Mg:0}function V(){var a=0;return Vh&&(a=nk?Ng:ok?$h?Math.max(20,tk)*($h+1):Kg:Math.max(20,tk)*(rk+1)),a}function W(){var a,b,c=!dh;Xg=di?1:0,Yg=di?Kg:Ig,Zg=di?0:Kg,$g=di?Ig:1,_g=Xg,ah=Yg,bh=di?0:Lg,ch=di?Jg:1,dh=Z(Xg,Yg,c?void 0:dh.orgDomain(),function(){return jh.tickOffset()}),eh=$(Zg,$g,c?void 0:eh.domain()),fh=$(Zg,$g,c?void 0:fh.domain()),gh=Z(Xg,Yg,Ik,function(a){return a%1?0:mh.tickOffset()}),hh=$(bh,ch,c?void 0:hh.domain()),ih=$(bh,ch,c?void 0:ih.domain()),a=eb(),b=oi?oi:c?void 0:jh.tickValues(),jh=bb(dh,ik,a,b),mh=bb(gh,lk,a,b),kh=cb(eh,jk,Ci,Ei),lh=cb(fh,kk,Li,Ni),c||(zk.scale(gh),wg&&Ak.scale(dh)),X()}function X(){Tg=Lb(),Ug=Mb(),Vg=Mb(.98)}function Y(a,b,c){return(c?mg.time.scale():mg.scale.linear()).range([a,b])}function Z(a,b,c,d){var e,f=Y(a,b,Tj),g=c?f.domain(c):f;Uj?(d=d||function(){return 0},f=function(a,b){var c=g(a)+d(a);return b?c:Math.ceil(c)}):f=function(a,b){var c=g(a);return b?c:Math.ceil(c)};for(e in g)f[e]=g[e];return f.orgDomain=function(){return g.domain()},Uj&&(f.domain=function(a){return arguments.length?(g.domain(a),f):(a=this.orgDomain(),[a[0],a[1]+1])}),f}function $(a,b,c){var d=Y(a,b);return c&&d.domain(c),d}function _(a){return"y2"===db(a)?fh:eh}function ab(a){return"y2"===db(a)?ih:hh}function bb(a,b,c,d){var f=e(mg,Uj).scale(a).orient(b);return f.tickFormat(c).tickValues(d),Uj?(f.tickCentered(ii),Te(ki)&&(ki=!1)):f.tickOffset=function(){var a=Pc(ng.data.targets),b=dh(a[1])-dh(a[0]),c=b?b:di?Kg:Ig;return c/Nc()/2},f}function cb(a,b,c,d){return e(mg).scale(a).orient(b).tickFormat(c).ticks(d)}function db(a){return a in vh?vh[a]:"y"}function eb(){var a=Tj?ek:Uj?ed:function(a){return 0>a?a.toFixed(0):a};return ji&&("function"==typeof ji?a=ji:Tj&&(a=function(a){return a?dk(ji)(a):""})),a}function fb(a){var b;return"y"===a?b=Ai:"y2"===a?b=Ji:"x"===a&&(b=vi),b}function gb(a){var b=fb(a);return"string"==typeof b?b:b?b.text:null}function hb(a,b){var c=fb(a);"string"==typeof c?"y"===a?Ai=b:"y2"===a?Ji=b:"x"===a&&(vi=b):c&&(c.text=b)}function ib(a){return 10*Math.sin(Math.PI*(a/180))}function jb(a){return 11.5-2.5*(a/15)}function kb(a,b,c){a.selectAll(".tick text").style("text-anchor","start"),b.selectAll(".tick text").attr("y",jb(c)).attr("x",ib(c)).attr("transform","rotate("+c+")")}function lb(a,b){var c=fb(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}}function mb(){return lb("x",di?"inner-top":"inner-right")}function nb(){return lb("y",di?"inner-right":"inner-top")}function ob(){return lb("y2",di?"inner-right":"inner-top")}function pb(a){return"y2"===a?ob():"y"===a?nb():mb()}function qb(){return gb("x")}function rb(){return gb("y")}function sb(){return gb("y2")}function tb(a,b){return a?b.isLeft?0:b.isCenter?Ig/2:Ig:b.isBottom?-Kg:b.isMiddle?-Kg/2:0}function ub(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function vb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function wb(){return tb(!di,mb())}function xb(){return tb(di,nb())}function yb(){return tb(di,ob())}function zb(){return ub(!di,mb())}function Ab(){return ub(di,nb())}function Bb(){return ub(di,ob())}function Cb(){var a=mb();return di?a.isInner?"1.2em":-25-Ib("x"):a.isInner?"-0.5em":ti?ti-10:"3em"}function Db(){var a=nb();return di?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-Ib("y")}function Eb(){var a=ob();return di?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+Ib("y2")}function Fb(){return vb(!di,mb())}function Gb(){return vb(di,nb())}function Hb(){return vb(di,ob())}function Ib(a){var b,c,d,e=0;return Bk&&(b=Vc(ng.data.targets),"y"===a?(c=eh.copy().domain(cc(b,"y")),d=cb(c,jk,Ci,Ei)):"y2"===a?(c=fh.copy().domain(cc(b,"y2")),d=cb(c,kk,Li,Ni)):(c=dh.copy().domain(gc(b)),d=bb(c,ik,eb(),oi?oi:jh.tickValues())),Dk.append("g").call(d).each(function(){mg.select(this).selectAll("text").each(function(){var a=this.getBoundingClientRect();e<a.width&&(e=a.width)})}).remove()),vk=0>=e?vk:e}function Jb(a){var b=Dk.select("."+g.axisX+" ."+g.axisXLabel),c=Dk.select("."+g.axisY+" ."+g.axisYLabel),d=Dk.select("."+g.axisY2+" ."+g.axisY2Label);(a?b.transition():b).attr("x",wb).attr("dx",zb).attr("dy",Cb).text(qb),(a?c.transition():c).attr("x",xb).attr("dx",Ab).attr("dy",Db).attr("dy",Db).text(rb),(a?d.transition():d).attr("x",yb).attr("dx",Bb).attr("dy",Eb).text(sb)}function Kb(a){var b=!1;if(Wg(Vc(ng.data.targets)).forEach(function(c){b||c.data.id!==a.data.id||(b=!0,a=c)}),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),Ee(a.data)){var c=nj,d=oj,e=Math.abs(c)+d,f=Math.PI/e;a.startAngle=-1*(Math.PI/2)+f*Math.abs(c),a.endAngle=a.startAngle+f*(a.value>d?d:a.value)}return b?a:null}function Lb(){var a=mg.svg.arc().outerRadius(Og).innerRadius(Qg),b=function(b,c){var d;return c?a(b):(d=Kb(b),d?a(d):"M 0 0")};return b.centroid=a.centroid,b}function Mb(a){var b=mg.svg.arc().outerRadius(Pg*(a?a:1)).innerRadius(Qg);return function(a){var c=Kb(a);return c?b(c):"M 0 0"}}function Nb(a,b,c){return c||Ge(a.data)?Tg(a,b):"M 0 0"}function Ob(a){var b,c,d,e,f,g=Kb(a),h="";return g&&!ue(ng.data.targets)&&(b=Tg.centroid(g),c=isNaN(b[0])?0:b[0],d=isNaN(b[1])?0:b[1],e=Math.sqrt(c*c+d*d),f=Og&&e?(36/Og>.375?1.175-36/Og:.8)*Og/e:0,h="translate("+c*f+","+d*f+")"),h}function Pb(a){var b=ue(ng.data.targets)?Math.PI:2*Math.PI;return a?(a.endAngle-a.startAngle)/b:null}function Qb(a){return Ac({id:a.data.id,value:a.value,ratio:Pb(a)})}function Rb(a){var b,c,d,e;return Ub()?(b=Kb(a),c=b?b.value:null,d=Pb(b),ue(ng.data.targets)||Vb(d)?(e=Wb(),e?e(c,d):Pd(c,d)):""):""}function Sb(a,b){var c=Bk.selectAll("."+g.chartArc+Cd(a)),d=Bk.selectAll("."+g.arc).filter(function(b){return b.data.id!==a});Me(a)&&c.selectAll("path").transition().duration(50).attr("d",Ug).transition().duration(100).attr("d",Vg).each(function(a){Fe(a.data)}),b||d.style("opacity",.3)}function Tb(a){var b=Bk.selectAll("."+g.chartArc+Cd(a));b.selectAll("path."+g.arc).transition().duration(50).attr("d",Tg),Bk.selectAll("."+g.arc).style("opacity",1)}function Ub(){var a=!0;return ve(ng.data.targets)?a=uj:te(ng.data.targets)&&(a=cj),a}function Vb(a){var b=ve(ng.data.targets)?wj:ej;return a>=b}function Wb(){var a=dj;return ue(ng.data.targets)?a=lj:ve(ng.data.targets)&&(a=vj),a}function Xb(){return ve(ng.data.targets)?zj:""}function Yb(){var a=hj;return ue(ng.data.targets)?a=pj:ve(ng.data.targets)&&(a=Aj),"function"==typeof a?a:function(){}}function Zb(){var a=ij;return ue(ng.data.targets)?a=qj:ve(ng.data.targets)&&(a=Bj),"function"==typeof a?a:function(){}}function $b(){var a=jj;return ue(ng.data.targets)?a=rj:ve(ng.data.targets)&&(a=Cj),"function"==typeof a?a:function(){}}function _b(a,c,d,e){var f="ratio"===a.unit?e:1;return b(a[c])?a[c]*f:d}function ac(a){var b,c,d,e,f,g,h=Qc(a),i=ad(a);if(uh.length>0)for(g=cd(a),b=0;b<uh.length;b++)if(e=uh[b].filter(function(a){return h.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=0>a?a:0}),c=1;c<e.length;c++)f=e[c],i[f]&&i[f].forEach(function(a,b){db(f)!==db(d)||!i[d]||g&&+a>0||(i[d][b]+=+a)});return mg.min(Object.keys(i).map(function(a){return mg.min(i[a])}))}function bc(a){var b,c,d,e,f,g,h=Qc(a),i=ad(a);if(uh.length>0)for(g=dd(a),b=0;b<uh.length;b++)if(e=uh[b].filter(function(a){return h.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=a>0?a:0}),c=1;c<e.length;c++)f=e[c],i[f]&&i[f].forEach(function(a,b){db(f)!==db(d)||!i[d]||g&&0>+a||(i[d][b]+=+a)});return mg.max(Object.keys(i).map(function(a){return mg.max(i[a])}))}function cc(a,c){var d,e,f,g,h,i,j,k,l,m,n=a.filter(function(a){return db(a.id)===c}),o="y2"===c?Hi:yi,p="y2"===c?Gi:xi,q=b(o)?o:ac(n),r=b(p)?p:bc(n),s="y2"===c?Ii:zi,t=re(n)&&bj||qe(n),u=Jd()&&di,v=Jd()&&!di;return 0===n.length?"y2"===c?fh.domain():eh.domain():(q===r&&(0>q?r=0:q=0),l=q>=0&&r>=0,m=0>=q&&0>=r,t&&(l&&(q=0),m&&(r=0)),d=Math.abs(r-q),e=f=g=.1*d,s&&(h=Math.max(Math.abs(q),Math.abs(r)),r=h-s,q=s-h),u?(i=Kd(q,r,c,"width"),j=ic(eh.range()),k=[i[0]/j,i[1]/j],f+=d*(k[1]/(1-k[0]-k[1])),g+=d*(k[0]/(1-k[0]-k[1]))):v&&(i=Kd(q,r,c,"height"),f+=i[1],g+=i[0]),"y"===c&&Di&&(f=_b(Di,"top",e,d),g=_b(Di,"bottom",e,d)),"y2"===c&&Mi&&(f=_b(Mi,"top",e,d),g=_b(Mi,"bottom",e,d)),t&&(l&&(g=q),m&&(f=-r)),[q-g,r+f])}function dc(a){return ri?Tj?Pe(ri):ri:mg.min(a,function(a){return mg.min(a.values,function(a){return a.x})})}function ec(a){return qi?Tj?Pe(qi):qi:mg.max(a,function(a){return mg.max(a.values,function(a){return a.x})})}function fc(a){var c,d,e,f,g=Pc(a),h=g[1]-g[0];return Uj?d=0:re(a)?(c=Nc(),d=c>1?h/(c-1)/2:.5):d=.01*h,"object"==typeof si&&Ue(si)?(e=b(si.left)?si.left:d,f=b(si.right)?si.right:d):e=f="number"==typeof si?si:d,{left:e,right:f}}function gc(a){var b=[dc(a),ec(a)],c=b[0],d=b[1],e=fc(a),f=0,g=0;return c-d!==0||Uj||(c=Tj?new Date(.5*c.getTime()):-.5,d=Tj?new Date(1.5*d.getTime()):.5),(c||0===c)&&(f=Tj?new Date(c.getTime()-e.left):c-e.left),(d||0===d)&&(g=Tj?new Date(d.getTime()+e.right):d+e.right),[f,g]}function hc(a,b,c,d){return c&&(dh.domain(d?d:mg.extent(gc(a))),Ik=dh.domain(),wg&&Ak.scale(dh).updateScaleExtent(),gh.domain(dh.domain()),zk.scale(gh)),b&&(dh.domain(d?d:zk.empty()?Ik:zk.extent()),wg&&Ak.scale(dh).updateScaleExtent()),dh.domain()}function ic(a){return a[1]-a[0]}function jc(a){for(var b=0;b<a.length;b++)if(!(a[b]in og))return!1;return!0}function kc(a,b){og[a]=Kc(b)}function lc(a){for(var b=[],c=0;c<a.length;c++)a[c]in og&&b.push(Kc(og[a[c]]));return b}function mc(a){var b,c="y"===a.axis?eh:fh;return b="y"===a.axis||"y2"===a.axis?di?"start"in a?c(a.start):0:0:di?0:"start"in a?dh(Tj?Pe(a.start):a.start):0}function nc(a){var b,c="y"===a.axis?eh:fh;return b="y"===a.axis||"y2"===a.axis?di?0:"end"in a?c(a.end):0:di?"start"in a?dh(Tj?Pe(a.start):a.start):0:0}function oc(a){var b,c=mc(a),d="y"===a.axis?eh:fh;return b="y"===a.axis||"y2"===a.axis?di?"end"in a?d(a.end):Ig:Ig:di?Ig:"end"in a?dh(Tj?Pe(a.end):a.end):Ig,c>b?0:b-c}function pc(a){var b,c=nc(a),d="y"===a.axis?eh:fh;return b="y"===a.axis||"y2"===a.axis?di?Kg:"start"in a?d(a.start):Kg:di?"end"in a?dh(Tj?Pe(a.end):a.end):Kg:Kg,c>b?0:b-c}function qc(a){return!a.axis||"x"===a.axis}function rc(a){return nh&&a===nh||Ue(oh)&&Ve(oh,a)}function sc(a){return!rc(a)}function tc(a){return nh?nh:Ue(oh)?oh[a]:null}function uc(a,b){var c,d=b&&Ue(b)?Qc(b):[];return d.forEach(function(b){tc(b)===a&&(c=ng.data.xs[b])}),c}function vc(a,c){return a in ng.data.xs&&ng.data.xs[a]&&b(ng.data.xs[a][c])?ng.data.xs[a][c]:c}function wc(){var a=Object.keys(ng.data.xs);return a.length?ng.data.xs[a[0]]:null}function xc(a){var b=wc();return b&&a<b.length?b[a]:null}function yc(a){Object.keys(a).forEach(function(b){oh[b]=a[b]})}function zc(a){return 1===mg.set(Object.keys(a).map(function(b){return a[b]})).size()}function Ac(a){var b;return a&&(b=sh[a.id],a.name=b?b:a.id),a}function Bc(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null}function Cc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=Ec(b[d],a.id,d)}),ng.data.xs[a.id]=b})}function Dc(a,b){a.forEach(function(a){b[a.id]&&Cc([a],b[a.id])})}function Ec(a,c,d){var e;return e=Tj?Pe(a?a:vc(c,d)):Vj()&&!Uj?b(a)?+a:vc(c,d):d}function Fc(a){var b,c=mg.csv.parseRows(a);return 1===c.length?(b=[{}],c[0].forEach(function(a){b[0][a]=null})):b=mg.csv.parse(a),b}function Gc(a,b){var c,d,e=[];return b?(c=b.value,b.x&&(c.push(b.x),nh=b.x),e.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d="undefined"==typeof a[c]?null:a[c];b.push(d)}),e.push(b)}),d=Hc(e)):(Object.keys(a).forEach(function(b){e.push([b].concat(a[b]))}),d=Ic(e)),d}function Hc(a){var b,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++)e[d[c]]=a[b][c];f.push(e)}return f}function Ic(a){var b,d,e,f=[];for(b=0;b<a.length;b++)for(e=a[b][0],d=1;d<a[b].length;d++)c(f[d-1])&&(f[d-1]={}),f[d-1][e]=a[b][d];return f}function Jc(a,c){var d,e=mg.keys(a[0]).filter(sc),f=mg.keys(a[0]).filter(rc);return e.forEach(function(d){var e=tc(d);Vj()||Tj?f.indexOf(e)>=0?ng.data.xs[d]=(c&&ng.data.xs[d]?ng.data.xs[d]:[]).concat(a.map(function(a){return a[e]}).filter(b).map(function(a,b){return Ec(a,d,b)})):nh?ng.data.xs[d]=wc():Ue(oh)&&(ng.data.xs[d]=uc(e,ng.data.targets)):ng.data.xs[d]=a.map(function(a,b){return b})}),e.forEach(function(a){if(!ng.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),d=e.map(function(b,c){var d=rh(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=tc(b),g=a[f],h=Ec(g,b,e);return Vj()&&Uj&&0===c&&g&&(0===e&&(hi=[]),hi.push(g)),("undefined"==typeof a[b]||ng.data.xs[b].length<=e)&&(h=void 0),{x:h,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}}).filter(function(a){return"undefined"!=typeof a.x})}}),d.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++}),ng.data.xs[a.id].sort(function(a,b){return a-b})}),wh&&oe(Qc(d).filter(function(a){return!(a in xh)}),wh),d.forEach(function(a){kc(a.id_org,a)}),d}function Kc(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}}function Lc(a){var b=Bc(ng.data.targets[0].values,a-1);return b?b.x:null}function Mc(a){var b=Bc(ng.data.targets[0].values,a+1);return b?b.x:null}function Nc(){return mg.max(ng.data.targets,function(a){return a.values.length})}function Oc(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b}function Pc(a){var b,c,d=Oc(a);return d?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]}function Qc(a){return a.map(function(a){return a.id})}function Rc(a){return a?"string"==typeof a?[a]:a:Qc(ng.data.targets)}function Sc(a,b){var c,d=Qc(a);for(c=0;c<d.length;c++)if(d[c]===b)return!0;return!1}function Tc(a){return fk.indexOf(a)<0}function Uc(a){return gk.indexOf(a)<0}function Vc(a){return a.filter(function(a){return Tc(a.id)})}function Wc(a){var b=mg.set(mg.merge(a.map(function(a){return a.values.map(function(a){return a.x})}))).values();return b.map(Tj?function(a){return new Date(a)}:function(a){return+a})}function Xc(a,b){var c,d,e,f,g,h,i,j=a;if(b)if(c="function"==typeof b?b():b,1===c)j=[a[0]];else if(2===c)j=[a[0],a[a.length-1]];else if(c>2){for(f=c-2,d=a[0],e=a[a.length-1],g=(e-d)/(f+1),j=[d],h=0;f>h;h++)i=+d+g*(h+1),j.push(Tj?new Date(i):i);j.push(e)}return Tj||(j=j.sort(function(a,b){return a-b})),j}function Yc(a){fk=fk.concat(a)}function Zc(a){fk=fk.filter(function(b){return a.indexOf(b)<0})}function $c(a){gk=gk.concat(a)}function _c(a){gk=gk.filter(function(b){return a.indexOf(b)<0})}function ad(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b}function bd(a,b){var c,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1}function cd(a){return bd(a,function(a){return 0>a})}function dd(a){return bd(a,function(a){return a>0})}function ed(a){return a<hi.length?hi[a]:a}function fd(a,b){return" "+a+" "+a+Bd(b)}function gd(a){return fd(g.text,a.index)}function hd(a){return fd(g.texts,a.id)}function id(a){return fd(g.shape,a.index)}function jd(a){return fd(g.shapes,a.id)}function kd(a){return id(a)+fd(g.line,a.id)}function ld(a){return jd(a)+fd(g.lines,a.id)}function md(a){return id(a)+fd(g.circle,a.index)}function nd(a){return jd(a)+fd(g.circles,a.id)}function od(a){return id(a)+fd(g.bar,a.index)}function pd(a){return jd(a)+fd(g.bars,a.id)}function qd(a){return id(a.data)+fd(g.arc,a.data.id)}function rd(a){return jd(a.data)+fd(g.arcs,a.data.id)}function sd(a){return id(a)+fd(g.area,a.id)}function td(a){return jd(a)+fd(g.areas,a.id)}function ud(a,b){return fd(g.region,b)+" "+("class"in a?a.class:"")}function vd(a){return fd(g.eventRect,a.index)}function wd(a){var b=th[a],c="";return b&&(c=" "+g.target+"-"+b),fd(g.target,a)+c}function xd(a){return g.chartText+wd(a.id)}function yd(a){return g.chartLine+wd(a.id)}function zd(a){return g.chartBar+wd(a.id)}function Ad(a){return g.chartArc+wd(a.data.id)}function Bd(a){return a||0===a?"-"+(a.replace?a.replace(/([^a-zA-Z0-9-_])/g,"-"):a):""}function Cd(a){return"."+g.target+Bd(a)}function Dd(a){return a.length?a.map(function(a){return Cd(a)}):null}function Ed(a){return"."+g.legendItem+Bd(a)}function Fd(a){return a.length?a.map(function(a){return Ed(a)}):null}function Gd(a){return null!==a.value&&Kk[a.id]?1:0}function Hd(a){return b(a.value)?Ce(a)?.5:1:0}function Id(){return Jd()?1:0}function Jd(){return"boolean"==typeof yh&&yh?!0:"object"==typeof yh&&Ue(yh)?!0:!1}function Kd(a,b,c,d){var e=[0,0],f=1.3;return Hk.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return Qd(c)(a)}).each(function(a,b){e[b]=this.getBoundingClientRect()[d]*f}).remove(),e}function Ld(a){var b=a&&!ue(ng.data.targets)?Pd:Md,c=a&&!ue(ng.data.targets)?Pd:Nd;return function(a,d,e){var f="y2"===db(e)?c:b;return f(a,d)}}function Md(a){var b=Ci?Ci:Od;return b(a)}function Nd(a){var b=Li?Li:Od;return b(a)}function Od(a){return b(a)?+a:""}function Pd(a,b){return(100*b).toFixed(1)+"%"}function Qd(a){var c=function(a){return b(a)?+a:""};return"function"==typeof yh.format?c=yh.format:"object"==typeof yh.format&&"function"==typeof yh.format[a]&&(c=yh.format[a]),c}function Rd(a){return a?dh(a.x):null}function Sd(a){return Math.ceil(dh(Tj?Pe(a.value):a.value))}function Td(a){var b=a.axis&&"y2"===a.axis?fh:eh;return Math.ceil(b(a.value))}function Ud(a){return a?gh(a.x):null}function Vd(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);return e}function Wd(a,b,c,d){var e,f=c?c:0,g=d?d:a.length-1,h=Math.floor((g-f)/2)+f,i=a[h],j=dh(i.x)-b[di?1:0];return j>0?g=h:f=h,g-f===1||0===f&&0===g?(e=[],(a[f].x||0===a[f].x)&&(e=e.concat(Vd(a,f))),(a[g].x||0===a[g].x)&&(e=e.concat(Vd(a,g))),Yd(e,b)):Wd(a,b,f,g)}function Xd(a,b){var c;return c=a.map(function(a){return Wd(a.values,b)}),Yd(c,b)}function Yd(a,b){var c,d;return a.forEach(function(a){var e=We(a,b);(c>e||!c)&&(c=e,d=a)}),d}function Zd(a,b){return mg.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})}function $d(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}}function _d(){return zh&&"desc"===zh.toLowerCase()}function ae(){return zh&&"asc"===zh.toLowerCase()}function be(a){var b=ae(),c=_d();return b||c?a.sort(function(a,c){var d=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(d,0),f=c.values.reduce(d,0);return b?f-e:e-f}):"function"==typeof zh&&a.sort(zh),a}function ce(a,c){var d,e,f,g,h,i,j,k=we(ng.data.targets),l=a.filter(function(a){return a&&b(a.value)});0!==l.length&&Ej&&(Gk.html(Jj(a,eb(),Ld(k),ak)).style("display","block"),d=Gk.property("offsetWidth"),e=Gk.property("offsetHeight"),k?(g=Ig/2+c[0],i=Kg/2+c[1]+20):(di?(f=s(),g=f+c[0]+100,h=g+d,j=t()-y(),i=dh(l[0].x)+20):(f=s(),g=f+x()+dh(l[0].x)+20,h=g+d,j=f+t()-y(),i=c[1]+15),h>j&&(g-=h-j),i+e>u()&&(i-=e+30)),Gk.style("top",i+"px").style("left",g+"px"))}function de(){Gk.style("display","none")}function ee(a){var c=a.filter(function(a){return a&&b(a.value)});if(Ej&&!se(ng.data.targets)&&!we(ng.data.targets)){var d=Dk.selectAll("line."+g.xgridFocus);d.style("visibility","visible").data([c[0]]).attr(di?"y1":"x1",Rd).attr(di?"y2":"x2",Rd),Pf(d,"grid")}}function fe(){Dk.select("line."+g.xgridFocus).style("visibility","hidden")}function ge(a,b){var c,d,e,f,h=[],i=Dk.select("."+g.axisX).selectAll(".tick").size();if("year"===a)for(c=gc(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>i&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h}function he(a){var b,d,e={},f=0;return Vc(ng.data.targets.filter(a)).forEach(function(a){for(b=0;b<uh.length;b++)if(!(uh[b].indexOf(a.id)<0))for(d=0;d<uh[b].length;d++)if(uh[b][d]in e){e[a.id]=e[uh[b][d]];break}c(e[a.id])&&(e[a.id]=f++)}),e.__max__=f-1,e}function ie(a,b,c,d){var e=d?gh:dh;return function(d){var f=d.id in c?c[d.id]:0;return d.x||0===d.x?e(d.x)-a*(b/2-f):0}}function je(a){return function(b){var c=a?ab(b.id):_(b.id);return c(b.value)}}function ke(a,b,c){var d=be(Vc(ng.data.targets.filter(a))),e=d.map(function(a){return a.id});return function(a,f){var g=c?ab(a.id):_(a.id),h=g(0),i=h;return d.forEach(function(c){c.id!==a.id&&b[c.id]===b[a.id]&&e.indexOf(c.id)<e.indexOf(a.id)&&c.values[f].value*a.value>=0&&(i+=g(c.values[f].value)-h)}),i}}function le(a){return a.x||0===a.x?dh(a.x):null}function me(a,b){var c=he(xe),d=Df(c);return uh.length>0?d(a,b)[0][1]:_(a.id)(a.value)}function ne(a,b){return"number"==typeof _i?_i:b?2*a.tickOffset()*aj/b:0}function oe(a,b){Rc(a).forEach(function(a){Kk[a]=b===xh[a],xh[a]=b}),a||(wh=b)}function pe(a,b){var c=!1;return a.forEach(function(a){xh[a.id]===b&&(c=!0),a.id in xh||"line"!==b||(c=!0)}),c}function qe(a){return pe(a,"area")||pe(a,"area-spline")||pe(a,"area-step")}function re(a){return pe(a,"bar")}function se(a){return pe(a,"scatter")}function te(a){return"pie"===wh||pe(a,"pie")}function ue(a){return pe(a,"gauge")}function ve(a){return"donut"===wh||pe(a,"donut")}function we(a){return te(a)||ve(a)||ue(a)}function xe(a){var b="string"==typeof a?a:a.id;return!xh[b]||["line","spline","area","area-spline","step","area-step"].indexOf(xh[b])>=0}function ye(a){var b="string"==typeof a?a:a.id;return["step","area-step"].indexOf(xh[b])>=0}function ze(a){var b="string"==typeof a?a:a.id;return["spline","area-spline"].indexOf(xh[b])>=0}function Ae(a){var b="string"==typeof a?a:a.id;return["area","area-spline","area-step"].indexOf(xh[b])>=0}function Be(a){var b="string"==typeof a?a:a.id;return"bar"===xh[b]}function Ce(a){var b="string"==typeof a?a:a.id;return"scatter"===xh[b]}function De(a){var b="string"==typeof a?a:a.id;return"pie"===xh[b]}function Ee(a){var b="string"==typeof a?a:a.id;return"gauge"===xh[b]}function Fe(a){var b="string"==typeof a?a:a.id;return"donut"===xh[b]}function Ge(a){return De(a)||Fe(a)||Ee(a)}function He(a){return xe(a)?[a]:[]}function Ie(a){return Ge(a.data)?[a]:[]}function Je(a){return Be(a)?a.values:[]}function Ke(a){return xe(a)||Ce(a)?a.values:[]}function Le(a){return Be(a)||xe(a)?a.values:[]}function Me(a){return Fe(a)&&yj||Ee(a)&&mj||De(a)&&gj}function Ne(a,b,c){var d=[];return function(e){var f,g=e.id||e;return a[g]instanceof Function?f=a[g](e):a[g]?f=a[g]:(d.indexOf(g)<0&&d.push(g),f=b[d.indexOf(g)%b.length],a[g]=f),c instanceof Function?c(f,e):f}}function Oe(a,b){var c="value"===b.unit,d=b.values&&b.values.length?b.values:[],e=b.max||100;return function(b){var f,g,h=a[a.length-1];for(f=0;f<d.length;f++)if(g=c?b:100*b/e,g<d[f]){h=a[f];break}return h}}function Pe(b){var c;return c=b instanceof Date?b:"number"==typeof b?new Date(b):ck(ph).parse(b),(!c||isNaN(+c))&&a.console.error("Failed to parse x '"+b+"' to Date object"),c}function Qe(a,b){var c=mg.mouse(a),d=mg.select(a),e=1*d.attr("cx"),f=1*d.attr("cy");return Math.sqrt(Math.pow(e-c[0],2)+Math.pow(f-c[1],2))<b}function Re(a){var b=mg.mouse(a),c=a.getBoundingClientRect(),d=a.pathSegList.getItem(0),e=a.pathSegList.getItem(1),f=d.x,g=Math.min(d.y,e.y),h=c.width,i=c.height,j=2,k=f-j,l=f+h+j,m=g+i+j,n=g-j;return k<b[0]&&b[0]<l&&n<b[1]&&b[1]<m
}function Se(a,b){var c;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}function Te(a){return!a||"string"==typeof a&&0===a.length||"object"==typeof a&&0===Object.keys(a).length}function Ue(a){return Object.keys(a).length>0}function Ve(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function We(a,b){var c="y"===db(a.id)?eh:fh,d=di?1:0,e=di?0:1;return Math.pow(dh(a.x)-b[d],2)+Math.pow(c(a.value)-b[e],2)}function Xe(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})}function Ye(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b}function Ze(a,b,c){return d(a[b])?a[b]:c}function $e(a){return 10*Math.ceil(a/10)}function _e(a,b){var c;return mg.select("body").selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).text(a).each(function(){c=this.getBoundingClientRect()}).remove(),c}function af(a){return ze(a)?"cardinal":ye(a)?"step-after":"linear"}function bf(){return mg.selectAll([])}function cf(a,b,c){Mh.call(ng,b,a.node()),Dk.select("."+g.selectedCircles+Bd(b.id)).selectAll("."+g.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return fd(g.selectedCircle,c)}).attr("cx",di?me:le).attr("cy",di?le:me).attr("stroke",function(){return ak(b)}).attr("r",1.4*of(b)).transition().duration(100).attr("r",of)}function df(a,b,c){Nh.call(ng,b,a.node()),Dk.select("."+g.selectedCircles+Bd(b.id)).selectAll("."+g.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function ef(a,b,c,d){a?cf(b,c,d):df(b,c,d)}function ff(a,b){Mh.call(ng,b,a.node()),a.transition().duration(100).style("fill",function(){return mg.rgb(ak(b)).brighter(.75)})}function gf(a,b){Nh.call(ng,b,a.node()),a.transition().duration(100).style("fill",function(){return ak(b)})}function hf(a,b,c,d){a?ff(b,c,d):gf(b,c,d)}function jf(a,b,c,d){hf(a,b,c.data,d)}function kf(a){return"circle"===a.nodeName?ef:mg.select(a).classed(g.bar)?hf:jf}function lf(a){return a.filter(function(a){return b(a.value)})}function mf(a){return Vi&&!ye(a)?"function"==typeof Wi?Wi(a):Wi:0}function nf(a){return Xi?Yi?Yi:1.75*mf(a):mf(a)}function of(a){return Zi?Zi:4*mf(a)}function pf(a,c){return(c?Dk.selectAll("."+g.circles+Bd(c)):Dk).selectAll("."+g.circle+(b(a)?"-"+a:""))}function qf(a,b){pf(a,b).classed(g.EXPANDED,!0).attr("r",nf)}function rf(a){pf(a).filter(function(){return mg.select(this).classed(g.EXPANDED)}).classed(g.EXPANDED,!1).attr("r",mf)}function sf(a){return Dk.selectAll("."+g.bar+(b(a)?"-"+a:""))}function tf(a){sf(a).classed(g.EXPANDED,!0)}function uf(a){sf(a).classed(g.EXPANDED,!1)}function vf(a,b){var c=mg.svg.area(),d=Bf(a,b),e=b?ab:_,f=function(a,b){return uh.length>0?d(a,b)[0][1]:e(a.id)(0)},g=function(a,b){return uh.length>0?d(a,b)[1][1]:e(a.id)(a.value)};return c=di?c.x0(f).x1(g).y(Rd):c.x(Rd).y0(f).y1(g),function(a){var b,d=lf(a.values),e=0,f=0;return Ae(a)?b=c.interpolate(af(a))(d):(d[0]&&(e=dh(d[0].x),f=_(a.id)(d[0].value)),b=di?"M "+f+" "+e:"M "+e+" "+f),b?b:"M 0 0"}}function wf(a,b){var c=mg.svg.line(),d=Df(a,b),e=b?ab:_,f=b?Ud:Rd,g=function(a,b){return uh.length>0?d(a,b)[0][1]:e(a.id)(a.value)};return c=di?c.x(g).y(f):c.x(f).y(g),$i||(c=c.defined(function(a){return null!=a.value})),function(a){var d,f=$i?lf(a.values):a.values,g=b?g:gh,h=e(a.id),i=0,j=0;return xe(a)?d=Ah[a.id]?Ef(f,g,h,Ah[a.id]):c.interpolate(af(a))(f):(f[0]&&(i=g(f[0].x),j=h(f[0].value)),d=di?"M "+j+" "+i:"M "+i+" "+j),d?d:"M 0 0"}}function xf(a,b){var c=Cf(a,b);return function(a,b){var d=c(a,b),e=di?1:0,f=di?0:1,g="M "+d[0][e]+","+d[0][f]+" L"+d[1][e]+","+d[1][f]+" L"+d[2][e]+","+d[2][f]+" L"+d[3][e]+","+d[3][f]+" z";return g}}function yf(a,b){var c=Cf(a,!1),d=b?zf:Af;return function(a,b){return d(c(a,b),a,this)}}function zf(a,b,c){var d,e,f=c.getBoundingClientRect();return di?(e=Be(b)?4:6,d=a[2][1]+e*(b.value<0?-1:1)):d=a[0][0]+(a[2][0]-a[0][0])/2,d>Ig?Ig-f.width:d}function Af(a,b,c){var d,e=c.getBoundingClientRect();return d=di?(a[0][0]+a[2][0]+.6*e.height)/2:a[2][1]+(b.value<0?e.height:Be(b)?-3:-6),d<e.height?e.height:d}function Bf(a,b){var c=a.__max__+1,d=ie(0,c,a,!!b),e=je(!!b),f=ke(Ae,a,!!b),g=b?ab:_;return function(a,b){var c=g(a.id)(0),h=f(a,b)||c,i=d(a),j=e(a);return di&&(0<a.value&&c>j||a.value<0&&j>c)&&(j=c),[[i,h],[i,j-(c-h)]]}}function Cf(a,b){var c=a.__max__+1,d=ne(jh,c),e=ie(d,c,a,!!b),f=je(!!b),g=ke(Be,a,!!b),h=b?ab:_;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return di&&(0<a.value&&c>k||a.value<0&&k>c)&&(k=c),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function Df(a,b){var c=a.__max__+1,d=ie(0,c,a,!!b),e=je(!!b),f=ke(xe,a,!!b),g=b?ab:_;return function(a,b){var c=g(a.id)(0),h=f(a,b)||c,i=d(a),j=e(a);return di&&(0<a.value&&c>j||a.value<0&&j>c)&&(j=c),[[i,j-(c-h)]]}}function Ef(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s=-1,t="M",u=[];if(d(f))for(g=0;g<f.length;g++)u[g]={},u[g].start=c(f[g].start)?a[0].x:Tj?Pe(f[g].start):f[g].start,u[g].end=c(f[g].end)?a[a.length-1].x:Tj?Pe(f[g].end):f[g].end;for(q=di?function(a){return e(a.value)}:function(a){return b(a.x)},r=di?function(a){return b(a.x)}:function(a){return e(a.value)},i=Tj?function(a,c,d,f){var g=a.x.getTime(),h=c.x-a.x,i=new Date(g+h*d),j=new Date(g+h*(d+f));return"M"+b(i)+" "+e(k(d))+" "+b(j)+" "+e(k(d+f))}:function(a,c,d,f){return"M"+b(j(d),!0)+" "+e(k(d))+" "+b(j(d+f),!0)+" "+e(k(d+f))},g=0;g<a.length;g++){if(c(u)||!Se(a[g].x,u))t+=" "+q(a[g])+" "+r(a[g]);else for(j=Y(a[g-1].x,a[g].x,Tj),k=Y(a[g-1].value,a[g].value),l=b(a[g].x)-b(a[g-1].x),m=e(a[g].value)-e(a[g-1].value),n=Math.sqrt(Math.pow(l,2)+Math.pow(m,2)),o=2/n,p=2*o,h=o;1>=h;h+=p)t+=i(a[g-1],a[g],h,o);s=a[g].x}return t}function Ff(){var a=wg?Ak:function(){};Dk.select("."+g.zoomRect).call(a),Dk.selectAll("."+g.eventRect).call(a)}function Gf(){di?(hk.x.call(jh),hk.subx.call(mh)):(hk.y.call(kh),hk.y2.call(lh)),p(),W(),Uf(),o(!1)}function Hf(b){var c=new MutationObserver(function(d){d.forEach(function(d){if("childList"===d.type&&d.previousSibling){c.disconnect();var e=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(e),Gf(),Qf({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10)}})});c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0})}function If(b){var c,d,e,f,h=!0;if(Hk=mg.select(pg),Hk.empty()&&(Hk=mg.select(document.createElement("div")).style("opacity",0),Hf(Hk),h=!1),Hk.html("").classed("c3",!0),ng.data.xs={},ng.data.targets=Jc(b),Eh&&(ng.data.targets=ng.data.targets.filter(Eh)),Dh&&Yc(Dh===!0?Qc(ng.data.targets):Dh),ue(ng.data.targets)&&(Vh=!1),p(),W(),dh.domain(mg.extent(gc(ng.data.targets))),eh.domain(cc(ng.data.targets,"y")),fh.domain(cc(ng.data.targets,"y2")),gh.domain(dh.domain()),hh.domain(eh.domain()),ih.domain(fh.domain()),Ik=dh.domain(),zk.scale(gh),wg&&Ak.scale(dh),Bk=Hk.append("svg").style("overflow","hidden").on("mouseenter",function(){return Ag.call(ng)}).on("mouseleave",function(){return Bg.call(ng)}),Ck=Bk.append("defs"),Ck.append("clipPath").attr("id",Nj).append("rect"),Ck.append("clipPath").attr("id",Oj).append("rect"),Ck.append("clipPath").attr("id",Pj).append("rect"),Uf(),Dk=Bk.append("g").attr("transform",mk.main),Ek=Bk.append("g").attr("transform",mk.context),Fk=Bk.append("g").attr("transform",mk.legend),Rh||Ek.style("visibility","hidden"),Vh||(Fk.style("visibility","hidden"),gk=Qc(ng.data.targets)),Gk=Hk.style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),fg(Qc(ng.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1}),Dk.append("text").attr("class",g.text+" "+g.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),Dk.append("g").attr("clip-path",Qj).attr("class",g.regions),e=Dk.append("g").attr("clip-path",Qj).attr("class",g.grid),Oi&&e.append("g").attr("class",g.xgrids),Ui&&e.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),e.append("g").attr("class",g.xgridLines),Ri&&e.append("g").attr("class",g.ygrids),e.append("g").attr("class",g.ygridLines),Dk.append("g").attr("clip-path",Qj).attr("class",g.chart),d=Dk.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0),Dk.select("."+g.chart).append("g").attr("class",g.chartBars),Dk.select("."+g.chart).append("g").attr("class",g.chartLines),c=Dk.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",mk.arc),c.append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Xb()),ue(ng.data.targets)&&(c.append("path").attr("class",g.chartArcsBackground).attr("d",function(){var a={data:[{value:oj}],startAngle:-1*(Math.PI/2),endAngle:Math.PI/2};return Nb(a,!0,!0)}),c.append("text").attr("dy",".75em").attr("class",g.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none").text(kj?sj:""),c.append("text").attr("dx",-1*(Qg+(Og-Qg)/2)+"px").attr("dy","1.2em").attr("class",g.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none").text(kj?nj:""),c.append("text").attr("dx",Qg+(Og-Qg)/2+"px").attr("dy","1.2em").attr("class",g.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none").text(kj?oj:"")),Dk.select("."+g.chart).append("g").attr("class",g.chartTexts),Dk.insert("rect",yg?null:"g."+g.regions).attr("class",g.zoomRect).attr("width",Ig).attr("height",Kg).style("opacity",0).style("cursor",di?"ns-resize":"ew-resize").on("dblclick.zoom",null),ui&&zk.extent("function"!=typeof ui?ui:ui(gc())),hk.x=Dk.append("g").attr("class",g.axis+" "+g.axisX).attr("clip-path",Rj).attr("transform",mk.x).style("visibility",ei?"visible":"hidden"),hk.x.append("text").attr("class",g.axisXLabel).attr("transform",di?"rotate(-90)":"").style("text-anchor",Fb),hk.y=Dk.append("g").attr("class",g.axis+" "+g.axisY).attr("clip-path",Sj).attr("transform",mk.y).style("visibility",wi?"visible":"hidden"),hk.y.append("text").attr("class",g.axisYLabel).attr("transform",di?"":"rotate(-90)").style("text-anchor",Gb),hk.y2=Dk.append("g").attr("class",g.axis+" "+g.axisY2).attr("transform",mk.y2).style("visibility",Fi?"visible":"hidden"),hk.y2.append("text").attr("class",g.axisY2Label).attr("transform",di?"":"rotate(-90)").style("text-anchor",Hb),Ek.append("g").attr("clip-path",Qj).attr("class",g.chart),Ek.select("."+g.chart).append("g").attr("class",g.chartBars),Ek.select("."+g.chart).append("g").attr("class",g.chartLines),Ek.append("g").attr("clip-path",Qj).attr("class",g.brush).call(zk).selectAll("rect").attr(di?"width":"height",di?Jg:Lg),hk.subx=Ek.append("g").attr("class",g.axisX).attr("transform",mk.subx).attr("clip-path",di?"":Rj),Xf(ng.data.targets),h&&(Gf(),Qf({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),Kj){if(Tj&&"string"==typeof Lj){for(Lj=Pe(Lj),f=0;f<ng.data.targets[0].values.length&&ng.data.targets[0].values[f].x-Lj!==0;f++);Lj=f}Gk.html(Jj(ng.data.targets.map(function(a){return Ac(a.values[Lj])}),eb(),Ld(we(ng.data.targets)),ak)),Gk.style("top",Mj.top).style("left",Mj.left).style("display","block")}null==a.onresize&&(a.onresize=Tf()),a.onresize.add&&(a.onresize.add(function(){Cg.call(ng)}),a.onresize.add(function(){ng.flush()}),a.onresize.add(function(){Dg.call(ng)})),ng.element=Hk.node()}function Jf(a){a.append("rect").attr("class",vd).style("cursor",Fh&&Gh?"pointer":null).on("mouseover",function(a){var b,c,d=a.index;Xj||we(ng.data.targets)||(b=ng.data.targets.map(function(a){return Ac(Bc(a.values,d))}),c=[],Object.keys(sh).forEach(function(a){for(var d=0;d<b.length;d++)if(b[d]&&b[d].id===a){c.push(b[d]),b.shift(d);break}}),b=c.concat(b),Xi&&qf(d),tf(d),Dk.selectAll("."+g.shape+"-"+d).each(function(a){Kh.call(ng,a)}))}).on("mouseout",function(a){var b=a.index;we(ng.data.targets)||(fe(),de(),rf(b),uf(),Dk.selectAll("."+g.shape+"-"+b).each(function(a){Lh.call(ng,a)}))}).on("mousemove",function(a){var b,c=a.index,d=Bk.select("."+g.eventRect+"-"+c);Xj||we(ng.data.targets)||(b=Vc(ng.data.targets).map(function(a){return Ac(Bc(a.values,c))}),Fj&&(ce(b,mg.mouse(this)),ee(b)),(!Fj||Fh&&!Gh)&&Dk.selectAll("."+g.shape+"-"+c).each(function(){mg.select(this).classed(g.EXPANDED,!0),Fh&&d.style("cursor",Gh?"pointer":null),Fj||(fe(),de(),Gh||(rf(c),uf()))}).filter(function(a){return"circle"===this.nodeName?Qe(this,of(a)):"path"===this.nodeName?Re(this):void 0}).each(function(a){Fh&&(Gh||Hh(a))&&d.style("cursor","pointer"),Fj||(ce([a],mg.mouse(this)),ee([a]),Xi&&qf(c,a.id),tf(c,a.id))}))}).on("click",function(a){var b=a.index;if(!we(ng.data.targets))return Yj?void(Yj=!1):void Dk.selectAll("."+g.shape+"-"+b).each(function(a){Lf(this,a,b)})}).call(mg.behavior.drag().origin(Object).on("drag",function(){Mf(mg.mouse(this))}).on("dragstart",function(){Nf(mg.mouse(this))}).on("dragend",function(){Of()})).on("dblclick.zoom",null)}function Kf(a){a.append("rect").attr("x",0).attr("y",0).attr("width",Ig).attr("height",Kg).attr("class",g.eventRect).on("mouseout",function(){we(ng.data.targets)||(fe(),de(),rf())}).on("mousemove",function(){var a,b,c,d,e=Vc(ng.data.targets);Xj||we(e)||(a=mg.mouse(this),b=Xd(e,a),b&&(c=Ce(b)?[b]:Zd(e,b.x),d=c.map(function(a){return Ac(a)}),ce(d,a),Xi&&(rf(),qf(b.index,b.id)),ee(d),We(b,a)<100?(Bk.select("."+g.eventRect).style("cursor","pointer"),Zj||(Kh.call(ng,b),Zj=!0)):(Bk.select("."+g.eventRect).style("cursor",null),Lh.call(ng,b),Zj=!1)))}).on("click",function(){var a,b,c=Vc(ng.data.targets);we(c)||(a=mg.mouse(this),b=Xd(c,a),b&&We(b,a)<100&&Dk.select("."+g.circles+"-"+Bd(b.id)).select("."+g.circle+"-"+b.index).each(function(){Lf(this,b,b.index)}))}).call(mg.behavior.drag().origin(Object).on("drag",function(){Mf(mg.mouse(this))}).on("dragstart",function(){Nf(mg.mouse(this))}).on("dragend",function(){Of()})).on("dblclick.zoom",null)}function Lf(a,b,c){var d,e,f=mg.select(a),h=f.classed(g.SELECTED);"circle"===a.nodeName?(d=Qe(a,1.5*of(b)),e=ef):"path"===a.nodeName&&(f.classed(g.bar)?(d=Re(a),e=hf):(d=!0,e=jf)),(Gh||d)&&(Fh&&Hh(b)&&(Ih||Dk.selectAll("."+g.shapes+(Gh?Bd(b.id):"")).selectAll("."+g.shape).each(function(a,b){var c=mg.select(this);c.classed(g.SELECTED)&&e(!1,c.classed(g.SELECTED,!1),a,b)}),f.classed(g.SELECTED,!h),e(!h,f,b,c)),Jh.call(ng,b,a))}function Mf(a){var b,c,d,e,f,h,i,j;we(ng.data.targets)||Fh&&(!wg||Ak.altDomain)&&Ih&&(b=Wj[0],c=Wj[1],d=a[0],e=a[1],f=Math.min(b,d),h=Math.max(b,d),i=Gh?Fg.top:Math.min(c,e),j=Gh?Kg:Math.max(c,e),Dk.select("."+g.dragarea).attr("x",f).attr("y",i).attr("width",h-f).attr("height",j-i),Dk.selectAll("."+g.shapes).selectAll("."+g.shape).filter(function(a){return Hh(a)}).each(function(a,b){var c,d,e,k,l,m,n=mg.select(this),o=n.classed(g.SELECTED),p=n.classed(g.INCLUDED),q=!1;if(n.classed(g.circle))c=1*n.attr("cx"),d=1*n.attr("cy"),l=ef,q=c>f&&h>c&&d>i&&j>d;else{if(!n.classed(g.bar))return;m=$d(this),c=m.x,d=m.y,e=m.width,k=m.height,l=hf,q=!(c>h||f>c+e||d>j||i>d+k)}q^p&&(n.classed(g.INCLUDED,!p),n.classed(g.SELECTED,!o),l(!o,n,a,b))}))}function Nf(a){we(ng.data.targets)||Fh&&(Wj=a,Dk.select("."+g.chart).append("rect").attr("class",g.dragarea).style("opacity",.1),Xj=!0,Oh.call(ng))}function Of(){we(ng.data.targets)||Fh&&(Dk.select("."+g.dragarea).transition().duration(100).style("opacity",0).remove(),Dk.selectAll("."+g.shape).classed(g.INCLUDED,!1),Xj=!1,Ph.call(ng))}function Pf(a,b){"grid"===b&&a.each(function(){var a=mg.select(this),b=a.attr("x1"),c=a.attr("x2"),d=a.attr("y1"),e=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(c),y1:Math.ceil(d),y2:Math.ceil(e)})})}function Qf(a,c){var d,e,f,h,i,j,k,l,m,n,o,p,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb=he(Ae),cb=he(Be),eb=he(xe),fb=we(ng.data.targets),gb=Vc(ng.data.targets);if(d=h=p=u=bf(),a=a||{},E=Ze(a,"withY",!0),F=Ze(a,"withSubchart",!0),G=Ze(a,"withTransition",!0),J=Ze(a,"withTransform",!1),K=Ze(a,"withUpdateXDomain",!1),L=Ze(a,"withUpdateOrgXDomain",!1),M=Ze(a,"withLegend",!1),H=Ze(a,"withTransitionForExit",G),I=Ze(a,"withTransitionForAxis",G),W=G?Eg:0,X=H?W:0,Y=I?W:0,c=c||Vf(Y),M&&Vh&&fg(Qc(ng.data.targets),a,c),Uj&&0===gb.length&&dh.domain([0,hk.x.selectAll(".tick").size()]),gb.length?(hc(gb,K,L),oi||!ni&&!mi||($=Xc(Wc(gb),mi),jh.tickValues($),mh.tickValues($))):(jh.tickValues([]),mh.tickValues([])),eh.domain(cc(gb,"y")),fh.domain(cc(gb,"y2")),hk.x.style("opacity",fb?0:1),hk.y.style("opacity",fb?0:1),hk.y2.style("opacity",fb?0:1),hk.subx.style("opacity",fb?0:1),c.axisX.call(jh),c.axisY.call(kh),c.axisY2.call(lh),c.axisSubX.call(mh),Jb(G),K&&gb.length)if(ki&&$){for(_=1;_<$.length;_++)if($.length/_<li){ab=_;break}Bk.selectAll("."+g.axisX+" .tick text").each(function(a){var b=$.indexOf(a);b>=0&&mg.select(this).style("display",b%ab?"none":"block")})}else Bk.selectAll("."+g.axisX+" .tick text").style("display","block");!di&&pi&&kb(hk.x,c.axisX,pi),N=vf(bb,!1),P=xf(cb),S=wf(eb,!1),U=yf(cb,!0),V=yf(cb,!1),hh.domain(eh.domain()),ih.domain(fh.domain()),Gk.style("display","none"),q(),Dk.select("text."+g.text+"."+g.empty).attr("x",Ig/2).attr("y",Kg/2).text(Qh).transition().style("opacity",gb.length?0:1),Dk.select("line."+g.xgridFocus).style("visibility","hidden"),Oi&&(e=di?{x1:0,x2:Ig,y1:function(a){return dh(a)-B},y2:function(a){return dh(a)-B}}:{x1:function(a){return dh(a)+B},x2:function(a){return dh(a)+B},y1:Fg.top,y2:Kg},(m=function(a){f=ge(Pi,dh),B=Uj?jh.tickOffset():0,d=Dk.select("."+g.xgrids).selectAll("."+g.xgrid).data(f),d.enter().append("line").attr("class",g.xgrid),a||d.attr(e).style("opacity",function(){return+mg.select(this).attr(di?"y1":"x1")===(di?Kg:0)?0:1}),d.exit().remove()})()),h=Dk.select("."+g.xgridLines).selectAll("."+g.xgridLine).data(Qi),i=h.enter().append("g").attr("class",function(a){return g.xgridLine+(a.class?" "+a.class:"")}),i.append("line").style("opacity",0),i.append("text").attr("text-anchor","end").attr("transform",di?"":"rotate(-90)").attr("dx",di?0:-Fg.top).attr("dy",-5).style("opacity",0),h.exit().transition().duration(W).style("opacity",0).remove(),E&&Ri&&(j=Dk.select("."+g.ygrids).selectAll("."+g.ygrid).data(eh.ticks(Ti)),j.enter().append("line").attr("class",g.ygrid),j.attr("x1",di?eh:0).attr("x2",di?eh:Ig).attr("y1",di?0:eh).attr("y2",di?Kg:eh),j.exit().remove(),Pf(j,"grid")),E&&(k=Dk.select("."+g.ygridLines).selectAll("."+g.ygridLine).data(Si),l=k.enter().append("g").attr("class",function(a){return g.ygridLine+(a.class?" "+a.class:"")}),l.append("line").style("opacity",0),l.append("text").attr("text-anchor","end").attr("transform",di?"rotate(-90)":"").attr("dx",di?0:-Fg.top).attr("dy",-5).style("opacity",0),k.select("line").transition().duration(W).attr("x1",di?Td:0).attr("x2",di?Td:Ig).attr("y1",di?0:Td).attr("y2",di?Kg:Td).style("opacity",1),k.select("text").transition().duration(W).attr("x",di?0:Ig).attr("y",Td).text(function(a){return a.text}).style("opacity",1),k.exit().transition().duration(W).style("opacity",0).remove()),t=Dk.select("."+g.regions).selectAll("."+g.region).data(Dj),t.enter().append("g").attr("class",ud).append("rect").style("fill-opacity",0),t.exit().transition().duration(W).style("opacity",0).remove(),r=Dk.selectAll("."+g.bars).selectAll("."+g.bar).data(Je),r.enter().append("path").attr("class",od).style("stroke",function(a){return ak(a.id)}).style("fill",function(a){return ak(a.id)}),r.style("opacity",Gd),r.exit().transition().duration(X).style("opacity",0).remove(),n=Dk.selectAll("."+g.lines).selectAll("."+g.line).data(He),n.enter().append("path").attr("class",kd).style("stroke",ak),n.style("opacity",Gd).attr("transform",null),n.exit().transition().duration(X).style("opacity",0).remove(),o=Dk.selectAll("."+g.areas).selectAll("."+g.area).data(He),o.enter().append("path").attr("class",sd).style("fill",ak).style("opacity",function(){return Jk=+mg.select(this).style("opacity"),0}),o.style("opacity",Jk),o.exit().transition().duration(X).style("opacity",0).remove(),Vi&&(p=Dk.selectAll("."+g.circles).selectAll("."+g.circle).data(Ke),p.enter().append("circle").attr("class",md).attr("r",mf).style("fill",ak),p.style("opacity",Gd),p.exit().remove()),Jd()&&(u=Dk.selectAll("."+g.texts).selectAll("."+g.text).data(Le),u.enter().append("text").attr("class",gd).attr("text-anchor",function(a){return di?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",ak).style("fill-opacity",0),u.text(function(a){return Qd(db(a.id))(a.value,a.id)}),u.exit().transition().duration(X).style("fill-opacity",0).remove()),s=Dk.selectAll("."+g.arcs).selectAll("."+g.arc).data(Ie),s.enter().append("path").attr("class",qd).style("fill",function(a){return ak(a.data)}).style("cursor",function(a){return Hh(a)?"pointer":null}).style("opacity",0).each(function(a){Ee(a.data)&&(a.startAngle=a.endAngle=-1*(Math.PI/2)),this._current=a}).on("mouseover",function(a,b){var c,d,e;$j||(c=Kb(a),d=Qb(c),e=Zb(),Sb(c.data.id),bg(c.data.id,!0),e.call(ng,d,b))}).on("mousemove",function(a){var b=Kb(a),c=Qb(b),d=[c];ce(d,mg.mouse(this))}).on("mouseout",function(a,b){var c,d,e;$j||(c=Kb(a),d=Qb(c),e=$b(),Tb(c.data.id),cg(),de(),e.call(ng,d,b))}).on("click",function(a,b){var c=Kb(a),d=Qb(c),e=Yb();Lf(this,a,b),e.call(ng,d,b)}),s.attr("transform",function(a){return!Ee(a.data)&&J?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).each(function(){$j=!0}).transition().duration(W).attrTween("d",function(a){var b,c=Kb(a);return c?(isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=mg.interpolate(this._current,c),this._current=b(0),function(a){return Nb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",J?"scale(1)":"").style("fill",function(a){return bk?bk(a.data.values[0].value):ak(a.data.id)}).style("opacity",1).call(Xe,function(){$j=!1}),s.exit().transition().duration(X).style("opacity",0).remove(),Dk.selectAll("."+g.chartArc).select("text").style("opacity",0).attr("class",function(a){return Ee(a.data)?g.gaugeValue:""}).text(Rb).attr("transform",Ob).transition().duration(W).style("opacity",function(a){return Tc(a.data.id)&&Ge(a.data)?1:0}),Dk.select("."+g.chartArcsTitle).style("opacity",ve(ng.data.targets)||ue(ng.data.targets)?1:0),Rh&&(mg.event&&"zoom"===mg.event.type&&zk.extent(dh.orgDomain()).update(),F&&(!di&&pi&&kb(hk.subx,c.axisSubX,pi),zk.empty()||zk.extent(dh.orgDomain()).update(),O=vf(bb,!0),R=xf(cb,!0),T=wf(eb,!0),x=Ek.selectAll("."+g.bars).selectAll("."+g.bar).data(Je),x.enter().append("path").attr("class",od).style("stroke","none").style("fill",ak),x.style("opacity",Gd).transition().duration(W).attr("d",R).style("opacity",1),x.exit().transition().duration(W).style("opacity",0).remove(),v=Ek.selectAll("."+g.lines).selectAll("."+g.line).data(He),v.enter().append("path").attr("class",kd).style("stroke",ak),v.style("opacity",Gd).transition().duration(W).attr("d",T).style("opacity",1),v.exit().transition().duration(W).style("opacity",0).remove(),w=Ek.selectAll("."+g.areas).selectAll("."+g.area).data(He),w.enter().append("path").attr("class",sd).style("fill",ak).style("opacity",function(){return Jk=+mg.select(this).style("opacity"),0}),w.style("opacity",0).transition().duration(W).attr("d",O).style("fill",ak).style("opacity",Jk),w.exit().transition().duration(X).style("opacity",0).remove())),Dk.selectAll("."+g.selectedCircles).filter(function(a){return Be(a)}).selectAll("circle").remove(),zg&&(y=Dk.select("."+g.eventRects).style("cursor",wg?di?"ns-resize":"ew-resize":null),Ue(oh)&&!zc(oh)?(y.classed(g.eventRectsMultiple)||y.classed(g.eventRectsMultiple,!0).classed(g.eventRectsSingle,!1).selectAll("."+g.eventRect).remove(),z=Dk.select("."+g.eventRects).selectAll("."+g.eventRect).data([0]),Kf(z.enter()),z.attr("x",0).attr("y",0).attr("width",Ig).attr("height",Kg)):(y.classed(g.eventRectsSingle)||y.classed(g.eventRectsMultiple,!1).classed(g.eventRectsSingle,!0).selectAll("."+g.eventRect).remove(),!Vj()&&!Tj||Uj?(D=Q(),C=function(a){return dh(a.x)-D/2}):(D=function(a){var b=Lc(a.index),c=Mc(a.index),d=ng.data.xs[a.id][a.index],e=(dh(c?c:d)-dh(b?b:d))/2;return 0>e?0:e},C=function(a){var b=Lc(a.index),c=ng.data.xs[a.id][a.index];return(dh(c)+dh(b?b:c))/2}),A=Oc(ng.data.targets),Dk.select("."+g.eventRects).datum(A?A.values:[]),z=Dk.select("."+g.eventRects).selectAll("."+g.eventRect).data(function(a){return a}),Jf(z.enter()),z.attr("class",vd).attr("x",di?0:C).attr("y",di?C:0).attr("width",di?Ig:D).attr("height",di?D:Kg),z.exit().remove())),mg.transition().duration(W).each(function(){var c=[];c.push(r.transition().attr("d",P).style("fill",ak).style("opacity",1)),c.push(n.transition().attr("d",S).style("stroke",ak).style("opacity",1)),c.push(o.transition().attr("d",N).style("fill",ak).style("opacity",Jk)),c.push(p.transition().style("opacity",Hd).style("fill",ak).attr("cx",di?me:le).attr("cy",di?le:me)),c.push(Dk.selectAll("."+g.selectedCircle).transition().attr("cx",di?me:le).attr("cy",di?le:me)),c.push(u.transition().attr("x",U).attr("y",V).style("fill",ak).style("fill-opacity",a.flow?0:Id)),c.push(t.selectAll("rect").transition().attr("x",mc).attr("y",nc).attr("width",oc).attr("height",pc).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1})),c.push(h.select("line").transition().attr("x1",di?0:Sd).attr("x2",di?Ig:Sd).attr("y1",di?Sd:Fg.top).attr("y2",di?Sd:Kg).style("opacity",1)),c.push(h.select("text").transition().attr("x",di?Ig:0).attr("y",Sd).text(function(a){return a.text}).style("opacity",1)),a.flow&&(Z=Ye(),c.forEach(function(a){Z.add(a)}))}).call(Z?Z:function(){},function(){var b,c,f,i=1,j=a.flow.index,k=a.flow.length,l=Bc(ng.data.targets[0].values,j),q=Bc(ng.data.targets[0].values,j+k),s=dh.domain(),v=a.flow.duration||W,w=a.flow.done||function(){},x=Ye();ng.data.targets.forEach(function(a){a.values.splice(0,k)}),f=hc(gb,!0,!0),m&&m(!0),a.flow.orgDataCount?b=1===a.flow.orgDataCount||l.x===q.x?dh(s[0])-dh(f[0]):Tj?dh(s[0])-dh(f[0]):dh(l.x)-dh(q.x):1!==ng.data.targets[0].values.length?b=dh(s[0])-dh(f[0]):Tj?(l=Bc(ng.data.targets[0].values,0),q=Bc(ng.data.targets[0].values,ng.data.targets[0].values.length-1),b=dh(l.x)-dh(q.x)):b=ic(f)/2,i=ic(s)/ic(f),c="translate("+b+",0) scale("+i+",1)",mg.transition().ease("linear").duration(v).each(function(){x.add(hk.x.transition().call(jh)),x.add(r.transition().attr("transform",c)),x.add(n.transition().attr("transform",c)),x.add(o.transition().attr("transform",c)),x.add(p.transition().attr("transform",c)),x.add(u.transition().attr("transform",c)),x.add(t.filter(qc).transition().attr("transform",c)),x.add(d.transition().attr("transform",c)),x.add(h.transition().attr("transform",c))}).call(x,function(){var a,b=[],c=[],f=[];if(k){for(a=0;k>a;a++)b.push("."+g.shape+"-"+(j+a)),c.push("."+g.text+"-"+(j+a)),f.push("."+g.eventRect+"-"+(j+a));Bk.selectAll("."+g.shapes).selectAll(b).remove(),Bk.selectAll("."+g.texts).selectAll(c).remove(),Bk.selectAll("."+g.eventRects).selectAll(f).remove(),Bk.select("."+g.xgrid).remove()}d.attr("transform",null).attr(e),h.attr("transform",null),h.select("line").attr("x1",di?0:Sd).attr("x2",di?Ig:Sd),h.select("text").attr("x",di?Ig:0).attr("y",Sd),r.attr("transform",null).attr("d",P),n.attr("transform",null).attr("d",S),o.attr("transform",null).attr("d",N),p.attr("transform",null).attr("cx",di?me:le).attr("cy",di?le:me),u.attr("transform",null).attr("x",U).attr("y",V).style("fill-opacity",Id),t.attr("transform",null),t.select("rect").filter(qc).attr("x",mc).attr("width",oc),z.attr("x",di?0:C).attr("y",di?C:0).attr("width",di?Ig:D).attr("height",di?D:Kg),w()})}),Qc(ng.data.targets).forEach(function(a){Kk[a]=!0}),Ff()}function Rf(){Qf({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function Sf(){if(wg&&0!==Vc(ng.data.targets).length){if("mousemove"===mg.event.sourceEvent.type&&Ak.altDomain)return dh.domain(Ak.altDomain),void Ak.scale(dh).updateScaleExtent();Uj&&dh.orgDomain()[0]===Ik[0]&&dh.domain([Ik[0]-1e-10,dh.orgDomain()[1]]),Qf({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===mg.event.sourceEvent.type&&(Yj=!0)}}function Tf(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function Uf(){Bk.attr("width",Mg).attr("height",Ng),Bk.select("#"+Nj).select("rect").attr("width",Ig).attr("height",Kg),Bk.select("#"+Oj).select("rect").attr("x",G).attr("y",H).attr("width",M).attr("height",N),Bk.select("#"+Pj).select("rect").attr("x",I).attr("y",J).attr("width",O).attr("height",P),Bk.select("."+g.zoomRect).attr("width",Ig).attr("height",Kg),Hk.style("max-height",Ng+"px")}function Vf(a){return{axisX:a?hk.x.transition().duration(a):hk.x,axisY:a?hk.y.transition().duration(a):hk.y,axisY2:a?hk.y2.transition().duration(a):hk.y2,axisSubX:a?hk.subx.transition().duration(a):hk.subx}}function Wf(a){var b;a=a||{},a.withTransition=Ze(a,"withTransition",!0),a.withTransform=Ze(a,"withTransform",!1),a.withLegend=Ze(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,p(),a.withLegend&&Vh||(b=Vf(a.withTransitionForAxis?Eg:0),W(),Uf(),o(a.withTransition,b)),Qf(a,b)}function Xf(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=Dk.select("."+g.chartTexts).selectAll("."+g.chartText).data(a).attr("class",xd),j=i.enter().append("g").attr("class",xd).style("opacity",0).style("pointer-events","none"),j.append("g").attr("class",hd),e=Dk.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",zd),d=e.enter().append("g").attr("class",zd).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",pd).style("cursor",function(a){return Hh(a)?"pointer":null}),c=Dk.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",yd),b=c.enter().append("g").attr("class",yd).style("opacity",0).style("pointer-events","none"),b.append("g").attr("class",ld),b.append("g").attr("class",td),b.append("g").attr("class",function(a){return fd(g.selectedCircles,a.id)}),b.append("g").attr("class",nd).style("cursor",function(a){return Hh(a)?"pointer":null}),a.forEach(function(a){Dk.selectAll("."+g.selectedCircles+Bd(a.id)).selectAll("."+g.selectedCircle).each(function(b){b.value=a.values[b.index].value})}),h=Dk.select("."+g.chartArcs).selectAll("."+g.chartArc).data(Wg(a)).attr("class",Ad),f=h.enter().append("g").attr("class",Ad),f.append("g").attr("class",rd),f.append("text").attr("dy",ue(ng.data.targets)?"-0.35em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),Rh&&(n=Ek.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",zd),m=n.enter().append("g").style("opacity",0).attr("class",zd),m.append("g").attr("class",pd),l=Ek.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",yd),k=l.enter().append("g").style("opacity",0).attr("class",yd),k.append("g").attr("class",ld),k.append("g").attr("class",td)),Bk.selectAll("."+g.target).filter(function(a){return Tc(a.id)}).transition().duration(Eg).style("opacity",1)}function Yf(a,b){a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){b.types?oe(a.id,b.types[a.id]):oe(a.id,b.type)}),ng.data.targets.forEach(function(b){for(var c=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),ng.data.targets=ng.data.targets.concat(a)),Xf(ng.data.targets),Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b.done&&b.done()}function Zf(a){a.data?Yf(Jc(a.data),a):a.url?mg.csv(a.url,function(b,c){Yf(Jc(c),a)}):a.json?Yf(Jc(Gc(a.json,a.keys)),a):a.rows?Yf(Jc(Hc(a.rows)),a):a.columns?Yf(Jc(Ic(a.columns)),a):Yf(null,a)}function $f(a,b){return"function"!=typeof b&&(b=function(){}),a=a.filter(function(a){return Sc(ng.data.targets,a)}),a&&0!==a.length?(Bk.selectAll(a.map(function(a){return Cd(a)})).transition().style("opacity",0).remove().call(Xe,b),void a.forEach(function(a){Kk[a]=!1,Fk.selectAll("."+g.legendItem+Bd(a)).remove(),ng.data.targets=ng.data.targets.filter(function(b){return b.id!==a})})):void b()}function _f(a){return a.classed(g.legendItemHidden)?uk:1
}function ag(a){return a.classed(g.legendItemHidden)?uk:.3}function bg(a,b){Fk.selectAll("."+g.legendItem).transition().duration(100).style("opacity",function(c){var d=mg.select(this);return a&&c!==a?b?ag(d):_f(d):b?_f(d):ag(d)})}function cg(){Fk.selectAll("."+g.legendItem).transition().duration(100).style("opacity",function(){return _f(mg.select(this))})}function dg(a){Vh||(Vh=!0,Fk.style("visibility","visible")),_c(a),Fk.selectAll(Fd(a)).style("visibility","visible").transition().style("opacity",function(){return _f(mg.select(this))})}function eg(a){Vh&&Te(a)&&(Vh=!1,Fk.style("visibility","hidden")),$c(a),Fk.selectAll(Fd(a)).style("opacity",0).style("visibility","hidden")}function fg(a,b,c){function e(b,c,d){function e(a,b){b||(f=(m-z-l)/2,y>f&&(f=(m-l)/2,z=0,F++)),E[a]=F,D[F]=ok?10:f,A[a]=z,z+=l}var f,h,i=_e(b.textContent,g.legendItem),j=10*Math.ceil((i.width+v)/10),k=10*Math.ceil((i.height+u)/10),l=nk||ok?k:j,m=nk||ok?V():U();return d&&(z=0,F=0,w=0,x=0),Vh&&!Uc(c)?void(B[c]=C[c]=E[c]=A[c]=0):(B[c]=j,C[c]=k,(!w||j>=w)&&(w=j),(!x||k>=x)&&(x=k),h=nk||ok?x:w,void(ci?(Object.keys(B).forEach(function(a){B[a]=w}),Object.keys(C).forEach(function(a){C[a]=x}),f=(m-h*a.length)/2,y>f?(z=0,F=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var f,h,i,j,k,l,m,n,q,r,s,t,u=4,v=36,w=0,x=0,y=10,z=0,A={},B={},C={},D=[0],E={},F=0,G=Fk.selectAll("."+g.legendItemFocused).size();b=b||{},n=Ze(b,"withTransition",!0),q=Ze(b,"withTransitionForTransform",!0),nk?(f=function(a){return w*E[a]},j=function(a){return D[E[a]]+A[a]}):ok?(f=function(a){return w*E[a]+10},j=function(a){return D[E[a]]+A[a]}):(f=function(a){return D[E[a]]+A[a]},j=function(a){return x*E[a]}),h=function(a,b){return f(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return f(a,b)-4},l=function(a,b){return j(a,b)-7},m=Fk.selectAll("."+g.legendItem).data(a).enter().append("g").attr("class",function(a){return fd(g.legendItem,a)}).style("visibility",function(a){return Uc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof _h?_h.call(ng,a):ng.toggle(a)}).on("mouseover",function(a){mg.select(this).classed(g.legendItemFocused,!0),$j||ng.focus(a),"function"==typeof ai&&ai.call(ng,a)}).on("mouseout",function(a){mg.select(this).classed(g.legendItemFocused,!1),$j||ng.revert(),"function"==typeof bi&&bi.call(ng,a)}),m.append("text").text(function(a){return d(sh[a])?sh[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",nk||ok?h:-200).attr("y",nk||ok?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",nk||ok?i:-200).attr("y",nk||ok?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",ak).attr("x",nk||ok?h:-200).attr("y",nk||ok?-200:j).attr("width",10).attr("height",10),ok&&0!==w&&Fk.insert("g","."+g.legendItem).attr("class",g.legendBackground).append("rect").attr("height",V()-10).attr("width",w*(F+1)+10),r=Fk.selectAll("text").data(a).text(function(a){return d(sh[a])?sh[a]:a}).each(function(a,b){e(this,a,0===b)}),(n?r.transition():r).attr("x",h).attr("y",k),s=Fk.selectAll("rect."+g.legendItemEvent).data(a),(n?s.transition():s).attr("width",function(a){return B[a]}).attr("height",function(a){return C[a]}).attr("x",i).attr("y",l),t=Fk.selectAll("rect."+g.legendItemTile).data(a),(n?t.transition():t).style("fill",ak).attr("x",f).attr("y",j),Fk.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Tc(a)}).transition().style("opacity",function(a){var b=mg.select(this);return Tc(a)?!G||b.classed(g.legendItemFocused)?_f(b):ag(b):uk}),S(w),T(x),R(F),p(),W(),Uf(),o(q,c)}function gg(a){return Sc(ng.data.targets,a.id)}function hg(a){return"data"in a&&Sc(ng.data.targets,a.data.id)}function ig(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(d){("value"in d&&b.value===a.value||"class"in d&&b.class===a.class)&&(c=!0)}),c}:function(){return!0}}function jg(a,b){var c=ig(a),d=function(a){return!c(a)},e=b?g.xgridLines:g.ygridLines,f=b?g.xgridLine:g.ygridLine;Dk.select("."+e).selectAll("."+f).filter(c).transition().duration(Eg).style("opacity",0).remove(),b?Qi=Qi.filter(d):Si=Si.filter(d)}function kg(a,b,c){var d=!we(ng.data.targets);$j=!1,oe(a,b),Wf(c||{withTransitionForAxis:d})}function lg(a){var b=a.mimeType?a.mimeType:"csv";mg.xhr(a.url,function(c,d){var e;e="json"===b?Gc(JSON.parse(d.response),a.keys):Fc(d.response),If(e)})}var mg=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,ng={data:{},axis:{},legend:{}},og={},pg=i(["bindto"],"#chart"),qg=i(["size","width"]),rg=i(["size","height"]),sg=i(["padding","left"]),tg=i(["padding","right"]),ug=i(["padding","top"]),vg=i(["padding","bottom"]),wg=i(["zoom","enabled"],!1),xg=i(["zoom","extent"]),yg=i(["zoom","privileged"],!1),zg=i(["interaction","enabled"],!0),Ag=i(["onmouseover"],function(){}),Bg=i(["onmouseout"],function(){}),Cg=i(["onresize"],function(){}),Dg=i(["onresized"],function(){}),Eg=i(["transition","duration"],350);h("data","data is required in config");var Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg,Rg,Sg,Tg,Ug,Vg,Wg,Xg,Yg,Zg,$g,_g,ah,bh,ch,dh,eh,fh,gh,hh,ih,jh,kh,lh,mh,nh=i(["data","x"]),oh=i(["data","xs"],{}),ph=i(["data","x_format"],"%Y-%m-%d"),qh=i(["data","x_localtime"],!0),rh=i(["data","id_converter"],function(a){return a}),sh=i(["data","names"],{}),th=i(["data","classes"],{}),uh=i(["data","groups"],[]),vh=i(["data","axes"],{}),wh=i(["data","type"]),xh=i(["data","types"],{}),yh=i(["data","labels"],{}),zh=i(["data","order"]),Ah=i(["data","regions"],{}),Bh=i(["data","color"]),Ch=i(["data","colors"],{}),Dh=i(["data","hide"],!1),Eh=i(["data","filter"]),Fh=i(["data","selection","enabled"],!1),Gh=i(["data","selection","grouped"],!1),Hh=i(["data","selection","isselectable"],function(){return!0}),Ih=i(["data","selection","multiple"],!0),Jh=i(["data","onclick"],function(){}),Kh=i(["data","onmouseover"],function(){}),Lh=i(["data","onmouseout"],function(){}),Mh=i(["data","onselected"],function(){}),Nh=i(["data","onunselected"],function(){}),Oh=i(["data","ondragstart"],function(){}),Ph=i(["data","ondragend"],function(){}),Qh=i(["data","empty","label","text"],""),Rh=i(["subchart","show"],!1),Sh=i(["subchart","size","height"],60),Th=i(["color","pattern"],[]),Uh=i(["color","threshold"],{}),Vh=i(["legend","show"],!0),Wh=i(["legend","position"],"bottom"),Xh=i(["legend","inset","anchor"],"top-left"),Yh=i(["legend","inset","x"],10),Zh=i(["legend","inset","y"],0),$h=i(["legend","inset","step"]),_h=i(["legend","item","onclick"]),ai=i(["legend","item","onmouseover"]),bi=i(["legend","item","onmouseout"]),ci=i(["legend","equally"],!1),di=i(["axis","rotated"],!1),ei=i(["axis","x","show"],!0),fi=i(["axis","x","type"],"indexed"),gi=i(["axis","x","localtime"],!0),hi=i(["axis","x","categories"],[]),ii=i(["axis","x","tick","centered"],!1),ji=i(["axis","x","tick","format"]),ki=i(["axis","x","tick","culling"],{}),li=i(["axis","x","tick","culling","max"],10),mi=i(["axis","x","tick","count"]),ni=i(["axis","x","tick","fit"],!0),oi=i(["axis","x","tick","values"],null),pi=i(["axis","x","tick","rotate"]),qi=i(["axis","x","max"],null),ri=i(["axis","x","min"],null),si=i(["axis","x","padding"],{}),ti=i(["axis","x","height"]),ui=i(["axis","x","default"]),vi=i(["axis","x","label"],{}),wi=i(["axis","y","show"],!0),xi=i(["axis","y","max"]),yi=i(["axis","y","min"]),zi=i(["axis","y","center"]),Ai=i(["axis","y","label"],{}),Bi=i(["axis","y","inner"],!1),Ci=i(["axis","y","tick","format"]),Di=i(["axis","y","padding"]),Ei=i(["axis","y","ticks"],10),Fi=i(["axis","y2","show"],!1),Gi=i(["axis","y2","max"]),Hi=i(["axis","y2","min"]),Ii=i(["axis","y2","center"]),Ji=i(["axis","y2","label"],{}),Ki=i(["axis","y2","inner"],!1),Li=i(["axis","y2","tick","format"]),Mi=i(["axis","y2","padding"]),Ni=i(["axis","y2","ticks"],10),Oi=i(["grid","x","show"],!1),Pi=i(["grid","x","type"],"tick"),Qi=i(["grid","x","lines"],[]),Ri=i(["grid","y","show"],!1),Si=i(["grid","y","lines"],[]),Ti=i(["grid","y","ticks"],10),Ui=i(["grid","focus","show"],!0),Vi=i(["point","show"],!0),Wi=i(["point","r"],2.5),Xi=i(["point","focus","expand","enabled"],!0),Yi=i(["point","focus","expand","r"]),Zi=i(["point","focus","select","r"]),$i=i(["line","connect_null"],!1),_i=i(["bar","width"]),aj=i(["bar","width","ratio"],.6),bj=i(["bar","zerobased"],!0),cj=i(["pie","label","show"],!0),dj=i(["pie","label","format"]),ej=i(["pie","label","threshold"],.05),fj=i(["pie","sort"],!0),gj=i(["pie","expand"],!0),hj=i(["pie","onclick"],function(){}),ij=i(["pie","onmouseover"],function(){}),jj=i(["pie","onmouseout"],function(){}),kj=i(["gauge","label","show"],!0),lj=i(["gauge","label","format"]),mj=i(["gauge","expand"],!0),nj=i(["gauge","min"],0),oj=i(["gauge","max"],100),pj=i(["gauge","onclick"],function(){}),qj=i(["gauge","onmouseover"],function(){}),rj=i(["gauge","onmouseout"],function(){}),sj=i(["gauge","units"]),tj=i(["gauge","width"]),uj=i(["donut","label","show"],!0),vj=i(["donut","label","format"]),wj=i(["donut","label","threshold"],.05),xj=i(["donut","sort"],!0),yj=i(["donut","expand"],!0),zj=i(["donut","title"],""),Aj=i(["donut","onclick"],function(){}),Bj=i(["donut","onmouseover"],function(){}),Cj=i(["donut","onmouseout"],function(){}),Dj=i(["regions"],[]),Ej=i(["tooltip","show"],!0),Fj=i(["tooltip","grouped"],!0),Gj=i(["tooltip","format","title"]),Hj=i(["tooltip","format","name"]),Ij=i(["tooltip","format","value"]),Jj=i(["tooltip","contents"],function(a,b,c,d){var e,f,h,i,j,k,l=Gj?Gj:b,m=Hj?Hj:function(a){return a},n=Ij?Ij:c;for(f=0;f<a.length;f++)a[f]&&(a[f].value||0===a[f].value)&&(e||(h=l?l(a[f].x):a[f].x,e="<table class='"+g.tooltip+"'>"+(h||0===h?"<tr><th colspan='2'>"+h+"</th></tr>":"")),j=m(a[f].name),i=n(a[f].value,a[f].ratio,a[f].id,a[f].index),k=bk?bk(a[f].value):d(a[f].id),e+="<tr class='"+g.tooltipName+"-"+a[f].id+"'>",e+="<td class='name'><span style='background-color:"+k+"'></span>"+j+"</td>",e+="<td class='value'>"+i+"</td>",e+="</tr>");return e+"</table>"}),Kj=i(["tooltip","init","show"],!1),Lj=i(["tooltip","init","x"],0),Mj=i(["tooltip","init","position"],{top:"0px",left:"50px"}),Nj="c3-"+ +new Date+"-clip",Oj=Nj+"-xaxis",Pj=Nj+"-yaxis",Qj=j(Nj),Rj=j(Oj),Sj=j(Pj),Tj="timeseries"===fi,Uj=fi.indexOf("categor")>=0,Vj=function(){return!Tj&&(nh||Ue(oh))},Wj=null,Xj=!1,Yj=!1,Zj=!1,$j=!1,_j=mg.scale.category10().range(),ak=Ne(Ch,Ue(Th)?Th:_j,Bh),bk=Ue(Uh)?Oe(Th,Uh):null,ck=qh?mg.time.format:mg.time.format.utc,dk=gi?mg.time.format:mg.time.format.utc,ek=dk.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),fk=[],gk=[],hk={},ik=di?"left":"bottom",jk=di?Bi?"top":"bottom":Bi?"right":"left",kk=di?Ki?"bottom":"top":Ki?"left":"right",lk=di?"left":"bottom",mk={main:function(){return"translate("+k(Fg.left)+","+k(Fg.top)+")"},context:function(){return"translate("+k(Gg.left)+","+k(Gg.top)+")"},legend:function(){return"translate("+Hg.left+","+Hg.top+")"},x:function(){return"translate(0,"+(di?0:Kg)+")"},y:function(){return"translate(0,"+(di?Kg:0)+")"},y2:function(){return"translate("+(di?0:Ig)+","+(di?1:0)+")"},subx:function(){return"translate(0,"+(di?0:Lg)+")"},arc:function(){return"translate("+Rg/2+","+Sg/2+")"}},nk="right"===Wh,ok="inset"===Wh,pk="top-left"===Xh||"top-right"===Xh,qk="top-left"===Xh||"bottom-left"===Xh,rk=0,sk=0,tk=0,uk=.15,vk=0,wk=30,xk=di&&!ei?0:30,yk=5;Wg=mg.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)}),fj&&xj||Wg.sort(null);var zk,Ak=function(){};zk=mg.svg.brush().on("brush",Rf),zk.update=function(){return Ek&&Ek.select("."+g.brush).call(this),this},zk.scale=function(a){return di?this.y(a):this.x(a)},Ak=mg.behavior.zoom().on("zoomstart",function(){Ak.altDomain=mg.event.sourceEvent.altKey?dh.orgDomain():null}).on("zoom",Sf),Ak.scale=function(a){return di?this.y(a):this.x(a)},Ak.orgScaleExtent=function(){var a=xg?xg:[1,10];return[a[0],Math.max(Nc()/a[1],a[1])]},Ak.updateScaleExtent=function(){var a=ic(dh.orgDomain())/ic(Ik),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this};var Bk,Ck,Dk,Ek,Fk,Gk,Hk,Ik,Jk,Kk={};if(ng.focus=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",1)}var c=Bk.selectAll(Cd(a)),d=c.filter(gg),e=c.filter(hg);ng.revert(),ng.defocus(),b(d.classed(g.focused,!0)),b(e),we(ng.data.targets)&&Sb(a,!0),bg(a,!0)},ng.defocus=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",.3)}var c=Bk.selectAll(Cd(a)),d=c.filter(gg),e=c.filter(hg);ng.revert(),b(d.classed(g.focused,!1)),b(e),we(ng.data.targets)&&Tb(a),bg(a,!1)},ng.revert=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",1)}var c=Bk.selectAll(Cd(a)),d=c.filter(gg),e=c.filter(hg);b(d.classed(g.focused,!1)),b(e),we(ng.data.targets)&&Tb(a),cg()},ng.show=function(a,b){a=Rc(a),b=b||{},Zc(a),Bk.selectAll(Dd(a)).transition().style("opacity",1),b.withLegend&&dg(a),Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},ng.hide=function(a,b){a=Rc(a),b=b||{},Yc(a),Bk.selectAll(Dd(a)).transition().style("opacity",0),b.withLegend&&eg(a),Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},ng.toggle=function(a){Tc(a)?ng.hide(a):ng.show(a)},ng.unzoom=function(){zk.clear().update(),Qf({withUpdateXDomain:!0})},ng.zoom=function(){},ng.zoom.enable=function(a){wg=a,Wf()},ng.load=function(a){return a.xs&&yc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){th[b]=a.classes[b]}),"categories"in a&&Uj&&(hi=a.categories),"cacheIds"in a&&jc(a.cacheIds)?void Yf(lc(a.cacheIds),a.done):void("unload"in a?$f(Rc("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Zf(a)}):Zf(a))},ng.unload=function(a,b){$f(Rc(a),function(){Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},ng.flow=function(a){var c,e,f,g,h,i,j=Jc(Ic(a.columns),!0),k=[],l=Nc(),m=0,n=0;ng.data.targets.forEach(function(a){var b,c,d=!1;for(b=0;b<j.length;b++)if(a.id===j[b].id){for(d=!0,a.values[a.values.length-1]&&(n=a.values[a.values.length-1].index+1),m=j[b].values.length,c=0;m>c;c++)j[b].values[c].index=n+c,Tj||(j[b].values[c].x=n+c);a.values=a.values.concat(j[b].values),j.splice(b,1);break}d||k.push(a.id)}),ng.data.targets.forEach(function(a){var b,c;for(b=0;b<k.length;b++)if(a.id===k[b])for(n=a.values[a.values.length-1].index+1,c=0;m>c;c++)a.values.push({id:a.id,index:n+c,x:Tj?xc(n+c):n+c,value:null})}),ng.data.targets.length&&j.forEach(function(a){var b,c=[];for(b=ng.data.targets[0].values[0].index;n>b;b++)c.push({id:a.id,index:b,x:Tj?xc(b):b,value:null});a.values.forEach(function(a){a.index+=n,Tj||(a.x+=n)}),a.values=c.concat(a.values)}),ng.data.targets=ng.data.targets.concat(j),c=Nc(),f=ng.data.targets[0],g=f.values[0],d(a.to)?(m=0,i=Tj?Pe(a.to):a.to,f.values.forEach(function(a){a.x<i&&m++})):d(a.length)&&(m=a.length),l?1===l&&Tj&&(h=(f.values[f.values.length-1].x-g.x)/2,e=[new Date(+g.x-h),new Date(+g.x+h)],hc(null,!0,!0,e)):(h=Tj?f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-gc(ng.data.targets)[0]:1,e=[g.x-h,g.x],hc(null,!0,!0,e)),Xf(ng.data.targets),Qf({flow:{index:g.index,length:m,duration:b(a.duration)?a.duration:Eg,done:a.done,orgDataCount:l},withLegend:!0,withTransition:l>1})},ng.selected=function(a){return mg.merge(Dk.selectAll("."+g.shapes+Bd(a)).selectAll("."+g.shape).filter(function(){return mg.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},ng.select=function(a,b,c){Fh&&Dk.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=mg.select(this),i=e.data?e.data.id:e.id,j=kf(this),k=Gh||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0,m=h.classed(g.SELECTED);h.classed(g.line)||h.classed(g.area)||(k&&l?Hh(e)&&!m&&j(!0,h.classed(g.SELECTED,!0),e,f):d(c)&&c&&m&&j(!1,h.classed(g.SELECTED,!1),e,f))})},ng.unselect=function(a,b){Fh&&Dk.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(c,d){var e=mg.select(this),f=c.data?c.data.id:c.id,h=kf(this),i=Gh||!a||a.indexOf(f)>=0,j=!b||b.indexOf(d)>=0,k=e.classed(g.SELECTED);e.classed(g.line)||e.classed(g.area)||i&&j&&Hh(c)&&k&&h(!1,e.classed(g.SELECTED,!1),c,d)})},ng.transform=function(a,b){var c=["pie","donut"].indexOf(a)>=0?{withTransform:!0}:null;kg(b,a,c)},ng.groups=function(a){return c(a)?uh:(uh=a,Qf(),uh)},ng.xgrids=function(a){return a?(Qi=a,Qf(),Qi):Qi},ng.xgrids.add=function(a){return a?ng.xgrids(Qi.concat(a)):void 0},ng.xgrids.remove=function(a){jg(a,!0)},ng.ygrids=function(a){return a?(Si=a,Qf(),Si):Si},ng.ygrids.add=function(a){return a?ng.ygrids(Si.concat(a)):void 0},ng.ygrids.remove=function(a){jg(a,!1)},ng.regions=function(a){return a?(Dj=a,Qf(),Dj):Dj},ng.regions.add=function(a){return a?(Dj=Dj.concat(a),Qf(),Dj):Dj},ng.regions.remove=function(a){var b,c,d;return a=a||{},b=Ze(a,"duration",Eg),c=Ze(a,"classes",[g.region]),d=Dk.select("."+g.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),Dj=Dj.filter(function(a){var b=!1;return a.class?(a.class.split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0})},ng.data.get=function(a){var b=ng.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},ng.data.getAsTarget=function(a){var b=ng.data.targets.filter(function(b){return b.id===a});return b.length>0?b[0]:void 0},ng.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){sh[b]=a[b]}),Qf({withLegend:!0}),sh):sh},ng.data.colors=function(a){return arguments.length?(Object.keys(a).forEach(function(b){Ch[b]=a[b]}),Qf({withLegend:!0}),Ch):Ch},ng.category=function(a,b){return arguments.length>1&&(hi[a]=b,Qf()),hi[a]},ng.categories=function(a){return arguments.length?(hi=a,Qf(),hi):hi},ng.color=ak,ng.x=function(a){return arguments.length&&(Cc(ng.data.targets,a),Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),ng.data.xs},ng.xs=function(a){return arguments.length&&(Dc(ng.data.targets,a),Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),ng.data.xs},ng.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){hb(b,a[b])}),Jb())},ng.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(qi=a.x),b(a.y)&&(xi=a.y),b(a.y2)&&(Gi=a.y2)):xi=Gi=a,Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},ng.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(ri=a.x),b(a.y)&&(yi=a.y),b(a.y2)&&(Hi=a.y2)):yi=Hi=a,Qf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},ng.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&ng.axis.max(a.max),"undefined"!=typeof a.min&&ng.axis.min(a.min))},ng.legend.show=function(a){dg(Rc(a)),Wf({withLegend:!0})},ng.legend.hide=function(a){eg(Rc(a)),Wf({withLegend:!0})},ng.resize=function(a){qg=a?a.width:null,rg=a?a.height:null,ng.flush()},ng.flush=function(){Wf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},ng.destroy=function(){ng.data.targets=void 0,ng.data.xs={},Hk.classed("c3",!1).html(""),a.onresize=null},f.data.url)lg(f.data);else if(f.data.json)If(Gc(f.data.json,f.data.keys));else if(f.data.rows)If(Hc(f.data.rows));else{if(!f.data.columns)throw Error("url or json or rows or columns is required.");If(Ic(f.data.columns))}return ng},"function"==typeof define&&define.amd?define("c3",["d3"],f):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=f:a.c3=f}(window);