title: Calling a function once when data enters in d3
body: <p>Is there a way to call a function when data enters using data().enter()?</p>
  
  <p>For example, in this current jsfiddle: <a href="http://jsfiddle.net/p3m8A/4/" rel="noreferrer">http://jsfiddle.net/p3m8A/4/</a> , I have a function that draws a group and I want to call this function when new data enters. The current jsfiddle doesn't do anything but the objective is to click on the red square and using .data.enter draw a purple square when the red square is clicked. </p>
  
  <p>The specific part I'm trying to get to work is :</p>
  
  <pre><code>canvas.selectAll("#boxGroup")
      .data(data)
  .enter().function(d,i) {
      drawBox(150,20,d);
  };
  </code></pre>
  
  <p>Thanks</p>