Skip to main content

Home > @jsplumbtoolkit/core > Vertex

Vertex class#

Signature:

export declare abstract class Vertex extends Base 

Extends: Base

Constructors#

ConstructorModifiersDescription
(constructor)(graph, data, idFunction)Constructs a new instance of the Vertex class

Properties#

PropertyModifiersTypeDescription
_idnumberThe vertex's internal id. not part of the API.
dataObjectDataData associated with the vertex.
edgesArray<Edge>
graphGraph
graphsArray<Graph>
idstringThe vertex's id. A string.
indegreeCentralitynumber
nestedGraphsArray<Graph>
outdegreeCentralitynumber

Methods#

MethodModifiersDescription
addEdge(edge)Adds an Edge to the vertex.
addGraph(g)Adds a sub-graph to this vertex. If you provide an existing Graph instance that does not have an id, one will be assigned.
deleteEdge(edge)Deletes an Edge from the Vertex.
getAllEdges(params)
getEdges(params)Gets all Edges where this Vertex is either the source or the target of the Edge. Note that this does *not* retrieve Edges on any Ports associated with this Vertex - for that,
getFullId()Gets the Vertex's id, which, for Nodes and Groups, is just the id property. This method is overridden by Ports.
getGraph(id)Retrieves a sub-graph by id.
getIndegreeCentrality()
getOutdegreeCentrality()
getSourceEdges()Gets all Edges where this Vertex is the source.
getTargetEdges()Gets all Edges where this Vertex is the target.
inspect()Returns a string representation of the Vertex.
isChildOf(v)