Options
All
  • Public
  • Public/Protected
  • All
Menu

The SceneTreeController is responsible for coordinating interactions of the view, fetching and mutating tree data on the server, maintaining state and notifying the view about state changes.

Hierarchy

  • SceneTreeController

Index

Constructors

Properties

onStateChange: EventDispatcher<SceneTreeState> = ...

A dispatcher that emits an event whenever the internal state has changed.

Accessors

  • get fetchedPageCount(): number
  • get isConnected(): boolean

Methods

  • cancel(): void
  • collapseAll(): Promise<void>
  • collapseNode(id: string): Promise<void>
  • connectToViewer(viewer: HTMLVertexViewerElement): Disposable
  • disconnect(reset?: boolean): void
  • expandAll(): Promise<void>
  • expandNode(id: string): Promise<void>
  • expandParentNodes(id: string): Promise<number>
  • fetchMetadataKeys(): Promise<string[]>
  • fetchNodeAncestors(nodeId: string): Promise<AsObject[]>
  • fetchPage(index: number): Promise<void>
  • Fetches a page at the given index. Once the data has been fetched, the controller will emit an onStateChange event that contains rows with the fetched page. If a page is invalidated before the request completes, the response is ignored.

    If the index is out of range, returns without fetching any data.

    Parameters

    • index: number

      A 0 based index to fetch.

    Returns Promise<void>

  • fetchPageAtOffset(offset: number): Promise<void>
  • fetchRange(startOffset: number, endOffset: number): Promise<void>
  • getNonLoadedPageIndexes(start: number, end: number): number[]
  • Returns a list of page indices within a range that have not been loaded.

    Parameters

    • start: number

      The start page index, inclusive.

    • end: number

      The end page index, inclusive.

    Returns number[]

    A list of pages indices that have not been loaded.

  • getPage(index: number): undefined | Page
  • getPageForOffset(offset: number): number
  • getPageIndexesForRange(start: number, end: number): [number, number]
  • invalidatePagesOutsideRange(startPage: number, endPage: number, threshold?: number): void
  • Clears page data that is outside a given range. Uses a distance algorithm to removes pages that are furthest from either end of the range. This method is useful for clearing out data that is not needed anymore to keep memory pressure in the client low.

    Parameters

    • startPage: number

      The index of the starting page in the range.

    • endPage: number

      The index of the ending page in the range.

    • threshold: number = 0

      A minimum number of pages to keep. No cleanup is performed if the number of fetched pages doesn't meet this threshold.

    Returns void

  • isPageLoaded(index: number): boolean
  • setDebugLogs(debugLogs: boolean): void
  • setMetadataKeys(keys: string[]): Promise<void>
  • stateChanged(listener: Listener<undefined | SceneTreeState>): Disposable
  • updateActiveRowRange(start: number, end: number): Promise<void>
  • Sets the active rows. Active rows dictate which pages will be refetched when the tree changes.

    Parameters

    • start: number

      The starting row index.

    • end: number

      The ending row index.

    Returns Promise<void>

    A promise that resolves when the first page of data has been loaded.