|
|
|
!function(a){"use strict";function b(a){return a||0===a}function c(a){return"undefined"==typeof a}function d(a){return"undefined"!=typeof a}function e(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.round(b(a)+s)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.round(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,k);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);return d.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=m.copy();return b&&(a=m.domain(),c.domain([a[0],a[1]-1])),c}function h(a){var c=b&&a<u.length?u[a]:a;return j?j(c):c}function i(i){i.each(function(){function i(a){var b=m(a)+s;return B[0]<b&&b<B[1]?o:0}var j,k,t=a.select(this),u=this.__chart__||m,v=this.__chart__=g(),w=r?r:f(v),x=t.selectAll(".tick").data(w,v),y=x.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),z=a.transition(x.exit()).style("opacity",1e-6).remove(),A=a.transition(x).style("opacity",1),B=m.rangeExtent?m.rangeExtent():e(m.range()),C=t.selectAll(".domain").data([0]),D=(C.enter().append("path").attr("class","domain"),a.transition(C));y.append("line"),y.append("text");var E=y.select("line"),F=A.select("line"),G=x.select("text").text(h),H=y.select("text"),I=A.select("text");switch(b?(s=Math.round((v(1)-v(0))/2),k=l?0:s):s=k=0,n){case"bottom":j=c,E.attr("y2",o),H.attr("y",Math.max(o,0)+q),F.attr("x1",k).attr("x2",k).attr("y2",i),I.attr("x",0).attr("y",Math.max(o,0)+q),G.attr("dy",".71em").style("text-anchor","middle"),D.attr("d","M"+B[0]+","+p+"V0H"+B[1]+"V"+p);break;case"top":j=c,E.attr("y2",-o),H.attr("y",-(Math.max(o,0)+q)),F.attr("x2",0).attr("y2",-o),I.attr("x",0).attr("y",-(Math.max(o,0)+q)),G.attr("dy","0em").style("text-anchor","middle"),D.attr("d","M"+B[0]+","+-p+"V0H"+B[1]+"V"+-p);break;case"left":j=d,E.attr("x2",-o),H.attr("x",-(Math.max(o,0)+q)),F.attr("x2",-o).attr("y2",0),I.attr("x",-(Math.max(o,0)+q)).attr("y",s),G.attr("dy",".32em").style("text-anchor","end"),D.attr("d","M"+-p+","+B[0]+"H0V"+B[1]+"H"+-p);break;case"right":j=d,E.attr("x2",o),H.attr("x",Math.max(o,0)+q),F.attr("x2",o).attr("y2",0),I.attr("x",Math.max(o,0)+q).attr("y",0),G.attr("dy",".32em").style("text-anchor","start"),D.attr("d","M"+p+","+B[0]+"H0V"+B[1]+"H"+p)}if(v.rangeBand){var J=v,K=J.rangeBand()/2;u=v=function(a){return J(a)+K}}else u.rangeBand?u=v:z.call(j,v);y.call(j,u),A.call(j,v)})}var j,k,l,m=a.scale.linear(),n="bottom",o=6,p=6,q=3,r=null,s=0,t=!0,u=[];return i.scale=function(a){return arguments.length?(m=a,i):m},i.orient=function(a){return arguments.length?(n=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",i):n},i.tickFormat=function(a){return arguments.length?(j=a,i):j},i.tickCentered=function(a){return arguments.length?(l=a,i):l},i.tickOffset=function(){return s},i.ticks=function(){return arguments.length?(k=arguments,i):k},i.tickCulling=function(a){return arguments.length?(t=a,i):t},i.tickValues=function(a){return arguments.length?(r=a,i):r},i.categories=function(a){return arguments.length?(u=a,i):u},i}var f={version:"0.1.41"},g={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",text:"c3-text",texts:"c3-texts",grid:"c3-grid",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLi
|
|
|
|
}function gf(a,b){var c=a.__max__+1,d=ee(Kg,c),e=be(d,c,a,!!b),f=ce(!!b),g=de(a,!!b),h=b?_:$;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return xh&&(0<a.value&&c>k||a.value<0&&k>c)&&(k=c),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function hf(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s=-1,t="M",u=[];if(d(f))for(g=0;g<f.length;g++)u[g]={},u[g].start=c(f[g].start)?a[0].x:Wi?Ae(f[g].start):f[g].start,u[g].end=c(f[g].end)?a[a.length-1].x:Wi?Ae(f[g].end):f[g].end;for(q=xh?function(a){return e(a.value)}:function(a){return b(a.x)},r=xh?function(a){return b(a.x)}:function(a){return e(a.value)},i=Wi?function(a,c,d,f){var g=a.x.getTime(),h=c.x-a.x,i=new Date(g+h*d),j=new Date(g+h*(d+f));return"M"+b(i)+" "+e(k(d))+" "+b(j)+" "+e(k(d+f))}:function(a,c,d,f){return"M"+b(j(d),!0)+" "+e(k(d))+" "+b(j(d+f),!0)+" "+e(k(d+f))},g=0;g<a.length;g++){if(c(u)||!De(a[g].x,u))t+=" "+q(a[g])+" "+r(a[g]);else for(j=X(a[g-1].x,a[g].x,Wi),k=X(a[g-1].value,a[g].value),l=b(a[g].x)-b(a[g-1].x),m=e(a[g].value)-e(a[g-1].value),n=Math.sqrt(Math.pow(l,2)+Math.pow(m,2)),o=2/n,p=2*o,h=o;1>=h;h+=p)t+=i(a[g-1],a[g],h,o);s=a[g].x}return t}function jf(b){var c,d,e;if(Hj=Nf.select(Qf),Hj.empty())throw new Error("Element to bind not found");if(Hj.html("").classed("c3",!0),Of.data.xs={},Of.data.targets=zc(b),ch&&(Of.data.targets=Of.data.targets.filter(ch)),bh&&Oc(bh===!0?Gc(Of.data.targets):bh),p(),V(),Eg.domain(Nf.extent(dc(Of.data.targets))),Fg.domain(_b(Of.data.targets,"y")),Gg.domain(_b(Of.data.targets,"y2")),Hg.domain(Eg.domain()),Ig.domain(Fg.domain()),Jg.domain(Gg.domain()),Ij=Eg.domain(),wj.scale(Hg),Xf&&Aj.scale(Eg),Bj=Hj.append("svg").style("overflow","hidden").on("mouseenter",_f).on("mouseleave",ag),Cj=Bj.append("defs"),Cj.append("clipPath").attr("id",Qi).append("rect"),Cj.append("clipPath").attr("id",Ri).append("rect"),Cj.append("clipPath").attr("id",Si).append("rect"),vf(),Dj=Bj.append("g").attr("transform",nj.main),Ej=Bj.append("g").attr("transform",nj.context),Fj=Bj.append("g").attr("transform",nj.legend),oh||Ej.style("visibility","hidden"),rh||(Fj.style("visibility","hidden"),hj=Gc(Of.data.targets)),Gj=Hj.style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),If(Gc(Of.data.targets),{withTransform:!1,withTransitionForTransform:!1}),d=Dj.append("g").attr("clip-path",Ti).attr("class",g.grid),gi&&d.append("g").attr("class",g.xgrids),Fe(ii)&&d.append("g").attr("class",g.xgridLines),oi&&d.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),ji&&d.append("g").attr("class",g.ygrids),Fe(ki)&&d.append("g").attr("class",g.ygridLines),Dj.append("g").attr("clip-path",Ti).attr("class",g.regions),Dj.append("g").attr("clip-path",Ti).attr("class",g.chart),c=Dj.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0).style("cursor",Xf?xh?"ns-resize":"ew-resize":null),Dj.select("."+g.chart).append("g").attr("class",g.chartBars),Dj.select("."+g.chart).append("g").attr("class",g.chartLines),Dj.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",nj.arc).append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Vb()),Dj.select("."+g.chart).append("g").attr("class",g.chartTexts),Xf&&Dj.insert("rect",Zf?null:"g."+g.grid).attr("class",g.zoomRect).attr("width",hg).attr("height",jg).style("opacity",0).style("cursor",xh?"ns-resize":"ew-resize").call(Aj).on("dblclick.zoom",null),Oh&&wj.extent("function"!=typeof Oh?Oh:Oh(dc())),ij.x=Dj.append("g").attr("class",g.axisX).attr("clip-path",Ui).attr("transform",nj.x).style("visibility",yh?"visible":"hidden"),ij.x.append("text").attr("class",g.axisXLabel).attr("transform",xh?"rotate(-90)":"").style("text-anchor",Eb),ij.y=Dj.append("g").attr("class",g.axisY).attr("clip-path",Vi).attr("transform",nj.y).style("visibility",Qh?"visible":"hidden"),ij.y.append("text").attr("class",g.axisYLabel).attr("transform",xh?"":"rotate(-90)").style("text-anchor",Fb),ij.y2=Dj.append("g").attr("class",g.axisY2).attr("transform",nj.y2).style("visibili
|
|
|
|
}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),gj=[],hj=[],ij={},jj=xh?"left":"bottom",kj=xh?Vh?"top":"bottom":Vh?"right":"left",lj=xh?ci?"bottom":"top":ci?"left":"right",mj=xh?"left":"bottom",nj={main:function(){return"translate("+k(eg.left)+","+k(eg.top)+")"},context:function(){return"translate("+k(fg.left)+","+k(fg.top)+")"},legend:function(){return"translate("+gg.left+","+gg.top+")"},x:function(){return"translate(0,"+(xh?0:jg)+")"},y:function(){return"translate(0,"+(xh?jg:0)+")"},y2:function(){return"translate("+(xh?0:hg)+","+(xh?1:0)+")"},subx:function(){return"translate(0,"+(xh?0:kg)+")"},arc:function(){return"translate("+qg/2+","+rg/2+")"}},oj="right"===sh,pj=0,qj=0,rj=0,sj=.15,tj=30,uj=xh&&!yh?0:30,vj=5;vg=Nf.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var wj,xj=bf(Eg,Id,$),yj=bf(Hg,Ld,_),zj=function(){var a;return a=xh?Nf.svg.area().x0(function(a){return $(a.id)(0)}).x1(function(a){return $(a.id)(a.value)}).y(Id):Nf.svg.area().x(Id).y0(function(a){return $(a.id)(0)}).y1(function(a){return $(a.id)(a.value)}),function(b){var c,d,e=Te(b.values);return ge([b],"area")||ge([b],"area-spline")?(a.interpolate(ne(b)?"cardinal":"linear"),a(e)):(c=e[0]?Eg(e[0].x):0,d=e[0]?$(b.id)(e[0].value):0,xh?"M "+d+" "+c:"M "+c+" "+d)}}(),Aj=function(){};wj=Nf.svg.brush().on("brush",sf),wj.update=function(){return Ej&&Ej.select("."+g.brush).call(this),this},wj.scale=function(a){return xh?this.y(a):this.x(a)},Xf&&(Aj=Nf.behavior.zoom().on("zoomstart",function(){Aj.altDomain=Nf.event.sourceEvent.altKey?Eg.orgDomain():null}).on("zoom",Xf?tf:null),Aj.scale=function(a){return xh?this.y(a):this.x(a)},Aj.orgScaleExtent=function(){var a=Yf?Yf:[1,10];return[a[0],Math.max(Dc()/a[1],a[1])]},Aj.updateScaleExtent=function(){var a=ec(Eg.orgDomain())/ec(Ij),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Bj,Cj,Dj,Ej,Fj,Gj,Hj,Ij,Jj,Kj={};if(Of.focus=function(a){function b(a){Lc(a).transition().duration(100).style("opacity",1)}var c=Bj.selectAll(sd(a)),d=c.filter(Jf),e=c.filter(Kf);Of.revert(),Of.defocus(),b(d.classed(g.focused,!0)),b(e),le(Of.data.targets)&&Rb(a,!0),Ef(a,!0)},Of.defocus=function(a){function b(a){Lc(a).transition().duration(100).style("opacity",.3)}var c=Bj.selectAll(sd(a)),d=c.filter(Jf),e=c.filter(Kf);Of.revert(),b(d.classed(g.focused,!1)),b(e),le(Of.data.targets)&&Sb(a),Ef(a,!1)},Of.revert=function(a){function b(a){Lc(a).transition().duration(100).style("opacity",1)}var c=Bj.selectAll(sd(a)),d=c.filter(Jf),e=c.filter(Kf);b(d.classed(g.focused,!1)),b(e),le(Of.data.targets)&&Sb(a),Ff()},Of.show=function(a,b){a=Hc(a),b=b||{},Pc(a),Bj.selectAll(td(a)).transition().style("opacity",1),b.withLegend&&Gf(a),rf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Of.hide=function(a,b){a=Hc(a),b=b||{},Oc(a),Bj.selectAll(td(a)).transition().style("opacity",0),b.withLegend&&Hf(a),rf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Of.toggle=function(a){Jc(a)?Of.hide(a):Of.show(a)},Of.unzoom=function(){wj.clear().update(),rf({withUpdateXDomain:!0})},Of.load=function(a){return a.xs&&rc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){Tg[b]=a.classes[b]}),"categories"in a&&Xi&&(Bh=a.categories,Kg.categories(Bh)),"cacheIds"in a&&fc(a.cacheIds)?void zf(hc(a.cacheIds),a.done):void("unload"in a?Bf(Hc("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Af(a)}):Af(a))},Of.unload=function(a,b){Bf(Hc(a),function(){rf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},Of.selected=function(a){return Nf.merge(Dj.selectAll("."+g.shapes+rd(a)).selectAll("."+g.shape).filter(function(){return Nf.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},Of.select=function(a,b,c){dh&&Dj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=Nf.select(this),i=e.data?e.data.id:e.id,j=Se(this),k=eh||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0
|