Raphael JS - Parsing an SVG on the fly
- by Chris
I found a neat SVG parser at http://bkp.ee/atirip/ which parses an SVG file and outputs it into javascript that uses the Raphael JS library (raphaeljs.com). You'll notice in the source code at http://bkp.ee/atirip/svg2rdemo.php :
<script>
jQuery(document).ready( function() {
$("#c1").each(function(){
var c = Raphael(this, 190, 154, 0, 0);
var g1 = c.set();
...
it creates variables like g1, g2, etc. But it also reuses these variables. I would like to create unique variables for each group. In my .ai file, I have named my groups and I would like to use these names to create the variable names.
Where in http://bkp.ee/atirip/f/svgToRaphaelParser.php.zip should I look to make this change?