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

    Function useViewAnimation

    • Tween the viewport View between values. Wraps useViewTween's animateTo

      • cancel, and adds an animateToBounds convenience that composes fitViewToBounds with the existing tween so consumers can say "zoom to this bounds with animation" in one call.

      animateToBounds needs the current View and the current viewport dimensions to compute the target — both are passed as arguments so this hook stays a leaf (no canvas-size subscription, no View storage).

      Parameters

      • setView: (v: View) => void

      Returns {
          animateTo: (
              from: View,
              to: View,
              opts?: { duration?: number; easing?: (t: number) => number },
          ) => void;
          animateToBounds: (
              bounds: Bounds,
              currentView: View,
              viewportDims: ViewportDims,
              opts?: AnimateToBoundsOptions,
          ) => void;
          cancel: () => void;
      }