Created
June 19, 2013 09:10
-
-
Save norrs/5812879 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var XMLS = new XMLSerializer(); | |
var html = d3.select("svg") | |
.attr("title", "sdfsdfsdf") | |
.attr("version", 1.1) | |
.attr("xmlns", "http://www.w3.org/2000/svg") | |
.node(); | |
html.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink" ) | |
d3.select("body").append("div") | |
.attr("id", "download") | |
.html("Right-click on this preview and choose Save as<br />Left-Click to dismiss<br />") | |
.append("img") | |
.attr("src", "data:image/svg+xml;base64,"+ btoa(XMLS.serializeToString(html))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment