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

3 lines
70 KiB

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