This class provides helper methods to convert between buses given by complete subgraphs and buses represented by specific hub nodes.
Remarks
In a representation by means of hubs, each connected subgraph induced by hubs establishes a bus. All regular nodes (non-hubs) which are connected to hubs of the same component are end-nodes of the same bus. In other words, nodes which are reachable on paths consisting of only hubs belong to the same bus. Of course, a node can be an end-node of more than one bus.
Since a bus models a group of nodes in which every node is connected to every other node, it can be represented as a complete subgraph of these nodes. To distinguish buses in this representation, each edge must be associated with a unique ID which identifies the bus to which it is associated. This is the representation expected by BusRouter.
Type Details
- yfiles module
- router-bus
- yfiles-umd modules
- router-bus, layout
- Legacy UMD name
- yfiles.router.BusRepresentations
See Also
Constants
A data acceptor key to transfer a user-defined object from each original edge to the respective newly created edge.
Remarks
Domain | Edge | |
Values | Object | the user-defined object that is associated with an edge and automatically transferred to newly created edges |
A data acceptor key to transfer a user-defined object from each original edge to the respective newly created edge.
Remarks
Domain | Edge | |
Values | Object | the user-defined object that is associated with an edge and automatically transferred to newly created edges |
Static Methods
replaceHubsBySubgraph
(graph: LayoutGraph, hubMarker: IDataProvider, descriptorAcceptor: IDataAcceptor) : EdgeListChanges the representation of buses from hubs to complete subgraphs.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph of the bus
- hubMarker - IDataProvider
- a IDataProvider that marks hub nodes
Domain YNode Values boolean true
if a node is a hub,false
otherwise - descriptorAcceptor - IDataAcceptor
- a IDataAcceptor for storing the created bus descriptors
Domain Edge the edges after transforming the graph Values BusRouterBusDescriptor the algorithm uses this to store the created bus descriptors
Returns
- ↪EdgeList
- a list of the created edges
See Also
replaceHubsBySubgraph
(graph: LayoutGraph, hubEdgesLists: EdgeList[], hubMarker: IDataProvider, fixedMarker: IDataProvider, descriptorAcceptor: IDataAcceptor) : EdgeListChanges the representation of buses from hubs to complete subgraphs by creating new edges between regular nodes and removing the hubs.
Remarks
This method respects multiple connections of nodes and creates appropriate BusRouterBusDescriptors consisting of the bus ID as well as source and target group IDs.
The path of each new edge follows the route defined by the component of the hubs. If the subgraph of hubs is not a tree, these paths are ambiguous. In this case, an arbitrary tree is computed from the hub's subgraph which defines all the paths.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph of the bus
- hubEdgesLists - EdgeList[]
- an array of EdgeLists each containing the edges of a bus
- hubMarker - IDataProvider
- a IDataProvider that marks hub nodes
Domain YNode Values boolean true
if a node is a hub,false
otherwise - fixedMarker - IDataProvider
- a IDataProvider that marks fixed edges
Domain Edge Values boolean true
if an edge is fixed,false
otherwise - descriptorAcceptor - IDataAcceptor
- a IDataAcceptor for storing the created bus descriptors
Domain Edge the edges after transforming the graph Values BusRouterBusDescriptor the algorithm uses this to store the created bus descriptors
Returns
- ↪EdgeList
- a list of the created edges
See Also
replaceSubgraphByHubs
(graph: LayoutGraph, edgeCursor: IEdgeCursor, descriptorProvider: IDataProvider, busIDAcceptor: IDataAcceptor)Changes the representation of buses from complete subgraphs to hubs by replacing intersection points by hubs.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph where each bus is represented by a complete subgraph of the corresponding nodes
- edgeCursor - IEdgeCursor
- an IEdgeCursor of the regular edges
- descriptorProvider - IDataProvider
- a IDataProvider that provides a BusRouterBusDescriptor for each edge
Domain Edge Values BusRouterBusDescriptor the descriptor associated with an edge - busIDAcceptor - IDataAcceptor
- an optional IDataAcceptor that stores the bus ID for each new edge
Domain Edge Values Object the bus ID for each new edge
Throws
- Exception({ name: 'InvalidOperationError' })
- if the path of an edge is not orthogonal or if some paths form a cycle
See Also
Calculates for every bus represented by hubs a list of all of its edges.
Parameters
A map of options to pass to the method.
- graph - Graph
- the graph where buses are represented by means of hubs
- hubMarker - IDataProvider
- a IDataProvider which marks hub nodes
Domain YNode Values boolean true
if the node is a hub,false
otherwise