|
|
|
!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}var e={};e.generate=function(e){function f(a,b){if(!(a in e))throw Error(b)}function g(a,b){var c,d,f,g=e;for(c=0;c<a.length;c++){if("object"==typeof g&&!(a[c]in g))return b;if(d=c===a.length-1,f=g[a[c]],!d&&"object"!=typeof f||d&&"object"!=typeof b&&"object"==typeof f)return b;g=f}return g}function h(a){return"url("+document.URL.split("#")[0]+"#"+a+")"}function i(){Sh.attr("transform",Dh.main),Sh.select("."+Ie.axisX).attr("transform",Dh.x),Sh.select("."+Ie.axisY).attr("transform",Dh.y),Sh.select("."+Ie.axisY2).attr("transform",Dh.y2),Sh.select("."+Ie.chartArcs).attr("transform",Dh.arc)}function j(){_f&&(Th.attr("transform",Dh.context),Th.select("."+Ie.axisX).attr("transform",Dh.subx))}function k(a){var b=a!==!1?250:0;cg&&Uh.transition().duration(b).attr("transform",Dh.legend)}function l(a){i(a),j(a),k(a)}function m(){_e=p(),af=q(),bf=O(),cf=N(),Ue={top:gg?u("y2"):Kh,right:s(),bottom:u(gg?"y":"x")+(gg?0:ag)+(Eh?0:bf),left:(gg?ag+Jh:0)+r()},Xe=_e-Ue.left-Ue.right,Ze=af-Ue.top-Ue.bottom,0>Xe&&(Xe=0),0>Ze&&(Ze=0),Ve={top:gg?Ue.top:af-ag-(Eh?0:bf),right:0/0,bottom:20+(Eh?0:bf),left:gg?Ih:Ue.left},Ye=gg?Ue.left-Ih-Jh:Xe,$e=gg?Ze:af-Ve.top-Ve.bottom,0>Ye&&(Ye=0),0>$e&&($e=0),We={top:Eh?0:af-bf,right:0/0,bottom:0,left:Eh?_e-cf:0},n(),Eh&&vd(De.data.targets)&&(We.left=Xe/2+ef)}function n(){ef=Ze/2,df=.95*ef,ff=ud(De.data.targets)?.6*df:0}function o(){var a=gg?Ie.axisX:Ie.axisY,b=Ce.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Ce.select(Je).node().getBoundingClientRect(),e=c.right-d.left-r();return e>0?e:0}function p(){return Ke?Ke:v()}function q(){var a=Le?Le:w();return a>0?a:320}function r(){return vd(De.data.targets)?0:Me?Me:gg||!rg||wg?1:t("y")}function s(){var a=1;return vd(De.data.targets)?0:Ne?Ne:Eh?cf+(Ag&&!gg?t("y2"):a):Ag?Fg||gg?a:t("y2"):a}function t(a){var b=db(a);return b.isInner?20+wb(a):40+wb(a)}function u(a){return"y"!==a||rg?"y2"!==a||Ag?(db(a).isInner?30:40)+("y2"===a?-10:0):Kh:cg&&!Eh?10:1}function v(){return+Ce.select(Je).style("width").replace("px","")}function w(){return+Ce.select(Je).style("height").replace("px","")}function x(a){return a?-5:-(Ue.left-1)}function y(a){return a?-20:-1}function z(){return x(!gg)}function A(){return y(!gg)}function B(){return x(gg)}function C(){return y(gg)}function D(a){return a?Xe+2+4:Ue.left+20}function E(a){return a?80:Ze+2}function F(){return D(!gg)}function G(){return E(!gg)}function H(){return D(gg)}function I(){return E(gg)}function J(){var a=gg?Ze:Xe,b=mc(),c=Rb()*(rd(De.data.targets)?(b-(rh?.25:1))/b:.98);return b>1?a*c/(b-1):a}function K(a){Fh=a}function L(a){Gh=a}function M(a){Hh=a}function N(){return cg?Eh?Gh*(Fh+1):_e:0}function O(){return cg?Eh?af:Hh*(Fh+1):0}function P(){var a,b,c=!tf;lf=gg?1:0,mf=gg?Ze:Xe,nf=gg?0:Ze,of=gg?Xe:1,pf=lf,qf=mf,rf=gg?0:$e,sf=gg?Ye:1,tf=R(lf,mf,c?void 0:tf.domain(),function(){return zf.tickOffset()}),uf=S(nf,of),vf=S(nf,of),wf=R(lf,mf,Xh,function(a){return a%1?0:Cf.tickOffset()}),xf=S(rf,sf),yf=S(rf,sf),a=Y(),b=Z(),zf=V(tf,zh,a,b),Cf=V(wf,Ch,a,b),Af=W(uf,Ah,xg,zg),Bf=W(vf,Bh,Gg,Ig),c||(Lh.scale(wf),Oe&&Ph.scale(tf)),Q()}function Q(){gf=zb(),hf=Ab(),jf=Ab(.98)}function R(a,b,e,f){var g=(qh?Ce.time.scale():Ce.scale.linear()).range([a,b]);if(g.orgDomain=function(){return g.domain()},d(e)&&g.domain(e),c(f)&&(f=function(){return 0}),rh){var h,i=g;g=function(a){return i(a)+f(a)};for(h in i)g[h]=i[h];g.orgDomain=function(){return i.domain()},g.domain=function(a){return arguments.length?(i.domain(a),g):(a=i.domain(),[a[0],a[1]+1])}}return g}function S(a,b){return Ce.scale.linear().range([a,b])}function T(a){return"y2"===X(a)?vf:uf}function U(a){return"y2"===X(a)?yf:xf}function V(a,b,c,d){var e=(rh?xb():Ce.svg.axis()).scale(a).orient(b);return e.tickFormat(c).ticks(d),rh?e.tickCentered(jg):e.tickOffset=function(){var a=gg?Ze:Xe;return a*Rb()/mc()/2},rh&&e.categories(ig),e}function W(a,b,c,d){return Ce.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function X(a){re
|
|
|
|
}))}function ke(a){vd(De.data.targets)||Qf&&(th=a,Sh.select("."+Ie.chart).append("rect").attr("class",Ie.dragarea).style("opacity",.1),uh=!0,Zf())}function le(){vd(De.data.targets)||Qf&&(Sh.select("."+Ie.dragarea).transition().duration(100).style("opacity",0).remove(),Sh.selectAll("."+Ie.shape).classed(He,!1),uh=!1,$f())}function me(a){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=kd(),I=vd(De.data.targets);if(a=d(a)?a:{},t=d(a.withY)?a.withY:!0,u=d(a.withSubchart)?a.withSubchart:!0,v=d(a.withTransition)?a.withTransition:!0,w=d(a.withTransform)?a.withTransform:!1,x=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,y=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,z=d(a.withLegend)?a.withLegend:!1,E=v?Te:0,F=d(a.durationForExit)?a.durationForExit:E,G=d(a.durationForAxis)?a.durationForAxis:E,z&&cg&&ye(De.data.targets,a),y&&(tf.domain(Ce.extent(Vb(De.data.targets))),Xh=tf.domain(),Oe&&Ph.scale(tf).updateScaleExtent(),wf.domain(tf.domain()),Lh.scale(wf)),x&&(tf.domain(Lh.empty()?Xh:Lh.extent()),Oe&&Ph.scale(tf).updateScaleExtent()),uf.domain(Qb("y")),vf.domain(Qb("y2")),Sh.select("."+Ie.axisX).style("opacity",I?0:1).transition().duration(G).call(zf),Sh.select("."+Ie.axisY).style("opacity",I?0:1).transition().duration(G).call(Af),Sh.select("."+Ie.axisY2).style("opacity",I?0:1).transition().duration(G).call(Bf),A=_d(H),C=ae(H,!0),D=ae(H,!1),Sh.select("."+Ie.axisX+" ."+Ie.axisXLabel).attr("x",kb),Sh.select("."+Ie.axisY+" ."+Ie.axisYLabel).attr("x",lb).attr("dy",rb),Sh.select("."+Ie.axisY2+" ."+Ie.axisY2Label).attr("x",mb).attr("dy",sb),xf.domain(uf.domain()),yf.domain(vf.domain()),Vh.style("display","none"),Sh.select("line."+Ie.xgridFocus).style("visibility","hidden"),Jg){if("year"===Kg){e=[];for(var K=Vb(),L=K[0].getFullYear(),M=K[1].getFullYear(),N=L;M>=N;N++)e.push(new Date(N+"-01-01 00:00:00"))}else e=tf.ticks(10);c=Sh.select("."+Ie.xgrids).selectAll("."+Ie.xgrid).data(e),c.enter().append("line").attr("class",Ie.xgrid),c.attr("x1",gg?0:function(a){return tf(a)-zf.tickOffset()}).attr("x2",gg?Xe:function(a){return tf(a)-zf.tickOffset()}).attr("y1",gg?function(a){return tf(a)-zf.tickOffset()}:Ue.top).attr("y2",gg?function(a){return tf(a)-zf.tickOffset()}:Ze).style("opacity",function(){return+Ce.select(this).attr(gg?"y1":"x1")===(gg?Ze:0)?0:1}),c.exit().remove()}Ld(Lg)&&(f=Sh.select("."+Ie.xgridLines).selectAll("."+Ie.xgridLine).data(Lg),g=f.enter().append("g").attr("class",function(a){return Ie.xgridLine+(a.class?a.class:"")}),g.append("line").style("opacity",0),g.append("text").attr("text-anchor","end").attr("transform",gg?"":"rotate(-90)").attr("dx",gg?0:-Ue.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(E).attr("x1",gg?0:Tc).attr("x2",gg?Xe:Tc).attr("y1",gg?Tc:Ue.top).attr("y2",gg?Tc:Ze).style("opacity",1),f.select("text").transition().duration(E).attr("x",gg?Xe:0).attr("y",Tc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(E).style("opacity",0).remove()),t&&Mg&&(h=Sh.select("."+Ie.ygrids).selectAll("."+Ie.ygrid).data(uf.ticks(Og)),h.enter().append("line").attr("class",Ie.ygrid),h.attr("x1",gg?uf:0).attr("x2",gg?uf:Xe).attr("y1",gg?0:uf).attr("y2",gg?Ze:uf),h.exit().remove()),t&&Ld(Ng)&&(i=Sh.select("."+Ie.ygridLines).selectAll("."+Ie.ygridLine).data(Ng),j=i.enter().append("g").attr("class",function(a){return Ie.ygridLine+(a.class?a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",gg?"rotate(-90)":"").attr("dx",gg?0:-Ue.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(E).attr("x1",gg?Uc:0).attr("x2",gg?Uc:Xe).attr("y1",gg?0:Uc).attr("y2",gg?Ze:Uc).style("opacity",1),i.select("text").transition().duration(E).attr("x",gg?0:Xe).attr("y",Uc).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(E).style("opacity",0).remove()),l=Sh.selectAll("."+Ie.bars).selectAll("."+Ie.bar).data(Dd),l.enter().append("path").attr("d",A).style("stroke","none").style("opacity",0).style("fill",function(a){return xh(a.id)}).attr("class",Ec),l.style(
|