From 239454e203eca702799cbc2cb7891601e2a5c4ee Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 18 Jul 2012 11:53:13 -0500 Subject: [PATCH] cleanup --- dygraph-canvas.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.7.4