[],d,h,e;for(d=0;d<a.length;d++)for(e=a[d][0],h=1;h<a[d].length;h++)s(b[h-1])&&(b[h-1]={}),b[h-1][e]=a[d][h];returnb}functionIa(a){varb=e.keys(a[0]).filter(function(a){returna!==T}),d,h;if(z&&!T)returnha.alert('data.x must be specified when axis.x.type == "timeseries"'),[];kb&&s(k.data.x)&&(k.data.x=a.map(function(a){returna[T]}));d=0;a.forEach(function(a){if(z){if(!(Tina))throwError("'"+T+"' must be included in data");h=na(a[T]);if(null===h)throwError("Failed to parse timeseries date in data");
[],c,g,e;for(c=0;c<a.length;c++)for(e=a[c][0],g=1;g<a[c].length;g++)t(b[g-1])&&(b[g-1]={}),b[g-1][e]=a[c][g];returnb}functionIa(a){varb=e.keys(a[0]).filter(function(a){returna!==U}),c,g;if(z&&!U)returnP.alert('data.x must be specified when axis.x.type == "timeseries"'),[];lb&&t(k.data.x)&&(k.data.x=a.map(function(a){returna[U]}));c=0;a.forEach(function(a){if(z){if(!(Uina))throwError("'"+U+"' must be included in data");g=na(a[U]);if(null===g)throwError("Failed to parse timeseries date in data");
a.length;c++)if(s(q)||!Qc(a[c].x,q))r+=" "+kc(a[c])+" "+n(a[c]);else{k=I(a[c-1].x,a[c].x);l=D(a[c-1].value,a[c].value);g=b(a[c].x)-b(a[c-1].x);u=d(a[c].value)-d(a[c-1].value);g=Math.sqrt(Math.pow(g,2)+Math.pow(u,2));u=2/g;vart=2*u;for(g=u;1>=g;g+=t)r+=e(a[c-1],a[c],g,u)}returnr}functionsb(a){varb=k.data.targets=Ia(a),d,c;lc=e.select(ua);if(lc.empty())ha.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{Q();
a.length;d++)if(t(r)||!Pc(a[d].x,r))k+=" "+l(a[d])+" "+s(a[d]);else{h=I(a[d-1].x,a[d].x);m=D(a[d-1].value,a[d].value);q=b(a[d].x)-b(a[d-1].x);u=c(a[d].value)-c(a[d-1].value);q=Math.sqrt(Math.pow(q,2)+Math.pow(u,2));u=2/q;varv=2*u;for(q=u;1>=q;q+=v)k+=e(a[d-1],a[d],q,u)}returnk}functiontb(a){varb,c;ab=e.select(ua);if(ab.empty())P.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{ab.html("");k.data.x=void0;
null),oa=c(["zoom","enabled"],!1),tc=c(["zoom","extent"],null),ed=c(["zoom","privileged"],!1),Zc=c(["onenter"],function(){}),$c=c(["onleave"],function(){});if(!("data"inV))throwError("data is required in config");varT=c(["data","x"],void0),ld=c(["data","x_format"],"%Y-%m-%d"),Kc=c(["data","id_converter"],function(a){returna}),Ha=c(["data","names"],{}),v=c(["data","groups"],[]),Sb=c(["data","axes"],{}),ca=c(["data","types"],{}),uc=c(["data","regions"],{}),md=c(["data","colors"],{}),ea=c(["data",
250:0).attr("x",function(a,b){returnf+Pa*b+14})}functionQa(a){returnn(a)?".target-"+a:".target"}vark={data:{}},Ya={},ga="_expanded_",ha="_selected_",Ab="_included_",ua=d(["bindto"],"#chart"),Fb=d(["size","width"],null),Gb=d(["size","height"],null),Mb=d(["padding","left"],null),Kb=d(["padding","right"],null),oa=d(["zoom","enabled"],!1),sc=d(["zoom","extent"],null),dd=d(["zoom","privileged"],!1),Yc=d(["onenter"],function(){}),Zc=d(["onleave"],function(){});if(!("data"inW))throwError("data is required in config");
if("cacheIds"ina&&sa(a.cacheIds))Oa(Ra(a.cacheIds),a.done);elseif("data"ina)Oa(Ia(a.data),a.done);elseif("url"ina)e.csv(a.url,function(b,d){Oa(Ia(d),a.done)});elseif("rows"ina)Oa(Ia(Ub(a.rows)),a.done);elseif("columns"ina)Oa(Ia(Vb(a.columns)),a.done);elsethrowError("url or rows or columns is required.");};k.unload=function(a){k.data.targets=k.data.targets.filter(function(b){returnb.id!==a});e.selectAll(".target-"+a).transition().style("opacity",0).remove();za&&(e.selectAll(".legend-item-"+
c){Oa(Ia(c),a.done)});elseif("rows"ina)Oa(Ia(Vb(a.rows)),a.done);elseif("columns"ina)Oa(Ia(Wb(a.columns)),a.done);elsethrowError("url or rows or columns is required.");};k.unload=function(a){k.data.targets=k.data.targets.filter(function(b){returnb.id!==a});e.selectAll(".target-"+a).transition().style("opacity",0).remove();za&&(e.selectAll(".legend-item-"+a).remove(),db(k.data.targets));0<k.data.targets.length&&C()};k.selected=function(a){a=n(a)?"-"+a:"";returne.merge(h.selectAll(".-shapes"+
Xa(function(b){returnb.id===a});return0<b.length?b[0]:void0};if("url"inV.data)e.csv(V.data.url,function(a,b){sb(b)});elseif("rows"inV.data)sb(Ub(V.data.rows));elseif("columns"inV.data)sb(Vb(V.data.columns));elsethrowError("url or rows or columns is required.");ha.onresize=function(){Q();Ab();F.x(Z);oa&&G.x(l);e.select("svg").attr("width",fb).attr("height",va);e.select("#"+tb).select("rect").attr("width",q).attr("height",t);e.select("#xaxis-clip").select("rect").attr("width",W);e.select(".zoom-rect").attr("width",
null};if("url"inW.data)e.csv(W.data.url,function(a,b){tb(b)});elseif("rows"inW.data)tb(Vb(W.data.rows));elseif("columns"inW.data)tb(Wb(W.data.columns));elsethrowError("url or rows or columns is required.");returnk}})(window);