Skip to content

Instantly share code, notes, and snippets.

Created October 3, 2014 15:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save carlosperez/99304b4a5f2fc647a51f to your computer and use it in GitHub Desktop.
Force d3 to output the xlink namespace on anchor tags'#points')
.attr('xlink:xlink:href', '#') // add the namespace TWICE
// and so on and so forth
Copy link

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