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_;
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);
}
continue;
}
- // TODO(danvk): here
if (stepPlot) {
newYs = [ point.y_bottom, point.y_top ];
prevY = point.y;