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