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