title: how to add new elements to d3 data set used in enter.append?
body: <p>I have the following data set with only text and color information</p>
  
  <pre><code>var inputs = [{"text": "inleaf1", "col": "red"}, {"text": "inleaf2", "col": "blue"}, {"text": "inleaf3", "col": "green"}];
  </code></pre>
  
  <p>and the following is used to draw rectangles with text elements in it</p>
  
  <pre><code>            var inputleaf = container.selectAll("rect")
                      .data(data)
                      .enter().append("rect")
                      .attr("class", "input-leaf")
                      .attr("width", elementwidth)
                      .attr("height", elementheight)
                      .attr("x", startX)
                      .attr("y", function (d, i) {
                          return startY + ((elementheight + verticalmargin) * i);
                      })
                      .attr("stroke-width", "2")
                      .attr("fill", "none")
                      .attr("stroke", function (d) {
                          return d.col;
                      })
                      .call(function (d) {
                         //--------------------add position details to the data set
                      });
  
              var inputtext = container.selectAll("text")
                      .data(data)
                      .enter().append("text")
                      .attr("x", startX + elementwidth / 10)
                      .attr("y", function (d, i) {
                          return startY + (elementheight / 2) + ((elementheight + verticalmargin) * i);
                      })
                      .text(function (d) {
                          return d.text;
                      });
  </code></pre>
  
  <p>during iteration, how can I add more attributes to the dataset, such as the position details. Basically I want to update the dataset. </p>