|
|
|
!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(){Ih.attr("transform",th.main),Ih.select(".x.axis").attr("transform",th.x),Ih.select(".y.axis").attr("transform",th.y),Ih.select(".y2.axis").attr("transform",th.y2),Ih.select(".chart-arcs").attr("transform",th.arc)}function j(){Rf&&(Jh.attr("transform",th.context),Jh.select(".x.axis").attr("transform",th.subx))}function k(a){var b=a!==!1?250:0;Uf&&Kh.transition().duration(b).attr("transform",th.legend)}function l(a){i(a),j(a),k(a)}function m(){Ye=p(),Ze=q(),$e=O(),_e=N(),Re={top:Yf?u("y2"):Ah,right:s(),bottom:u(Yf?"y":"x")+(Yf?0:Sf)+(uh?0:$e),left:(Yf?Sf+zh:0)+r()},Ue=Ye-Re.left-Re.right,We=Ze-Re.top-Re.bottom,0>Ue&&(Ue=0),0>We&&(We=0),Se={top:Yf?Re.top:Ze-Sf-(uh?0:$e),right:0/0,bottom:20+(uh?0:$e),left:Yf?yh:Re.left},Ve=Yf?Re.left-yh-zh:Ue,Xe=Yf?We:Ze-Se.top-Se.bottom,0>Ve&&(Ve=0),0>Xe&&(Xe=0),Te={top:uh?0:Ze-$e,right:0/0,bottom:0,left:uh?Ye-_e:0},n(),uh&&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=Yf?".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:Yf||!hg||mg?1:t("y")}function s(){var a=1;return sd(Be.data.targets)?0:Ke?Ke:uh?_e+(qg&&!Yf?t("y2"):a):qg?vg||Yf?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||hg?"y2"!==a||qg?(db(a).isInner?30:40)+("y2"===a?-10:0):Ah:Uf&&!uh?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(!Yf)}function A(){return y(!Yf)}function B(){return x(Yf)}function C(){return y(Yf)}function D(a){return a?Ue+2+4:Re.left+20}function E(a){return a?80:We+2}function F(){return D(!Yf)}function G(){return E(!Yf)}function H(){return D(Yf)}function I(){return E(Yf)}function J(){var a=Yf?We:Ue,b=Rb(),c=mc();return c>1?a*b/(c-1):a}function K(a){vh=a}function L(a){wh=a}function M(a){xh=a}function N(){return Uf?uh?wh*(vh+1):Ye:0}function O(){return Uf?uh?Ze:xh*(vh+1):0}function P(){var a,b,c=!qf;hf=Yf?1:0,jf=Yf?We:Ue,kf=Yf?0:We,lf=Yf?Ue:1,mf=hf,nf=jf,of=Yf?0:Xe,pf=Yf?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,Nh,function(a){return a%1?0:zf.tickOffset()}),uf=S(of,pf),vf=S(of,pf),a=Y(),b=Z(),wf=V(qf,ph,a,b),zf=V(tf,sh,a,b),xf=W(rf,qh,ng,pg),yf=W(sf,rh,wg,yg),c||(Bh.scale(tf),Le&&Fh.scale(qf)),Q()}function Q(){df=zb(),ef=Ab(),ff=Ab(.98)}function R(a,b,e,f){var g=(hh?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}),ih){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=(ih?xb():Ae.svg.axis()).scale(a).orient(b);return e.tickFormat(c).ticks(d),ih?e.tickCentered(_f):e.tickOffset=function(){var a=Yf?We:Ue;return a*Rb()/mc()/2},ih&&e.categories($f),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=hh?oh:ih?vc:null;return ag&&("function"==typeof ag?a=ag:hh&&(a=function(a){return Ae.time.format(ag)(a)})),a}function Z(){var a=mc();return bg&
|
|
|
|
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=Ih.select(".xgrids").selectAll(".xgrid").data(e),c.enter().append("line").attr("class","xgrid"),c.attr("x1",Yf?0:function(a){return qf(a)-wf.tickOffset()}).attr("x2",Yf?Ue:function(a){return qf(a)-wf.tickOffset()}).attr("y1",Yf?function(a){return qf(a)-wf.tickOffset()}:Re.top).attr("y2",Yf?function(a){return qf(a)-wf.tickOffset()}:We).style("opacity",function(){return+Ae.select(this).attr(Yf?"y1":"x1")===(Yf?We:0)?0:1}),c.exit().remove()}Bg&&(f=Ih.select(".xgrid-lines").selectAll(".xgrid-line").data(Bg),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",Yf?"":"rotate(-90)").attr("dx",Yf?0:-Re.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(E).attr("x1",Yf?0:Rc).attr("x2",Yf?Ue:Rc).attr("y1",Yf?Rc:Re.top).attr("y2",Yf?Rc:We).style("opacity",1),f.select("text").transition().duration(E).attr("x",Yf?Ue:0).attr("y",Rc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(E).style("opacity",0).remove()),t&&Cg&&(h=Ih.select(".ygrids").selectAll(".ygrid").data(rf.ticks(Eg)),h.enter().append("line").attr("class","ygrid"),h.attr("x1",Yf?rf:0).attr("x2",Yf?rf:Ue).attr("y1",Yf?0:rf).attr("y2",Yf?We:rf),h.exit().remove()),t&&Dg&&(i=Ih.select(".ygrid-lines").selectAll(".ygrid-line").data(Dg),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",Yf?"rotate(-90)":"").attr("dx",Yf?0:-Re.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(E).attr("x1",Yf?Sc:0).attr("x2",Yf?Sc:Ue).attr("y1",Yf?0:Sc).attr("y2",Yf?We:Sc).style("opacity",1),i.select("text").transition().duration(E).attr("x",Yf?0:Ue).attr("y",Sc).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(E).style("opacity",0).remove()),l=Ih.selectAll(".-bars").selectAll(".-bar").data(Ad),l.enter().append("path").attr("d",A).style("stroke","none").style("opacity",0).style("fill",function(a){return nh(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=Ih.selectAll(".-texts").selectAll(".-text").data(Cd),n.enter().append("text").attr("class",xc).attr("text-anchor",function(a){return Yf?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(),Ih.selectAll(".-line").style("opacity",Kc).transition().duration(E).attr("d",Ch).style("opacity",1),Ih.selectAll(".-area").style("opacity",0).transition().duration(E).attr("d",Dh).style("opacity",Oh),k=Ih.selectAll(".-circles").selectAll(".-circle").data(Bd),k.enter().append("circle").attr("class",Gc).style("opacity",0).attr("r",Gg),k.style("opacity",Kc).transition().duration(E).style("opacity",Mc).attr("cx",Yf?gd:fd).attr("cy",Yf?fd:gd),k.exit().remove(),Ih.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),Ih.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}),Ih.select(".chart-arcs-title").style("opacity",rd(Be.data.targets)?1:0),Rf&&(null!==Ae.event&&"zoom"===Ae.event.type&&Bh.extent(qf.orgDomain()).update(),u&&(Jh.select(".x.axis"
|