Instead of generic SVG shapes, I want to bind external SVG icons to my data with D3. I can do that like this
group = svg.selectAll("g")
.data(dataset)
.enter()
.append("g");
group.append("svg:image")
.attr("xlink:href",path)
.attr(...)
etc but I run into several scaling issues. This fiddle embeds an exemplary icon. Running it in three different browsers, I get three different renderings. Chrome does it best:
Edge:
Firefox:
I've added a viewPort
attribute, which appears in various guides on how to scale SVGs, but it doesn't seem to do anything no matter the coordinates I set it to. How can I make the scaling behave like in Chrome in all browsers?