Skip to main content

Home > @jsplumbtoolkit/core > Node

Node class#

Signature:

export declare class Node extends Vertex 

Extends: Vertex

Constructors#

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

Properties#

PropertyModifiersTypeDescription
groupGroup
objectTypestring
objectTypestaticstring
portMapDictionary<Port>
portsArray<Port>

Methods#

MethodModifiersDescription
addPort(data, idFunction)Adds a Port to the Node.
getAllEdges(params)Gets all of the Edges connected to this Node, both on the Node itself and on all of its Ports.
getAllSourceEdges()Gets all of the Edges connected to this Node, both on the Node itself and on all of its Ports, where this node/port is the source of edge
getAllTargetEdges()Gets all of the Edges connected to this Node, both on the Node itself and on all of its Ports, where this node/port is the target of edge
getDirectEdges(params)Gets all Edges directly connected to this Vertex, ie. not to one of the Ports on the Vertex. This is an alias for getEdges.
getDirectSourceEdges()Gets all Edges directly connected to this Vertex, ie. not to one of the Ports on the Vertex, where this Vertex is the source. This is an alias for getSourceEdges.
getDirectTargetEdges()Gets all Edges directly connected to this Vertex, ie. not to one of the Ports on the Vertex, where this Vertex is the target. This is an alias for getTargetEdges.
getIndegreeCentrality()Gets this Node's "indegree" centrality; a measure of how many other Nodes are connected to this Node as the target of some Edge.
getInternalEdge(source, target)Gets an "internal" Edge from one Port to another.
getOutdegreeCentrality()Gets this Node's "outdegree" centrality; a measure of how many other Nodes this Node is connected to as the source of some Edge.
getPort(portId)Gets the Port with the given id, null if nothing found.
getPortEdges(params)Gets all Edges that are connected to Ports on this Node, not directly to the Node itself.
getPorts()Gets all Ports associated with this Node.
getPortSourceEdges()Gets all Edges that are connected to Ports on this Node, not directly to the Node itself, where the Port on this Node is the source of the edge.
getPortTargetEdges()Gets all Edges that are connected to Ports on this Node, not directly to the Node itself, where the Port on this Node is the target of the edge.
removePort(port)Removes the given Port.
renamePort(port, newId)
setDefaultInternalCost(cost)Sets the default cost of travelling from one Port to another inside some Node. When a Node is created, this value is set to 1.
setInternalEdge(source, target, cost, directed)Sets the cost and directedness of some internal Edge.
setPort(id, data)Sets the underlying data for the Port with the given id. If the Port does not yet exist, it is created.