D3 Selection Operators

Selection operators can accept constants or functions.
Function arguments are the current datum (d) and index (i).

d3.select("body").selectAll("div")
  .data([1,2,3])
 .enter().append("div")
  .attr("class", function(d,i) { return "para"+d; })
  .style("font-family", "Gill Sans")
  .style("font-size",
     function(d,i) { return (16+i)+"pt"; })
  .text("Div Text!");