myTransition.text( func ) in D3.js

Set the text contents to a new value at the start of the transition.

Arguments

nametypedescription
func Function Invoked for each element in the transition selection, passed the current datum and index, with the this context as the current DOM element. The function’s return value is used to set the element’s textContent at the start of the transition. A null value will clear the content.
Return Type
Transition

Description

For more details see https://github.com/mbostock/d3/wiki/Transitions#wiki-text.

See Also