Since HTML5 canvas has support for drawing Bezier splines, another approach to drawing smooth lines through points is to use a Catmull-Rom spline. This gives the benefit of using the browser's native curve drawing routines. This might lead to better performance, or smoother looking curves, though it appears that this implementation's adaptive segmentation looks pretty good.