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