1])&&(b[f-1]={}),b[f-1][c]=a[d][f];returnb}functionKa(a){varb=c.keys(a[0]).filter(id),d=c.keys(a[0]).filter(ec);if(r&&0===d.length)returnP.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"'),[];tb&&b.forEach(function(b){varc=qa?qa:X?X[b]:null;0<=d.indexOf(c)&&(h.data.x[b]=a.map(function(a){returna[c]}))});b=b.map(function(b){vard=jd(b);return{id:d,id_org:b,values:a.map(function(a,c){vare;e=qa?qa:X?X[b]:null;e=r?pa(a[e]):tb?a[e]?a[e]:h.data.x[b][c]:c;if(e<ea||null===
a:a.id]}functionwc(a){returnGa(a)?a.values:[]}functionod(a){varb;(b=xb(a))||(b="scatter"===O["string"===typeofa?a:a.id]);returnb?a.values:[]}functionpa(a){varb;if(!a)throwError(a+" can not be parsed as d3.time with format "+yb+". Maybe 'x' of this data is not defined. See data.x or data.xs option.");b=c.time.format(yb).parse(a);if(!b)throwError("Failed to parse '"+a+"' with format "+yb);returnb}functionxc(a,b){vard=c.mouse(a),f=c.select(a),e=1*f.attr("cx"),f=1*f.attr("cy");returnMath.sqrt(Math.pow(e-
d(a[c-1].value);e=Math.sqrt(Math.pow(e,2)+Math.pow(l,2));l=2/e;vars=2*l;for(e=l;1>=e;e+=s)h+=f(a[c-1],a[c],e,l)}returnh}functionDb(a){varb,d;hb=c.select(wa);if(hb.empty())P.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{hb.html("");h.data.x={};h.data.targets=Ka(a);Gc&&Na(fb().filter(function(a){return!(ainO)}),Gc);ua();Mb();m.domain(c.extent(Va()));w.domain(ka("y"));U.domain(ka("y2"));da.domain(m.domain());
{data:{}},db={},Z="_expanded_",ia="_selected_",Lb="_included_",wa=e(["bindto"],"#chart"),Xa=e(["size","width"],null),Yb=e(["size","height"],null),Ub=e(["padding","left"],null),Sb=e(["padding","right"],null),ra=e(["zoom","enabled"],!1),Pc=e(["zoom","extent"],null),Fd=e(["zoom","privileged"],!1),yd=e(["onenter"],function(){}),zd=e(["onleave"],function(){});if(!("data"in$))throwError("data is required in config");varqa=e(["data","x"],null),X=e(["data","xs"],null),yb=e(["data","x_format"],"%Y-%m-%d"),
a.done);elsethrowError("url or rows or columns is required.");};h.unload=function(a){h.data.targets=h.data.targets.filter(function(b){returnb.id!==a});c.selectAll(".target-"+a).transition().style("opacity",0).remove();Aa&&(c.selectAll(".legend-item-"+a).remove(),kb(h.data.targets));0<h.data.targets.length&&z()};h.selected=function(a){a=n(a)?"-"+a:"";returnc.merge(k.selectAll(".-shapes"+a).selectAll(".-shape").filter(function(){returnc.select(this).classed(ia)}).map(function(a){returna.map(function(a){returna.__data__})}))};
0;c<a.length;c++)for(d=a[c][0],h=1;h<a[c].length;h++)t(b[h-1])&&(b[h-1]={}),b[h-1][d]=a[c][h];returnb}functionOa(a){varb=d.keys(a[0]).filter(Cd),c=d.keys(a[0]).filter(qc);if(z&&0===c.length)returnT.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"'),[];Eb&&b.forEach(function(b){vard=sa?sa:aa?aa[b]:null;0<=c.indexOf(d)&&(f.data.x[b]=a.map(function(a){returna[d]}))});b=b.map(function(b){varc=Dd(b);return{id:c,id_org:b,values:a.map(function(a,d){vare;e=sa?sa:aa?aa[b]:
returnc}functionA(a){returnBb(a,"pie")}functionGb(a){a="string"===typeofa?a:a.id;return!(ainN)||"line"===N[a]||"spline"===N[a]}functionKa(a){return"bar"===N["string"===typeofa?a:a.id]}functionJc(a){return"pie"===N["string"===typeofa?a:a.id]}functionKc(a){returnKa(a)?a.values:[]}functionJd(a){varb;(b=Gb(a))||(b="scatter"===N["string"===typeofa?a:a.id]);returnb?a.values:[]}functionra(a){varb;if(!a)throwError(a+" can not be parsed as d3.time with format "+Hb+". Maybe 'x' of this data is not defined. See data.x or data.xs option.");
b=d.time.format(Hb).parse(a);if(!b)throwError("Failed to parse '"+a+"' with format "+Hb);returnb}functionLc(a,b){varc=d.mouse(a),h=d.select(a),e=1*h.attr("cx"),h=1*h.attr("cy");returnMath.sqrt(Math.pow(e-c[0],2)+Math.pow(h-c[1],2))<b}functionMc(a){varb=d.mouse(a),c=d.select(a);a=1*c.attr("x");varh=1*c.attr("y"),c=1*c.attr("width");returna-10<b[0]&&b[0]<a+c+10&&h-10<b[1]}functionKd(a,b){varc;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}functionBd(a,b){varc=!1;
" "+c(l(h+e))}:function(a,d,h,e){return"M"+b(m(h))+" "+c(l(h))+" "+b(m(h+e))+" "+c(l(h+e))};for(e=0;e<a.length;e++)if(t(q)||!Kd(a[e].x,q))k+=" "+Tc(a[e])+" "+r(a[e]);else{m=L(a[e-1].x,a[e].x);l=G(a[e-1].value,a[e].value);f=b(a[e].x)-b(a[e-1].x);n=c(a[e].value)-c(a[e-1].value);f=Math.sqrt(Math.pow(f,2)+Math.pow(n,2));n=2/f;varu=2*n;for(f=n;1>=f;f+=u)k+=d(a[e-1],a[e],f,n)}returnk}functionMb(a){varb,c;pb=d.select(ya);if(pb.empty())T.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');
ec=e(["padding","left"],null),cc=e(["padding","right"],null),ta=e(["zoom","enabled"],!1),ed=e(["zoom","extent"],null),$d=e(["zoom","privileged"],!1),Td=e(["onenter"],function(){}),Ud=e(["onleave"],function(){});if(!("data"inca))throwError("data is required in config");varsa=e(["data","x"],null),aa=e(["data","xs"],null),Hb=e(["data","x_format"],"%Y-%m-%d"),Dd=e(["data","id_converter"],function(a){returna}),Na=e(["data","names"],{}),u=e(["data","groups"],[]),nc=e(["data","axes"],{}),bd=e(["data",
a)Wa(Oa(a.data),a.done);elseif("url"ina)d.csv(a.url,function(b,c){Wa(Oa(c),a.done)});elseif("rows"ina)Wa(Oa(rc(a.rows)),a.done);elseif("columns"ina)Wa(Oa(sc(a.columns)),a.done);elsethrowError("url or rows or columns is required.");};f.unload=function(a){f.data.targets=f.data.targets.filter(function(b){returnb.id!==a});d.selectAll(".target-"+a).transition().style("opacity",0).remove();Ba&&(d.selectAll(".legend-item-"+a).remove(),sb(f.data.targets));0<f.data.targets.length&&B()};f.selected=
jb(function(b){returnb.id===a});return0<b.length?b[0]:void0};f.destroy=function(){f.data.targets=void0;f.data.x={};pb.html("");T.onresize=null};if("url"inca.data)d.csv(ca.data.url,function(a,b){Mb(b)});elseif("rows"inca.data)Mb(rc(ca.data.rows));elseif("columns"inca.data)Mb(sc(ca.data.columns));elsethrowError("url or rows or columns is required.");returnf}})(window);