From: Dan Vanderkam Date: Wed, 18 Jul 2012 16:53:13 +0000 (-0500) Subject: cleanup X-Git-Tag: v1.0.0~222 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=239454e203eca702799cbc2cb7891601e2a5c4ee;p=dygraphs.git cleanup --- diff --git a/dygraph-canvas.js b/dygraph-canvas.js index a8b9807..fd74d5b 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -306,6 +306,7 @@ DygraphCanvasRenderer.prototype._drawSeries = function( ctx.strokeStyle = color; ctx.lineWidth = strokeWidth; + // NOTE: we break the iterator's encapsulation here for about a 25% speedup. var arr = iter.array_; var limit = iter.end_; var predicate = iter.predicate_; @@ -354,6 +355,8 @@ DygraphCanvasRenderer.prototype._drawSeries = function( ctx.lineTo(point.canvasx, prevCanvasY); prevCanvasX = point.canvasx; } + + // TODO(danvk): this moveTo is rarely necessary ctx.moveTo(prevCanvasX, prevCanvasY); ctx.lineTo(point.canvasx, point.canvasy); } @@ -495,7 +498,6 @@ DygraphCanvasRenderer.prototype.drawErrorBars_ = function(points) { continue; } - // TODO(danvk): here if (stepPlot) { newYs = [ point.y_bottom, point.y_top ]; prevY = point.y;