An animation for use with WebGL2GraphModelManager, only.
Remarks
You can create instances of this class via the factory methods in WebGL2GraphModelManager. After associating an animation with graph items, you can start it.
After starting, an animation makes progress towards its final state, possibly going through several iterations. The final state is either the same as the initial state for cyclic animations or a different state for unidirectional animations. While it is in progress, an animation can be given a signal to stop. For unidirectional animations like scale, a stopping animations continues its current iteration, and then finishes its progress. For cyclic animations like pulse, it reverses its effect in a single last iteration until it reaches its initial state, and then finishes its progress. Also, while an animation is stopping, you can switch it back into normal progress by calling the start method again.
To cancel its progress immediately, call the reset method. To start a finished animation a second time, call the reset method, first.
Note that Resetting or stopping an animation does not remove the association with the graph elements, but removing the association cancels the animation.
This class also implements the IAnimation interface, so animations can be scheduled via animator instances. This can be handy for running multiple animations in parallel.
Animations should be shared and un-assigned when not in use as the maximum number of assigned animation instances is limited to 15 per type of element. There can be only 8 animations assigned to one item at the same time and only 31 different combinations of the above animations may be assigned to items, with the 32nd combination being no animation at all. If any of these limits are violated, some animations will either not be applied or will stop working.
Type Details
- yfiles module
- view-webgl
- yfiles-umd modules
- view-webgl, view
- Legacy UMD name
- yfiles.view.WebGL2Animation
See Also
Properties
Specifies the preferred total duration of this animation if it is used with an Animator.
Remarks
Implements
Methods
Called by an Animator to run this animation.
Remarks
Parameters
A map of options to pass to the method.
- time - number
- The animation time in [0,1].
Implements
Called by an Animator to clean up after this animation has finished.
Remarks
Implements
Creates a delayed animation instance from this instance.
Remarks
delay
longer than the existing one.Parameters
A map of options to pass to the method.
- delay - TimeSpan
- The delay to wait before the provided animation starts.
Returns
- ↪IAnimation
- A new animation that will first wait before the animation starts.
Defined in
Creates an eased animation for the given base animation.
Remarks
The animation speed linearly increases up to a easeIn
and linearly decreases from easeOut
. Between those two points, the animation speed is constant.
The duration of the ease in and ease out is determined by a mapping [0,1] → [0,1]. The mapping has to be increasing to preserve the order of the frames in the decorated animation. In general, we consider continuously differentiable functions f where integral of f′ equals 1 a suitable choice for the mapping.
Parameters
A map of options to pass to the method.
- easeIn - number
- The ratio for the ease-in time [0,1] where 0 is the start of the animation and 1 the end.
0.5
is the default value. - easeOut - number
- The ratio for the ease-out time [0,1] where 0 is the start of the animation and 1 the end.
0.5
is the default value.
See Also
Defined in
Immediately resets this animation to its initial state.
Remarks
See Also
Starts the progress of the animation, unless it already finished.
Remarks
After associating an animation with graph items, you can start it.
After starting, an animation makes progress towards its final state, possibly going through several iterations. The final state is either the same as the initial state for cyclic animations or a different state for unidirectional animations. While it is in progress, an animation can be given a signal to stop. For unidirectional animations like scale, a stopping animations continues its current iteration, and then finishes its progress. For cyclic animations like pulse, it reverses its effect in a single last iteration until it reaches its initial state, and then finishes its progress. Also, while an animation is stopping, you can switch it back into normal progress by calling the start method again.
To cancel its progress immediately, call the reset method. To start a finished animation a second time, call the reset method, first.
Using this method does not require a separate Animator instance, and initialize must not called before calling this method.
Returns
- ↪Promise<boolean>
- A Promise<void> that will resolve to
true
if the animation reached its final state, or tofalse
if the animation has been signaled to stop or resetted.
See Also
Signals the animation to stop.
Remarks
While it is in progress, an animation can be given a signal to stop. For unidirectional animations like scale, a stopping animations continues its current iteration, and then finishes its progress. For cyclic animations like pulse, it reverses its effect in a single last iteration until it reaches its initial state, and then finishes its progress. Also, while an animation is stopping, you can switch it back into normal progress by calling the start method again.
To cancel its progress immediately, call the reset method.
Returns
- ↪Promise<boolean>
- A Promise<void> that will resolve to
true
if the animation has fully stopped or resetted, or tofalse
if the animation has been switched back to normal progress.