X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Frange-selector.js;h=717f85059442578e9e37a9aafc8cb351bc688938;hb=ec8cc8b206a5ec69ec5c9ca786d2b127e6c00c72;hp=88425461a59a41fc6ade35b2631bd37cc3b71d1c;hpb=85adc3fe50381b61dc4afa1f96fb62e835a77f18;p=dygraphs.git diff --git a/plugins/range-selector.js b/plugins/range-selector.js index 8842546..717f850 100644 --- a/plugins/range-selector.js +++ b/plugins/range-selector.js @@ -594,6 +594,13 @@ rangeSelector.prototype.drawMiniPlot_ = function() { var dataPoint = combinedSeriesData.data[i]; var x = ((dataPoint[0] !== null) ? ((dataPoint[0] - xExtremes[0])*xFact) : NaN); var y = ((dataPoint[1] !== null) ? (canvasHeight - (dataPoint[1] - combinedSeriesData.yMin)*yFact) : NaN); + + // Skip points that don't change the x-value. Overly fine-grained points + // can cause major slowdowns with the ctx.fill() call below. + if (!stepPlot && prevX !== null && Math.round(x) == Math.round(prevX)) { + continue; + } + if (isFinite(x) && isFinite(y)) { if(prevX === null) { ctx.lineTo(x, canvasHeight);