The Grid controller class

Hierarchy

  • Grid

Constructors

Properties

images: MicrioImage[] = []

The instanced grid images

current: MicrioImage[] = []

The currently shown images

_grid: HTMLDivElement = ...

The grid HTML element

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

The image HTML

clickable: boolean = false

The HTML grid will stay visible and clickable

focussed: Writable<MicrioImage> = ...

The current full-view focussed image

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

Show the markers of these elements

history: GridHistory[] = []

The grid state history

depth: Writable<number> = ...

The current history length

aniDurationIn: number = 1500

The animation duration when opening a new layout, in ms

aniDurationOut: number = 500

The animation duration when going back, in ms

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

Current individual cell sizes w,h

The MicrioImage which is the virtual grid container

Methods

  • Set the grid to this input

    Returns

    Promise when the animation is done with the currently shown images

    Parameters

    • input: string = ''

      The grid string

    • opts: {
          noHistory?: boolean;
          keepGrid?: boolean;
          horizontal?: boolean;
          duration?: number;
          defaultCrossfade?: boolean;
          view?: View;
          noDraw?: boolean;
          noBlur?: boolean;
          noFade?: boolean;
      } = {}

      Optional settings

      • Optional noHistory?: boolean

        Don't add the layout to the history stack

      • Optional keepGrid?: boolean

        Don't remove the grid

      • Optional horizontal?: boolean

        The layout is horizontal

      • Optional duration?: number

        Any main camera animation duration in seconds

      • Optional defaultCrossfade?: boolean

        Use the default crossfade duration

      • Optional view?: View

        Fly the main grid view to this viewport

      • Optional noDraw?: boolean

        Don't draw any frame or do any camera stuff

      • Optional noBlur?: boolean

        Don't unfocus the current focussed image

      • Optional noFade?: boolean

        Don't do any fading in

    Returns Promise<MicrioImage[]>

  • Convert a grid string to GridImage object

    Returns

    the GridImage

    Parameters

    • s: string

      The image individual encoded grid string

    Returns GridImage

  • Convert an ImageInfo object to an individual image grid string

    Returns

    The grid encoded string of this image

    Parameters

    Returns string

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

    Returns boolean

  • Reset the grid to its initial layout

    Returns

    Promise when the transition is complete

    Parameters

    • Optional duration: number
    • Optional noDraw: boolean

    Returns Promise<MicrioImage[]>

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

    Returns

    Promise when the transition is complete

    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[]>

  • Go back one step in the grid history

    Returns

    Promise when the transition is complete

    Parameters

    • Optional duration: number

      Optional duration for transition

    Returns Promise<void>

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

    Returns

    Promise for when the transition completes

    Parameters

    • img: MicrioImage

      The image

    • Optional view: View

      Optional viewport to focus on

    • Optional duration: number

    Returns Promise<void>

  • Unfocusses any currently focussed image

    Returns void

  • 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

  • Enlarge a specific image idx of the currently shown grid

    Returns

    Promise when the transition is completed

    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[]>

Generated using TypeDoc