Skip to main content

Animations

Victory is able to animate changes in props using d3-interpolate. Victory components define their animations via the animate prop. duration, delay, easing and onEnd functions may all be specified via the animate prop. An animationWhitelist may also be specified on the animate prop. When given, only props specified in the whitelist will animate.

Live View
Loading...
Live Editor

Transitions

Victory components define default transitions for entering and exiting nodes, but these may be overridden with the onEnter and onExit properties of the animate object. The before and after properties take functions whose return values alter the datum of the transitioning node before or after the transition. These functions are called with the original datum of the transitioning node, the index of that datum, and the entire data array.

note: Use private variables _x, _y, _y0 and _y1 when altering position data during transitions.

Live View
Loading...
Live Editor