Spline drawing tool using JS