X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-layout.js;h=4beddc489fba1be624a744cfda69236d1c216a37;hb=5f453f17a4e6cd8a588018ce54d9cbab45e0ffac;hp=4f8656e8b5801f1bdda09622a9993e006caf4a23;hpb=80e653aa7a48cd48dbcaf24dff5d5b99417d91e7;p=dygraphs.git diff --git a/dygraph-layout.js b/dygraph-layout.js index 4f8656e..4beddc4 100644 --- a/dygraph-layout.js +++ b/dygraph-layout.js @@ -129,6 +129,11 @@ DygraphLayout.prototype._evaluateLimits = function() { DygraphLayout.prototype._evaluateLineCharts = function() { // add all the rects this.points = new Array(); + // An array to keep track of how many points will be drawn for each set. + // This will allow for the canvas renderer to not have to check every point + // for every data set since the points are added in order of the sets in datasets + this.setPointsLengths = new Array(); + for (var setName in this.datasets) { if (!this.datasets.hasOwnProperty(setName)) continue; @@ -141,9 +146,12 @@ DygraphLayout.prototype._evaluateLineCharts = function() { var prevYPx = NaN; var currXPx = NaN; var currYPx = NaN; + var setPointsLength = 0; // Ignore the pixel skipping optimization if there are error bars. - var skip_opt = (this.attr_("errorBars") || + // XXX 2011-07-25 temporarily disabled (see autotests/tests/selection.js) + var skip_opt = (true || + this.attr_("errorBars") || this.attr_("customBars") || this.annotations.length > 0); @@ -178,10 +186,12 @@ DygraphLayout.prototype._evaluateLineCharts = function() { name: setName }; this.points.push(point); + setPointsLength += 1; } prevXPx = currXPx; prevYPx = currYPx; } + this.setPointsLengths.push(setPointsLength); } };