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