Export SVG code

24 views
Skip to first unread message

Robert Kosara

unread,
Feb 24, 2010, 6:08:35 PM2/24/10
to prot...@googlegroups.com
Is it possible to get the SVG protovis creates out of the canvas element and into a file? It's not a problem if this requires some code, it's for my own use.

Mike Bostock

unread,
Feb 24, 2010, 6:22:22 PM2/24/10
to prot...@googlegroups.com
> Is it possible to get the SVG protovis creates out of the canvas element and
> into a file?

There are a couple of tricks here:

http://groups.google.com/group/protovis/browse_thread/thread/3169031c3b2aae52/f976d5fb9c893846

Mike

Jamie Love

unread,
Feb 24, 2010, 6:22:32 PM2/24/10
to prot...@googlegroups.com
Yup, two methods have been mentioned recently:

1/ A bit of PHP code and an ajax request - http://groups.google.com/group/protovis/browse_thread/thread/81efbb03ee7fd17e/a5793e4a07d9445a?lnk=gst&q=php#a5793e4a07d9445a
2/ Use Rhino server side. The archives have a demo/test by me that writes out a protovis generated SVG file to disk - zip of code that shows this is here: http://groups.google.com/group/protovis/attach/8a70b0e274255b36/rhinotest.zip?part=4

or if you're wanting to do it manually, you can just view the generated SVG XML using FireFox and copy/paste.


On Thu, Feb 25, 2010 at 12:08 PM, Robert Kosara <rko...@gmail.com> wrote:
Is it possible to get the SVG protovis creates out of the canvas element and into a file? It's not a problem if this requires some code, it's for my own use.

--
You received this message because you are subscribed to the Google Groups "protovis" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

Robert Kosara

unread,
Feb 25, 2010, 12:37:00 AM2/25/10
to prot...@googlegroups.com
Thanks, Mike and Jamie. That's exactly what I was looking for.

Reply all
Reply to author
Forward
0 new messages