Adds an edge to the graph.
Optional
idFunction: IdFunctionOptional
connectableFilterFunction: FunctionAdds a Group to the Graph.
Optional
idFunction: IdFunctionAdds a list of Nodes to the Graph
List of data objects, one for each Node to be added.
Optional
idFunction: IdFunctionOptional function to use to retrieve ID from backing data. Defaults to retrieving id
from data object.
Deletes an Edge.
Edge, or ID of Edge, to delete.
Deletes a Group
Either a Group, or a Group id.
Optional
removeMembers: booleanIf true, also remove all the Nodes/Groups that are members of the Group.
Finds the shortest path from source to target, using the Djikstra algorithm.
Source Node or Node ID.
Target Node or Node ID.
Optional
strict: booleanDefaults to true. Sets whether or not paths are searched strictly by the given source/target. If, for instance, you supply a node as the source, but there are only edges connected to ports on that node, by default these edges will be ignored. Switching strict
to false will mean these edges are considered.
Optional
nodeFilter: FunctionOptional function that is given each Node's backing data and asked to return true or false - true means include the Node, false means exclude it.
Optional
edgeFilter: FunctionOptional function that is given each Edge's backing data and asked to return true or false - true means include the Edge, false means exclude it.
A ShortestPathResult object.
Returns the betweenness centrality of the given node.
Vertex, or Vertex ID, to retrieve betweenness centrality for.
Vertex's "betweenness" centrality.
Returns the Closeness centrality of the given vertex. This is the inverse of the vertex's farness.
Vertex, or Vertex ID, to retrieve closeness for.
Node's "closeness".
Calculates "clusters" of nodes (and groups), where a 'cluster' is a set of Nodes/Groups that are connected. Direction of connections is not taken into account. Nodes that are children of Groups are included in all cluster calculations, which might cause some weird situations, but this functionality is mostly intended just for Nodes anyway.
An array of arrays, each entry being a list of nodes in the cluster.
Finds the distance between source and target.
Source vertex or vertex ID.
Target vertex or vertex ID.
Optional
strict: booleanDefauls to true. Sets whether or not paths are searched strictly by the given source/target. If, for instance, you supply a node as the source, but there are only edges connected to ports on that node, by default these edges will be ignored. Switching strict
to false will mean these edges are considered.
Distance from the source to the target.
For some given node, get a subset of edges that match the given filter function.
Optional
params: { Method parameters
Optional
filter?: ((e: Edge) => boolean)Optional edge filter.
Optional
node?: string | VertexOptional
source?: booleanIf true, only match edges for which this node is the source.
Optional
target?: booleanIf true, only match edges for which this node is the target.
Returns the farness centrality of the given node, ie. the sum of its distance from all other nodes, where the distance from one vertex to another is given by the associated cost of the Edge joining the two nodes.
Vertex, or Vertex ID, to retrieve farness for.
Vertex's "farness".
Returns the indegree centrality of the given vertex (number of connections entering the vertex)
Vertex, or Vertex ID, to retrieve indegree centrality for.
Vertex's indegree centrality.
Returns the outdegree centrality of the given vertex (number of connections exiting the vertex)
Vertex, or Vertex ID, to retrieve outdegree centrality for.
Vertex's indegree centrality.
Gets the type for some data, by running it through the current typeFunction.
Object to get type from.
The calculated type for the given object.
Looks up a vertex identified by the port id, which is in full port id (vertexId.portId) format, returning null if nothing found. (Note that we show full port id format as vertexId.portId, but the '.' is just the default portSeparator; it is possible to change that to some other character)
ID of the port to find a vertex for.
Sets whether or not Nodes are Graphs themselves, and can have child Nodes. If you enable this then you cannot use slashes (/) in your Node ids, as they will be treated as components of a path to a Node in a nested Graph.
True to enable, false to disable.
A directed/undirected graph. Each instance of JsPlumb has a Graph at its core.