more info here: http://www.w3.org/TR/SVG/linking.html#Links
In tag form, it's <a href="link.html"><rect/></a>.
In JavaScript, it's append("a").attr("xlink:href", "link.html").append("rect").
Mike
--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/3g-NfeUbSLQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Great! I'm glad that you worked it out.
It's cool to see your code example of how you would get the ctrl and metaKey if you had to, I didn't know about d3.event.ctrlKey and d3.event.metaKey, thank you for that.
On Wednesday, May 20, 2015 at 12:27:26 PM UTC-7, Roydon D'Souza wrote:
Hi CurranThank you very much. I didn't realise making it a link itself would achieve the functionality I was looking for.I went ahead and used d3.event.metaKey and ctrlKey (for windows) to detect if the CMD key was down when someone clicked on a rectangle..on("click", function(d) {//on ^ + click / ⌘ + clickif (d3.event.ctrlKey || d3.event.metaKey) {//on supported key combination and click open in new tab//since i use angularJS$window.open('/campaigns/' + d.id);}});After reading your email,I went a head and wrapped around the rectangle with anchor tag. Does the job for me. Thank you very much.
Regards,
Roydon D' Souza