From 53c63cfc13b62a3c0563a829bd8c29ca1efd4e4c Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Wed, 19 Mar 2014 00:44:01 +0900 Subject: [PATCH] Fix horizontal axis height --- c3.js | 7 ++++++- c3.min.js | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/c3.js b/c3.js index 2994547..d2a66a7 100644 --- a/c3.js +++ b/c3.js @@ -343,7 +343,9 @@ return position.isInner ? 20 + getMaxTickWidth(id) : 40 + getMaxTickWidth(id); } function getAxisHeightByAxisId(id) { - var position = getAxisLabelPositionById(id); + var position; + if (! getAxisLabel(id)) { return 20; } + position = getAxisLabelPositionById(id); return (position.isInner ? 0 : 20) + (id === 'y2' ? 20 : 0); } function getParentWidth() { @@ -539,6 +541,9 @@ function getAxisLabelText(option) { return typeof option === 'string' ? option : option ? option.text : null; } + function getAxisLabel(id) { + return id === 'x' ? __axis_x_label : id === 'y' ? __axis_y_label : __axis_y2_label; + } function getAxisLabelPosition(option, defaultPosition) { var position = (option && typeof option === 'object' && option.position) ? option.position : defaultPosition; return { diff --git a/c3.min.js b/c3.min.js index 2741a7c..830b1c8 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,2 +1,2 @@ -!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]);c0&&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 a0?a:320}function t(){return ld(se.data.targets)?0:Ae?Ae:ag?1:v("y")}function u(){return ld(se.data.targets)?0:Be?Be:ah?Se+(eg&&!Pf?v("y2"):1):eg?jg||Pf?1:v("y2"):1}function v(a){var b=gb(a);return b.isInner?20+yb(a):40+yb(a)}function w(a){var b=gb(a);return(b.isInner?0:20)+("y2"===a?20:0)}function x(){return+g.select(xe).style("width").replace("px","")}function y(){return+g.select(xe).style("height").replace("px","")}function z(a){return a?-1:-(Ie.left-1)}function A(a){return a?-20:-1}function B(){return z(!Pf)}function C(){return A(!Pf)}function D(){return z(Pf)}function E(){return A(Pf)}function F(a){return a?Le+2:Ie.left+20}function G(a){return a?80:Ne+2}function H(){return F(!Pf)}function I(){return G(!Pf)}function J(){return F(Pf)}function K(){return G(Pf)}function L(){var a=Pf?Ne:Le,b=Lb(),c=gc();return c>1?a*b/(c-1):a}function M(a){bh=a}function N(a){ch=a}function O(a){dh=a}function P(){return Lf?ah?ch*(bh+1):Pe:0}function Q(){return Lf?ah?Qe:dh*(bh+1):0}function R(){var a=db();return a.isInner?5:20}function S(){var a,b,c=!gf;$e=Pf?1:0,_e=Pf?Ne:Le,af=Pf?0:Ne,bf=Pf?Le:1,cf=$e,df=_e,ef=Pf?0:Oe,ff=Pf?Me:1,gf=U($e,_e,c?void 0:gf.domain(),function(){return nf.tickOffset()}),hf=V(af,bf),jf=V(af,bf),kf=U($e,_e,sh,function(a){return a%1?0:qf.tickOffset()}),lf=V(ef,ff),mf=V(ef,ff),a=_(),b=ab(),nf=Y(gf,Xg,a,b),qf=Y(kf,$g,a,b),of=Z(hf,Yg,bg,dg),pf=Z(jf,Zg,kg,mg),c||(gh.scale(kf),Ce&&kh.scale(gf)),T()}function T(){We=Ab(),Xe=Bb(),Ye=Bb(.98)}function U(a,b,c,f){var h=(Pg?g.time.scale():g.scale.linear()).range([a,b]);if(h.orgDomain=function(){return h.domain()},e(c)&&h.domain(c),d(f)&&(f=function(){return 0}),Qg){var i,j=h;h=function(a){return j(a)+f(a)};for(i in j)h[i]=j[i];h.orgDomain=function(){return j.domain()},h.domain=function(a){return arguments.length?(j.domain(a),h):(a=j.domain(),[a[0],a[1]+1])}}return h}function V(a,b){return g.scale.linear().range([a,b])}function W(a){return"y2"===$(a)?jf:hf}function X(a){return"y2"===$(a)?mf:lf}function Y(a,c,d,e){var f=(Qg?b():g.svg.axis()).scale(a).orient(c);return f.tickFormat(d).ticks(e),Qg?f.tickCentered(Sf):f.tickOffset=function(){var a=Pf?Ne:Le;return a*Lb()/gc()/2},Qg&&f.categories(Rf),f}function Z(a,b,c,d){return g.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function $(a){return a in xf?xf[a]:"y"}function _(){var a=Pg?Wg:Qg?pc:null;return Tf&&("function"==typeof Tf?a=Tf:Pg&&(a=function(a){return g.time.format(Tf)(a)})),a}function ab(){var a=gc();return Uf&&a>Vf?Vf:a}function bb(a){return"string"==typeof a?a:a?a.text:null}function cb(a,b){var c=a&&"object"==typeof a&&a.position?a.position:b;return{isInner:c.indexOf("inner")>=0,isOuter:c.indexOf("outer")>=0,isLeft:c.indexOf("left")>=0,isCenter:c.indexOf("center")>=0,isRight:c.indexOf("right")>=0,isTop:c.indexOf("top")>=0,isMiddle:c.indexOf("middle")>=0,isBottom:c.indexOf("bottom")>=0}}function db(){return cb(Xf,"inner-right")}function eb(){return cb(_f,"inner-top")}function fb(){return cb(ig,"inner-top")}function gb(a){return"y2"===a?fb():"y"===a?eb():db()}function hb(){return bb(Xf)}function ib(){return bb(_f)}function jb(){return bb(ig)}function kb(a,b){return a?b.isLeft?0:b.isCenter?Le/2:Le:b.isBottom?-Ne:b.isMiddle?-Ne/2:0}function lb(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function mb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function nb(){return kb(!Pf,db())}function ob(){return kb(Pf,eb())}function pb(){return kb(Pf,fb())}function qb(){return lb(Pf,eb())}function rb(){return lb(Pf,fb())}function sb(){var a=db();return Pf?a.isInner?"1.2em":-30-yb("x"):a.isInner?"-0.5em":"3em"}function tb(){var a=eb();return Pf?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-yb("y")}function ub(){var a=fb();return Pf?a.isInner?"1.2em":"-2.5em":a.isInner?"-0.5em":30+yb("y2")}function vb(){return mb(!Pf,db())}function wb(){return mb(Pf,eb())}function xb(){return mb(Pf,fb())}function yb(a){var b=0;return g.selectAll("."+a+".axis .tick text").each(function(){var a=this.getBBox();b0)for(f=nc(a),b=0;ba?a:0}),c=1;c0||(h[d][b]+=+a)});return g.min(Object.keys(h).map(function(a){return g.min(h[a])}))}function Jb(a){var b,c,d,e,f,h=lc(a);if(wf.length>0)for(f=oc(a),b=0;b0?a:0}),c=1;c+a||(h[d][b]+=+a)});return g.max(Object.keys(h).map(function(a){return g.max(h[a])}))}function Kb(a){var b,d,e,f,g,h,i,j,k=kc(function(b){return $(b.id)===a}),l="y2"===a?gg:Zf,m="y2"===a?fg:Yf,n=c(l)?l:Ib(k),o=c(m)?m:Jb(k),p="y2"===a?hg:$f,q=Hc()&&Pf;return n===o&&(0>n?o=0:n=0),b=Math.abs(o-n),d=e=f=q?0:.1*b,p&&(g=Math.max(Math.abs(n),Math.abs(o)),o=g-p,n=p-g),"y"===a&&cg&&(e=c(cg.top)?cg.top:d,f=c(cg.bottom)?cg.bottom:d),"y2"===a&&lg&&(e=c(lg.top)?lg.top:d,f=c(lg.bottom)?lg.bottom:d),q&&(h=Ic(n,o),i=Qb(hf.range()),j=[h[0]/i,h[1]/i],e+=b*(j[1]/(1-j[0]-j[1])),f+=b*(j[0]/(1-j[0]-j[1]))),hd(k)&&!nc(k)&&(f=n),[n-f,o+e]}function Lb(a){var b=Qb(sh),c=Qb(gf.domain());return a||0===c?1:b/c}function Mb(a){return g.min(a,function(a){return g.min(a.values,function(a){return a.x})})}function Nb(a){return g.max(a,function(a){return g.max(a.values,function(a){return a.x})})}function Ob(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return Qg?d=0:hd(a)?(c=gc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Pb(a){var b=[Mb(a),Nb(a)],c=b[0],d=b[1],e=Ob(a,b),f=Pg?new Date(c.getTime()-e):c-e,g=Pg?new Date(d.getTime()+e):d+e;return[f,g]}function Qb(a){return a[1]-a[0]}function Rb(a){for(var b=0;bd?0:d}function Wb(a){return rf&&a===rf||sf&&Bd(sf,a)}function Xb(a){return!Wb(a)}function Yb(a){return rf?rf:sf?sf[a]:null}function Zb(a,b){return a in se.data.x&&se.data.x[a]&&se.data.x[a][b]?se.data.x[a][b]:b}function $b(a){Object.keys(a).forEach(function(b){sf[b]=a[b]})}function _b(a){var b;return a&&(b=vf[a.id],a.name=b?b:a.id),a}function ac(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?b.map(function(a){return a[c]}):se.data.x[Object.keys(se.data.x)[0]]}),c=d.map(function(a){var c=uf(a);return{id:c,id_org:a,values:b.map(function(b,d){var e,f=Yb(a);return e=Pg?xd(b[f]):Rg?b[f]?+b[f]:Zb(a,d):d,b.x=e,{x:e,value:null===b[a]||isNaN(b[a])?null:+b[a],id:c}})}}),c.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++})}),yf&&fd(ic(c).filter(function(a){return!(a in zf)}),yf),c.forEach(function(a){Sb(a.id_org,a)}),c)}function dc(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}}function ec(a){return a>0&&se.data.targets[0].values[a-1]?se.data.targets[0].values[a-1].x:void 0}function fc(a){return a1?se.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?se.data.targets[0]:null,a}function ic(a){return a=d(a)?se.data.targets:a,a.map(function(a){return a.id})}function jc(a){var b,c=ic();for(b=0;ba})}function oc(a){return mc(a,function(a){return a>0})}function pc(a){return a=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?g=h:f=h,g-f===1?(e=[],a[f].x&&(e=e.concat(Pc(a,f))),a[g].x&&(e=e.concat(Pc(a,g))),Sc(e,b)):Qc(a,b,f,g)}function Rc(a,b){var c;return c=a.map(function(a){return Qc(a.values,b)}),Sc(c,b)}function Sc(a,b){var c,d;return a.forEach(function(a){var e=Cd(a,b);(c>e||!c)&&(c=e,d=a)}),d}function Tc(){return Bf&&"desc"===Bf.toLowerCase()}function Uc(){return Bf&&"asc"===Bf.toLowerCase()}function Vc(a){var b=Uc(),c=Tc();return b||c?a.sort(function(a,c){var d=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(d,0),f=c.values.reduce(d,0);return b?f-e:e-f}):"function"==typeof Bf&&a.sort(Bf),a}function Wc(a,b){var d,e,f,g,h,i,j,k=ld(se.data.targets),l=k?Oc:Nc,m=a.filter(function(a){return a&&c(a.value)});Gg&&0!==m.length&&(qh.html(Jg(a,_(),l,Vg)).style("visibility","hidden").style("display","block"),d=qh.property("offsetWidth"),e=qh.property("offsetHeight"),k?(g=Le/2+b[0],i=Ne/2+b[1]+20):(Pf?(f=q(),g=f+b[0]+100,h=g+d,j=r()-u(),i=gf(m[0].x)+20):(f=q(),g=f+t()+gf(m[0].x)+20,h=g+d,j=f+r()-u(),i=b[1]+15),h>j&&(g-=d+60),i+e>s()&&(i-=e+30)),qh.style("top",i+"px").style("left",g+"px").style("visibility","visible"))}function Xc(){qh.style("display","none")}function Yc(a){var b=a.filter(function(a){return a&&c(a.value)});Gg&&(id(se.data.targets)||ld(se.data.targets)||nh.selectAll("line.xgrid-focus").style("visibility","visible").data([b[0]]).attr(Pf?"y1":"x1",Jc).attr(Pf?"y2":"x2",Jc))}function Zc(){nh.select("line.xgrid-focus").style("visibility","hidden")}function $c(a){return a.x||0===a.x?gf(a.x):null}function _c(a){return W(a.id)(a.value)}function ad(){var a,b,c={},e=0;return kc(od).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function ed(a,b){return b?2*a.tickOffset()*.6/b:0}function fd(a,b){var c=d(a)?ic():a;"string"==typeof c&&(c=[c]);for(var e=0;e0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function Vd(a,b,c,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(e(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function Wd(b){var c,d,e;if(rh=g.select(xe),rh.empty())return void a.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(rh.html(""),se.data.x={},se.data.targets=cc(b),o(),S(),gf.domain(g.extent(Pb(se.data.targets))),hf.domain(Kb("y")),jf.domain(Kb("y2")),kf.domain(gf.domain()),lf.domain(hf.domain()),mf.domain(jf.domain()),sh=gf.domain(),gh.scale(kf),Ce&&kh.scale(gf),lh=g.select(xe).append("svg").attr("width",Le+Ie.left+Ie.right).attr("height",Ne+Ie.top+Ie.bottom).on("mouseenter",Fe).on("mouseleave",Ge),mh=lh.append("defs"),mh.append("clipPath").attr("id",Ng).append("rect").attr("width",Le).attr("height",Ne),mh.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),mh.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),nh=lh.append("g").attr("transform",_g.main),oh=If?lh.append("g").attr("transform",_g.context):null,ph=Lf?lh.append("g").attr("transform",_g.legend):null,qh=g.select(xe).style("position","relative").append("div").style("position","absolute").style("z-index","10").style("display","none"),nh.append("g").attr("class","x axis").attr("clip-path",Pf?"":j("xaxis-clip")).attr("transform",_g.x).append("text").attr("class","-axis-x-label").attr("transform",Pf?"rotate(-90)":"").attr("dy",sb).style("text-anchor",vb).text(hb),nh.append("g").attr("class","y axis").attr("clip-path",Pf?j("yaxis-clip"):"").append("text").attr("class","-axis-y-label").attr("transform",Pf?"":"rotate(-90)").attr("dx",qb).style("text-anchor",wb).text(ib),eg&&nh.append("g").attr("class","y2 axis").attr("transform",_g.y2).append("text").attr("class","-axis-y2-label").attr("transform",Pf?"":"rotate(-90)").attr("dx",rb).style("text-anchor",xb).text(jb),d=nh.append("g").attr("clip-path",Og).attr("class","grid"),ng&&d.append("g").attr("class","xgrids"),pg&&d.append("g").attr("class","xgrid-lines"),vg&&d.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",Pf?0:-10).attr("x2",Pf?Le:-10).attr("y1",Pf?-10:Ie.top).attr("y2",Pf?-10:Ne),qg&&d.append("g").attr("class","ygrids"),rg&&d.append("g").attr("class","ygrid-lines"),nh.append("g").attr("clip-path",Og).attr("class","regions"),nh.append("g").attr("clip-path",Og).attr("class","chart"),c=nh.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",Ce?Pf?"ns-resize":"ew-resize":null),nh.select(".chart").append("g").attr("class","chart-bars"),nh.select(".chart").append("g").attr("class","chart-lines"),nh.select(".chart").append("g").attr("class","chart-arcs").attr("transform",_g.arc).append("text").attr("class","chart-arcs-title").style("text-anchor","middle").text(Eg),nh.select(".chart").append("g").attr("class","chart-texts"),Ce&&nh.insert("rect",Ee?null:"g.grid").attr("class","zoom-rect").attr("width",Le).attr("height",Ne).style("opacity",0).style("cursor",Pf?"ns-resize":"ew-resize").call(kh).on("dblclick.zoom",null),null!==Wf&&gh.extent("function"!=typeof Wf?Wf:Wf(Pb())),If&&(oh.append("g").attr("clip-path",Og).attr("class","chart"),oh.select(".chart").append("g").attr("class","chart-bars"),oh.select(".chart").append("g").attr("class","chart-lines"),oh.append("g").attr("clip-path",Og).attr("class","x brush").call(gh).selectAll("rect").attr(Pf?"width":"height",Pf?Me:Oe),oh.append("g").attr("class","x axis").attr("transform",_g.subx).attr("clip-path",Pf?j("yaxis-clip"):"")),he(se.data.targets),Pf?nh.select(".x.axis").style("opacity",0).call(nf):(nh.select(".y.axis").style("opacity",0).call(of),nh.select(".y2.axis").style("opacity",0).call(pf)),ge({withTransform:!0,withUpdateXDomain:!0,withLegend:!0,durationForAxis:0}),Kg){if(Pg&&"string"==typeof Lg){for(Lg=xd(Lg),e=0;e0){d=[];for(var f in vf)for(c=0;cf&&h>c&&d>i&&j>d):"rect"===this.nodeName&&(c=1*l.attr("x"),d=1*l.attr("y"),e=1*l.attr("width"),k=Id,o=c+e>f&&h>c&&j>d),o^n&&(l.classed(we,!n),l.classed(ve,!m),k(!m,l,a,b))}))}function _d(a){ld(se.data.targets)||Ef&&(Sg=a,nh.select(".chart").append("rect").attr("class","dragarea").style("opacity",.1),Tg=!0)}function ae(){ld(se.data.targets)||Ef&&(nh.select(".dragarea").transition().duration(100).style("opacity",0).remove(),nh.selectAll(".-shape").classed(we,!1),Tg=!1)}function be(a){var b,d,f,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,I=ad(),J=ld(se.data.targets);if(a=e(a)?a:{},u=e(a.withY)?a.withY:!0,v=e(a.withSubchart)?a.withSubchart:!0,w=e(a.withTransition)?a.withTransition:!0,x=e(a.withTransform)?a.withTransform:!1,y=e(a.withUpdateXDomain)?a.withUpdateXDomain:!1,z=e(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,A=e(a.withLegend)?a.withLegend:!1,F=w?He:0,G=e(a.durationForExit)?a.durationForExit:F,H=e(a.durationForAxis)?a.durationForAxis:F,A&&Lf&&me(se.data.targets,a),z&&(gf.domain(g.extent(Pb(se.data.targets))),sh=gf.domain(),Ce&&kh.scale(gf).updateScaleExtent(),kf.domain(gf.domain()),gh.scale(kf)),y&&(gf.domain(gh.empty()?sh:gh.extent()),Ce&&kh.scale(gf).updateScaleExtent()),hf.domain(Kb("y")),jf.domain(Kb("y2")),nh.select(".x.axis").style("opacity",J?0:1).transition().duration(H).call(nf),nh.select(".y.axis").style("opacity",J?0:1).transition().duration(H).call(of),nh.select(".y2.axis").style("opacity",J?0:1).transition().duration(H).call(pf),B=Qd(I),D=Rd(I,!0),E=Rd(I,!1),nh.select(".x.axis .-axis-x-label").attr("x",nb),nh.select(".y.axis .-axis-y-label").attr("x",ob).attr("dy",tb),nh.select(".y2.axis .-axis-y2-label").attr("x",pb).attr("dy",ub),lf.domain(hf.domain()),mf.domain(jf.domain()),qh.style("display","none"),nh.select("line.xgrid-focus").style("visibility","hidden").attr("y2",Ne),ng){if("year"===og){d=[];for(var K=Pb(),M=K[0].getFullYear(),N=K[1].getFullYear(),O=M;N>=O;O++)d.push(new Date(O+"-01-01 00:00:00"))}else d=gf.ticks(10);b=nh.select(".xgrids").selectAll(".xgrid").data(d),b.enter().append("line").attr("class","xgrid"),b.attr("x1",Pf?0:function(a){return gf(a)-nf.tickOffset() -}).attr("x2",Pf?Le:function(a){return gf(a)-nf.tickOffset()}).attr("y1",Pf?function(a){return gf(a)-nf.tickOffset()}:Ie.top).attr("y2",Pf?function(a){return gf(a)-nf.tickOffset()}:Ne).style("opacity",function(){return+g.select(this).attr(Pf?"y1":"x1")===(Pf?Ne:0)?0:1}),b.exit().remove()}pg&&(f=nh.select(".xgrid-lines").selectAll(".xgrid-line").data(pg),h=f.enter().append("g").attr("class",function(a){return"xgrid-line xgrid-line-"+(a["class"]?a["class"]:"")}),h.append("line").style("opacity",0),h.append("text").attr("text-anchor","end").attr("transform",Pf?"":"rotate(-90)").attr("dx",Pf?0:-Ie.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(F).attr("x1",Pf?0:Kc).attr("x2",Pf?Le:Kc).attr("y1",Pf?Kc:Ie.top).attr("y2",Pf?Kc:Ne).style("opacity",1),f.select("text").transition().duration(F).attr("x",Pf?Le:0).attr("y",Kc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(F).style("opacity",0).remove()),u&&qg&&(i=nh.select(".ygrids").selectAll(".ygrid").data(hf.ticks(sg)),i.enter().append("line").attr("class","ygrid"),i.attr("x1",Pf?hf:0).attr("x2",Pf?hf:Le).attr("y1",Pf?0:hf).attr("y2",Pf?Ne:hf),i.exit().remove()),u&&rg&&(j=nh.select(".ygrid-lines").selectAll(".ygrid-line").data(rg),k=j.enter().append("g").attr("class",function(a){return"ygrid-line ygrid-line-"+(a.class?a.class:"")}),k.append("line").style("opacity",0),k.append("text").attr("text-anchor","end").attr("transform",Pf?"rotate(-90)":"").attr("dx",Pf?0:-Ie.top).attr("dy",-5).style("opacity",0),j.select("line").transition().duration(F).attr("x1",Pf?Lc:0).attr("x2",Pf?Lc:Le).attr("y1",Pf?0:Lc).attr("y2",Pf?Ne:Lc).style("opacity",1),j.select("text").transition().duration(F).attr("x",Pf?0:Le).attr("y",Lc).text(function(a){return a.text}).style("opacity",1),j.exit().transition().duration(F).style("opacity",0).remove()),m=nh.selectAll(".-bars").selectAll(".-bar").data(td),m.enter().append("path").attr("d",B).style("stroke","none").style("opacity",0).style("fill",function(a){return Vg(a.id)}).attr("class",Ac),m.style("opacity",Dc).transition().duration(F).attr("d",B).style("opacity",1),m.exit().transition().duration(G).style("opacity",0).remove(),o=nh.selectAll(".-texts").selectAll(".-text").data(vd),o.enter().append("text").attr("class",qc).attr("text-anchor",function(a){return Pf?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return Nc(a.value)}),o.style("fill-opacity",Ec).transition().duration(F).attr("x",D).attr("y",E).style("fill-opacity",Gc),o.exit().transition().duration(G).style("fill-opacity",0).remove(),nh.selectAll(".-line").style("opacity",Dc).transition().duration(F).attr("d",hh).style("opacity",1),nh.selectAll(".-area").style("opacity",0).transition().duration(F).attr("d",ih).style("opacity",th),l=nh.selectAll(".-circles").selectAll(".-circle").data(ud),l.enter().append("circle").attr("class",zc).style("opacity",0).attr("r",ug),l.style("opacity",Dc).transition().duration(F).style("opacity",Fc).attr("cx",Pf?_c:$c).attr("cy",Pf?$c:_c),l.exit().remove(),nh.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=zb(a);if(!b)return function(){return"M 0 0"};var c=g.interpolate(this._current,b);return this._current=c(0),function(a){return Cb(c(a),!0)}}).attr("transform",x?"scale(1)":"").style("opacity",1),nh.selectAll(".chart-arc").select("text").attr("transform",Db).style("opacity",0).transition().duration(F).text(Fb).style("opacity",function(a){return sd(a.data)?1:0}),nh.select(".chart-arcs-title").style("opacity",kd(se.data.targets)?1:0),If&&(null!==g.event&&"zoom"===g.event.type&&gh.extent(gf.orgDomain()).update(),v&&(oh.select(".x.axis").style("opacity",J?0:1).transition().duration(F).call(qf),gh.empty()||gh.extent(gf.orgDomain()).update(),C=Qd(I,!0),p=oh.selectAll(".-bars").selectAll(".-bar").data(td),p.enter().append("path").attr("d",C).style("stroke","none").style("fill",function(a){return Vg(a.id)}).attr("class",Ac),p.style("opacity",Dc).transition().duration(F).attr("d",C).style("opacity",1),p.exit().transition().duration(F).style("opacity",0).remove(),oh.selectAll(".-line").style("opacity",Dc).transition().duration(F).attr("d",jh).style("opacity",1))),nh.selectAll(".selected-circles").filter(function(a){return od(a)}).selectAll("circle").remove(),nh.selectAll(".selected-circle").transition().duration(F).attr("cx",Pf?_c:$c).attr("cy",Pf?$c:_c),sf?(q=nh.select(".event-rects").selectAll(".event-rect").data([0]),Yd(q.enter()),q.attr("x",0).attr("y",0).attr("width",Le).attr("height",Ne)):(Rg?(t=function(a,b){var c=ec(b),d=fc(b);return(gf(d?d:a.x+50)-gf(c?c:a.x-50))/2},s=function(a,b){var c=ec(b);return(gf(a.x)+gf(c?c:a.x-50))/2}):(t=L(),s=function(a){return gf(a.x)-t/2}),r=hc(),nh.select(".event-rects").datum(r?r.values:[]),q=nh.select(".event-rects").selectAll(".event-rect").data(function(a){return a}),Xd(q.enter()),q.attr("class",Cc).attr("x",Pf?0:s).attr("y",Pf?s:0).attr("width",Pf?Le:t).attr("height",Pf?t:Ne),q.exit().remove()),n=nh.select(".regions").selectAll("rect.region").data(Fg),n.enter().append("rect").style("fill-opacity",0),n.attr("class",Bc).attr("x",Pf?0:Ub).attr("y",Pf?Ub:Ie.top).attr("width",Pf?Le:Vb).attr("height",Pf?Vb:Ne).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(),ic().forEach(function(a){uh[a]=!0})}function ce(){be({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function de(){return"mousemove"===g.event.sourceEvent.type&&kh.altDomain?(gf.domain(kh.altDomain),void kh.scale(gf).updateScaleExtent()):(Qg&&gf.orgDomain()[0]===sh[0]&&gf.domain([sh[0]-1e-10,gf.orgDomain()[1]]),be({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===g.event.sourceEvent.type&&(Ug=!0)))}function ee(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function fe(){lh.attr("width",Pe).attr("height",Qe),lh.select("#"+Ng).select("rect").attr("width",Le).attr("height",Ne),lh.select("#xaxis-clip").select("rect").attr("width",H),lh.select(".zoom-rect").attr("width",Le).attr("height",Ne)}function ge(a){a=e(a)?a:{},a.withTransition=e(a.withTransition)?a.withTransition:!0,a.withTransform=e(a.withTransform)?a.withTransform:!1,a.withLegend=e(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.durationForExit=0,o(),S(),fe(),n(a.withTransition),be(a)}function he(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=nh.select(".chart-texts").selectAll(".chart-text").data(a),j=i.enter().append("g").attr("class",function(a){return"chart-text target target-"+a.id}).style("pointer-events","none"),j.append("g").attr("class",rc).style("fill",function(a){return Vg(a.id)}),e=nh.select(".chart-bars").selectAll(".chart-bar").data(a),d=e.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}).style("pointer-events","none"),d.append("g").attr("class",vc).style("fill",function(a){return Vg(a.id)}).style("stroke","none").style("cursor",function(a){return Gf(a)?"pointer":null}),c=nh.select(".chart-lines").selectAll(".chart-line").data(a),b=c.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}).style("pointer-events","none"),b.append("path").attr("class",tc).style("opacity",0).style("stroke",function(a){return Vg(a.id)}),b.append("path").attr("class",xc).style("opacity",function(){return th=+g.select(this).style("opacity"),0}).style("fill",function(a){return Vg(a.id)}),b.append("g").attr("class",function(a){return"selected-circles selected-circles-"+a.id}),b.append("g").attr("class",uc).style("fill",function(a){return Vg(a.id)}).style("cursor",function(a){return Gf(a)?"pointer":null}),a.forEach(function(a){var b=ne(a.id);nh.selectAll(".selected-circles"+b).selectAll(".selected-circle").each(function(b){b.value=a.values[b.x].value})}),h=nh.select(".chart-arcs").selectAll(".chart-arc").data(Ze(a)),f=h.enter().append("g").attr("class",function(a){return"chart-arc target target-"+a.data.id}),f.append("path").attr("class",wc).style("opacity",0).style("fill",function(a){return Vg(a.data.id)}).style("cursor",function(a){return Gf(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a){Gb(a.data.id),je(a.data.id)}).on("mousemove",function(a){var b=[_b({id:a.data.id,value:a.value,ratio:Eb(a)})];Wc(b,g.mouse(this))}).on("mouseout",function(a){Hb(a.data.id),le(),Xc()}),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),If&&(n=oh.select(".chart-bars").selectAll(".chart-bar").data(a),m=n.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}),m.append("g").attr("class",vc).style("fill",function(a){return Vg(a.id)}),l=oh.select(".chart-lines").selectAll(".chart-line").data(a),k=l.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}),k.append("path").attr("class",tc).style("opacity",0).style("stroke",function(a){return Vg(a.id)})),lh.selectAll(".target").transition().style("opacity",1)}function ie(a,b){se.data.targets.forEach(function(b){for(var c=0;ce&&(e=(k-j)/2,v=0,B++)),A[a]=B,z[B]=e,w[a]=v,v+=j}var e,f,g=a.getBBox(),h=10*Math.ceil((g.width+t)/10),i=10*Math.ceil((g.height+s)/10),j=ah?i:h,k=ah?Re:Se;c&&(v=0,B=0,m=0,p=0),x[b]=h,y[b]=i,(!m||h>=m)&&(m=h),(!p||i>=p)&&(p=i),f=ah?p:m,Of?(Object.keys(x).forEach(function(a){x[a]=m}),Object.keys(y).forEach(function(a){y[a]=p}),e=(k-f*r.length)/2,u>e?(v=0,B=0,r.forEach(function(a){d(a)})):d(b,!0)):d(b)}var f,g,h,i,j,k,l,m,p,q,r=ic(a),s=4,t=26,u=10,v=0,w={},x={},y={},z={},A={},B=0;b=d(b)?{}:b,q=e(b.withTransition)?b.withTransition:!0,ah?(g=function(a){return m*(.2+A[a])},j=function(a){return z[A[a]]+w[a]}):(g=function(a){return z[A[a]]+w[a]},j=function(a){return p*(.2+A[a])}),h=function(a,b){return g(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return g(a,b)-4},l=function(a,b){return j(a,b)-7},f=ph.selectAll(".legend-item").data(r).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+a}).style("cursor","pointer").on("click",function(a){Nf(a)}).on("mouseover",function(a){se.focus(a)}).on("mouseout",function(){se.revert()}),f.append("text").text(function(a){return e(vf[a])?vf[a]:a}).each(function(a,b){c(this,a,0===b)}).style("pointer-events","none").attr("x",ah?h:-200).attr("y",ah?-200:k),f.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",ah?i:-200).attr("y",ah?-200:l).attr("width",function(a){return x[a]}).attr("height",function(a){return y[a]}),f.append("rect").attr("class","legend-item-tile").style("pointer-events","none").style("fill",function(a){return Vg(a)}).attr("x",ah?h:-200).attr("y",ah?-200:j).attr("width",10).attr("height",10),ph.selectAll("text").data(r).each(function(a,b){c(this,a,0===b)}).transition().duration(q?250:0).attr("x",h).attr("y",k),ph.selectAll("rect.legend-item-event").data(r).transition().duration(q?250:0).attr("x",i).attr("y",l),ph.selectAll("rect.legend-item-tile").data(r).transition().duration(q?250:0).attr("x",g).attr("y",j),N(m),O(p),M(B),o(),S(),fe(),n(!1)}function ne(a){return a?"-"+a.replace(/\./g,"\\."):""}function oe(a){return".target"+ne(a)}function pe(a){return jc(a.id)}function qe(a){return"data"in a&&jc(a.data.id)}function re(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}var se={data:{}},te={},ue="_expanded_",ve="_selected_",we="_included_",xe=i(["bindto"],"#chart"),ye=i(["size","width"],null),ze=i(["size","height"],null),Ae=i(["padding","left"],null),Be=i(["padding","right"],null),Ce=i(["zoom","enabled"],!1),De=i(["zoom","extent"],null),Ee=i(["zoom","privileged"],!1),Fe=i(["onenter"],function(){}),Ge=i(["onleave"],function(){}),He=i(["transition","duration"],350);h("data","data is required in config");var Ie,Je,Ke,Le,Me,Ne,Oe,Pe,Qe,Re,Se,Te,Ue,Ve,We,Xe,Ye,Ze,$e,_e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf=i(["data","x"],null),sf=i(["data","xs"],null),tf=i(["data","x_format"],"%Y-%m-%d"),uf=i(["data","id_converter"],function(a){return a}),vf=i(["data","names"],{}),wf=i(["data","groups"],[]),xf=i(["data","axes"],{}),yf=i(["data","type"],null),zf=i(["data","types"],{}),Af=i(["data","labels"],{}),Bf=i(["data","order"],null),Cf=i(["data","regions"],{}),Df=i(["data","colors"],{}),Ef=i(["data","selection","enabled"],!1),Ff=i(["data","selection","grouped"],!1),Gf=i(["data","selection","isselectable"],function(){return!0}),Hf=i(["data","selection","multiple"],!0),If=i(["subchart","show"],!1),Jf=If?i(["subchart","size","height"],60):0,Kf=i(["color","pattern"],null),Lf=i(["legend","show"],!0),Mf=i(["legend","position"],"bottom"),Nf=i(["legend","item","onclick"],function(){}),Of=i(["legend","equally"],!1),Pf=i(["axis","rotated"],!1),Qf=i(["axis","x","type"],"indexed"),Rf=i(["axis","x","categories"],[]),Sf=i(["axis","x","tick","centered"],!1),Tf=i(["axis","x","tick","format"],null),Uf=i(["axis","x","tick","culling"],"categorized"===Qf?!1:!0),Vf=i(["axis","x","tick","count"],10),Wf=i(["axis","x","default"],null),Xf=i(["axis","x","label"],null),Yf=i(["axis","y","max"],null),Zf=i(["axis","y","min"],null),$f=i(["axis","y","center"],null),_f=i(["axis","y","label"],null),ag=i(["axis","y","inner"],!1),bg=i(["axis","y","tick","format"],null),cg=i(["axis","y","padding"],null),dg=i(["axis","y","ticks"],10),eg=i(["axis","y2","show"],!1),fg=i(["axis","y2","max"],null),gg=i(["axis","y2","min"],null),hg=i(["axis","y2","center"],null),ig=i(["axis","y2","label"],null),jg=i(["axis","y2","inner"],!1),kg=i(["axis","y2","tick","format"],null),lg=i(["axis","y2","padding"],null),mg=i(["axis","y2","ticks"],10),ng=i(["grid","x","show"],!1),og=i(["grid","x","type"],"tick"),pg=i(["grid","x","lines"],null),qg=i(["grid","y","show"],!1),rg=i(["grid","y","lines"],null),sg=i(["grid","y","ticks"],10),tg=i(["point","show"],!0),ug=tg?i(["point","r"],2.5):0,vg=i(["point","focus","line","enabled"],!0),wg=i(["point","focus","expand","enabled"],!0),xg=i(["point","focus","expand","r"],wg?4:ug),yg=i(["point","focus","select","r"],8),zg=i(["point","onclick"],function(){}),Ag=i(["point","onselected"],function(){}),Bg=i(["point","onunselected"],function(){}),Cg=i(["arc","label","show"],!0),Dg=i(["arc","label","format"],null),Eg=i(["arc","title"],""),Fg=i(["regions"],[]),Gg=i(["tooltip","show"],!0),Hg=i(["tooltip","format","title"],null),Ig=i(["tooltip","format","value"],null),Jg=i(["tooltip","contents"],function(a,b,c,d){var e,f,g,h,i,j=Hg?Hg:b,k=Ig?Ig:c;for(f=0;f"+(g?""+g+"":"")),i=a[f].name,h=k(a[f].value,a[f].ratio),e+=""+i+""+h+"");return e+""}),Kg=i(["tooltip","init","show"],!1),Lg=i(["tooltip","init","x"],0),Mg=i(["tooltip","init","position"],{top:"0px",left:"50px"}),Ng=xe.replace("#","")+"-clip",Og=j(Ng),Pg="timeseries"===Qf,Qg="categorized"===Qf,Rg=!Pg&&(rf||sf),Sg=null,Tg=!1,Ug=!1,Vg=wd(Df,Kf),Wg=function(){var a=[[g.time.format("%Y/%-m/%-d"),function(){return!0}],[g.time.format("%-m/%-d"),function(a){return a.getMonth()}],[g.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[g.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[g.time.format("%I %p"),function(a){return a.getHours()}],[g.time.format("%I:%M"),function(a){return a.getMinutes()}],[g.time.format(":%S"),function(a){return a.getSeconds()}],[g.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),Xg=Pf?"left":"bottom",Yg=Pf?ag?"top":"bottom":ag?"right":"left",Zg=Pf?jg?"bottom":"top":jg?"left":"right",$g=Pf?"left":"bottom",_g={main:function(){return"translate("+Ie.left+","+Ie.top+")"},context:function(){return"translate("+Je.left+","+Je.top+")"},legend:function(){return"translate("+Ke.left+","+Ke.top+")"},x:function(){return"translate(0,"+(Pf?0:Ne)+")"},y:function(){return"translate(0,"+(Pf?Ne:0)+")"},y2:function(){return"translate("+(Pf?0:Le)+","+(Pf?1:0)+")"},subx:function(){return"translate(0,"+(Pf?0:Oe)+")"},arc:function(){return"translate("+Le/2+","+Ne/2+")"}},ah="right"===Mf,bh=0,ch=0,dh=0,eh=40,fh=20;Ze=g.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var gh,hh=function(){var a=g.svg.line().x(Pf?function(a){return W(a.id)(a.value)}:Jc).y(Pf?Jc:function(a){return W(a.id)(a.value)});return function(b){var c,d,e=Jd(b.values);return md(b)?(a.interpolate(nd(b)?"cardinal":"linear"),Cf[b.id]?Vd(e,gf,W(b.id),Cf[b.id]):a(e)):(c=gf(e[0].x),d=W(b.id)(e[0].value),Pf?"M "+d+" "+c:"M "+c+" "+d)}}(),ih=function(){var a;return a=Pf?g.svg.area().x0(function(a){return W(a.id)(0)}).x1(function(a){return W(a.id)(a.value)}).y(Jc):g.svg.area().x(Jc).y0(function(a){return W(a.id)(0)}).y1(function(a){return W(a.id)(a.value)}),function(b){var c,d,e=Jd(b.values);return gd([b],"area")||gd([b],"area-spline")?(a.interpolate(nd(b)?"cardinal":"linear"),a(e)):(c=gf(e[0].x),d=W(b.id)(e[0].value),Pf?"M "+d+" "+c:"M "+c+" "+d)}}(),jh=function(){var a=g.svg.line().x(Pf?function(a){return X(a.id)(a.value)}:Mc).y(Pf?Mc:function(a){return X(a.id)(a.value)});return function(b){var c=Jd(b.values);return md(b)?a(c):"M "+kf(c[0].x)+" "+X(b.id)(c[0].value)}}(),kh=function(){};gh=g.svg.brush().on("brush",ce),gh.update=function(){return oh&&oh.select(".x.brush").call(this),this},gh.scale=function(a){return Pf?this.y(a):this.x(a)},Ce&&(kh=g.behavior.zoom().on("zoomstart",function(){kh.altDomain=g.event.sourceEvent.altKey?gf.orgDomain():null}).on("zoom",Ce?de:null),kh.scale=function(a){return Pf?this.y(a):this.x(a)},kh.orgScaleExtent=function(){var a=De?De:[1,10];return[a[0],Math.max(gc()/a[1],a[1])]},kh.updateScaleExtent=function(){var a=Qb(gf.orgDomain())/Qb(sh),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var lh,mh,nh,oh,ph,qh,rh,sh,th,uh={};if(se.focus=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=lh.selectAll(oe(a)),d=c.filter(pe),e=c.filter(qe);se.revert(),se.defocus(),b(d.classed("focused",!0)),b(e),ld(se.data.targets)&&Gb(a,!0),je(a)},se.defocus=function(a){function b(a){a.transition().duration(100).style("opacity",.3)}var c=lh.selectAll(oe(a)),d=c.filter(pe),e=c.filter(qe);se.revert(),b(d.classed("focused",!1)),b(e),ld(se.data.targets)&&Hb(a),ke(a)},se.revert=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=lh.selectAll(oe(a)),d=c.filter(pe),e=c.filter(qe);b(d.classed("focused",!1)),b(e),ld(se.data.targets)&&Hb(a),le()},se.show=function(a){lh.selectAll(oe(a)).transition().style("opacity",1)},se.hide=function(a){lh.selectAll(oe(a)).transition().style("opacity",0)},se.unzoom=function(){gh.clear().update(),be({withUpdateXDomain:!0})},se.load=function(a){if("function"!=typeof a.done&&(a.done=function(){}),a.xs&&$b(a.xs),"categories"in a&&Qg&&(Rf=a.categories,nf.categories(Rf)),"cacheIds"in a&&Rb(a.cacheIds))return void ie(Tb(a.cacheIds),a.done);if("data"in a)ie(cc(a.data),a.done);else if("url"in a)g.csv(a.url,function(b,c){ie(cc(c),a.done)});else if("rows"in a)ie(cc(ac(a.rows)),a.done);else{if(!("columns"in a))throw Error("url or rows or columns is required.");ie(cc(bc(a.columns)),a.done)}},se.unload=function(a){se.data.targets=se.data.targets.filter(function(b){return b.id!==a}),lh.selectAll(oe(a)).transition().style("opacity",0).remove(),Lf&&ph.selectAll(".legend-item"+ne(a)).remove(),se.data.targets.length>0&&be({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},se.selected=function(a){var b=ne(a);return g.merge(nh.selectAll(".-shapes"+b).selectAll(".-shape").filter(function(){return g.select(this).classed(ve)}).map(function(a){return a.map(function(a){return a.__data__})}))},se.select=function(a,b,c){Ef&&nh.selectAll(".-shapes").selectAll(".-shape").each(function(d,f){var h="circle"===this.nodeName?Dd:Gd,i="circle"===this.nodeName?Ed:Hd,j=Ff||!a||a.indexOf(d.id)>=0,k=!b||b.indexOf(f)>=0;j&&k?Gf(d)&&h(g.select(this).classed(ve,!0),d,f):e(c)&&c&&i(g.select(this).classed(ve,!1),d,f)})},se.unselect=function(a,b){Ef&&nh.selectAll(".-shapes").selectAll(".-shape").each(function(c,d){var e="circle"===this.nodeName?Ed:Hd,f=Ff||!a||a.indexOf(c.id)>=0,h=!b||b.indexOf(d)>=0;f&&h&&Gf(c)&&e(g.select(this).classed(ve,!1),c,d)})},se.toLine=function(a){fd(a,"line"),ge()},se.toSpline=function(a){fd(a,"spline"),ge()},se.toBar=function(a){fd(a,"bar"),ge()},se.toScatter=function(a){fd(a,"scatter"),ge()},se.toArea=function(a){fd(a,"area"),ge()},se.toAreaSpline=function(a){fd(a,"area-spline"),ge()},se.toPie=function(a){fd(a,"pie"),ge({withTransform:!0})},se.toDonut=function(a){fd(a,"donut"),ge({withTransform:!0})},se.groups=function(a){return d(a)?wf:(wf=a,be(),wf)},se.xgrids=function(a){return a?(pg=a,be(),pg):pg},se.xgrids.add=function(a){return a?se.xgrids(pg.concat(a)):void 0},se.xgrids.remove=function(a){var b=re(a);return se.xgrids(pg.filter(b))},se.ygrids=function(a){return a?(rg=a,be(),rg):rg},se.ygrids.add=function(a){return a?se.ygrids(rg.concat(a)):void 0},se.ygrids.remove=function(a){var b=re(a);return se.ygrids(rg.filter(b))},se.regions=function(a){return d(a)?Fg:(Fg=a,be(),Fg)},se.regions.add=function(a){return d(a)?Fg:(Fg=Fg.concat(a),be(),Fg)},se.regions.remove=function(a,b){var d=[].concat(a);return b=e(b)?b:{},d.forEach(function(a){var d=c(b.duration)?b.duration:0;lh.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),Fg=Fg.filter(function(b){return b.classes.indexOf(a)<0})}),Fg},se.data.get=function(a){var b=se.data.getAsTarget(a);return e(b)?b.values.map(function(a){return a.value}):void 0},se.data.getAsTarget=function(a){var b=kc(function(b){return b.id===a});return b.length>0?b[0]:void 0},se.resize=function(a){ye=a?a.width:null,ze=a?a.height:null,ge({withLegend:!0,withTransition:!1})},se.destroy=function(){se.data.targets=void 0,se.data.x={},rh.html(""),a.onresize=null},"url"in f.data)g.csv(f.data.url,function(a,b){Wd(b)});else if("rows"in f.data)Wd(ac(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");Wd(bc(f.data.columns))}return se}}(window); \ No newline at end of file +!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]);c0&&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 a0?a:320}function t(){return md(te.data.targets)?0:Be?Be:bg?1:v("y")}function u(){return md(te.data.targets)?0:Ce?Ce:bh?Te+(fg&&!Qf?v("y2"):1):fg?kg||Qf?1:v("y2"):1}function v(a){var b=hb(a);return b.isInner?20+zb(a):40+zb(a)}function w(a){var b;return cb(a)?(b=hb(a),(b.isInner?0:20)+("y2"===a?20:0)):20}function x(){return+g.select(ye).style("width").replace("px","")}function y(){return+g.select(ye).style("height").replace("px","")}function z(a){return a?-1:-(Je.left-1)}function A(a){return a?-20:-1}function B(){return z(!Qf)}function C(){return A(!Qf)}function D(){return z(Qf)}function E(){return A(Qf)}function F(a){return a?Me+2:Je.left+20}function G(a){return a?80:Oe+2}function H(){return F(!Qf)}function I(){return G(!Qf)}function J(){return F(Qf)}function K(){return G(Qf)}function L(){var a=Qf?Oe:Me,b=Mb(),c=hc();return c>1?a*b/(c-1):a}function M(a){ch=a}function N(a){dh=a}function O(a){eh=a}function P(){return Mf?bh?dh*(ch+1):Qe:0}function Q(){return Mf?bh?Re:eh*(ch+1):0}function R(){var a=eb();return a.isInner?5:20}function S(){var a,b,c=!hf;_e=Qf?1:0,af=Qf?Oe:Me,bf=Qf?0:Oe,cf=Qf?Me:1,df=_e,ef=af,ff=Qf?0:Pe,gf=Qf?Ne:1,hf=U(_e,af,c?void 0:hf.domain(),function(){return of.tickOffset()}),jf=V(bf,cf),kf=V(bf,cf),lf=U(_e,af,th,function(a){return a%1?0:rf.tickOffset()}),mf=V(ff,gf),nf=V(ff,gf),a=_(),b=ab(),of=Y(hf,Yg,a,b),rf=Y(lf,_g,a,b),pf=Z(jf,Zg,cg,eg),qf=Z(kf,$g,lg,ng),c||(hh.scale(lf),De&&lh.scale(hf)),T()}function T(){Xe=Bb(),Ye=Cb(),Ze=Cb(.98)}function U(a,b,c,f){var h=(Qg?g.time.scale():g.scale.linear()).range([a,b]);if(h.orgDomain=function(){return h.domain()},e(c)&&h.domain(c),d(f)&&(f=function(){return 0}),Rg){var i,j=h;h=function(a){return j(a)+f(a)};for(i in j)h[i]=j[i];h.orgDomain=function(){return j.domain()},h.domain=function(a){return arguments.length?(j.domain(a),h):(a=j.domain(),[a[0],a[1]+1])}}return h}function V(a,b){return g.scale.linear().range([a,b])}function W(a){return"y2"===$(a)?kf:jf}function X(a){return"y2"===$(a)?nf:mf}function Y(a,c,d,e){var f=(Rg?b():g.svg.axis()).scale(a).orient(c);return f.tickFormat(d).ticks(e),Rg?f.tickCentered(Tf):f.tickOffset=function(){var a=Qf?Oe:Me;return a*Mb()/hc()/2},Rg&&f.categories(Sf),f}function Z(a,b,c,d){return g.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function $(a){return a in yf?yf[a]:"y"}function _(){var a=Qg?Xg:Rg?qc:null;return Uf&&("function"==typeof Uf?a=Uf:Qg&&(a=function(a){return g.time.format(Uf)(a)})),a}function ab(){var a=hc();return Vf&&a>Wf?Wf:a}function bb(a){return"string"==typeof a?a:a?a.text:null}function cb(a){return"x"===a?Yf:"y"===a?ag:jg}function db(a,b){var c=a&&"object"==typeof a&&a.position?a.position:b;return{isInner:c.indexOf("inner")>=0,isOuter:c.indexOf("outer")>=0,isLeft:c.indexOf("left")>=0,isCenter:c.indexOf("center")>=0,isRight:c.indexOf("right")>=0,isTop:c.indexOf("top")>=0,isMiddle:c.indexOf("middle")>=0,isBottom:c.indexOf("bottom")>=0}}function eb(){return db(Yf,"inner-right")}function fb(){return db(ag,"inner-top")}function gb(){return db(jg,"inner-top")}function hb(a){return"y2"===a?gb():"y"===a?fb():eb()}function ib(){return bb(Yf)}function jb(){return bb(ag)}function kb(){return bb(jg)}function lb(a,b){return a?b.isLeft?0:b.isCenter?Me/2:Me:b.isBottom?-Oe:b.isMiddle?-Oe/2:0}function mb(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function nb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function ob(){return lb(!Qf,eb())}function pb(){return lb(Qf,fb())}function qb(){return lb(Qf,gb())}function rb(){return mb(Qf,fb())}function sb(){return mb(Qf,gb())}function tb(){var a=eb();return Qf?a.isInner?"1.2em":-30-zb("x"):a.isInner?"-0.5em":"3em"}function ub(){var a=fb();return Qf?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-zb("y")}function vb(){var a=gb();return Qf?a.isInner?"1.2em":"-2.5em":a.isInner?"-0.5em":30+zb("y2")}function wb(){return nb(!Qf,eb())}function xb(){return nb(Qf,fb())}function yb(){return nb(Qf,gb())}function zb(a){var b=0;return g.selectAll("."+a+".axis .tick text").each(function(){var a=this.getBBox();b0)for(f=oc(a),b=0;ba?a:0}),c=1;c0||(h[d][b]+=+a)});return g.min(Object.keys(h).map(function(a){return g.min(h[a])}))}function Kb(a){var b,c,d,e,f,h=mc(a);if(xf.length>0)for(f=pc(a),b=0;b0?a:0}),c=1;c+a||(h[d][b]+=+a)});return g.max(Object.keys(h).map(function(a){return g.max(h[a])}))}function Lb(a){var b,d,e,f,g,h,i,j,k=lc(function(b){return $(b.id)===a}),l="y2"===a?hg:$f,m="y2"===a?gg:Zf,n=c(l)?l:Jb(k),o=c(m)?m:Kb(k),p="y2"===a?ig:_f,q=Ic()&&Qf;return n===o&&(0>n?o=0:n=0),b=Math.abs(o-n),d=e=f=q?0:.1*b,p&&(g=Math.max(Math.abs(n),Math.abs(o)),o=g-p,n=p-g),"y"===a&&dg&&(e=c(dg.top)?dg.top:d,f=c(dg.bottom)?dg.bottom:d),"y2"===a&&mg&&(e=c(mg.top)?mg.top:d,f=c(mg.bottom)?mg.bottom:d),q&&(h=Jc(n,o),i=Rb(jf.range()),j=[h[0]/i,h[1]/i],e+=b*(j[1]/(1-j[0]-j[1])),f+=b*(j[0]/(1-j[0]-j[1]))),id(k)&&!oc(k)&&(f=n),[n-f,o+e]}function Mb(a){var b=Rb(th),c=Rb(hf.domain());return a||0===c?1:b/c}function Nb(a){return g.min(a,function(a){return g.min(a.values,function(a){return a.x})})}function Ob(a){return g.max(a,function(a){return g.max(a.values,function(a){return a.x})})}function Pb(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return Rg?d=0:id(a)?(c=hc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Qb(a){var b=[Nb(a),Ob(a)],c=b[0],d=b[1],e=Pb(a,b),f=Qg?new Date(c.getTime()-e):c-e,g=Qg?new Date(d.getTime()+e):d+e;return[f,g]}function Rb(a){return a[1]-a[0]}function Sb(a){for(var b=0;bd?0:d}function Xb(a){return sf&&a===sf||tf&&Cd(tf,a)}function Yb(a){return!Xb(a)}function Zb(a){return sf?sf:tf?tf[a]:null}function $b(a,b){return a in te.data.x&&te.data.x[a]&&te.data.x[a][b]?te.data.x[a][b]:b}function _b(a){Object.keys(a).forEach(function(b){tf[b]=a[b]})}function ac(a){var b;return a&&(b=wf[a.id],a.name=b?b:a.id),a}function bc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?b.map(function(a){return a[c]}):te.data.x[Object.keys(te.data.x)[0]]}),c=d.map(function(a){var c=vf(a);return{id:c,id_org:a,values:b.map(function(b,d){var e,f=Zb(a);return e=Qg?yd(b[f]):Sg?b[f]?+b[f]:$b(a,d):d,b.x=e,{x:e,value:null===b[a]||isNaN(b[a])?null:+b[a],id:c}})}}),c.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++})}),zf&&gd(jc(c).filter(function(a){return!(a in Af)}),zf),c.forEach(function(a){Tb(a.id_org,a)}),c)}function ec(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}}function fc(a){return a>0&&te.data.targets[0].values[a-1]?te.data.targets[0].values[a-1].x:void 0}function gc(a){return a1?te.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?te.data.targets[0]:null,a}function jc(a){return a=d(a)?te.data.targets:a,a.map(function(a){return a.id})}function kc(a){var b,c=jc();for(b=0;ba})}function pc(a){return nc(a,function(a){return a>0})}function qc(a){return a=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?g=h:f=h,g-f===1?(e=[],a[f].x&&(e=e.concat(Qc(a,f))),a[g].x&&(e=e.concat(Qc(a,g))),Tc(e,b)):Rc(a,b,f,g)}function Sc(a,b){var c;return c=a.map(function(a){return Rc(a.values,b)}),Tc(c,b)}function Tc(a,b){var c,d;return a.forEach(function(a){var e=Dd(a,b);(c>e||!c)&&(c=e,d=a)}),d}function Uc(){return Cf&&"desc"===Cf.toLowerCase()}function Vc(){return Cf&&"asc"===Cf.toLowerCase()}function Wc(a){var b=Vc(),c=Uc();return b||c?a.sort(function(a,c){var d=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(d,0),f=c.values.reduce(d,0);return b?f-e:e-f}):"function"==typeof Cf&&a.sort(Cf),a}function Xc(a,b){var d,e,f,g,h,i,j,k=md(te.data.targets),l=k?Pc:Oc,m=a.filter(function(a){return a&&c(a.value)});Hg&&0!==m.length&&(rh.html(Kg(a,_(),l,Wg)).style("visibility","hidden").style("display","block"),d=rh.property("offsetWidth"),e=rh.property("offsetHeight"),k?(g=Me/2+b[0],i=Oe/2+b[1]+20):(Qf?(f=q(),g=f+b[0]+100,h=g+d,j=r()-u(),i=hf(m[0].x)+20):(f=q(),g=f+t()+hf(m[0].x)+20,h=g+d,j=f+r()-u(),i=b[1]+15),h>j&&(g-=d+60),i+e>s()&&(i-=e+30)),rh.style("top",i+"px").style("left",g+"px").style("visibility","visible"))}function Yc(){rh.style("display","none")}function Zc(a){var b=a.filter(function(a){return a&&c(a.value)});Hg&&(jd(te.data.targets)||md(te.data.targets)||oh.selectAll("line.xgrid-focus").style("visibility","visible").data([b[0]]).attr(Qf?"y1":"x1",Kc).attr(Qf?"y2":"x2",Kc))}function $c(){oh.select("line.xgrid-focus").style("visibility","hidden")}function _c(a){return a.x||0===a.x?hf(a.x):null}function ad(a){return W(a.id)(a.value)}function bd(){var a,b,c={},e=0;return lc(pd).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function fd(a,b){return b?2*a.tickOffset()*.6/b:0}function gd(a,b){var c=d(a)?jc():a;"string"==typeof c&&(c=[c]);for(var e=0;e0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function Wd(a,b,c,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(e(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function Xd(b){var c,d,e;if(sh=g.select(ye),sh.empty())return void a.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(sh.html(""),te.data.x={},te.data.targets=dc(b),o(),S(),hf.domain(g.extent(Qb(te.data.targets))),jf.domain(Lb("y")),kf.domain(Lb("y2")),lf.domain(hf.domain()),mf.domain(jf.domain()),nf.domain(kf.domain()),th=hf.domain(),hh.scale(lf),De&&lh.scale(hf),mh=g.select(ye).append("svg").attr("width",Me+Je.left+Je.right).attr("height",Oe+Je.top+Je.bottom).on("mouseenter",Ge).on("mouseleave",He),nh=mh.append("defs"),nh.append("clipPath").attr("id",Og).append("rect").attr("width",Me).attr("height",Oe),nh.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),nh.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),oh=mh.append("g").attr("transform",ah.main),ph=Jf?mh.append("g").attr("transform",ah.context):null,qh=Mf?mh.append("g").attr("transform",ah.legend):null,rh=g.select(ye).style("position","relative").append("div").style("position","absolute").style("z-index","10").style("display","none"),oh.append("g").attr("class","x axis").attr("clip-path",Qf?"":j("xaxis-clip")).attr("transform",ah.x).append("text").attr("class","-axis-x-label").attr("transform",Qf?"rotate(-90)":"").attr("dy",tb).style("text-anchor",wb).text(ib),oh.append("g").attr("class","y axis").attr("clip-path",Qf?j("yaxis-clip"):"").append("text").attr("class","-axis-y-label").attr("transform",Qf?"":"rotate(-90)").attr("dx",rb).style("text-anchor",xb).text(jb),fg&&oh.append("g").attr("class","y2 axis").attr("transform",ah.y2).append("text").attr("class","-axis-y2-label").attr("transform",Qf?"":"rotate(-90)").attr("dx",sb).style("text-anchor",yb).text(kb),d=oh.append("g").attr("clip-path",Pg).attr("class","grid"),og&&d.append("g").attr("class","xgrids"),qg&&d.append("g").attr("class","xgrid-lines"),wg&&d.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",Qf?0:-10).attr("x2",Qf?Me:-10).attr("y1",Qf?-10:Je.top).attr("y2",Qf?-10:Oe),rg&&d.append("g").attr("class","ygrids"),sg&&d.append("g").attr("class","ygrid-lines"),oh.append("g").attr("clip-path",Pg).attr("class","regions"),oh.append("g").attr("clip-path",Pg).attr("class","chart"),c=oh.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",De?Qf?"ns-resize":"ew-resize":null),oh.select(".chart").append("g").attr("class","chart-bars"),oh.select(".chart").append("g").attr("class","chart-lines"),oh.select(".chart").append("g").attr("class","chart-arcs").attr("transform",ah.arc).append("text").attr("class","chart-arcs-title").style("text-anchor","middle").text(Fg),oh.select(".chart").append("g").attr("class","chart-texts"),De&&oh.insert("rect",Fe?null:"g.grid").attr("class","zoom-rect").attr("width",Me).attr("height",Oe).style("opacity",0).style("cursor",Qf?"ns-resize":"ew-resize").call(lh).on("dblclick.zoom",null),null!==Xf&&hh.extent("function"!=typeof Xf?Xf:Xf(Qb())),Jf&&(ph.append("g").attr("clip-path",Pg).attr("class","chart"),ph.select(".chart").append("g").attr("class","chart-bars"),ph.select(".chart").append("g").attr("class","chart-lines"),ph.append("g").attr("clip-path",Pg).attr("class","x brush").call(hh).selectAll("rect").attr(Qf?"width":"height",Qf?Ne:Pe),ph.append("g").attr("class","x axis").attr("transform",ah.subx).attr("clip-path",Qf?j("yaxis-clip"):"")),ie(te.data.targets),Qf?oh.select(".x.axis").style("opacity",0).call(of):(oh.select(".y.axis").style("opacity",0).call(pf),oh.select(".y2.axis").style("opacity",0).call(qf)),he({withTransform:!0,withUpdateXDomain:!0,withLegend:!0,durationForAxis:0}),Lg){if(Qg&&"string"==typeof Mg){for(Mg=yd(Mg),e=0;e0){d=[];for(var f in wf)for(c=0;cf&&h>c&&d>i&&j>d):"rect"===this.nodeName&&(c=1*l.attr("x"),d=1*l.attr("y"),e=1*l.attr("width"),k=Jd,o=c+e>f&&h>c&&j>d),o^n&&(l.classed(xe,!n),l.classed(we,!m),k(!m,l,a,b))}))}function ae(a){md(te.data.targets)||Ff&&(Tg=a,oh.select(".chart").append("rect").attr("class","dragarea").style("opacity",.1),Ug=!0)}function be(){md(te.data.targets)||Ff&&(oh.select(".dragarea").transition().duration(100).style("opacity",0).remove(),oh.selectAll(".-shape").classed(xe,!1),Ug=!1)}function ce(a){var b,d,f,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,I=bd(),J=md(te.data.targets);if(a=e(a)?a:{},u=e(a.withY)?a.withY:!0,v=e(a.withSubchart)?a.withSubchart:!0,w=e(a.withTransition)?a.withTransition:!0,x=e(a.withTransform)?a.withTransform:!1,y=e(a.withUpdateXDomain)?a.withUpdateXDomain:!1,z=e(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,A=e(a.withLegend)?a.withLegend:!1,F=w?Ie:0,G=e(a.durationForExit)?a.durationForExit:F,H=e(a.durationForAxis)?a.durationForAxis:F,A&&Mf&&ne(te.data.targets,a),z&&(hf.domain(g.extent(Qb(te.data.targets))),th=hf.domain(),De&&lh.scale(hf).updateScaleExtent(),lf.domain(hf.domain()),hh.scale(lf)),y&&(hf.domain(hh.empty()?th:hh.extent()),De&&lh.scale(hf).updateScaleExtent()),jf.domain(Lb("y")),kf.domain(Lb("y2")),oh.select(".x.axis").style("opacity",J?0:1).transition().duration(H).call(of),oh.select(".y.axis").style("opacity",J?0:1).transition().duration(H).call(pf),oh.select(".y2.axis").style("opacity",J?0:1).transition().duration(H).call(qf),B=Rd(I),D=Sd(I,!0),E=Sd(I,!1),oh.select(".x.axis .-axis-x-label").attr("x",ob),oh.select(".y.axis .-axis-y-label").attr("x",pb).attr("dy",ub),oh.select(".y2.axis .-axis-y2-label").attr("x",qb).attr("dy",vb),mf.domain(jf.domain()),nf.domain(kf.domain()),rh.style("display","none"),oh.select("line.xgrid-focus").style("visibility","hidden").attr("y2",Oe),og){if("year"===pg){d=[];for(var K=Qb(),M=K[0].getFullYear(),N=K[1].getFullYear(),O=M;N>=O;O++)d.push(new Date(O+"-01-01 00:00:00"))}else d=hf.ticks(10);b=oh.select(".xgrids").selectAll(".xgrid").data(d),b.enter().append("line").attr("class","xgrid"),b.attr("x1",Qf?0:function(a){return hf(a)-of.tickOffset() +}).attr("x2",Qf?Me:function(a){return hf(a)-of.tickOffset()}).attr("y1",Qf?function(a){return hf(a)-of.tickOffset()}:Je.top).attr("y2",Qf?function(a){return hf(a)-of.tickOffset()}:Oe).style("opacity",function(){return+g.select(this).attr(Qf?"y1":"x1")===(Qf?Oe:0)?0:1}),b.exit().remove()}qg&&(f=oh.select(".xgrid-lines").selectAll(".xgrid-line").data(qg),h=f.enter().append("g").attr("class",function(a){return"xgrid-line xgrid-line-"+(a["class"]?a["class"]:"")}),h.append("line").style("opacity",0),h.append("text").attr("text-anchor","end").attr("transform",Qf?"":"rotate(-90)").attr("dx",Qf?0:-Je.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(F).attr("x1",Qf?0:Lc).attr("x2",Qf?Me:Lc).attr("y1",Qf?Lc:Je.top).attr("y2",Qf?Lc:Oe).style("opacity",1),f.select("text").transition().duration(F).attr("x",Qf?Me:0).attr("y",Lc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(F).style("opacity",0).remove()),u&&rg&&(i=oh.select(".ygrids").selectAll(".ygrid").data(jf.ticks(tg)),i.enter().append("line").attr("class","ygrid"),i.attr("x1",Qf?jf:0).attr("x2",Qf?jf:Me).attr("y1",Qf?0:jf).attr("y2",Qf?Oe:jf),i.exit().remove()),u&&sg&&(j=oh.select(".ygrid-lines").selectAll(".ygrid-line").data(sg),k=j.enter().append("g").attr("class",function(a){return"ygrid-line ygrid-line-"+(a.class?a.class:"")}),k.append("line").style("opacity",0),k.append("text").attr("text-anchor","end").attr("transform",Qf?"rotate(-90)":"").attr("dx",Qf?0:-Je.top).attr("dy",-5).style("opacity",0),j.select("line").transition().duration(F).attr("x1",Qf?Mc:0).attr("x2",Qf?Mc:Me).attr("y1",Qf?0:Mc).attr("y2",Qf?Oe:Mc).style("opacity",1),j.select("text").transition().duration(F).attr("x",Qf?0:Me).attr("y",Mc).text(function(a){return a.text}).style("opacity",1),j.exit().transition().duration(F).style("opacity",0).remove()),m=oh.selectAll(".-bars").selectAll(".-bar").data(ud),m.enter().append("path").attr("d",B).style("stroke","none").style("opacity",0).style("fill",function(a){return Wg(a.id)}).attr("class",Bc),m.style("opacity",Ec).transition().duration(F).attr("d",B).style("opacity",1),m.exit().transition().duration(G).style("opacity",0).remove(),o=oh.selectAll(".-texts").selectAll(".-text").data(wd),o.enter().append("text").attr("class",rc).attr("text-anchor",function(a){return Qf?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return Oc(a.value)}),o.style("fill-opacity",Fc).transition().duration(F).attr("x",D).attr("y",E).style("fill-opacity",Hc),o.exit().transition().duration(G).style("fill-opacity",0).remove(),oh.selectAll(".-line").style("opacity",Ec).transition().duration(F).attr("d",ih).style("opacity",1),oh.selectAll(".-area").style("opacity",0).transition().duration(F).attr("d",jh).style("opacity",uh),l=oh.selectAll(".-circles").selectAll(".-circle").data(vd),l.enter().append("circle").attr("class",Ac).style("opacity",0).attr("r",vg),l.style("opacity",Ec).transition().duration(F).style("opacity",Gc).attr("cx",Qf?ad:_c).attr("cy",Qf?_c:ad),l.exit().remove(),oh.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=Ab(a);if(!b)return function(){return"M 0 0"};var c=g.interpolate(this._current,b);return this._current=c(0),function(a){return Db(c(a),!0)}}).attr("transform",x?"scale(1)":"").style("opacity",1),oh.selectAll(".chart-arc").select("text").attr("transform",Eb).style("opacity",0).transition().duration(F).text(Gb).style("opacity",function(a){return td(a.data)?1:0}),oh.select(".chart-arcs-title").style("opacity",ld(te.data.targets)?1:0),Jf&&(null!==g.event&&"zoom"===g.event.type&&hh.extent(hf.orgDomain()).update(),v&&(ph.select(".x.axis").style("opacity",J?0:1).transition().duration(F).call(rf),hh.empty()||hh.extent(hf.orgDomain()).update(),C=Rd(I,!0),p=ph.selectAll(".-bars").selectAll(".-bar").data(ud),p.enter().append("path").attr("d",C).style("stroke","none").style("fill",function(a){return Wg(a.id)}).attr("class",Bc),p.style("opacity",Ec).transition().duration(F).attr("d",C).style("opacity",1),p.exit().transition().duration(F).style("opacity",0).remove(),ph.selectAll(".-line").style("opacity",Ec).transition().duration(F).attr("d",kh).style("opacity",1))),oh.selectAll(".selected-circles").filter(function(a){return pd(a)}).selectAll("circle").remove(),oh.selectAll(".selected-circle").transition().duration(F).attr("cx",Qf?ad:_c).attr("cy",Qf?_c:ad),tf?(q=oh.select(".event-rects").selectAll(".event-rect").data([0]),Zd(q.enter()),q.attr("x",0).attr("y",0).attr("width",Me).attr("height",Oe)):(Sg?(t=function(a,b){var c=fc(b),d=gc(b);return(hf(d?d:a.x+50)-hf(c?c:a.x-50))/2},s=function(a,b){var c=fc(b);return(hf(a.x)+hf(c?c:a.x-50))/2}):(t=L(),s=function(a){return hf(a.x)-t/2}),r=ic(),oh.select(".event-rects").datum(r?r.values:[]),q=oh.select(".event-rects").selectAll(".event-rect").data(function(a){return a}),Yd(q.enter()),q.attr("class",Dc).attr("x",Qf?0:s).attr("y",Qf?s:0).attr("width",Qf?Me:t).attr("height",Qf?t:Oe),q.exit().remove()),n=oh.select(".regions").selectAll("rect.region").data(Gg),n.enter().append("rect").style("fill-opacity",0),n.attr("class",Cc).attr("x",Qf?0:Vb).attr("y",Qf?Vb:Je.top).attr("width",Qf?Me:Wb).attr("height",Qf?Wb: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(),jc().forEach(function(a){vh[a]=!0})}function de(){ce({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function ee(){return"mousemove"===g.event.sourceEvent.type&&lh.altDomain?(hf.domain(lh.altDomain),void lh.scale(hf).updateScaleExtent()):(Rg&&hf.orgDomain()[0]===th[0]&&hf.domain([th[0]-1e-10,hf.orgDomain()[1]]),ce({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===g.event.sourceEvent.type&&(Vg=!0)))}function fe(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function ge(){mh.attr("width",Qe).attr("height",Re),mh.select("#"+Og).select("rect").attr("width",Me).attr("height",Oe),mh.select("#xaxis-clip").select("rect").attr("width",H),mh.select(".zoom-rect").attr("width",Me).attr("height",Oe)}function he(a){a=e(a)?a:{},a.withTransition=e(a.withTransition)?a.withTransition:!0,a.withTransform=e(a.withTransform)?a.withTransform:!1,a.withLegend=e(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.durationForExit=0,o(),S(),ge(),n(a.withTransition),ce(a)}function ie(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=oh.select(".chart-texts").selectAll(".chart-text").data(a),j=i.enter().append("g").attr("class",function(a){return"chart-text target target-"+a.id}).style("pointer-events","none"),j.append("g").attr("class",sc).style("fill",function(a){return Wg(a.id)}),e=oh.select(".chart-bars").selectAll(".chart-bar").data(a),d=e.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}).style("pointer-events","none"),d.append("g").attr("class",wc).style("fill",function(a){return Wg(a.id)}).style("stroke","none").style("cursor",function(a){return Hf(a)?"pointer":null}),c=oh.select(".chart-lines").selectAll(".chart-line").data(a),b=c.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}).style("pointer-events","none"),b.append("path").attr("class",uc).style("opacity",0).style("stroke",function(a){return Wg(a.id)}),b.append("path").attr("class",yc).style("opacity",function(){return uh=+g.select(this).style("opacity"),0}).style("fill",function(a){return Wg(a.id)}),b.append("g").attr("class",function(a){return"selected-circles selected-circles-"+a.id}),b.append("g").attr("class",vc).style("fill",function(a){return Wg(a.id)}).style("cursor",function(a){return Hf(a)?"pointer":null}),a.forEach(function(a){var b=oe(a.id);oh.selectAll(".selected-circles"+b).selectAll(".selected-circle").each(function(b){b.value=a.values[b.x].value})}),h=oh.select(".chart-arcs").selectAll(".chart-arc").data($e(a)),f=h.enter().append("g").attr("class",function(a){return"chart-arc target target-"+a.data.id}),f.append("path").attr("class",xc).style("opacity",0).style("fill",function(a){return Wg(a.data.id)}).style("cursor",function(a){return Hf(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a){Hb(a.data.id),ke(a.data.id)}).on("mousemove",function(a){var b=[ac({id:a.data.id,value:a.value,ratio:Fb(a)})];Xc(b,g.mouse(this))}).on("mouseout",function(a){Ib(a.data.id),me(),Yc()}),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),Jf&&(n=ph.select(".chart-bars").selectAll(".chart-bar").data(a),m=n.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}),m.append("g").attr("class",wc).style("fill",function(a){return Wg(a.id)}),l=ph.select(".chart-lines").selectAll(".chart-line").data(a),k=l.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}),k.append("path").attr("class",uc).style("opacity",0).style("stroke",function(a){return Wg(a.id)})),mh.selectAll(".target").transition().style("opacity",1)}function je(a,b){te.data.targets.forEach(function(b){for(var c=0;ce&&(e=(k-j)/2,v=0,B++)),A[a]=B,z[B]=e,w[a]=v,v+=j}var e,f,g=a.getBBox(),h=10*Math.ceil((g.width+t)/10),i=10*Math.ceil((g.height+s)/10),j=bh?i:h,k=bh?Se:Te;c&&(v=0,B=0,m=0,p=0),x[b]=h,y[b]=i,(!m||h>=m)&&(m=h),(!p||i>=p)&&(p=i),f=bh?p:m,Pf?(Object.keys(x).forEach(function(a){x[a]=m}),Object.keys(y).forEach(function(a){y[a]=p}),e=(k-f*r.length)/2,u>e?(v=0,B=0,r.forEach(function(a){d(a)})):d(b,!0)):d(b)}var f,g,h,i,j,k,l,m,p,q,r=jc(a),s=4,t=26,u=10,v=0,w={},x={},y={},z={},A={},B=0;b=d(b)?{}:b,q=e(b.withTransition)?b.withTransition:!0,bh?(g=function(a){return m*(.2+A[a])},j=function(a){return z[A[a]]+w[a]}):(g=function(a){return z[A[a]]+w[a]},j=function(a){return p*(.2+A[a])}),h=function(a,b){return g(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return g(a,b)-4},l=function(a,b){return j(a,b)-7},f=qh.selectAll(".legend-item").data(r).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+a}).style("cursor","pointer").on("click",function(a){Of(a)}).on("mouseover",function(a){te.focus(a)}).on("mouseout",function(){te.revert()}),f.append("text").text(function(a){return e(wf[a])?wf[a]:a}).each(function(a,b){c(this,a,0===b)}).style("pointer-events","none").attr("x",bh?h:-200).attr("y",bh?-200:k),f.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",bh?i:-200).attr("y",bh?-200:l).attr("width",function(a){return x[a]}).attr("height",function(a){return y[a]}),f.append("rect").attr("class","legend-item-tile").style("pointer-events","none").style("fill",function(a){return Wg(a)}).attr("x",bh?h:-200).attr("y",bh?-200:j).attr("width",10).attr("height",10),qh.selectAll("text").data(r).each(function(a,b){c(this,a,0===b)}).transition().duration(q?250:0).attr("x",h).attr("y",k),qh.selectAll("rect.legend-item-event").data(r).transition().duration(q?250:0).attr("x",i).attr("y",l),qh.selectAll("rect.legend-item-tile").data(r).transition().duration(q?250:0).attr("x",g).attr("y",j),N(m),O(p),M(B),o(),S(),ge(),n(!1)}function oe(a){return a?"-"+a.replace(/\./g,"\\."):""}function pe(a){return".target"+oe(a)}function qe(a){return kc(a.id)}function re(a){return"data"in a&&kc(a.data.id)}function se(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}var te={data:{}},ue={},ve="_expanded_",we="_selected_",xe="_included_",ye=i(["bindto"],"#chart"),ze=i(["size","width"],null),Ae=i(["size","height"],null),Be=i(["padding","left"],null),Ce=i(["padding","right"],null),De=i(["zoom","enabled"],!1),Ee=i(["zoom","extent"],null),Fe=i(["zoom","privileged"],!1),Ge=i(["onenter"],function(){}),He=i(["onleave"],function(){}),Ie=i(["transition","duration"],350);h("data","data is required in config");var Je,Ke,Le,Me,Ne,Oe,Pe,Qe,Re,Se,Te,Ue,Ve,We,Xe,Ye,Ze,$e,_e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf=i(["data","x"],null),tf=i(["data","xs"],null),uf=i(["data","x_format"],"%Y-%m-%d"),vf=i(["data","id_converter"],function(a){return a}),wf=i(["data","names"],{}),xf=i(["data","groups"],[]),yf=i(["data","axes"],{}),zf=i(["data","type"],null),Af=i(["data","types"],{}),Bf=i(["data","labels"],{}),Cf=i(["data","order"],null),Df=i(["data","regions"],{}),Ef=i(["data","colors"],{}),Ff=i(["data","selection","enabled"],!1),Gf=i(["data","selection","grouped"],!1),Hf=i(["data","selection","isselectable"],function(){return!0}),If=i(["data","selection","multiple"],!0),Jf=i(["subchart","show"],!1),Kf=Jf?i(["subchart","size","height"],60):0,Lf=i(["color","pattern"],null),Mf=i(["legend","show"],!0),Nf=i(["legend","position"],"bottom"),Of=i(["legend","item","onclick"],function(){}),Pf=i(["legend","equally"],!1),Qf=i(["axis","rotated"],!1),Rf=i(["axis","x","type"],"indexed"),Sf=i(["axis","x","categories"],[]),Tf=i(["axis","x","tick","centered"],!1),Uf=i(["axis","x","tick","format"],null),Vf=i(["axis","x","tick","culling"],"categorized"===Rf?!1:!0),Wf=i(["axis","x","tick","count"],10),Xf=i(["axis","x","default"],null),Yf=i(["axis","x","label"],null),Zf=i(["axis","y","max"],null),$f=i(["axis","y","min"],null),_f=i(["axis","y","center"],null),ag=i(["axis","y","label"],null),bg=i(["axis","y","inner"],!1),cg=i(["axis","y","tick","format"],null),dg=i(["axis","y","padding"],null),eg=i(["axis","y","ticks"],10),fg=i(["axis","y2","show"],!1),gg=i(["axis","y2","max"],null),hg=i(["axis","y2","min"],null),ig=i(["axis","y2","center"],null),jg=i(["axis","y2","label"],null),kg=i(["axis","y2","inner"],!1),lg=i(["axis","y2","tick","format"],null),mg=i(["axis","y2","padding"],null),ng=i(["axis","y2","ticks"],10),og=i(["grid","x","show"],!1),pg=i(["grid","x","type"],"tick"),qg=i(["grid","x","lines"],null),rg=i(["grid","y","show"],!1),sg=i(["grid","y","lines"],null),tg=i(["grid","y","ticks"],10),ug=i(["point","show"],!0),vg=ug?i(["point","r"],2.5):0,wg=i(["point","focus","line","enabled"],!0),xg=i(["point","focus","expand","enabled"],!0),yg=i(["point","focus","expand","r"],xg?4:vg),zg=i(["point","focus","select","r"],8),Ag=i(["point","onclick"],function(){}),Bg=i(["point","onselected"],function(){}),Cg=i(["point","onunselected"],function(){}),Dg=i(["arc","label","show"],!0),Eg=i(["arc","label","format"],null),Fg=i(["arc","title"],""),Gg=i(["regions"],[]),Hg=i(["tooltip","show"],!0),Ig=i(["tooltip","format","title"],null),Jg=i(["tooltip","format","value"],null),Kg=i(["tooltip","contents"],function(a,b,c,d){var e,f,g,h,i,j=Ig?Ig:b,k=Jg?Jg:c;for(f=0;f"+(g?""+g+"":"")),i=a[f].name,h=k(a[f].value,a[f].ratio),e+=""+i+""+h+"");return e+""}),Lg=i(["tooltip","init","show"],!1),Mg=i(["tooltip","init","x"],0),Ng=i(["tooltip","init","position"],{top:"0px",left:"50px"}),Og=ye.replace("#","")+"-clip",Pg=j(Og),Qg="timeseries"===Rf,Rg="categorized"===Rf,Sg=!Qg&&(sf||tf),Tg=null,Ug=!1,Vg=!1,Wg=xd(Ef,Lf),Xg=function(){var a=[[g.time.format("%Y/%-m/%-d"),function(){return!0}],[g.time.format("%-m/%-d"),function(a){return a.getMonth()}],[g.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[g.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[g.time.format("%I %p"),function(a){return a.getHours()}],[g.time.format("%I:%M"),function(a){return a.getMinutes()}],[g.time.format(":%S"),function(a){return a.getSeconds()}],[g.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),Yg=Qf?"left":"bottom",Zg=Qf?bg?"top":"bottom":bg?"right":"left",$g=Qf?kg?"bottom":"top":kg?"left":"right",_g=Qf?"left":"bottom",ah={main:function(){return"translate("+Je.left+","+Je.top+")"},context:function(){return"translate("+Ke.left+","+Ke.top+")"},legend:function(){return"translate("+Le.left+","+Le.top+")"},x:function(){return"translate(0,"+(Qf?0:Oe)+")"},y:function(){return"translate(0,"+(Qf?Oe:0)+")"},y2:function(){return"translate("+(Qf?0:Me)+","+(Qf?1:0)+")"},subx:function(){return"translate(0,"+(Qf?0:Pe)+")"},arc:function(){return"translate("+Me/2+","+Oe/2+")"}},bh="right"===Nf,ch=0,dh=0,eh=0,fh=40,gh=20;$e=g.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var hh,ih=function(){var a=g.svg.line().x(Qf?function(a){return W(a.id)(a.value)}:Kc).y(Qf?Kc:function(a){return W(a.id)(a.value)});return function(b){var c,d,e=Kd(b.values);return nd(b)?(a.interpolate(od(b)?"cardinal":"linear"),Df[b.id]?Wd(e,hf,W(b.id),Df[b.id]):a(e)):(c=hf(e[0].x),d=W(b.id)(e[0].value),Qf?"M "+d+" "+c:"M "+c+" "+d)}}(),jh=function(){var a;return a=Qf?g.svg.area().x0(function(a){return W(a.id)(0)}).x1(function(a){return W(a.id)(a.value)}).y(Kc):g.svg.area().x(Kc).y0(function(a){return W(a.id)(0)}).y1(function(a){return W(a.id)(a.value)}),function(b){var c,d,e=Kd(b.values);return hd([b],"area")||hd([b],"area-spline")?(a.interpolate(od(b)?"cardinal":"linear"),a(e)):(c=hf(e[0].x),d=W(b.id)(e[0].value),Qf?"M "+d+" "+c:"M "+c+" "+d)}}(),kh=function(){var a=g.svg.line().x(Qf?function(a){return X(a.id)(a.value)}:Nc).y(Qf?Nc:function(a){return X(a.id)(a.value)});return function(b){var c=Kd(b.values);return nd(b)?a(c):"M "+lf(c[0].x)+" "+X(b.id)(c[0].value)}}(),lh=function(){};hh=g.svg.brush().on("brush",de),hh.update=function(){return ph&&ph.select(".x.brush").call(this),this},hh.scale=function(a){return Qf?this.y(a):this.x(a)},De&&(lh=g.behavior.zoom().on("zoomstart",function(){lh.altDomain=g.event.sourceEvent.altKey?hf.orgDomain():null}).on("zoom",De?ee:null),lh.scale=function(a){return Qf?this.y(a):this.x(a)},lh.orgScaleExtent=function(){var a=Ee?Ee:[1,10];return[a[0],Math.max(hc()/a[1],a[1])]},lh.updateScaleExtent=function(){var a=Rb(hf.orgDomain())/Rb(th),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var mh,nh,oh,ph,qh,rh,sh,th,uh,vh={};if(te.focus=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=mh.selectAll(pe(a)),d=c.filter(qe),e=c.filter(re);te.revert(),te.defocus(),b(d.classed("focused",!0)),b(e),md(te.data.targets)&&Hb(a,!0),ke(a)},te.defocus=function(a){function b(a){a.transition().duration(100).style("opacity",.3)}var c=mh.selectAll(pe(a)),d=c.filter(qe),e=c.filter(re);te.revert(),b(d.classed("focused",!1)),b(e),md(te.data.targets)&&Ib(a),le(a)},te.revert=function(a){function b(a){a.transition().duration(100).style("opacity",1)}var c=mh.selectAll(pe(a)),d=c.filter(qe),e=c.filter(re);b(d.classed("focused",!1)),b(e),md(te.data.targets)&&Ib(a),me()},te.show=function(a){mh.selectAll(pe(a)).transition().style("opacity",1)},te.hide=function(a){mh.selectAll(pe(a)).transition().style("opacity",0)},te.unzoom=function(){hh.clear().update(),ce({withUpdateXDomain:!0})},te.load=function(a){if("function"!=typeof a.done&&(a.done=function(){}),a.xs&&_b(a.xs),"categories"in a&&Rg&&(Sf=a.categories,of.categories(Sf)),"cacheIds"in a&&Sb(a.cacheIds))return void je(Ub(a.cacheIds),a.done);if("data"in a)je(dc(a.data),a.done);else if("url"in a)g.csv(a.url,function(b,c){je(dc(c),a.done)});else if("rows"in a)je(dc(bc(a.rows)),a.done);else{if(!("columns"in a))throw Error("url or rows or columns is required.");je(dc(cc(a.columns)),a.done)}},te.unload=function(a){te.data.targets=te.data.targets.filter(function(b){return b.id!==a}),mh.selectAll(pe(a)).transition().style("opacity",0).remove(),Mf&&qh.selectAll(".legend-item"+oe(a)).remove(),te.data.targets.length>0&&ce({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},te.selected=function(a){var b=oe(a);return g.merge(oh.selectAll(".-shapes"+b).selectAll(".-shape").filter(function(){return g.select(this).classed(we)}).map(function(a){return a.map(function(a){return a.__data__})}))},te.select=function(a,b,c){Ff&&oh.selectAll(".-shapes").selectAll(".-shape").each(function(d,f){var h="circle"===this.nodeName?Ed:Hd,i="circle"===this.nodeName?Fd:Id,j=Gf||!a||a.indexOf(d.id)>=0,k=!b||b.indexOf(f)>=0;j&&k?Hf(d)&&h(g.select(this).classed(we,!0),d,f):e(c)&&c&&i(g.select(this).classed(we,!1),d,f)})},te.unselect=function(a,b){Ff&&oh.selectAll(".-shapes").selectAll(".-shape").each(function(c,d){var e="circle"===this.nodeName?Fd:Id,f=Gf||!a||a.indexOf(c.id)>=0,h=!b||b.indexOf(d)>=0;f&&h&&Hf(c)&&e(g.select(this).classed(we,!1),c,d)})},te.toLine=function(a){gd(a,"line"),he()},te.toSpline=function(a){gd(a,"spline"),he()},te.toBar=function(a){gd(a,"bar"),he()},te.toScatter=function(a){gd(a,"scatter"),he()},te.toArea=function(a){gd(a,"area"),he()},te.toAreaSpline=function(a){gd(a,"area-spline"),he()},te.toPie=function(a){gd(a,"pie"),he({withTransform:!0})},te.toDonut=function(a){gd(a,"donut"),he({withTransform:!0})},te.groups=function(a){return d(a)?xf:(xf=a,ce(),xf)},te.xgrids=function(a){return a?(qg=a,ce(),qg):qg},te.xgrids.add=function(a){return a?te.xgrids(qg.concat(a)):void 0},te.xgrids.remove=function(a){var b=se(a);return te.xgrids(qg.filter(b))},te.ygrids=function(a){return a?(sg=a,ce(),sg):sg},te.ygrids.add=function(a){return a?te.ygrids(sg.concat(a)):void 0},te.ygrids.remove=function(a){var b=se(a);return te.ygrids(sg.filter(b))},te.regions=function(a){return d(a)?Gg:(Gg=a,ce(),Gg)},te.regions.add=function(a){return d(a)?Gg:(Gg=Gg.concat(a),ce(),Gg)},te.regions.remove=function(a,b){var d=[].concat(a);return b=e(b)?b:{},d.forEach(function(a){var d=c(b.duration)?b.duration:0;mh.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),Gg=Gg.filter(function(b){return b.classes.indexOf(a)<0})}),Gg},te.data.get=function(a){var b=te.data.getAsTarget(a);return e(b)?b.values.map(function(a){return a.value}):void 0},te.data.getAsTarget=function(a){var b=lc(function(b){return b.id===a});return b.length>0?b[0]:void 0},te.resize=function(a){ze=a?a.width:null,Ae=a?a.height:null,he({withLegend:!0,withTransition:!1})},te.destroy=function(){te.data.targets=void 0,te.data.x={},sh.html(""),a.onresize=null},"url"in f.data)g.csv(f.data.url,function(a,b){Xd(b)});else if("rows"in f.data)Xd(bc(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");Xd(cc(f.data.columns))}return te}}(window); \ No newline at end of file