crccheck / raphael-svg-import-classic

Import SVG files to Raphael
MIT License
98 stars 40 forks source link

Loss of document structure. Groups (<g>) are lost. #13

Open Grsmto opened 11 years ago

Grsmto commented 11 years ago

Groups are well parsed and displayed but they should be translated in RaphaelJS sets. We should have a main set for our shape, then, child set for every groups. here is the original SVG file : capture decran 2013-09-04 a 14 19 43

Here is the output : capture decran 2013-09-04 a 14 21 33

And we should have something like this : capture decran 2013-09-04 a 14 23 12

What do you think?

crccheck commented 11 years ago

I couldn't think of a way to reference groups -> raphael sets without polluting global state. That's my main blocker on that. I definitely thought about doing it many times. I've been able to get by with having ids on my original SVG groups and getting the data-attr/ids off the output. I don't think raphaeljs is capable of making group elements.