diff --git a/c3.js b/c3.js index a06b2ef..d060110 100644 --- a/c3.js +++ b/c3.js @@ -790,6 +790,10 @@ function classRegion(d, i) { return 'region region-' + i + ' ' + ('classes' in d ? [].concat(d.classes).join(' ') : ''); } function classEvent(d, i) { return "event-rect event-rect-" + i; } + function opacityCircle(d) { + return d.value ? isScatterType(d) ? 0.5 : 1 : 0; + } + function xx(d) { return x(d.x); } @@ -2062,7 +2066,7 @@ .attr("class", classCircle) .attr("r", __point_r); mainCircle.transition().duration(duration) - .style('opacity', function (d) { return d.value === null ? 0 : 1; }) + .style('opacity', opacityCircle) .attr("cx", __axis_rotated ? circleY : circleX) .attr("cy", __axis_rotated ? circleX : circleY); mainCircle.exit().remove(); diff --git a/c3.min.js b/c3.min.js index b4bafb8..57cedc0 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,86 +1,86 @@ -(function(P){function jd(){function r(d,f){d.attr("transform",function(d){return"translate("+(f(d)+ba)+", 0)"})}function x(d,f){d.attr("transform",function(d){return"translate(0,"+f(d)+")"})}function P(d){var f=d[0];d=d[d.length-1];return fa?a:0}),c=1;c -+a||(b[e][c]+=+a)});return d.max(Object.keys(b).map(function(a){return d.max(b[a])}))}function mb(a){var b=nb(function(b){return y(b.id)===a}),c="y2"===a?vd:wd,e="y2"===a?xd:yd,c=c?c:sd(b),e=e?e:td(b),k=0.1*Math.abs(e-c),d=k,f=k,g="y2"===a?zd:Ad;g&&(c=Math.max(Math.abs(c),Math.abs(e)),e=c-g,c=g-c);"y"===a&&Ga&&(d=Ga.top?Ga.top:k,f=Ga.bottom?Ga.bottom:k);"y2"===a&&Ha&&(d=Ha.top?Ha.top:k,f=Ha.bottom?Ha.bottom:k);Ia(b,"bar")&&!rc(b)&&(f=c);return[c-f,e+d]}function kc(a){var b;a?(a=m.domain(),b=K.extent()): -(a=V,b=m.domain());return(a[1]-a[0])/(b[1]-b[0])}function Bd(a){return d.min(a,function(a){return d.min(a.values,function(a){return a.x})})}function Cd(a){return d.max(a,function(a){return d.max(a.values,function(a){return a.x})})}function ob(a){var b=[Bd(a),Cd(a)];a=b[0];var b=b[1],c=ea?0:0.01*Math.abs(a-b);a=B?new Date(a.getTime()-c):a-c;b=B?new Date(b.getTime()+c):b+c;return[a,b]}function Dd(a){for(var b=0;ba?0:a}function uc(a){return oa&&a===oa||Z&&Fd(Z,a)}function Gd(a){return!uc(a)}function Hd(a){Object.keys(a).forEach(function(b){Z[b]=a[b]})}function qb(a){var b;a&&(b=Ja[a.id],a.name=b?b:a.id);return a}function vc(a){var b=a[0],c={},e=[],k,d;for(k=1;kb&&(c=a,b=a.values.length)}):c=a?g.data.targets[0]:null;return c}function rb(a){a=x(a)?g.data.targets:a;return a.map(function(a){return a.id})}function yc(a){var b= -rb(),c;for(c=0;ca})}function ud(a){return zc(a,function(a){return 0k&&(d-=c+30));c=b[1]+ -15+et[c].indexOf(k.id)))for(e=0;e=f;f+=s)g+=e(a[d-1],a[d],f,ya)}return g}function Pb(a){var b;tb=d.select(ua);if(tb.empty())P.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".'); -else{tb.html("");g.data.x={};g.data.targets=Ka(a);ra();R();m.domain(d.extent(ob(g.data.targets)));z.domain(mb("y"));Y.domain(mb("y2"));U.domain(m.domain());hb.domain(z.domain());ib.domain(Y.domain());J.ticks(10>a.length?a.length:10);ma.ticks(Zd).outerTickSize(0).tickFormat($d);jb.ticks(ae).outerTickSize(0).tickFormat(be);V=m.domain();K.x(U);pa&&F.x(m);n=d.select(ua).append("svg").attr("width",q+I+da).attr("height",s+u+O).on("mouseenter",ce).on("mouseleave",de);ub=n.append("defs");ub.append("clipPath").attr("id", +(2*Math.PI)).toFixed(1)+"%"}function Ya(a,b){var c=n.selectAll(".chart-arc.target"+(a?"-"+a:"")),e=n.selectAll(".-arc").filter(function(b){return b.data.id!==a});c.selectAll("path").transition().duration(50).attr("d",nc).transition().duration(100).attr("d",oc);b||e.style("opacity",0.3)}function xb(a){n.selectAll(".chart-arc.target"+(a?"-"+a:"")).selectAll("path").transition().duration(50).attr("d",kb);n.selectAll(".-arc").style("opacity",1)}function td(a){var b=qc(a),c,e,k,D;if(0a?a:0}),c=1;c ++a||(b[e][c]+=+a)});return d.max(Object.keys(b).map(function(a){return d.max(b[a])}))}function mb(a){var b=nb(function(b){return y(b.id)===a}),c="y2"===a?wd:xd,e="y2"===a?yd:zd,c=c?c:td(b),e=e?e:ud(b),k=0.1*Math.abs(e-c),d=k,f=k,g="y2"===a?Ad:Bd;g&&(c=Math.max(Math.abs(c),Math.abs(e)),e=c-g,c=g-c);"y"===a&&Ga&&(d=Ga.top?Ga.top:k,f=Ga.bottom?Ga.bottom:k);"y2"===a&&Ha&&(d=Ha.top?Ha.top:k,f=Ha.bottom?Ha.bottom:k);Ia(b,"bar")&&!rc(b)&&(f=c);return[c-f,e+d]}function kc(a){var b;a?(a=m.domain(),b=K.extent()): +(a=V,b=m.domain());return(a[1]-a[0])/(b[1]-b[0])}function Cd(a){return d.min(a,function(a){return d.min(a.values,function(a){return a.x})})}function Dd(a){return d.max(a,function(a){return d.max(a.values,function(a){return a.x})})}function ob(a){var b=[Cd(a),Dd(a)];a=b[0];var b=b[1],c=ea?0:0.01*Math.abs(a-b);a=B?new Date(a.getTime()-c):a-c;b=B?new Date(b.getTime()+c):b+c;return[a,b]}function Ed(a){for(var b=0;ba?0:a}function uc(a){return oa&&a===oa||Z&&Gd(Z,a)}function Hd(a){return!uc(a)}function Id(a){Object.keys(a).forEach(function(b){Z[b]=a[b]})}function qb(a){var b;a&&(b=Ja[a.id],a.name=b?b:a.id);return a}function vc(a){var b=a[0],c={},e=[],k,d;for(k=1;kb&&(c=a,b=a.values.length)}):c=a?g.data.targets[0]:null;return c}function rb(a){a=x(a)?g.data.targets:a;return a.map(function(a){return a.id})}function yc(a){var b= +rb(),c;for(c=0;ca})}function vd(a){return zc(a,function(a){return 0k&&(d-=c+30));c=b[1]+15+et[c].indexOf(k.id)))for(e=0;e=f;f+=s)g+=e(a[d-1],a[d],f,ya)}return g}function Pb(a){var b;tb=d.select(ua);if(tb.empty())P.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".'); +else{tb.html("");g.data.x={};g.data.targets=Ka(a);ra();R();m.domain(d.extent(ob(g.data.targets)));z.domain(mb("y"));Y.domain(mb("y2"));U.domain(m.domain());hb.domain(z.domain());ib.domain(Y.domain());J.ticks(10>a.length?a.length:10);ma.ticks(ae).outerTickSize(0).tickFormat(be);jb.ticks(ce).outerTickSize(0).tickFormat(de);V=m.domain();K.x(U);pa&&F.x(m);n=d.select(ua).append("svg").attr("width",q+I+da).attr("height",s+u+O).on("mouseenter",ee).on("mouseleave",fe);ub=n.append("defs");ub.append("clipPath").attr("id", Qb).append("rect").attr("y",u).attr("width",q).attr("height",s-u);ub.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1-I).attr("y",-20).attr("width",N).attr("height",ca);ub.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-I+1).attr("y",u-1).attr("width",ia).attr("height",yb);l=n.append("g").attr("transform",M.main);A=za?n.append("g").attr("transform",M.context):null;Aa=Ba?n.append("g").attr("transform",M.legend):null;W=d.select(ua).style("position","relative").append("div").style("position", -"absolute").style("z-index","10").style("display","none");l.append("g").attr("class","x axis").attr("clip-path",h?"":"url(#xaxis-clip)").attr("transform",M.x).call(h?ma:J).append("text").attr("class","-axis-x-label").attr("x",q).attr("dy","-.5em").style("text-anchor","end").text(ee);l.append("g").attr("class","y axis").attr("clip-path",h?"url(#yaxis-clip)":"").call(h?J:ma).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(fe);Ab&& -l.append("g").attr("class","y2 axis").attr("transform",M.y2).call(jb);a=l.append("g").attr("clip-path",Qa).attr("class","grid");Wc&&a.append("g").attr("class","xgrids");Rb&&(b=a.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(Rb).enter().append("g").attr("class","xgrid-line"),b.append("line").attr("class",function(a){return""+a["class"]}),b.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",h?"":"rotate(-90)").attr("dx",h? -0:-u).attr("dy",-5).text(function(a){return a.text}));ge&&a.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",h?0:-10).attr("x2",h?q:-10).attr("y1",h?-10:u).attr("y2",h?-10:s);Xc&&a.append("g").attr("class","ygrids");Sb&&(a=a.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(Sb).enter().append("g").attr("class","ygrid-line"),a.append("line").attr("class",function(a){return""+a["class"]}),a.append("text").attr("class",function(a){return""+ +"absolute").style("z-index","10").style("display","none");l.append("g").attr("class","x axis").attr("clip-path",h?"":"url(#xaxis-clip)").attr("transform",M.x).call(h?ma:J).append("text").attr("class","-axis-x-label").attr("x",q).attr("dy","-.5em").style("text-anchor","end").text(ge);l.append("g").attr("class","y axis").attr("clip-path",h?"url(#yaxis-clip)":"").call(h?J:ma).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(he);Ab&& +l.append("g").attr("class","y2 axis").attr("transform",M.y2).call(jb);a=l.append("g").attr("clip-path",Qa).attr("class","grid");Xc&&a.append("g").attr("class","xgrids");Rb&&(b=a.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(Rb).enter().append("g").attr("class","xgrid-line"),b.append("line").attr("class",function(a){return""+a["class"]}),b.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",h?"":"rotate(-90)").attr("dx",h? +0:-u).attr("dy",-5).text(function(a){return a.text}));ie&&a.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",h?0:-10).attr("x2",h?q:-10).attr("y1",h?-10:u).attr("y2",h?-10:s);Yc&&a.append("g").attr("class","ygrids");Sb&&(a=a.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(Sb).enter().append("g").attr("class","ygrid-line"),a.append("line").attr("class",function(a){return""+a["class"]}),a.append("text").attr("class",function(a){return""+ a["class"]}).attr("text-anchor","end").attr("transform",h?"rotate(-90)":"").attr("dx",h?0:-u).attr("dy",-5).text(function(a){return a.text}));l.append("g").attr("clip-path",Qa).attr("class","regions");l.append("g").attr("clip-path",Qa).attr("class","chart");l.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",pa?"ew-resize":null);l.select(".chart").append("g").attr("class","chart-bars");l.select(".chart").append("g").attr("class","chart-lines");l.select(".chart").append("g").attr("class", -"chart-arcs").attr("transform",M.arc);if(pa)l.insert("rect",he?null:"g.grid").attr("class","zoom-rect").attr("width",q).attr("height",s).style("opacity",0).style("cursor","ew-resize").call(F).on("dblclick.zoom",null);null!==vb&&K.extent("function"!==typeof vb?vb:vb(ob()));za&&(A.append("g").attr("clip-path",Qa).attr("class","chart"),A.select(".chart").append("g").attr("class","chart-bars"),A.select(".chart").append("g").attr("class","chart-lines"),A.append("g").attr("clip-path",Qa).attr("class","x brush").call(K).selectAll("rect").attr("height", -ta),A.append("g").attr("class","x axis").attr("transform",M.subx).call(gb));Ba&&wb(g.data.targets);Yc(g.data.targets);G({withTransition:!1,withUpdateXDomain:!0});if(ie){if(B&&"string"===typeof Ca){Ca=na(Ca);for(a=0;aHb(c,a)?n.select(".event-rect").style("cursor","pointer"):n.select(".event-rect").style("cursor",null))}).on("click", -function(){var a,c;C(g.data.targets)||(a=d.mouse(this),c=Hc(g.data.targets,a),100>Hb(c,a)&&l.select(".-circles-"+c.id).select(".-circle-"+c.index).each(function(){$c(this,c,c.index)}))}).call(d.behavior.drag().origin(Object).on("drag",function(){ad(d.mouse(this))}).on("dragstart",function(){bd(d.mouse(this))}).on("dragend",function(){cd()})).call(F).on("dblclick.zoom",null)}function $c(a,b,c){var e=d.select(a),f=e.classed(ha),g=!1,h;"circle"===a.nodeName?(g=Pc(a,1.5*Pa),h=Sc):"rect"===a.nodeName&& -(g=Qc(a),h=Uc);if(qa||g)fa&&ga(b)&&(e.classed(ha,!f),h(!f,e,b,c)),ne(b,e)}function ad(a){var b,c,e,f,h,m,n;C(g.data.targets)||!fa||pa&&!F.altDomain||(b=Wb[0],c=Wb[1],e=a[0],a=a[1],f=Math.min(b,e),h=Math.max(b,e),m=qa?u:Math.min(c,a),n=qa?s:Math.max(c,a),l.select(".dragarea").attr("x",f).attr("y",m).attr("width",h-f).attr("height",n-m),l.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return ga(a)}).each(function(a,b){var c=d.select(this),e=c.classed(ha),g=c.classed(Xb),l,p,q,r;l=!1; -"circle"===this.nodeName?(l=1*c.attr("cx"),p=1*c.attr("cy"),r=Sc,l=fHb(c,a)?n.select(".event-rect").style("cursor","pointer"):n.select(".event-rect").style("cursor",null))}).on("click", +function(){var a,c;C(g.data.targets)||(a=d.mouse(this),c=Ic(g.data.targets,a),100>Hb(c,a)&&l.select(".-circles-"+c.id).select(".-circle-"+c.index).each(function(){ad(this,c,c.index)}))}).call(d.behavior.drag().origin(Object).on("drag",function(){bd(d.mouse(this))}).on("dragstart",function(){cd(d.mouse(this))}).on("dragend",function(){dd()})).call(F).on("dblclick.zoom",null)}function ad(a,b,c){var e=d.select(a),f=e.classed(ha),g=!1,h;"circle"===a.nodeName?(g=Qc(a,1.5*Pa),h=Tc):"rect"===a.nodeName&& +(g=Rc(a),h=Vc);if(qa||g)fa&&ga(b)&&(e.classed(ha,!f),h(!f,e,b,c)),pe(b,e)}function bd(a){var b,c,e,f,h,m,n;C(g.data.targets)||!fa||pa&&!F.altDomain||(b=Wb[0],c=Wb[1],e=a[0],a=a[1],f=Math.min(b,e),h=Math.max(b,e),m=qa?u:Math.min(c,a),n=qa?s:Math.max(c,a),l.select(".dragarea").attr("x",f).attr("y",m).attr("width",h-f).attr("height",n-m),l.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return ga(a)}).each(function(a,b){var c=d.select(this),e=c.classed(ha),g=c.classed(Xb),l,p,q,r;l=!1; +"circle"===this.nodeName?(l=1*c.attr("cx"),p=1*c.attr("cy"),r=Tc,l=f",c,d,f;for(c=0;c"+ -f+""+d+"");return b+""}),ie=f(["tooltip","init","show"],!1),Ca=f(["tooltip","init","x"],0),Zc=f(["tooltip","init","position"],{top:"0px",left:"50px"}),Qb=ua.replace("#","")+"-clip",Qa="url(#"+Qb+")",B="timeseries"===id,ea="categorized"===id,Gb=!B&&(oa||Z),Wb=null,Ra=!1,Vb=!1,la=Ba?40:0,L=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]}}(ue,ve),qd=function(){var a=[[d.time.format("%Y/%-m/%-d"),function(){return!0}],[d.time.format("%-m/%-d"),function(a){return a.getMonth()}],[d.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[d.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[d.time.format("%I %p"),function(a){return a.getHours()}],[d.time.format("%I:%M"),function(a){return a.getMinutes()}],[d.time.format(":%S"),function(a){return a.getSeconds()}], -[d.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)}}(),dc,hc,fc,bb,gc,ic,q,s,ta,zb,sa,eb,Bb,kb,nc,oc,Eb,lc,mc,Cb,Db,m,z,Y,U,hb,ib,J,ma,jb,gb,ld=h?"left":"bottom",md=h?db?"top":"bottom":db?"right":"left",nd=h?ab?"bottom":"top":ab?"left":"right",od="bottom",M={main:function(){return"translate("+I+","+u+")"},context:function(){return"translate("+p+","+Da+")"},legend:function(){return"translate("+ac+","+$b+")"}, -y2:function(){return"translate("+(h?0:q)+","+(h?10:0)+")"},x:function(){return"translate(0,"+s+")"},subx:function(){return"translate(0,"+ta+")"},arc:function(){return"translate("+q/2+","+s/2+")"}};Eb=d.layout.pie().value(function(a){return a.values.reduce(function(a,c){return a+c.value},0)});var pe=function(){var a=d.svg.line().x(h?function(a){return w(a.id)(a.value)}:va).y(h?va:function(a){return w(a.id)(a.value)});return function(b){var c=Lb(b.values),d;if(Ib(b))return Mc(b)?a.interpolate("cardinal"): -a.interpolate("linear"),hd[b.id]?Yd(c,m,w(b.id),hd[b.id]):a(c);d=m(c[0].x);b=w(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),qe=function(){var a;a=h?d.svg.area().x0(function(a){return w(a.id)(0)}).x1(function(a){return w(a.id)(a.value)}).y(va):d.svg.area().x(va).y0(function(a){return w(a.id)(0)}).y1(function(a){return w(a.id)(a.value)});return function(b){var c=Lb(b.values),d;if(Ia([b],"area")||Ia([b],"area-spline"))return Mc(b)?a.interpolate("cardinal"):a.interpolate("linear"),a(c);d= -m(c[0].x);b=w(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),re=function(){var a=d.svg.line().x(function(a){return U(a.x)}).y(function(a){return H(a.id)(a.value)});return function(b){var c=Lb(b.values);return Ib(b)?a(c):"M "+U(c[0].x)+" "+H(b.id)(c[0].value)}}(),K=d.svg.brush().on("brush",function(){G({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}),F=d.behavior.zoom().on("zoomstart",function(){F.altDomain=d.event.sourceEvent.altKey?m.orgDomain():null}).on("zoom",pa? -se:null);K.update=function(){A&&A.select(".x.brush").call(this);return this};F.orgScaleExtent=function(){var a=gd?gd:[1,10];return[a[0],Math.max(fb()/a[1],a[1])]};F.updateScaleExtent=function(){var a=m.orgDomain(),a=(a[1]-a[0])/(V[1]-V[0]),b=this.orgScaleExtent();this.scaleExtent([b[0]*a,b[1]*a]);return this};var n,ub,l,A,Aa,W,tb,V;g.focus=function(a){var b=n.selectAll(Ua(a)),c=b.filter(Yb),b=b.filter(Zb);g.defocus();c.classed("focused",!0).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity", +b});Aa.selectAll("text").data(c).transition().duration(f?250:0).attr("x",function(a,b){return d+Ta*b+14})}function Ua(a){return r(a)?".target-"+a:".target"}function Yb(a){return yc(a.id)}function Zb(a){return"data"in a&&yc(a.data.id)}var g={data:{}},pb={},$="_expanded_",ha="_selected_",Xb="_included_",ua=f(["bindto"],"#chart"),Za=f(["size","width"],null),jc=f(["size","height"],null),cb=f(["padding","left"],null),$a=f(["padding","right"],null),pa=f(["zoom","enabled"],!1),hd=f(["zoom","extent"],null), +je=f(["zoom","privileged"],!1),ee=f(["onenter"],function(){}),fe=f(["onleave"],function(){});if(!("data"in aa))throw Error("data is required in config");var oa=f(["data","x"],null),Z=f(["data","xs"],null),Jb=f(["data","x_format"],"%Y-%m-%d"),Jd=f(["data","id_converter"],function(a){return a}),Ja=f(["data","names"],{}),t=f(["data","groups"],[]),pc=f(["data","axes"],{}),ed=f(["data","type"],null),E=f(["data","types"],{}),id=f(["data","regions"],{}),we=f(["data","colors"],{}),fa=f(["data","selection", +"enabled"],!1),qa=f(["data","selection","grouped"],!1),ga=f(["data","selection","isselectable"],function(){return!0}),za=f(["subchart","show"],!1),ec=za?f(["subchart","size","height"],60):0,xe=f(["color","pattern"],null),Ba=f(["legend","show"],!0),Ta=f(["legend","item","width"],80),ve=f(["legend","item","onclick"],function(){}),jd=f(["axis","x","type"],"indexed"),Fa=f(["axis","x","categories"],[]),qd=f(["axis","x","tick","centered"],!1),lb=f(["axis","x","tick","format"],null),vb=f(["axis","x","default"], +null),ge=f(["axis","x","label"],null),zd=f(["axis","y","max"],null),xd=f(["axis","y","min"],null),Bd=f(["axis","y","center"],null),he=f(["axis","y","label"],null),db=f(["axis","y","inner"],!1),be=f(["axis","y","tick","format"],function(a){return a}),Ga=f(["axis","y","padding"],null),ae=f(["axis","y","ticks"],10),Ab=f(["axis","y2","show"],!1),yd=f(["axis","y2","max"],null),wd=f(["axis","y2","min"],null),Ad=f(["axis","y2","center"],null),ab=f(["axis","y2","inner"],!1),de=f(["axis","y2","tick","format"], +function(a){return a}),Ha=f(["axis","y2","padding"],null),ce=f(["axis","y2","ticks"],10),h=f(["axis","rotated"],!1),Xc=f(["grid","x","show"],!1),qe=f(["grid","x","type"],"tick"),Rb=f(["grid","x","lines"],null),Yc=f(["grid","y","show"],!1),Sb=f(["grid","y","lines"],null),Ob=f(["point","show"],!0)?f(["point","r"],2.5):0,ie=f(["point","focus","line","enabled"],!0),Tb=f(["point","focus","expand","enabled"],!0),Ub=f(["point","focus","expand","r"],Tb?4:Ob),Pa=f(["point","focus","select","r"],8),pe=f(["point", +"onclick"],function(){}),Xd=f(["point","onselected"],function(){}),Yd=f(["point","onunselected"],function(){}),Q=f(["regions"],[]),Kc=f(["tooltip","contents"],function(a){var b="",c,d,f;for(c=0;c");return b+"
"+cc()(a[0].x)+"
"+ +f+""+d+"
"}),ke=f(["tooltip","init","show"],!1),Ca=f(["tooltip","init","x"],0),$c=f(["tooltip","init","position"],{top:"0px",left:"50px"}),Qb=ua.replace("#","")+"-clip",Qa="url(#"+Qb+")",B="timeseries"===jd,ea="categorized"===jd,Gb=!B&&(oa||Z),Wb=null,Ra=!1,Vb=!1,la=Ba?40:0,L=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]}}(we,xe),rd=function(){var a=[[d.time.format("%Y/%-m/%-d"),function(){return!0}],[d.time.format("%-m/%-d"),function(a){return a.getMonth()}],[d.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[d.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[d.time.format("%I %p"),function(a){return a.getHours()}],[d.time.format("%I:%M"),function(a){return a.getMinutes()}],[d.time.format(":%S"),function(a){return a.getSeconds()}], +[d.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)}}(),dc,hc,fc,bb,gc,ic,q,s,ta,zb,sa,eb,Bb,kb,nc,oc,Eb,lc,mc,Cb,Db,m,z,Y,U,hb,ib,J,ma,jb,gb,md=h?"left":"bottom",nd=h?db?"top":"bottom":db?"right":"left",od=h?ab?"bottom":"top":ab?"left":"right",pd="bottom",M={main:function(){return"translate("+I+","+u+")"},context:function(){return"translate("+p+","+Da+")"},legend:function(){return"translate("+ac+","+$b+")"}, +y2:function(){return"translate("+(h?0:q)+","+(h?10:0)+")"},x:function(){return"translate(0,"+s+")"},subx:function(){return"translate(0,"+ta+")"},arc:function(){return"translate("+q/2+","+s/2+")"}};Eb=d.layout.pie().value(function(a){return a.values.reduce(function(a,c){return a+c.value},0)});var re=function(){var a=d.svg.line().x(h?function(a){return w(a.id)(a.value)}:va).y(h?va:function(a){return w(a.id)(a.value)});return function(b){var c=Lb(b.values),d;if(Ib(b))return Nc(b)?a.interpolate("cardinal"): +a.interpolate("linear"),id[b.id]?$d(c,m,w(b.id),id[b.id]):a(c);d=m(c[0].x);b=w(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),se=function(){var a;a=h?d.svg.area().x0(function(a){return w(a.id)(0)}).x1(function(a){return w(a.id)(a.value)}).y(va):d.svg.area().x(va).y0(function(a){return w(a.id)(0)}).y1(function(a){return w(a.id)(a.value)});return function(b){var c=Lb(b.values),d;if(Ia([b],"area")||Ia([b],"area-spline"))return Nc(b)?a.interpolate("cardinal"):a.interpolate("linear"),a(c);d= +m(c[0].x);b=w(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),te=function(){var a=d.svg.line().x(function(a){return U(a.x)}).y(function(a){return H(a.id)(a.value)});return function(b){var c=Lb(b.values);return Ib(b)?a(c):"M "+U(c[0].x)+" "+H(b.id)(c[0].value)}}(),K=d.svg.brush().on("brush",function(){G({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}),F=d.behavior.zoom().on("zoomstart",function(){F.altDomain=d.event.sourceEvent.altKey?m.orgDomain():null}).on("zoom",pa? +ue:null);K.update=function(){A&&A.select(".x.brush").call(this);return this};F.orgScaleExtent=function(){var a=hd?hd:[1,10];return[a[0],Math.max(fb()/a[1],a[1])]};F.updateScaleExtent=function(){var a=m.orgDomain(),a=(a[1]-a[0])/(V[1]-V[0]),b=this.orgScaleExtent();this.scaleExtent([b[0]*a,b[1]*a]);return this};var n,ub,l,A,Aa,W,tb,V;g.focus=function(a){var b=n.selectAll(Ua(a)),c=b.filter(Yb),b=b.filter(Zb);g.defocus();c.classed("focused",!0).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity", 1);C(g.data.targets)&&Ya(a,!0)};g.defocus=function(a){var b=n.selectAll(Ua(a)),c=b.filter(Yb),b=b.filter(Zb);c.classed("focused",!1).transition().duration(100).style("opacity",0.3);b.transition().duration(100).style("opacity",0.3);C(g.data.targets)&&xb(a)};g.revert=function(a){var b=n.selectAll(Ua(a)),c=b.filter(Yb),b=b.filter(Zb);c.classed("focused",!1).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity",1);C(g.data.targets)&&xb(a)};g.show=function(a){n.selectAll(Ua(a)).transition().style("opacity", -1)};g.hide=function(a){n.selectAll(Ua(a)).transition().style("opacity",0)};g.unzoom=function(){K.clear().update();G({withUpdateXDomain:!0})};g.load=function(a){"function"!==typeof a.done&&(a.done=function(){});a.xs&&Hd(a.xs);"categories"in a&&ea&&(Fa=a.categories,J.categories(Fa));if("cacheIds"in a&&Dd(a.cacheIds))Sa(Ed(a.cacheIds),a.done);else if("data"in a)Sa(Ka(a.data),a.done);else if("url"in a)d.csv(a.url,function(b,c){Sa(Ka(c),a.done)});else if("rows"in a)Sa(Ka(vc(a.rows)),a.done);else if("columns"in +1)};g.hide=function(a){n.selectAll(Ua(a)).transition().style("opacity",0)};g.unzoom=function(){K.clear().update();G({withUpdateXDomain:!0})};g.load=function(a){"function"!==typeof a.done&&(a.done=function(){});a.xs&&Id(a.xs);"categories"in a&&ea&&(Fa=a.categories,J.categories(Fa));if("cacheIds"in a&&Ed(a.cacheIds))Sa(Fd(a.cacheIds),a.done);else if("data"in a)Sa(Ka(a.data),a.done);else if("url"in a)d.csv(a.url,function(b,c){Sa(Ka(c),a.done)});else if("rows"in a)Sa(Ka(vc(a.rows)),a.done);else if("columns"in a)Sa(Ka(wc(a.columns)),a.done);else throw Error("url or rows or columns is required.");};g.unload=function(a){g.data.targets=g.data.targets.filter(function(b){return b.id!==a});n.selectAll(".target-"+a).transition().style("opacity",0).remove();Ba&&(n.selectAll(".legend-item-"+a).remove(),wb(g.data.targets));0b.classes.indexOf(a)})});return Q};g.data.get=function(a){a=g.data.getAsTarget(a);return r(a)?a.values.map(function(a){return a.value}):void 0};g.data.getAsTarget=function(a){var b=nb(function(b){return b.id===a});return 0