class Reactive · Animation
RvgPinAnimator
Animator for reactive Pin values.
Accessed via Animate.Pin. A pin encodes both a position and an orientation/scale vector, so
animations can optionally be anchored to a fixed point in the parent coordinate system to produce
rotation and scale transitions that appear to pivot around that point.
Methods
along
along(pin: Pin, along: Polyline | ShapeLike, duration: number, options?: RvgAlongOptions | null): RvgAnimationMoves a pin along a route, facing the direction of travel.
By default from the start of the route to its end, at constant speed along the route (eased
in time). options.from and options.to are ratios of the route length; with from > to the
pin moves backwards. The pin is set to the start position at once. The route is read every
frame, so it may move. Use it with Animate.shape.trace and the same duration and easing for
a marker at the tip of a drawn line.
pin- The reactive pin to move.
along- The route.
duration- Animation duration in milliseconds.
optionsoptional- Optional start and end ratio, easing and onComplete.
Returns The running animation: to cancel it or to wait for it.
eased
eased(refObj: Pin, to: Pin | PinLike, duration: number, options?: RvgEasedOptions | null): RvgAnimationSmoothly interpolates the pin from its current state to to over the given duration.
refObj- The reactive
Pinto animate. to- The target pin 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.
easedAll
easedAll(pins: Pin[], targets: Pin[], duration: number, options?: RvgEasedOptions | null): RvgAnimationMoves many pins at once, each to the target with the same index, as one animation.
All share the duration and easing; options.stagger delays the start of each pin after the
first by that many milliseconds more. options.onComplete is called once, when the last pin
has arrived. With different list lengths, the extra pins or targets are left out.
pins- The reactive pins to animate.
targets- The target pins, one per pin.
duration- The duration of each pin's animation in milliseconds.
optionsoptional- Optional easing, tolerance, stagger and onComplete for the whole group.
Returns One animation for all pins: to cancel them or to wait for the last one.
easedAt
easedAt(refObj: Pin, to: Pin | PinLike, anchor: Point | VectorLike, duration: number, options?: RvgEasedOptions | null): RvgAnimationSmoothly interpolates the pin from its current state to to, pivoting the transformation
around anchor in the parent coordinate system.
refObj- The reactive
Pinto animate. to- The target pin value.
anchor- A fixed point in the parent coordinate system around which the pin's position, rotation, and scale are interpolated. Useful for animating a group that should appear to spin or scale about a specific on-screen location.
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: Pin, to: Pin | PinLike, options?: RvgFollowOptions | null): RvgAnimationContinuously moves the pin toward to each frame using an exponential decay, producing a
lag-based pursuit effect.
refObj- The reactive
Pinto animate. to- The target pin value to follow.
optionsoptional- Optional
RvgFollowOptionscontrolling the follow alpha and snap tolerance.
Returns The running animation: to cancel it or to wait for it.
followAll
followAll(pins: Pin[], targets: Pin[], options?: RvgFollowOptions | null): RvgAnimationLets many pins follow their targets at once (the target with the same index), as one animation.
options.onComplete is called once, when all pins have caught up. Called again for the same
pins (new targets), it continues without a jump; the earlier call counts as cancelled. With
different list lengths, the extra pins or targets are left out.
pins- The reactive pins to animate.
targets- The pins to follow, one per pin.
optionsoptional- Optional alpha, tolerance and onComplete for the whole group.
Returns One animation for all pins: to cancel them or to wait until all have caught up.
set
set(refObj: Pin, value: Pin | PinLike, delay: number, options?: RvgSetOptions | null): RvgAnimationSchedules an assignment of value after the given delay, with no interpolation.
refObj- The reactive
Pinto animate. value- The pin 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: Pin, value: Pin | PinLike): voidImmediately cancels any active animation on the pin and assigns the new value without delay.
The write is performed inside a reactive transaction to ensure that all dependent reactive values update atomically.
refObj- The reactive
Pinto update. value- The pin value to assign immediately.
