transition.call(function[, arguments…])
Invokes the specified function exactly once, passing in this transition along with any optional arguments. Returns this transition. This is equivalent to invoking the function by hand but facilitates method chaining. For example, to set several attributes in a reusable function:
function color(transition, fill, stroke) {
transition
.style("fill", fill)
.style("stroke", stroke);
}
Now say:
d3.selectAll("div").transition().call(color, "red"