d3.js graphs output into high resolution print quality files?

There are more complicated methods but a quick, easy way is to just copy the svg element from the DOM (you may need to include your css files as well), paste it into a file and save it with the extension .svg. After that you can open it in a vector editor.

There are also ways to convert the d3.js output to a png file as well. Somebody put together a jsfiddle of doing this with canvg at http://jsfiddle.net/plaliberte/HAXyd/.

Leave a Comment