Use the data object for JSON serializable data. For temporary or non-serializable data, use BaseGraph.Class.scratchData.
the data object associated with this graph.
A collection of all edges in the graph.
A collection of all nodes in the graph.
Use the scratch data object for temporary or non-serializable data. For JSON serializable data, use BaseGraph.Class.data.
The scratch data is stored under the @specs-feup/flow namespace.
the scratch data object associated with this graph.
Applies a Graph.Transformation to the graph. May be chained.
The graph after applying the transformation.
Creates a collection from an array of nodes. Given that the array may be empty, passing the NodeType is mandatory.
A collection of the given type with the given nodes.
Creates a collection from an array of edges. Given that the array may be empty, passing the EdgeType is mandatory.
A collection of the given type with the given edges.
Changes the functionality class of the current graph. This is only possible if the data and scratch data are compatible with the new class. To assert that, use BaseGraph.Class.is.
The same graph, wrapped in the new functionality class.
Changes the functionality class of the current graph. Should only be used when it is known (but not statically provable) that the graph is compatible with the new class. If not, an error will be thrown.
It is bad practice to try and catch the error thrown by this function. For such cases, combine BaseGraph.Class.is with BaseGraph.Class.as, or use BaseGraph.Class.switch instead.
The graph, wrapped in the new functionality class.
LaraFlowError if the graph is not compatible with the type. This error should be seen as a logic error and not catched.
Retrieve a specific edge from the graph by its id.
The id of the edge to get.
The edge with the given id, or undefined if no such edge exists.
Retrieve a specific node from the graph by its id.
The id of the node to get.
The node with the given id, or undefined if no such node exists.
Initializes the graph with the information of a builder. This is effectively extends the type of the graph to include the data and scratch data of the builder.
The same graph may simultaneously be of multiple types, as long as the data and scratch data are compatible with the types. The builder methods may overwrite data and scratch data fields with names that collide with its type's fields.
The same graph, with the data and scratch data of the builder. The graph is downcasted to BaseGraph.Class because the builder may overwrite the data and scratch data fields, invalidating the current type.
Sets the id generator to be used when generating edge identifiers. This id generator is only used when creating an edge without specifying an id. In other words, if an id is explicitly provided when creating an edge, it will have precedence over calling the id generator.
When no id generator is set and no id is provided when creating an edge, the id generation will be delegated to cytoscape.
The id generator to use, or undefined to delegate to cytoscape's default id generation.
itself for chaining.
Sets the id generator to be used when generating node identifiers. This id generator is only used when creating a node without specifying an id. In other words, if an id is explicitly provided when creating a node, it will have precedence over calling the id generator.
When no id generator is set and no id is provided when creating a node, the id generation will be delegated to cytoscape.
The id generator to use, or undefined to delegate to cytoscape's default id generation.
itself for chaining.
Checks if the type of the graph is compatible with several types, calling a callback for the first match. See Graph.Case for the syntax of each case.
For a default case, match with BaseGraph, which will always be compatible with any graph type.
Rest
...cases: _Case<BaseGraph.Data, BaseGraph.ScratchData, BaseGraph.Class<BaseGraph.Data, BaseGraph.ScratchData>>[]The cases to match against.
Converts the graph to a string using a Graph.Formatter.
The string representation of the graph.
Tries to change the functionality class of the current graph. If the graph is not compatible with the new class, undefined is returned.
The graph, wrapped in the new functionality class, or undefined if the graph is not compatible with the type.
The class with functionality for the base graph type.