Line

returns SVG.Line which inherits from SVG.Shape

Create a line from point A to point B:

var line = draw.line(0, 0, 100, 150).stroke({ width: 1 })

Creating a line element can be done in four ways. Look at the plot() method to see all the possibilities.

array()

returns SVG.PointArray

References the SVG.PointArray instance. This method is rather intended for internal use:

polyline.array()

plot()

returns itself
animate yes

Updating a line is done with the plot() method:

line.plot(50, 30, 100, 150)

Alternatively it also accepts a point string:

line.plot('0,0 100,150')

Or a point array:

line.plot([[0, 0], [100, 150]])

Or an instance of SVG.PointArray:

var array = new SVG.PointArray([[0, 0], [100, 150]])
line.plot(array)

The plot() method can also be animated:

line.animate(3000).plot([[200, 200], [100, 150]])
Fork me on GitHub