|
|
|
!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(){Ig.attr("transform",xg.main),Ig.select(".x.axis").attr("transform",xg.x),Ig.select(".y2.axis").attr("transform",xg.y2),Ig.select(".chart-arcs").attr("transform",xg.arc)}function k(){ff&&(Jg.attr("transform",xg.context),Jg.select(".x.axis").attr("transform",xg.subx))}function l(a){var b=a!==!1?250:0;jf&&Kg.transition().duration(b).attr("transform",xg.legend)}function m(a){j(a),k(a),l(a)}function n(){oe=q(),pe=r(),qe=D(),re=C(),he={top:nf&&Ef?20:0,right:t(),bottom:20+(nf?0:gf)+(yg?E():qe),left:(nf?gf+Ag:0)+s()},ke=oe-he.left-he.right,me=pe-he.top-he.bottom,ie={top:nf?he.top:pe-gf-(yg?0:qe),right:0/0,bottom:20+(yg?0:qe),left:nf?zg:he.left},le=nf?he.left-zg-Ag:ke,ne=nf?me:pe-ie.top-ie.bottom,je={top:yg?he.top:pe+E()-qe,right:0/0,bottom:0,left:yg?oe-re:0},o(),yg&&Oc(Td.data.targets)&&(je.left=ke/2+te)}function o(){te=me/2,se=.95*te,ue=Nc(Td.data.targets)?.6*se:0}function p(){var a=g.select(".y.axis").node().getBoundingClientRect(),b=g.select(Yd).node().getBoundingClientRect();return a.right-b.left-s()}function q(){return Zd?Zd:v()}function r(){var a=$d?$d:w();return a>0?a:320}function s(){return Oc(Td.data.targets)?0:_d?_d:Af?1:u("y")}function t(){return Oc(Td.data.targets)?0:ae?ae:yg?re*(Ef&&!nf?1.25:1):Ef?If||nf?1:u("y2"):1}function u(){var a=T();return a.isInner?40:60}function v(){return+g.select(Yd).style("width").
|
|
|
|
}).style("stroke","none").style("fill-opacity",0).text(function(a){return pc(a.value)}),m.style("fill-opacity",gc).transition().duration(D).attr("x",A).attr("y",C).style("fill-opacity",ic),m.exit().transition().duration(E).style("fill-opacity",0).remove(),Ig.selectAll(".-line").style("opacity",fc).transition().duration(D).attr("d",Cg).style("opacity",1),Ig.selectAll(".-area").style("opacity",0).transition().duration(D).attr("d",Dg).style("opacity",Og),j=Ig.selectAll(".-circles").selectAll(".-circle").data(Xc),j.enter().append("circle").attr("class",bc).style("opacity",0).attr("r",Tf),j.style("opacity",fc).transition().duration(D).style("opacity",hc).attr("cx",nf?Cc:Bc).attr("cy",nf?Bc:Cc),j.exit().remove(),Ig.selectAll(".chart-arc").select(".-arc").attr("transform",v?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(D).attrTween("d",function(a){var b=bb(a);if(!b)return function(){return"M 0 0"};var c=g.interpolate(this._current,b);return this._current=c(0),function(a){return eb(c(a),!0)}}).attr("transform",v?"scale(1)":"").style("opacity",1),Ig.selectAll(".chart-arc").select("text").attr("transform",fb).style("opacity",0).transition().duration(D).text(hb).style("opacity",function(a){return Vc(a.data)?1:0}),Ig.select(".chart-arcs-title").style("opacity",Nc(Td.data.targets)?1:0),ff&&(null!==g.event&&"zoom"===g.event.type&&Bg.extent(He.orgDomain()).update(),t&&(Jg.select(".x.axis").style("opacity",G?0:1).transition().duration(D).call(Qe),Bg.empty()||Bg.extent(He.orgDomain()).update(),z=rd(F,!0),n=Jg.selectAll(".-bars").selectAll(".-bar").data(Wc),n.enter().append("path").attr("d",z).style("stroke","none").style("fill",function(a){return rg(a.id)}).attr("class",cc),n.style("opacity",fc).transition().duration(D).attr("d",z).style("opacity",1),n.exit().transition().duration(D).style("opacity",0).remove(),Jg.selectAll(".-line").style("opacity",fc).transition().duration(D).attr("d",Eg).style("opacity",1))),Ig.selectAll(".selected-circles").filter(function(a){return Rc(a)}).selectAll("circle").remove(),Ig.selectAll(".selected-circle").transition().duration(D).attr("cx",nf?Cc:Bc).attr("cy",nf?Bc:Cc),Se?(o=Ig.select(".event-rects").selectAll(".event-rect").data([0]),zd(o.enter()),o.attr("x",0).attr("y",0).attr("width",ke).attr("height",me)):(ng?(r=function(a,b){var c=Ib(b),d=Jb(b);return(He(d?d:a.x+50)-He(c?c:a.x-50))/2},q=function(a,b){var c=Ib(b);return(He(a.x)+He(c?c:a.x-50))/2}):(r=B(),q=function(a){return He(a.x)-r/2}),p=Lb(),Ig.select(".event-rects").datum(p?p.values:[]),o=Ig.select(".event-rects").selectAll(".event-rect").data(function(a){return a}),yd(o.enter()),o.attr("class",ec).attr("x",nf?0:q).attr("y",nf?q:0).attr("width",nf?ke:r).attr("height",nf?r:me),o.exit().remove()),l=Ig.select(".regions").selectAll("rect.region").data(bg),l.enter().append("rect").style("fill-opacity",0),l.attr("class",dc).attr("x",nf?0:wb).attr("y",nf?wb:he.top).attr("width",nf?ke:xb).attr("height",nf?xb:me).transition().duration(D).style("fill-opacity",function(a){return c(a.opacity)?a.opacity:.1}),l.exit().transition().duration(D).style("fill-opacity",0).remove(),jf&&Od(Td.data.targets,{withTransition:u}),Mb().forEach(function(a){Pg[a]=!0})}function Fd(){Ed({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function Gd(){return"mousemove"===g.event.sourceEvent.type&&Fg.altDomain?(He.domain(Fg.altDomain),void Fg.scale(He).updateScaleExtent()):(mg&&He.orgDomain()[0]===Ng[0]&&He.domain([Ng[0]-1e-10,He.orgDomain()[1]]),Ed({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===g.event.sourceEvent.type&&(qg=!0)))}function Hd(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function Id(a){var b,c;a=e(a)?a:{},b=e(a.withTransition)?a.withTransition:!1,c=e(a.withTransform)?a.withTransform:!1,n(),F(),Bg.scale(Ke),be&&Fg.scale(He),Gg.attr("width",oe).attr("height",pe),Gg.select("#"+jg).select("rect").attr("width",ke).attr("height",me),Gg.select("#xaxis-clip").select("rect").attr("width",x),Gg.select(".zoom-rect").attr("width",ke).attr("height"
|