ixfx
    Preparing search index...

    Function viewportToSpace

    • Returns a function that converts input viewport coordinate space to an output coordinate space.

      // f() will convert from viewport to document coordinate space
      const f = viewportToSpace('document');

      // {x:100,y:100} is viewport coordinate space
      f(100,100); // Yields: { x, y } converted to document space

      Or immediately invoke for one-off use:

      viewportToSpace('document')(100,100); // Yields: { x, y }
      

      Parameters

      Returns (
          a: Readonly<number | number[] | Geometry.Point>,
          b?: number,
      ) => Readonly<{ x: number; y: number }>