Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Force d3 to output the xlink namespace on anchor tags
vis.select('#points')
.selectAll('.point')
.enter()
.append('svg:a')
.attr('xlink:xlink:href', '#') // add the namespace TWICE
.append('svg:circle')
// and so on and so forth
@carlosperez

This comment has been minimized.

Show comment Hide comment
@carlosperez

carlosperez Oct 3, 2014

We wracked our brains too much on this one... D3 seemed to be removing the xlink namespace from our SVG anchor tags. As a result, the links wouldn't work. At first we assumed Chrome was removing the namespace, but realized it wasn't even present in the source (not just not showing in the Web Inspector).

So yah. It's 2014 and we are super happy that we got links to work on a web site.

Owner

carlosperez commented Oct 3, 2014

We wracked our brains too much on this one... D3 seemed to be removing the xlink namespace from our SVG anchor tags. As a result, the links wouldn't work. At first we assumed Chrome was removing the namespace, but realized it wasn't even present in the source (not just not showing in the Web Inspector).

So yah. It's 2014 and we are super happy that we got links to work on a web site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment