title: dagre-d3 how to click node and run an event after that
body: <p>I am using dagre-d3.js to create hierarchical graph. Now I have a requirement to make the node clickable and perform a function. I am unable to achieve that.</p>
  
  <p>current some of my code looks like</p>
  
  <pre><code>var g = new dagreD3.graphlib.Graph().setGraph({});
  g.setNode("TEST", { label: "TEST"})
  g.setNode("TEST1", { label: "TEST1"})
  
  g.setEdge("TEST", "TEST1", { label: "open", style: "stroke: green; stroke-width: 2px;fill: none", arrowheadStyle: "fill: green" });
  
  var svg = d3.select("svg"),
  inner = svg.select("g");
  
  var render = new dagreD3.render();
  render(inner, g);
  var initialScale = 0.75;
  zoom
  .translate([(svg.attr("width") - g.graph().width * initialScale) / 2, 20])
  .scale(initialScale)
  .event(svg);
  svg.attr('height', g.graph().height * initialScale + 40);
  </code></pre>
  
  <p>I just need to be able to click on TEST or TEST1 and run a function that I wrote to go to that div with same name on page(TEST, TEST1)</p>
  
  <p>I have looked through this, but it doesn't help me.
  <a href="https://github.com/cpettitt/dagre-d3/issues/13" rel="noreferrer">https://github.com/cpettitt/dagre-d3/issues/13</a>
  Also this seems to use different method which is not available to me.</p>
  
  <p>Please guide me</p>
  
  <p>Thanks,
  Nihir</p>