|
|
|
!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]);c<a[1];c++)b.push(c);return b.length>0&&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 a<t.length?t[a]:a}function h(a){var b=f(a);return r?r(b):b}function i(f){f.each(function(){var f,i,p=g.select(this),r=d(j.domain()),s=p.selectAll(".tick.major").data(r,String),t=s.enter().insert("g","path").attr("class","tick major").style("opacity",1e-6),u=g.transition(s.exit()).style("opacity",1e-6).remove(),v=g.transition(s).style("opacity",1),w=j.rangeExtent?j.rangeExtent():c(j.range()),x=p.selectAll(".domain").data([0]);x.enter().append("path").attr("class","domain");var y=g.transition(x),z=j.copy(),A=this.__chart__||z;this.__chart__=z,t.append("line"),t.append("text");var B=t.select("line"),C=v.select("line"),D=s.select("text"),E=t.select("text"),F=v.select("text");switch(q=(z(1)-z(0))/2,i=o?0:q,k){case"bottom":f=a,B.attr("y2",l),E.attr("y",Math.max(l,0)+n),C.attr("x1",i).attr("x2",i).attr("y2",l),F.attr("x",0).attr("y",Math.max(l,0)+n),D.attr("dy",".71em").style("text-anchor","middle"),D.text(function(a){return e(r,a)?h(a):""}),y.attr("d","M"+w[0]+","+m+"V0H"+w[1]+"V"+m);break;case"left":f=b,B.attr("x2",-l),E.attr("x",-(Math.max(l,0)+n)),C.attr("x2",-l).attr("y2",0),F.attr("x",-(Math.max(l,0)+n)).attr("y",q),D.attr("dy",".32em").style("text-anchor","end"),D.text(function(a){return e(r,a)?h(a):""}),y.attr("d","M"+-m+","+w[0]+"H0V"+w[1]+"H"+-m)}if(j.ticks)t.call(f,A),v.call(f,z),u.call(f,z);else{var G=z.rangeBand()/2,H=function(a){return z(a)+G};t.call(f,H),v.call(f,H)}})}var j=g.scale.linear(),k="bottom",l=6,m=6,n=3,o=!1,p=10,q=0,r=null,s=!0,t=[];return i.scale=function(a){return arguments.length?(j=a,i):j},i.orient=function(a){return arguments.length?(k=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",i):k},i.categories=function(a){return arguments.length?(t=a,i):t},i.tickCentered=function(a){return arguments.length?(o=a,i):o},i.tickFormat=function(a){return arguments.length?(r=a,i):r},i.tickOffset=function(){return q},i.ticks=function(a){return arguments.length?(p=a,i):p},i.tickCulling=function(a){return arguments.length?(s=a,i):s},i}function c(a){return a||0===a}function d(a){return"undefined"==typeof a}function e(a){return"undefined"!=typeof a}var f=a.c3={},g=a.d3;f.generate=function(f){function h(a,b){if(!(a in f))throw Error(b)}function i(a,b){for(var c=f,d=0;d<a.length;d++){if(!(a[d]in c))return b;c=c[a[d]]}return c}function j(a){return"url("+document.URL.split("#")[0]+"#"+a}function k(){Kg.attr("transform",zg.main),Kg.select(".x.axis").attr("transform",zg.x),Kg.select(".y2.axis").attr("transform",zg.y2),Kg.select(".chart-arcs").attr("transform",zg.arc)}function l(){hf&&(Lg.attr("transform",zg.context),Lg.select(".x.axis").attr("transform",zg.subx))}function m(a){var b=a!==!1?250:0;lf&&Mg.transition().duration(b).attr("transform",zg.legend)}function n(a){k(a),l(a),m(a)}function o(){qe=r(),re=s(),se=E(),te=D(),je={top:pf&&Gf?20:0,right:u(),bottom:20+(pf?0:jf)+(Ag?F():se),left:(pf?jf+Cg:0)+t()},me=qe-je.left-je.right,oe=re-je.top-je.bottom,ke={top:pf?je.top:re-jf-(Ag?0:se),right:0/0,bottom:20+(Ag?0:se),left:pf?Bg:je.left},ne=pf?je.left-Bg-Cg:me,pe=pf?oe:re-ke.top-ke.bottom,le={top:Ag?je.top:re+F()-se,right:0/0,bottom:0,left:Ag?qe-te:0},p(),Ag&&Pc(Vd.data.targets)&&(le.left=me/2+ve)}function p(){ve=oe/2,ue=.95*ve,we=Oc(Vd.data.targets)?.6*ue:0}function q(){var a=g.select(".y.axis").node().getBoundingClientRect(),b=g.select($d).node().getBoundingClientRect();return a.right-b.left-t()}function r(){return _d?_d:w()}function s(){var a=ae?ae:x();return a>0?a:320}function t(){return Pc(Vd.data.targets)?0:be?be:Cf?1:v("y")}function u(){return Pc(Vd.data.targets)?0:ce?ce:Ag?te*(Gf&&!pf?1.25:1):Gf?Kf||pf?1:v("y2"):1}function v(){var a=U();return a.is
|
|
|
|
}).style("opacity",1),j.exit().transition().duration(F).style("opacity",0).remove()),m=Kg.selectAll(".-bars").selectAll(".-bar").data(Xc),m.enter().append("path").attr("d",A).style("stroke","none").style("opacity",0).style("fill",function(a){return tg(a.id)}).attr("class",dc),m.style("opacity",gc).transition().duration(F).attr("d",A).style("opacity",1),m.exit().transition().duration(G).style("opacity",0).remove(),o=Kg.selectAll(".-texts").selectAll(".-text").data(Zc),o.enter().append("text").attr("class",Vb).attr("text-anchor",function(a){return pf?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return qc(a.value)}),o.style("fill-opacity",hc).transition().duration(F).attr("x",D).attr("y",E).style("fill-opacity",jc),o.exit().transition().duration(G).style("fill-opacity",0).remove(),Kg.selectAll(".-line").style("opacity",gc).transition().duration(F).attr("d",Eg).style("opacity",1),Kg.selectAll(".-area").style("opacity",0).transition().duration(F).attr("d",Fg).style("opacity",Qg),l=Kg.selectAll(".-circles").selectAll(".-circle").data(Yc),l.enter().append("circle").attr("class",cc).style("opacity",0).attr("r",Vf),l.style("opacity",gc).transition().duration(F).style("opacity",ic).attr("cx",pf?Dc:Cc).attr("cy",pf?Cc:Dc),l.exit().remove(),Kg.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=cb(a);if(!b)return function(){return"M 0 0"};var c=g.interpolate(this._current,b);return this._current=c(0),function(a){return fb(c(a),!0)}}).attr("transform",x?"scale(1)":"").style("opacity",1),Kg.selectAll(".chart-arc").select("text").attr("transform",gb).style("opacity",0).transition().duration(F).text(ib).style("opacity",function(a){return Wc(a.data)?1:0}),Kg.select(".chart-arcs-title").style("opacity",Oc(Vd.data.targets)?1:0),hf&&(null!==g.event&&"zoom"===g.event.type&&Dg.extent(Je.orgDomain()).update(),v&&(Lg.select(".x.axis").style("opacity",I?0:1).transition().duration(F).call(Se),Dg.empty()||Dg.extent(Je.orgDomain()).update(),B=sd(H,!0),p=Lg.selectAll(".-bars").selectAll(".-bar").data(Xc),p.enter().append("path").attr("d",B).style("stroke","none").style("fill",function(a){return tg(a.id)}).attr("class",dc),p.style("opacity",gc).transition().duration(F).attr("d",B).style("opacity",1),p.exit().transition().duration(F).style("opacity",0).remove(),Lg.selectAll(".-line").style("opacity",gc).transition().duration(F).attr("d",Gg).style("opacity",1))),Kg.selectAll(".selected-circles").filter(function(a){return Sc(a)}).selectAll("circle").remove(),Kg.selectAll(".selected-circle").transition().duration(F).attr("cx",pf?Dc:Cc).attr("cy",pf?Cc:Dc),Ue?(q=Kg.select(".event-rects").selectAll(".event-rect").data([0]),Ad(q.enter()),q.attr("x",0).attr("y",0).attr("width",me).attr("height",oe)):(pg?(t=function(a,b){var c=Jb(b),d=Kb(b);return(Je(d?d:a.x+50)-Je(c?c:a.x-50))/2},s=function(a,b){var c=Jb(b);return(Je(a.x)+Je(c?c:a.x-50))/2}):(t=C(),s=function(a){return Je(a.x)-t/2}),r=Mb(),Kg.select(".event-rects").datum(r?r.values:[]),q=Kg.select(".event-rects").selectAll(".event-rect").data(function(a){return a}),zd(q.enter()),q.attr("class",fc).attr("x",pf?0:s).attr("y",pf?s:0).attr("width",pf?me:t).attr("height",pf?t:oe),q.exit().remove()),n=Kg.select(".regions").selectAll("rect.region").data(dg),n.enter().append("rect").style("fill-opacity",0),n.attr("class",ec).attr("x",pf?0:xb).attr("y",pf?xb:je.top).attr("width",pf?me:yb).attr("height",pf?yb:oe).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(),lf&&Pd(Vd.data.targets,{withTransition:w}),Nb().forEach(function(a){Rg[a]=!0})}function Gd(){Fd({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function Hd(){return"mousemove"===g.event.sourceEvent.type&&Hg.altDomain?(Je.domain(Hg.altDomain),void Hg.scale(Je).updateScaleExtent()):(og&&Je.orgDomain()[0]===Pg[0]&&Je.domain([Pg[0]-1e-10,Je.orgDoma
|