From e8b7f734d456e9a14b6a39ffbc20a88fc3cb31e1 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Mon, 31 Mar 2014 22:32:12 +0900 Subject: [PATCH] Support multiple unload --- c3.js | 32 +++++++++++++++++++------------- c3.min.js | 4 ++-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/c3.js b/c3.js index 5f89602..96d68a5 100644 --- a/c3.js +++ b/c3.js @@ -3389,6 +3389,21 @@ done(); } + function unload(targetIds) { + targetIds.forEach(function (id) { + c3.data.targets = c3.data.targets.filter(function (t) { + return t.id !== id; + }); + svg.selectAll(selectorTarget(id)) + .transition() + .style('opacity', 0) + .remove(); + if (__legend_show) { + legend.selectAll('.' + CLASS.legendItem + getTargetSelectorSuffix(id)).remove(); + } + }); + } + /*-- Draw Legend --*/ function toggleFocusLegend(id, focus) { @@ -3685,19 +3700,10 @@ } }; - c3.unload = function (targetId) { - c3.data.targets = c3.data.targets.filter(function (t) { - return t.id !== targetId; - }); - svg.selectAll(selectorTarget(targetId)) - .transition() - .style('opacity', 0) - .remove(); - - if (__legend_show) { - legend.selectAll('.' + CLASS.legendItem + getTargetSelectorSuffix(targetId)).remove(); - } - + c3.unload = function (targetIds) { + // remove elements for targetId + unload(typeof targetIds === 'string' ? [targetIds] : targetIds); + // try redraw if targets exist if (c3.data.targets.length > 0) { redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true}); } diff --git a/c3.min.js b/c3.min.js index 8509736..c90b37c 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,2 +1,2 @@ -!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}var e={};e.generate=function(e){function f(a,b){if(!(a in e))throw Error(b)}function g(a,b){var c,d,f,g=e;for(c=0;ccf&&(cf=0),0>ef&&(ef=0),af={top:ng?_e.top:hf-hg-(Mh?0:jf),right:0/0,bottom:20+(Mh?0:jf),left:ng?Qh:_e.left},df=ng?_e.left-Qh-Rh:cf,ff=ng?ef:hf-af.top-af.bottom,0>df&&(df=0),0>ff&&(ff=0),bf={top:Mh?0:hf-jf,right:0/0,bottom:0,left:Mh?gf-kf:0},n(),Mh&&Cd(Ke.data.targets)&&(bf.left=cf/2+mf)}function n(){mf=ef/2,lf=.95*mf,nf=Bd(Ke.data.targets)?.6*lf:0}function o(){var a=ng?Pe.axisX:Pe.axisY,b=Je.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Je.select(Qe).node().getBoundingClientRect(),e=c.right-d.left-r();return e>0?e:0}function p(){return Re?Re:v()}function q(){var a=Se?Se:w();return a>0?a:320}function r(){return Cd(Ke.data.targets)?0:Te?Te:ng||!yg||Dg?1:t("y")}function s(){var a=1;return Cd(Ke.data.targets)?0:Ue?Ue:Mh?kf+(Hg&&!ng?t("y2"):a):Hg?Mg||ng?a:t("y2"):a}function t(a){var b=db(a);return b.isInner?20+wb(a):40+wb(a)}function u(a){return"y"!==a||yg?"y2"!==a||Hg?(db(a).isInner?30:40)+("y2"===a?-10:0):Sh:jg&&!Mh?10:1}function v(){return+Je.select(Qe).style("width").replace("px","")}function w(){return+Je.select(Qe).style("height").replace("px","")}function x(a){return a?-5:-(_e.left-1)}function y(a){return a?-20:-1}function z(){return x(!ng)}function A(){return y(!ng)}function B(){return x(ng)}function C(){return y(ng)}function D(a){return a?cf+2+4:_e.left+20}function E(a){return a?80:ef+2}function F(){return D(!ng)}function G(){return E(!ng)}function H(){return D(ng)}function I(){return E(ng)}function J(){var a=ng?ef:cf,b=pc(),c=Rb()*(yd(Ke.data.targets)?(b-(yh?.25:1))/b:.98);return b>1?a*c/(b-1):a}function K(a){Nh=a}function L(a){Oh=a}function M(a){Ph=a}function N(){return jg?Mh?Oh*(Nh+1):gf:0}function O(){return jg?Mh?hf:Ph*(Nh+1):0}function P(){var a,b,c=!Af;sf=ng?1:0,tf=ng?ef:cf,uf=ng?0:ef,vf=ng?cf:1,wf=sf,xf=tf,yf=ng?0:ff,zf=ng?df:1,Af=R(sf,tf,c?void 0:Af.domain(),function(){return Gf.tickOffset()}),Bf=S(uf,vf),Cf=S(uf,vf),Df=R(sf,tf,di,function(a){return a%1?0:Jf.tickOffset()}),Ef=S(yf,zf),Ff=S(yf,zf),a=Y(),b=Z(),Gf=V(Af,Hh,a,b),Jf=V(Df,Kh,a,b),Hf=W(Bf,Ih,Eg,Gg),If=W(Cf,Jh,Ng,Pg),c||(Th.scale(Df),Ve&&Xh.scale(Af)),Q()}function Q(){of=zb(),pf=Ab(),qf=Ab(.98)}function R(a,b,e,f){var g=(xh?Je.time.scale():Je.scale.linear()).range([a,b]);if(g.orgDomain=function(){return g.domain()},d(e)&&g.domain(e),c(f)&&(f=function(){return 0}),yh){var h,i=g;g=function(a){return i(a)+f(a)};for(h in i)g[h]=i[h];g.orgDomain=function(){return i.domain()},g.domain=function(a){return arguments.length?(i.domain(a),g):(a=i.domain(),[a[0],a[1]+1])}}return g}function S(a,b){return Je.scale.linear().range([a,b])}function T(a){return"y2"===X(a)?Cf:Bf}function U(a){return"y2"===X(a)?Ff:Ef}function V(a,b,c,d){var e=(yh?xb():Je.svg.axis()).scale(a).orient(b);return e.tickFormat(c).ticks(d),yh?e.tickCentered(qg):e.tickOffset=function(){var a=ng?ef:cf;return a*Rb()/pc()/2},yh&&e.categories(pg),e}function W(a,b,c,d){return Je.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function X(a){return a in Qf?Qf[a]:"y"}function Y(){var a=xh?Fh:yh?Cc:null;return rg&&("function"==typeof rg?a=rg:xh&&(a=function(a){return Je.time.format(rg)(a)})),a}function Z(){var a=pc();return sg&&a>tg?tg:a}function $(a){return"string"==typeof a?a:a?a.text:null}function _(a,b){var c=a&&"object"==typeof a&&a.position?a.position:b;return{isInner:c.indexOf("inner")>=0,isOuter:c.indexOf("outer")>=0,isLeft:c.indexOf("left")>=0,isCenter:c.indexOf("center")>=0,isRight:c.indexOf("right")>=0,isTop:c.indexOf("top")>=0,isMiddle:c.indexOf("middle")>=0,isBottom:c.indexOf("bottom")>=0}}function ab(){return _(xg,ng?"inner-top":"inner-right")}function bb(){return _(Cg,ng?"inner-right":"inner-top")}function cb(){return _(Lg,ng?"inner-right":"inner-top")}function db(a){return"y2"===a?cb():"y"===a?bb():ab()}function eb(){return $(xg)}function fb(){return $(Cg)}function gb(){return $(Lg)}function hb(a,b){return a?b.isLeft?0:b.isCenter?cf/2:cf:b.isBottom?-ef:b.isMiddle?-ef/2:0}function ib(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function jb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function kb(){return hb(!ng,ab())}function lb(){return hb(ng,bb())}function mb(){return hb(ng,cb())}function nb(){return ib(!ng,ab())}function ob(){return ib(ng,bb())}function pb(){return ib(ng,cb())}function qb(){var a=ab();return ng?a.isInner?"1.2em":-30-wb("x"):a.isInner?"-0.5em":"3em"}function rb(){var a=bb();return ng?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-wb("y")}function sb(){var a=cb();return ng?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+wb("y2")}function tb(){return jb(!ng,ab())}function ub(){return jb(ng,bb())}function vb(){return jb(ng,cb())}function wb(a){var b=0,c="x"===a?Pe.axisX:"y"===a?Pe.axisY:Pe.axisY2;return Je.selectAll("."+c+" .tick text").each(function(){var a=this.getBBox();bb?[b,c]:[c,b]}function d(a){for(var b=[],c=Math.ceil(a[0]);c0&&b[0]>0&&b.unshift(b[0]-(b[1]-b[0])),b}function e(a,b){var c=a.length-1;return o>=c||b%Math.ceil(c/o)===0}function f(a){return a0)for(g=Ac(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 Je.min(Object.keys(i).map(function(a){return Je.min(i[a])}))}function Pb(a){var b,c,d,e,f,g,h=rc(a),i=yc(a);if(Pf.length>0)for(g=Bc(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 Je.max(Object.keys(i).map(function(a){return Je.max(i[a])}))}function Qb(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return X(a.id)===c}),m="y2"===c?Jg:Ag,n="y2"===c?Ig:zg,o=b(m)?m:Ob(l),p=b(n)?n:Pb(l),q="y2"===c?Kg:Bg,r=Xc()&&ng;return 0===l.length?"y2"===c?Cf.domain():Bf.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),"y"===c&&Fg&&(f=b(Fg.top)?Fg.top:e,g=b(Fg.bottom)?Fg.bottom:e),"y2"===c&&Og&&(f=b(Og.top)?Og.top:e,g=b(Og.bottom)?Og.bottom:e),r&&(i=Yc(o,p),j=Wb(Bf.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]))),yd(l)&&!Ac(l)&&(g=o),[o-g,p+f])}function Rb(a){var b=Wb(di),c=Wb(Af.domain());return a||0===c?1:b/c}function Sb(a){return vg?vg:Je.min(a,function(a){return Je.min(a.values,function(a){return a.x})})}function Tb(a){return ug?ug:Je.max(a,function(a){return Je.max(a.values,function(a){return a.x})})}function Ub(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return yh?d=0:yd(a)?(c=pc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Vb(a){var b=[Sb(a),Tb(a)],c=b[0],d=b[1],e=Ub(a,b),f=xh?new Date(c.getTime()-e):c-e,g=xh?new Date(d.getTime()+e):d+e;return[f,g]}function Wb(a){return a[1]-a[0]}function Xb(a){for(var b=0;bd?0:d}function ac(a){return Kf&&a===Kf||Sd(Lf)&&Td(Lf,a)}function bc(a){return!ac(a)}function cc(a){return Kf?Kf:Sd(Lf)?Lf[a]:null}function dc(a,b){return a in Ke.data.x&&Ke.data.x[a]&&Ke.data.x[a][b]?Ke.data.x[a][b]:b}function ec(a){Object.keys(a).forEach(function(b){Lf[b]=a[b]})}function fc(a){var b;return a&&(b=Of[a.id],a.name=b?b:a.id),a}function gc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=ic(b[d],a.id,d)}),Ke.data.x[a.id]=b})}function hc(a,b){a.forEach(function(a){b[a.id]&&gc([a],b[a.id])})}function ic(a,b,c){var d;return d=xh?a?a instanceof Date?a:Od(a):Od(dc(b,c)):zh&&!yh?a?+a:dc(b,c):c}function jc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0&&(Ke.data.x[b]=a.map(function(a){return a[c]})):Ke.data.x[b]=a.map(function(a,b){return b})}),c.forEach(function(a){if(!Ke.data.x[a])throw new Error('x is not defined for id = "'+a+'".')}),b=c.map(function(b,c){var d=Nf(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=cc(b),g=a[f],h=ic(g,b,e);return zh&&yh&&0===c&&g&&(0===e&&(pg=[]),pg.push(g)),"undefined"==typeof a[b]&&(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})}}),b.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++})}),Rf&&wd(rc(b).filter(function(a){return!(a in Sf)}),Rf),b.forEach(function(a){Yb(a.id_org,a)}),b}function mc(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 nc(a){return a>0&&Ke.data.targets[0].values[a-1]?Ke.data.targets[0].values[a-1].x:void 0}function oc(a){return a1?Ke.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?Ke.data.targets[0]:null,a}function rc(a){return a=c(a)?Ke.data.targets:a,a.map(function(a){return a.id})}function sc(a){var b,c=rc();for(b=0;ba})}function Bc(a){return zc(a,function(a){return a>0})}function Cc(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&&(e=e.concat(dd(a,f))),a[g].x&&(e=e.concat(dd(a,g))),gd(e,b)):ed(a,b,f,g)}function fd(a,b){var c;return c=a.map(function(a){return ed(a.values,b)}),gd(c,b)}function gd(a,b){var c,d;return a.forEach(function(a){var e=Ud(a,b);(c>e||!c)&&(c=e,d=a)}),d}function hd(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 id(){return Uf&&"desc"===Uf.toLowerCase()}function jd(){return Uf&&"asc"===Uf.toLowerCase()}function kd(a){var b=jd(),c=id();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 Uf&&a.sort(Uf),a}function ld(a,c){var d,e,f,g,h,i,j,k=Cd(Ke.data.targets),l=k?cd:bd,m=a.filter(function(a){return a&&b(a.value)});oh&&0!==m.length&&(bi.html(rh(a,Y(),l,Eh)).style("display","block"),d=bi.property("offsetWidth"),e=bi.property("offsetHeight"),k?(g=cf/2+c[0],i=ef/2+c[1]+20):(ng?(f=o(),g=f+c[0]+100,h=g+d,j=p()-s(),i=Af(m[0].x)+20):(f=o(),g=f+r()+Af(m[0].x)+20,h=g+d,j=f+p()-s(),i=c[1]+15),h>j&&(g-=d+60),i+e>q()&&(i-=e+30)),bi.style("top",i+"px").style("left",g+"px"))}function md(){bi.style("display","none")}function nd(a){var c=a.filter(function(a){return a&&b(a.value)});oh&&(zd(Ke.data.targets)||Cd(Ke.data.targets)||$h.selectAll("line."+Pe.xgridFocus).style("visibility","visible").data([c[0]]).attr(ng?"y1":"x1",Zc).attr(ng?"y2":"x2",Zc))}function od(){$h.select("line."+Pe.xgridFocus).style("visibility","hidden")}function pd(a){return a.x||0===a.x?Af(a.x):null}function qd(a){return T(a.id)(a.value)}function rd(){var a,b,d={},e=0;return vc(tc(Fd)).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function vd(a,b){return ah?ah:b?2*a.tickOffset()*bh/b:0}function wd(a,b){var d=c(a)?rc():a;"string"==typeof d&&(d=[d]);for(var e=0;e0}function Td(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function Ud(a,b){return Math.pow(Af(a.x)-b[0],2)+Math.pow(Bf(a.value)-b[1],2)}function Vd(a,b,c){cg(b,a.node()),$h.select("."+Pe.selectedCircles+Rc(b.id)).selectAll("."+Pe.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return Dc(Pe.selectedCircle,c)}).attr("cx",ng?qd:pd).attr("cy",ng?pd:qd).attr("stroke",function(){return Eh(b.id)}).attr("r",1.4*_g).transition().duration(100).attr("r",_g)}function Wd(a,b,c){dg(b,a.node()),$h.select("."+Pe.selectedCircles+Rc(b.id)).selectAll("."+Pe.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function Xd(a,b,c,d){a?Vd(b,c,d):Wd(b,c,d)}function Yd(a,b){cg(b,a.node()),a.transition().duration(100).style("fill",function(){return Je.rgb(Eh(b.id)).darker(1)})}function Zd(a,b){dg(b,a.node()),a.transition().duration(100).style("fill",function(){return Eh(b.id)})}function $d(a,b,c,d){a?Yd(b,c,d):Zd(b,c,d)}function _d(a){return a.filter(function(a){return b(a.value)})}function ae(a,c){return(c?$h.selectAll("."+Pe.circles+Rc(c)):$h).selectAll("."+Pe.circle+(b(a)?"-"+a:""))}function be(a,b){ae(a,b).classed(Me,!0).attr("r",$g)}function ce(a){ae(a).filter(function(){return Je.select(this).classed(Me)}).classed(Me,!1).attr("r",Xg)}function de(a){return $h.selectAll("."+Pe.bar+(b(a)?"-"+a:""))}function ee(a){de(a).classed(Me,!0)}function fe(a){de(a).classed(Me,!1)}function ge(a,b){var c=ke(a,b);return function(a,b){var d=c(a,b),e=ng?1:0,f=ng?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 he(a,b){var c=ke(a,!1),d=b?ie:je;return function(a,b){return d(c(a,b),a,this)}}function ie(a,b){var c;return ng?(c=Fd(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}function je(a,b,c){var d=c.getBBox();return ng?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:Fd(b)?-3:-6)}function ke(a,b){var c=a.__max__+1,d=vd(Gf,c),e=sd(d,c,a,!!b),f=td(!!b),g=ud(a,!!b),h=b?U:T;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return ng&&(a.value>0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function le(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(d(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function me(b){var c,d,e;if(ci=Je.select(Qe),ci.empty())throw new Error('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(ci.html(""),ci.classed("c3",!0),Ke.data.x={},Ke.data.targets=lc(b),m(),P(),Af.domain(Je.extent(Vb(Ke.data.targets))),Bf.domain(Qb(Ke.data.targets,"y")),Cf.domain(Qb(Ke.data.targets,"y2")),Df.domain(Af.domain()),Ef.domain(Bf.domain()),Ff.domain(Cf.domain()),di=Af.domain(),Th.scale(Df),Ve&&Xh.scale(Af),Yh=ci.append("svg").attr("width",cf+_e.left+_e.right).attr("height",ef+_e.top+_e.bottom).on("mouseenter",Ye).on("mouseleave",Ze),Zh=Yh.append("defs"),Zh.append("clipPath").attr("id",vh).append("rect").attr("width",cf).attr("height",ef),Zh.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",z).attr("y",A).attr("width",F).attr("height",G),Zh.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),$h=Yh.append("g").attr("transform",Lh.main),_h=gg?Yh.append("g").attr("transform",Lh.context):null,ai=jg?Yh.append("g").attr("transform",Lh.legend):null,bi=Je.select(Qe).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),$h.append("g").attr("class",Pe.axisX).attr("clip-path",ng?"":h("xaxis-clip")).attr("transform",Lh.x).append("text").attr("class",Pe.axisXLabel).attr("transform",ng?"rotate(-90)":"").attr("dx",nb).attr("dy",qb).style("text-anchor",tb).text(eb),yg&&$h.append("g").attr("class",Pe.axisY).attr("clip-path",ng?h("yaxis-clip"):"").append("text").attr("class",Pe.axisYLabel).attr("transform",ng?"":"rotate(-90)").attr("dx",ob).attr("dy",rb).style("text-anchor",ub).text(fb),Hg&&$h.append("g").attr("class",Pe.axisY2).attr("transform",Lh.y2).append("text").attr("class",Pe.axisY2Label).attr("transform",ng?"":"rotate(-90)").attr("dx",pb).style("text-anchor",vb).text(gb),d=$h.append("g").attr("clip-path",wh).attr("class",Pe.grid),Qg&&d.append("g").attr("class",Pe.xgrids),Sd(Sg)&&d.append("g").attr("class",Pe.xgridLines),Yg&&d.append("g").attr("class",Pe.xgridFocus).append("line").attr("class",Pe.xgridFocus).attr("x1",ng?0:-10).attr("x2",ng?cf:-10).attr("y1",ng?-10:_e.top).attr("y2",ng?-10:ef),Tg&&d.append("g").attr("class",Pe.ygrids),Sd(Ug)&&d.append("g").attr("class",Pe.ygridLines),$h.append("g").attr("clip-path",wh).attr("class",Pe.regions),$h.append("g").attr("clip-path",wh).attr("class",Pe.chart),c=$h.select("."+Pe.chart).append("g").attr("class",Pe.eventRects).style("fill-opacity",0).style("cursor",Ve?ng?"ns-resize":"ew-resize":null),$h.select("."+Pe.chart).append("g").attr("class",Pe.chartBars),$h.select("."+Pe.chart).append("g").attr("class",Pe.chartLines),$h.select("."+Pe.chart).append("g").attr("class",Pe.chartArcs).attr("transform",Lh.arc).append("text").attr("class",Pe.chartArcsTitle).style("text-anchor","middle").text(Kb()),$h.select("."+Pe.chart).append("g").attr("class",Pe.chartTexts),Ve&&$h.insert("rect",Xe?null:"g."+Pe.grid).attr("class",Pe.zoomRect).attr("width",cf).attr("height",ef).style("opacity",0).style("cursor",ng?"ns-resize":"ew-resize").call(Xh).on("dblclick.zoom",null),wg&&Th.extent("function"!=typeof wg?wg:wg(Vb())),gg&&(_h.append("g").attr("clip-path",wh).attr("class",Pe.chart),_h.select("."+Pe.chart).append("g").attr("class",Pe.chartBars),_h.select("."+Pe.chart).append("g").attr("class",Pe.chartLines),_h.append("g").attr("clip-path",wh).attr("class",Pe.brush).call(Th).selectAll("rect").attr(ng?"width":"height",ng?df:ff),_h.append("g").attr("class",Pe.axisX).attr("transform",Lh.subx).attr("clip-path",ng?"":h("xaxis-clip"))),ze(Ke.data.targets),ng?$h.select("."+Pe.axisX).style("opacity",0).call(Gf):($h.select("."+Pe.axisY).style("opacity",0).call(Hf),$h.select("."+Pe.axisY2).style("opacity",0).call(If)),ye({withTransform:!0,withLegend:!0,durationForAxis:0}),sh){if(xh&&"string"==typeof th){for(th=Od(th),e=0;e0){d=[];for(var f in Of)for(c=0;cf&&g>c&&d>h&&i>d):"path"===this.nodeName&&(l=hd(this),c=l.x,d=l.y,e=l.width,j=l.height,k=$d,p=!(c>g||f>c+e||d>i||h>d+j)),p^o&&(m.classed(Oe,!o),m.classed(Ne,!n),k(!n,m,a,b))}))}function re(a){Cd(Ke.data.targets)||Xf&&(Ah=a,$h.select("."+Pe.chart).append("rect").attr("class",Pe.dragarea).style("opacity",.1),Bh=!0,eg())}function se(){Cd(Ke.data.targets)||Xf&&($h.select("."+Pe.dragarea).transition().duration(100).style("opacity",0).remove(),$h.selectAll("."+Pe.shape).classed(Oe,!1),Bh=!1,fg())}function te(a){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=rd(),I=Cd(Ke.data.targets),K=vc(Ke.data.targets);if(0!==K.length){if(a=d(a)?a:{},t=d(a.withY)?a.withY:!0,u=d(a.withSubchart)?a.withSubchart:!0,v=d(a.withTransition)?a.withTransition:!0,w=d(a.withTransform)?a.withTransform:!1,x=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,y=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,z=d(a.withLegend)?a.withLegend:!1,E=v?$e:0,F=d(a.durationForExit)?a.durationForExit:E,G=d(a.durationForAxis)?a.durationForAxis:E,z&&jg&&Fe(Ke.data.targets,a),y&&(Af.domain(Je.extent(Vb(K))),di=Af.domain(),Ve&&Xh.scale(Af).updateScaleExtent(),Df.domain(Af.domain()),Th.scale(Df)),x&&(Af.domain(Th.empty()?di:Th.extent()),Ve&&Xh.scale(Af).updateScaleExtent()),Bf.domain(Qb(K,"y")),Cf.domain(Qb(K,"y2")),$h.select("."+Pe.axisX).style("opacity",I?0:1).transition().duration(G).call(Gf),$h.select("."+Pe.axisY).style("opacity",I?0:1).transition().duration(G).call(Hf),$h.select("."+Pe.axisY2).style("opacity",I?0:1).transition().duration(G).call(If),A=ge(H),C=he(H,!0),D=he(H,!1),$h.select("."+Pe.axisX+" ."+Pe.axisXLabel).attr("x",kb),$h.select("."+Pe.axisY+" ."+Pe.axisYLabel).attr("x",lb).attr("dy",rb),$h.select("."+Pe.axisY2+" ."+Pe.axisY2Label).attr("x",mb).attr("dy",sb),Ef.domain(Bf.domain()),Ff.domain(Cf.domain()),bi.style("display","none"),$h.select("line."+Pe.xgridFocus).style("visibility","hidden"),Qg){if("year"===Rg){e=[];for(var L=Vb(),M=L[0].getFullYear(),N=L[1].getFullYear(),O=M;N>=O;O++)e.push(new Date(O+"-01-01 00:00:00"))}else e=Af.ticks(10);c=$h.select("."+Pe.xgrids).selectAll("."+Pe.xgrid).data(e),c.enter().append("line").attr("class",Pe.xgrid),c.attr("x1",ng?0:function(a){return Af(a)-Gf.tickOffset()}).attr("x2",ng?cf:function(a){return Af(a)-Gf.tickOffset()}).attr("y1",ng?function(a){return Af(a)-Gf.tickOffset()}:_e.top).attr("y2",ng?function(a){return Af(a)-Gf.tickOffset()}:ef).style("opacity",function(){return+Je.select(this).attr(ng?"y1":"x1")===(ng?ef:0)?0:1}),c.exit().remove()}Sd(Sg)&&(f=$h.select("."+Pe.xgridLines).selectAll("."+Pe.xgridLine).data(Sg),g=f.enter().append("g").attr("class",function(a){return Pe.xgridLine+(a.class?a.class:"")}),g.append("line").style("opacity",0),g.append("text").attr("text-anchor","end").attr("transform",ng?"":"rotate(-90)").attr("dx",ng?0:-_e.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(E).attr("x1",ng?0:$c).attr("x2",ng?cf:$c).attr("y1",ng?$c:_e.top).attr("y2",ng?$c:ef).style("opacity",1),f.select("text").transition().duration(E).attr("x",ng?cf:0).attr("y",$c).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(E).style("opacity",0).remove()),t&&Tg&&(h=$h.select("."+Pe.ygrids).selectAll("."+Pe.ygrid).data(Bf.ticks(Vg)),h.enter().append("line").attr("class",Pe.ygrid),h.attr("x1",ng?Bf:0).attr("x2",ng?Bf:cf).attr("y1",ng?0:Bf).attr("y2",ng?ef:Bf),h.exit().remove()),t&&Sd(Ug)&&(i=$h.select("."+Pe.ygridLines).selectAll("."+Pe.ygridLine).data(Ug),j=i.enter().append("g").attr("class",function(a){return Pe.ygridLine+(a.class?a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",ng?"rotate(-90)":"").attr("dx",ng?0:-_e.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(E).attr("x1",ng?_c:0).attr("x2",ng?_c:cf).attr("y1",ng?0:_c).attr("y2",ng?ef:_c).style("opacity",1),i.select("text").transition().duration(E).attr("x",ng?0:cf).attr("y",_c).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(E).style("opacity",0).remove()),l=$h.selectAll("."+Pe.bars).selectAll("."+Pe.bar).data(Kd),l.enter().append("path").attr("d",A).style("stroke","none").style("opacity",0).style("fill",function(a){return Eh(a.id)}).attr("class",Lc),l.style("opacity",Tc).transition().duration(E).attr("d",A).style("opacity",1),l.exit().transition().duration(F).style("opacity",0).remove(),n=$h.selectAll("."+Pe.texts).selectAll("."+Pe.text).data(Md),n.enter().append("text").attr("class",Ec).attr("text-anchor",function(a){return ng?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0),n.text(function(a){return bd(a.value)}).style("fill-opacity",Uc).transition().duration(E).attr("x",C).attr("y",D).style("fill-opacity",Wc),n.exit().transition().duration(F).style("fill-opacity",0).remove(),$h.selectAll("."+Pe.line).style("opacity",Tc).transition().duration(E).attr("d",Uh).style("opacity",1),$h.selectAll("."+Pe.area).style("opacity",0).transition().duration(E).attr("d",Vh).style("opacity",ei),k=$h.selectAll("."+Pe.circles).selectAll("."+Pe.circle).data(Ld),k.enter().append("circle").attr("class",Jc).style("opacity",0).attr("r",Xg),k.style("opacity",Tc).transition().duration(E).style("opacity",Vc).attr("cx",ng?qd:pd).attr("cy",ng?pd:qd),k.exit().remove(),$h.selectAll("."+Pe.chartArc).select("."+Pe.arc).attr("transform",w?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(E).attrTween("d",function(a){var b,c=yb(a);return c?(b=Je.interpolate(this._current,c),this._current=b(0),function(a){return Bb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",w?"scale(1)":"").style("opacity",1),$h.selectAll("."+Pe.chartArc).select("text").attr("transform",Cb).style("opacity",0).transition().duration(E).text(Fb).style("opacity",function(a){return uc(a.data.id)&&Jd(a.data)?1:0}),$h.select("."+Pe.chartArcsTitle).style("opacity",Bd(Ke.data.targets)?1:0),gg&&(null!==Je.event&&"zoom"===Je.event.type&&Th.extent(Af.orgDomain()).update(),u&&(_h.select("."+Pe.axisX).style("opacity",I?0:1).transition().duration(E).call(Jf),Th.empty()||Th.extent(Af.orgDomain()).update(),B=ge(H,!0),o=_h.selectAll("."+Pe.bars).selectAll("."+Pe.bar).data(Kd),o.enter().append("path").attr("d",B).style("stroke","none").style("fill",function(a){return Eh(a.id)}).attr("class",Lc),o.style("opacity",Tc).transition().duration(E).attr("d",B).style("opacity",1),o.exit().transition().duration(E).style("opacity",0).remove(),_h.selectAll("."+Pe.line).style("opacity",Tc).transition().duration(E).attr("d",Wh).style("opacity",1))),$h.selectAll("."+Pe.selectedCircles).filter(function(a){return Fd(a)}).selectAll("circle").remove(),$h.selectAll("."+Pe.selectedCircle).transition().duration(E).attr("cx",ng?qd:pd).attr("cy",ng?pd:qd),Sd(Lf)?(p=$h.select("."+Pe.eventRects).selectAll("."+Pe.eventRect).data([0]),oe(p.enter()),p.attr("x",0).attr("y",0).attr("width",cf).attr("height",ef)):(zh&&!yh?(s=function(a,b){var c=nc(b),d=oc(b),e=Ke.data.x[a.id][b];return(Af(d?d:e+50)-Af(c?c:e-50))/2},r=function(a,b){var c=nc(b),d=Ke.data.x[a.id][b];return(Af(d)+Af(c?c:d-50))/2}):(s=J(),r=function(a){return Af(a.x)-s/2}),q=qc(),$h.select("."+Pe.eventRects).datum(q?q.values:[]),p=$h.select("."+Pe.eventRects).selectAll("."+Pe.eventRect).data(function(a){return a}),ne(p.enter()),p.attr("class",Qc).attr("x",ng?0:r).attr("y",ng?r:0).attr("width",ng?cf:s).attr("height",ng?s:ef),p.exit().remove()),m=$h.select("."+Pe.regions).selectAll("rect."+Pe.region).data(nh),m.enter().append("rect").style("fill-opacity",0),m.attr("class",Pc).attr("x",ng?0:$b).attr("y",ng?$b:_e.top).attr("width",ng?cf:_b).attr("height",ng?_b:ef).transition().duration(E).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),m.exit().transition().duration(E).style("fill-opacity",0).remove(),rc().forEach(function(a){fi[a]=!0})}}function ue(){te({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function ve(){return"mousemove"===Je.event.sourceEvent.type&&Xh.altDomain?(Af.domain(Xh.altDomain),void Xh.scale(Af).updateScaleExtent()):(yh&&Af.orgDomain()[0]===di[0]&&Af.domain([di[0]-1e-10,Af.orgDomain()[1]]),te({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===Je.event.sourceEvent.type&&(Ch=!0)))}function we(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function xe(){Yh.attr("width",gf).attr("height",hf),Yh.select("#"+vh).select("rect").attr("width",cf).attr("height",ef),Yh.select("#xaxis-clip").select("rect").attr("width",F),Yh.select("#yaxis-clip").select("rect").attr("width",H),Yh.select("."+Pe.zoomRect).attr("width",cf).attr("height",ef)}function ye(a){a=d(a)?a:{},a.withTransition=d(a.withTransition)?a.withTransition:!0,a.withTransform=d(a.withTransform)?a.withTransform:!1,a.withLegend=d(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.durationForExit=0,m(),P(),xe(),l(a.withTransition),te(a)}function ze(a){var b,c,d,e,f,g,h,i,j,k,l,m;h=$h.select("."+Pe.chartTexts).selectAll("."+Pe.chartText).data(a),i=h.enter().append("g").attr("class",function(a){return Pe.chartText+Dc(Pe.target,a.id)}).style("pointer-events","none"),i.append("g").attr("class",Fc).style("fill",function(a){return Eh(a.id)}),e=$h.select("."+Pe.chartBars).selectAll("."+Pe.chartBar).data(a),d=e.enter().append("g").attr("class",function(a){return Pe.chartBar+Dc(Pe.target,a.id)}).style("pointer-events","none"),d.append("g").attr("class",Mc).style("fill",function(a){return Eh(a.id)}).style("stroke","none").style("cursor",function(a){return Zf(a)?"pointer":null}),c=$h.select("."+Pe.chartLines).selectAll("."+Pe.chartLine).data(a),b=c.enter().append("g").attr("class",function(a){return Pe.chartLine+Dc(Pe.target,a.id)}).style("pointer-events","none"),b.append("path").attr("class",Ic).style("opacity",0).style("stroke",function(a){return Eh(a.id)}),b.append("path").attr("class",Oc).style("opacity",function(){return ei=+Je.select(this).style("opacity"),0}).style("fill",function(a){return Eh(a.id)}),b.append("g").attr("class",function(a){return Dc(Pe.selectedCircles,a.id)}),b.append("g").attr("class",Kc).style("fill",function(a){return Eh(a.id)}).style("cursor",function(a){return Zf(a)?"pointer":null}),a.forEach(function(a){$h.selectAll("."+Pe.selectedCircles+Rc(a.id)).selectAll("."+Pe.selectedCircle).each(function(b,c){b.value=a.values[c].value})}),g=$h.select("."+Pe.chartArcs).selectAll("."+Pe.chartArc).data(rf(a)),f=g.enter().append("g").attr("class",function(a){return Pe.chartArc+Dc(Pe.target,a.data.id)}),f.append("path").attr("class",Nc).style("opacity",0).style("fill",function(a){return Eh(a.data.id)}).style("cursor",function(a){return Zf(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){var c=yb(a),d=Eb(c),e=Mb();Gb(c.data.id),Ce(c.data.id),e(d,b)}).on("mousemove",function(a){var b=yb(a),c=[Eb(b)];ld(c,Je.mouse(this))}).on("mouseout",function(a,b){var c=yb(a),d=Eb(c),e=Nb();Hb(c.data.id),Ee(),md(),e(d,b)}).on("click",function(a,b){var c=yb(a),d=Eb(c),e=Lb();e(d,b)}),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),gg&&(m=_h.select("."+Pe.chartBars).selectAll("."+Pe.chartBar).data(a),l=m.enter().append("g").attr("class",function(a){return Pe.chartBar+Dc(Pe.target,a.id)}),l.append("g").attr("class",Mc).style("fill",function(a){return Eh(a.id)}),k=_h.select("."+Pe.chartLines).selectAll("."+Pe.chartLine).data(a),j=k.enter().append("g").attr("class",function(a){return Pe.chartLine+Dc(Pe.target,a.id)}),j.append("path").attr("class",Ic).style("opacity",0).style("stroke",function(a){return Eh(a.id)})),Yh.selectAll("."+Pe.target).filter(function(a){return uc(a.id)}).transition().style("opacity",1)}function Ae(a,b){Ke.data.targets.forEach(function(b){for(var c=0;ce&&(e=(k-j)/2,v=0,B++)),A[a]=B,z[B]=e,w[a]=v,v+=j}var e,f,g=a.getBBox(),h=10*Math.ceil((g.width+r)/10),i=10*Math.ceil((g.height+q)/10),j=Mh?i:h,k=Mh?jf:kf;c&&(v=0,B=0,s=0,t=0),x[b]=h,y[b]=i,(!s||h>=s)&&(s=h),(!t||i>=t)&&(t=i),f=Mh?t:s,mg?(Object.keys(x).forEach(function(a){x[a]=s}),Object.keys(y).forEach(function(a){y[a]=t}),e=(k-f*p.length)/2,u>e?(v=0,B=0,p.forEach(function(a){d(a)})):d(b,!0)):d(b)}var f,g,h,i,j,k,n,o,p=rc(a),q=4,r=26,s=0,t=0,u=10,v=0,w={},x={},y={},z={},A={},B=0;b=c(b)?{}:b,o=d(b.withTransition)?b.withTransition:!0,Mh?(g=function(a){return s*(.2+A[a])},j=function(a){return z[A[a]]+w[a]}):(g=function(a){return z[A[a]]+w[a]},j=function(a){return t*(.2+A[a])}),h=function(a,b){return g(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return g(a,b)-4},n=function(a,b){return j(a,b)-7},f=ai.selectAll("."+Pe.legendItem).data(p).enter().append("g").attr("class",function(a){return Dc(Pe.legendItem,a)}).style("cursor","pointer").on("click",function(a){"function"==typeof lg?lg(a):Ke.toggle(a)}).on("mouseover",function(a){Ke.focus(a)}).on("mouseout",function(){Ke.revert()}),f.append("text").text(function(a){return d(Of[a])?Of[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",Mh?h:-200).attr("y",Mh?-200:k),f.append("rect").attr("class",Pe.legendItemEvent).style("fill-opacity",0).attr("x",Mh?i:-200).attr("y",Mh?-200:n).attr("width",function(a){return x[a]}).attr("height",function(a){return y[a]}),f.append("rect").attr("class",Pe.legendItemTile).style("pointer-events","none").style("fill",function(a){return Eh(a)}).attr("x",Mh?h:-200).attr("y",Mh?-200:j).attr("width",10).attr("height",10),ai.selectAll("text").data(p).text(function(a){return d(Of[a])?Of[a]:a}).each(function(a,b){e(this,a,0===b)}).transition().duration(o?250:0).attr("x",h).attr("y",k),ai.selectAll("rect."+Pe.legendItemEvent).data(p).transition().duration(o?250:0).attr("x",i).attr("y",n),ai.selectAll("rect."+Pe.legendItemTile).data(p).transition().duration(o?250:0).attr("x",g).attr("y",j),L(s),M(t),K(B),m(),P(),xe(),l(!1)}function Ge(a){return sc(a.id)}function He(a){return"data"in a&&sc(a.data.id)}function Ie(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}}var Je=a.d3?a.d3:a.require?a.require("d3"):void 0,Ke={data:{}},Le={},Me="_expanded_",Ne="_selected_",Oe="_included_",Pe={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",area:"c3-area",text:"c3-text",texts:"c3-texts",grid:"c3-grid",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",dragarea:"c3-dragarea"},Qe=g(["bindto"],"#chart"),Re=g(["size","width"]),Se=g(["size","height"]),Te=g(["padding","left"]),Ue=g(["padding","right"]),Ve=g(["zoom","enabled"],!1),We=g(["zoom","extent"]),Xe=g(["zoom","privileged"],!1),Ye=g(["onenter"],function(){}),Ze=g(["onleave"],function(){}),$e=g(["transition","duration"],350);f("data","data is required in config");var _e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,xf,yf,zf,Af,Bf,Cf,Df,Ef,Ff,Gf,Hf,If,Jf,Kf=g(["data","x"]),Lf=g(["data","xs"],{}),Mf=g(["data","x_format"],"%Y-%m-%d"),Nf=g(["data","id_converter"],function(a){return a}),Of=g(["data","names"],{}),Pf=g(["data","groups"],[]),Qf=g(["data","axes"],{}),Rf=g(["data","type"]),Sf=g(["data","types"],{}),Tf=g(["data","labels"],{}),Uf=g(["data","order"]),Vf=g(["data","regions"],{}),Wf=g(["data","colors"],{}),Xf=g(["data","selection","enabled"],!1),Yf=g(["data","selection","grouped"],!1),Zf=g(["data","selection","isselectable"],function(){return!0}),$f=g(["data","selection","multiple"],!0),_f=g(["data","onclick"],function(){}),ag=g(["data","onenter"],function(){}),bg=g(["data","onleave"],function(){}),cg=g(["data","onselected"],function(){}),dg=g(["data","onunselected"],function(){}),eg=g(["data","ondragstart"],function(){}),fg=g(["data","ondragend"],function(){}),gg=g(["subchart","show"],!1),hg=gg?g(["subchart","size","height"],60):0,ig=g(["color","pattern"],[]),jg=g(["legend","show"],!0),kg=g(["legend","position"],"bottom"),lg=g(["legend","item","onclick"]),mg=g(["legend","equally"],!1),ng=g(["axis","rotated"],!1),og=g(["axis","x","type"],"indexed"),pg=g(["axis","x","categories"],[]),qg=g(["axis","x","tick","centered"],!1),rg=g(["axis","x","tick","format"]),sg=g(["axis","x","tick","culling"],"categorized"===og?!1:!0),tg=g(["axis","x","tick","count"],10),ug=g(["axis","x","max"]),vg=g(["axis","x","min"]),wg=g(["axis","x","default"]),xg=g(["axis","x","label"],{}),yg=g(["axis","y","show"],!0),zg=g(["axis","y","max"]),Ag=g(["axis","y","min"]),Bg=g(["axis","y","center"]),Cg=g(["axis","y","label"],{}),Dg=g(["axis","y","inner"],!1),Eg=g(["axis","y","tick","format"]),Fg=g(["axis","y","padding"]),Gg=g(["axis","y","ticks"],10),Hg=g(["axis","y2","show"],!1),Ig=g(["axis","y2","max"]),Jg=g(["axis","y2","min"]),Kg=g(["axis","y2","center"]),Lg=g(["axis","y2","label"]),Mg=g(["axis","y2","inner"],!1),Ng=g(["axis","y2","tick","format"]),Og=g(["axis","y2","padding"]),Pg=g(["axis","y2","ticks"],10),Qg=g(["grid","x","show"],!1),Rg=g(["grid","x","type"],"tick"),Sg=g(["grid","x","lines"],[]),Tg=g(["grid","y","show"],!1),Ug=g(["grid","y","lines"],[]),Vg=g(["grid","y","ticks"],10),Wg=g(["point","show"],!0),Xg=Wg?g(["point","r"],2.5):0,Yg=g(["point","focus","line","enabled"],!0),Zg=g(["point","focus","expand","enabled"],!0),$g=g(["point","focus","expand","r"],Zg?4:Xg),_g=g(["point","focus","select","r"],8),ah=g(["bar","width"]),bh=g(["bar","width","ratio"],.6),ch=g(["pie","label","show"],!0),dh=g(["pie","label","format"]),eh=g(["pie","onclick"],function(){}),fh=g(["pie","onmouseover"],function(){}),gh=g(["pie","onmouseout"],function(){}),hh=g(["donut","label","show"],!0),ih=g(["donut","label","format"]),jh=g(["donut","title"],""),kh=g(["donut","onclick"],function(){}),lh=g(["donut","onmouseover"],function(){}),mh=g(["donut","onmouseout"],function(){}),nh=g(["regions"],[]),oh=g(["tooltip","show"],!0),ph=g(["tooltip","format","title"]),qh=g(["tooltip","format","value"]),rh=g(["tooltip","contents"],function(a,b,c,d){var e,f,g,h,i,j=ph?ph:b,k=qh?qh:c;for(f=0;f"+(g||0===g?""+g+"":"")),i=a[f].name,h=k(a[f].value,a[f].ratio),e+="",e+=""+i+"",e+=""+h+"",e+="");return e+""}),sh=g(["tooltip","init","show"],!1),th=g(["tooltip","init","x"],0),uh=g(["tooltip","init","position"],{top:"0px",left:"50px"}),vh=("string"==typeof Qe?Qe.replace("#",""):Qe.id)+"-clip",wh=h(vh),xh="timeseries"===og,yh="categorized"===og,zh=!xh&&(Kf||Sd(Lf)),Ah=null,Bh=!1,Ch=!1,Dh=!1,Eh=Nd(Wf,ig),Fh=function(){var a=[[Je.time.format("%Y/%-m/%-d"),function(){return!0}],[Je.time.format("%-m/%-d"),function(a){return a.getMonth()}],[Je.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[Je.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[Je.time.format("%I %p"),function(a){return a.getHours()}],[Je.time.format("%I:%M"),function(a){return a.getMinutes()}],[Je.time.format(":%S"),function(a){return a.getSeconds()}],[Je.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),Gh=[],Hh=ng?"left":"bottom",Ih=ng?Dg?"top":"bottom":Dg?"right":"left",Jh=ng?Mg?"bottom":"top":Mg?"left":"right",Kh=ng?"left":"bottom",Lh={main:function(){return"translate("+_e.left+","+_e.top+")"},context:function(){return"translate("+af.left+","+af.top+")"},legend:function(){return"translate("+bf.left+","+bf.top+")"},x:function(){return"translate(0,"+(ng?0:ef)+")"},y:function(){return"translate(0,"+(ng?ef:0)+")"},y2:function(){return"translate("+(ng?0:cf)+","+(ng?1:0)+")"},subx:function(){return"translate(0,"+(ng?0:ff)+")"},arc:function(){return"translate("+cf/2+","+ef/2+")"}},Mh="right"===kg,Nh=0,Oh=0,Ph=0,Qh=30,Rh=30,Sh=5;rf=Je.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var Th,Uh=function(){var a=Je.svg.line().x(ng?function(a){return T(a.id)(a.value)}:Zc).y(ng?Zc:function(a){return T(a.id)(a.value)});return function(b){var c,d,e=_d(b.values);return Dd(b)?(a.interpolate(Ed(b)?"cardinal":"linear"),Vf[b.id]?le(e,Af,T(b.id),Vf[b.id]):a(e)):(c=Af(e[0].x),d=T(b.id)(e[0].value),ng?"M "+d+" "+c:"M "+c+" "+d)}}(),Vh=function(){var a;return a=ng?Je.svg.area().x0(function(a){return T(a.id)(0)}).x1(function(a){return T(a.id)(a.value)}).y(Zc):Je.svg.area().x(Zc).y0(function(a){return T(a.id)(0)}).y1(function(a){return T(a.id)(a.value)}),function(b){var c,d,e=_d(b.values);return xd([b],"area")||xd([b],"area-spline")?(a.interpolate(Ed(b)?"cardinal":"linear"),a(e)):(c=Af(e[0].x),d=T(b.id)(e[0].value),ng?"M "+d+" "+c:"M "+c+" "+d)}}(),Wh=function(){var a=Je.svg.line().x(ng?function(a){return U(a.id)(a.value)}:ad).y(ng?ad:function(a){return U(a.id)(a.value)});return function(b){var c=_d(b.values);return Dd(b)?a(c):"M "+Df(c[0].x)+" "+U(b.id)(c[0].value)}}(),Xh=function(){};Th=Je.svg.brush().on("brush",ue),Th.update=function(){return _h&&_h.select("."+Pe.brush).call(this),this},Th.scale=function(a){return ng?this.y(a):this.x(a)},Ve&&(Xh=Je.behavior.zoom().on("zoomstart",function(){Xh.altDomain=Je.event.sourceEvent.altKey?Af.orgDomain():null}).on("zoom",Ve?ve:null),Xh.scale=function(a){return ng?this.y(a):this.x(a)},Xh.orgScaleExtent=function(){var a=We?We:[1,10];return[a[0],Math.max(pc()/a[1],a[1])]},Xh.updateScaleExtent=function(){var a=Wb(Af.orgDomain())/Wb(di),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Yh,Zh,$h,_h,ai,bi,ci,di,ei,fi={};if(Ke.focus=function(a){function b(a){vc(a).transition().duration(100).style("opacity",1)}var c=Yh.selectAll(Sc(a)),d=c.filter(Ge),e=c.filter(He);Ke.revert(),Ke.defocus(),b(d.classed(Pe.focused,!0)),b(e),Cd(Ke.data.targets)&&Gb(a,!0),Ce(a)},Ke.defocus=function(a){function b(a){vc(a).transition().duration(100).style("opacity",.3)}var c=Yh.selectAll(Sc(a)),d=c.filter(Ge),e=c.filter(He);Ke.revert(),b(d.classed(Pe.focused,!1)),b(e),Cd(Ke.data.targets)&&Hb(a),De(a)},Ke.revert=function(a){function b(a){vc(a).transition().duration(100).style("opacity",1)}var c=Yh.selectAll(Sc(a)),d=c.filter(Ge),e=c.filter(He);b(d.classed(Pe.focused,!1)),b(e),Cd(Ke.data.targets)&&Hb(a),Ee()},Ke.show=function(a){xc(a),Yh.selectAll(Sc(a)).transition().style("opacity",1),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!1})},Ke.hide=function(a){wc(a),Yh.selectAll(Sc(a)).transition().style("opacity",0),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!1})},Ke.toggle=function(a){uc(a)?Ke.hide(a):Ke.show(a)},Ke.unzoom=function(){Th.clear().update(),te({withUpdateXDomain:!0})},Ke.load=function(a){if("function"!=typeof a.done&&(a.done=function(){}),a.xs&&ec(a.xs),"categories"in a&&yh&&(pg=a.categories,Gf.categories(pg)),"cacheIds"in a&&Xb(a.cacheIds))return void Ae(Zb(a.cacheIds),a.done);if("data"in a)Ae(lc(a.data),a.done);else if("url"in a)Je.csv(a.url,function(b,c){Ae(lc(c),a.done)});else if("rows"in a)Ae(lc(jc(a.rows)),a.done);else{if(!("columns"in a))throw Error("url or rows or columns is required.");Ae(lc(kc(a.columns)),a.done)}},Ke.unload=function(a){Ke.data.targets=Ke.data.targets.filter(function(b){return b.id!==a}),Yh.selectAll(Sc(a)).transition().style("opacity",0).remove(),jg&&ai.selectAll("."+Pe.legendItem+Rc(a)).remove(),Ke.data.targets.length>0&&te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Ke.selected=function(a){return Je.merge($h.selectAll("."+Pe.shapes+Rc(a)).selectAll("."+Pe.shape).filter(function(){return Je.select(this).classed(Ne)}).map(function(a){return a.map(function(a){return a.__data__})}))},Ke.select=function(a,b,c){Xf&&$h.selectAll("."+Pe.shapes).selectAll("."+Pe.shape).each(function(e,f){var g=Je.select(this),h="circle"===this.nodeName?Vd:Yd,i="circle"===this.nodeName?Wd:Zd,j=Yf||!a||a.indexOf(e.id)>=0,k=!b||b.indexOf(f)>=0,l=g.classed(Ne);j&&k?Zf(e)&&!l&&h(g.classed(Ne,!0),e,f):d(c)&&c&&l&&i(g.classed(Ne,!1),e,f)})},Ke.unselect=function(a,b){Xf&&$h.selectAll("."+Pe.shapes).selectAll("."+Pe.shape).each(function(c,d){var e=Je.select(this),f="circle"===this.nodeName?Wd:Zd,g=Yf||!a||a.indexOf(c.id)>=0,h=!b||b.indexOf(d)>=0,i=e.classed(Ne);g&&h&&Zf(c)&&i&&f(e.classed(Ne,!1),c,d)})},Ke.toLine=function(a){wd(a,"line"),ye()},Ke.toSpline=function(a){wd(a,"spline"),ye()},Ke.toBar=function(a){wd(a,"bar"),ye()},Ke.toScatter=function(a){wd(a,"scatter"),ye()},Ke.toArea=function(a){wd(a,"area"),ye()},Ke.toAreaSpline=function(a){wd(a,"area-spline"),ye()},Ke.toPie=function(a){wd(a,"pie"),ye({withTransform:!0})},Ke.toDonut=function(a){wd(a,"donut"),ye({withTransform:!0})},Ke.groups=function(a){return c(a)?Pf:(Pf=a,te(),Pf)},Ke.xgrids=function(a){return a?(Sg=a,te(),Sg):Sg},Ke.xgrids.add=function(a){return a?Ke.xgrids(Sg.concat(a)):void 0},Ke.xgrids.remove=function(a){var b=Ie(a);return Ke.xgrids(Sg.filter(b))},Ke.ygrids=function(a){return a?(Ug=a,te(),Ug):Ug},Ke.ygrids.add=function(a){return a?Ke.ygrids(Ug.concat(a)):void 0},Ke.ygrids.remove=function(a){var b=Ie(a);return Ke.ygrids(Ug.filter(b))},Ke.regions=function(a){return c(a)?nh:(nh=a,te(),nh)},Ke.regions.add=function(a){return c(a)?nh:(nh=nh.concat(a),te(),nh)},Ke.regions.remove=function(a,c){var e=[].concat(a);return c=d(c)?c:{},e.forEach(function(a){var d=b(c.duration)?c.duration:0;Yh.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),nh=nh.filter(function(b){return b.classes.indexOf(a)<0})}),nh},Ke.data.get=function(a){var b=Ke.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},Ke.data.getAsTarget=function(a){var b=tc(function(b){return b.id===a});return b.length>0?b[0]:void 0},Ke.data.names=function(a){return arguments.length?(Of=a,Fe(Ke.data.targets,{withTransition:!0}),Of):Of},Ke.x=function(a){return arguments.length&&(gc(Ke.data.targets,a),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Ke.data.x},Ke.xs=function(a){return arguments.length&&(hc(Ke.data.targets,a),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Ke.data.x},Ke.resize=function(a){Re=a?a.width:null,Se=a?a.height:null,ye({withLegend:!0,withTransition:!1})},Ke.destroy=function(){Ke.data.targets=void 0,Ke.data.x={},ci.html(""),a.onresize=null},"url"in e.data)Je.csv(e.data.url,function(a,b){me(b)});else if("rows"in e.data)me(jc(e.data.rows));else{if(!("columns"in e.data))throw Error("url or rows or columns is required.");me(kc(e.data.columns))}return Ke},"function"==typeof a.define&&a.define.amd?a.define(e):a.c3=e}(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}var e={};e.generate=function(e){function f(a,b){if(!(a in e))throw Error(b)}function g(a,b){var c,d,f,g=e;for(c=0;cdf&&(df=0),0>ff&&(ff=0),bf={top:og?af.top:jf-ig-(Nh?0:kf),right:0/0,bottom:20+(Nh?0:kf),left:og?Rh:af.left},ef=og?af.left-Rh-Sh:df,gf=og?ff:jf-bf.top-bf.bottom,0>ef&&(ef=0),0>gf&&(gf=0),cf={top:Nh?0:jf-kf,right:0/0,bottom:0,left:Nh?hf-lf:0},n(),Nh&&Cd(Le.data.targets)&&(cf.left=df/2+nf)}function n(){nf=ff/2,mf=.95*nf,of=Bd(Le.data.targets)?.6*mf:0}function o(){var a=og?Qe.axisX:Qe.axisY,b=Ke.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Ke.select(Re).node().getBoundingClientRect(),e=c.right-d.left-r();return e>0?e:0}function p(){return Se?Se:v()}function q(){var a=Te?Te:w();return a>0?a:320}function r(){return Cd(Le.data.targets)?0:Ue?Ue:og||!zg||Eg?1:t("y")}function s(){var a=1;return Cd(Le.data.targets)?0:Ve?Ve:Nh?lf+(Ig&&!og?t("y2"):a):Ig?Ng||og?a:t("y2"):a}function t(a){var b=db(a);return b.isInner?20+wb(a):40+wb(a)}function u(a){return"y"!==a||zg?"y2"!==a||Ig?(db(a).isInner?30:40)+("y2"===a?-10:0):Th:kg&&!Nh?10:1}function v(){return+Ke.select(Re).style("width").replace("px","")}function w(){return+Ke.select(Re).style("height").replace("px","")}function x(a){return a?-5:-(af.left-1)}function y(a){return a?-20:-1}function z(){return x(!og)}function A(){return y(!og)}function B(){return x(og)}function C(){return y(og)}function D(a){return a?df+2+4:af.left+20}function E(a){return a?80:ff+2}function F(){return D(!og)}function G(){return E(!og)}function H(){return D(og)}function I(){return E(og)}function J(){var a=og?ff:df,b=pc(),c=Rb()*(yd(Le.data.targets)?(b-(zh?.25:1))/b:.98);return b>1?a*c/(b-1):a}function K(a){Oh=a}function L(a){Ph=a}function M(a){Qh=a}function N(){return kg?Nh?Ph*(Oh+1):hf:0}function O(){return kg?Nh?jf:Qh*(Oh+1):0}function P(){var a,b,c=!Bf;tf=og?1:0,uf=og?ff:df,vf=og?0:ff,wf=og?df:1,xf=tf,yf=uf,zf=og?0:gf,Af=og?ef:1,Bf=R(tf,uf,c?void 0:Bf.domain(),function(){return Hf.tickOffset()}),Cf=S(vf,wf),Df=S(vf,wf),Ef=R(tf,uf,ei,function(a){return a%1?0:Kf.tickOffset()}),Ff=S(zf,Af),Gf=S(zf,Af),a=Y(),b=Z(),Hf=V(Bf,Ih,a,b),Kf=V(Ef,Lh,a,b),If=W(Cf,Jh,Fg,Hg),Jf=W(Df,Kh,Og,Qg),c||(Uh.scale(Ef),We&&Yh.scale(Bf)),Q()}function Q(){pf=zb(),qf=Ab(),rf=Ab(.98)}function R(a,b,e,f){var g=(yh?Ke.time.scale():Ke.scale.linear()).range([a,b]);if(g.orgDomain=function(){return g.domain()},d(e)&&g.domain(e),c(f)&&(f=function(){return 0}),zh){var h,i=g;g=function(a){return i(a)+f(a)};for(h in i)g[h]=i[h];g.orgDomain=function(){return i.domain()},g.domain=function(a){return arguments.length?(i.domain(a),g):(a=i.domain(),[a[0],a[1]+1])}}return g}function S(a,b){return Ke.scale.linear().range([a,b])}function T(a){return"y2"===X(a)?Df:Cf}function U(a){return"y2"===X(a)?Gf:Ff}function V(a,b,c,d){var e=(zh?xb():Ke.svg.axis()).scale(a).orient(b);return e.tickFormat(c).ticks(d),zh?e.tickCentered(rg):e.tickOffset=function(){var a=og?ff:df;return a*Rb()/pc()/2},zh&&e.categories(qg),e}function W(a,b,c,d){return Ke.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function X(a){return a in Rf?Rf[a]:"y"}function Y(){var a=yh?Gh:zh?Cc:null;return sg&&("function"==typeof sg?a=sg:yh&&(a=function(a){return Ke.time.format(sg)(a)})),a}function Z(){var a=pc();return tg&&a>ug?ug:a}function $(a){return"string"==typeof a?a:a?a.text:null}function _(a,b){var c=a&&"object"==typeof a&&a.position?a.position:b;return{isInner:c.indexOf("inner")>=0,isOuter:c.indexOf("outer")>=0,isLeft:c.indexOf("left")>=0,isCenter:c.indexOf("center")>=0,isRight:c.indexOf("right")>=0,isTop:c.indexOf("top")>=0,isMiddle:c.indexOf("middle")>=0,isBottom:c.indexOf("bottom")>=0}}function ab(){return _(yg,og?"inner-top":"inner-right")}function bb(){return _(Dg,og?"inner-right":"inner-top")}function cb(){return _(Mg,og?"inner-right":"inner-top")}function db(a){return"y2"===a?cb():"y"===a?bb():ab()}function eb(){return $(yg)}function fb(){return $(Dg)}function gb(){return $(Mg)}function hb(a,b){return a?b.isLeft?0:b.isCenter?df/2:df:b.isBottom?-ff:b.isMiddle?-ff/2:0}function ib(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function jb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function kb(){return hb(!og,ab())}function lb(){return hb(og,bb())}function mb(){return hb(og,cb())}function nb(){return ib(!og,ab())}function ob(){return ib(og,bb())}function pb(){return ib(og,cb())}function qb(){var a=ab();return og?a.isInner?"1.2em":-30-wb("x"):a.isInner?"-0.5em":"3em"}function rb(){var a=bb();return og?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-wb("y")}function sb(){var a=cb();return og?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+wb("y2")}function tb(){return jb(!og,ab())}function ub(){return jb(og,bb())}function vb(){return jb(og,cb())}function wb(a){var b=0,c="x"===a?Qe.axisX:"y"===a?Qe.axisY:Qe.axisY2;return Ke.selectAll("."+c+" .tick text").each(function(){var a=this.getBBox();bb?[b,c]:[c,b]}function d(a){for(var b=[],c=Math.ceil(a[0]);c0&&b[0]>0&&b.unshift(b[0]-(b[1]-b[0])),b}function e(a,b){var c=a.length-1;return o>=c||b%Math.ceil(c/o)===0}function f(a){return a0)for(g=Ac(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 Ke.min(Object.keys(i).map(function(a){return Ke.min(i[a])}))}function Pb(a){var b,c,d,e,f,g,h=rc(a),i=yc(a);if(Qf.length>0)for(g=Bc(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 Ke.max(Object.keys(i).map(function(a){return Ke.max(i[a])}))}function Qb(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return X(a.id)===c}),m="y2"===c?Kg:Bg,n="y2"===c?Jg:Ag,o=b(m)?m:Ob(l),p=b(n)?n:Pb(l),q="y2"===c?Lg:Cg,r=Xc()&&og;return 0===l.length?"y2"===c?Df.domain():Cf.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),"y"===c&&Gg&&(f=b(Gg.top)?Gg.top:e,g=b(Gg.bottom)?Gg.bottom:e),"y2"===c&&Pg&&(f=b(Pg.top)?Pg.top:e,g=b(Pg.bottom)?Pg.bottom:e),r&&(i=Yc(o,p),j=Wb(Cf.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]))),yd(l)&&!Ac(l)&&(g=o),[o-g,p+f])}function Rb(a){var b=Wb(ei),c=Wb(Bf.domain());return a||0===c?1:b/c}function Sb(a){return wg?wg:Ke.min(a,function(a){return Ke.min(a.values,function(a){return a.x})})}function Tb(a){return vg?vg:Ke.max(a,function(a){return Ke.max(a.values,function(a){return a.x})})}function Ub(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return zh?d=0:yd(a)?(c=pc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Vb(a){var b=[Sb(a),Tb(a)],c=b[0],d=b[1],e=Ub(a,b),f=yh?new Date(c.getTime()-e):c-e,g=yh?new Date(d.getTime()+e):d+e;return[f,g]}function Wb(a){return a[1]-a[0]}function Xb(a){for(var b=0;bd?0:d}function ac(a){return Lf&&a===Lf||Sd(Mf)&&Td(Mf,a)}function bc(a){return!ac(a)}function cc(a){return Lf?Lf:Sd(Mf)?Mf[a]:null}function dc(a,b){return a in Le.data.x&&Le.data.x[a]&&Le.data.x[a][b]?Le.data.x[a][b]:b}function ec(a){Object.keys(a).forEach(function(b){Mf[b]=a[b]})}function fc(a){var b;return a&&(b=Pf[a.id],a.name=b?b:a.id),a}function gc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=ic(b[d],a.id,d)}),Le.data.x[a.id]=b})}function hc(a,b){a.forEach(function(a){b[a.id]&&gc([a],b[a.id])})}function ic(a,b,c){var d;return d=yh?a?a instanceof Date?a:Od(a):Od(dc(b,c)):Ah&&!zh?a?+a:dc(b,c):c}function jc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0&&(Le.data.x[b]=a.map(function(a){return a[c]})):Le.data.x[b]=a.map(function(a,b){return b})}),c.forEach(function(a){if(!Le.data.x[a])throw new Error('x is not defined for id = "'+a+'".')}),b=c.map(function(b,c){var d=Of(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=cc(b),g=a[f],h=ic(g,b,e);return Ah&&zh&&0===c&&g&&(0===e&&(qg=[]),qg.push(g)),"undefined"==typeof a[b]&&(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})}}),b.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++})}),Sf&&wd(rc(b).filter(function(a){return!(a in Tf)}),Sf),b.forEach(function(a){Yb(a.id_org,a)}),b}function mc(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 nc(a){return a>0&&Le.data.targets[0].values[a-1]?Le.data.targets[0].values[a-1].x:void 0}function oc(a){return a1?Le.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?Le.data.targets[0]:null,a}function rc(a){return a=c(a)?Le.data.targets:a,a.map(function(a){return a.id})}function sc(a){var b,c=rc();for(b=0;ba})}function Bc(a){return zc(a,function(a){return a>0})}function Cc(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&&(e=e.concat(dd(a,f))),a[g].x&&(e=e.concat(dd(a,g))),gd(e,b)):ed(a,b,f,g)}function fd(a,b){var c;return c=a.map(function(a){return ed(a.values,b)}),gd(c,b)}function gd(a,b){var c,d;return a.forEach(function(a){var e=Ud(a,b);(c>e||!c)&&(c=e,d=a)}),d}function hd(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 id(){return Vf&&"desc"===Vf.toLowerCase()}function jd(){return Vf&&"asc"===Vf.toLowerCase()}function kd(a){var b=jd(),c=id();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 Vf&&a.sort(Vf),a}function ld(a,c){var d,e,f,g,h,i,j,k=Cd(Le.data.targets),l=k?cd:bd,m=a.filter(function(a){return a&&b(a.value)});ph&&0!==m.length&&(ci.html(sh(a,Y(),l,Fh)).style("display","block"),d=ci.property("offsetWidth"),e=ci.property("offsetHeight"),k?(g=df/2+c[0],i=ff/2+c[1]+20):(og?(f=o(),g=f+c[0]+100,h=g+d,j=p()-s(),i=Bf(m[0].x)+20):(f=o(),g=f+r()+Bf(m[0].x)+20,h=g+d,j=f+p()-s(),i=c[1]+15),h>j&&(g-=d+60),i+e>q()&&(i-=e+30)),ci.style("top",i+"px").style("left",g+"px"))}function md(){ci.style("display","none")}function nd(a){var c=a.filter(function(a){return a&&b(a.value)});ph&&(zd(Le.data.targets)||Cd(Le.data.targets)||_h.selectAll("line."+Qe.xgridFocus).style("visibility","visible").data([c[0]]).attr(og?"y1":"x1",Zc).attr(og?"y2":"x2",Zc))}function od(){_h.select("line."+Qe.xgridFocus).style("visibility","hidden")}function pd(a){return a.x||0===a.x?Bf(a.x):null}function qd(a){return T(a.id)(a.value)}function rd(){var a,b,d={},e=0;return vc(tc(Fd)).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function vd(a,b){return bh?bh:b?2*a.tickOffset()*ch/b:0}function wd(a,b){var d=c(a)?rc():a;"string"==typeof d&&(d=[d]);for(var e=0;e0}function Td(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function Ud(a,b){return Math.pow(Bf(a.x)-b[0],2)+Math.pow(Cf(a.value)-b[1],2)}function Vd(a,b,c){dg(b,a.node()),_h.select("."+Qe.selectedCircles+Rc(b.id)).selectAll("."+Qe.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return Dc(Qe.selectedCircle,c)}).attr("cx",og?qd:pd).attr("cy",og?pd:qd).attr("stroke",function(){return Fh(b.id)}).attr("r",1.4*ah).transition().duration(100).attr("r",ah)}function Wd(a,b,c){eg(b,a.node()),_h.select("."+Qe.selectedCircles+Rc(b.id)).selectAll("."+Qe.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function Xd(a,b,c,d){a?Vd(b,c,d):Wd(b,c,d)}function Yd(a,b){dg(b,a.node()),a.transition().duration(100).style("fill",function(){return Ke.rgb(Fh(b.id)).darker(1)})}function Zd(a,b){eg(b,a.node()),a.transition().duration(100).style("fill",function(){return Fh(b.id)})}function $d(a,b,c,d){a?Yd(b,c,d):Zd(b,c,d)}function _d(a){return a.filter(function(a){return b(a.value)})}function ae(a,c){return(c?_h.selectAll("."+Qe.circles+Rc(c)):_h).selectAll("."+Qe.circle+(b(a)?"-"+a:""))}function be(a,b){ae(a,b).classed(Ne,!0).attr("r",_g)}function ce(a){ae(a).filter(function(){return Ke.select(this).classed(Ne)}).classed(Ne,!1).attr("r",Yg)}function de(a){return _h.selectAll("."+Qe.bar+(b(a)?"-"+a:""))}function ee(a){de(a).classed(Ne,!0)}function fe(a){de(a).classed(Ne,!1)}function ge(a,b){var c=ke(a,b);return function(a,b){var d=c(a,b),e=og?1:0,f=og?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 he(a,b){var c=ke(a,!1),d=b?ie:je;return function(a,b){return d(c(a,b),a,this)}}function ie(a,b){var c;return og?(c=Fd(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}function je(a,b,c){var d=c.getBBox();return og?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:Fd(b)?-3:-6)}function ke(a,b){var c=a.__max__+1,d=vd(Hf,c),e=sd(d,c,a,!!b),f=td(!!b),g=ud(a,!!b),h=b?U:T;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return og&&(a.value>0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function le(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(d(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function me(b){var c,d,e;if(di=Ke.select(Re),di.empty())throw new Error('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(di.html(""),di.classed("c3",!0),Le.data.x={},Le.data.targets=lc(b),m(),P(),Bf.domain(Ke.extent(Vb(Le.data.targets))),Cf.domain(Qb(Le.data.targets,"y")),Df.domain(Qb(Le.data.targets,"y2")),Ef.domain(Bf.domain()),Ff.domain(Cf.domain()),Gf.domain(Df.domain()),ei=Bf.domain(),Uh.scale(Ef),We&&Yh.scale(Bf),Zh=di.append("svg").attr("width",df+af.left+af.right).attr("height",ff+af.top+af.bottom).on("mouseenter",Ze).on("mouseleave",$e),$h=Zh.append("defs"),$h.append("clipPath").attr("id",wh).append("rect").attr("width",df).attr("height",ff),$h.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",z).attr("y",A).attr("width",F).attr("height",G),$h.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),_h=Zh.append("g").attr("transform",Mh.main),ai=hg?Zh.append("g").attr("transform",Mh.context):null,bi=kg?Zh.append("g").attr("transform",Mh.legend):null,ci=Ke.select(Re).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),_h.append("g").attr("class",Qe.axisX).attr("clip-path",og?"":h("xaxis-clip")).attr("transform",Mh.x).append("text").attr("class",Qe.axisXLabel).attr("transform",og?"rotate(-90)":"").attr("dx",nb).attr("dy",qb).style("text-anchor",tb).text(eb),zg&&_h.append("g").attr("class",Qe.axisY).attr("clip-path",og?h("yaxis-clip"):"").append("text").attr("class",Qe.axisYLabel).attr("transform",og?"":"rotate(-90)").attr("dx",ob).attr("dy",rb).style("text-anchor",ub).text(fb),Ig&&_h.append("g").attr("class",Qe.axisY2).attr("transform",Mh.y2).append("text").attr("class",Qe.axisY2Label).attr("transform",og?"":"rotate(-90)").attr("dx",pb).style("text-anchor",vb).text(gb),d=_h.append("g").attr("clip-path",xh).attr("class",Qe.grid),Rg&&d.append("g").attr("class",Qe.xgrids),Sd(Tg)&&d.append("g").attr("class",Qe.xgridLines),Zg&&d.append("g").attr("class",Qe.xgridFocus).append("line").attr("class",Qe.xgridFocus).attr("x1",og?0:-10).attr("x2",og?df:-10).attr("y1",og?-10:af.top).attr("y2",og?-10:ff),Ug&&d.append("g").attr("class",Qe.ygrids),Sd(Vg)&&d.append("g").attr("class",Qe.ygridLines),_h.append("g").attr("clip-path",xh).attr("class",Qe.regions),_h.append("g").attr("clip-path",xh).attr("class",Qe.chart),c=_h.select("."+Qe.chart).append("g").attr("class",Qe.eventRects).style("fill-opacity",0).style("cursor",We?og?"ns-resize":"ew-resize":null),_h.select("."+Qe.chart).append("g").attr("class",Qe.chartBars),_h.select("."+Qe.chart).append("g").attr("class",Qe.chartLines),_h.select("."+Qe.chart).append("g").attr("class",Qe.chartArcs).attr("transform",Mh.arc).append("text").attr("class",Qe.chartArcsTitle).style("text-anchor","middle").text(Kb()),_h.select("."+Qe.chart).append("g").attr("class",Qe.chartTexts),We&&_h.insert("rect",Ye?null:"g."+Qe.grid).attr("class",Qe.zoomRect).attr("width",df).attr("height",ff).style("opacity",0).style("cursor",og?"ns-resize":"ew-resize").call(Yh).on("dblclick.zoom",null),xg&&Uh.extent("function"!=typeof xg?xg:xg(Vb())),hg&&(ai.append("g").attr("clip-path",xh).attr("class",Qe.chart),ai.select("."+Qe.chart).append("g").attr("class",Qe.chartBars),ai.select("."+Qe.chart).append("g").attr("class",Qe.chartLines),ai.append("g").attr("clip-path",xh).attr("class",Qe.brush).call(Uh).selectAll("rect").attr(og?"width":"height",og?ef:gf),ai.append("g").attr("class",Qe.axisX).attr("transform",Mh.subx).attr("clip-path",og?"":h("xaxis-clip"))),ze(Le.data.targets),og?_h.select("."+Qe.axisX).style("opacity",0).call(Hf):(_h.select("."+Qe.axisY).style("opacity",0).call(If),_h.select("."+Qe.axisY2).style("opacity",0).call(Jf)),ye({withTransform:!0,withLegend:!0,durationForAxis:0}),th){if(yh&&"string"==typeof uh){for(uh=Od(uh),e=0;e0){d=[];for(var f in Pf)for(c=0;cf&&g>c&&d>h&&i>d):"path"===this.nodeName&&(l=hd(this),c=l.x,d=l.y,e=l.width,j=l.height,k=$d,p=!(c>g||f>c+e||d>i||h>d+j)),p^o&&(m.classed(Pe,!o),m.classed(Oe,!n),k(!n,m,a,b))}))}function re(a){Cd(Le.data.targets)||Yf&&(Bh=a,_h.select("."+Qe.chart).append("rect").attr("class",Qe.dragarea).style("opacity",.1),Ch=!0,fg())}function se(){Cd(Le.data.targets)||Yf&&(_h.select("."+Qe.dragarea).transition().duration(100).style("opacity",0).remove(),_h.selectAll("."+Qe.shape).classed(Pe,!1),Ch=!1,gg())}function te(a){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=rd(),I=Cd(Le.data.targets),K=vc(Le.data.targets);if(0!==K.length){if(a=d(a)?a:{},t=d(a.withY)?a.withY:!0,u=d(a.withSubchart)?a.withSubchart:!0,v=d(a.withTransition)?a.withTransition:!0,w=d(a.withTransform)?a.withTransform:!1,x=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,y=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,z=d(a.withLegend)?a.withLegend:!1,E=v?_e:0,F=d(a.durationForExit)?a.durationForExit:E,G=d(a.durationForAxis)?a.durationForAxis:E,z&&kg&&Ge(Le.data.targets,a),y&&(Bf.domain(Ke.extent(Vb(K))),ei=Bf.domain(),We&&Yh.scale(Bf).updateScaleExtent(),Ef.domain(Bf.domain()),Uh.scale(Ef)),x&&(Bf.domain(Uh.empty()?ei:Uh.extent()),We&&Yh.scale(Bf).updateScaleExtent()),Cf.domain(Qb(K,"y")),Df.domain(Qb(K,"y2")),_h.select("."+Qe.axisX).style("opacity",I?0:1).transition().duration(G).call(Hf),_h.select("."+Qe.axisY).style("opacity",I?0:1).transition().duration(G).call(If),_h.select("."+Qe.axisY2).style("opacity",I?0:1).transition().duration(G).call(Jf),A=ge(H),C=he(H,!0),D=he(H,!1),_h.select("."+Qe.axisX+" ."+Qe.axisXLabel).attr("x",kb),_h.select("."+Qe.axisY+" ."+Qe.axisYLabel).attr("x",lb).attr("dy",rb),_h.select("."+Qe.axisY2+" ."+Qe.axisY2Label).attr("x",mb).attr("dy",sb),Ff.domain(Cf.domain()),Gf.domain(Df.domain()),ci.style("display","none"),_h.select("line."+Qe.xgridFocus).style("visibility","hidden"),Rg){if("year"===Sg){e=[];for(var L=Vb(),M=L[0].getFullYear(),N=L[1].getFullYear(),O=M;N>=O;O++)e.push(new Date(O+"-01-01 00:00:00"))}else e=Bf.ticks(10);c=_h.select("."+Qe.xgrids).selectAll("."+Qe.xgrid).data(e),c.enter().append("line").attr("class",Qe.xgrid),c.attr("x1",og?0:function(a){return Bf(a)-Hf.tickOffset()}).attr("x2",og?df:function(a){return Bf(a)-Hf.tickOffset()}).attr("y1",og?function(a){return Bf(a)-Hf.tickOffset()}:af.top).attr("y2",og?function(a){return Bf(a)-Hf.tickOffset()}:ff).style("opacity",function(){return+Ke.select(this).attr(og?"y1":"x1")===(og?ff:0)?0:1}),c.exit().remove()}Sd(Tg)&&(f=_h.select("."+Qe.xgridLines).selectAll("."+Qe.xgridLine).data(Tg),g=f.enter().append("g").attr("class",function(a){return Qe.xgridLine+(a.class?a.class:"")}),g.append("line").style("opacity",0),g.append("text").attr("text-anchor","end").attr("transform",og?"":"rotate(-90)").attr("dx",og?0:-af.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(E).attr("x1",og?0:$c).attr("x2",og?df:$c).attr("y1",og?$c:af.top).attr("y2",og?$c:ff).style("opacity",1),f.select("text").transition().duration(E).attr("x",og?df:0).attr("y",$c).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(E).style("opacity",0).remove()),t&&Ug&&(h=_h.select("."+Qe.ygrids).selectAll("."+Qe.ygrid).data(Cf.ticks(Wg)),h.enter().append("line").attr("class",Qe.ygrid),h.attr("x1",og?Cf:0).attr("x2",og?Cf:df).attr("y1",og?0:Cf).attr("y2",og?ff:Cf),h.exit().remove()),t&&Sd(Vg)&&(i=_h.select("."+Qe.ygridLines).selectAll("."+Qe.ygridLine).data(Vg),j=i.enter().append("g").attr("class",function(a){return Qe.ygridLine+(a.class?a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",og?"rotate(-90)":"").attr("dx",og?0:-af.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(E).attr("x1",og?_c:0).attr("x2",og?_c:df).attr("y1",og?0:_c).attr("y2",og?ff:_c).style("opacity",1),i.select("text").transition().duration(E).attr("x",og?0:df).attr("y",_c).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(E).style("opacity",0).remove()),l=_h.selectAll("."+Qe.bars).selectAll("."+Qe.bar).data(Kd),l.enter().append("path").attr("d",A).style("stroke","none").style("opacity",0).style("fill",function(a){return Fh(a.id)}).attr("class",Lc),l.style("opacity",Tc).transition().duration(E).attr("d",A).style("opacity",1),l.exit().transition().duration(F).style("opacity",0).remove(),n=_h.selectAll("."+Qe.texts).selectAll("."+Qe.text).data(Md),n.enter().append("text").attr("class",Ec).attr("text-anchor",function(a){return og?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0),n.text(function(a){return bd(a.value)}).style("fill-opacity",Uc).transition().duration(E).attr("x",C).attr("y",D).style("fill-opacity",Wc),n.exit().transition().duration(F).style("fill-opacity",0).remove(),_h.selectAll("."+Qe.line).style("opacity",Tc).transition().duration(E).attr("d",Vh).style("opacity",1),_h.selectAll("."+Qe.area).style("opacity",0).transition().duration(E).attr("d",Wh).style("opacity",fi),k=_h.selectAll("."+Qe.circles).selectAll("."+Qe.circle).data(Ld),k.enter().append("circle").attr("class",Jc).style("opacity",0).attr("r",Yg),k.style("opacity",Tc).transition().duration(E).style("opacity",Vc).attr("cx",og?qd:pd).attr("cy",og?pd:qd),k.exit().remove(),_h.selectAll("."+Qe.chartArc).select("."+Qe.arc).attr("transform",w?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(E).attrTween("d",function(a){var b,c=yb(a);return c?(b=Ke.interpolate(this._current,c),this._current=b(0),function(a){return Bb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",w?"scale(1)":"").style("opacity",1),_h.selectAll("."+Qe.chartArc).select("text").attr("transform",Cb).style("opacity",0).transition().duration(E).text(Fb).style("opacity",function(a){return uc(a.data.id)&&Jd(a.data)?1:0}),_h.select("."+Qe.chartArcsTitle).style("opacity",Bd(Le.data.targets)?1:0),hg&&(null!==Ke.event&&"zoom"===Ke.event.type&&Uh.extent(Bf.orgDomain()).update(),u&&(ai.select("."+Qe.axisX).style("opacity",I?0:1).transition().duration(E).call(Kf),Uh.empty()||Uh.extent(Bf.orgDomain()).update(),B=ge(H,!0),o=ai.selectAll("."+Qe.bars).selectAll("."+Qe.bar).data(Kd),o.enter().append("path").attr("d",B).style("stroke","none").style("fill",function(a){return Fh(a.id)}).attr("class",Lc),o.style("opacity",Tc).transition().duration(E).attr("d",B).style("opacity",1),o.exit().transition().duration(E).style("opacity",0).remove(),ai.selectAll("."+Qe.line).style("opacity",Tc).transition().duration(E).attr("d",Xh).style("opacity",1))),_h.selectAll("."+Qe.selectedCircles).filter(function(a){return Fd(a)}).selectAll("circle").remove(),_h.selectAll("."+Qe.selectedCircle).transition().duration(E).attr("cx",og?qd:pd).attr("cy",og?pd:qd),Sd(Mf)?(p=_h.select("."+Qe.eventRects).selectAll("."+Qe.eventRect).data([0]),oe(p.enter()),p.attr("x",0).attr("y",0).attr("width",df).attr("height",ff)):(Ah&&!zh?(s=function(a,b){var c=nc(b),d=oc(b),e=Le.data.x[a.id][b];return(Bf(d?d:e+50)-Bf(c?c:e-50))/2},r=function(a,b){var c=nc(b),d=Le.data.x[a.id][b];return(Bf(d)+Bf(c?c:d-50))/2}):(s=J(),r=function(a){return Bf(a.x)-s/2}),q=qc(),_h.select("."+Qe.eventRects).datum(q?q.values:[]),p=_h.select("."+Qe.eventRects).selectAll("."+Qe.eventRect).data(function(a){return a}),ne(p.enter()),p.attr("class",Qc).attr("x",og?0:r).attr("y",og?r:0).attr("width",og?df:s).attr("height",og?s:ff),p.exit().remove()),m=_h.select("."+Qe.regions).selectAll("rect."+Qe.region).data(oh),m.enter().append("rect").style("fill-opacity",0),m.attr("class",Pc).attr("x",og?0:$b).attr("y",og?$b:af.top).attr("width",og?df:_b).attr("height",og?_b:ff).transition().duration(E).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),m.exit().transition().duration(E).style("fill-opacity",0).remove(),rc().forEach(function(a){gi[a]=!0})}}function ue(){te({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function ve(){return"mousemove"===Ke.event.sourceEvent.type&&Yh.altDomain?(Bf.domain(Yh.altDomain),void Yh.scale(Bf).updateScaleExtent()):(zh&&Bf.orgDomain()[0]===ei[0]&&Bf.domain([ei[0]-1e-10,Bf.orgDomain()[1]]),te({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===Ke.event.sourceEvent.type&&(Dh=!0)))}function we(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function xe(){Zh.attr("width",hf).attr("height",jf),Zh.select("#"+wh).select("rect").attr("width",df).attr("height",ff),Zh.select("#xaxis-clip").select("rect").attr("width",F),Zh.select("#yaxis-clip").select("rect").attr("width",H),Zh.select("."+Qe.zoomRect).attr("width",df).attr("height",ff)}function ye(a){a=d(a)?a:{},a.withTransition=d(a.withTransition)?a.withTransition:!0,a.withTransform=d(a.withTransform)?a.withTransform:!1,a.withLegend=d(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.durationForExit=0,m(),P(),xe(),l(a.withTransition),te(a)}function ze(a){var b,c,d,e,f,g,h,i,j,k,l,m;h=_h.select("."+Qe.chartTexts).selectAll("."+Qe.chartText).data(a),i=h.enter().append("g").attr("class",function(a){return Qe.chartText+Dc(Qe.target,a.id)}).style("pointer-events","none"),i.append("g").attr("class",Fc).style("fill",function(a){return Fh(a.id)}),e=_h.select("."+Qe.chartBars).selectAll("."+Qe.chartBar).data(a),d=e.enter().append("g").attr("class",function(a){return Qe.chartBar+Dc(Qe.target,a.id)}).style("pointer-events","none"),d.append("g").attr("class",Mc).style("fill",function(a){return Fh(a.id)}).style("stroke","none").style("cursor",function(a){return $f(a)?"pointer":null}),c=_h.select("."+Qe.chartLines).selectAll("."+Qe.chartLine).data(a),b=c.enter().append("g").attr("class",function(a){return Qe.chartLine+Dc(Qe.target,a.id)}).style("pointer-events","none"),b.append("path").attr("class",Ic).style("opacity",0).style("stroke",function(a){return Fh(a.id)}),b.append("path").attr("class",Oc).style("opacity",function(){return fi=+Ke.select(this).style("opacity"),0}).style("fill",function(a){return Fh(a.id)}),b.append("g").attr("class",function(a){return Dc(Qe.selectedCircles,a.id)}),b.append("g").attr("class",Kc).style("fill",function(a){return Fh(a.id)}).style("cursor",function(a){return $f(a)?"pointer":null}),a.forEach(function(a){_h.selectAll("."+Qe.selectedCircles+Rc(a.id)).selectAll("."+Qe.selectedCircle).each(function(b,c){b.value=a.values[c].value})}),g=_h.select("."+Qe.chartArcs).selectAll("."+Qe.chartArc).data(sf(a)),f=g.enter().append("g").attr("class",function(a){return Qe.chartArc+Dc(Qe.target,a.data.id)}),f.append("path").attr("class",Nc).style("opacity",0).style("fill",function(a){return Fh(a.data.id)}).style("cursor",function(a){return $f(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){var c=yb(a),d=Eb(c),e=Mb();Gb(c.data.id),De(c.data.id),e(d,b)}).on("mousemove",function(a){var b=yb(a),c=[Eb(b)];ld(c,Ke.mouse(this))}).on("mouseout",function(a,b){var c=yb(a),d=Eb(c),e=Nb();Hb(c.data.id),Fe(),md(),e(d,b)}).on("click",function(a,b){var c=yb(a),d=Eb(c),e=Lb();e(d,b)}),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),hg&&(m=ai.select("."+Qe.chartBars).selectAll("."+Qe.chartBar).data(a),l=m.enter().append("g").attr("class",function(a){return Qe.chartBar+Dc(Qe.target,a.id)}),l.append("g").attr("class",Mc).style("fill",function(a){return Fh(a.id)}),k=ai.select("."+Qe.chartLines).selectAll("."+Qe.chartLine).data(a),j=k.enter().append("g").attr("class",function(a){return Qe.chartLine+Dc(Qe.target,a.id)}),j.append("path").attr("class",Ic).style("opacity",0).style("stroke",function(a){return Fh(a.id)})),Zh.selectAll("."+Qe.target).filter(function(a){return uc(a.id)}).transition().style("opacity",1)}function Ae(a,b){Le.data.targets.forEach(function(b){for(var c=0;ce&&(e=(k-j)/2,v=0,B++)),A[a]=B,z[B]=e,w[a]=v,v+=j}var e,f,g=a.getBBox(),h=10*Math.ceil((g.width+r)/10),i=10*Math.ceil((g.height+q)/10),j=Nh?i:h,k=Nh?kf:lf;c&&(v=0,B=0,s=0,t=0),x[b]=h,y[b]=i,(!s||h>=s)&&(s=h),(!t||i>=t)&&(t=i),f=Nh?t:s,ng?(Object.keys(x).forEach(function(a){x[a]=s}),Object.keys(y).forEach(function(a){y[a]=t}),e=(k-f*p.length)/2,u>e?(v=0,B=0,p.forEach(function(a){d(a)})):d(b,!0)):d(b)}var f,g,h,i,j,k,n,o,p=rc(a),q=4,r=26,s=0,t=0,u=10,v=0,w={},x={},y={},z={},A={},B=0;b=c(b)?{}:b,o=d(b.withTransition)?b.withTransition:!0,Nh?(g=function(a){return s*(.2+A[a])},j=function(a){return z[A[a]]+w[a]}):(g=function(a){return z[A[a]]+w[a]},j=function(a){return t*(.2+A[a])}),h=function(a,b){return g(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return g(a,b)-4},n=function(a,b){return j(a,b)-7},f=bi.selectAll("."+Qe.legendItem).data(p).enter().append("g").attr("class",function(a){return Dc(Qe.legendItem,a)}).style("cursor","pointer").on("click",function(a){"function"==typeof mg?mg(a):Le.toggle(a)}).on("mouseover",function(a){Le.focus(a)}).on("mouseout",function(){Le.revert()}),f.append("text").text(function(a){return d(Pf[a])?Pf[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",Nh?h:-200).attr("y",Nh?-200:k),f.append("rect").attr("class",Qe.legendItemEvent).style("fill-opacity",0).attr("x",Nh?i:-200).attr("y",Nh?-200:n).attr("width",function(a){return x[a]}).attr("height",function(a){return y[a]}),f.append("rect").attr("class",Qe.legendItemTile).style("pointer-events","none").style("fill",function(a){return Fh(a)}).attr("x",Nh?h:-200).attr("y",Nh?-200:j).attr("width",10).attr("height",10),bi.selectAll("text").data(p).text(function(a){return d(Pf[a])?Pf[a]:a}).each(function(a,b){e(this,a,0===b)}).transition().duration(o?250:0).attr("x",h).attr("y",k),bi.selectAll("rect."+Qe.legendItemEvent).data(p).transition().duration(o?250:0).attr("x",i).attr("y",n),bi.selectAll("rect."+Qe.legendItemTile).data(p).transition().duration(o?250:0).attr("x",g).attr("y",j),L(s),M(t),K(B),m(),P(),xe(),l(!1)}function He(a){return sc(a.id)}function Ie(a){return"data"in a&&sc(a.data.id)}function Je(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}}var Ke=a.d3?a.d3:a.require?a.require("d3"):void 0,Le={data:{}},Me={},Ne="_expanded_",Oe="_selected_",Pe="_included_",Qe={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",area:"c3-area",text:"c3-text",texts:"c3-texts",grid:"c3-grid",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",dragarea:"c3-dragarea"},Re=g(["bindto"],"#chart"),Se=g(["size","width"]),Te=g(["size","height"]),Ue=g(["padding","left"]),Ve=g(["padding","right"]),We=g(["zoom","enabled"],!1),Xe=g(["zoom","extent"]),Ye=g(["zoom","privileged"],!1),Ze=g(["onenter"],function(){}),$e=g(["onleave"],function(){}),_e=g(["transition","duration"],350);f("data","data is required in config");var af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,xf,yf,zf,Af,Bf,Cf,Df,Ef,Ff,Gf,Hf,If,Jf,Kf,Lf=g(["data","x"]),Mf=g(["data","xs"],{}),Nf=g(["data","x_format"],"%Y-%m-%d"),Of=g(["data","id_converter"],function(a){return a}),Pf=g(["data","names"],{}),Qf=g(["data","groups"],[]),Rf=g(["data","axes"],{}),Sf=g(["data","type"]),Tf=g(["data","types"],{}),Uf=g(["data","labels"],{}),Vf=g(["data","order"]),Wf=g(["data","regions"],{}),Xf=g(["data","colors"],{}),Yf=g(["data","selection","enabled"],!1),Zf=g(["data","selection","grouped"],!1),$f=g(["data","selection","isselectable"],function(){return!0}),_f=g(["data","selection","multiple"],!0),ag=g(["data","onclick"],function(){}),bg=g(["data","onenter"],function(){}),cg=g(["data","onleave"],function(){}),dg=g(["data","onselected"],function(){}),eg=g(["data","onunselected"],function(){}),fg=g(["data","ondragstart"],function(){}),gg=g(["data","ondragend"],function(){}),hg=g(["subchart","show"],!1),ig=hg?g(["subchart","size","height"],60):0,jg=g(["color","pattern"],[]),kg=g(["legend","show"],!0),lg=g(["legend","position"],"bottom"),mg=g(["legend","item","onclick"]),ng=g(["legend","equally"],!1),og=g(["axis","rotated"],!1),pg=g(["axis","x","type"],"indexed"),qg=g(["axis","x","categories"],[]),rg=g(["axis","x","tick","centered"],!1),sg=g(["axis","x","tick","format"]),tg=g(["axis","x","tick","culling"],"categorized"===pg?!1:!0),ug=g(["axis","x","tick","count"],10),vg=g(["axis","x","max"]),wg=g(["axis","x","min"]),xg=g(["axis","x","default"]),yg=g(["axis","x","label"],{}),zg=g(["axis","y","show"],!0),Ag=g(["axis","y","max"]),Bg=g(["axis","y","min"]),Cg=g(["axis","y","center"]),Dg=g(["axis","y","label"],{}),Eg=g(["axis","y","inner"],!1),Fg=g(["axis","y","tick","format"]),Gg=g(["axis","y","padding"]),Hg=g(["axis","y","ticks"],10),Ig=g(["axis","y2","show"],!1),Jg=g(["axis","y2","max"]),Kg=g(["axis","y2","min"]),Lg=g(["axis","y2","center"]),Mg=g(["axis","y2","label"]),Ng=g(["axis","y2","inner"],!1),Og=g(["axis","y2","tick","format"]),Pg=g(["axis","y2","padding"]),Qg=g(["axis","y2","ticks"],10),Rg=g(["grid","x","show"],!1),Sg=g(["grid","x","type"],"tick"),Tg=g(["grid","x","lines"],[]),Ug=g(["grid","y","show"],!1),Vg=g(["grid","y","lines"],[]),Wg=g(["grid","y","ticks"],10),Xg=g(["point","show"],!0),Yg=Xg?g(["point","r"],2.5):0,Zg=g(["point","focus","line","enabled"],!0),$g=g(["point","focus","expand","enabled"],!0),_g=g(["point","focus","expand","r"],$g?4:Yg),ah=g(["point","focus","select","r"],8),bh=g(["bar","width"]),ch=g(["bar","width","ratio"],.6),dh=g(["pie","label","show"],!0),eh=g(["pie","label","format"]),fh=g(["pie","onclick"],function(){}),gh=g(["pie","onmouseover"],function(){}),hh=g(["pie","onmouseout"],function(){}),ih=g(["donut","label","show"],!0),jh=g(["donut","label","format"]),kh=g(["donut","title"],""),lh=g(["donut","onclick"],function(){}),mh=g(["donut","onmouseover"],function(){}),nh=g(["donut","onmouseout"],function(){}),oh=g(["regions"],[]),ph=g(["tooltip","show"],!0),qh=g(["tooltip","format","title"]),rh=g(["tooltip","format","value"]),sh=g(["tooltip","contents"],function(a,b,c,d){var e,f,g,h,i,j=qh?qh:b,k=rh?rh:c;for(f=0;f"+(g||0===g?""+g+"":"")),i=a[f].name,h=k(a[f].value,a[f].ratio),e+="",e+=""+i+"",e+=""+h+"",e+="");return e+""}),th=g(["tooltip","init","show"],!1),uh=g(["tooltip","init","x"],0),vh=g(["tooltip","init","position"],{top:"0px",left:"50px"}),wh=("string"==typeof Re?Re.replace("#",""):Re.id)+"-clip",xh=h(wh),yh="timeseries"===pg,zh="categorized"===pg,Ah=!yh&&(Lf||Sd(Mf)),Bh=null,Ch=!1,Dh=!1,Eh=!1,Fh=Nd(Xf,jg),Gh=function(){var a=[[Ke.time.format("%Y/%-m/%-d"),function(){return!0}],[Ke.time.format("%-m/%-d"),function(a){return a.getMonth()}],[Ke.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[Ke.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[Ke.time.format("%I %p"),function(a){return a.getHours()}],[Ke.time.format("%I:%M"),function(a){return a.getMinutes()}],[Ke.time.format(":%S"),function(a){return a.getSeconds()}],[Ke.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),Hh=[],Ih=og?"left":"bottom",Jh=og?Eg?"top":"bottom":Eg?"right":"left",Kh=og?Ng?"bottom":"top":Ng?"left":"right",Lh=og?"left":"bottom",Mh={main:function(){return"translate("+af.left+","+af.top+")"},context:function(){return"translate("+bf.left+","+bf.top+")"},legend:function(){return"translate("+cf.left+","+cf.top+")"},x:function(){return"translate(0,"+(og?0:ff)+")"},y:function(){return"translate(0,"+(og?ff:0)+")"},y2:function(){return"translate("+(og?0:df)+","+(og?1:0)+")"},subx:function(){return"translate(0,"+(og?0:gf)+")"},arc:function(){return"translate("+df/2+","+ff/2+")"}},Nh="right"===lg,Oh=0,Ph=0,Qh=0,Rh=30,Sh=30,Th=5;sf=Ke.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var Uh,Vh=function(){var a=Ke.svg.line().x(og?function(a){return T(a.id)(a.value)}:Zc).y(og?Zc:function(a){return T(a.id)(a.value)});return function(b){var c,d,e=_d(b.values);return Dd(b)?(a.interpolate(Ed(b)?"cardinal":"linear"),Wf[b.id]?le(e,Bf,T(b.id),Wf[b.id]):a(e)):(c=Bf(e[0].x),d=T(b.id)(e[0].value),og?"M "+d+" "+c:"M "+c+" "+d)}}(),Wh=function(){var a;return a=og?Ke.svg.area().x0(function(a){return T(a.id)(0)}).x1(function(a){return T(a.id)(a.value)}).y(Zc):Ke.svg.area().x(Zc).y0(function(a){return T(a.id)(0)}).y1(function(a){return T(a.id)(a.value)}),function(b){var c,d,e=_d(b.values);return xd([b],"area")||xd([b],"area-spline")?(a.interpolate(Ed(b)?"cardinal":"linear"),a(e)):(c=Bf(e[0].x),d=T(b.id)(e[0].value),og?"M "+d+" "+c:"M "+c+" "+d)}}(),Xh=function(){var a=Ke.svg.line().x(og?function(a){return U(a.id)(a.value)}:ad).y(og?ad:function(a){return U(a.id)(a.value)});return function(b){var c=_d(b.values);return Dd(b)?a(c):"M "+Ef(c[0].x)+" "+U(b.id)(c[0].value)}}(),Yh=function(){};Uh=Ke.svg.brush().on("brush",ue),Uh.update=function(){return ai&&ai.select("."+Qe.brush).call(this),this},Uh.scale=function(a){return og?this.y(a):this.x(a)},We&&(Yh=Ke.behavior.zoom().on("zoomstart",function(){Yh.altDomain=Ke.event.sourceEvent.altKey?Bf.orgDomain():null}).on("zoom",We?ve:null),Yh.scale=function(a){return og?this.y(a):this.x(a)},Yh.orgScaleExtent=function(){var a=Xe?Xe:[1,10];return[a[0],Math.max(pc()/a[1],a[1])]},Yh.updateScaleExtent=function(){var a=Wb(Bf.orgDomain())/Wb(ei),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Zh,$h,_h,ai,bi,ci,di,ei,fi,gi={};if(Le.focus=function(a){function b(a){vc(a).transition().duration(100).style("opacity",1)}var c=Zh.selectAll(Sc(a)),d=c.filter(He),e=c.filter(Ie);Le.revert(),Le.defocus(),b(d.classed(Qe.focused,!0)),b(e),Cd(Le.data.targets)&&Gb(a,!0),De(a)},Le.defocus=function(a){function b(a){vc(a).transition().duration(100).style("opacity",.3)}var c=Zh.selectAll(Sc(a)),d=c.filter(He),e=c.filter(Ie);Le.revert(),b(d.classed(Qe.focused,!1)),b(e),Cd(Le.data.targets)&&Hb(a),Ee(a)},Le.revert=function(a){function b(a){vc(a).transition().duration(100).style("opacity",1)}var c=Zh.selectAll(Sc(a)),d=c.filter(He),e=c.filter(Ie);b(d.classed(Qe.focused,!1)),b(e),Cd(Le.data.targets)&&Hb(a),Fe()},Le.show=function(a){xc(a),Zh.selectAll(Sc(a)).transition().style("opacity",1),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!1})},Le.hide=function(a){wc(a),Zh.selectAll(Sc(a)).transition().style("opacity",0),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!1})},Le.toggle=function(a){uc(a)?Le.hide(a):Le.show(a)},Le.unzoom=function(){Uh.clear().update(),te({withUpdateXDomain:!0})},Le.load=function(a){if("function"!=typeof a.done&&(a.done=function(){}),a.xs&&ec(a.xs),"categories"in a&&zh&&(qg=a.categories,Hf.categories(qg)),"cacheIds"in a&&Xb(a.cacheIds))return void Ae(Zb(a.cacheIds),a.done);if("data"in a)Ae(lc(a.data),a.done);else if("url"in a)Ke.csv(a.url,function(b,c){Ae(lc(c),a.done)});else if("rows"in a)Ae(lc(jc(a.rows)),a.done);else{if(!("columns"in a))throw Error("url or rows or columns is required.");Ae(lc(kc(a.columns)),a.done)}},Le.unload=function(a){Be("string"==typeof a?[a]:a),Le.data.targets.length>0&&te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Le.selected=function(a){return Ke.merge(_h.selectAll("."+Qe.shapes+Rc(a)).selectAll("."+Qe.shape).filter(function(){return Ke.select(this).classed(Oe)}).map(function(a){return a.map(function(a){return a.__data__})}))},Le.select=function(a,b,c){Yf&&_h.selectAll("."+Qe.shapes).selectAll("."+Qe.shape).each(function(e,f){var g=Ke.select(this),h="circle"===this.nodeName?Vd:Yd,i="circle"===this.nodeName?Wd:Zd,j=Zf||!a||a.indexOf(e.id)>=0,k=!b||b.indexOf(f)>=0,l=g.classed(Oe);j&&k?$f(e)&&!l&&h(g.classed(Oe,!0),e,f):d(c)&&c&&l&&i(g.classed(Oe,!1),e,f)})},Le.unselect=function(a,b){Yf&&_h.selectAll("."+Qe.shapes).selectAll("."+Qe.shape).each(function(c,d){var e=Ke.select(this),f="circle"===this.nodeName?Wd:Zd,g=Zf||!a||a.indexOf(c.id)>=0,h=!b||b.indexOf(d)>=0,i=e.classed(Oe);g&&h&&$f(c)&&i&&f(e.classed(Oe,!1),c,d)})},Le.toLine=function(a){wd(a,"line"),ye()},Le.toSpline=function(a){wd(a,"spline"),ye()},Le.toBar=function(a){wd(a,"bar"),ye()},Le.toScatter=function(a){wd(a,"scatter"),ye()},Le.toArea=function(a){wd(a,"area"),ye()},Le.toAreaSpline=function(a){wd(a,"area-spline"),ye()},Le.toPie=function(a){wd(a,"pie"),ye({withTransform:!0})},Le.toDonut=function(a){wd(a,"donut"),ye({withTransform:!0})},Le.groups=function(a){return c(a)?Qf:(Qf=a,te(),Qf)},Le.xgrids=function(a){return a?(Tg=a,te(),Tg):Tg},Le.xgrids.add=function(a){return a?Le.xgrids(Tg.concat(a)):void 0},Le.xgrids.remove=function(a){var b=Je(a);return Le.xgrids(Tg.filter(b))},Le.ygrids=function(a){return a?(Vg=a,te(),Vg):Vg},Le.ygrids.add=function(a){return a?Le.ygrids(Vg.concat(a)):void 0},Le.ygrids.remove=function(a){var b=Je(a);return Le.ygrids(Vg.filter(b))},Le.regions=function(a){return c(a)?oh:(oh=a,te(),oh)},Le.regions.add=function(a){return c(a)?oh:(oh=oh.concat(a),te(),oh)},Le.regions.remove=function(a,c){var e=[].concat(a);return c=d(c)?c:{},e.forEach(function(a){var d=b(c.duration)?c.duration:0;Zh.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),oh=oh.filter(function(b){return b.classes.indexOf(a)<0})}),oh},Le.data.get=function(a){var b=Le.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},Le.data.getAsTarget=function(a){var b=tc(function(b){return b.id===a});return b.length>0?b[0]:void 0},Le.data.names=function(a){return arguments.length?(Pf=a,Ge(Le.data.targets,{withTransition:!0}),Pf):Pf},Le.x=function(a){return arguments.length&&(gc(Le.data.targets,a),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Le.data.x},Le.xs=function(a){return arguments.length&&(hc(Le.data.targets,a),te({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Le.data.x},Le.resize=function(a){Se=a?a.width:null,Te=a?a.height:null,ye({withLegend:!0,withTransition:!1})},Le.destroy=function(){Le.data.targets=void 0,Le.data.x={},di.html(""),a.onresize=null},"url"in e.data)Ke.csv(e.data.url,function(a,b){me(b)});else if("rows"in e.data)me(jc(e.data.rows));else{if(!("columns"in e.data))throw Error("url or rows or columns is required.");me(kc(e.data.columns))}return Le},"function"==typeof a.define&&a.define.amd?a.define(e):a.c3=e}(window); \ No newline at end of file