Raphael JS - Parsing an SVG on the fly
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-05-17T22:36:24Z
Indexed on
2010/05/17
22:40 UTC
Read the original article
Hit count: 987
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?
© Stack Overflow or respective owner