weasel API - v0.8.0
    Preparing search index...

    Interface DecayLoopConfig

    interface DecayLoopConfig {
        boundary?: "stop" | "bounce" | "spring";
        friction?: number;
        initialPosition?: { x: number; y: number };
        minSpeed?: number;
        onEnd?: () => void;
        onTick: (dx: number, dy: number) => void;
        velocity: { vx: number; vy: number };
        viewBounds?: PanBounds;
    }
    Index

    Properties

    boundary?: "stop" | "bounce" | "spring"

    What to do when the accumulated position hits viewBounds. Default: no clamping.

    • 'stop': clamp at boundary, kill velocity component.
    • 'bounce': linear reflection — flip velocity sign, magnitude preserved.
    • 'spring': damped reflection — flip velocity sign and shrink magnitude by SPRING_DAMPING per bounce so the motion settles naturally.
    friction?: number
    initialPosition?: { x: number; y: number }

    Starting position for internal boundary tracking. Required when viewBounds is set.

    minSpeed?: number
    onEnd?: () => void
    onTick: (dx: number, dy: number) => void
    velocity: { vx: number; vy: number }
    viewBounds?: PanBounds

    Bounds for boundary clamping. Requires boundary to take effect.