|
|
|
!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){for(var c=e,d=0;d<a.length;d++){if(!(a[d]in c))return b;c=c[a[d]]}return c}function h(a){return"url("+document.URL.split("#")[0]+"#"+a+")"}function i(){Kh.attr("transform",vh.main),Kh.select(".x.axis").attr("transform",vh.x),Kh.select(".y.axis").attr("transform",vh.y),Kh.select(".y2.axis").attr("transform",vh.y2),Kh.select(".chart-arcs").attr("transform",vh.arc)}function j(){Wf&&(Lh.attr("transform",vh.context),Lh.select(".x.axis").attr("transform",vh.subx))}function k(a){var b=a!==!1?250:0;Zf&&Mh.transition().duration(b).attr("transform",vh.legend)}function l(a){i(a),j(a),k(a)}function m(){Ye=p(),Ze=q(),$e=O(),_e=N(),Re={top:bg?u("y2"):Ch,right:s(),bottom:u(bg?"y":"x")+(bg?0:Xf)+(wh?0:$e),left:(bg?Xf+Bh:0)+r()},Ue=Ye-Re.left-Re.right,We=Ze-Re.top-Re.bottom,0>Ue&&(Ue=0),0>We&&(We=0),Se={top:bg?Re.top:Ze-Xf-(wh?0:$e),right:0/0,bottom:20+(wh?0:$e),left:bg?Ah:Re.left},Ve=bg?Re.left-Ah-Bh:Ue,Xe=bg?We:Ze-Se.top-Se.bottom,0>Ve&&(Ve=0),0>Xe&&(Xe=0),Te={top:wh?0:Ze-$e,right:0/0,bottom:0,left:wh?Ye-_e:0},n(),wh&&sd(Be.data.targets)&&(Te.left=Ue/2+bf)}function n(){bf=We/2,af=.95*bf,cf=rd(Be.data.targets)?.6*af:0}function o(){var a=bg?".x.axis":".y.axis",b=Ae.select(a).node(),c=b?b.getBoundingClientRect():{right:0},d=Ae.select(Ge).node().getBoundingClientRect(),e=c.right-d.left-r();return e>0?e:0}function p(){return He?He:v()}function q(){var a=Ie?Ie:w();return a>0?a:320}function r(){return sd(Be.data.targets)?0:Je?Je:bg||!mg||rg?1:t("y")}function s(){var a=1;return sd(Be.data.targets)?0:Ke?Ke:wh?_e+(vg&&!bg?t("y2"):a):vg?Ag||bg?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||mg?"y2"!==a||vg?(db(a).isInner?30:40)+("y2"===a?-10:0):Ch:Zf&&!wh?10:1}function v(){return+Ae.select(Ge).style("width").replace("px","")}function w(){return+Ae.select(Ge).style("height").replace("px","")}function x(a){return a?-5:-(Re.left-1)}function y(a){return a?-20:-1}function z(){return x(!bg)}function A(){return y(!bg)}function B(){return x(bg)}function C(){return y(bg)}function D(a){return a?Ue+2+4:Re.left+20}function E(a){return a?80:We+2}function F(){return D(!bg)}function G(){return E(!bg)}function H(){return D(bg)}function I(){return E(bg)}function J(){var a=bg?We:Ue,b=Rb(),c=mc();return c>1?a*b/(c-1):a}function K(a){xh=a}function L(a){yh=a}function M(a){zh=a}function N(){return Zf?wh?yh*(xh+1):Ye:0}function O(){return Zf?wh?Ze:zh*(xh+1):0}function P(){var a,b,c=!qf;hf=bg?1:0,jf=bg?We:Ue,kf=bg?0:We,lf=bg?Ue:1,mf=hf,nf=jf,of=bg?0:Xe,pf=bg?Ve:1,qf=R(hf,jf,c?void 0:qf.domain(),function(){return wf.tickOffset()}),rf=S(kf,lf),sf=S(kf,lf),tf=R(hf,jf,Ph,function(a){return a%1?0:zf.tickOffset()}),uf=S(of,pf),vf=S(of,pf),a=Y(),b=Z(),wf=V(qf,rh,a,b),zf=V(tf,uh,a,b),xf=W(rf,sh,sg,ug),yf=W(sf,th,Bg,Dg),c||(Dh.scale(tf),Le&&Hh.scale(qf)),Q()}function Q(){df=zb(),ef=Ab(),ff=Ab(.98)}function R(a,b,e,f){var g=(jh?Ae.time.scale():Ae.scale.linear()).range([a,b]);if(g.orgDomain=function(){return g.domain()},d(e)&&g.domain(e),c(f)&&(f=function(){return 0}),kh){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 Ae.scale.linear().range([a,b])}function T(a){return"y2"===X(a)?sf:rf}function U(a){return"y2"===X(a)?vf:uf}function V(a,b,c,d){var e=(kh?xb():Ae.svg.axis()).scale(a).orient(b);return e.tickFormat(c).ticks(d),kh?e.tickCentered(eg):e.tickOffset=function(){var a=bg?We:Ue;return a*Rb()/mc()/2},kh&&e.categories(dg),e}function W(a,b,c,d){return Ae.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function X(a){return a in Gf?Gf[a]:"y"}function Y(){var a=jh?qh:kh?vc:null;return fg&&("function"==typeof fg?a=fg:jh&&(a=function(a){return Ae.time.format(fg)(a)})),a}function Z(){var a=mc();return gg&
|
|
|
|
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=qf.ticks(10);c=Kh.select(".xgrids").selectAll(".xgrid").data(e),c.enter().append("line").attr("class","xgrid"),c.attr("x1",bg?0:function(a){return qf(a)-wf.tickOffset()}).attr("x2",bg?Ue:function(a){return qf(a)-wf.tickOffset()}).attr("y1",bg?function(a){return qf(a)-wf.tickOffset()}:Re.top).attr("y2",bg?function(a){return qf(a)-wf.tickOffset()}:We).style("opacity",function(){return+Ae.select(this).attr(bg?"y1":"x1")===(bg?We:0)?0:1}),c.exit().remove()}Gg&&(f=Kh.select(".xgrid-lines").selectAll(".xgrid-line").data(Gg),g=f.enter().append("g").attr("class",function(a){return"xgrid-line xgrid-line-"+(a["class"]?a["class"]:"")}),g.append("line").style("opacity",0),g.append("text").attr("text-anchor","end").attr("transform",bg?"":"rotate(-90)").attr("dx",bg?0:-Re.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(E).attr("x1",bg?0:Rc).attr("x2",bg?Ue:Rc).attr("y1",bg?Rc:Re.top).attr("y2",bg?Rc:We).style("opacity",1),f.select("text").transition().duration(E).attr("x",bg?Ue:0).attr("y",Rc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(E).style("opacity",0).remove()),t&&Hg&&(h=Kh.select(".ygrids").selectAll(".ygrid").data(rf.ticks(Jg)),h.enter().append("line").attr("class","ygrid"),h.attr("x1",bg?rf:0).attr("x2",bg?rf:Ue).attr("y1",bg?0:rf).attr("y2",bg?We:rf),h.exit().remove()),t&&Ig&&(i=Kh.select(".ygrid-lines").selectAll(".ygrid-line").data(Ig),j=i.enter().append("g").attr("class",function(a){return"ygrid-line ygrid-line-"+(a.class?a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",bg?"rotate(-90)":"").attr("dx",bg?0:-Re.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(E).attr("x1",bg?Sc:0).attr("x2",bg?Sc:Ue).attr("y1",bg?0:Sc).attr("y2",bg?We:Sc).style("opacity",1),i.select("text").transition().duration(E).attr("x",bg?0:Ue).attr("y",Sc).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(E).style("opacity",0).remove()),l=Kh.selectAll(".-bars").selectAll(".-bar").data(Ad),l.enter().append("path").attr("d",A).style("stroke","none").style("opacity",0).style("fill",function(a){return ph(a.id)}).attr("class",Hc),l.style("opacity",Kc).transition().duration(E).attr("d",A).style("opacity",1),l.exit().transition().duration(F).style("opacity",0).remove(),n=Kh.selectAll(".-texts").selectAll(".-text").data(Cd),n.enter().append("text").attr("class",xc).attr("text-anchor",function(a){return bg?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return Uc(a.value)}),n.style("fill-opacity",Lc).transition().duration(E).attr("x",C).attr("y",D).style("fill-opacity",Nc),n.exit().transition().duration(F).style("fill-opacity",0).remove(),Kh.selectAll(".-line").style("opacity",Kc).transition().duration(E).attr("d",Eh).style("opacity",1),Kh.selectAll(".-area").style("opacity",0).transition().duration(E).attr("d",Fh).style("opacity",Qh),k=Kh.selectAll(".-circles").selectAll(".-circle").data(Bd),k.enter().append("circle").attr("class",Gc).style("opacity",0).attr("r",Lg),k.style("opacity",Kc).transition().duration(E).style("opacity",Mc).attr("cx",bg?gd:fd).attr("cy",bg?fd:gd),k.exit().remove(),Kh.selectAll(".chart-arc").select(".-arc").attr("transform",w?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(E).attrTween("d",function(a){var b=yb(a);if(!b)return function(){return"M 0 0"};var c=Ae.interpolate(this._current,b);return this._current=c(0),function(a){return Bb(c(a),!0)}}).attr("transform",w?"scale(1)":"").style("opacity",1),Kh.selectAll(".chart-arc").select("text").attr("transform",Cb).style("opacity",0).transition().duration(E).text(Fb).style("opacity",function(a){return zd(a.data)?1:0}),Kh.select(".chart-arcs-title").style("opacity",rd(Be.data.targets)?1:0),Wf&&(null!==Ae.event&&"zoom"===Ae.event.type&&Dh.extent(qf.orgDomain()).update(),u&&(Lh.select(".x.axis"
|