transition.text(value)
For each selected element, sets the text content to the specified target value when the transition starts. The 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. The function’s return value is then used to set each element’s text content. A null value will clear the content.
To interpolate text rather than to set it on start, use transition.tween (for example) or append a replacement element and cross-fade opacity (for example). Text is not interpolated by default because it is usually undesirable.
Please login to continue.