transition.style(name, value[, priority])
For each selected element, assigns the style tween for the style with the specified name to the specified target value with the specified priority. The starting value of the tween is the style’s computed 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 style is removed when the transition starts. Otherwise, an interpolator is chosen based on the type of the target value, using the following algorithm:
- If value is a number, use interpolateNumber.
- If value is a color or a string coercible to a color, use interpolateRgb.
- Use interpolateString.
To apply a different interpolator, use transition.styleTween.
Please login to continue.