http://www.w3.org/TR/SVG/struct.html#ImageElement
For example:
d3.selectAll("#infoBox").append("svg:image")
.attr("xlink:href", "http://www.e-pint.com/epint.jpg")
.attr("width", 150)
.attr("height", 200);
D3 knows about various namespaces already (see d3.ns), so you just
have to specify the prefix.
Mike
Hey, that's a neat trick. Here's an example you can paste into your console:
var html = d3.select("svg")
.attr("version", 1.1)
.attr("xmlns", "http://www.w3.org/2000/svg")
.node().parentNode.innerHTML;
d3.select("body").append("a")
.attr("title", "file.svg")
.attr("href-lang", "image/svg+xml")
.attr("href", "data:image/svg+xml;base64,\n" + btoa(html))
.text("Download");
The `btoa` method is a built-in Base64 encoding. You can use another
library to do Base64 if you prefer.
Mike