Line, Polygon, and Polyline API

jsav.g.line(x1, y1, x2, y2[, properties])

Initializes a line from point x1, y1 to x2, y2. Optional parameter properties,if given, should be an object with key-value pairs. See raphael.attr for valid keys and values.

jsav.g.polyline(points[, properties]) and jsav.polygon(points[, properties])

Initializes a polyline or polygon. Parameter points should be an array of arrays with x and y coordinates. For example:

var polyline = av.g.polyline([[0, 0], [20, 20], [200, 200]],
{"stroke-width": 7, "stroke":"#ddd"});

Optional parameter properties, if given, should be an object with key-value pairs. See raphael.attr for valid keys and values.

.translatePoint(point, dx, dy)

Translates the given point in the (poly)line by the given amount of pixels. The point is a zero-indexed list of points used to initialize the polyline. For line, start point is index 0 and endpoint index 1.

.movePoints(points)

Moves the given points to the given pixel positions. Parameter points should be an array of arrays with each item specifying point, px, and py.