RaphaelJS - Get all elements
javascript, raphael
Solution
I guess it depends what you mean when you say "keeping track."
You're able to loop all elements on a given paper using `Paper.forEach` and you're able to pull out specific elements using `Paper.getById`.
If you're drawing elements with `Paper.path` , set an ID that you can store in a separate data structure using the method described in this SO thread.
Problem
I am starting a painting application with RaphaelJS. What's the best way of keeping track of all the elements that have been drawn on a paper (with a mouse)? The first way I thought of was to append all drawn elements into an array, but this might not be as efficient if there was a 'out of the box' solution that RaphaelJS had. I checked the API but didn't find anything like what I was looking for... am I out of luck?