diff --git a/c3.js b/c3.js index 023d0a9..5967ed1 100644 --- a/c3.js +++ b/c3.js @@ -2140,6 +2140,7 @@ toggleBar(selected, target, d.data, i); } function getToggle(that) { + // path selection not supported yet return that.nodeName === 'circle' ? togglePoint : (d3.select(that).classed(CLASS.bar) ? toggleBar : toggleArc); } @@ -4218,6 +4219,7 @@ isTargetId = __data_selection_grouped || !ids || ids.indexOf(id) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0, isSelected = shape.classed(CLASS.SELECTED); + if (this.nodeName === 'path') { return; } // path selection not supported yet if (isTargetId && isTargetIndex) { if (__data_selection_isselectable(d) && !isSelected) { toggle(true, shape.classed(CLASS.SELECTED, true), d, i); @@ -4237,6 +4239,7 @@ isTargetId = __data_selection_grouped || !ids || ids.indexOf(id) >= 0, isTargetIndex = !indices || indices.indexOf(i) >= 0, isSelected = shape.classed(CLASS.SELECTED); + if (this.nodeName === 'path') { return; } // path selection not supported yet if (isTargetId && isTargetIndex) { if (__data_selection_isselectable(d)) { if (isSelected) { diff --git a/c3.min.js b/c3.min.js index 8a62a89..27dc876 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){var c=b&&aag&&(ag=0),0>cg&&(cg=0),bg=nh?Zf.left-ij-jj:ag,dg=nh?cg:fg-$f.top-$f.bottom,0>bg&&(bg=0),0>dg&&(dg=0),r(),dj&&je(If.data.targets)&&(_f.left=ag/2+hg)}function q(){sj.select("line."+g.xgridFocus).attr("x1",nh?0:-10).attr("x2",nh?ag:-10).attr("y1",nh?-10:Zf.top).attr("y2",nh?-10:cg)}function r(){hg=cg/2,gg=.95*hg,ig=ie(If.data.targets)?.6*gg:0}function s(){var a=nh?g.axisX:g.axisY,b=sj.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Hf.select(Kf).node().getBoundingClientRect(),e=c.right-d.left-v();return e>0?e:0}function t(){return Lf?Lf:z()}function u(){var a=Mf?Mf:A();return a>0?a:320}function v(){return je(If.data.targets)?0:Nf?Nf:nh?oh?x("x"):1:!Gh||Lh?1:x("y")}function w(){var a=1;return je(If.data.targets)?0:Of?Of:dj?R()+20+(Ph&&!nh?x("y2"):a):Ph?Uh||nh?a:x("y2"):a}function x(a){var b=lb(a);return b.isInner?20+Eb(a):40+Eb(a)}function y(a){return"x"!==a||oh?"x"===a&&Dh?Dh:"y"!==a||Gh?"y2"!==a||Ph?(lb(a).isInner?30:40)+("y2"===a?-10:0):kj:hh&&!dj?10:1:0}function z(){return+Hf.select(Kf).style("width").replace("px","")}function A(){return+Hf.select(Kf).style("height").replace("px","")}function B(a){return a?-5:-(Zf.left-1)}function C(a){return a?-20:-4}function D(){return B(!nh)}function E(){return C(!nh)}function F(){return B(nh)}function G(){return C(nh)}function H(a){return a?ag+2+4:Zf.left+20}function I(a){return a?(Dh?Dh:0)+80:cg+8}function J(){return H(!nh)}function K(){return I(!nh)}function L(){return H(nh)}function M(){return I(nh)}function N(){var a,b,c,d,e,f=Bc(If.data.targets);return f?(a=f.values[0],b=f.values[f.values.length-1],c=vg(b.x)-vg(a.x),0===c?nh?cg:ag:(d=Ac(),e=fe(If.data.targets)?(d-(Ni?.25:1))/d:1,d>1?c*e/(d-1):c)):0}function O(a){ej=a}function P(a){fj=a}function Q(a){gj=a}function R(){return hh?dj?fj*(ej+1):eg:0}function S(){return hh?dj?fg:gj*(ej+1):0}function T(){var a,b,c=!vg;ng=nh?1:0,og=nh?cg:ag,pg=nh?0:cg,qg=nh?ag:1,rg=ng,sg=og,tg=nh?0:dg,ug=nh?bg:1,vg=V(ng,og,c?void 0:vg.domain(),function(){return Bg.tickOffset()}),wg=W(pg,qg,c?void 0:wg.domain()),xg=W(pg,qg,c?void 0:xg.domain()),yg=V(ng,og,xj,function(a){return a%1?0:Eg.tickOffset()}),zg=W(tg,ug,c?void 0:zg.domain()),Ag=W(tg,ug,c?void 0:Ag.domain()),a=ab(),b=yh?yh:c?void 0:Bg.tickValues(),Bg=Z(vg,$i,a,b),Eg=Z(yg,bj,a,b),Cg=$(wg,_i,Mh,Oh),Dg=$(xg,aj,Vh,Xh),c||(lj.scale(yg),Rf&&pj.scale(vg)),U()}function U(){jg=Hb(),kg=Ib(),lg=Ib(.98)}function V(a,b,c,d){var e,f=(Mi?Hf.time.scale():Hf.scale.linear()).range([a,b]),g=c?f.domain(c):f;Ni?(d=d||function(){return 0},f=function(a){return Math.ceil(g(a)+d(a))}):f=function(a){return Math.ceil(g(a))};for(e in g)f[e]=g[e];return f.orgDomain=function(){var a=g.domain();return xj&&xj[0]===a[0]&&xj[1]a?a.toFixed(0):a};return th&&("function"==typeof th?a=th:Mi&&(a=function(a){return a?Wi(th)(a):""})),a}function bb(a){var b;return"y"===a?b=Kh:"y2"===a?b=Th:"x"===a&&(b=Fh),b}function cb(a){var b=bb(a);return"string"==typeof b?b:b?b.text:null}function db(a,b){var c=bb(a);"string"==typeof c?"y"===a?Kh=b:"y2"===a?Th=b:"x"===a&&(Fh=b):c&&(c.text=b)}function eb(a){return 10*Math.sin(Math.PI*(a/180))}function fb(a){return 11.5-2.5*(a/15)}function gb(a,b,c){a.selectAll(".tick text").style("text-anchor","start"),b.selectAll(".tick text").attr("y",fb(c)).attr("x",eb(c)).attr("transform","rotate("+c+")")}function hb(a,b){var c=bb(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 ib(){return hb("x",nh?"inner-top":"inner-right")}function jb(){return hb("y",nh?"inner-right":"inner-top")}function kb(){return hb("y2",nh?"inner-right":"inner-top")}function lb(a){return"y2"===a?kb():"y"===a?jb():ib()}function mb(){return cb("x")}function nb(){return cb("y")}function ob(){return cb("y2")}function pb(a,b){return a?b.isLeft?0:b.isCenter?ag/2:ag:b.isBottom?-cg:b.isMiddle?-cg/2:0}function qb(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function rb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function sb(){return pb(!nh,ib())}function tb(){return pb(nh,jb())}function ub(){return pb(nh,kb())}function vb(){return qb(!nh,ib())}function wb(){return qb(nh,jb())}function xb(){return qb(nh,kb())}function yb(){var a=ib();return nh?a.isInner?"1.2em":-25-Eb("x"):a.isInner?"-0.5em":Dh?Dh-10:"3em"}function zb(){var a=jb();return nh?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-Eb("y")}function Ab(){var a=kb();return nh?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+Eb("y2")}function Bb(){return rb(!nh,ib())}function Cb(){return rb(nh,jb())}function Db(){return rb(nh,kb())}function Eb(a){var b=0,c="x"===a?g.axisX:"y"===a?g.axisY:g.axisY2;return Hf.selectAll("."+c+" .tick text").each(function(){var a=this.getBoundingClientRect();bb?0:b}function Fb(a){var b=sj.select("."+g.axisX+" ."+g.axisXLabel),c=sj.select("."+g.axisY+" ."+g.axisYLabel),d=sj.select("."+g.axisY2+" ."+g.axisY2Label);(a?b.transition():b).attr("x",sb).attr("dx",vb).attr("dy",yb).text(mb),(a?c.transition():c).attr("x",tb).attr("dx",wb).attr("dy",zb).attr("dy",zb).text(nb),(a?d.transition():d).attr("x",ub).attr("dx",xb).attr("dy",Ab).text(ob)}function Gb(a){var b=!1;return mg(Jc(If.data.targets)).forEach(function(c){return b||c.data.id!==a.data.id?void 0:(b=!0,void(a=c))}),b?a:null}function Hb(){var a=Hf.svg.arc().outerRadius(gg).innerRadius(ig),b=function(b,c){var d;return c?a(b):(d=Gb(b),d?a(d):"M 0 0")};return b.centroid=a.centroid,b}function Ib(a){var b=Hf.svg.arc().outerRadius(hg*(a?a:1)).innerRadius(ig);return function(a){var c=Gb(a);return c?b(c):"M 0 0"}}function Jb(a,b){return qe(a.data)?jg(a,b):"M 0 0"}function Kb(a){var b,c,d,e,f=Gb(a),g="";return f&&(b=jg.centroid(f),c=b[0],d=b[1],e=Math.sqrt(c*c+d*d),g="translate("+c/e*gg*.8+","+d/e*gg*.8+")"),g}function Lb(a){return a?(a.endAngle-a.startAngle)/(2*Math.PI):null}function Mb(a){return qc({id:a.data.id,value:a.value,ratio:Lb(a)})}function Nb(a){var b,c,d,e;return Qb()?(b=Gb(a),c=b?b.value:null,d=Lb(b),e=Rb(),e?e(c,d):Ed(c,d)):""}function Ob(a,b){var c=qj.selectAll("."+g.chartArc+qd(a)),d=qj.selectAll("."+g.arc).filter(function(b){return b.data.id!==a});we(a)&&c.selectAll("path").transition().duration(50).attr("d",kg).transition().duration(100).attr("d",lg).each(function(a){pe(a.data)}),b||d.style("opacity",.3)}function Pb(a){var b=qj.selectAll("."+g.chartArc+qd(a));b.selectAll("path").transition().duration(50).attr("d",jg),qj.selectAll("."+g.arc).style("opacity",1)}function Qb(){return ie(If.data.targets)?ri:li}function Rb(){return ie(If.data.targets)?si:mi}function Sb(){return ie(If.data.targets)?ui:""}function Tb(){var a=ie(If.data.targets)?vi:oi;return"function"==typeof a?a:function(){}}function Ub(){var a=ie(If.data.targets)?wi:pi;return"function"==typeof a?a:function(){}}function Vb(){var a=ie(If.data.targets)?xi:qi;return"function"==typeof a?a:function(){}}function Wb(a){var b,c,d,e,f,g,h=Dc(a),i=Qc(a);if(Lg.length>0)for(g=Sc(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 Hf.min(Object.keys(i).map(function(a){return Hf.min(i[a])}))}function Xb(a){var b,c,d,e,f,g,h=Dc(a),i=Qc(a);if(Lg.length>0)for(g=Tc(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 Hf.max(Object.keys(i).map(function(a){return Hf.max(i[a])}))}function Yb(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return _(a.id)===c}),m="y2"===c?Rh:Ih,n="y2"===c?Qh:Hh,o=b(m)?m:Wb(l),p=b(n)?n:Xb(l),q="y2"===c?Sh:Jh,r=yd()&&nh;return 0===l.length?"y2"===c?xg.domain():wg.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=zd(o,p),j=bc(wg.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&&Nh&&(f=b(Nh.top)?Nh.top:e,g=b(Nh.bottom)?Nh.bottom:e),"y2"===c&&Wh&&(f=b(Wh.top)?Wh.top:e,g=b(Wh.bottom)?Wh.bottom:e),fe(l)&&!Sc(l)&&(g=o),[o-g,p+f])}function Zb(a){return Bh?Mi?ye(Bh):Bh:Hf.min(a,function(a){return Hf.min(a.values,function(a){return a.x})})}function $b(a){return Ah?Mi?ye(Ah):Ah:Hf.max(a,function(a){return Hf.max(a.values,function(a){return a.x})})}function _b(a){var c,d,e,f,g=Cc(a),h=g[1]-g[0];return Ni?d=0:fe(a)?(c=Ac(),d=c>1?h/(c-1)/2:.5):d=.01*h,"object"==typeof Ch&&De(Ch)?(e=b(Ch.left)?Ch.left:d,f=b(Ch.right)?Ch.right:d):e=f="number"==typeof Ch?Ch:d,{left:e,right:f}}function ac(a){var b=[Zb(a),$b(a)],c=b[0],d=b[1],e=_b(a),f=0,g=0;return c-d!==0||Ni||(c=Mi?new Date(.5*c.getTime()):-.5,d=Mi?new Date(1.5*d.getTime()):.5),(c||0===c)&&(f=Mi?new Date(c.getTime()-e.left):c-e.left),(d||0===d)&&(g=Mi?new Date(d.getTime()+e.right):d+e.right),[f,g]}function bc(a){return a[1]-a[0]}function cc(a){for(var b=0;bb?0:b-c}function ic(a){var b,c=gc(a),d="y"===a.axis?wg:xg;return b="y"===a.axis||"y2"===a.axis?nh?cg:"start"in a?d(a.start):cg:nh?"end"in a?vg(Mi?ye(a.end):a.end):cg:cg,c>b?0:b-c}function jc(a){return Fg&&a===Fg||De(Gg)&&Ee(Gg,a)}function kc(a){return!jc(a)}function lc(a){return Fg?Fg:De(Gg)?Gg[a]:null}function mc(a,b){var c,d=b&&De(b)?Dc(b):[];return d.forEach(function(b){lc(b)===a&&(c=If.data.xs[b])}),c}function nc(a,b){return a in If.data.xs&&If.data.xs[a]&&If.data.xs[a][b]?If.data.xs[a][b]:b}function oc(a){Object.keys(a).forEach(function(b){Gg[b]=a[b]})}function pc(a){return 1===Hf.set(Object.keys(a).map(function(b){return a[b]})).size()}function qc(a){var b;return a&&(b=Jg[a.id],a.name=b?b:a.id),a}function rc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=tc(b[d],a.id,d)}),If.data.xs[a.id]=b})}function sc(a,b){a.forEach(function(a){b[a.id]&&rc([a],b[a.id])})}function tc(a,c,d){var e;return e=Mi?a?a instanceof Date?a:ye(a):ye(nc(c,d)):Oi&&!Ni?b(a)?+a:nc(c,d):d}function uc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?If.data.xs[c]=a.map(function(a){return a[f]}).filter(b):Fg?(d=Object.keys(If.data.xs),If.data.xs[c]=d.length>0?If.data.xs[d[0]]:void 0):De(Gg)&&(If.data.xs[c]=mc(f,If.data.targets)):If.data.xs[c]=a.map(function(a,b){return b})}),d.forEach(function(a){if(!If.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=d.map(function(b,c){var d=Ig(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=lc(b),g=a[f],h=tc(g,b,e);return Oi&&Ni&&0===c&&g&&(0===e&&(rh=[]),rh.push(g)),("undefined"==typeof a[b]||If.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})}}),c.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++})}),Ng&&de(Dc(c).filter(function(a){return!(a in Og)}),Ng),c.forEach(function(a){dc(a.id_org,a)}),c}function xc(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 yc(a){return a>0&&If.data.targets[0].values[a-1]?If.data.targets[0].values[a-1].x:void 0}function zc(a){return a1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b}function Cc(a){var b,c,d=Bc(a);return d?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]}function Dc(a){return a.map(function(a){return a.id})}function Ec(a){return a?"string"==typeof a?[a]:a:Dc(If.data.targets)}function Fc(a,b){var c,d=Dc(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(Mi?new Date(i):i);j.push(e)}return Mi||(j=j.sort(function(a,b){return a-b})),j}function Mc(a){Yi=Yi.concat(a)}function Nc(a){Yi=Yi.filter(function(b){return a.indexOf(b)<0})}function Oc(a){Zi=Zi.concat(a)}function Pc(a){Zi=Zi.filter(function(b){return a.indexOf(b)<0})}function Qc(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b}function Rc(a,b){var c,d,e,f=Object.keys(a);for(c=0;ca})}function Tc(a){return Rc(a,function(a){return a>0})}function Uc(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(Kd(a,f))),(a[g].x||0===a[g].x)&&(e=e.concat(Kd(a,g))),Nd(e,b)):Ld(a,b,f,g)}function Md(a,b){var c;return c=a.map(function(a){return Ld(a.values,b)}),Nd(c,b)}function Nd(a,b){var c,d;return a.forEach(function(a){var e=Fe(a,b);(c>e||!c)&&(c=e,d=a)}),d}function Od(a,b){return Hf.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})}function Pd(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 Qd(){return Qg&&"desc"===Qg.toLowerCase()}function Rd(){return Qg&&"asc"===Qg.toLowerCase()}function Sd(a){var b=Rd(),c=Qd();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 Qg&&a.sort(Qg),a}function Td(a,c){var d,e,f,g,h,i,j,k=je(If.data.targets),l=a.filter(function(a){return a&&b(a.value)});0!==l.length&&zi&&(vj.html(Ci(a,ab(),Ad(k),Vi)).style("display","block"),d=vj.property("offsetWidth"),e=vj.property("offsetHeight"),k?(g=ag/2+c[0],i=cg/2+c[1]+20):(nh?(f=s(),g=f+c[0]+100,h=g+d,j=t()-w(),i=vg(l[0].x)+20):(f=s(),g=f+v()+vg(l[0].x)+20,h=g+d,j=f+t()-w(),i=c[1]+15),h>j&&(g-=d+60),i+e>u()&&(i-=e+30)),vj.style("top",i+"px").style("left",g+"px"))}function Ud(){vj.style("display","none")}function Vd(a){var c=a.filter(function(a){return a&&b(a.value)});if(zi&&!ge(If.data.targets)&&!je(If.data.targets)){var d=sj.selectAll("line."+g.xgridFocus);d.style("visibility","visible").data([c[0]]).attr(nh?"y1":"x1",Gd).attr(nh?"y2":"x2",Gd),lf(d,"grid")}}function Wd(){sj.select("line."+g.xgridFocus).style("visibility","hidden")}function Xd(a,b){var c,d,e,f,h=[],i=sj.select("."+g.axisX).selectAll(".tick").size();if("year"===a)for(c=ac(),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);return h.slice(0,i)}function Yd(a){return a.x||0===a.x?vg(a.x):null}function Zd(a){return X(a.id)(a.value)}function $d(){var a,b,d={},e=0;return Jc(Gc(me)).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function ce(a,b){return"number"==typeof ji?ji:b?2*a.tickOffset()*ki/b:0}function de(a,b){Ec(a).forEach(function(a){zj[a]=b===Og[a],Og[a]=b})}function ee(a,b){var c=!1;return a.forEach(function(a){Og[a.id]===b&&(c=!0),a.id in Og||"line"!==b||(c=!0)}),c}function fe(a){return ee(a,"bar")}function ge(a){return ee(a,"scatter")}function he(a){return ee(a,"pie")}function ie(a){return ee(a,"donut")}function je(a){return he(a)||ie(a)}function ke(a){var b="string"==typeof a?a:a.id;return!(b in Og)||"line"===Og[b]||"spline"===Og[b]||"area"===Og[b]||"area-spline"===Og[b]}function le(a){var b="string"==typeof a?a:a.id;return"spline"===Og[b]||"area-spline"===Og[b]}function me(a){var b="string"==typeof a?a:a.id;return"bar"===Og[b]}function ne(a){var b="string"==typeof a?a:a.id;return"scatter"===Og[b]}function oe(a){var b="string"==typeof a?a:a.id;return"pie"===Og[b]}function pe(a){var b="string"==typeof a?a:a.id;return"donut"===Og[b]}function qe(a){return oe(a)||pe(a)}function re(a){return ke(a)?[a]:[]}function se(a){return qe(a.data)?[a]:[]}function te(a){return me(a)?a.values:[]}function ue(a){return ke(a)||ne(a)?a.values:[]}function ve(a){return me(a)||ke(a)?a.values:[]}function we(a){return pe(a)&&ti||oe(a)&&ni}function xe(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 ye(b){var c;try{c=Hg?Hf.time.format(Hg).parse(b):new Date(b)}catch(d){a.console.error("Failed to parse x '"+b+"' to Date with format "+Hg)}return c}function ze(a,b){var c=Hf.mouse(a),d=Hf.select(a),e=1*d.attr("cx"),f=1*d.attr("cy");return Math.sqrt(Math.pow(e-c[0],2)+Math.pow(f-c[1],2))0}function Ee(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function Fe(a,b){var c="y"===_(a.id)?wg:xg,d=nh?1:0,e=nh?0:1;return Math.pow(vg(a.x)-b[d],2)+Math.pow(c(a.value)-b[e],2)}function Ge(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})}function He(a,b,c){ah(b,a.node()),sj.select("."+g.selectedCircles+pd(b.id)).selectAll("."+g.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return Vc(g.selectedCircle,c)}).attr("cx",nh?Zd:Yd).attr("cy",nh?Yd:Zd).attr("stroke",function(){return Vi(b)}).attr("r",1.4*Se(b)).transition().duration(100).attr("r",Se)}function Ie(a,b,c){bh(b,a.node()),sj.select("."+g.selectedCircles+pd(b.id)).selectAll("."+g.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function Je(a,b,c,d){a?He(b,c,d):Ie(b,c,d)}function Ke(a,b){ah(b,a.node()),a.transition().duration(100).style("fill",function(){return Hf.rgb(Vi(b)).brighter(.75)})}function Le(a,b){bh(b,a.node()),a.transition().duration(100).style("fill",function(){return Vi(b)})}function Me(a,b,c,d){a?Ke(b,c,d):Le(b,c,d)}function Ne(a,b,c,d){Me(a,b,c.data,d)}function Oe(a){return"circle"===a.nodeName?Je:Hf.select(a).classed(g.bar)?Me:Ne}function Pe(a){return a.filter(function(a){return b(a.value)})}function Qe(a){return ci?"function"==typeof di?di(a):di:0}function Re(a){return fi?gi?gi:1.75*Qe(a):Qe(a)}function Se(a){return hi?hi:4*Qe(a)}function Te(a,c){return(c?sj.selectAll("."+g.circles+pd(c)):sj).selectAll("."+g.circle+(b(a)?"-"+a:""))}function Ue(a,b){Te(a,b).classed(g.EXPANDED,!0).attr("r",Re)}function Ve(a){Te(a).filter(function(){return Hf.select(this).classed(g.EXPANDED)}).classed(g.EXPANDED,!1).attr("r",Qe)}function We(a){return sj.selectAll("."+g.bar+(b(a)?"-"+a:""))}function Xe(a){We(a).classed(g.EXPANDED,!0)}function Ye(a){We(a).classed(g.EXPANDED,!1)}function Ze(a,b){var c=bf(a,b);return function(a,b){var d=c(a,b),e=nh?1:0,f=nh?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 $e(a,b){var c=bf(a,!1),d=b?_e:af;return function(a,b){return d(c(a,b),a,this)}}function _e(a,b){var c;return nh?(c=me(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}function af(a,b,c){var d=c.getBoundingClientRect();return nh?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:me(b)?-3:-6)}function bf(a,b){var c=a.__max__+1,d=ce(Bg,c),e=_d(d,c,a,!!b),f=ae(!!b),g=be(a,!!b),h=b?Y:X;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return nh&&(0k||a.value<0&&k>c)&&(k=c),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function cf(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 df(b){var c,d,e;if(wj=Hf.select(Kf),wj.empty())throw new Error('Bind element not found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(wj.html("").classed("c3",!0),If.data.xs={},If.data.targets=wc(b),Ug&&Mc(Ug===!0?Dc(If.data.targets):Ug),p(),T(),vg.domain(Hf.extent(ac(If.data.targets))),wg.domain(Yb(If.data.targets,"y")),xg.domain(Yb(If.data.targets,"y2")),yg.domain(vg.domain()),zg.domain(wg.domain()),Ag.domain(xg.domain()),xj=vg.domain(),lj.scale(yg),Rf&&pj.scale(vg),qj=wj.append("svg").on("mouseenter",Uf).on("mouseleave",Vf),rj=qj.append("defs"),rj.append("clipPath").attr("id",Gi).append("rect"),rj.append("clipPath").attr("id",Hi).append("rect"),rj.append("clipPath").attr("id",Ii).append("rect"),qf(),sj=qj.append("g").attr("transform",cj.main),tj=qj.append("g").attr("transform",cj.context),uj=qj.append("g").attr("transform",cj.legend),eh||tj.style("visibility","hidden"),hh||(uj.style("visibility","hidden"),Zi=Dc(If.data.targets)),vj=Hf.select(Kf).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),Cf(Dc(If.data.targets),{withTransform:!1,withTransitionForTransform:!1}),d=sj.append("g").attr("clip-path",Ji).attr("class",g.grid),Yh&&d.append("g").attr("class",g.xgrids),De($h)&&d.append("g").attr("class",g.xgridLines),ei&&d.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),_h&&d.append("g").attr("class",g.ygrids),De(ai)&&d.append("g").attr("class",g.ygridLines),sj.append("g").attr("clip-path",Ji).attr("class",g.regions),sj.append("g").attr("clip-path",Ji).attr("class",g.chart),c=sj.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0).style("cursor",Rf?nh?"ns-resize":"ew-resize":null),sj.select("."+g.chart).append("g").attr("class",g.chartBars),sj.select("."+g.chart).append("g").attr("class",g.chartLines),sj.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",cj.arc).append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Sb()),sj.select("."+g.chart).append("g").attr("class",g.chartTexts),Rf&&sj.insert("rect",Tf?null:"g."+g.grid).attr("class",g.zoomRect).attr("width",ag).attr("height",cg).style("opacity",0).style("cursor",nh?"ns-resize":"ew-resize").call(pj).on("dblclick.zoom",null),Eh&&lj.extent("function"!=typeof Eh?Eh:Eh(ac())),oh&&sj.append("g").attr("class",g.axisX).attr("clip-path",Ki).attr("transform",cj.x).append("text").attr("class",g.axisXLabel).attr("transform",nh?"rotate(-90)":"").style("text-anchor",Bb),Gh&&sj.append("g").attr("class",g.axisY).attr("clip-path",Li).attr("transform",cj.y).append("text").attr("class",g.axisYLabel).attr("transform",nh?"":"rotate(-90)").style("text-anchor",Cb),Ph&&sj.append("g").attr("class",g.axisY2).attr("transform",cj.y2).append("text").attr("class",g.axisY2Label).attr("transform",nh?"":"rotate(-90)").style("text-anchor",Db),tj.append("g").attr("clip-path",Ji).attr("class",g.chart),tj.select("."+g.chart).append("g").attr("class",g.chartBars),tj.select("."+g.chart).append("g").attr("class",g.chartLines),tj.append("g").attr("clip-path",Ji).attr("class",g.brush).call(lj).selectAll("rect").attr(nh?"width":"height",nh?bg:dg),tj.append("g").attr("class",g.axisX).attr("transform",cj.subx).attr("clip-path",nh?"":Ki),sf(If.data.targets),nh?sj.select("."+g.axisX).style("opacity",0).call(Bg):(sj.select("."+g.axisY).style("opacity",0).call(Cg),sj.select("."+g.axisY2).style("opacity",0).call(Dg)),p(),T(),qf(),o(!1),mf({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),Di){if(Mi&&"string"==typeof Ei){for(Ei=ye(Ei),e=0;e0){d=[];for(var f in Jg)for(c=0;cf&&h>c&&d>i&&j>d):"path"===this.nodeName&&(m=Pd(this),c=m.x,d=m.y,e=m.width,k=m.height,l=Me,q=!(c>h||f>c+e||d>j||i>d+k)),q^p&&(n.classed(g.INCLUDED,!p),n.classed(g.SELECTED,!o),l(!o,n,a,b))}))}function jf(a){je(If.data.targets)||Vg&&(Pi=a,sj.select("."+g.chart).append("rect").attr("class",g.dragarea).style("opacity",.1),Qi=!0,ch())}function kf(){je(If.data.targets)||Vg&&(sj.select("."+g.dragarea).transition().duration(100).style("opacity",0).remove(),sj.selectAll("."+g.shape).classed(g.INCLUDED,!1),Qi=!1,dh())}function lf(a,b){"grid"===b&&a.each(function(){var a=Hf.select(this),b=a.attr("x1"),c=a.attr("x2"),d=a.attr("y1"),e=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(c),y1:Math.ceil(d),y2:Math.ceil(e)})})}function mf(a){var c,e,f,h,i,j,k,l,m,n,o,p,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_=$d(),ab=je(If.data.targets),bb=Jc(If.data.targets);if(a=d(a)?a:{},G=d(a.withY)?a.withY:!0,H=d(a.withSubchart)?a.withSubchart:!0,I=d(a.withTransition)?a.withTransition:!0,L=d(a.withTransform)?a.withTransform:!1,M=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,O=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,P=d(a.withLegend)?a.withLegend:!1,J=d(a.withTransitionForExit)?a.withTransitionForExit:I,K=d(a.withTransitionForAxis)?a.withTransitionForAxis:I,V=I?Yf:0,W=J?V:0,X=K?V:0,c=sj.select("."+g.axisX).style("opacity",ab?0:1),f=sj.select("."+g.axisY).style("opacity",ab?0:1),h=sj.select("."+g.axisY2).style("opacity",ab?0:1),e=tj.select("."+g.axisX).style("opacity",ab?0:1),U={axisX:c.transition().duration(X),axisY:f.transition().duration(X),axisY2:h.transition().duration(X),axisSubX:e.transition().duration(X)},P&&hh&&Cf(Dc(If.data.targets),a,U),Ni&&0===bb.length&&vg.domain([0,c.selectAll(".tick").size()]),bb.length&&(O&&(vg.domain(Hf.extent(ac(bb))),xj=vg.domain(),Rf&&pj.scale(vg).updateScaleExtent(),yg.domain(vg.domain()),lj.scale(yg)),M&&(vg.domain(lj.empty()?xj:lj.extent()),Rf&&pj.scale(vg).updateScaleExtent()),yh||!xh&&!wh||(Y=Lc(Kc(bb),wh),Bg.tickValues(Y),Eg.tickValues(Y))),wg.domain(Yb(bb,"y")),xg.domain(Yb(bb,"y2")),U.axisX.call(Bg),U.axisY.call(Cg),U.axisY2.call(Dg),U.axisSubX.call(Eg),Fb(I),M&&bb.length)if(uh&&Y){for(Z=1;Z=0&&Hf.select(this).style("display",b%$?"none":"block")})}else qj.selectAll("."+g.axisX+" .tick text").style("display","block");!nh&&zh&&gb(c,U.axisX,zh),Q=Ze(_),S=$e(_,!0),T=$e(_,!1),zg.domain(wg.domain()),Ag.domain(xg.domain()),vj.style("display","none"),q(),sj.select("line."+g.xgridFocus).style("visibility","hidden"),Yh&&(k=Xd(Zh,vg),D=Ni?Bg.tickOffset():0,j=nh?{x1:0,x2:ag,y1:function(a){return vg(a)-D},y2:function(a){return vg(a)-D}}:{x1:function(a){return vg(a)+D},x2:function(a){return vg(a)+D},y1:Zf.top,y2:cg},i=sj.select("."+g.xgrids).selectAll("."+g.xgrid).data(k),i.enter().append("line").attr("class",g.xgrid),i.attr(j).style("opacity",function(){return+Hf.select(this).attr(nh?"y1":"x1")===(nh?cg:0)?0:1}),i.exit().remove()),De($h)&&(l=sj.select("."+g.xgridLines).selectAll("."+g.xgridLine).data($h),m=l.enter().append("g").attr("class",function(a){return g.xgridLine+(a.class?a.class:"")}),m.append("line").style("opacity",0),m.append("text").attr("text-anchor","end").attr("transform",nh?"":"rotate(-90)").attr("dx",nh?0:-Zf.top).attr("dy",-5).style("opacity",0),l.select("line").transition().duration(V).attr("x1",nh?0:Hd).attr("x2",nh?ag:Hd).attr("y1",nh?Hd:Zf.top).attr("y2",nh?Hd:cg).style("opacity",1),l.select("text").transition().duration(V).attr("x",nh?ag:0).attr("y",Hd).text(function(a){return a.text}).style("opacity",1),l.exit().transition().duration(V).style("opacity",0).remove()),G&&_h&&(n=sj.select("."+g.ygrids).selectAll("."+g.ygrid).data(wg.ticks(bi)),n.enter().append("line").attr("class",g.ygrid),n.attr("x1",nh?wg:0).attr("x2",nh?wg:ag).attr("y1",nh?0:wg).attr("y2",nh?cg:wg),n.exit().remove(),lf(n,"grid")),G&&De(ai)&&(o=sj.select("."+g.ygridLines).selectAll("."+g.ygridLine).data(ai),p=o.enter().append("g").attr("class",function(a){return g.ygridLine+(a.class?a.class:"")}),p.append("line").style("opacity",0),p.append("text").attr("text-anchor","end").attr("transform",nh?"rotate(-90)":"").attr("dx",nh?0:-Zf.top).attr("dy",-5).style("opacity",0),o.select("line").transition().duration(V).attr("x1",nh?Id:0).attr("x2",nh?Id:ag).attr("y1",nh?0:Id).attr("y2",nh?cg:Id).style("opacity",1),o.select("text").transition().duration(V).attr("x",nh?0:ag).attr("y",Id).text(function(a){return a.text}).style("opacity",1),o.exit().transition().duration(V).style("opacity",0).remove()),w=sj.select("."+g.regions).selectAll("."+g.region).data(yi),w.enter().append("g").attr("class",id).append("rect").style("fill-opacity",0),w.selectAll("rect").transition().duration(V).attr("x",fc).attr("y",gc).attr("width",hc).attr("height",ic).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),w.exit().transition().duration(V).style("fill-opacity",0).remove(),u=sj.selectAll("."+g.bars).selectAll("."+g.bar).data(te),u.enter().append("path").attr("class",cd).style("stroke","none").style("fill",Vi),u.style("opacity",ud).transition().duration(V).attr("d",Q).style("fill",Vi).style("opacity",1),u.exit().transition().duration(W).style("opacity",0).remove(),r=sj.selectAll("."+g.lines).selectAll("."+g.line).data(re),r.enter().append("path").attr("class",$c).style("stroke",Vi),r.style("opacity",ud).transition().duration(V).attr("d",mj).style("stroke",Vi).style("opacity",1),r.exit().transition().duration(W).style("opacity",0).remove(),s=sj.selectAll("."+g.areas).selectAll("."+g.area).data(re),s.enter().append("path").attr("class",gd).style("fill",Vi).style("opacity",function(){return yj=+Hf.select(this).style("opacity"),0}),s.style("opacity",0).transition().duration(V).attr("d",nj).style("fill",Vi).style("opacity",yj),s.exit().transition().duration(W).style("opacity",0).remove(),t=sj.selectAll("."+g.circles).selectAll("."+g.circle).data(ue),t.enter().append("circle").attr("class",ad).attr("r",Qe).style("fill",Vi),t.style("opacity",ud).transition().duration(V).style("opacity",wd).style("fill",Vi).attr("cx",nh?Zd:Yd).attr("cy",nh?Yd:Zd),t.exit().remove(),x=sj.selectAll("."+g.texts).selectAll("."+g.text).data(ve),x.enter().append("text").attr("class",Wc).attr("text-anchor",function(a){return nh?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",Vi).style("fill-opacity",0),x.text(function(a){return Fd(a.id)(a.value,a.id)}).style("fill-opacity",vd).transition().duration(V).attr("x",S).attr("y",T).style("fill",Vi).style("fill-opacity",xd),x.exit().transition().duration(W).style("fill-opacity",0).remove(),v=sj.selectAll("."+g.arcs).selectAll("."+g.arc).data(se),v.enter().append("path").attr("class",ed).style("fill",function(a){return Vi(a.data)}).style("cursor",function(a){return Xg(a)?"pointer":null}).style("opacity",0).each(function(a){this._current=a}).on("mouseover",function(a,b){var c,d,e;Ti||(c=Gb(a),d=Mb(c),e=Ub(),Ob(c.data.id),yf(c.data.id,!0),e(d,b))}).on("mousemove",function(a){var b=Gb(a),c=Mb(b),d=[c];Td(d,Hf.mouse(this))}).on("mouseout",function(a,b){var c,d,e;Ti||(c=Gb(a),d=Mb(c),e=Vb(),Pb(c.data.id),zf(),Ud(),e(d,b))}).on("click",function(a,b){var c=Gb(a),d=Mb(c),e=Tb();gf(this,a,b),e(d,b)}),v.attr("transform",L?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).each(function(){Ti=!0}).transition().duration(V).attrTween("d",function(a){var b,c=Gb(a);return c?(b=Hf.interpolate(this._current,c),this._current=b(0),function(a){return Jb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",L?"scale(1)":"").style("fill",function(a){return Vi(a.data)}).style("opacity",1).call(Ge,function(){Ti=!1}),v.exit().transition().duration(W).style("opacity",0).remove(),sj.selectAll("."+g.chartArc).select("text").attr("transform",Kb).style("opacity",0).transition().duration(V).text(Nb).style("opacity",function(a){return Hc(a.data.id)&&qe(a.data)?1:0}),sj.select("."+g.chartArcsTitle).style("opacity",ie(If.data.targets)?1:0),eh&&(Hf.event&&"zoom"===Hf.event.type&&lj.extent(vg.orgDomain()).update(),H&&(!nh&&zh&&gb(e,U.axisSubX,zh),lj.empty()||lj.extent(vg.orgDomain()).update(),R=Ze(_,!0),z=tj.selectAll("."+g.bars).selectAll("."+g.bar).data(te),z.enter().append("path").attr("class",cd).style("stroke","none").style("fill",Vi),z.style("opacity",ud).transition().duration(V).attr("d",R).style("opacity",1),z.exit().transition().duration(V).style("opacity",0).remove(),y=tj.selectAll("."+g.lines).selectAll("."+g.line).data(re),y.enter().append("path").attr("class",$c).style("stroke",Vi),y.style("opacity",ud).transition().duration(V).attr("d",oj).style("opacity",1),y.exit().transition().duration(V).style("opacity",0).remove())),sj.selectAll("."+g.selectedCircles).filter(function(a){return me(a)}).selectAll("circle").remove(),sj.selectAll("."+g.selectedCircle).transition().duration(V).attr("cx",nh?Zd:Yd).attr("cy",nh?Yd:Zd),A=sj.select("."+g.eventRects),De(Gg)&&!pc(Gg)?(A.classed(g.eventRectsMultiple)||A.classed(g.eventRectsMultiple,!0).classed(g.eventRectsSingle,!1).selectAll("."+g.eventRect).remove(),B=sj.select("."+g.eventRects).selectAll("."+g.eventRect).data([0]),ff(B.enter()),B.attr("x",0).attr("y",0).attr("width",ag).attr("height",cg)):(A.classed(g.eventRectsSingle)||A.classed(g.eventRectsMultiple,!1).classed(g.eventRectsSingle,!0).selectAll("."+g.eventRect).remove(),Oi&&!Ni?(F=function(a,b){var c=yc(b),d=zc(b),e=If.data.xs[a.id][b];return(vg(d?d:e+50)-vg(c?c:e-50))/2},E=function(a,b){var c=yc(b),d=If.data.xs[a.id][b];return(vg(d)+vg(c?c:d-50))/2}):(F=N(),E=function(a){return vg(a.x)-F/2}),C=Bc(If.data.targets),sj.select("."+g.eventRects).datum(C?C.values:[]),B=sj.select("."+g.eventRects).selectAll("."+g.eventRect).data(function(a){return a}),ef(B.enter()),B.attr("class",jd).attr("x",nh?0:E).attr("y",nh?E:0).attr("width",nh?ag:F).attr("height",nh?F:cg),B.exit().remove()),Dc(If.data.targets).forEach(function(a){zj[a]=!0})}function nf(){mf({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function of(){if(0!==Jc(If.data.targets).length){if("mousemove"===Hf.event.sourceEvent.type&&pj.altDomain)return vg.domain(pj.altDomain),void pj.scale(vg).updateScaleExtent();Ni&&vg.orgDomain()[0]===xj[0]&&vg.domain([xj[0]-1e-10,vg.orgDomain()[1]]),mf({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===Hf.event.sourceEvent.type&&(Ri=!0)}}function pf(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function qf(){qj.attr("width",eg).attr("height",fg),qj.select("#"+Gi).select("rect").attr("width",ag).attr("height",cg),qj.select("#"+Hi).select("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),qj.select("#"+Ii).select("rect").attr("x",F).attr("y",G).attr("width",L).attr("height",M),qj.select("."+g.zoomRect).attr("width",ag).attr("height",cg),wj.style("max-height",fg+"px")}function rf(a){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.withTransitionForExit=!1,p(),T(),qf(),o(a.withTransition),mf(a)}function sf(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=sj.select("."+g.chartTexts).selectAll("."+g.chartText).data(a).attr("class",ld),j=i.enter().append("g").attr("class",ld).style("opacity",0).style("pointer-events","none"),j.append("g").attr("class",Xc),e=sj.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",nd),d=e.enter().append("g").attr("class",nd).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",dd).style("cursor",function(a){return Xg(a)?"pointer":null}),c=sj.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",md),b=c.enter().append("g").attr("class",md).style("opacity",0).style("pointer-events","none"),b.append("g").attr("class",_c),b.append("g").attr("class",hd),b.append("g").attr("class",function(a){return Vc(g.selectedCircles,a.id)}),b.append("g").attr("class",bd).style("cursor",function(a){return Xg(a)?"pointer":null}),a.forEach(function(a){sj.selectAll("."+g.selectedCircles+pd(a.id)).selectAll("."+g.selectedCircle).each(function(b,c){b.value=a.values[c].value})}),h=sj.select("."+g.chartArcs).selectAll("."+g.chartArc).data(mg(a)).attr("class",od),f=h.enter().append("g").attr("class",od),f.append("g").attr("class",fd),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),eh&&(n=tj.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",nd),m=n.enter().append("g").style("opacity",0).attr("class",nd),m.append("g").attr("class",dd),l=tj.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",md),k=l.enter().append("g").style("opacity",0).attr("class",md),k.append("g").attr("class",_c)),qj.selectAll("."+g.target).filter(function(a){return Hc(a.id)}).transition().duration(Yf).style("opacity",1)}function tf(a,b){(b.type||b.types)&&a.forEach(function(a){b.types?de(a.id,b.types[a.id]):de(a.id,b.type)}),If.data.targets.forEach(function(b){for(var c=0;cf&&(f=(l-k)/2,w=0,C++)),B[a]=C,A[C]=f,x[a]=w,w+=k}var f,g,h=b.getBoundingClientRect(),i=10*Math.ceil((h.width+s)/10),j=10*Math.ceil((h.height+r)/10),k=dj?j:i,l=dj?S():R();return d&&(w=0,C=0,t=0,u=0),hh&&!Ic(c)?void(y[c]=z[c]=B[c]=x[c]=0):(y[c]=i,z[c]=j,(!t||i>=t)&&(t=i),(!u||j>=u)&&(u=j),g=dj?u:t,void(mh?(Object.keys(y).forEach(function(a){y[a]=t}),Object.keys(z).forEach(function(a){z[a]=u}),f=(l-g*a.length)/2,v>f?(w=0,C=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var f,h,i,j,k,l,m,n,q,r=4,s=26,t=0,u=0,v=10,w=0,x={},y={},z={},A=[0],B={},C=0,D=uj.selectAll("."+g.legendItemFocused).size();b=b||{},n=d(b.withTransition)?b.withTransition:!0,q=d(b.withTransitionForTransform)?b.withTransitionForTransform:!0,dj?(f=function(a){return t*B[a]},j=function(a){return A[B[a]]+x[a]}):(f=function(a){return A[B[a]]+x[a]},j=function(a){return u*B[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=uj.selectAll("."+g.legendItem).data(a).enter().append("g").attr("class",function(a){return Vc(g.legendItem,a)}).style("visibility",function(a){return Ic(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof jh?jh(a):If.toggle(a)}).on("mouseover",function(a){Hf.select(this).classed(g.legendItemFocused,!0),Ti||If.focus(a),"function"==typeof kh&&kh(a)}).on("mouseout",function(a){Hf.select(this).classed(g.legendItemFocused,!1),Ti||If.revert(),"function"==typeof lh&&lh(a)}),m.append("text").text(function(a){return d(Jg[a])?Jg[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",dj?h:-200).attr("y",dj?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",dj?i:-200).attr("y",dj?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",Vi).attr("x",dj?h:-200).attr("y",dj?-200:j).attr("width",10).attr("height",10),uj.selectAll("text").data(a).text(function(a){return d(Jg[a])?Jg[a]:a}).each(function(a,b){e(this,a,0===b)}).transition().duration(n?250:0).attr("x",h).attr("y",k),uj.selectAll("rect."+g.legendItemEvent).data(a).transition().duration(n?250:0).attr("width",function(a){return y[a]}).attr("height",function(a){return z[a]}).attr("x",i).attr("y",l),uj.selectAll("rect."+g.legendItemTile).data(a).transition().duration(n?250:0).style("fill",Vi).attr("x",f).attr("y",j),uj.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Hc(a)}).transition().style("opacity",function(a){var b=Hf.select(this);return Hc(a)?!D||b.classed(g.legendItemFocused)?wf(b):xf(b):hj}),P(t),Q(u),O(C),p(),T(),qf(),o(q,c)}function Df(a){return Fc(If.data.targets,a.id)}function Ef(a){return"data"in a&&Fc(If.data.targets,a.data.id)}function Ff(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 Gf(a,b,c){var d=!je(If.data.targets);Ti=!1,de(a,b),rf(c||{withTransitionForAxis:d})}var Hf=a.d3?a.d3:a.require?a.require("d3"):void 0,If={data:{},axis:{},legend:{}},Jf={},Kf=i(["bindto"],"#chart"),Lf=i(["size","width"]),Mf=i(["size","height"]),Nf=i(["padding","left"],50),Of=i(["padding","right"],0),Pf=i(["padding","top"],0),Qf=i(["padding","bottom"],0),Rf=i(["zoom","enabled"],!1),Sf=i(["zoom","extent"]),Tf=i(["zoom","privileged"],!1),Uf=i(["onenter"],function(){}),Vf=i(["onleave"],function(){}),Wf=i(["onresize"],function(){}),Xf=i(["onresized"],function(){}),Yf=i(["transition","duration"],350);h("data","data is required in config");var Zf,$f,_f,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,Ag,Bg,Cg,Dg,Eg,Fg=i(["data","x"]),Gg=i(["data","xs"],{}),Hg=i(["data","x_format"]),Ig=i(["data","id_converter"],function(a){return a}),Jg=i(["data","names"],{}),Kg=i(["data","classes"],{}),Lg=i(["data","groups"],[]),Mg=i(["data","axes"],{}),Ng=i(["data","type"]),Og=i(["data","types"],{}),Pg=i(["data","labels"],{}),Qg=i(["data","order"]),Rg=i(["data","regions"],{}),Sg=i(["data","color"]),Tg=i(["data","colors"],{}),Ug=i(["data","hide"],!1),Vg=i(["data","selection","enabled"],!1),Wg=i(["data","selection","grouped"],!1),Xg=i(["data","selection","isselectable"],function(){return!0}),Yg=i(["data","selection","multiple"],!0),Zg=i(["data","onclick"],function(){}),$g=i(["data","onenter"],function(){}),_g=i(["data","onleave"],function(){}),ah=i(["data","onselected"],function(){}),bh=i(["data","onunselected"],function(){}),ch=i(["data","ondragstart"],function(){}),dh=i(["data","ondragend"],function(){}),eh=i(["subchart","show"],!1),fh=i(["subchart","size","height"],60),gh=i(["color","pattern"],[]),hh=i(["legend","show"],!0),ih=i(["legend","position"],"bottom"),jh=i(["legend","item","onclick"]),kh=i(["legend","item","onmouseover"]),lh=i(["legend","item","onmouseout"]),mh=i(["legend","equally"],!1),nh=i(["axis","rotated"],!1),oh=i(["axis","x","show"],!0),ph=i(["axis","x","type"],"indexed"),qh=i(["axis","x","localtime"],!0),rh=i(["axis","x","categories"],[]),sh=i(["axis","x","tick","centered"],!1),th=i(["axis","x","tick","format"]),uh=i(["axis","x","tick","culling"],{}),vh=i(["axis","x","tick","culling","max"],10),wh=i(["axis","x","tick","count"]),xh=i(["axis","x","tick","fit"],!0),yh=i(["axis","x","tick","values"],null),zh=i(["axis","x","tick","rotate"]),Ah=i(["axis","x","max"],null),Bh=i(["axis","x","min"],null),Ch=i(["axis","x","padding"],{}),Dh=i(["axis","x","height"]),Eh=i(["axis","x","default"]),Fh=i(["axis","x","label"],{}),Gh=i(["axis","y","show"],!0),Hh=i(["axis","y","max"]),Ih=i(["axis","y","min"]),Jh=i(["axis","y","center"]),Kh=i(["axis","y","label"],{}),Lh=i(["axis","y","inner"],!1),Mh=i(["axis","y","tick","format"]),Nh=i(["axis","y","padding"]),Oh=i(["axis","y","ticks"],10),Ph=i(["axis","y2","show"],!1),Qh=i(["axis","y2","max"]),Rh=i(["axis","y2","min"]),Sh=i(["axis","y2","center"]),Th=i(["axis","y2","label"],{}),Uh=i(["axis","y2","inner"],!1),Vh=i(["axis","y2","tick","format"]),Wh=i(["axis","y2","padding"]),Xh=i(["axis","y2","ticks"],10),Yh=i(["grid","x","show"],!1),Zh=i(["grid","x","type"],"tick"),$h=i(["grid","x","lines"],[]),_h=i(["grid","y","show"],!1),ai=i(["grid","y","lines"],[]),bi=i(["grid","y","ticks"],10),ci=i(["point","show"],!0),di=i(["point","r"],2.5),ei=i(["point","focus","line","enabled"],!0),fi=i(["point","focus","expand","enabled"],!0),gi=i(["point","focus","expand","r"]),hi=i(["point","focus","select","r"]),ii=i(["line","connect_null"],!1),ji=i(["bar","width"]),ki=i(["bar","width","ratio"],.6),li=i(["pie","label","show"],!0),mi=i(["pie","label","format"]),ni=i(["pie","expand"],!0),oi=i(["pie","onclick"],function(){}),pi=i(["pie","onmouseover"],function(){}),qi=i(["pie","onmouseout"],function(){}),ri=i(["donut","label","show"],!0),si=i(["donut","label","format"]),ti=i(["donut","expand"],!0),ui=i(["donut","title"],""),vi=i(["donut","onclick"],function(){}),wi=i(["donut","onmouseover"],function(){}),xi=i(["donut","onmouseout"],function(){}),yi=i(["regions"],[]),zi=i(["tooltip","show"],!0),Ai=i(["tooltip","format","title"]),Bi=i(["tooltip","format","value"]),Ci=i(["tooltip","contents"],function(a,b,c,d){var e,f,h,i,j,k=Ai?Ai:b,l=Bi?Bi:c;for(f=0;f"+(h||0===h?""+h+"":"")),j=a[f].name,i=l(a[f].value,a[f].ratio,a[f].id,a[f].index),e+="",e+=""+j+"",e+=""+i+"",e+="");return e+""}),Di=i(["tooltip","init","show"],!1),Ei=i(["tooltip","init","x"],0),Fi=i(["tooltip","init","position"],{top:"0px",left:"50px"}),Gi=("string"==typeof Kf?Kf.replace("#",""):Kf.id)+"-clip",Hi=Gi+"-xaxis",Ii=Gi+"-yaxis",Ji=j(Gi),Ki=j(Hi),Li=j(Ii),Mi="timeseries"===ph,Ni="categorized"===ph,Oi=!Mi&&(Fg||De(Gg)),Pi=null,Qi=!1,Ri=!1,Si=!1,Ti=!1,Ui=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Vi=xe(Tg,De(gh)?gh:Ui,Sg),Wi=qh?Hf.time.format:Hf.time.format.utc,Xi=function(){var a=[[Wi("%Y/%-m/%-d"),function(){return!0}],[Wi("%-m/%-d"),function(a){return a.getMonth()}],[Wi("%-m/%-d"),function(a){return 1!==a.getDate()}],[Wi("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[Wi("%I %p"),function(a){return a.getHours()}],[Wi("%I:%M"),function(a){return a.getMinutes()}],[Wi(":%S"),function(a){return a.getSeconds()}],[Wi(".%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)}}(),Yi=[],Zi=[],$i=nh?"left":"bottom",_i=nh?Lh?"top":"bottom":Lh?"right":"left",aj=nh?Uh?"bottom":"top":Uh?"left":"right",bj=nh?"left":"bottom",cj={main:function(){return"translate("+k(Zf.left)+","+k(Zf.top)+")"},context:function(){return"translate("+k($f.left)+","+k($f.top)+")"},legend:function(){return"translate("+_f.left+","+_f.top+")"},x:function(){return"translate(0,"+(nh?0:cg)+")"},y:function(){return"translate(0,"+(nh?cg:0)+")"},y2:function(){return"translate("+(nh?0:ag)+","+(nh?1:0)+")"},subx:function(){return"translate(0,"+(nh?0:dg)+")"},arc:function(){return"translate("+ag/2+","+cg/2+")" -}},dj="right"===ih,ej=0,fj=0,gj=0,hj=.15,ij=30,jj=nh&&!oh?0:30,kj=5;mg=Hf.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var lj,mj=function(){var a=Hf.svg.line().x(nh?function(a){return X(a.id)(a.value)}:Gd).y(nh?Gd:function(a){return X(a.id)(a.value)});return ii||(a=a.defined(function(a){return null!=a.value})),function(b){var c,d,e=ii?Pe(b.values):b.values;return ke(b)?(a.interpolate(le(b)?"cardinal":"linear"),Rg[b.id]?cf(e,vg,X(b.id),Rg[b.id]):a(e)):(c=e[0]?vg(e[0].x):0,d=e[0]?X(b.id)(e[0].value):0,nh?"M "+d+" "+c:"M "+c+" "+d)}}(),nj=function(){var a;return a=nh?Hf.svg.area().x0(function(a){return X(a.id)(0)}).x1(function(a){return X(a.id)(a.value)}).y(Gd):Hf.svg.area().x(Gd).y0(function(a){return X(a.id)(0)}).y1(function(a){return X(a.id)(a.value)}),function(b){var c,d,e=Pe(b.values);return ee([b],"area")||ee([b],"area-spline")?(a.interpolate(le(b)?"cardinal":"linear"),a(e)):(c=e[0]?vg(e[0].x):0,d=e[0]?X(b.id)(e[0].value):0,nh?"M "+d+" "+c:"M "+c+" "+d)}}(),oj=function(){var a=Hf.svg.line().x(nh?function(a){return Y(a.id)(a.value)}:Jd).y(nh?Jd:function(a){return Y(a.id)(a.value)});return function(b){var c=Pe(b.values);return ke(b)?a(c):"M "+yg(c[0].x)+" "+Y(b.id)(c[0].value)}}(),pj=function(){};lj=Hf.svg.brush().on("brush",nf),lj.update=function(){return tj&&tj.select("."+g.brush).call(this),this},lj.scale=function(a){return nh?this.y(a):this.x(a)},Rf&&(pj=Hf.behavior.zoom().on("zoomstart",function(){pj.altDomain=Hf.event.sourceEvent.altKey?vg.orgDomain():null}).on("zoom",Rf?of:null),pj.scale=function(a){return nh?this.y(a):this.x(a)},pj.orgScaleExtent=function(){var a=Sf?Sf:[1,10];return[a[0],Math.max(Ac()/a[1],a[1])]},pj.updateScaleExtent=function(){var a=bc(vg.orgDomain())/bc(xj),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var qj,rj,sj,tj,uj,vj,wj,xj,yj,zj={};if(If.focus=function(a){function b(a){Jc(a).transition().duration(100).style("opacity",1)}var c=qj.selectAll(qd(a)),d=c.filter(Df),e=c.filter(Ef);If.revert(),If.defocus(),b(d.classed(g.focused,!0)),b(e),je(If.data.targets)&&Ob(a,!0),yf(a,!0)},If.defocus=function(a){function b(a){Jc(a).transition().duration(100).style("opacity",.3)}var c=qj.selectAll(qd(a)),d=c.filter(Df),e=c.filter(Ef);If.revert(),b(d.classed(g.focused,!1)),b(e),je(If.data.targets)&&Pb(a),yf(a,!1)},If.revert=function(a){function b(a){Jc(a).transition().duration(100).style("opacity",1)}var c=qj.selectAll(qd(a)),d=c.filter(Df),e=c.filter(Ef);b(d.classed(g.focused,!1)),b(e),je(If.data.targets)&&Pb(a),zf()},If.show=function(a,b){a=Ec(a),b=b||{},Nc(a),qj.selectAll(rd(a)).transition().style("opacity",1),b.withLegend&&Af(a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},If.hide=function(a,b){a=Ec(a),b=b||{},Mc(a),qj.selectAll(rd(a)).transition().style("opacity",0),b.withLegend&&Bf(a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},If.toggle=function(a){Hc(a)?If.hide(a):If.show(a)},If.unzoom=function(){lj.clear().update(),mf({withUpdateXDomain:!0})},If.load=function(a){return a.xs&&oc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){Kg[b]=a.classes[b]}),"categories"in a&&Ni&&(rh=a.categories,Bg.categories(rh)),"cacheIds"in a&&cc(a.cacheIds)?void tf(ec(a.cacheIds),a.done):void("unload"in a?vf(Ec("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){uf(a)}):uf(a))},If.unload=function(a,b){vf(Ec(a),function(){mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},If.selected=function(a){return Hf.merge(sj.selectAll("."+g.shapes+pd(a)).selectAll("."+g.shape).filter(function(){return Hf.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},If.select=function(a,b,c){Vg&&sj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=Hf.select(this),i=e.data?e.data.id:e.id,j=Oe(this),k=Wg||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0,m=h.classed(g.SELECTED);k&&l?Xg(e)&&!m&&j(!0,h.classed(g.SELECTED,!0),e,f):d(c)&&c&&m&&j(!1,h.classed(g.SELECTED,!1),e,f)})},If.unselect=function(a,b){Vg&&sj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(c,d){var e=Hf.select(this),f=c.data?c.data.id:c.id,h=Oe(this),i=Wg||!a||a.indexOf(f)>=0,j=!b||b.indexOf(d)>=0,k=e.classed(g.SELECTED);i&&j&&Xg(c)&&k&&h(!1,e.classed(g.SELECTED,!1),c,d)})},If.toLine=function(a){Gf(a,"line")},If.toSpline=function(a){Gf(a,"spline")},If.toBar=function(a){Gf(a,"bar")},If.toScatter=function(a){Gf(a,"scatter")},If.toArea=function(a){Gf(a,"area")},If.toAreaSpline=function(a){Gf(a,"area-spline")},If.toPie=function(a){Gf(a,"pie",{withTransform:!0})},If.toDonut=function(a){Gf(a,"donut",{withTransform:!0})},If.groups=function(a){return c(a)?Lg:(Lg=a,mf(),Lg)},If.xgrids=function(a){return a?($h=a,mf(),$h):$h},If.xgrids.add=function(a){return a?If.xgrids($h.concat(a)):void 0},If.xgrids.remove=function(a){var b=Ff(a);return If.xgrids($h.filter(b))},If.ygrids=function(a){return a?(ai=a,mf(),ai):ai},If.ygrids.add=function(a){return a?If.ygrids(ai.concat(a)):void 0},If.ygrids.remove=function(a){var b=Ff(a);return If.ygrids(ai.filter(b))},If.regions=function(a){return c(a)?yi:(yi=a,mf(),yi)},If.regions.add=function(a){return c(a)?yi:(yi=yi.concat(a),mf(),yi)},If.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;qj.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),yi=yi.filter(function(b){return b.classes.indexOf(a)<0})}),yi},If.data.get=function(a){var b=If.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},If.data.getAsTarget=function(a){var b=Gc(function(b){return b.id===a});return b.length>0?b[0]:void 0},If.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){Jg[b]=a[b]}),mf({withLegend:!0}),Jg):Jg},If.data.colors=function(a){return arguments.length?(Object.keys(a).forEach(function(b){Tg[b]=a[b]}),mf({withLegend:!0}),Tg):Tg},If.x=function(a){return arguments.length&&(rc(If.data.targets,a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),If.data.xs},If.xs=function(a){return arguments.length&&(sc(If.data.targets,a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),If.data.xs},If.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){db(b,a[b])}),Fb())},If.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Ah=+a.x),b(a.y)&&(Hh=+a.y),b(a.y2)&&(Qh=+a.y2)):Hh=Qh=+a,mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},If.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Bh=+a.x),b(a.y)&&(Ih=+a.y),b(a.y2)&&(Rh=+a.y2)):Ih=Rh=+a,mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},If.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&If.axis.max(a.max),"undefined"!=typeof a.min&&If.axis.min(a.min))},If.legend.show=function(a){Af(Ec(a)),mf({withLegend:!0})},If.legend.hide=function(a){Bf(Ec(a)),mf({withLegend:!0})},If.resize=function(a){Lf=a?a.width:null,Mf=a?a.height:null,rf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},If.destroy=function(){If.data.targets=void 0,If.data.xs={},wj.html(""),a.onresize=null},"url"in f.data)Hf.xhr(f.data.url,function(a,b){var c,d=Hf.csv.parseRows(b.response);1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=Hf.csv.parse(b.response),df(c)});else if("rows"in f.data)df(uc(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");df(vc(f.data.columns))}return If},"function"==typeof a.define&&a.define.amd?a.define("c3",["d3"],f):a.c3=f}(window); \ No newline at end of file +}},dj="right"===ih,ej=0,fj=0,gj=0,hj=.15,ij=30,jj=nh&&!oh?0:30,kj=5;mg=Hf.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var lj,mj=function(){var a=Hf.svg.line().x(nh?function(a){return X(a.id)(a.value)}:Gd).y(nh?Gd:function(a){return X(a.id)(a.value)});return ii||(a=a.defined(function(a){return null!=a.value})),function(b){var c,d,e=ii?Pe(b.values):b.values;return ke(b)?(a.interpolate(le(b)?"cardinal":"linear"),Rg[b.id]?cf(e,vg,X(b.id),Rg[b.id]):a(e)):(c=e[0]?vg(e[0].x):0,d=e[0]?X(b.id)(e[0].value):0,nh?"M "+d+" "+c:"M "+c+" "+d)}}(),nj=function(){var a;return a=nh?Hf.svg.area().x0(function(a){return X(a.id)(0)}).x1(function(a){return X(a.id)(a.value)}).y(Gd):Hf.svg.area().x(Gd).y0(function(a){return X(a.id)(0)}).y1(function(a){return X(a.id)(a.value)}),function(b){var c,d,e=Pe(b.values);return ee([b],"area")||ee([b],"area-spline")?(a.interpolate(le(b)?"cardinal":"linear"),a(e)):(c=e[0]?vg(e[0].x):0,d=e[0]?X(b.id)(e[0].value):0,nh?"M "+d+" "+c:"M "+c+" "+d)}}(),oj=function(){var a=Hf.svg.line().x(nh?function(a){return Y(a.id)(a.value)}:Jd).y(nh?Jd:function(a){return Y(a.id)(a.value)});return function(b){var c=Pe(b.values);return ke(b)?a(c):"M "+yg(c[0].x)+" "+Y(b.id)(c[0].value)}}(),pj=function(){};lj=Hf.svg.brush().on("brush",nf),lj.update=function(){return tj&&tj.select("."+g.brush).call(this),this},lj.scale=function(a){return nh?this.y(a):this.x(a)},Rf&&(pj=Hf.behavior.zoom().on("zoomstart",function(){pj.altDomain=Hf.event.sourceEvent.altKey?vg.orgDomain():null}).on("zoom",Rf?of:null),pj.scale=function(a){return nh?this.y(a):this.x(a)},pj.orgScaleExtent=function(){var a=Sf?Sf:[1,10];return[a[0],Math.max(Ac()/a[1],a[1])]},pj.updateScaleExtent=function(){var a=bc(vg.orgDomain())/bc(xj),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var qj,rj,sj,tj,uj,vj,wj,xj,yj,zj={};if(If.focus=function(a){function b(a){Jc(a).transition().duration(100).style("opacity",1)}var c=qj.selectAll(qd(a)),d=c.filter(Df),e=c.filter(Ef);If.revert(),If.defocus(),b(d.classed(g.focused,!0)),b(e),je(If.data.targets)&&Ob(a,!0),yf(a,!0)},If.defocus=function(a){function b(a){Jc(a).transition().duration(100).style("opacity",.3)}var c=qj.selectAll(qd(a)),d=c.filter(Df),e=c.filter(Ef);If.revert(),b(d.classed(g.focused,!1)),b(e),je(If.data.targets)&&Pb(a),yf(a,!1)},If.revert=function(a){function b(a){Jc(a).transition().duration(100).style("opacity",1)}var c=qj.selectAll(qd(a)),d=c.filter(Df),e=c.filter(Ef);b(d.classed(g.focused,!1)),b(e),je(If.data.targets)&&Pb(a),zf()},If.show=function(a,b){a=Ec(a),b=b||{},Nc(a),qj.selectAll(rd(a)).transition().style("opacity",1),b.withLegend&&Af(a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},If.hide=function(a,b){a=Ec(a),b=b||{},Mc(a),qj.selectAll(rd(a)).transition().style("opacity",0),b.withLegend&&Bf(a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},If.toggle=function(a){Hc(a)?If.hide(a):If.show(a)},If.unzoom=function(){lj.clear().update(),mf({withUpdateXDomain:!0})},If.load=function(a){return a.xs&&oc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){Kg[b]=a.classes[b]}),"categories"in a&&Ni&&(rh=a.categories,Bg.categories(rh)),"cacheIds"in a&&cc(a.cacheIds)?void tf(ec(a.cacheIds),a.done):void("unload"in a?vf(Ec("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){uf(a)}):uf(a))},If.unload=function(a,b){vf(Ec(a),function(){mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},If.selected=function(a){return Hf.merge(sj.selectAll("."+g.shapes+pd(a)).selectAll("."+g.shape).filter(function(){return Hf.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},If.select=function(a,b,c){Vg&&sj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=Hf.select(this),i=e.data?e.data.id:e.id,j=Oe(this),k=Wg||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0,m=h.classed(g.SELECTED);"path"!==this.nodeName&&(k&&l?Xg(e)&&!m&&j(!0,h.classed(g.SELECTED,!0),e,f):d(c)&&c&&m&&j(!1,h.classed(g.SELECTED,!1),e,f))})},If.unselect=function(a,b){Vg&&sj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(c,d){var e=Hf.select(this),f=c.data?c.data.id:c.id,h=Oe(this),i=Wg||!a||a.indexOf(f)>=0,j=!b||b.indexOf(d)>=0,k=e.classed(g.SELECTED);"path"!==this.nodeName&&i&&j&&Xg(c)&&k&&h(!1,e.classed(g.SELECTED,!1),c,d)})},If.toLine=function(a){Gf(a,"line")},If.toSpline=function(a){Gf(a,"spline")},If.toBar=function(a){Gf(a,"bar")},If.toScatter=function(a){Gf(a,"scatter")},If.toArea=function(a){Gf(a,"area")},If.toAreaSpline=function(a){Gf(a,"area-spline")},If.toPie=function(a){Gf(a,"pie",{withTransform:!0})},If.toDonut=function(a){Gf(a,"donut",{withTransform:!0})},If.groups=function(a){return c(a)?Lg:(Lg=a,mf(),Lg)},If.xgrids=function(a){return a?($h=a,mf(),$h):$h},If.xgrids.add=function(a){return a?If.xgrids($h.concat(a)):void 0},If.xgrids.remove=function(a){var b=Ff(a);return If.xgrids($h.filter(b))},If.ygrids=function(a){return a?(ai=a,mf(),ai):ai},If.ygrids.add=function(a){return a?If.ygrids(ai.concat(a)):void 0},If.ygrids.remove=function(a){var b=Ff(a);return If.ygrids(ai.filter(b))},If.regions=function(a){return c(a)?yi:(yi=a,mf(),yi)},If.regions.add=function(a){return c(a)?yi:(yi=yi.concat(a),mf(),yi)},If.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;qj.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),yi=yi.filter(function(b){return b.classes.indexOf(a)<0})}),yi},If.data.get=function(a){var b=If.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},If.data.getAsTarget=function(a){var b=Gc(function(b){return b.id===a});return b.length>0?b[0]:void 0},If.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){Jg[b]=a[b]}),mf({withLegend:!0}),Jg):Jg},If.data.colors=function(a){return arguments.length?(Object.keys(a).forEach(function(b){Tg[b]=a[b]}),mf({withLegend:!0}),Tg):Tg},If.x=function(a){return arguments.length&&(rc(If.data.targets,a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),If.data.xs},If.xs=function(a){return arguments.length&&(sc(If.data.targets,a),mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),If.data.xs},If.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){db(b,a[b])}),Fb())},If.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Ah=+a.x),b(a.y)&&(Hh=+a.y),b(a.y2)&&(Qh=+a.y2)):Hh=Qh=+a,mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},If.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Bh=+a.x),b(a.y)&&(Ih=+a.y),b(a.y2)&&(Rh=+a.y2)):Ih=Rh=+a,mf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},If.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&If.axis.max(a.max),"undefined"!=typeof a.min&&If.axis.min(a.min))},If.legend.show=function(a){Af(Ec(a)),mf({withLegend:!0})},If.legend.hide=function(a){Bf(Ec(a)),mf({withLegend:!0})},If.resize=function(a){Lf=a?a.width:null,Mf=a?a.height:null,rf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},If.destroy=function(){If.data.targets=void 0,If.data.xs={},wj.html(""),a.onresize=null},"url"in f.data)Hf.xhr(f.data.url,function(a,b){var c,d=Hf.csv.parseRows(b.response);1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=Hf.csv.parse(b.response),df(c)});else if("rows"in f.data)df(uc(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");df(vc(f.data.columns))}return If},"function"==typeof a.define&&a.define.amd?a.define("c3",["d3"],f):a.c3=f}(window); \ No newline at end of file