I have the same problem without using d3. I use only pure SVG and add it to the DOM with angularJS controller. The problem is not d3. You can fix this problem by adding the return value false to the jQuery event handler for elements containing the link.
Part of my SVG:
<g id="1" class="node"> <a xlink:title="title"> <polygon fill="#cccccc" stroke="#cccccc" points="25,-434 25,-457 98,-457 98,-434 25,-434"></polygon> <polygon fill="none" stroke="black" points="25,-434 25,-457 98,-457 98,-434 25,-434"></polygon> <text text-anchor="start" x="29.5" y="-442.3" font-family="Arial" font-size="14.00">title</text> <polygon fill="transparent" stroke="black" points="25,-412 25,-434 98,-434 98,-412 25,-412"></polygon> <text text-anchor="start" x="37" y="-419.8" font-family="Arial" font-size="14.00">title</text> </a> </g>
JQuery overload method:
$('g.node').click(function (element) { return false; });
Hope this helps ...
source share