Interface ZoomManagerSettings

Hierarchy

  • ZoomManagerSettings

Properties

autoZoom?: AutoZoomSettings

Options of the auto zoom. If provided, will automatically change the zoom when the window width changes so expectedWidth is available on the rescaled element.

defaultZoom?: number

Default zoom, used at setup. If a zoom if stored in localStorage, the default zoom is ignored.

element: HTMLElement

The element that can be zoomed in/out.

localStorageZoomKey?: string

The key used to persist the zoom level on localStorage. Default (unset) is no storage.

onDimensionsChange?: ((zoom) => void)

Type declaration

    • (zoom): void
    • Function called when the element dimensions changes, or after a zoom change. This function can be called a lot of times, don't forget to debounce it if used.

      Parameters

      • zoom: number

      Returns void

onZoomChange?: ((zoom) => void)

Type declaration

    • (zoom): void
    • Function called when the zoom changes.

      Parameters

      • zoom: number

      Returns void

smooth?: boolean

Smooth transition when changing zoom level. Default true.

throttleTime?: number

Throttle time, in ms, for resize events, to avoid event spamming. Default is 100ms.

zoomControls?: ZoomControls

Options of the zoom controls.

zoomLevels?: number[]

An array of zoom levels for the zoomIn/zoomOut methods. Default is [0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1]

Generated using TypeDoc