diff --git a/c3.js b/c3.js index ad76df3..d155bb8 100644 --- a/c3.js +++ b/c3.js @@ -1140,19 +1140,22 @@ function category(i) { return i < __axis_x_categories.length ? __axis_x_categories[i] : i; } - function classText(d) { return "-text -text-" + d.id; } - function classTexts(d) { return "-texts -texts-" + d.id; } - function classShapes(d) { return "-shapes -shapes-" + d.id; } - function classLine(d) { return classShapes(d) + " -line -line-" + d.id; } - function classCircles(d) { return classShapes(d) + " -circles -circles-" + d.id; } - function classBars(d) { return classShapes(d) + " -bars -bars-" + d.id; } - function classArc(d) { return classShapes(d.data) + " -arc -arc-" + d.data.id; } - function classArea(d) { return classShapes(d) + " -area -area-" + d.id; } - function classShape(d, i) { return "-shape -shape-" + i; } - function classCircle(d, i) { return classShape(d, i) + " -circle -circle-" + i; } - function classBar(d, i) { return classShape(d, i) + " -bar -bar-" + i; } - function classRegion(d, i) { return 'region region-' + i + ' ' + ('class' in d ? d.class : ''); } - function classEvent(d, i) { return "event-rect event-rect-" + i; } + function generateClass(prefix, targetId) { + return " " + prefix + " " + prefix + getTargetSelectorSuffix(targetId); + } + function classText(d) { return generateClass("-text", d.id); } + function classTexts(d) { return generateClass("-texts", d.id); } + function classShapes(d) { return generateClass("-shapes", d.id); } + function classLine(d) { return classShapes(d) + generateClass("-line", d.id); } + function classCircles(d) { return classShapes(d) + generateClass("-circles", d.id); } + function classBars(d) { return classShapes(d) + generateClass("-bars", d.id); } + function classArc(d) { return classShapes(d.data) + generateClass("-arc", d.data.id); } + function classArea(d) { return classShapes(d) + generateClass("-area", d.id); } + function classShape(d, i) { return generateClass("-shape", i); } + function classCircle(d, i) { return classShape(d, i) + generateClass("-circle", i); } + function classBar(d, i) { return classShape(d, i) + generateClass("-bar", i); } + function classRegion(d, i) { return generateClass("region", i) + ' ' + ('class' in d ? d.class : ''); } + function classEvent(d, i) { return generateClass("event-rect", i); } function initialOpacity(d) { return withoutFadeIn[d.id] ? 1 : 0; @@ -1575,10 +1578,10 @@ function selectPoint(target, d, i) { __point_onselected(target, d); // add selected-circle on low layer g - main.select(".selected-circles-" + d.id).selectAll('.selected-circle-' + i) + main.select(".selected-circles" + getTargetSelectorSuffix(d.id)).selectAll('.selected-circle-' + i) .data([d]) .enter().append('circle') - .attr("class", function () { return "selected-circle selected-circle-" + i; }) + .attr("class", function () { return generateClass("selected-circle", i); }) .attr("cx", __axis_rotated ? circleY : circleX) .attr("cy", __axis_rotated ? circleX : circleY) .attr("stroke", function () { return color(d.id); }) @@ -1589,7 +1592,7 @@ function unselectPoint(target, d, i) { __point_onunselected(target, d); // remove selected-circle from low layer g - main.select(".selected-circles-" + d.id).selectAll(".selected-circle-" + i) + main.select(".selected-circles" + getTargetSelectorSuffix(d.id)).selectAll(".selected-circle-" + i) .transition().duration(100).attr('r', 0) .remove(); } @@ -1614,7 +1617,7 @@ //-- Shape --// function getCircles(i, id) { - return (id ? main.selectAll('.-circles-' + id) : main).selectAll('.-circle' + (isValue(i) ? '-' + i : '')); + return (id ? main.selectAll('.-circles' + getTargetSelectorSuffix(id)) : main).selectAll('.-circle' + (isValue(i) ? '-' + i : '')); } function expandCircles(i, id) { getCircles(i, id) @@ -2299,7 +2302,7 @@ // select if selection enabled if (dist(closest, mouse) < 100) { - main.select('.-circles-' + closest.id).select('.-circle-' + closest.index).each(function () { + main.select('.-circles-' + getTargetSelectorSuffix(closest.id)).select('.-circle-' + closest.index).each(function () { selectShape(this, closest, closest.index); }); } @@ -2878,7 +2881,7 @@ .selectAll('.chart-text') .data(targets); mainTextEnter = mainTextUpdate.enter().append('g') - .attr('class', function (d) { return 'chart-text target target-' + d.id; }) + .attr('class', function (d) { return 'chart-text' + generateClass('target', d.id); }) .style("pointer-events", "none"); mainTextEnter.append('g') .attr('class', classTexts) @@ -2889,7 +2892,7 @@ .selectAll('.chart-bar') .data(targets); mainBarEnter = mainBarUpdate.enter().append('g') - .attr('class', function (d) { return 'chart-bar target target-' + d.id; }) + .attr('class', function (d) { return 'chart-bar' + generateClass('target', d.id); }) .style("pointer-events", "none"); // Bars for each data mainBarEnter.append('g') @@ -2903,7 +2906,7 @@ .selectAll('.chart-line') .data(targets); mainLineEnter = mainLineUpdate.enter().append('g') - .attr('class', function (d) { return 'chart-line target target-' + d.id; }) + .attr('class', function (d) { return 'chart-line' + generateClass('target', d.id); }) .style("pointer-events", "none"); // Lines for each data mainLineEnter.append("path") @@ -2917,7 +2920,7 @@ .style("fill", function (d) { return color(d.id); }); // Circles for each data point on lines mainLineEnter.append('g') - .attr("class", function (d) { return "selected-circles selected-circles-" + d.id; }); + .attr("class", function (d) { return generateClass("selected-circles", d.id); }); mainLineEnter.append('g') .attr("class", classCircles) .style("fill", function (d) { return color(d.id); }) @@ -2981,7 +2984,7 @@ .selectAll('.chart-bar') .data(targets); contextBarEnter = contextBarUpdate.enter().append('g') - .attr('class', function (d) { return 'chart-bar target target-' + d.id; }); + .attr('class', function (d) { return 'chart-bar' + generateClass('target', d.id); }); // Bars for each data contextBarEnter.append('g') .attr("class", classBars) @@ -2992,7 +2995,7 @@ .selectAll('.chart-line') .data(targets); contextLineEnter = contextLineUpdate.enter().append('g') - .attr('class', function (d) { return 'chart-line target target-' + d.id; }); + .attr('class', function (d) { return 'chart-line' + generateClass('target', d.id); }); // Lines for each data contextLineEnter.append("path") .attr("class", classLine) @@ -3133,7 +3136,7 @@ l = legend.selectAll('.legend-item') .data(ids) .enter().append('g') - .attr('class', function (id) { return 'legend-item legend-item-' + id; }) + .attr('class', function (id) { return generateClass('legend-item', id); }) .style('cursor', 'pointer') .on('click', function (id) { __legend_item_onclick(id); @@ -3200,7 +3203,7 @@ /*-- Event Handling --*/ function getTargetSelectorSuffix(targetId) { - return targetId ? '-' + targetId.replace(/([^a-zA-Z0-9-_])/g, '-') : ''; + return targetId || targetId === 0 ? '-' + (targetId.replace ? targetId.replace(/([^a-zA-Z0-9-_])/g, '-') : targetId) : ''; } function getTargetSelector(targetId) { return '.target' + getTargetSelectorSuffix(targetId); diff --git a/c3.min.js b/c3.min.js index dfbdc55..58a7cf2 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,2 +1,2 @@ -!function(a){"use strict";function b(){function a(a,b){a.attr("transform",function(a){return"translate("+(b(a)+q)+", 0)"})}function b(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function c(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function d(a){for(var b=[],c=Math.ceil(a[0]);c0&&b[0]>0&&b.unshift(b[0]-(b[1]-b[0])),b}function e(a,b){var c=a.length-1;return p>=c||b%Math.ceil(c/p)===0}function f(a){return a0?a:320}function t(){return sd(ze.data.targets)?0:He?He:Wf||jg?1:v("y")}function u(){var a=1;return sd(ze.data.targets)?0:Ie?Ie:rh?Ze+(ng&&!Wf?v("y2"):a):ng?sg||Wf?a:v("y2"):a}function v(a){var b=fb(a);return b.isInner?20+yb(a):40+yb(a)}function w(a){var b=fb(a);return(b.isInner?30:40)+("y2"===a?-10:0)}function x(){return+g.select(Ee).style("width").replace("px","")}function y(){return+g.select(Ee).style("height").replace("px","")}function z(a){return a?-5:-(Pe.left-1)}function A(a){return a?-20:-1}function B(){return z(!Wf)}function C(){return A(!Wf)}function D(){return z(Wf)}function E(){return A(Wf)}function F(a){return a?Se+2+4:Pe.left+20}function G(a){return a?80:Ue+2}function H(){return F(!Wf)}function I(){return G(!Wf)}function J(){return F(Wf)}function K(){return G(Wf)}function L(){var a=Wf?Ue:Se,b=Sb(),c=nc();return c>1?a*b/(c-1):a}function M(a){sh=a}function N(a){th=a}function O(a){uh=a}function P(){return Sf?rh?th*(sh+1):We:0}function Q(){return Sf?rh?Xe:uh*(sh+1):0}function R(){var a,b,c=!of;ff=Wf?1:0,gf=Wf?Ue:Se,hf=Wf?0:Ue,jf=Wf?Se:1,kf=ff,lf=gf,mf=Wf?0:Ve,nf=Wf?Te:1,of=T(ff,gf,c?void 0:of.domain(),function(){return uf.tickOffset()}),pf=U(hf,jf),qf=U(hf,jf),rf=T(ff,gf,Jh,function(a){return a%1?0:xf.tickOffset()}),sf=U(mf,nf),tf=U(mf,nf),a=$(),b=_(),uf=X(of,mh,a,b),xf=X(rf,ph,a,b),vf=Y(pf,nh,kg,mg),wf=Y(qf,oh,tg,vg),c||(xh.scale(rf),Je&&Bh.scale(of)),S()}function S(){bf=Ab(),cf=Bb(),df=Bb(.98)}function T(a,b,c,f){var h=(eh?g.time.scale():g.scale.linear()).range([a,b]);if(h.orgDomain=function(){return h.domain()},e(c)&&h.domain(c),d(f)&&(f=function(){return 0}),fh){var i,j=h;h=function(a){return j(a)+f(a)};for(i in j)h[i]=j[i];h.orgDomain=function(){return j.domain()},h.domain=function(a){return arguments.length?(j.domain(a),h):(a=j.domain(),[a[0],a[1]+1])}}return h}function U(a,b){return g.scale.linear().range([a,b])}function V(a){return"y2"===Z(a)?qf:pf}function W(a){return"y2"===Z(a)?tf:sf}function X(a,c,d,e){var f=(fh?b():g.svg.axis()).scale(a).orient(c);return f.tickFormat(d).ticks(e),fh?f.tickCentered(Zf):f.tickOffset=function(){var a=Wf?Ue:Se;return a*Sb()/nc()/2},fh&&f.categories(Yf),f}function Y(a,b,c,d){return g.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function Z(a){return a in Ef?Ef[a]:"y"}function $(){var a=eh?lh:fh?wc:null;return $f&&("function"==typeof $f?a=$f:eh&&(a=function(a){return g.time.format($f)(a)})),a}function _(){var a=nc();return _f&&a>ag?ag:a}function ab(a){return"string"==typeof a?a:a?a.text:null}function bb(a,b){var c=a&&"object"==typeof a&&a.position?a.position:b;return{isInner:c.indexOf("inner")>=0,isOuter:c.indexOf("outer")>=0,isLeft:c.indexOf("left")>=0,isCenter:c.indexOf("center")>=0,isRight:c.indexOf("right")>=0,isTop:c.indexOf("top")>=0,isMiddle:c.indexOf("middle")>=0,isBottom:c.indexOf("bottom")>=0}}function cb(){return bb(eg,Wf?"inner-top":"inner-right")}function db(){return bb(ig,Wf?"inner-right":"inner-top")}function eb(){return bb(rg,Wf?"inner-right":"inner-top")}function fb(a){return"y2"===a?eb():"y"===a?db():cb()}function gb(){return ab(eg)}function hb(){return ab(ig)}function ib(){return ab(rg)}function jb(a,b){return a?b.isLeft?0:b.isCenter?Se/2:Se:b.isBottom?-Ue:b.isMiddle?-Ue/2:0}function kb(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function lb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function mb(){return jb(!Wf,cb())}function nb(){return jb(Wf,db())}function ob(){return jb(Wf,eb())}function pb(){return kb(!Wf,cb())}function qb(){return kb(Wf,db())}function rb(){return kb(Wf,eb())}function sb(){var a=cb();return Wf?a.isInner?"1.2em":-30-yb("x"):a.isInner?"-0.5em":"3em"}function tb(){var a=db();return Wf?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-yb("y")}function ub(){var a=eb();return Wf?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+yb("y2")}function vb(){return lb(!Wf,cb())}function wb(){return lb(Wf,db())}function xb(){return lb(Wf,eb())}function yb(a){var b=0;return g.selectAll("."+a+".axis .tick text").each(function(){var a=this.getBBox();b0)for(f=uc(a),b=0;ba?a:0}),c=1;c0||(h[d][b]+=+a)});return g.min(Object.keys(h).map(function(a){return g.min(h[a])}))}function Qb(a){var b,c,d,e,f,h=sc(a);if(Df.length>0)for(f=vc(a),b=0;b0?a:0}),c=1;c+a||(h[d][b]+=+a)});return g.max(Object.keys(h).map(function(a){return g.max(h[a])}))}function Rb(a){var b,d,e,f,g,h,i,j,k=rc(function(b){return Z(b.id)===a}),l="y2"===a?pg:gg,m="y2"===a?og:fg,n=c(l)?l:Pb(k),o=c(m)?m:Qb(k),p="y2"===a?qg:hg,q=Oc()&&Wf;return n===o&&(0>n?o=0:n=0),b=Math.abs(o-n),d=e=f=q?0:.1*b,p&&(g=Math.max(Math.abs(n),Math.abs(o)),o=g-p,n=p-g),"y"===a&&lg&&(e=c(lg.top)?lg.top:d,f=c(lg.bottom)?lg.bottom:d),"y2"===a&&ug&&(e=c(ug.top)?ug.top:d,f=c(ug.bottom)?ug.bottom:d),q&&(h=Pc(n,o),i=Xb(pf.range()),j=[h[0]/i,h[1]/i],e+=b*(j[1]/(1-j[0]-j[1])),f+=b*(j[0]/(1-j[0]-j[1]))),od(k)&&!uc(k)&&(f=n),[n-f,o+e]}function Sb(a){var b=Xb(Jh),c=Xb(of.domain());return a||0===c?1:b/c}function Tb(a){return cg?cg:g.min(a,function(a){return g.min(a.values,function(a){return a.x})})}function Ub(a){return bg?bg:g.max(a,function(a){return g.max(a.values,function(a){return a.x})})}function Vb(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return fh?d=0:od(a)?(c=nc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Wb(a){var b=[Tb(a),Ub(a)],c=b[0],d=b[1],e=Vb(a,b),f=eh?new Date(c.getTime()-e):c-e,g=eh?new Date(d.getTime()+e):d+e;return[f,g]}function Xb(a){return a[1]-a[0]}function Yb(a){for(var b=0;bd?0:d}function bc(a){return yf&&a===yf||zf&&Id(zf,a)}function cc(a){return!bc(a)}function dc(a){return yf?yf:zf?zf[a]:null}function ec(a,b){return a in ze.data.x&&ze.data.x[a]&&ze.data.x[a][b]?ze.data.x[a][b]:b}function fc(a){Object.keys(a).forEach(function(b){zf[b]=a[b]})}function gc(a){var b;return a&&(b=Cf[a.id],a.name=b?b:a.id),a}function hc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?b.map(function(a){return a[c]}):ze.data.x[Object.keys(ze.data.x)[0]]}),c=d.map(function(a){var c=Bf(a);return{id:c,id_org:a,values:b.map(function(b,d){var e,f=dc(a);return e=eh?b[f]instanceof Date?b[f]:Ed(b[f]):gh?b[f]?+b[f]:ec(a,d):d,b.x=e,{x:e,value:null===b[a]||isNaN(b[a])?null:+b[a],id:c}})}}),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++})}),Ff&&md(pc(c).filter(function(a){return!(a in Gf)}),Ff),c.forEach(function(a){Zb(a.id_org,a)}),c)}function kc(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 lc(a){return a>0&&ze.data.targets[0].values[a-1]?ze.data.targets[0].values[a-1].x:void 0}function mc(a){return a1?ze.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?ze.data.targets[0]:null,a}function pc(a){return a=d(a)?ze.data.targets:a,a.map(function(a){return a.id})}function qc(a){var b,c=pc();for(b=0;ba})}function vc(a){return tc(a,function(a){return a>0})}function wc(a){return a=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?g=h:f=h,g-f===1?(e=[],a[f].x&&(e=e.concat(Wc(a,f))),a[g].x&&(e=e.concat(Wc(a,g))),Zc(e,b)):Xc(a,b,f,g)}function Yc(a,b){var c;return c=a.map(function(a){return Xc(a.values,b)}),Zc(c,b)}function Zc(a,b){var c,d;return a.forEach(function(a){var e=Jd(a,b);(c>e||!c)&&(c=e,d=a)}),d}function $c(){return If&&"desc"===If.toLowerCase()}function _c(){return If&&"asc"===If.toLowerCase()}function ad(a){var b=_c(),c=$c();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 If&&a.sort(If),a}function bd(a,b){var d,e,f,g,h,i,j,k=sd(ze.data.targets),l=k?Vc:Uc,m=a.filter(function(a){return a&&c(a.value)});Xg&&0!==m.length&&(Hh.html($g(a,$(),l,kh)).style("visibility","hidden").style("display","block"),d=Hh.property("offsetWidth"),e=Hh.property("offsetHeight"),k?(g=Se/2+b[0],i=Ue/2+b[1]+20):(Wf?(f=q(),g=f+b[0]+100,h=g+d,j=r()-u(),i=of(m[0].x)+20):(f=q(),g=f+t()+of(m[0].x)+20,h=g+d,j=f+r()-u(),i=b[1]+15),h>j&&(g-=d+60),i+e>s()&&(i-=e+30)),Hh.style("top",i+"px").style("left",g+"px").style("visibility","visible"))}function cd(){Hh.style("display","none")}function dd(a){var b=a.filter(function(a){return a&&c(a.value)});Xg&&(pd(ze.data.targets)||sd(ze.data.targets)||Eh.selectAll("line.xgrid-focus").style("visibility","visible").data([b[0]]).attr(Wf?"y1":"x1",Qc).attr(Wf?"y2":"x2",Qc))}function ed(){Eh.select("line.xgrid-focus").style("visibility","hidden")}function fd(a){return a.x||0===a.x?of(a.x):null}function gd(a){return V(a.id)(a.value)}function hd(){var a,b,c={},e=0;return rc(vd).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function ld(a,b){return b?2*a.tickOffset()*.6/b:0}function md(a,b){var c=d(a)?pc():a;"string"==typeof c&&(c=[c]);for(var e=0;e0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function ae(a,b,c,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(e(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function be(b){var c,d,e;if(Ih=g.select(Ee),Ih.empty())return void a.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(Ih.html(""),ze.data.x={},ze.data.targets=jc(b),o(),R(),of.domain(g.extent(Wb(ze.data.targets))),pf.domain(Rb("y")),qf.domain(Rb("y2")),rf.domain(of.domain()),sf.domain(pf.domain()),tf.domain(qf.domain()),Jh=of.domain(),xh.scale(rf),Je&&Bh.scale(of),Ch=g.select(Ee).append("svg").attr("width",Se+Pe.left+Pe.right).attr("height",Ue+Pe.top+Pe.bottom).on("mouseenter",Me).on("mouseleave",Ne),Dh=Ch.append("defs"),Dh.append("clipPath").attr("id",ch).append("rect").attr("width",Se).attr("height",Ue),Dh.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),Dh.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),Eh=Ch.append("g").attr("transform",qh.main),Fh=Pf?Ch.append("g").attr("transform",qh.context):null,Gh=Sf?Ch.append("g").attr("transform",qh.legend):null,Hh=g.select(Ee).style("position","relative").append("div").style("position","absolute").style("z-index","10").style("display","none"),Eh.append("g").attr("class","x axis").attr("clip-path",Wf?"":j("xaxis-clip")).attr("transform",qh.x).append("text").attr("class","-axis-x-label").attr("transform",Wf?"rotate(-90)":"").attr("dx",pb).attr("dy",sb).style("text-anchor",vb).text(gb),Eh.append("g").attr("class","y axis").attr("clip-path",Wf?j("yaxis-clip"):"").append("text").attr("class","-axis-y-label").attr("transform",Wf?"":"rotate(-90)").attr("dx",qb).attr("dy",tb).style("text-anchor",wb).text(hb),ng&&Eh.append("g").attr("class","y2 axis").attr("transform",qh.y2).append("text").attr("class","-axis-y2-label").attr("transform",Wf?"":"rotate(-90)").attr("dx",rb).style("text-anchor",xb).text(ib),d=Eh.append("g").attr("clip-path",dh).attr("class","grid"),wg&&d.append("g").attr("class","xgrids"),yg&&d.append("g").attr("class","xgrid-lines"),Eg&&d.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",Wf?0:-10).attr("x2",Wf?Se:-10).attr("y1",Wf?-10:Pe.top).attr("y2",Wf?-10:Ue),zg&&d.append("g").attr("class","ygrids"),Ag&&d.append("g").attr("class","ygrid-lines"),Eh.append("g").attr("clip-path",dh).attr("class","regions"),Eh.append("g").attr("clip-path",dh).attr("class","chart"),c=Eh.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",Je?Wf?"ns-resize":"ew-resize":null),Eh.select(".chart").append("g").attr("class","chart-bars"),Eh.select(".chart").append("g").attr("class","chart-lines"),Eh.select(".chart").append("g").attr("class","chart-arcs").attr("transform",qh.arc).append("text").attr("class","chart-arcs-title").style("text-anchor","middle").text(Lb()),Eh.select(".chart").append("g").attr("class","chart-texts"),Je&&Eh.insert("rect",Le?null:"g.grid").attr("class","zoom-rect").attr("width",Se).attr("height",Ue).style("opacity",0).style("cursor",Wf?"ns-resize":"ew-resize").call(Bh).on("dblclick.zoom",null),null!==dg&&xh.extent("function"!=typeof dg?dg:dg(Wb())),Pf&&(Fh.append("g").attr("clip-path",dh).attr("class","chart"),Fh.select(".chart").append("g").attr("class","chart-bars"),Fh.select(".chart").append("g").attr("class","chart-lines"),Fh.append("g").attr("clip-path",dh).attr("class","x brush").call(xh).selectAll("rect").attr(Wf?"width":"height",Wf?Te:Ve),Fh.append("g").attr("class","x axis").attr("transform",qh.subx).attr("clip-path",Wf?j("yaxis-clip"):"")),oe(ze.data.targets),Wf?Eh.select(".x.axis").style("opacity",0).call(uf):(Eh.select(".y.axis").style("opacity",0).call(vf),Eh.select(".y2.axis").style("opacity",0).call(wf)),ne({withTransform:!0,withLegend:!0,durationForAxis:0}),_g){if(eh&&"string"==typeof ah){for(ah=Ed(ah),e=0;e0){d=[];for(var f in Cf)for(c=0;cf&&h>c&&d>i&&j>d):"rect"===this.nodeName&&(c=1*l.attr("x"),d=1*l.attr("y"),e=1*l.attr("width"),k=Pd,o=c+e>f&&h>c&&j>d),o^n&&(l.classed(De,!n),l.classed(Ce,!m),k(!m,l,a,b))}))}function ge(a){sd(ze.data.targets)||Lf&&(hh=a,Eh.select(".chart").append("rect").attr("class","dragarea").style("opacity",.1),ih=!0)}function he(){sd(ze.data.targets)||Lf&&(Eh.select(".dragarea").transition().duration(100).style("opacity",0).remove(),Eh.selectAll(".-shape").classed(De,!1),ih=!1)}function ie(a){var b,d,f,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I=hd(),J=sd(ze.data.targets);if(a=e(a)?a:{},u=e(a.withY)?a.withY:!0,v=e(a.withSubchart)?a.withSubchart:!0,w=e(a.withTransition)?a.withTransition:!0,x=e(a.withTransform)?a.withTransform:!1,y=e(a.withUpdateXDomain)?a.withUpdateXDomain:!1,z=e(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,A=e(a.withLegend)?a.withLegend:!1,F=w?Oe:0,G=e(a.durationForExit)?a.durationForExit:F,H=e(a.durationForAxis)?a.durationForAxis:F,A&&Sf&&te(ze.data.targets,a),z&&(of.domain(g.extent(Wb(ze.data.targets))),Jh=of.domain(),Je&&Bh.scale(of).updateScaleExtent(),rf.domain(of.domain()),xh.scale(rf)),y&&(of.domain(xh.empty()?Jh:xh.extent()),Je&&Bh.scale(of).updateScaleExtent()),pf.domain(Rb("y")),qf.domain(Rb("y2")),Eh.select(".x.axis").style("opacity",J?0:1).transition().duration(H).call(uf),Eh.select(".y.axis").style("opacity",J?0:1).transition().duration(H).call(vf),Eh.select(".y2.axis").style("opacity",J?0:1).transition().duration(H).call(wf),B=Xd(I),D=Yd(I,!0),E=Yd(I,!1),Eh.select(".x.axis .-axis-x-label").attr("x",mb),Eh.select(".y.axis .-axis-y-label").attr("x",nb).attr("dy",tb),Eh.select(".y2.axis .-axis-y2-label").attr("x",ob).attr("dy",ub),sf.domain(pf.domain()),tf.domain(qf.domain()),Hh.style("display","none"),Eh.select("line.xgrid-focus").style("visibility","hidden").attr("y2",Ue),wg){if("year"===xg){d=[]; -for(var K=Wb(),M=K[0].getFullYear(),N=K[1].getFullYear(),O=M;N>=O;O++)d.push(new Date(O+"-01-01 00:00:00"))}else d=of.ticks(10);b=Eh.select(".xgrids").selectAll(".xgrid").data(d),b.enter().append("line").attr("class","xgrid"),b.attr("x1",Wf?0:function(a){return of(a)-uf.tickOffset()}).attr("x2",Wf?Se:function(a){return of(a)-uf.tickOffset()}).attr("y1",Wf?function(a){return of(a)-uf.tickOffset()}:Pe.top).attr("y2",Wf?function(a){return of(a)-uf.tickOffset()}:Ue).style("opacity",function(){return+g.select(this).attr(Wf?"y1":"x1")===(Wf?Ue:0)?0:1}),b.exit().remove()}yg&&(f=Eh.select(".xgrid-lines").selectAll(".xgrid-line").data(yg),h=f.enter().append("g").attr("class",function(a){return"xgrid-line xgrid-line-"+(a["class"]?a["class"]:"")}),h.append("line").style("opacity",0),h.append("text").attr("text-anchor","end").attr("transform",Wf?"":"rotate(-90)").attr("dx",Wf?0:-Pe.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(F).attr("x1",Wf?0:Rc).attr("x2",Wf?Se:Rc).attr("y1",Wf?Rc:Pe.top).attr("y2",Wf?Rc:Ue).style("opacity",1),f.select("text").transition().duration(F).attr("x",Wf?Se:0).attr("y",Rc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(F).style("opacity",0).remove()),u&&zg&&(i=Eh.select(".ygrids").selectAll(".ygrid").data(pf.ticks(Bg)),i.enter().append("line").attr("class","ygrid"),i.attr("x1",Wf?pf:0).attr("x2",Wf?pf:Se).attr("y1",Wf?0:pf).attr("y2",Wf?Ue:pf),i.exit().remove()),u&&Ag&&(j=Eh.select(".ygrid-lines").selectAll(".ygrid-line").data(Ag),k=j.enter().append("g").attr("class",function(a){return"ygrid-line ygrid-line-"+(a.class?a.class:"")}),k.append("line").style("opacity",0),k.append("text").attr("text-anchor","end").attr("transform",Wf?"rotate(-90)":"").attr("dx",Wf?0:-Pe.top).attr("dy",-5).style("opacity",0),j.select("line").transition().duration(F).attr("x1",Wf?Sc:0).attr("x2",Wf?Sc:Se).attr("y1",Wf?0:Sc).attr("y2",Wf?Ue:Sc).style("opacity",1),j.select("text").transition().duration(F).attr("x",Wf?0:Se).attr("y",Sc).text(function(a){return a.text}).style("opacity",1),j.exit().transition().duration(F).style("opacity",0).remove()),m=Eh.selectAll(".-bars").selectAll(".-bar").data(Ad),m.enter().append("path").attr("d",B).style("stroke","none").style("opacity",0).style("fill",function(a){return kh(a.id)}).attr("class",Hc),m.style("opacity",Kc).transition().duration(F).attr("d",B).style("opacity",1),m.exit().transition().duration(G).style("opacity",0).remove(),o=Eh.selectAll(".-texts").selectAll(".-text").data(Cd),o.enter().append("text").attr("class",xc).attr("text-anchor",function(a){return Wf?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return Uc(a.value)}),o.style("fill-opacity",Lc).transition().duration(F).attr("x",D).attr("y",E).style("fill-opacity",Nc),o.exit().transition().duration(G).style("fill-opacity",0).remove(),Eh.selectAll(".-line").style("opacity",Kc).transition().duration(F).attr("d",yh).style("opacity",1),Eh.selectAll(".-area").style("opacity",0).transition().duration(F).attr("d",zh).style("opacity",Kh),l=Eh.selectAll(".-circles").selectAll(".-circle").data(Bd),l.enter().append("circle").attr("class",Gc).style("opacity",0).attr("r",Dg),l.style("opacity",Kc).transition().duration(F).style("opacity",Mc).attr("cx",Wf?gd:fd).attr("cy",Wf?fd:gd),l.exit().remove(),Eh.selectAll(".chart-arc").select(".-arc").attr("transform",x?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(F).attrTween("d",function(a){var b=zb(a);if(!b)return function(){return"M 0 0"};var c=g.interpolate(this._current,b);return this._current=c(0),function(a){return Cb(c(a),!0)}}).attr("transform",x?"scale(1)":"").style("opacity",1),Eh.selectAll(".chart-arc").select("text").attr("transform",Db).style("opacity",0).transition().duration(F).text(Gb).style("opacity",function(a){return zd(a.data)?1:0}),Eh.select(".chart-arcs-title").style("opacity",rd(ze.data.targets)?1:0),Pf&&(null!==g.event&&"zoom"===g.event.type&&xh.extent(of.orgDomain()).update(),v&&(Fh.select(".x.axis").style("opacity",J?0:1).transition().duration(F).call(xf),xh.empty()||xh.extent(of.orgDomain()).update(),C=Xd(I,!0),p=Fh.selectAll(".-bars").selectAll(".-bar").data(Ad),p.enter().append("path").attr("d",C).style("stroke","none").style("fill",function(a){return kh(a.id)}).attr("class",Hc),p.style("opacity",Kc).transition().duration(F).attr("d",C).style("opacity",1),p.exit().transition().duration(F).style("opacity",0).remove(),Fh.selectAll(".-line").style("opacity",Kc).transition().duration(F).attr("d",Ah).style("opacity",1))),Eh.selectAll(".selected-circles").filter(function(a){return vd(a)}).selectAll("circle").remove(),Eh.selectAll(".selected-circle").transition().duration(F).attr("cx",Wf?gd:fd).attr("cy",Wf?fd:gd),zf?(q=Eh.select(".event-rects").selectAll(".event-rect").data([0]),de(q.enter()),q.attr("x",0).attr("y",0).attr("width",Se).attr("height",Ue)):(gh?(t=function(a,b){var c=lc(b),d=mc(b);return(of(d?d:a.x+50)-of(c?c:a.x-50))/2},s=function(a,b){var c=lc(b);return(of(a.x)+of(c?c:a.x-50))/2}):(t=L(),s=function(a){return of(a.x)-t/2}),r=oc(),Eh.select(".event-rects").datum(r?r.values:[]),q=Eh.select(".event-rects").selectAll(".event-rect").data(function(a){return a}),ce(q.enter()),q.attr("class",Jc).attr("x",Wf?0:s).attr("y",Wf?s:0).attr("width",Wf?Se:t).attr("height",Wf?t:Ue),q.exit().remove()),n=Eh.select(".regions").selectAll("rect.region").data(Wg),n.enter().append("rect").style("fill-opacity",0),n.attr("class",Ic).attr("x",Wf?0:_b).attr("y",Wf?_b:Pe.top).attr("width",Wf?Se:ac).attr("height",Wf?ac:Ue).transition().duration(F).style("fill-opacity",function(a){return c(a.opacity)?a.opacity:.1}),n.exit().transition().duration(F).style("fill-opacity",0).remove(),pc().forEach(function(a){Lh[a]=!0})}function je(){ie({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function ke(){return"mousemove"===g.event.sourceEvent.type&&Bh.altDomain?(of.domain(Bh.altDomain),void Bh.scale(of).updateScaleExtent()):(fh&&of.orgDomain()[0]===Jh[0]&&of.domain([Jh[0]-1e-10,of.orgDomain()[1]]),ie({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===g.event.sourceEvent.type&&(jh=!0)))}function le(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function me(){Ch.attr("width",We).attr("height",Xe),Ch.select("#"+ch).select("rect").attr("width",Se).attr("height",Ue),Ch.select("#xaxis-clip").select("rect").attr("width",H),Ch.select("#yaxis-clip").select("rect").attr("width",J),Ch.select(".zoom-rect").attr("width",Se).attr("height",Ue)}function ne(a){a=e(a)?a:{},a.withTransition=e(a.withTransition)?a.withTransition:!0,a.withTransform=e(a.withTransform)?a.withTransform:!1,a.withLegend=e(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.durationForExit=0,o(),R(),me(),n(a.withTransition),ie(a)}function oe(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=Eh.select(".chart-texts").selectAll(".chart-text").data(a),j=i.enter().append("g").attr("class",function(a){return"chart-text target target-"+a.id}).style("pointer-events","none"),j.append("g").attr("class",yc).style("fill",function(a){return kh(a.id)}),e=Eh.select(".chart-bars").selectAll(".chart-bar").data(a),d=e.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}).style("pointer-events","none"),d.append("g").attr("class",Cc).style("fill",function(a){return kh(a.id)}).style("stroke","none").style("cursor",function(a){return Nf(a)?"pointer":null}),c=Eh.select(".chart-lines").selectAll(".chart-line").data(a),b=c.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}).style("pointer-events","none"),b.append("path").attr("class",Ac).style("opacity",0).style("stroke",function(a){return kh(a.id)}),b.append("path").attr("class",Ec).style("opacity",function(){return Kh=+g.select(this).style("opacity"),0}).style("fill",function(a){return kh(a.id)}),b.append("g").attr("class",function(a){return"selected-circles selected-circles-"+a.id}),b.append("g").attr("class",Bc).style("fill",function(a){return kh(a.id)}).style("cursor",function(a){return Nf(a)?"pointer":null}),a.forEach(function(a){var b=ue(a.id);Eh.selectAll(".selected-circles"+b).selectAll(".selected-circle").each(function(b){b.value=a.values[b.x].value})}),h=Eh.select(".chart-arcs").selectAll(".chart-arc").data(ef(a)),f=h.enter().append("g").attr("class",function(a){return"chart-arc target target-"+a.data.id}),f.append("path").attr("class",Dc).style("opacity",0).style("fill",function(a){return kh(a.data.id)}).style("cursor",function(a){return Nf(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){var c=Fb(a),d=Nb();Hb(a.data.id),qe(a.data.id),d(c,b)}).on("mousemove",function(a){var b=[Fb(a)];bd(b,g.mouse(this))}).on("mouseout",function(a,b){var c=Fb(a),d=Ob();Ib(a.data.id),se(),cd(),d(c,b)}).on("click",function(a,b){var c=Fb(a),d=Mb();d(c,b)}),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),Pf&&(n=Fh.select(".chart-bars").selectAll(".chart-bar").data(a),m=n.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}),m.append("g").attr("class",Cc).style("fill",function(a){return kh(a.id)}),l=Fh.select(".chart-lines").selectAll(".chart-line").data(a),k=l.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}),k.append("path").attr("class",Ac).style("opacity",0).style("stroke",function(a){return kh(a.id)})),Ch.selectAll(".target").transition().style("opacity",1)}function pe(a,b){ze.data.targets.forEach(function(b){for(var c=0;ce&&(e=(k-j)/2,v=0,B++)),A[a]=B,z[B]=e,w[a]=v,v+=j}var e,f,g=a.getBBox(),h=10*Math.ceil((g.width+r)/10),i=10*Math.ceil((g.height+q)/10),j=rh?i:h,k=rh?Ye:Ze;c&&(v=0,B=0,s=0,t=0),x[b]=h,y[b]=i,(!s||h>=s)&&(s=h),(!t||i>=t)&&(t=i),f=rh?t:s,Vf?(Object.keys(x).forEach(function(a){x[a]=s}),Object.keys(y).forEach(function(a){y[a]=t}),e=(k-f*p.length)/2,u>e?(v=0,B=0,p.forEach(function(a){d(a)})):d(b,!0)):d(b)}var f,g,h,i,j,k,l,m,p=pc(a),q=4,r=26,s=0,t=0,u=10,v=0,w={},x={},y={},z={},A={},B=0;b=d(b)?{}:b,m=e(b.withTransition)?b.withTransition:!0,rh?(g=function(a){return s*(.2+A[a])},j=function(a){return z[A[a]]+w[a]}):(g=function(a){return z[A[a]]+w[a]},j=function(a){return t*(.2+A[a])}),h=function(a,b){return g(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return g(a,b)-4},l=function(a,b){return j(a,b)-7},f=Gh.selectAll(".legend-item").data(p).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+a}).style("cursor","pointer").on("click",function(a){Uf(a)}).on("mouseover",function(a){ze.focus(a)}).on("mouseout",function(){ze.revert()}),f.append("text").text(function(a){return e(Cf[a])?Cf[a]:a}).each(function(a,b){c(this,a,0===b)}).style("pointer-events","none").attr("x",rh?h:-200).attr("y",rh?-200:k),f.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",rh?i:-200).attr("y",rh?-200:l).attr("width",function(a){return x[a]}).attr("height",function(a){return y[a]}),f.append("rect").attr("class","legend-item-tile").style("pointer-events","none").style("fill",function(a){return kh(a)}).attr("x",rh?h:-200).attr("y",rh?-200:j).attr("width",10).attr("height",10),Gh.selectAll("text").data(p).each(function(a,b){c(this,a,0===b)}).transition().duration(m?250:0).attr("x",h).attr("y",k),Gh.selectAll("rect.legend-item-event").data(p).transition().duration(m?250:0).attr("x",i).attr("y",l),Gh.selectAll("rect.legend-item-tile").data(p).transition().duration(m?250:0).attr("x",g).attr("y",j),N(s),O(t),M(B),o(),R(),me(),n(!1)}function ue(a){return a?"-"+a.replace(/\./g,"\\."):""}function ve(a){return".target"+ue(a)}function we(a){return qc(a.id)}function xe(a){return"data"in a&&qc(a.data.id)}function ye(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}var ze={data:{}},Ae={},Be="_expanded_",Ce="_selected_",De="_included_",Ee=i(["bindto"],"#chart"),Fe=i(["size","width"],null),Ge=i(["size","height"],null),He=i(["padding","left"],null),Ie=i(["padding","right"],null),Je=i(["zoom","enabled"],!1),Ke=i(["zoom","extent"],null),Le=i(["zoom","privileged"],!1),Me=i(["onenter"],function(){}),Ne=i(["onleave"],function(){}),Oe=i(["transition","duration"],350);h("data","data is required in config");var Pe,Qe,Re,Se,Te,Ue,Ve,We,Xe,Ye,Ze,$e,_e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,xf,yf=i(["data","x"],null),zf=i(["data","xs"],null),Af=i(["data","x_format"],"%Y-%m-%d"),Bf=i(["data","id_converter"],function(a){return a}),Cf=i(["data","names"],{}),Df=i(["data","groups"],[]),Ef=i(["data","axes"],{}),Ff=i(["data","type"],null),Gf=i(["data","types"],{}),Hf=i(["data","labels"],{}),If=i(["data","order"],null),Jf=i(["data","regions"],{}),Kf=i(["data","colors"],{}),Lf=i(["data","selection","enabled"],!1),Mf=i(["data","selection","grouped"],!1),Nf=i(["data","selection","isselectable"],function(){return!0}),Of=i(["data","selection","multiple"],!0),Pf=i(["subchart","show"],!1),Qf=Pf?i(["subchart","size","height"],60):0,Rf=i(["color","pattern"],null),Sf=i(["legend","show"],!0),Tf=i(["legend","position"],"bottom"),Uf=i(["legend","item","onclick"],function(){}),Vf=i(["legend","equally"],!1),Wf=i(["axis","rotated"],!1),Xf=i(["axis","x","type"],"indexed"),Yf=i(["axis","x","categories"],[]),Zf=i(["axis","x","tick","centered"],!1),$f=i(["axis","x","tick","format"],null),_f=i(["axis","x","tick","culling"],"categorized"===Xf?!1:!0),ag=i(["axis","x","tick","count"],10),bg=i(["axis","x","max"],null),cg=i(["axis","x","min"],null),dg=i(["axis","x","default"],null),eg=i(["axis","x","label"],null),fg=i(["axis","y","max"],null),gg=i(["axis","y","min"],null),hg=i(["axis","y","center"],null),ig=i(["axis","y","label"],null),jg=i(["axis","y","inner"],!1),kg=i(["axis","y","tick","format"],null),lg=i(["axis","y","padding"],null),mg=i(["axis","y","ticks"],10),ng=i(["axis","y2","show"],!1),og=i(["axis","y2","max"],null),pg=i(["axis","y2","min"],null),qg=i(["axis","y2","center"],null),rg=i(["axis","y2","label"],null),sg=i(["axis","y2","inner"],!1),tg=i(["axis","y2","tick","format"],null),ug=i(["axis","y2","padding"],null),vg=i(["axis","y2","ticks"],10),wg=i(["grid","x","show"],!1),xg=i(["grid","x","type"],"tick"),yg=i(["grid","x","lines"],null),zg=i(["grid","y","show"],!1),Ag=i(["grid","y","lines"],null),Bg=i(["grid","y","ticks"],10),Cg=i(["point","show"],!0),Dg=Cg?i(["point","r"],2.5):0,Eg=i(["point","focus","line","enabled"],!0),Fg=i(["point","focus","expand","enabled"],!0),Gg=i(["point","focus","expand","r"],Fg?4:Dg),Hg=i(["point","focus","select","r"],8),Ig=i(["point","onclick"],function(){}),Jg=i(["point","onselected"],function(){}),Kg=i(["point","onunselected"],function(){}),Lg=i(["pie","label","show"],!0),Mg=i(["pie","label","format"],null),Ng=i(["pie","onclick"],function(){}),Og=i(["pie","onmouseover"],function(){}),Pg=i(["pie","onmouseout"],function(){}),Qg=i(["donut","label","show"],!0),Rg=i(["donut","label","format"],null),Sg=i(["donut","title"],""),Tg=i(["donut","onclick"],function(){}),Ug=i(["donut","onmouseover"],function(){}),Vg=i(["donut","onmouseout"],function(){}),Wg=i(["regions"],[]),Xg=i(["tooltip","show"],!0),Yg=i(["tooltip","format","title"],null),Zg=i(["tooltip","format","value"],null),$g=i(["tooltip","contents"],function(a,b,c,d){var e,f,g,h,i,j=Yg?Yg:b,k=Zg?Zg:c;for(f=0;f"+(g||0===g?""+g+"":"")),i=a[f].name,h=k(a[f].value,a[f].ratio),e+=""+i+""+h+"");return e+""}),_g=i(["tooltip","init","show"],!1),ah=i(["tooltip","init","x"],0),bh=i(["tooltip","init","position"],{top:"0px",left:"50px"}),ch=Ee.replace("#","")+"-clip",dh=j(ch),eh="timeseries"===Xf,fh="categorized"===Xf,gh=!eh&&(yf||zf),hh=null,ih=!1,jh=!1,kh=Dd(Kf,Rf),lh=function(){var a=[[g.time.format("%Y/%-m/%-d"),function(){return!0}],[g.time.format("%-m/%-d"),function(a){return a.getMonth()}],[g.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[g.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[g.time.format("%I %p"),function(a){return a.getHours()}],[g.time.format("%I:%M"),function(a){return a.getMinutes()}],[g.time.format(":%S"),function(a){return a.getSeconds()}],[g.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),mh=Wf?"left":"bottom",nh=Wf?jg?"top":"bottom":jg?"right":"left",oh=Wf?sg?"bottom":"top":sg?"left":"right",ph=Wf?"left":"bottom",qh={main:function(){return"translate("+Pe.left+","+Pe.top+")"},context:function(){return"translate("+Qe.left+","+Qe.top+")"},legend:function(){return"translate("+Re.left+","+Re.top+")"},x:function(){return"translate(0,"+(Wf?0:Ue)+")"},y:function(){return"translate(0,"+(Wf?Ue:0)+")"},y2:function(){return"translate("+(Wf?0:Se)+","+(Wf?1:0)+")"},subx:function(){return"translate(0,"+(Wf?0:Ve)+")"},arc:function(){return"translate("+Se/2+","+Ue/2+")"}},rh="right"===Tf,sh=0,th=0,uh=0,vh=40,wh=20;ef=g.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var xh,yh=function(){var a=g.svg.line().x(Wf?function(a){return V(a.id)(a.value)}:Qc).y(Wf?Qc:function(a){return V(a.id)(a.value)});return function(b){var c,d,e=Qd(b.values);return td(b)?(a.interpolate(ud(b)?"cardinal":"linear"),Jf[b.id]?ae(e,of,V(b.id),Jf[b.id]):a(e)):(c=of(e[0].x),d=V(b.id)(e[0].value),Wf?"M "+d+" "+c:"M "+c+" "+d)}}(),zh=function(){var a;return a=Wf?g.svg.area().x0(function(a){return V(a.id)(0)}).x1(function(a){return V(a.id)(a.value)}).y(Qc):g.svg.area().x(Qc).y0(function(a){return V(a.id)(0)}).y1(function(a){return V(a.id)(a.value)}),function(b){var c,d,e=Qd(b.values);return nd([b],"area")||nd([b],"area-spline")?(a.interpolate(ud(b)?"cardinal":"linear"),a(e)):(c=of(e[0].x),d=V(b.id)(e[0].value),Wf?"M "+d+" "+c:"M "+c+" "+d)}}(),Ah=function(){var a=g.svg.line().x(Wf?function(a){return W(a.id)(a.value)}:Tc).y(Wf?Tc:function(a){return W(a.id)(a.value)});return function(b){var c=Qd(b.values);return td(b)?a(c):"M "+rf(c[0].x)+" "+W(b.id)(c[0].value)}}(),Bh=function(){};xh=g.svg.brush().on("brush",je),xh.update=function(){return Fh&&Fh.select(".x.brush").call(this),this},xh.scale=function(a){return Wf?this.y(a):this.x(a)},Je&&(Bh=g.behavior.zoom().on("zoomstart",function(){Bh.altDomain=g.event.sourceEvent.altKey?of.orgDomain():null}).on("zoom",Je?ke:null),Bh.scale=function(a){return Wf?this.y(a):this.x(a)},Bh.orgScaleExtent=function(){var a=Ke?Ke:[1,10];return[a[0],Math.max(nc()/a[1],a[1])]},Bh.updateScaleExtent=function(){var a=Xb(of.orgDomain())/Xb(Jh),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Ch,Dh,Eh,Fh,Gh,Hh,Ih,Jh,Kh,Lh={};if(ze.focus=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=Ch.selectAll(ve(a)),d=c.filter(we),e=c.filter(xe);ze.revert(),ze.defocus(),b(d.classed("focused",!0)),b(e),sd(ze.data.targets)&&Hb(a,!0),qe(a)},ze.defocus=function(a){function b(a){a.transition().duration(100).style("opacity",.3)}var c=Ch.selectAll(ve(a)),d=c.filter(we),e=c.filter(xe);ze.revert(),b(d.classed("focused",!1)),b(e),sd(ze.data.targets)&&Ib(a),re(a)},ze.revert=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=Ch.selectAll(ve(a)),d=c.filter(we),e=c.filter(xe);b(d.classed("focused",!1)),b(e),sd(ze.data.targets)&&Ib(a),se()},ze.show=function(a){Ch.selectAll(ve(a)).transition().style("opacity",1)},ze.hide=function(a){Ch.selectAll(ve(a)).transition().style("opacity",0)},ze.unzoom=function(){xh.clear().update(),ie({withUpdateXDomain:!0})},ze.load=function(a){if("function"!=typeof a.done&&(a.done=function(){}),a.xs&&fc(a.xs),"categories"in a&&fh&&(Yf=a.categories,uf.categories(Yf)),"cacheIds"in a&&Yb(a.cacheIds))return void pe($b(a.cacheIds),a.done);if("data"in a)pe(jc(a.data),a.done);else if("url"in a)g.csv(a.url,function(b,c){pe(jc(c),a.done)});else if("rows"in a)pe(jc(hc(a.rows)),a.done);else{if(!("columns"in a))throw Error("url or rows or columns is required.");pe(jc(ic(a.columns)),a.done)}},ze.unload=function(a){ze.data.targets=ze.data.targets.filter(function(b){return b.id!==a}),Ch.selectAll(ve(a)).transition().style("opacity",0).remove(),Sf&&Gh.selectAll(".legend-item"+ue(a)).remove(),ze.data.targets.length>0&&ie({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},ze.selected=function(a){var b=ue(a);return g.merge(Eh.selectAll(".-shapes"+b).selectAll(".-shape").filter(function(){return g.select(this).classed(Ce)}).map(function(a){return a.map(function(a){return a.__data__})}))},ze.select=function(a,b,c){Lf&&Eh.selectAll(".-shapes").selectAll(".-shape").each(function(d,f){var h="circle"===this.nodeName?Kd:Nd,i="circle"===this.nodeName?Ld:Od,j=Mf||!a||a.indexOf(d.id)>=0,k=!b||b.indexOf(f)>=0;j&&k?Nf(d)&&h(g.select(this).classed(Ce,!0),d,f):e(c)&&c&&i(g.select(this).classed(Ce,!1),d,f)})},ze.unselect=function(a,b){Lf&&Eh.selectAll(".-shapes").selectAll(".-shape").each(function(c,d){var e="circle"===this.nodeName?Ld:Od,f=Mf||!a||a.indexOf(c.id)>=0,h=!b||b.indexOf(d)>=0;f&&h&&Nf(c)&&e(g.select(this).classed(Ce,!1),c,d)})},ze.toLine=function(a){md(a,"line"),ne()},ze.toSpline=function(a){md(a,"spline"),ne()},ze.toBar=function(a){md(a,"bar"),ne()},ze.toScatter=function(a){md(a,"scatter"),ne()},ze.toArea=function(a){md(a,"area"),ne()},ze.toAreaSpline=function(a){md(a,"area-spline"),ne()},ze.toPie=function(a){md(a,"pie"),ne({withTransform:!0})},ze.toDonut=function(a){md(a,"donut"),ne({withTransform:!0})},ze.groups=function(a){return d(a)?Df:(Df=a,ie(),Df)},ze.xgrids=function(a){return a?(yg=a,ie(),yg):yg},ze.xgrids.add=function(a){return a?ze.xgrids(yg.concat(a)):void 0},ze.xgrids.remove=function(a){var b=ye(a);return ze.xgrids(yg.filter(b))},ze.ygrids=function(a){return a?(Ag=a,ie(),Ag):Ag},ze.ygrids.add=function(a){return a?ze.ygrids(Ag.concat(a)):void 0},ze.ygrids.remove=function(a){var b=ye(a);return ze.ygrids(Ag.filter(b))},ze.regions=function(a){return d(a)?Wg:(Wg=a,ie(),Wg)},ze.regions.add=function(a){return d(a)?Wg:(Wg=Wg.concat(a),ie(),Wg)},ze.regions.remove=function(a,b){var d=[].concat(a);return b=e(b)?b:{},d.forEach(function(a){var d=c(b.duration)?b.duration:0;Ch.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),Wg=Wg.filter(function(b){return b.classes.indexOf(a)<0})}),Wg},ze.data.get=function(a){var b=ze.data.getAsTarget(a);return e(b)?b.values.map(function(a){return a.value}):void 0},ze.data.getAsTarget=function(a){var b=rc(function(b){return b.id===a});return b.length>0?b[0]:void 0},ze.resize=function(a){Fe=a?a.width:null,Ge=a?a.height:null,ne({withLegend:!0,withTransition:!1})},ze.destroy=function(){ze.data.targets=void 0,ze.data.x={},Ih.html(""),a.onresize=null},"url"in f.data)g.csv(f.data.url,function(a,b){be(b)});else if("rows"in f.data)be(hc(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");be(ic(f.data.columns))}return ze}}(window); \ No newline at end of file +!function(a){"use strict";function b(){function a(a,b){a.attr("transform",function(a){return"translate("+(b(a)+q)+", 0)"})}function b(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function c(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function d(a){for(var b=[],c=Math.ceil(a[0]);c0&&b[0]>0&&b.unshift(b[0]-(b[1]-b[0])),b}function e(a,b){var c=a.length-1;return p>=c||b%Math.ceil(c/p)===0}function f(a){return a0?a:320}function t(){return td(Ae.data.targets)?0:Ie?Ie:Xf||kg?1:v("y")}function u(){var a=1;return td(Ae.data.targets)?0:Je?Je:sh?$e+(og&&!Xf?v("y2"):a):og?tg||Xf?a:v("y2"):a}function v(a){var b=fb(a);return b.isInner?20+yb(a):40+yb(a)}function w(a){var b=fb(a);return(b.isInner?30:40)+("y2"===a?-10:0)}function x(){return+g.select(Fe).style("width").replace("px","")}function y(){return+g.select(Fe).style("height").replace("px","")}function z(a){return a?-5:-(Qe.left-1)}function A(a){return a?-20:-1}function B(){return z(!Xf)}function C(){return A(!Xf)}function D(){return z(Xf)}function E(){return A(Xf)}function F(a){return a?Te+2+4:Qe.left+20}function G(a){return a?80:Ve+2}function H(){return F(!Xf)}function I(){return G(!Xf)}function J(){return F(Xf)}function K(){return G(Xf)}function L(){var a=Xf?Ve:Te,b=Sb(),c=nc();return c>1?a*b/(c-1):a}function M(a){th=a}function N(a){uh=a}function O(a){vh=a}function P(){return Tf?sh?uh*(th+1):Xe:0}function Q(){return Tf?sh?Ye:vh*(th+1):0}function R(){var a,b,c=!pf;gf=Xf?1:0,hf=Xf?Ve:Te,jf=Xf?0:Ve,kf=Xf?Te:1,lf=gf,mf=hf,nf=Xf?0:We,of=Xf?Ue:1,pf=T(gf,hf,c?void 0:pf.domain(),function(){return vf.tickOffset()}),qf=U(jf,kf),rf=U(jf,kf),sf=T(gf,hf,Kh,function(a){return a%1?0:yf.tickOffset()}),tf=U(nf,of),uf=U(nf,of),a=$(),b=_(),vf=X(pf,nh,a,b),yf=X(sf,qh,a,b),wf=Y(qf,oh,lg,ng),xf=Y(rf,ph,ug,wg),c||(yh.scale(sf),Ke&&Ch.scale(pf)),S()}function S(){cf=Ab(),df=Bb(),ef=Bb(.98)}function T(a,b,c,f){var h=(fh?g.time.scale():g.scale.linear()).range([a,b]);if(h.orgDomain=function(){return h.domain()},e(c)&&h.domain(c),d(f)&&(f=function(){return 0}),gh){var i,j=h;h=function(a){return j(a)+f(a)};for(i in j)h[i]=j[i];h.orgDomain=function(){return j.domain()},h.domain=function(a){return arguments.length?(j.domain(a),h):(a=j.domain(),[a[0],a[1]+1])}}return h}function U(a,b){return g.scale.linear().range([a,b])}function V(a){return"y2"===Z(a)?rf:qf}function W(a){return"y2"===Z(a)?uf:tf}function X(a,c,d,e){var f=(gh?b():g.svg.axis()).scale(a).orient(c);return f.tickFormat(d).ticks(e),gh?f.tickCentered($f):f.tickOffset=function(){var a=Xf?Ve:Te;return a*Sb()/nc()/2},gh&&f.categories(Zf),f}function Y(a,b,c,d){return g.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function Z(a){return a in Ff?Ff[a]:"y"}function $(){var a=fh?mh:gh?wc:null;return _f&&("function"==typeof _f?a=_f:fh&&(a=function(a){return g.time.format(_f)(a)})),a}function _(){var a=nc();return ag&&a>bg?bg:a}function ab(a){return"string"==typeof a?a:a?a.text:null}function bb(a,b){var c=a&&"object"==typeof a&&a.position?a.position:b;return{isInner:c.indexOf("inner")>=0,isOuter:c.indexOf("outer")>=0,isLeft:c.indexOf("left")>=0,isCenter:c.indexOf("center")>=0,isRight:c.indexOf("right")>=0,isTop:c.indexOf("top")>=0,isMiddle:c.indexOf("middle")>=0,isBottom:c.indexOf("bottom")>=0}}function cb(){return bb(fg,Xf?"inner-top":"inner-right")}function db(){return bb(jg,Xf?"inner-right":"inner-top")}function eb(){return bb(sg,Xf?"inner-right":"inner-top")}function fb(a){return"y2"===a?eb():"y"===a?db():cb()}function gb(){return ab(fg)}function hb(){return ab(jg)}function ib(){return ab(sg)}function jb(a,b){return a?b.isLeft?0:b.isCenter?Te/2:Te:b.isBottom?-Ve:b.isMiddle?-Ve/2:0}function kb(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function lb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function mb(){return jb(!Xf,cb())}function nb(){return jb(Xf,db())}function ob(){return jb(Xf,eb())}function pb(){return kb(!Xf,cb())}function qb(){return kb(Xf,db())}function rb(){return kb(Xf,eb())}function sb(){var a=cb();return Xf?a.isInner?"1.2em":-30-yb("x"):a.isInner?"-0.5em":"3em"}function tb(){var a=db();return Xf?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-yb("y")}function ub(){var a=eb();return Xf?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+yb("y2")}function vb(){return lb(!Xf,cb())}function wb(){return lb(Xf,db())}function xb(){return lb(Xf,eb())}function yb(a){var b=0;return g.selectAll("."+a+".axis .tick text").each(function(){var a=this.getBBox();b0)for(f=uc(a),b=0;ba?a:0}),c=1;c0||(h[d][b]+=+a)});return g.min(Object.keys(h).map(function(a){return g.min(h[a])}))}function Qb(a){var b,c,d,e,f,h=sc(a);if(Ef.length>0)for(f=vc(a),b=0;b0?a:0}),c=1;c+a||(h[d][b]+=+a)});return g.max(Object.keys(h).map(function(a){return g.max(h[a])}))}function Rb(a){var b,d,e,f,g,h,i,j,k=rc(function(b){return Z(b.id)===a}),l="y2"===a?qg:hg,m="y2"===a?pg:gg,n=c(l)?l:Pb(k),o=c(m)?m:Qb(k),p="y2"===a?rg:ig,q=Pc()&&Xf;return n===o&&(0>n?o=0:n=0),b=Math.abs(o-n),d=e=f=q?0:.1*b,p&&(g=Math.max(Math.abs(n),Math.abs(o)),o=g-p,n=p-g),"y"===a&&mg&&(e=c(mg.top)?mg.top:d,f=c(mg.bottom)?mg.bottom:d),"y2"===a&&vg&&(e=c(vg.top)?vg.top:d,f=c(vg.bottom)?vg.bottom:d),q&&(h=Qc(n,o),i=Xb(qf.range()),j=[h[0]/i,h[1]/i],e+=b*(j[1]/(1-j[0]-j[1])),f+=b*(j[0]/(1-j[0]-j[1]))),pd(k)&&!uc(k)&&(f=n),[n-f,o+e]}function Sb(a){var b=Xb(Kh),c=Xb(pf.domain());return a||0===c?1:b/c}function Tb(a){return dg?dg:g.min(a,function(a){return g.min(a.values,function(a){return a.x})})}function Ub(a){return cg?cg:g.max(a,function(a){return g.max(a.values,function(a){return a.x})})}function Vb(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return gh?d=0:pd(a)?(c=nc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Wb(a){var b=[Tb(a),Ub(a)],c=b[0],d=b[1],e=Vb(a,b),f=fh?new Date(c.getTime()-e):c-e,g=fh?new Date(d.getTime()+e):d+e;return[f,g]}function Xb(a){return a[1]-a[0]}function Yb(a){for(var b=0;bd?0:d}function bc(a){return zf&&a===zf||Af&&Jd(Af,a)}function cc(a){return!bc(a)}function dc(a){return zf?zf:Af?Af[a]:null}function ec(a,b){return a in Ae.data.x&&Ae.data.x[a]&&Ae.data.x[a][b]?Ae.data.x[a][b]:b}function fc(a){Object.keys(a).forEach(function(b){Af[b]=a[b]})}function gc(a){var b;return a&&(b=Df[a.id],a.name=b?b:a.id),a}function hc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?a.map(function(a){return a[c]}):Ae.data.x[Object.keys(Ae.data.x)[0]]}),b=c.map(function(b){var c=Cf(b);return{id:c,id_org:b,values:a.map(function(a,d){var e,f=dc(b);return e=fh?a[f]instanceof Date?a[f]:Fd(a[f]):hh?a[f]?+a[f]:ec(b,d):d,a.x=e,{x:e,value:null===a[b]||isNaN(a[b])?null:+a[b],id:c}})}}),b.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++})}),Gf&&nd(pc(b).filter(function(a){return!(a in Hf)}),Gf),b.forEach(function(a){Zb(a.id_org,a)}),b}function kc(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 lc(a){return a>0&&Ae.data.targets[0].values[a-1]?Ae.data.targets[0].values[a-1].x:void 0}function mc(a){return a1?Ae.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?Ae.data.targets[0]:null,a}function pc(a){return a=d(a)?Ae.data.targets:a,a.map(function(a){return a.id})}function qc(a){var b,c=pc();for(b=0;ba})}function vc(a){return tc(a,function(a){return a>0})}function wc(a){return a=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?g=h:f=h,g-f===1?(e=[],a[f].x&&(e=e.concat(Xc(a,f))),a[g].x&&(e=e.concat(Xc(a,g))),$c(e,b)):Yc(a,b,f,g)}function Zc(a,b){var c;return c=a.map(function(a){return Yc(a.values,b)}),$c(c,b)}function $c(a,b){var c,d;return a.forEach(function(a){var e=Kd(a,b);(c>e||!c)&&(c=e,d=a)}),d}function _c(){return Jf&&"desc"===Jf.toLowerCase()}function ad(){return Jf&&"asc"===Jf.toLowerCase()}function bd(a){var b=ad(),c=_c();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 Jf&&a.sort(Jf),a}function cd(a,b){var d,e,f,g,h,i,j,k=td(Ae.data.targets),l=k?Wc:Vc,m=a.filter(function(a){return a&&c(a.value)});Yg&&0!==m.length&&(Ih.html(_g(a,$(),l,lh)).style("visibility","hidden").style("display","block"),d=Ih.property("offsetWidth"),e=Ih.property("offsetHeight"),k?(g=Te/2+b[0],i=Ve/2+b[1]+20):(Xf?(f=q(),g=f+b[0]+100,h=g+d,j=r()-u(),i=pf(m[0].x)+20):(f=q(),g=f+t()+pf(m[0].x)+20,h=g+d,j=f+r()-u(),i=b[1]+15),h>j&&(g-=d+60),i+e>s()&&(i-=e+30)),Ih.style("top",i+"px").style("left",g+"px").style("visibility","visible"))}function dd(){Ih.style("display","none")}function ed(a){var b=a.filter(function(a){return a&&c(a.value)});Yg&&(qd(Ae.data.targets)||td(Ae.data.targets)||Fh.selectAll("line.xgrid-focus").style("visibility","visible").data([b[0]]).attr(Xf?"y1":"x1",Rc).attr(Xf?"y2":"x2",Rc))}function fd(){Fh.select("line.xgrid-focus").style("visibility","hidden")}function gd(a){return a.x||0===a.x?pf(a.x):null}function hd(a){return V(a.id)(a.value)}function id(){var a,b,c={},e=0;return rc(wd).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function md(a,b){return b?2*a.tickOffset()*.6/b:0}function nd(a,b){var c=d(a)?pc():a;"string"==typeof c&&(c=[c]);for(var e=0;e0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function be(a,b,c,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(e(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function ce(b){var c,d,e;if(Jh=g.select(Fe),Jh.empty())throw new Error('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(Jh.html(""),Ae.data.x={},Ae.data.targets=jc(b),o(),R(),pf.domain(g.extent(Wb(Ae.data.targets))),qf.domain(Rb("y")),rf.domain(Rb("y2")),sf.domain(pf.domain()),tf.domain(qf.domain()),uf.domain(rf.domain()),Kh=pf.domain(),yh.scale(sf),Ke&&Ch.scale(pf),Dh=g.select(Fe).append("svg").attr("width",Te+Qe.left+Qe.right).attr("height",Ve+Qe.top+Qe.bottom).on("mouseenter",Ne).on("mouseleave",Oe),Eh=Dh.append("defs"),Eh.append("clipPath").attr("id",dh).append("rect").attr("width",Te).attr("height",Ve),Eh.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),Eh.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),Fh=Dh.append("g").attr("transform",rh.main),Gh=Qf?Dh.append("g").attr("transform",rh.context):null,Hh=Tf?Dh.append("g").attr("transform",rh.legend):null,Ih=g.select(Fe).style("position","relative").append("div").style("position","absolute").style("z-index","10").style("display","none"),Fh.append("g").attr("class","x axis").attr("clip-path",Xf?"":j("xaxis-clip")).attr("transform",rh.x).append("text").attr("class","-axis-x-label").attr("transform",Xf?"rotate(-90)":"").attr("dx",pb).attr("dy",sb).style("text-anchor",vb).text(gb),Fh.append("g").attr("class","y axis").attr("clip-path",Xf?j("yaxis-clip"):"").append("text").attr("class","-axis-y-label").attr("transform",Xf?"":"rotate(-90)").attr("dx",qb).attr("dy",tb).style("text-anchor",wb).text(hb),og&&Fh.append("g").attr("class","y2 axis").attr("transform",rh.y2).append("text").attr("class","-axis-y2-label").attr("transform",Xf?"":"rotate(-90)").attr("dx",rb).style("text-anchor",xb).text(ib),d=Fh.append("g").attr("clip-path",eh).attr("class","grid"),xg&&d.append("g").attr("class","xgrids"),zg&&d.append("g").attr("class","xgrid-lines"),Fg&&d.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",Xf?0:-10).attr("x2",Xf?Te:-10).attr("y1",Xf?-10:Qe.top).attr("y2",Xf?-10:Ve),Ag&&d.append("g").attr("class","ygrids"),Bg&&d.append("g").attr("class","ygrid-lines"),Fh.append("g").attr("clip-path",eh).attr("class","regions"),Fh.append("g").attr("clip-path",eh).attr("class","chart"),c=Fh.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",Ke?Xf?"ns-resize":"ew-resize":null),Fh.select(".chart").append("g").attr("class","chart-bars"),Fh.select(".chart").append("g").attr("class","chart-lines"),Fh.select(".chart").append("g").attr("class","chart-arcs").attr("transform",rh.arc).append("text").attr("class","chart-arcs-title").style("text-anchor","middle").text(Lb()),Fh.select(".chart").append("g").attr("class","chart-texts"),Ke&&Fh.insert("rect",Me?null:"g.grid").attr("class","zoom-rect").attr("width",Te).attr("height",Ve).style("opacity",0).style("cursor",Xf?"ns-resize":"ew-resize").call(Ch).on("dblclick.zoom",null),null!==eg&&yh.extent("function"!=typeof eg?eg:eg(Wb())),Qf&&(Gh.append("g").attr("clip-path",eh).attr("class","chart"),Gh.select(".chart").append("g").attr("class","chart-bars"),Gh.select(".chart").append("g").attr("class","chart-lines"),Gh.append("g").attr("clip-path",eh).attr("class","x brush").call(yh).selectAll("rect").attr(Xf?"width":"height",Xf?Ue:We),Gh.append("g").attr("class","x axis").attr("transform",rh.subx).attr("clip-path",Xf?j("yaxis-clip"):"")),pe(Ae.data.targets),Xf?Fh.select(".x.axis").style("opacity",0).call(vf):(Fh.select(".y.axis").style("opacity",0).call(wf),Fh.select(".y2.axis").style("opacity",0).call(xf)),oe({withTransform:!0,withLegend:!0,durationForAxis:0}),ah){if(fh&&"string"==typeof bh){for(bh=Fd(bh),e=0;e0){d=[];for(var f in Df)for(c=0;cf&&h>c&&d>i&&j>d):"rect"===this.nodeName&&(c=1*l.attr("x"),d=1*l.attr("y"),e=1*l.attr("width"),k=Qd,o=c+e>f&&h>c&&j>d),o^n&&(l.classed(Ee,!n),l.classed(De,!m),k(!m,l,a,b))}))}function he(a){td(Ae.data.targets)||Mf&&(ih=a,Fh.select(".chart").append("rect").attr("class","dragarea").style("opacity",.1),jh=!0)}function ie(){td(Ae.data.targets)||Mf&&(Fh.select(".dragarea").transition().duration(100).style("opacity",0).remove(),Fh.selectAll(".-shape").classed(Ee,!1),jh=!1)}function je(a){var b,d,f,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I=id(),J=td(Ae.data.targets);if(a=e(a)?a:{},u=e(a.withY)?a.withY:!0,v=e(a.withSubchart)?a.withSubchart:!0,w=e(a.withTransition)?a.withTransition:!0,x=e(a.withTransform)?a.withTransform:!1,y=e(a.withUpdateXDomain)?a.withUpdateXDomain:!1,z=e(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,A=e(a.withLegend)?a.withLegend:!1,F=w?Pe:0,G=e(a.durationForExit)?a.durationForExit:F,H=e(a.durationForAxis)?a.durationForAxis:F,A&&Tf&&ue(Ae.data.targets,a),z&&(pf.domain(g.extent(Wb(Ae.data.targets))),Kh=pf.domain(),Ke&&Ch.scale(pf).updateScaleExtent(),sf.domain(pf.domain()),yh.scale(sf)),y&&(pf.domain(yh.empty()?Kh:yh.extent()),Ke&&Ch.scale(pf).updateScaleExtent()),qf.domain(Rb("y")),rf.domain(Rb("y2")),Fh.select(".x.axis").style("opacity",J?0:1).transition().duration(H).call(vf),Fh.select(".y.axis").style("opacity",J?0:1).transition().duration(H).call(wf),Fh.select(".y2.axis").style("opacity",J?0:1).transition().duration(H).call(xf),B=Yd(I),D=Zd(I,!0),E=Zd(I,!1),Fh.select(".x.axis .-axis-x-label").attr("x",mb),Fh.select(".y.axis .-axis-y-label").attr("x",nb).attr("dy",tb),Fh.select(".y2.axis .-axis-y2-label").attr("x",ob).attr("dy",ub),tf.domain(qf.domain()),uf.domain(rf.domain()),Ih.style("display","none"),Fh.select("line.xgrid-focus").style("visibility","hidden").attr("y2",Ve),xg){if("year"===yg){d=[]; +for(var K=Wb(),M=K[0].getFullYear(),N=K[1].getFullYear(),O=M;N>=O;O++)d.push(new Date(O+"-01-01 00:00:00"))}else d=pf.ticks(10);b=Fh.select(".xgrids").selectAll(".xgrid").data(d),b.enter().append("line").attr("class","xgrid"),b.attr("x1",Xf?0:function(a){return pf(a)-vf.tickOffset()}).attr("x2",Xf?Te:function(a){return pf(a)-vf.tickOffset()}).attr("y1",Xf?function(a){return pf(a)-vf.tickOffset()}:Qe.top).attr("y2",Xf?function(a){return pf(a)-vf.tickOffset()}:Ve).style("opacity",function(){return+g.select(this).attr(Xf?"y1":"x1")===(Xf?Ve:0)?0:1}),b.exit().remove()}zg&&(f=Fh.select(".xgrid-lines").selectAll(".xgrid-line").data(zg),h=f.enter().append("g").attr("class",function(a){return"xgrid-line xgrid-line-"+(a["class"]?a["class"]:"")}),h.append("line").style("opacity",0),h.append("text").attr("text-anchor","end").attr("transform",Xf?"":"rotate(-90)").attr("dx",Xf?0:-Qe.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(F).attr("x1",Xf?0:Sc).attr("x2",Xf?Te:Sc).attr("y1",Xf?Sc:Qe.top).attr("y2",Xf?Sc:Ve).style("opacity",1),f.select("text").transition().duration(F).attr("x",Xf?Te:0).attr("y",Sc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(F).style("opacity",0).remove()),u&&Ag&&(i=Fh.select(".ygrids").selectAll(".ygrid").data(qf.ticks(Cg)),i.enter().append("line").attr("class","ygrid"),i.attr("x1",Xf?qf:0).attr("x2",Xf?qf:Te).attr("y1",Xf?0:qf).attr("y2",Xf?Ve:qf),i.exit().remove()),u&&Bg&&(j=Fh.select(".ygrid-lines").selectAll(".ygrid-line").data(Bg),k=j.enter().append("g").attr("class",function(a){return"ygrid-line ygrid-line-"+(a.class?a.class:"")}),k.append("line").style("opacity",0),k.append("text").attr("text-anchor","end").attr("transform",Xf?"rotate(-90)":"").attr("dx",Xf?0:-Qe.top).attr("dy",-5).style("opacity",0),j.select("line").transition().duration(F).attr("x1",Xf?Tc:0).attr("x2",Xf?Tc:Te).attr("y1",Xf?0:Tc).attr("y2",Xf?Ve:Tc).style("opacity",1),j.select("text").transition().duration(F).attr("x",Xf?0:Te).attr("y",Tc).text(function(a){return a.text}).style("opacity",1),j.exit().transition().duration(F).style("opacity",0).remove()),m=Fh.selectAll(".-bars").selectAll(".-bar").data(Bd),m.enter().append("path").attr("d",B).style("stroke","none").style("opacity",0).style("fill",function(a){return lh(a.id)}).attr("class",Ic),m.style("opacity",Lc).transition().duration(F).attr("d",B).style("opacity",1),m.exit().transition().duration(G).style("opacity",0).remove(),o=Fh.selectAll(".-texts").selectAll(".-text").data(Dd),o.enter().append("text").attr("class",yc).attr("text-anchor",function(a){return Xf?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return Vc(a.value)}),o.style("fill-opacity",Mc).transition().duration(F).attr("x",D).attr("y",E).style("fill-opacity",Oc),o.exit().transition().duration(G).style("fill-opacity",0).remove(),Fh.selectAll(".-line").style("opacity",Lc).transition().duration(F).attr("d",zh).style("opacity",1),Fh.selectAll(".-area").style("opacity",0).transition().duration(F).attr("d",Ah).style("opacity",Lh),l=Fh.selectAll(".-circles").selectAll(".-circle").data(Cd),l.enter().append("circle").attr("class",Hc).style("opacity",0).attr("r",Eg),l.style("opacity",Lc).transition().duration(F).style("opacity",Nc).attr("cx",Xf?hd:gd).attr("cy",Xf?gd:hd),l.exit().remove(),Fh.selectAll(".chart-arc").select(".-arc").attr("transform",x?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(F).attrTween("d",function(a){var b=zb(a);if(!b)return function(){return"M 0 0"};var c=g.interpolate(this._current,b);return this._current=c(0),function(a){return Cb(c(a),!0)}}).attr("transform",x?"scale(1)":"").style("opacity",1),Fh.selectAll(".chart-arc").select("text").attr("transform",Db).style("opacity",0).transition().duration(F).text(Gb).style("opacity",function(a){return Ad(a.data)?1:0}),Fh.select(".chart-arcs-title").style("opacity",sd(Ae.data.targets)?1:0),Qf&&(null!==g.event&&"zoom"===g.event.type&&yh.extent(pf.orgDomain()).update(),v&&(Gh.select(".x.axis").style("opacity",J?0:1).transition().duration(F).call(yf),yh.empty()||yh.extent(pf.orgDomain()).update(),C=Yd(I,!0),p=Gh.selectAll(".-bars").selectAll(".-bar").data(Bd),p.enter().append("path").attr("d",C).style("stroke","none").style("fill",function(a){return lh(a.id)}).attr("class",Ic),p.style("opacity",Lc).transition().duration(F).attr("d",C).style("opacity",1),p.exit().transition().duration(F).style("opacity",0).remove(),Gh.selectAll(".-line").style("opacity",Lc).transition().duration(F).attr("d",Bh).style("opacity",1))),Fh.selectAll(".selected-circles").filter(function(a){return wd(a)}).selectAll("circle").remove(),Fh.selectAll(".selected-circle").transition().duration(F).attr("cx",Xf?hd:gd).attr("cy",Xf?gd:hd),Af?(q=Fh.select(".event-rects").selectAll(".event-rect").data([0]),ee(q.enter()),q.attr("x",0).attr("y",0).attr("width",Te).attr("height",Ve)):(hh?(t=function(a,b){var c=lc(b),d=mc(b);return(pf(d?d:a.x+50)-pf(c?c:a.x-50))/2},s=function(a,b){var c=lc(b);return(pf(a.x)+pf(c?c:a.x-50))/2}):(t=L(),s=function(a){return pf(a.x)-t/2}),r=oc(),Fh.select(".event-rects").datum(r?r.values:[]),q=Fh.select(".event-rects").selectAll(".event-rect").data(function(a){return a}),de(q.enter()),q.attr("class",Kc).attr("x",Xf?0:s).attr("y",Xf?s:0).attr("width",Xf?Te:t).attr("height",Xf?t:Ve),q.exit().remove()),n=Fh.select(".regions").selectAll("rect.region").data(Xg),n.enter().append("rect").style("fill-opacity",0),n.attr("class",Jc).attr("x",Xf?0:_b).attr("y",Xf?_b:Qe.top).attr("width",Xf?Te:ac).attr("height",Xf?ac:Ve).transition().duration(F).style("fill-opacity",function(a){return c(a.opacity)?a.opacity:.1}),n.exit().transition().duration(F).style("fill-opacity",0).remove(),pc().forEach(function(a){Mh[a]=!0})}function ke(){je({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function le(){return"mousemove"===g.event.sourceEvent.type&&Ch.altDomain?(pf.domain(Ch.altDomain),void Ch.scale(pf).updateScaleExtent()):(gh&&pf.orgDomain()[0]===Kh[0]&&pf.domain([Kh[0]-1e-10,pf.orgDomain()[1]]),je({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===g.event.sourceEvent.type&&(kh=!0)))}function me(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function ne(){Dh.attr("width",Xe).attr("height",Ye),Dh.select("#"+dh).select("rect").attr("width",Te).attr("height",Ve),Dh.select("#xaxis-clip").select("rect").attr("width",H),Dh.select("#yaxis-clip").select("rect").attr("width",J),Dh.select(".zoom-rect").attr("width",Te).attr("height",Ve)}function oe(a){a=e(a)?a:{},a.withTransition=e(a.withTransition)?a.withTransition:!0,a.withTransform=e(a.withTransform)?a.withTransform:!1,a.withLegend=e(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.durationForExit=0,o(),R(),ne(),n(a.withTransition),je(a)}function pe(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=Fh.select(".chart-texts").selectAll(".chart-text").data(a),j=i.enter().append("g").attr("class",function(a){return"chart-text"+xc("target",a.id)}).style("pointer-events","none"),j.append("g").attr("class",zc).style("fill",function(a){return lh(a.id)}),e=Fh.select(".chart-bars").selectAll(".chart-bar").data(a),d=e.enter().append("g").attr("class",function(a){return"chart-bar"+xc("target",a.id)}).style("pointer-events","none"),d.append("g").attr("class",Dc).style("fill",function(a){return lh(a.id)}).style("stroke","none").style("cursor",function(a){return Of(a)?"pointer":null}),c=Fh.select(".chart-lines").selectAll(".chart-line").data(a),b=c.enter().append("g").attr("class",function(a){return"chart-line"+xc("target",a.id)}).style("pointer-events","none"),b.append("path").attr("class",Bc).style("opacity",0).style("stroke",function(a){return lh(a.id)}),b.append("path").attr("class",Fc).style("opacity",function(){return Lh=+g.select(this).style("opacity"),0}).style("fill",function(a){return lh(a.id)}),b.append("g").attr("class",function(a){return xc("selected-circles",a.id)}),b.append("g").attr("class",Cc).style("fill",function(a){return lh(a.id)}).style("cursor",function(a){return Of(a)?"pointer":null}),a.forEach(function(a){var b=ve(a.id);Fh.selectAll(".selected-circles"+b).selectAll(".selected-circle").each(function(b){b.value=a.values[b.x].value})}),h=Fh.select(".chart-arcs").selectAll(".chart-arc").data(ff(a)),f=h.enter().append("g").attr("class",function(a){return"chart-arc target target-"+a.data.id}),f.append("path").attr("class",Ec).style("opacity",0).style("fill",function(a){return lh(a.data.id)}).style("cursor",function(a){return Of(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){var c=Fb(a),d=Nb();Hb(a.data.id),re(a.data.id),d(c,b)}).on("mousemove",function(a){var b=[Fb(a)];cd(b,g.mouse(this))}).on("mouseout",function(a,b){var c=Fb(a),d=Ob();Ib(a.data.id),te(),dd(),d(c,b)}).on("click",function(a,b){var c=Fb(a),d=Mb();d(c,b)}),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),Qf&&(n=Gh.select(".chart-bars").selectAll(".chart-bar").data(a),m=n.enter().append("g").attr("class",function(a){return"chart-bar"+xc("target",a.id)}),m.append("g").attr("class",Dc).style("fill",function(a){return lh(a.id)}),l=Gh.select(".chart-lines").selectAll(".chart-line").data(a),k=l.enter().append("g").attr("class",function(a){return"chart-line"+xc("target",a.id)}),k.append("path").attr("class",Bc).style("opacity",0).style("stroke",function(a){return lh(a.id)})),Dh.selectAll(".target").transition().style("opacity",1)}function qe(a,b){Ae.data.targets.forEach(function(b){for(var c=0;ce&&(e=(k-j)/2,v=0,B++)),A[a]=B,z[B]=e,w[a]=v,v+=j}var e,f,g=a.getBBox(),h=10*Math.ceil((g.width+r)/10),i=10*Math.ceil((g.height+q)/10),j=sh?i:h,k=sh?Ze:$e;c&&(v=0,B=0,s=0,t=0),x[b]=h,y[b]=i,(!s||h>=s)&&(s=h),(!t||i>=t)&&(t=i),f=sh?t:s,Wf?(Object.keys(x).forEach(function(a){x[a]=s}),Object.keys(y).forEach(function(a){y[a]=t}),e=(k-f*p.length)/2,u>e?(v=0,B=0,p.forEach(function(a){d(a)})):d(b,!0)):d(b)}var f,g,h,i,j,k,l,m,p=pc(a),q=4,r=26,s=0,t=0,u=10,v=0,w={},x={},y={},z={},A={},B=0;b=d(b)?{}:b,m=e(b.withTransition)?b.withTransition:!0,sh?(g=function(a){return s*(.2+A[a])},j=function(a){return z[A[a]]+w[a]}):(g=function(a){return z[A[a]]+w[a]},j=function(a){return t*(.2+A[a])}),h=function(a,b){return g(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return g(a,b)-4},l=function(a,b){return j(a,b)-7},f=Hh.selectAll(".legend-item").data(p).enter().append("g").attr("class",function(a){return xc("legend-item",a)}).style("cursor","pointer").on("click",function(a){Vf(a)}).on("mouseover",function(a){Ae.focus(a)}).on("mouseout",function(){Ae.revert()}),f.append("text").text(function(a){return e(Df[a])?Df[a]:a}).each(function(a,b){c(this,a,0===b)}).style("pointer-events","none").attr("x",sh?h:-200).attr("y",sh?-200:k),f.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",sh?i:-200).attr("y",sh?-200:l).attr("width",function(a){return x[a]}).attr("height",function(a){return y[a]}),f.append("rect").attr("class","legend-item-tile").style("pointer-events","none").style("fill",function(a){return lh(a)}).attr("x",sh?h:-200).attr("y",sh?-200:j).attr("width",10).attr("height",10),Hh.selectAll("text").data(p).each(function(a,b){c(this,a,0===b)}).transition().duration(m?250:0).attr("x",h).attr("y",k),Hh.selectAll("rect.legend-item-event").data(p).transition().duration(m?250:0).attr("x",i).attr("y",l),Hh.selectAll("rect.legend-item-tile").data(p).transition().duration(m?250:0).attr("x",g).attr("y",j),N(s),O(t),M(B),o(),R(),ne(),n(!1)}function ve(a){return a||0===a?"-"+(a.replace?a.replace(/([^a-zA-Z0-9-_])/g,"-"):a):""}function we(a){return".target"+ve(a)}function xe(a){return qc(a.id)}function ye(a){return"data"in a&&qc(a.data.id)}function ze(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}var Ae={data:{}},Be={},Ce="_expanded_",De="_selected_",Ee="_included_",Fe=i(["bindto"],"#chart"),Ge=i(["size","width"],null),He=i(["size","height"],null),Ie=i(["padding","left"],null),Je=i(["padding","right"],null),Ke=i(["zoom","enabled"],!1),Le=i(["zoom","extent"],null),Me=i(["zoom","privileged"],!1),Ne=i(["onenter"],function(){}),Oe=i(["onleave"],function(){}),Pe=i(["transition","duration"],350);h("data","data is required in config");var Qe,Re,Se,Te,Ue,Ve,We,Xe,Ye,Ze,$e,_e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,xf,yf,zf=i(["data","x"],null),Af=i(["data","xs"],null),Bf=i(["data","x_format"],"%Y-%m-%d"),Cf=i(["data","id_converter"],function(a){return a}),Df=i(["data","names"],{}),Ef=i(["data","groups"],[]),Ff=i(["data","axes"],{}),Gf=i(["data","type"],null),Hf=i(["data","types"],{}),If=i(["data","labels"],{}),Jf=i(["data","order"],null),Kf=i(["data","regions"],{}),Lf=i(["data","colors"],{}),Mf=i(["data","selection","enabled"],!1),Nf=i(["data","selection","grouped"],!1),Of=i(["data","selection","isselectable"],function(){return!0}),Pf=i(["data","selection","multiple"],!0),Qf=i(["subchart","show"],!1),Rf=Qf?i(["subchart","size","height"],60):0,Sf=i(["color","pattern"],null),Tf=i(["legend","show"],!0),Uf=i(["legend","position"],"bottom"),Vf=i(["legend","item","onclick"],function(){}),Wf=i(["legend","equally"],!1),Xf=i(["axis","rotated"],!1),Yf=i(["axis","x","type"],"indexed"),Zf=i(["axis","x","categories"],[]),$f=i(["axis","x","tick","centered"],!1),_f=i(["axis","x","tick","format"],null),ag=i(["axis","x","tick","culling"],"categorized"===Yf?!1:!0),bg=i(["axis","x","tick","count"],10),cg=i(["axis","x","max"],null),dg=i(["axis","x","min"],null),eg=i(["axis","x","default"],null),fg=i(["axis","x","label"],null),gg=i(["axis","y","max"],null),hg=i(["axis","y","min"],null),ig=i(["axis","y","center"],null),jg=i(["axis","y","label"],null),kg=i(["axis","y","inner"],!1),lg=i(["axis","y","tick","format"],null),mg=i(["axis","y","padding"],null),ng=i(["axis","y","ticks"],10),og=i(["axis","y2","show"],!1),pg=i(["axis","y2","max"],null),qg=i(["axis","y2","min"],null),rg=i(["axis","y2","center"],null),sg=i(["axis","y2","label"],null),tg=i(["axis","y2","inner"],!1),ug=i(["axis","y2","tick","format"],null),vg=i(["axis","y2","padding"],null),wg=i(["axis","y2","ticks"],10),xg=i(["grid","x","show"],!1),yg=i(["grid","x","type"],"tick"),zg=i(["grid","x","lines"],null),Ag=i(["grid","y","show"],!1),Bg=i(["grid","y","lines"],null),Cg=i(["grid","y","ticks"],10),Dg=i(["point","show"],!0),Eg=Dg?i(["point","r"],2.5):0,Fg=i(["point","focus","line","enabled"],!0),Gg=i(["point","focus","expand","enabled"],!0),Hg=i(["point","focus","expand","r"],Gg?4:Eg),Ig=i(["point","focus","select","r"],8),Jg=i(["point","onclick"],function(){}),Kg=i(["point","onselected"],function(){}),Lg=i(["point","onunselected"],function(){}),Mg=i(["pie","label","show"],!0),Ng=i(["pie","label","format"],null),Og=i(["pie","onclick"],function(){}),Pg=i(["pie","onmouseover"],function(){}),Qg=i(["pie","onmouseout"],function(){}),Rg=i(["donut","label","show"],!0),Sg=i(["donut","label","format"],null),Tg=i(["donut","title"],""),Ug=i(["donut","onclick"],function(){}),Vg=i(["donut","onmouseover"],function(){}),Wg=i(["donut","onmouseout"],function(){}),Xg=i(["regions"],[]),Yg=i(["tooltip","show"],!0),Zg=i(["tooltip","format","title"],null),$g=i(["tooltip","format","value"],null),_g=i(["tooltip","contents"],function(a,b,c,d){var e,f,g,h,i,j=Zg?Zg:b,k=$g?$g:c;for(f=0;f"+(g||0===g?""+g+"":"")),i=a[f].name,h=k(a[f].value,a[f].ratio),e+=""+i+""+h+"");return e+""}),ah=i(["tooltip","init","show"],!1),bh=i(["tooltip","init","x"],0),ch=i(["tooltip","init","position"],{top:"0px",left:"50px"}),dh=("string"==typeof Fe?Fe.replace("#",""):Fe.id)+"-clip",eh=j(dh),fh="timeseries"===Yf,gh="categorized"===Yf,hh=!fh&&(zf||Af),ih=null,jh=!1,kh=!1,lh=Ed(Lf,Sf),mh=function(){var a=[[g.time.format("%Y/%-m/%-d"),function(){return!0}],[g.time.format("%-m/%-d"),function(a){return a.getMonth()}],[g.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[g.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[g.time.format("%I %p"),function(a){return a.getHours()}],[g.time.format("%I:%M"),function(a){return a.getMinutes()}],[g.time.format(":%S"),function(a){return a.getSeconds()}],[g.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),nh=Xf?"left":"bottom",oh=Xf?kg?"top":"bottom":kg?"right":"left",ph=Xf?tg?"bottom":"top":tg?"left":"right",qh=Xf?"left":"bottom",rh={main:function(){return"translate("+Qe.left+","+Qe.top+")"},context:function(){return"translate("+Re.left+","+Re.top+")"},legend:function(){return"translate("+Se.left+","+Se.top+")"},x:function(){return"translate(0,"+(Xf?0:Ve)+")"},y:function(){return"translate(0,"+(Xf?Ve:0)+")"},y2:function(){return"translate("+(Xf?0:Te)+","+(Xf?1:0)+")"},subx:function(){return"translate(0,"+(Xf?0:We)+")"},arc:function(){return"translate("+Te/2+","+Ve/2+")"}},sh="right"===Uf,th=0,uh=0,vh=0,wh=40,xh=20;ff=g.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var yh,zh=function(){var a=g.svg.line().x(Xf?function(a){return V(a.id)(a.value)}:Rc).y(Xf?Rc:function(a){return V(a.id)(a.value)});return function(b){var c,d,e=Rd(b.values);return ud(b)?(a.interpolate(vd(b)?"cardinal":"linear"),Kf[b.id]?be(e,pf,V(b.id),Kf[b.id]):a(e)):(c=pf(e[0].x),d=V(b.id)(e[0].value),Xf?"M "+d+" "+c:"M "+c+" "+d)}}(),Ah=function(){var a;return a=Xf?g.svg.area().x0(function(a){return V(a.id)(0)}).x1(function(a){return V(a.id)(a.value)}).y(Rc):g.svg.area().x(Rc).y0(function(a){return V(a.id)(0)}).y1(function(a){return V(a.id)(a.value)}),function(b){var c,d,e=Rd(b.values);return od([b],"area")||od([b],"area-spline")?(a.interpolate(vd(b)?"cardinal":"linear"),a(e)):(c=pf(e[0].x),d=V(b.id)(e[0].value),Xf?"M "+d+" "+c:"M "+c+" "+d)}}(),Bh=function(){var a=g.svg.line().x(Xf?function(a){return W(a.id)(a.value)}:Uc).y(Xf?Uc:function(a){return W(a.id)(a.value)});return function(b){var c=Rd(b.values);return ud(b)?a(c):"M "+sf(c[0].x)+" "+W(b.id)(c[0].value)}}(),Ch=function(){};yh=g.svg.brush().on("brush",ke),yh.update=function(){return Gh&&Gh.select(".x.brush").call(this),this},yh.scale=function(a){return Xf?this.y(a):this.x(a)},Ke&&(Ch=g.behavior.zoom().on("zoomstart",function(){Ch.altDomain=g.event.sourceEvent.altKey?pf.orgDomain():null}).on("zoom",Ke?le:null),Ch.scale=function(a){return Xf?this.y(a):this.x(a)},Ch.orgScaleExtent=function(){var a=Le?Le:[1,10];return[a[0],Math.max(nc()/a[1],a[1])]},Ch.updateScaleExtent=function(){var a=Xb(pf.orgDomain())/Xb(Kh),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Dh,Eh,Fh,Gh,Hh,Ih,Jh,Kh,Lh,Mh={};if(Ae.focus=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=Dh.selectAll(we(a)),d=c.filter(xe),e=c.filter(ye);Ae.revert(),Ae.defocus(),b(d.classed("focused",!0)),b(e),td(Ae.data.targets)&&Hb(a,!0),re(a)},Ae.defocus=function(a){function b(a){a.transition().duration(100).style("opacity",.3)}var c=Dh.selectAll(we(a)),d=c.filter(xe),e=c.filter(ye);Ae.revert(),b(d.classed("focused",!1)),b(e),td(Ae.data.targets)&&Ib(a),se(a)},Ae.revert=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=Dh.selectAll(we(a)),d=c.filter(xe),e=c.filter(ye);b(d.classed("focused",!1)),b(e),td(Ae.data.targets)&&Ib(a),te()},Ae.show=function(a){Dh.selectAll(we(a)).transition().style("opacity",1)},Ae.hide=function(a){Dh.selectAll(we(a)).transition().style("opacity",0)},Ae.unzoom=function(){yh.clear().update(),je({withUpdateXDomain:!0})},Ae.load=function(a){if("function"!=typeof a.done&&(a.done=function(){}),a.xs&&fc(a.xs),"categories"in a&&gh&&(Zf=a.categories,vf.categories(Zf)),"cacheIds"in a&&Yb(a.cacheIds))return void qe($b(a.cacheIds),a.done);if("data"in a)qe(jc(a.data),a.done);else if("url"in a)g.csv(a.url,function(b,c){qe(jc(c),a.done)});else if("rows"in a)qe(jc(hc(a.rows)),a.done);else{if(!("columns"in a))throw Error("url or rows or columns is required.");qe(jc(ic(a.columns)),a.done)}},Ae.unload=function(a){Ae.data.targets=Ae.data.targets.filter(function(b){return b.id!==a}),Dh.selectAll(we(a)).transition().style("opacity",0).remove(),Tf&&Hh.selectAll(".legend-item"+ve(a)).remove(),Ae.data.targets.length>0&&je({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Ae.selected=function(a){var b=ve(a);return g.merge(Fh.selectAll(".-shapes"+b).selectAll(".-shape").filter(function(){return g.select(this).classed(De)}).map(function(a){return a.map(function(a){return a.__data__})}))},Ae.select=function(a,b,c){Mf&&Fh.selectAll(".-shapes").selectAll(".-shape").each(function(d,f){var h="circle"===this.nodeName?Ld:Od,i="circle"===this.nodeName?Md:Pd,j=Nf||!a||a.indexOf(d.id)>=0,k=!b||b.indexOf(f)>=0;j&&k?Of(d)&&h(g.select(this).classed(De,!0),d,f):e(c)&&c&&i(g.select(this).classed(De,!1),d,f)})},Ae.unselect=function(a,b){Mf&&Fh.selectAll(".-shapes").selectAll(".-shape").each(function(c,d){var e="circle"===this.nodeName?Md:Pd,f=Nf||!a||a.indexOf(c.id)>=0,h=!b||b.indexOf(d)>=0;f&&h&&Of(c)&&e(g.select(this).classed(De,!1),c,d)})},Ae.toLine=function(a){nd(a,"line"),oe()},Ae.toSpline=function(a){nd(a,"spline"),oe()},Ae.toBar=function(a){nd(a,"bar"),oe()},Ae.toScatter=function(a){nd(a,"scatter"),oe()},Ae.toArea=function(a){nd(a,"area"),oe()},Ae.toAreaSpline=function(a){nd(a,"area-spline"),oe()},Ae.toPie=function(a){nd(a,"pie"),oe({withTransform:!0})},Ae.toDonut=function(a){nd(a,"donut"),oe({withTransform:!0})},Ae.groups=function(a){return d(a)?Ef:(Ef=a,je(),Ef)},Ae.xgrids=function(a){return a?(zg=a,je(),zg):zg},Ae.xgrids.add=function(a){return a?Ae.xgrids(zg.concat(a)):void 0},Ae.xgrids.remove=function(a){var b=ze(a);return Ae.xgrids(zg.filter(b))},Ae.ygrids=function(a){return a?(Bg=a,je(),Bg):Bg},Ae.ygrids.add=function(a){return a?Ae.ygrids(Bg.concat(a)):void 0},Ae.ygrids.remove=function(a){var b=ze(a);return Ae.ygrids(Bg.filter(b))},Ae.regions=function(a){return d(a)?Xg:(Xg=a,je(),Xg)},Ae.regions.add=function(a){return d(a)?Xg:(Xg=Xg.concat(a),je(),Xg)},Ae.regions.remove=function(a,b){var d=[].concat(a);return b=e(b)?b:{},d.forEach(function(a){var d=c(b.duration)?b.duration:0;Dh.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),Xg=Xg.filter(function(b){return b.classes.indexOf(a)<0})}),Xg},Ae.data.get=function(a){var b=Ae.data.getAsTarget(a);return e(b)?b.values.map(function(a){return a.value}):void 0},Ae.data.getAsTarget=function(a){var b=rc(function(b){return b.id===a});return b.length>0?b[0]:void 0},Ae.resize=function(a){Ge=a?a.width:null,He=a?a.height:null,oe({withLegend:!0,withTransition:!1})},Ae.destroy=function(){Ae.data.targets=void 0,Ae.data.x={},Jh.html(""),a.onresize=null},"url"in f.data)g.csv(f.data.url,function(a,b){ce(b)});else if("rows"in f.data)ce(hc(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");ce(ic(f.data.columns))}return Ae}}(window); \ No newline at end of file