title: How to invoke "click" event programmatically in d3?
body: <p>I'm trying like that (also at <a href="https://gist.github.com/1703994" rel="noreferrer">https://gist.github.com/1703994</a>):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.27.2"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?1.27.2"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript" src="js-libs/jquery-1.7.js"&gt;&lt;/script&gt;
  
      &lt;style&gt;
        &lt;!--
        #test {
        width: 400px;
        height: 500px;
        }
        --&gt;
      &lt;/style&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
  
      &lt;script type="text/javascript"&gt;
        $(function() {
          var w = 600,
              h = 350;
  
          var vis = d3.select("#test").append("svg:svg")
          .attr("width", w)
          .attr("height", h)
          .append("svg:g")
          .attr("transform", "translate(" + w / 2 + "," + h / 2 + ")");
  
          var g = vis.selectAll("g")
          .data([ { x:1 , y: 2} ])
          .enter().append("svg:g");
  
          g.append("svg:path")
          .attr("fill", "red")
          .attr("stroke", "red")
          .attr("stroke-width", "10")
          .attr("d", "M 100 350 l 150 -300")
  
          g.select("path")
          .on("click", function() { console.log("Hello"); });
  
          // XXX: how to execute click programmaticaly?
        })
      &lt;/script&gt;
  
      &lt;div id="test"&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But doesn't work</p>
  
  <p>I think we may use <a href="https://github.com/mbostock/d3/wiki/Internals#wiki-dispatch_on" rel="noreferrer">https://github.com/mbostock/d3/wiki/Internals#wiki-dispatch_on</a> </p>
  
  <p>But how to do it?</p>