Curves
Change the first key's interpolation to "hold". The dot stays at its first position until the next key. "linear" moves at a steady rate, while "bezier" eases through the keys.
Keyframed values
A Curve<T> maps time to a numeric scalar or fixed-size numeric List.
curve.sample(time: Duration): T
curve.at(progress: Number): T
curve.duration(): Duration
sample uses an exact timestamp; at uses normalized progress 0..1.
Values outside the key interval hold the nearest endpoint. Negative times fail.
animate takes either to= with a duration or curve=. With a curve,
duration defaults to its last timestamp; an explicit duration retimes it.
ease cannot be combined with curve.
Keyframe arguments
Keyframe(time: Duration, value: T, ...) returns a record used in
Curve(keys=[...]). All keys must have matching units and List lengths.
| Argument | Type / default | Meaning |
|---|---|---|
time | Duration; required | Timestamp; first key is zero, subsequent times strictly increase. |
value | Numeric scalar or fixed-size numeric List; required | Value at the key. |
interpolation | "bezier" (default), "linear", "hold" | How this key connects to the next. |
tangents | "auto_clamped" (default), "auto", "manual" | Automatic handles with/without overshoot limiting, or manual handles. |
handle_in / handle_out | Optional {time: Duration, value: T} | Offsets from this key; incoming time is nonpositive, outgoing nonnegative. |
Reflect the key List to edit it in Shrimply. Curves allow 2–4096 keys, up to 256 channels and 65,536 key/channel components; finite duration is at most two hours. Handles must stay ordered within each segment.
Geometric paths
Curve(points=[[0,0], [10,20], [30,20]]) defines a path without a clock.
at(progress) samples distance along it; direction(progress) returns its
tangent. Animate a scalar progress value to control travel speed. Timed
sample, duration and animate(curve=...) require keyframes.
Pass a 2D path as the target of move_to. Its first and last points set the
element's start and end positions. Use two pt coordinates or two percentages
at each point, with the same units throughout.
let arc = Curve(points=[[-120pt, 80pt], [0pt, -75pt], [120pt, 80pt]])
marker.move_to(arc, duration=800ms)
Geometric paths use linear timing by default and accept ease=. Keyframed
paths use their timestamps and easing handles. Set duration= to retime them.