Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.
Type parameters
-
T
Hierarchy
- Vertex
Index
Properties
Methods
Properties
Readonly data
User data associated with the vertex.
Readonly edgesIn
An iterable of all edges that have this vertex as its destination endpoint.
const vertex = graph.vertex('a');
for (const edgeIn of vertex.edgesIn) {
console.log(`vertex "${edgeIn.dst.id}" has an edge coming in from a vertex "${edgeIn.src.id}"`);
}
Readonly edgesInCount
The nubmer of edges that have this vertex as its destination endpoint.
const vertex = graph.vertex('a');
console.log(`vertex "${vertex.id}" has ${vertex.edgesInCount} edges out");
Readonly edgesOut
An iterable of all edges that have this vertex as its source endpoint.
const vertex = graph.vertex('a');
for (const edgeOut of vertex.edgesOut) {
console.log(`vertex "${edgeOut.src.id}" has an edge going to a vertex "${edgeOut.dst.id}"`);
}
Readonly edgesOutCount
The nubmer of edges that have this vertex as its source endpoint.
const vertex = graph.vertex('a');
console.log(`vertex "${vertex.id}" has ${vertex.edgeOutCount} edges out");
Readonly id
The vertex's id.
Readonly neighbors
An iterable of all vertices that can be traversed to from this vertex.
const vertex = graph.vertex('a');
for (const neighbor of vertex.neighbors) {
console.log(`vertex "${vertex.id}" shares an edge with "${neighbor.id}");
}
Methods
findEdgeIn
-
Find an edge into this vertex.
const vertex = graph.vertex('a'); // find an edge into 'a' and out from 'b' vertex.findEdgeIn(edge => edge.src.id === 'b');Parameters
-
predicate: function
The callback to run against each inward edge until one is found (by returning true.)
-
-
Parameters
-
edgeIn: Graph.Edge<T>
Returns boolean
-
-
-
-
Optional thisArg: any
The "this" argument to use in
predicate
Returns Graph.Edge<T> | undefined
-
findEdgeOut
-
Find an edge out of this vertex.
const vertex = graph.vertex('a'); // find an edge out from 'a' and into 'b' vertex.findEdgeIn(edge => edge.src.id === 'b');Parameters
-
predicate: function
The callback to run against each outward edge until one is found (by returning true.)
-
-
Parameters
-
edgeOut: Graph.Edge<T>
Returns boolean
-
-
-
-
Optional thisArg: any
The "this" argument to use in
predicate
Returns Graph.Edge<T> | undefined
-
A node in the graph.