Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export an SVG from DOM to file

I'm using d3.js to create a chart which I want to some how export in vector format to edit in illustrator. Is this possible? This is a snippet of the code that's generated:

enter image description here

like image 796
mheavers Avatar asked Jan 23 '12 15:01

mheavers


1 Answers

There are more complicated methods involving node.js and server-side rendering but a quick, easy way is to just copy the svg element from the DOM, paste it into a file and save it with the extension .svg

After that you can open it in a vector editor.

like image 51
Tyson Anderson Avatar answered Sep 19 '22 10:09

Tyson Anderson