ICollectionAdaptor | Matterport SDK
Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.

An adaptor for an observable collection to automatically generate and update a graph. Used in IDirectedGraph.watch.

Type parameters

  • T

Hierarchy

  • ICollectionAdaptor

Index

Properties

collection

collection: IObservableMap<T>

A observable collection from the sdk, e.g. mpSdk.Sweep.data.

Methods

isNeighborOf

  • Determines whether or not an item from the collection should be considered a neighbor of another item.

    Parameters

    • src: Graph.Vertex<T>

      A vertex containing the source item

    • dst: Graph.Vertex<T>

      A vertex containing the destination item

    Returns boolean

neighborsOf

  • neighborsOf(item: Graph.Vertex<T>): IterableIterator<string>
  • Get a list of ids for other vertices that should be considered neighbors to an item in the collection.

    Parameters

    Returns IterableIterator<string>

Optional shouldAdd

  • shouldAdd(item: T): boolean
  • Determines whether or not an item from the collection will be added as a graph vertex.

    Parameters

    • item: T

    Returns boolean

weightBetween

  • Get the weight between two items in the collection to use as the connecting edges weight.

    Parameters

    Returns number