Drawing A Curve Using Raphael Javascript Library?
I'm drawing a curve from point A to point B. I know coordinates of points. How can I draw this curve. I have used example from Raphael site http://raphaeljs.com/curver.html, but I
Solution 1:
Raphael is not computing a function for the curve, it directly uses SVG paths. Full spec is here http://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands .
In the example the path is defined here;
path2 = [["M", x, y], ["L", ax, ay], ["M", bx, by], ["L", zx, zy]];
Each sub-array represents a pen operation; moveto, closepath, lineto .
Solution 2:
You will want to use the Path method in Raphael (qv) with SVG path notation. The type of path to use would be one of cubic/quadratic bezier curve or elliptical arc depending on what kind of curve you want.
Post a Comment for "Drawing A Curve Using Raphael Javascript Library?"