bga-zoom
    Preparing search index...

    Class ZoomManager

    Index

    Constructors

    • Place the settings.element in a zoom wrapper and init zoomControls.

      Parameters

      • settings: ZoomManagerSettings

      Returns ZoomManager

    Properties

    _zoom: number
    _zoomLevels: number[]
    settings: ZoomManagerSettings
    throttleTime: number
    wrapper: HTMLDivElement
    zoomControls: HTMLDivElement
    zoomInButton: HTMLButtonElement
    zoomOutButton: HTMLButtonElement

    Accessors

    • get zoom(): number

      Returns the zoom level

      Returns number

    • get zoomLevels(): number[]

      Returns the zoom levels

      Returns number[]

    Methods

    • Set-up the zoom controls

      Parameters

      • settings: ZoomManagerSettings

        a ZoomManagerSettings object.

      Returns void

    • Call this method for the browsers not supporting ResizeObserver, everytime the table height changes, if you know it. If the browsert is recent enough (>= Safari 13.1) it will just be ignored.

      Returns void

    • Set the zoom level. Ideally, use a zoom level in the zoomLevels range.

      Parameters

      • zoom: number = 1

        zool level

      Returns void

    • Changes the color of the zoom controls.

      Parameters

      • color: "black" | "white"

      Returns void

    • Sets the available zoomLevels and new zoom to the provided values.

      Parameters

      • zoomLevels: number[]

        the new array of zoomLevels that can be used.

      • OptionalnewZoom: number

        if provided the zoom will be set to this value, if not the last element of the zoomLevels array will be set as the new zoom

      Returns void

    • Wraps an element around an existing DOM element

      Parameters

      • wrapper: HTMLElement

        the wrapper element

      • element: HTMLElement

        the existing element

      Returns void

    • Simulates a click on the Zoom-in button.

      Returns void

    • Everytime the element dimensions changes, we update the style. And call the optional callback. Unsafe method as this is not protected by throttle. Surround with advThrottle(() => this.zoomOrDimensionChanged(), this.throttleTime, { leading: true, trailing: true, }) to avoid spamming recomputation.

      Returns void

    • Simulates a click on the Zoom-out button.

      Returns void