I’m totally new to coding, I’m trying to add a redirect to a url when a node is clicked, after a couple of days of search here’s what I’ve done
var svg = d3.select("body")
.style("width", w + "px")
.style("height", h + "px")
.append("svg:svg")
//.attr("width", w)
//.attr("height", h)
.append("svg:g")
.attr("transform", "translate(.5,.5)")
.on("click",function(){ window.open("new.html");});
I’m working on https://gist.github.com/1446865
But it’s not working can you help out ?
a small modification I have added the .on(“click” on the SVG variable now it’s working, now I need the URL to be the d.key but can’t get it to work !
Finally got it to work, I was adding the .on click on the SVG element when I had to add it to the .cell(“rect”)
here’s the code
https://gist.github.com/4589729