Demo of Raphael JS grouping plugin


var myRectangles = [obj1,obj2...etc];// the array of elements which will form the group
var myGroup =,myRectangles);// '0' is the number of the 'svg' tag in the page
myGroup.translate(250,55);// translate the group to 250,55;
myGroup.rotate(45,20,48);// rotates the group
myGroup.scale(.5,.5);// scales the group
myGroup.copy(circle);// copies a Raphael JS element
myGroup.push(newRect);// adds a new object to the group at a later time
var someAttribute = myGroup.getAttr('translate'); // returns object (axis as x,y,z)