Created
October 3, 2014 15:45
-
-
Save carlosperez/99304b4a5f2fc647a51f to your computer and use it in GitHub Desktop.
Force d3 to output the xlink namespace on anchor tags
This file contains 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.