X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Frange-selector.js;fp=plugins%2Frange-selector.js;h=8e74ad90b5789d72599043db6a2bd975a50aa45d;hb=e146f6144b47eab0b66f8fd9cb8d84c4615098e6;hp=3a70e7d9ce5fcb5c7f437aa9c39107667411f3cf;hpb=0a0885d1383321a67155fcf1cb12c583cdd89ef2;p=dygraphs.git diff --git a/plugins/range-selector.js b/plugins/range-selector.js index 3a70e7d..8e74ad9 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);