I am using a force based layout using D3 and was wondering if it\'s possible that when I click either the nodes or the labels, I am automatically taken to the url stored in
Generally speaking, you can add click events to SVG elements in D3.js using
.on('click', function(d, i) {
window.location.href = d.url;
})
d
is the data object and the i
is in the index of d within the collection.
Just add that click handler to your text node as well as your node (path) node like in this fiddle http://jsfiddle.net/jNyrf/