Converts or downloads an SVG element as a PNG. I use this to save charts which have been generated with Vega and had their DOM messed with, which prevents the default exporter from working.
Simply provide an SVG element and a filename
SVGtoPNG.downloadPNG(document.querySelector("#headc svg"), "chart.png");
SVGtoPNG.toPNGString(document.querySelector("#headc svg"), function(data) { console.log(data); });