if(!date){throwError(date+" can not be parsed as d3.time with format "+__data_x_format+". Maybe 'x' of this data is not defined. See data.x or data.xs option.");}
a.end):p)-b;return0>a?0:a}functionnb(a){varb=Ia[a.id];a.name=n(b)?b:a.id;returna}functionWb(a){varb=a[0],d={},k=[],e,c;for(e=1;e<a.length;e++){d={};for(c=0;c<a[e].length;c++)d[b[c]]=a[e][c];k.push(d)}returnk}functionXb(a){varb=[],d,k,e;for(d=0;d<a.length;d++)for(e=a[d][0],k=1;k<a[d].length;k++)r(b[k-1])&&(b[k-1]={}),b[k-1][e]=a[d][k];returnb}functionJa(a){varb=e.keys(a[0]).filter(function(a){returna!==V}),d,k;if(z&&!V)returnO.alert('data.x must be specified when axis.x.type == "timeseries"'),
[];ob&&r(g.data.x)&&(g.data.x=a.map(function(a){returna[V]}));d=0;a.forEach(function(a){if(z){if(!(Vina))throwError("'"+V+"' must be included in data");k=oa(a[V]);if(null===k)throwError("Failed to parse timeseries date in data");a.x=k}elsea.x=ob?n(a[V])?a[V]:g.data.x[d]:d;null===bb&&(bb=newDate(a.x));pb=newDate(a.x);d++});b=b.map(function(b){vard=Oc(b);return{id:d,id_org:b,values:a.map(function(a){return{x:a.x,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}})}});b.forEach(function(a){ab[a.id_org]=
0===d.length)returnQ.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"'),[];sb&&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=cd(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]):sb?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){db[a.id_org]=
ha["string"===typeofa?a:a.id]}functionhd(a){returnxb(a)?a.values:[]}functionpc(a){returnHa(a)?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}functionqc(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-
functionwb(a){varb,d;db=e.select(ua);if(db.empty())O.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{db.html("");g.data.x=void0;g.data.targets=Ja(a);sa();Eb();l.domain(e.extent(a.map(function(a){returna.x})));y.domain(ka("y"));T.domain(ka("y2"));ba.domain(l.domain());Wa.domain(y.domain());Xa.domain(T.domain());B.ticks(10>a.length?a.length:10);na.ticks(Zc).outerTickSize(0).tickFormat($c);Ya.ticks(ad).outerTickSize(0).tickFormat(bd);
function(a,c,f,e){return"M"+b(k(f))+" "+d(m(f))+" "+b(k(f+e))+" "+d(m(f+e))};for(c=0;c<a.length;c++)if(s(p)||!id(a[c].x,p))h+=" "+yc(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}functionAb(a){varb,d;gb=c.select(wa);if(gb.empty())Q.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');
{data:{}},ab={},ha="_expanded_",ia="_selected_",Db="_included_",ua=c(["bindto"],"#chart"),Ua=c(["size","width"],null),Rb=c(["size","height"],null),Nb=c(["padding","left"],null),Lb=c(["padding","right"],null),pa=c(["zoom","enabled"],!1),uc=c(["zoom","extent"],null),id=c(["zoom","privileged"],!1),cd=c(["onenter"],function(){}),dd=c(["onleave"],function(){});if(!("data"inY))throwError("data is required in config");varV=c(["data","x"],void0),qd=c(["data","x_format"],"%Y-%m-%d"),Oc=c(["data","id_converter"],
"right"],null),ra=e(["zoom","enabled"],!1),Hc=e(["zoom","extent"],null),yd=e(["zoom","privileged"],!1),rd=e(["onenter"],function(){}),sd=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"),cd=e(["data","id_converter"],function(a){returna}),Ka=e(["data","names"],{}),t=e(["data","groups"],[]),Zb=e(["data","axes"],{}),ha=e(["data","types"],{}),Ic=e(["data","regions"],{}),Hd=e(["data",
0)};g.unzoom=function(){G.clear().update();C({withUpdateXDomain:!0})};g.load=function(a){r(a.done)&&(a.done=function(){});"categories"ina&&ca&&(Ea=a.categories,B.categories(Ea));if("cacheIds"ina&&Sa(a.cacheIds))Pa(Ta(a.cacheIds),a.done);elseif("data"ina)Pa(Ja(a.data),a.done);elseif("url"ina)e.csv(a.url,function(b,d){Pa(Ja(d),a.done)});elseif("rows"ina)Pa(Ja(Wb(a.rows)),a.done);elseif("columns"ina)Pa(Ja(Xb(a.columns)),a.done);elsethrowError("url or rows or columns is required.");};g.unload=
g.data.get=function(a){a=g.data.getAsTarget(a);returnn(a)?a.values.map(function(a){returna.value}):void0};g.data.getAsTarget=function(a){varb=$a(function(b){returnb.id===a});return0<b.length?b[0]:void0};g.destroy=function(){g.data.targets=void0;g.data.x=void0;db.html("");O.onresize=null};if("url"inY.data)e.csv(Y.data.url,function(a,b){wb(b)});elseif("rows"inY.data)wb(Wb(Y.data.rows));elseif("columns"inY.data)wb(Xb(Y.data.columns));elsethrowError("url or rows or columns is required.");
if("cacheIds"ina&&Va(a.cacheIds))Sa(Wa(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(bc(a.rows)),a.done);elseif("columns"ina)Sa(La(cc(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();Aa&&(c.selectAll(".legend-item-"+
cb(function(b){returnb.id===a});return0<b.length?b[0]:void0};h.destroy=function(){h.data.targets=void0;h.data.x={};gb.html("");Q.onresize=null};if("url"in$.data)c.csv($.data.url,function(a,b){Ab(b)});elseif("rows"in$.data)Ab(bc($.data.rows));elseif("columns"in$.data)Ab(cc($.data.columns));elsethrowError("url or rows or columns is required.");returnh}})(window);