The Grid controller class

Constructors

  • The Grid constructor

    Parameters

    Returns Grid

Properties

_buttons: Map<string, HTMLButtonElement> = ...

The image HTML <button> grid elements

_grid: HTMLDivElement = ...

The grid HTML element

aniDurationIn: number = 1.5

The animation duration when opening a new layout, in s

aniDurationOut: number = 0.5

The animation duration when going back, in s

cellSizes: Map<string, [number, number?]> = ...

Current individual cell sizes w,h

clickable: boolean = false

The HTML grid will stay visible and clickable

current: MicrioImage[] = []

The currently shown images

depth: Writable<number> = ...

The current history length

focussed: Writable<MicrioImage> = ...

The current full-view focussed image

history: GridHistory[] = []

The grid state history

The MicrioImage which is the virtual grid container

images: MicrioImage[] = []

The instanced grid images

markersShown: Writable<MicrioImage[]> = ...

Show the markers of these elements

The Micrio instance

transitionDelay: number = .5

For delayed transitions, individual delay in s

Accessors

Methods

  • Do an (external) action

    Parameters

    • action: string | GridActionType

      The action type enum or string

    • Optional data: string

      Optional action data

    • Optional duration: number

      Optional action duration

    Returns void

  • Go back one step in the grid history

    Parameters

    • Optional duration: number

      Optional duration for transition

    Returns Promise<void>

    Promise when the transition is complete

  • Unfocusses any currently focussed image

    Returns void

  • Enlarge a specific image idx of the currently shown grid

    Parameters

    • idx: number

      The image index of the current grid

    • width: number

      The image target number of columns

    • height: number = width

      The image target number of rows

    Returns Promise<MicrioImage[]>

    Promise when the transition is completed

  • Fly to the viewports of any markers containing a class name

    Parameters

    • Optional tag: string

      The class name to match

    • Optional duration: number

      Optional duration in ms

    • Optional noZoom: boolean

      Don't zoom into the markers, just filter the images

    Returns Promise<MicrioImage[]>

    Promise when the transition is complete

  • Open a grid image full size and set it as the main active image

    Parameters

    Returns Promise<void>

    Promise for when the transition completes

  • Convert a grid string to GridImage object

    Parameters

    • s: string

      The image individual encoded grid string

    Returns GridImage

    the GridImage

  • Get the relative in-grid viewport of the image

    Parameters

    Returns View

  • Convert an ImageInfo object to an individual image grid string

    Parameters

    Returns string

    The grid encoded string of this image

  • Checks whether current viewed image is (part of) grid

    Returns boolean

  • Reset the grid to its initial layout

    Parameters

    • Optional duration: number

      Duration in seconds

    • Optional noCamAni: boolean

      Don't do any camera animating

    • Optional forceAni: boolean

      Force animation on all grid images

    Returns Promise<MicrioImage[]>

    Promise when the transition is complete

  • Set the grid to this input

    Parameters

    • input: string | MicrioImage[] | ({
          image: MicrioImage;
      } & GridImageOptions)[] = ''

      The grid string

    • opts: {
          columns?: number;
          cover?: boolean;
          coverLimit?: boolean;
          duration?: number;
          forceAni?: boolean;
          forceAreaAni?: boolean;
          horizontal?: boolean;
          keepGrid?: boolean;
          noBlur?: boolean;
          noCamAni?: boolean;
          noFade?: boolean;
          noHistory?: boolean;
          scale?: number;
          transition?: GridSetTransition;
          view?: View;
      } = {}

      Optional settings

      • Optional columns?: number

        Grid columns

      • Optional cover?: boolean

        Open the images on cover view, but don't limit

      • Optional coverLimit?: boolean

        Limit the images to cover view

      • Optional duration?: number

        Any main camera animation duration in seconds

      • Optional forceAni?: boolean

        Force an animation for all images

      • Optional forceAreaAni?: boolean

        Force area animating for images currently not visible

      • Optional horizontal?: boolean

        The layout is horizontal

      • Optional keepGrid?: boolean

        Don't remove the grid HTML element

      • Optional noBlur?: boolean

        Don't unfocus the current focussed image

      • Optional noCamAni?: boolean

        Don't draw any frame or do any camera stuff

      • Optional noFade?: boolean

        Don't do any fading in

      • Optional noHistory?: boolean

        Don't add the layout to the history stack

      • Optional scale?: number

        Scale individual grid images (0-100%)

      • Optional transition?: GridSetTransition

        Transition animation, defaults to crossfade

      • Optional view?: View

        Fly the main grid view to this viewport

    Returns Promise<MicrioImage[]>

    Promise when the animation is done with the currently shown images