myTransition.attr( name, func ) in D3.js

Transition an attribute value based on data.


name String Name of the attribute to transition.
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 each attribute’s value at the end of the transition. A null value will not remove the specified attribute.
Return Type


For more details see

See Also