Is there a way to group elements in Raphaël on something like a layer in illustrator? So I can rotate translate delete the whole group.
Maybe what you are after is Paper.set()
See: http://dmitrybaranovskiy.github.io/raphael/reference.html#Paper.set
It allows you to group several elements together so you can manipulate them all at once.
In case you need to have a real element, here is a small plugin. It's kind of old but a beginning:
https://github.com/meszaros-lajos-gyorgy/Raphael-Plugins/blob/master/dev/raphael.group.js
And here is another website which created a small plugin:
http://2hats.net/_box/raphael/grouping.html
The reason why an extra plugin is needed is because Raphaels set() function does not create a real DOM element!
Creates array-like object to keep and operate several elements at once. Warning: it doesn’t create any elements for itself in the page, it just groups existing elements. Sets act as pseudo elements — all methods available to an element can be used on a set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With