matplotlib SVG compatibility

104 views
Skip to first unread message

Pat LeSmithe

unread,
Oct 3, 2009, 4:00:26 AM10/3/09
to svg-...@googlegroups.com

Hello,

Could an expert please look at the attached figure, output by
matplotlib's SVG backend, to determine what it would take to import
similar markup into SVG-edit? For example, is it a matter of tweaking
matplotlib?

Thanks!

- Pat LeSmithe

foo.svg

Jeff Schiller

unread,
Oct 5, 2009, 2:00:00 PM10/5/09
to svg-...@googlegroups.com
Hello Pat,

SVG-edit still does not handle many things in SVG (in particular,
things like the 'style' attribute, clip paths). So what I did was run
foo.svg through scour (http://codedread.com/scour/ or
http://www.planetsvg.com/scour ) and the scoured SVG seems to display
much better in SVG-edit.

See attached.

We do need to eventually support these things in SVG-edit so if you
can help out there, that would be great.

Jeff
foo.scour.svg

Jeff Schiller

unread,
Oct 5, 2009, 2:09:25 PM10/5/09
to svg-...@googlegroups.com
Another big thing we're missing is support for the <use/> element in
SVG-edit. Looking further at your source it has a lot of <use>s so
none of those show up in SVG-edit at the moment.

The issue with supporting elements and attributes in SVG-edit means
that we have to be very careful about security considerations. For
instance, <use> elements can refer to other files - we don't want to
allow that in SVG-edit because it might bring in elements from other
files (though I think there are cross-domain restrictions on <use>'s
xlink:href, I'm not entirely sure.

Furthermore, <use> elements could be resized, etc - not sure how this
might be impacted on the UI (can <use> be selected, moved, resized,
deleted, etc? I think the answer is 'yes' to all of those, but each
time we add support for something in SVG-edit we need to carefully
think about it.

(As an anecdotal story, I just recently found out that when I added
support in SVG-edit for the <title> element that a user could cause
invalid XML or inject <script> inside. I hope I fixed this last
night)

Regards,
Jeff
Reply all
Reply to author
Forward
0 new messages