DygraphLayout=function(b,a){this.dygraph_=b;this.options={};Dygraph.update(this.options,a?a:{});this.datasets=newArray();this.annotations=newArray()};DygraphLayout.prototype.attr_=function(a){returnthis.dygraph_.attr_(a)};DygraphLayout.prototype.addDataset=function(a,b){this.datasets[a]=b};DygraphLayout.prototype.setAnnotations=function(d){this.annotations=[];vare=this.attr_("xValueParser")||function(a){returna};for(varc=0;c<d.length;c++){varb={};if(!d[c].xval&&!d[c].x){this.dygraph_.error("Annotations must have an 'x' property");return}if(d[c].icon&&!(d[c].hasOwnProperty("width")&&d[c].hasOwnProperty("height"))){this.dygraph_.error("Must set width and height when setting annotation.icon property");return}Dygraph.update(b,d[c]);if(!b.xval){b.xval=e(b.x)}this.annotations.push(b)}};DygraphLayout.prototype.evaluate=function(){this._evaluateLimits();this._evaluateLineCharts();this._evaluateLineTicks();this._evaluateAnnotations()};DygraphLayout.prototype._evaluateLimits=function(){this.minxval=this.maxxval=null;if(this.options.dateWindow){this.minxval=this.options.dateWindow[0];this.maxxval=this.options.dateWindow[1]}else{for(varcinthis.datasets){if(!this.datasets.hasOwnProperty(c)){continue}vare=this.datasets[c];if(e.length>1){varb=e[0][0];if(!this.minxval||b<this.minxval){this.minxval=b}vara=e[e.length-1][0];if(!this.maxxval||a>this.maxxval){this.maxxval=a}}}}this.xrange=this.maxxval-this.minxval;this.xscale=(this.xrange!=0?1/this.xrange:1);for(vard=0;d<this.options.yAxes.length;d++){varf=this.options.yAxes[d];f.minyval=f.computedValueRange[0];f.maxyval=f.computedValueRange[1];f.yrange=f.maxyval-f.minyval;f.yscale=(f.yrange!=0?1/f.yrange:1);if(f.g.attr_("logscale")){f.ylogrange=Dygraph.log10(f.maxyval)-Dygraph.log10(f.minyval);f.ylogscale=(f.ylogrange!=0?1/f.ylogrange:1);if(!isFinite(f.ylogrange)||isNaN(f.ylogrange)){f.g.error("axis "+d+" of graph at "+f.g+" can't be displayed in log scale for range ["+f.minyval+" - "+f.maxyval+"]")}}}};DygraphLayout.prototype._evaluateLineCharts=function(){this.points=newArray();for(varfinthis.datasets){if(!this.datasets.hasOwnProperty(f)){continue}vare=this.datasets[f];varc=this.options.yAxes[this.options.seriesToAxisMap[f]];for(varb=0;b<e.length;b++){vard=e[b];varg;if(c.logscale){g=1-((Dygraph.log10(parseFloat(d[1]))-Dygraph.log10(c.minyval))*c.ylogscale)}else{g=1-((parseFloat(d[1])-c.minyval)*c.yscale)}vara={x:((parseFloat(d[0])-this.minxval)*this.xscale),y:g,xval:parseFloat(d[0]),yval:parseFloat(d[1]),name:f};this.points.push(a)}}};DygraphLayout.prototype._evaluateLineTicks=function(){this.xticks=newArray();for(vard=0;d<this.options.xTicks.length;d++){varc=this.options.xTicks[d];varb=c.label;varf=this.xscale*(c.v-this.minxval);if((f>=0)&&(f<=1)){this.xticks.push([f,b])}}this.yticks=newArray();for(vard=0;d<this.options.yAxes.length;d++){vare=this.options.yAxes[d];for(vara=0;a<e.ticks.length;a++){varc=e.ticks[a];varb=c.label;varf=this.dygraph_.toPercentYCoord(c.v,d);if((f>=0)&&(f<=1)){this.yticks.push([d,f,b])}}}};DygraphLayout.prototype.evaluateWithError=function(){this.evaluate();if(!this.options.errorBars){return}vard=0;for(varginthis.datasets){if(!this.datasets.hasOwnProperty(g)){continue}varc=0;varf=this.datasets[g];for(varc=0;c<f.length;c++,d++){vare=f[c];vara=parseFloat(e[0]);varb=parseFloat(e[1]);if(a==this.points[d].xval&&b==this.points[d].yval){this.points[d].errorMinus=parseFloat(e[2]);this.points[d].errorPlus=parseFloat(e[3])}}}};DygraphLayout.prototype._evaluateAnnotations=function(){varf={};for(vard=0;d<this.annotations.length;d++){varb=this.annotations[d];f[b.xval+","+b.series]=b}this.annotated_points=[];for(vard=0;d<this.points.length;d++){vare=this.points[d];varc=e.xval+","+e.name;if(cinf){e.annotation=f[c];this.annotated_points.push(e)}}};DygraphLayout.prototype.removeAllDatasets=function(){deletethis.datasets;this.datasets=newArray()};DygraphLayout.prototype.updateOptions=function(a){Dygraph.update(this.options,a?a:{})};DygraphLayout.prototype.unstackPointAtIndex=function(b){vara=this.points[b];vard={};for(var