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

Transition an attribute value based on data.

Arguments

nametypedescription
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
Transition

Description

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

See Also