transition.attr()

transition.attr(name, value)

For each selected element, assigns the attribute tween for the attribute with the specified name to the specified target value. The starting value of the tween is the attribute’s value when the transition starts. The target value may be specified either as a constant or a function. If a function, it is immediately evaluated for each selected element, in order, being passed the current datum d and index i, with the this context as the current DOM element.

If the target value is null, the attribute is removed when the transition starts. Otherwise, an interpolator is chosen based on the type of the target value, using the following algorithm:

  1. If value is a number, use interpolateNumber.
  2. If value is a color or a string coercible to a color, use interpolateRgb.
  3. Use interpolateString.

To apply a different interpolator, use transition.attrTween.

doc_D3_Js
2016-11-24 10:29:21
Comments
Leave a Comment

Please login to continue.