BFSLayerer uses a breadth first search for assigning layers to the nodes.
Remarks
The nodes of the first layer can be freely selected (see CORE_NODES_DP_KEY). The nodes that belong to a subsequent layer are determined as follows: Add all yet unassigned nodes to the new layer that are connected to nodes already assigned. As a consequence, all connected nodes will be at most one layer apart. Also, edges between nodes that belong to the same layer are possible.
Type Details
- yfiles module
- layout-hierarchic
- yfiles-umd modules
- layout-familytree, layout-hierarchic, layout-radial, layout
- Legacy UMD name
- yfiles.hierarchic.BFSLayerer
See Also
Constructors
Creates an instance of BFSLayerer.
Methods
Assigns all nodes of the graph to layers and adds them to the ILayers instance.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layers - ILayers
- the ILayers instance that will be filled with the results of the calculation
- ldp - ILayoutDataProvider
- the ILayoutDataProvider used for query information about the nodes and edges
See Also
Implements
Constants
A data provider key for identifying the core nodes of the BFS layering.
Remarks
The IDataProvider registered with this key should provide boolean values for the nodes of the graph. The boolean value determines whether or not a node is to be placed in the first layer. If there are no nodes marked as core nodes, then nodes with in-degree
0
are considered to be the core nodes.Domain | YNode | the nodes of the input graph |
Values | boolean | true if the node should be placed at the first layer, false otherwise |