d3 / d3-transition

Animated transitions for D3 selections.
https://d3js.org/d3-transition
ISC License
224 stars 64 forks source link

transition.tween API documentation missing a transition? #70

Closed myartsev closed 7 years ago

myartsev commented 7 years ago

Is the API sample for tween missing a call to transition?
A selection alone does not have a tween method.

selection.tween("attr.fill", function() {
  var node = this, i = d3.interpolateRgb(node.getAttribute("fill"), "blue");
  return function(t) {
    node.setAttribute("fill", i(t));
  };
});
selection.transition().tween("attr.fill", function() {
  var node = this, i = d3.interpolateRgb(node.getAttribute("fill"), "blue");
  return function(t) {
    node.setAttribute("fill", i(t));
  };
});
mbostock commented 7 years ago

I have corrected the README. Thank you for the report.