For each selected element, assigns the attribute tween for the attribute with the specified name to the specified target value. The starting value of the tween is the attribute’s value when the transition starts. If the target value is null, the attribute is removed when the transition starts.
For each selected element, assigns the attribute tween for the attribute with the specified name to the specified target value. The starting value of the tween is the attribute’s value when the transition starts. The target value is return value of the value function evaluated for the selected element.
An interpolator is chosen based on the type of the target value, using the following algorithm: 1.) If value is a number, use interpolateNumber. 2.) If value is a color or a string coercible to a color, use interpolateRgb. 3.) Use interpolateString.
To apply a different interpolator, use transition.attrTween.
Name of the attribute.
A value function which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). A null value will clear the attribute at the start of the transition.
Return the current interpolator factory for attribute with the specified name, or undefined if no such tween exists.
Name of attribute.
Remove the previously-assigned attribute tween of the specified name, if any.
Name of attribute.
Use null to remove previously-assigned attribute tween.
Assign the attribute tween for the attribute with the specified name to the specified interpolator factory. An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element. The returned interpolator will then be invoked for each frame of the transition, in order, being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the attribute value. The interpolator must return a string.
Name of attribute.
An interpolator factory which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The interpolator factory returns a string interpolator, which takes as its argument eased time t, typically in the range [0, 1] and returns the interpolated string.
Invoke the specified function exactly once, passing in this transition along with any optional arguments. Returns this transition.
A function which is passed this transition as the first argument along with any optional arguments.
Rest
...args: any[]Rest
...args: any[]List of optional arguments to be passed to the callback function.
Returns the current value of the delay for the first (non-null) element in the transition. This is generally useful only if you know that the transition contains exactly one element.
For each selected element, sets the transition delay to the specified value in milliseconds. If a delay is not specified, it defaults to zero.
Number of milliseconds for the delay.
For each selected element, sets the transition delay to the value in milliseconds returned by the value function.
A value function which is evaluated for each selected element, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The return value is a number specifying the delay in milliseconds.
Returns the current value of the duration for the first (non-null) element in the transition. This is generally useful only if you know that the transition contains exactly one element.
For each selected element, sets the transition duration to the specified value in milliseconds. If a duration is not specified, it defaults to 250ms.
For each selected element, sets the transition duration to the value in milliseconds returned by the value function.
A value function which is evaluated for each selected element, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The return value is a number specifying the duration in milliseconds.
Invoke the specified function for each selected element, passing the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously.
A function which is invoked for each selected element, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]).
Returns the current easing function for the first (non-null) element in the transition. This is generally useful only if you know that the transition contains exactly one element.
Returns the current easing function for the first (non-null) element in the transition. This is generally useful only if you know that the transition contains exactly one element.
Specifies the transition easing function for all selected elements. The value must be specified as a function. The easing function is invoked for each frame of the animation, being passed the normalized time t in the range [0, 1]; it must then return the eased time tʹ which is typically also in the range [0, 1]. A good easing function should return 0 if t = 0 and 1 if t = 1. If an easing function is not specified, it defaults to d3.easeCubic.
An easing function which is passed the normalized time t in the range [0, 1]; it must then return the eased time tʹ which is typically also in the range [0, 1]. A good easing function should return 0 if t = 0 and 1 if t = 1.
Specifies a factory for the transition easing function.
The factory must be a function. It is invoked for each node of the selection, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. It must return an easing function.
For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection.
The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
A CSS selector string.
For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection.
The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types contained in a pre-filter selection are narrowed to a subset as part of the filtering.
A CSS selector string.
For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection.
The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
A filter function which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The filter function returns a boolean indicating, whether the selected element matches.
For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection.
The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types contained in a pre-filter selection are narrowed to a subset as part of the filtering.
A filter function which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The filter function returns a boolean indicating, whether the selected element matches.
Returns a new transition merging this transition with the specified other transition, which must have the same id as this transition. The returned transition has the same number of groups, the same parents, the same name and the same id as this transition. Any missing (null) elements in this transition are filled with the corresponding element, if present (not null), from the other transition.
The transition to be merged.
Return the currently-assigned listener for the specified event typename on the first (non-null) selected element, if any. If multiple typenames are specified, the first matching listener is returned.
The typenames is one of the following string event types: start (when the transition starts), end (when the transition ends), interrupt (when the transition is interrupted), cancel(when the transition is cancelled). Note that these are not native DOM events. The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered to receive events of the same type, such as "start.foo"" and "start.bar". To specify multiple typenames, separate typenames with spaces, such as "interrupt end"" or "start.foo start.bar".
Remove all listeners for a given name.
Name of the event type for which the listener should be removed. To remove all listeners for a given name use ".foo" as the typename, where foo is the name; to remove all listeners with no name, specify "." as the typename.
Use null to remove listeners.
Add a listener to each selected element for the specified event typenames.
When a specified transition event is dispatched on a selected node, the specified listener will be invoked for each transitioning element. Listeners always see the latest datum for their element, but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener.
The typenames is one of the following string event types: start (when the transition starts), end (when the transition ends), interrupt (when the transition is interrupted), cancel(when the transition is cancelled). Note that these are not native DOM events. The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered to receive events of the same type, such as "start.foo"" and "start.bar". To specify multiple typenames, separate typenames with spaces, such as "interrupt end"" or "start.foo start.bar".
A listener function which will be evaluated for each selected element, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). Listeners always see the latest datum for their element, but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener.
For each selected element, removes the element when the transition ends, as long as the element has no other active or pending transitions. If the element has other active or pending transitions, does nothing.
For each selected element, select the first descendant element that matches the specified selector string, if any, and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
The generic represents the type of the descendant element to be selected.
CSS selector string
For each selected element, select the descendant element returned by the selector function, if any, and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
The generic represents the type of the descendant element to be selected.
A selector function, which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). It must return an element, or null if there is no matching element.
For each selected element, select all descendant elements that match the specified selector string, if any, and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type.
CSS selector string
For each selected element, select all descendant elements returned by the selector function, if any, and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element.
The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type.
A selector function which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). It must return an array of elements (or a pseudo-array, such as a NodeList), or the empty array if there are no matching elements.
For each selected element, selects the first child element that matches the specified selector string, if any, and returns a transition on the resulting selection. The selector may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. This method is equivalent to deriving the selection for this transition via transition.selection, creating a subselection via selection.selectChild, and then creating a new transition via selection.transition.
Optional
selector: string | ValueFn<GElement, Datum, DescElement>For each selected element, selects all children that match the specified selector string, if any, and returns a transition on the resulting selection. The selector may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. This method is equivalent to deriving the selection for this transition via transition.selection, creating a subselection via selection.selectChildren, and then creating a new transition via selection.transition.
Optional
selector: string | ValueFn<GElement, Datum, DescElement>For each selected element, the style with the specified name will be cleared at the start of the transition.
Name of the style.
Use null to clear the style.
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 inline value if present, and otherwise its computed value. The target value is the specified constant value for all elements.
An interpolator is chosen based on the type of the target value, using the following algorithm: 1.) If value is a number, use interpolateNumber. 2.) If value is a color or a string coercible to a color, use interpolateRgb. 3.) Use interpolateString.
To apply a different interpolator, use transition.attrTween.
Name of the style.
Target value for the style.
Optional
priority: "important"An optional priority flag, either null or the string important (without the exclamation point)
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 inline value if present, and otherwise its computed value. The target value is return value of the value function evaluated for the selected element.
An interpolator is chosen based on the type of the target value, using the following algorithm: 1.) If value is a number, use interpolateNumber. 2.) If value is a color or a string coercible to a color, use interpolateRgb. 3.) Use interpolateString.
To apply a different interpolator, use transition.attrTween.
Name of the style.
A value function which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). A null value will clear the style at the start of the transition.
Optional
priority: "important"An optional priority flag, either null or the string important (without the exclamation point)
Return the current interpolator factory for style with the specified name, or undefined if no such tween exists.
Name of style.
Remove the previously-assigned style tween of the specified name, if any.
Name of style.
Use null to remove previously-assigned style tween.
Assign the style tween for the style with the specified name to the specified interpolator factory. An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element. The returned interpolator will then be invoked for each frame of the transition, in order, being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the style value. The interpolator must return a string.
Name of style.
An interpolator factory which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The interpolator factory returns a string interpolator, which takes as its argument eased time t, typically in the range [0, 1] and returns the interpolated string.
Optional
priority: "important"An optional priority flag, either null or the string important (without the exclamation point)
For each selected element, sets the text content to the specified target value when the transition starts. A null value will clear the content.
For each selected element, sets the text content returned by the value function for each selected element when the transition starts.
To interpolate text rather than to set it on start, use transition.textTween (for example) or append a replacement element and cross-fade opacity (for example). Text is not interpolated by default because it is usually undesirable.
A value function which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). A null value will clear the text content at the start of the transition.
Returns the current interpolator factory for text, or undefined if no such tween exists.
Removes the previously-assigned text tween, if any
Use null to remove previously-assigned text tween.
Assigns the text tween to the specified interpolator factory. An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is 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 returned interpolator will then be invoked for each frame of the transition, in order, being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the text. The interpolator must return a string.
An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is 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 returned interpolator will then be invoked for each frame of the transition, in order, being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the text. The interpolator must return a string.
Returns a new transition on the same selected elements as this transition, scheduled to start when this transition ends. The new transition inherits a reference time equal to this transition’s time plus its delay and duration. The new transition also inherits this transition’s name, duration, and easing. This method can be used to schedule a sequence of chained transitions.
A delay configured for the new transition will be relative to the previous transition.
Returns the tween with the specified name, or undefined, if no tween was previously assigned to that name.
Name of tween.
Removes the tween with the specified name, if a tween was previously assigned to that name.
Name of tween.
Use null to remove a previously-assigned tween.
For each selected element, assigns the tween with the specified name with the specified value function. The value must be specified as a function that returns a function. When the transition starts, the value function is evaluated for each selected element. The returned function is then invoked for each frame of the transition, in order, being passed the eased time t, typically in the range [0, 1].
Name of tween.
A tween function which is evaluated for each selected element, in order, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The tween function returns a function which takes as its argument eased time t, typically in the range [0, 1] and performs the tweening activities for each transition frame.
A D3 Transition.
The first generic "GElement" refers to the type of the selected element(s) in the Transition. The second generic "Datum" refers to the type of the datum of a selected element(s) in the Transition. The third generic "PElement" refers to the type of the parent element(s) in the D3 selection in the Transition. The fourth generic "PDatum" refers to the type of the datum of the parent element(s) in the Transition.