diff --git a/c3.js b/c3.js index d08186b..f760f47 100644 --- a/c3.js +++ b/c3.js @@ -2199,8 +2199,8 @@ y2.domain(getYDomain('y2')); // axis - main.select(".x.axis").style("opacity", hideAxis ? 0 : 1).transition().duration(__axis_rotated ? duration : 0).call(__axis_rotated ? yAxis : xAxis); - main.select(".y.axis").style("opacity", hideAxis ? 0 : 1).transition().duration(__axis_rotated ? 0 : duration).call(__axis_rotated ? xAxis : yAxis); + main.select(".x.axis").style("opacity", hideAxis ? 0 : 1).transition().duration(duration).call(__axis_rotated ? yAxis : xAxis); + main.select(".y.axis").style("opacity", hideAxis ? 0 : 1).transition().duration(duration).call(__axis_rotated ? xAxis : yAxis); main.select(".y2.axis").style("opacity", hideAxis ? 0 : 1).transition().call(yAxis2); // setup drawer - MEMO: these must be called after axis updated @@ -2386,7 +2386,7 @@ // update subchart elements if needed if (withSubchart) { // axes - context.select('.x.axis').style("opacity", hideAxis ? 0 : 1).transition().duration(__axis_rotated ? duration : 0).call(subXAxis); + context.select('.x.axis').style("opacity", hideAxis ? 0 : 1).transition().duration(duration).call(subXAxis); // extent rect if (!brush.empty()) { brush.extent(x.orgDomain()).update(); diff --git a/c3.min.js b/c3.min.js index 88d27de..765c99f 100644 --- a/c3.min.js +++ b/c3.min.js @@ -50,47 +50,47 @@ c,c.index)}))}).call(e.behavior.drag().origin(Object).on("drag",function(){xd(e. a=a[1],k=Math.min(b,d),h=Math.max(b,d),m=xa?n:Math.min(c,a),p=xa?r:Math.max(c,a),l.select(".dragarea").attr("x",k).attr("y",m).attr("width",h-k).attr("height",p-m),l.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return ma(a)}).each(function(a,b){var c=e.select(this),d=c.classed(na),g=c.classed(nc),f,l,rd,n;f=!1;"circle"===this.nodeName?(f=1*c.attr("cx"),l=1*c.attr("cy"),n=ld,f=ka.value?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return Yb(a.value)});c.style("fill-opacity",se).transition().duration(s).attr("x",u).attr("y",v).style("fill-opacity",Uc);c.exit().transition().duration(a).style("fill-opacity",0).remove();l.selectAll(".-line").style("opacity",Ca).transition().duration(s).attr("d",We).style("opacity",1);l.selectAll(".-area").style("opacity",0).transition().duration(s).attr("d",Xe).style("opacity", -Ad);a=l.selectAll(".-circles").selectAll(".-circle").data(ze);a.enter().append("circle").attr("class",qe).style("opacity",0).attr("r",ec);a.style("opacity",Ca).transition().duration(s).style("opacity",te).attr("cx",h?Ha:Ga).attr("cy",h?Ga:Ha);a.exit().remove();l.selectAll(".chart-arc").select(".-arc").attr("transform",x?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(s).attrTween("d",function(a){a=oa(a);if(!a)return function(){return"M 0 0"};var b=e.interpolate(this._current, -a);this._current=b(0);return function(a){a=b(a);return gd(a.data)||Tb(a.data)?mb(a,!0):"M 0 0"}}).attr("transform",x?"scale(1)":"").style("opacity",1);l.selectAll(".chart-arc").select("text").attr("transform",eb).style("opacity",0).transition().duration(s).text(Cb).style("opacity",function(a){return gd(a.data)||Tb(a.data)?1:0});l.select(".chart-arcs-title").style("opacity",$(f.data.targets,"donut")?1:0);Ia&&(null!==e.event&&"zoom"===e.event.type&&J.extent(m.orgDomain()).update(),k&&(G.select(".x.axis").style("opacity", -w?0:1).transition().duration(h?s:0).call(Pb),J.empty()||J.extent(m.orgDomain()).update(),k=od(d,!0),d=G.selectAll(".-bars").selectAll(".-bar").data(hd),d.enter().append("path").attr("d",k).style("stroke","none").style("fill",function(a){return I(a.id)}).attr("class",Sc),d.style("opacity",Ca).transition().duration(s).attr("d",k).style("opacity",1),d.exit().transition().duration(s).style("opacity",0).remove(),G.selectAll(".-line").style("opacity",Ca).transition().duration(s).attr("d",Ye).style("opacity", -1)));l.selectAll(".selected-circles").filter(function(a){return wa(a)}).selectAll("circle").remove();l.selectAll(".selected-circle").transition().duration(s).attr("cx",h?Ha:Ga).attr("cy",h?Ga:Ha);ca?(k=l.select(".event-rects").selectAll(".event-rect").data([0]),Se(k.enter()),k.attr("x",0).attr("y",0).attr("width",q).attr("height",r)):(Wb?(p=function(a,b){var c=Nc(b),d=br&&(r=b,x||(s=(Qa-r*Object.keys(a).length)/ -2));c>q&&(q=c,x&&(s=(ta-q*Object.keys(a).length)/2))};d=Ja.selectAll(".legend-item").data(c).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+a}).style("cursor","pointer").on("click",function(a){af(a)}).on("mouseover",function(a){oc(a);f.focus(a)}).on("mouseout",function(){pc();f.revert()});d.append("text").text(function(a){return y(Va[a])?Va[a]:a}).each(function(){u(this)}).style("pointer-events","none").attr("x",x?h:-200).attr("y",x?-200:m);d.append("rect").attr("class", -"legend-item-event").style("fill-opacity",0).attr("x",x?l:-200).attr("y",x?-200:p).attr("width",r+14).attr("height",24);d.append("rect").attr("class","legend-item-tile").style("pointer-events","none").style("fill",function(a){return I(a)}).attr("x",x?h:-200).attr("y",x?-200:n).attr("width",10).attr("height",10);Ja.selectAll("text").data(c).each(function(){u(this)}).transition().duration(t?250:0).attr("x",h).attr("y",n);Ja.selectAll("rect.legend-item-event").data(c).transition().duration(t?250:0).attr("x", -l).attr("y",p);Ja.selectAll("rect.legend-item-tile").data(c).transition().duration(t?250:0).attr("x",e).attr("y",m)}function yb(a){return a?"-"+a.replace(/\./g,"\\."):""}function ka(a){return".target"+yb(a)}function qc(a){return Oc(a.id)}function rc(a){return"data"in a&&Oc(a.data.id)}var f={data:{}},rb={},ea="_expanded_",na="_selected_",nc="_included_",za=d(["bindto"],"#chart"),ra=d(["size","width"],null),Hb=d(["size","height"],null),gb=d(["padding","left"],null),zc=d(["padding","right"],null),fa= -d(["zoom","enabled"],!1),Bd=d(["zoom","extent"],null),Oe=d(["zoom","privileged"],!1),Ie=d(["onenter"],function(){}),Je=d(["onleave"],function(){}),Ue=d(["transition","duration"],350);if(!("data"in ga))throw Error("data is required in config");var va=d(["data","x"],null),ca=d(["data","xs"],null),$b=d(["data","x_format"],"%Y-%m-%d"),je=d(["data","id_converter"],function(a){return a}),Va=d(["data","names"],{}),u=d(["data","groups"],[]),Dc=d(["data","axes"],{}),Mc=d(["data","type"],null),z=d(["data", -"types"],{}),Da=d(["data","labels"],{}),Fa=d(["data","order"],null),Cd=d(["data","regions"],{}),bf=d(["data","colors"],{}),la=d(["data","selection","enabled"],!1),xa=d(["data","selection","grouped"],!1),ma=d(["data","selection","isselectable"],function(){return!0}),Ia=d(["subchart","show"],!1),Eb=Ia?d(["subchart","size","height"],60):0,cf=d(["color","pattern"],null),ia=d(["legend","show"],!0),df=d(["legend","position"],"bottom"),af=d(["legend","item","onclick"],function(){}),h=d(["axis","rotated"], -!1),sc=d(["axis","x","type"],"indexed"),Sa=d(["axis","x","categories"],[]),Pd=d(["axis","x","tick","centered"],!1),nb=d(["axis","x","tick","format"],null),Sd=d(["axis","x","tick","culling"],h||"categorized"===sc?!1:!0),Ec=d(["axis","x","tick","count"],10),wb=d(["axis","x","default"],null),Ke=d(["axis","x","label"],null),$d=d(["axis","y","max"],null),Yd=d(["axis","y","min"],null),be=d(["axis","y","center"],null),Le=d(["axis","y","label"],null),hb=d(["axis","y","inner"],!1),Rb=d(["axis","y","tick", -"format"],null),Ta=d(["axis","y","padding"],null),Ld=d(["axis","y","ticks"],10),fb=d(["axis","y2","show"],!1),Zd=d(["axis","y2","max"],null),Xd=d(["axis","y2","min"],null),ae=d(["axis","y2","center"],null),Ib=d(["axis","y2","inner"],!1),Nd=d(["axis","y2","tick","format"],null),Ua=d(["axis","y2","padding"],null),Od=d(["axis","y2","ticks"],10),sd=d(["grid","x","show"],!1),Ve=d(["grid","x","type"],"tick"),hc=d(["grid","x","lines"],null),td=d(["grid","y","show"],!1),ic=d(["grid","y","lines"],null),ec= -d(["point","show"],!0)?d(["point","r"],2.5):0,Me=d(["point","focus","line","enabled"],!0),jc=d(["point","focus","expand","enabled"],!0),kc=d(["point","focus","expand","r"],jc?4:ec),ab=d(["point","focus","select","r"],8),Te=d(["point","onclick"],function(){}),Ce=d(["point","onselected"],function(){}),De=d(["point","onunselected"],function(){}),Td=d(["arc","label","format"],function(a,b){return(100*b).toFixed(1)+"%"}),Ne=d(["arc","title"],""),O=d(["regions"],[]),bd=d(["tooltip","enabled"],!0),Dd=d(["tooltip", -"format","title"],null),Ed=d(["tooltip","format","value"],null),cd=d(["tooltip","contents"],function(a,b,c,d){b=Dd?Dd:b;c=Ed?Ed:c;var e,f,h,l;for(f=0;f"+e+""),l=a[f].name,h=c(a[f].value),e+=""+l+""+h+"");return e+""}),Pe= -d(["tooltip","init","show"],!1),Ka=d(["tooltip","init","x"],0),vd=d(["tooltip","init","position"],{top:"0px",left:"50px"}),gc=za.replace("#","")+"-clip",bb="url("+document.URL+"#"+gc+")",C="timeseries"===sc,ja="categorized"===sc,Wb=!C&&(va||ca),mc=null,cb=!1,lc=!1,I=function(a,b){var c=[],d=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");return function(b){if(b in a)return a[b];-1===c.indexOf(b)&&c.push(b);return d[c.indexOf(b)%d.length]}}(bf, -cf),Qd=function(){var a=[[e.time.format("%Y/%-m/%-d"),function(){return!0}],[e.time.format("%-m/%-d"),function(a){return a.getMonth()}],[e.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[e.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[e.time.format("%I %p"),function(a){return a.getHours()}],[e.time.format("%I:%M"),function(a){return a.getMinutes()}],[e.time.format(":%S"),function(a){return a.getSeconds()}],[e.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)}}(),q,Fb,r,ib,Pa,sa,ta,Qa,Ra,jb,Gb,mb,Bc,Cc,Sb,Jb,Kb,Lb,Mb,Nb,Ob,m,D,ba,T,kb,lb,S,Qb,Ac,Pb,Id=h?"left":"bottom",Kd=h?hb?"top":"bottom":hb?"right":"left",Md=h?Ib?"bottom":"top":Ib?"left":"right",Jd=h?"left":"bottom",K={main:function(){return"translate("+v+","+n+")"},context:function(){return"translate("+Na+","+Ab+")"},legend:function(){return"translate("+zb+","+tc+")"},y2:function(){return"translate("+(h?0:q)+","+(h?1: -0)+")"},x:function(){return"translate(0,"+r+")"},subx:function(){return"translate(0,"+(h?0:ib)+")"},arc:function(){return"translate("+q/2+","+r/2+")"}},x="right"===df,yc=40,xc=20;Sb=e.layout.pie().value(function(a){return a.values.reduce(function(a,c){return a+c.value},0)});var We=function(){var a=e.svg.line().x(h?function(a){return t(a.id)(a.value)}:Ea).y(h?Ea:function(a){return t(a.id)(a.value)});return function(b){var c=bc(b.values),d;if(tb(b))return fd(b)?a.interpolate("cardinal"):a.interpolate("linear"), -Cd[b.id]?He(c,m,t(b.id),Cd[b.id]):a(c);d=m(c[0].x);b=t(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),Xe=function(){var a;a=h?e.svg.area().x0(function(a){return t(a.id)(0)}).x1(function(a){return t(a.id)(a.value)}).y(Ea):e.svg.area().x(Ea).y0(function(a){return t(a.id)(0)}).y1(function(a){return t(a.id)(a.value)});return function(b){var c=bc(b.values),d;if($([b],"area")||$([b],"area-spline"))return fd(b)?a.interpolate("cardinal"):a.interpolate("linear"),a(c);d=m(c[0].x);b=t(b.id)(c[0].value); -return h?"M "+b+" "+d:"M "+d+" "+b}}(),Ye=function(){var a=e.svg.line().x(h?function(a){return H(a.id)(a.value)}:Wc).y(h?Wc:function(a){return H(a.id)(a.value)});return function(b){var c=bc(b.values);return tb(b)?a(c):"M "+T(c[0].x)+" "+H(b.id)(c[0].value)}}(),J,E=function(){};J=e.svg.brush().on("brush",function(){V({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})});J.update=function(){G&&G.select(".x.brush").call(this);return this};J.scale=function(a){return h?this.y(a):this.x(a)}; -fa&&(E=e.behavior.zoom().on("zoomstart",function(){E.altDomain=e.event.sourceEvent.altKey?m.orgDomain():null}).on("zoom",fa?Ze:null),E.scale=function(a){return h?this.y(a):this.x(a)},E.orgScaleExtent=function(){var a=Bd?Bd:[1,10];return[a[0],Math.max(Ba()/a[1],a[1])]},E.updateScaleExtent=function(){var a=Aa(m.orgDomain())/Aa(aa),b=this.orgScaleExtent();this.scaleExtent([b[0]*a,b[1]*a]);return this});var p,vb,l,G,Ja,U,ub,aa,Ad,Xb={};f.focus=function(a){var b=p.selectAll(ka(a)),c=b.filter(qc),b=b.filter(rc); -f.revert();f.defocus();c.classed("focused",!0).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity",1);B(f.data.targets)&&wc(a,!0);oc(a)};f.defocus=function(a){var b=p.selectAll(ka(a)),c=b.filter(qc),b=b.filter(rc);f.revert();c.classed("focused",!1).transition().duration(100).style("opacity",0.3);b.transition().duration(100).style("opacity",0.3);B(f.data.targets)&&Ub(a);$e(a)};f.revert=function(a){var b=p.selectAll(ka(a)),c=b.filter(qc),b=b.filter(rc);c.classed("focused", -!1).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity",1);B(f.data.targets)&&Ub(a);pc()};f.show=function(a){p.selectAll(ka(a)).transition().style("opacity",1)};f.hide=function(a){p.selectAll(ka(a)).transition().style("opacity",0)};f.unzoom=function(){J.clear().update();V({withUpdateXDomain:!0})};f.load=function(a){"function"!==typeof a.done&&(a.done=function(){});a.xs&&ie(a.xs);"categories"in a&&ja&&(Sa=a.categories,S.categories(Sa));if("cacheIds"in a&&ee(a.cacheIds))db(fe(a.cacheIds), -a.done);else if("data"in a)db(Wa(a.data),a.done);else if("url"in a)e.csv(a.url,function(b,c){db(Wa(c),a.done)});else if("rows"in a)db(Wa(Kc(a.rows)),a.done);else if("columns"in a)db(Wa(Lc(a.columns)),a.done);else throw Error("url or rows or columns is required.");};f.unload=function(a){f.data.targets=f.data.targets.filter(function(b){return b.id!==a});p.selectAll(ka(a)).transition().style("opacity",0).remove();ia&&(p.selectAll(".legend-item"+yb(a)).remove(),xb(f.data.targets));0b.classes.indexOf(a)})});return O};f.data.get=function(a){a=f.data.getAsTarget(a);return y(a)?a.values.map(function(a){return a.value}):void 0};f.data.getAsTarget=function(a){var b=pb(function(b){return b.id===a});return 0a.value?"end":"start": +"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return Yb(a.value)});c.style("fill-opacity",se).transition().duration(s).attr("x",u).attr("y",v).style("fill-opacity",Uc);c.exit().transition().duration(a).style("fill-opacity",0).remove();l.selectAll(".-line").style("opacity",Ca).transition().duration(s).attr("d",We).style("opacity",1);l.selectAll(".-area").style("opacity",0).transition().duration(s).attr("d",Xe).style("opacity",Ad);a=l.selectAll(".-circles").selectAll(".-circle").data(ze); +a.enter().append("circle").attr("class",qe).style("opacity",0).attr("r",ec);a.style("opacity",Ca).transition().duration(s).style("opacity",te).attr("cx",h?Ha:Ga).attr("cy",h?Ga:Ha);a.exit().remove();l.selectAll(".chart-arc").select(".-arc").attr("transform",x?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(s).attrTween("d",function(a){a=oa(a);if(!a)return function(){return"M 0 0"};var b=e.interpolate(this._current,a);this._current=b(0);return function(a){a= +b(a);return gd(a.data)||Tb(a.data)?mb(a,!0):"M 0 0"}}).attr("transform",x?"scale(1)":"").style("opacity",1);l.selectAll(".chart-arc").select("text").attr("transform",eb).style("opacity",0).transition().duration(s).text(Cb).style("opacity",function(a){return gd(a.data)||Tb(a.data)?1:0});l.select(".chart-arcs-title").style("opacity",$(f.data.targets,"donut")?1:0);Ia&&(null!==e.event&&"zoom"===e.event.type&&J.extent(m.orgDomain()).update(),k&&(G.select(".x.axis").style("opacity",w?0:1).transition().duration(s).call(Pb), +J.empty()||J.extent(m.orgDomain()).update(),k=od(d,!0),d=G.selectAll(".-bars").selectAll(".-bar").data(hd),d.enter().append("path").attr("d",k).style("stroke","none").style("fill",function(a){return I(a.id)}).attr("class",Sc),d.style("opacity",Ca).transition().duration(s).attr("d",k).style("opacity",1),d.exit().transition().duration(s).style("opacity",0).remove(),G.selectAll(".-line").style("opacity",Ca).transition().duration(s).attr("d",Ye).style("opacity",1)));l.selectAll(".selected-circles").filter(function(a){return wa(a)}).selectAll("circle").remove(); +l.selectAll(".selected-circle").transition().duration(s).attr("cx",h?Ha:Ga).attr("cy",h?Ga:Ha);ca?(k=l.select(".event-rects").selectAll(".event-rect").data([0]),Se(k.enter()),k.attr("x",0).attr("y",0).attr("width",q).attr("height",r)):(Wb?(p=function(a,b){var c=Nc(b),d=br&&(r=b,x||(s=(Qa-r*Object.keys(a).length)/2));c>q&&(q=c,x&& +(s=(ta-q*Object.keys(a).length)/2))};d=Ja.selectAll(".legend-item").data(c).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+a}).style("cursor","pointer").on("click",function(a){af(a)}).on("mouseover",function(a){oc(a);f.focus(a)}).on("mouseout",function(){pc();f.revert()});d.append("text").text(function(a){return y(Va[a])?Va[a]:a}).each(function(){u(this)}).style("pointer-events","none").attr("x",x?h:-200).attr("y",x?-200:m);d.append("rect").attr("class","legend-item-event").style("fill-opacity", +0).attr("x",x?l:-200).attr("y",x?-200:p).attr("width",r+14).attr("height",24);d.append("rect").attr("class","legend-item-tile").style("pointer-events","none").style("fill",function(a){return I(a)}).attr("x",x?h:-200).attr("y",x?-200:n).attr("width",10).attr("height",10);Ja.selectAll("text").data(c).each(function(){u(this)}).transition().duration(t?250:0).attr("x",h).attr("y",n);Ja.selectAll("rect.legend-item-event").data(c).transition().duration(t?250:0).attr("x",l).attr("y",p);Ja.selectAll("rect.legend-item-tile").data(c).transition().duration(t? +250:0).attr("x",e).attr("y",m)}function yb(a){return a?"-"+a.replace(/\./g,"\\."):""}function ka(a){return".target"+yb(a)}function qc(a){return Oc(a.id)}function rc(a){return"data"in a&&Oc(a.data.id)}var f={data:{}},rb={},ea="_expanded_",na="_selected_",nc="_included_",za=d(["bindto"],"#chart"),ra=d(["size","width"],null),Hb=d(["size","height"],null),gb=d(["padding","left"],null),zc=d(["padding","right"],null),fa=d(["zoom","enabled"],!1),Bd=d(["zoom","extent"],null),Oe=d(["zoom","privileged"],!1), +Ie=d(["onenter"],function(){}),Je=d(["onleave"],function(){}),Ue=d(["transition","duration"],350);if(!("data"in ga))throw Error("data is required in config");var va=d(["data","x"],null),ca=d(["data","xs"],null),$b=d(["data","x_format"],"%Y-%m-%d"),je=d(["data","id_converter"],function(a){return a}),Va=d(["data","names"],{}),u=d(["data","groups"],[]),Dc=d(["data","axes"],{}),Mc=d(["data","type"],null),z=d(["data","types"],{}),Da=d(["data","labels"],{}),Fa=d(["data","order"],null),Cd=d(["data","regions"], +{}),bf=d(["data","colors"],{}),la=d(["data","selection","enabled"],!1),xa=d(["data","selection","grouped"],!1),ma=d(["data","selection","isselectable"],function(){return!0}),Ia=d(["subchart","show"],!1),Eb=Ia?d(["subchart","size","height"],60):0,cf=d(["color","pattern"],null),ia=d(["legend","show"],!0),df=d(["legend","position"],"bottom"),af=d(["legend","item","onclick"],function(){}),h=d(["axis","rotated"],!1),sc=d(["axis","x","type"],"indexed"),Sa=d(["axis","x","categories"],[]),Pd=d(["axis","x", +"tick","centered"],!1),nb=d(["axis","x","tick","format"],null),Sd=d(["axis","x","tick","culling"],h||"categorized"===sc?!1:!0),Ec=d(["axis","x","tick","count"],10),wb=d(["axis","x","default"],null),Ke=d(["axis","x","label"],null),$d=d(["axis","y","max"],null),Yd=d(["axis","y","min"],null),be=d(["axis","y","center"],null),Le=d(["axis","y","label"],null),hb=d(["axis","y","inner"],!1),Rb=d(["axis","y","tick","format"],null),Ta=d(["axis","y","padding"],null),Ld=d(["axis","y","ticks"],10),fb=d(["axis", +"y2","show"],!1),Zd=d(["axis","y2","max"],null),Xd=d(["axis","y2","min"],null),ae=d(["axis","y2","center"],null),Ib=d(["axis","y2","inner"],!1),Nd=d(["axis","y2","tick","format"],null),Ua=d(["axis","y2","padding"],null),Od=d(["axis","y2","ticks"],10),sd=d(["grid","x","show"],!1),Ve=d(["grid","x","type"],"tick"),hc=d(["grid","x","lines"],null),td=d(["grid","y","show"],!1),ic=d(["grid","y","lines"],null),ec=d(["point","show"],!0)?d(["point","r"],2.5):0,Me=d(["point","focus","line","enabled"],!0),jc= +d(["point","focus","expand","enabled"],!0),kc=d(["point","focus","expand","r"],jc?4:ec),ab=d(["point","focus","select","r"],8),Te=d(["point","onclick"],function(){}),Ce=d(["point","onselected"],function(){}),De=d(["point","onunselected"],function(){}),Td=d(["arc","label","format"],function(a,b){return(100*b).toFixed(1)+"%"}),Ne=d(["arc","title"],""),O=d(["regions"],[]),bd=d(["tooltip","enabled"],!0),Dd=d(["tooltip","format","title"],null),Ed=d(["tooltip","format","value"],null),cd=d(["tooltip","contents"], +function(a,b,c,d){b=Dd?Dd:b;c=Ed?Ed:c;var e,f,h,l;for(f=0;f"+e+""),l=a[f].name,h=c(a[f].value),e+=""+l+""+h+"");return e+""}),Pe=d(["tooltip","init","show"],!1),Ka=d(["tooltip","init","x"],0),vd=d(["tooltip","init","position"], +{top:"0px",left:"50px"}),gc=za.replace("#","")+"-clip",bb="url("+document.URL+"#"+gc+")",C="timeseries"===sc,ja="categorized"===sc,Wb=!C&&(va||ca),mc=null,cb=!1,lc=!1,I=function(a,b){var c=[],d=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");return function(b){if(b in a)return a[b];-1===c.indexOf(b)&&c.push(b);return d[c.indexOf(b)%d.length]}}(bf,cf),Qd=function(){var a=[[e.time.format("%Y/%-m/%-d"),function(){return!0}],[e.time.format("%-m/%-d"), +function(a){return a.getMonth()}],[e.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[e.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[e.time.format("%I %p"),function(a){return a.getHours()}],[e.time.format("%I:%M"),function(a){return a.getMinutes()}],[e.time.format(":%S"),function(a){return a.getSeconds()}],[e.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)}}(),q,Fb, +r,ib,Pa,sa,ta,Qa,Ra,jb,Gb,mb,Bc,Cc,Sb,Jb,Kb,Lb,Mb,Nb,Ob,m,D,ba,T,kb,lb,S,Qb,Ac,Pb,Id=h?"left":"bottom",Kd=h?hb?"top":"bottom":hb?"right":"left",Md=h?Ib?"bottom":"top":Ib?"left":"right",Jd=h?"left":"bottom",K={main:function(){return"translate("+v+","+n+")"},context:function(){return"translate("+Na+","+Ab+")"},legend:function(){return"translate("+zb+","+tc+")"},y2:function(){return"translate("+(h?0:q)+","+(h?1:0)+")"},x:function(){return"translate(0,"+r+")"},subx:function(){return"translate(0,"+(h? +0:ib)+")"},arc:function(){return"translate("+q/2+","+r/2+")"}},x="right"===df,yc=40,xc=20;Sb=e.layout.pie().value(function(a){return a.values.reduce(function(a,c){return a+c.value},0)});var We=function(){var a=e.svg.line().x(h?function(a){return t(a.id)(a.value)}:Ea).y(h?Ea:function(a){return t(a.id)(a.value)});return function(b){var c=bc(b.values),d;if(tb(b))return fd(b)?a.interpolate("cardinal"):a.interpolate("linear"),Cd[b.id]?He(c,m,t(b.id),Cd[b.id]):a(c);d=m(c[0].x);b=t(b.id)(c[0].value);return h? +"M "+b+" "+d:"M "+d+" "+b}}(),Xe=function(){var a;a=h?e.svg.area().x0(function(a){return t(a.id)(0)}).x1(function(a){return t(a.id)(a.value)}).y(Ea):e.svg.area().x(Ea).y0(function(a){return t(a.id)(0)}).y1(function(a){return t(a.id)(a.value)});return function(b){var c=bc(b.values),d;if($([b],"area")||$([b],"area-spline"))return fd(b)?a.interpolate("cardinal"):a.interpolate("linear"),a(c);d=m(c[0].x);b=t(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),Ye=function(){var a=e.svg.line().x(h? +function(a){return H(a.id)(a.value)}:Wc).y(h?Wc:function(a){return H(a.id)(a.value)});return function(b){var c=bc(b.values);return tb(b)?a(c):"M "+T(c[0].x)+" "+H(b.id)(c[0].value)}}(),J,E=function(){};J=e.svg.brush().on("brush",function(){V({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})});J.update=function(){G&&G.select(".x.brush").call(this);return this};J.scale=function(a){return h?this.y(a):this.x(a)};fa&&(E=e.behavior.zoom().on("zoomstart",function(){E.altDomain=e.event.sourceEvent.altKey? +m.orgDomain():null}).on("zoom",fa?Ze:null),E.scale=function(a){return h?this.y(a):this.x(a)},E.orgScaleExtent=function(){var a=Bd?Bd:[1,10];return[a[0],Math.max(Ba()/a[1],a[1])]},E.updateScaleExtent=function(){var a=Aa(m.orgDomain())/Aa(aa),b=this.orgScaleExtent();this.scaleExtent([b[0]*a,b[1]*a]);return this});var p,vb,l,G,Ja,U,ub,aa,Ad,Xb={};f.focus=function(a){var b=p.selectAll(ka(a)),c=b.filter(qc),b=b.filter(rc);f.revert();f.defocus();c.classed("focused",!0).transition().duration(100).style("opacity", +1);b.transition().duration(100).style("opacity",1);B(f.data.targets)&&wc(a,!0);oc(a)};f.defocus=function(a){var b=p.selectAll(ka(a)),c=b.filter(qc),b=b.filter(rc);f.revert();c.classed("focused",!1).transition().duration(100).style("opacity",0.3);b.transition().duration(100).style("opacity",0.3);B(f.data.targets)&&Ub(a);$e(a)};f.revert=function(a){var b=p.selectAll(ka(a)),c=b.filter(qc),b=b.filter(rc);c.classed("focused",!1).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity", +1);B(f.data.targets)&&Ub(a);pc()};f.show=function(a){p.selectAll(ka(a)).transition().style("opacity",1)};f.hide=function(a){p.selectAll(ka(a)).transition().style("opacity",0)};f.unzoom=function(){J.clear().update();V({withUpdateXDomain:!0})};f.load=function(a){"function"!==typeof a.done&&(a.done=function(){});a.xs&&ie(a.xs);"categories"in a&&ja&&(Sa=a.categories,S.categories(Sa));if("cacheIds"in a&&ee(a.cacheIds))db(fe(a.cacheIds),a.done);else if("data"in a)db(Wa(a.data),a.done);else if("url"in a)e.csv(a.url, +function(b,c){db(Wa(c),a.done)});else if("rows"in a)db(Wa(Kc(a.rows)),a.done);else if("columns"in a)db(Wa(Lc(a.columns)),a.done);else throw Error("url or rows or columns is required.");};f.unload=function(a){f.data.targets=f.data.targets.filter(function(b){return b.id!==a});p.selectAll(ka(a)).transition().style("opacity",0).remove();ia&&(p.selectAll(".legend-item"+yb(a)).remove(),xb(f.data.targets));0b.classes.indexOf(a)})});return O};f.data.get=function(a){a=f.data.getAsTarget(a);return y(a)?a.values.map(function(a){return a.value}):void 0};f.data.getAsTarget=function(a){var b=pb(function(b){return b.id===a});return 0