class Reactive · Animation
RvgNumberAnimator
Animator for reactive real-number values.
Accessed via Animate.Real. Supports eased tweens, continuous follow, deferred set, and
immediate snap operations on reactive Real.
Methods
eased
eased(refObj: Real, to: Real | NumberLike, duration: number, options?: RvgEasedOptions | null): RvgAnimationSmoothly interpolates the value from its current state to to over the given duration.
A call with a new target starts again from the current value with the full duration (the same
target leaves the running animation alone). For a target that changes often, e.g. on every
drag move, use Animate.real.follow.
refObj- The reactive
Realto animate. to- The target numeric value.
duration- Animation duration in milliseconds.
optionsoptional- Optional
RvgEasedOptionscontrolling the easing curve, completion tolerance, and anonCompletecallback.
Returns The running animation: to cancel it or to wait for it.
follow
follow(refObj: Real, to: Real | NumberLike, options?: RvgFollowOptions | null): RvgAnimationContinuously moves the value toward to each frame using an exponential decay, producing a
lag-based pursuit effect.
The target is read when called. For a target that keeps changing (e.g. during a drag), call
follow again with the new target each time: the running animation keeps going and only its
target changes, so the motion stays smooth.
refObj- The reactive
Realto animate. to- The target numeric value to follow.
optionsoptional- Optional
RvgFollowOptionscontrolling the follow alpha and snap tolerance.
Returns The running animation: to cancel it or to wait for it.
set
set(refObj: Real, value: Real | NumberLike, delay: number, options?: RvgSetOptions | null): RvgAnimationSchedules an assignment of value after the given delay, with no interpolation.
refObj- The reactive
Realto animate. value- The value to assign when the delay elapses.
delay- Delay in milliseconds before the assignment occurs.
optionsoptional- Optional
RvgSetOptions— currently supports anonCompletecallback invoked after the assignment.
Returns The running animation: to cancel it or to wait for it.
snap
snap(refObj: Real, value: Real | NumberLike): voidImmediately cancels any active animation on the value and assigns the new value without delay.
refObj- The reactive
Realto update. value- The value to assign immediately.
