Quite good looking graph derived from d3.js http://c3js.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

2 lines
54 KiB

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