title: D3 Directed graphs
body: <p>I have used the following example to generate directed graphs</p>
  
  <p><a href="http://bl.ocks.org/1153292">http://bl.ocks.org/1153292</a></p>
  
  <p>I want to add a click event so that when the user clicks on a node, the heading of the node is displayed</p>
  
  <p>So far i did this </p>
  
  <pre><code>var circle = svg.append("svg:g").selectAll("circle")
      .data(force.nodes())
    .enter().append("svg:circle")
      .attr("r", 6)
      **.on("mouseup", disp)**
      .call(force.drag);
       ;
  
  function disp() {
      alert("Display the heading of the node clicked here");
  
  };
  </code></pre>
  
  <p>Please advise me how to display that</p>