0===d.length)returnQ.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"'),[];rb&&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=gd(b);return{id:d,id_org:b,values:a.map(function(a,c){vare;e=qa?qa:X?X[b]:null;e=A?pa(a[e]):rb?a[e]?a[e]:h.data.x[b][c]:c;if(e<xa||null===xa)xa=e;Ma<e&&(Ma=e);a.x=e;return{x:e,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d,index:c}})}});b.forEach(function(a){eb[a.id_org]=
a:a.id;return!(ainha)||"line"===ha[a]||"spline"===ha[a]}functionHa(a){return"bar"===ha["string"===typeofa?a:a.id]}functionld(a){returnwb(a)?a.values:[]}functionsc(a){returnHa(a)?a.values:[]}functionpa(a){varb;if(!a)throwError(a+" can not be parsed as d3.time with format "+xb+". Maybe 'x' of this data is not defined. See data.x or data.xs option.");b=c.time.format(xb).parse(a);if(!b)throwError("Failed to parse '"+a+"' with format "+xb);returnb}functiontc(a,b){vard=c.mouse(a),f=c.select(a),
" "+Cc(a[c])+" "+q(a[c]);else{k=H(a[c-1].x,a[c].x);m=D(a[c-1].value,a[c].value);e=b(a[c].x)-b(a[c-1].x);l=d(a[c].value)-d(a[c-1].value);e=Math.sqrt(Math.pow(e,2)+Math.pow(l,2));l=2/e;varr=2*l;for(e=l;1>=e;e+=r)h+=f(a[c-1],a[c],e,l)}returnh}functionCb(a){varb,d;hb=c.select(wa);if(hb.empty())Q.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=La(a);ua();Lb();m.domain(c.extent([xa,
{data:{}},eb={},Z="_expanded_",ja="_selected_",Kb="_included_",wa=e(["bindto"],"#chart"),Ya=e(["size","width"],null),Yb=e(["size","height"],null),Ub=e(["padding","left"],null),Sb=e(["padding","right"],null),ra=e(["zoom","enabled"],!1),Lc=e(["zoom","extent"],null),Cd=e(["zoom","privileged"],!1),vd=e(["onenter"],function(){}),wd=e(["onleave"],function(){});if(!("data"in$))throwError("data is required in config");varqa=e(["data","x"],null),X=e(["data","xs"],null),xb=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&&C()};h.selected=function(a){a=n(a)?"-"+a:"";returnc.merge(k.selectAll(".-shapes"+a).selectAll(".-shape").filter(function(){returnc.select(this).classed(ja)}).map(function(a){returna.map(function(a){returna.__data__})}))};
c.keys(a[0]).filter(gd),d=c.keys(a[0]).filter(ec);if(C&&0===d.length)returnQ.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"'),[];tb&&b.forEach(function(b){varc=ra?ra:Y?Y[b]:null;0<=d.indexOf(c)&&(h.data.x[b]=a.map(function(a){returna[c]}))});b=b.map(function(b){vard=hd(b);return{id:d,id_org:b,values:a.map(function(a,c){vare;e=ra?ra:Y?Y[b]:null;e=C?qa(a[e]):tb?a[e]?a[e]:h.data.x[b][c]:c;if(e<pa||null===pa)pa=e;ya<e&&(ya=e);a.x=e;return{x:e,value:null===a[b]||isNaN(a[b])?
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}functionvc(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[0],2)+Math.pow(f-d[1],2))<b}functionwc(a){varb=c.mouse(a),d=c.select(a);a=1*d.attr("x");varf=1*d.attr("y"),d=1*d.attr("width");returna-10<b[0]&&
r)h+=f(a[c-1],a[c],e,l)}returnh}functionDb(a){varb,d;hb=c.select(xa);if(hb.empty())Q.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=La(a);va();Mb();m.domain(c.extent(Va()));u.domain(la("y"));V.domain(la("y2"));fa.domain(m.domain());Za.domain(u.domain());$a.domain(V.domain());B.ticks(10>a.length?a.length:10);oa.ticks(sd).outerTickSize(0).tickFormat(td);ab.ticks(ud).outerTickSize(0).tickFormat(vd);
"right"],null),sa=e(["zoom","enabled"],!1),Nc=e(["zoom","extent"],null),Dd=e(["zoom","privileged"],!1),wd=e(["onenter"],function(){}),xd=e(["onleave"],function(){});if(!("data"inba))throwError("data is required in config");varra=e(["data","x"],null),Y=e(["data","xs"],null),yb=e(["data","x_format"],"%Y-%m-%d"),hd=e(["data","id_converter"],function(a){returna}),Ka=e(["data","names"],{}),t=e(["data","groups"],[]),ac=e(["data","axes"],{}),Z=e(["data","types"],{}),Oc=e(["data","regions"],{}),Md=e(["data",
if("cacheIds"ina&&Wa(a.cacheIds))Sa(mb(a.cacheIds),a.done);elseif("data"ina)Sa(La(a.data),a.done);elseif("url"ina)c.csv(a.url,function(b,c){Sa(La(c),a.done)});elseif("rows"ina)Sa(La(fc(a.rows)),a.done);elseif("columns"ina)Sa(La(gc(a.columns)),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();Ba&&(c.selectAll(".legend-item-"+
void0};h.data.getAsTarget=function(a){varb=cb(function(b){returnb.id===a});return0<b.length?b[0]:void0};h.destroy=function(){h.data.targets=void0;h.data.x={};hb.html("");Q.onresize=null};if("url"inba.data)c.csv(ba.data.url,function(a,b){Db(b)});elseif("rows"inba.data)Db(fc(ba.data.rows));elseif("columns"inba.data)Db(gc(ba.data.columns));elsethrowError("url or rows or columns is required.");returnh}})(window);