A GraphPartition partitions the bounding box of a graph into rectangles using the graph elements as Obstacles.
Remarks
All Obstacles used during the partitioning are created by IGraphPartitionExtensions. IGraphPartitionExtensions have been registered before using method preparePartition which is called during the initialization of a GraphPartition.
The core partitioning is delegated to an IObstaclePartition that is initialized with these Obstacles.
If the IObstaclePartition is of type IDynamicDecomposition, GraphPartition re-dispatches the decomposition notifications to its extensions.
Type Details
- yfiles module
- router-polyline
- yfiles-umd modules
- layout-area, layout-multipage, layout-orthogonal-compact, layout, router-bus, router-polyline
- Legacy UMD name
- yfiles.router.GraphPartition
See Also
Constructors
Creates a new GraphPartition instance using the given delegate inner obstacle partition.
Parameters
A map of options to pass to the method.
- partition - IObstaclePartition
- the delegate inner obstacle partition
Properties
Gets the bounds of the original rectangular area that is being partitioned.
Gets the delegate inner obstacle partition.
Methods
Adds the given listener to the GraphPartition.
Remarks
Parameters
A map of options to pass to the method.
- listener - IDecompositionListener
- the listener to be added
Implements
Clears the partition data such that the GraphPartition can be reused and initialized with a new configuration.
Remarks
See Also
Creates and returns a new Obstacle using the given bounds and data.
Remarks
Parameters
A map of options to pass to the method.
- bounds - YRectangle
- the bounds of the obstacle
- data - Object
- the additional data that should be associated with the obstacle
Returns
Returns a list of all PartitionCells that intersect or cover the given rectangle by delegating to the corresponding method of the inner partition.
Parameters
A map of options to pass to the method.
- rect - YRectangle
- the rectangular area whose (partially) covered cells will be returned
Returns
- ↪IList<any>
- a list containing (partially) covered PartitionCells
See Also
Implements
Returns all PartitionCells that are completely covered by the bounds of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node for which the covered cells will be returned
Returns
- ↪IList<any>
- a list of PartitionCell instances that are completely covered by the bounds of the given node
Throws
- Exception({ name: 'ArgumentError' })
- if the node is unknown
Returns a list of all PartitionCells that are neighbors of the given cell, i.e., those cells that have a common border segment with the given cell.
Parameters
A map of options to pass to the method.
- cell - PartitionCell
- the cell whose neighbors will be returned
Returns
- ↪IList<any>
- a list of PartitionCells that are neighbors of the given cell
Implements
Returns a list of all YNodes whose bounds intersect or cover the bounds of the given cell.
Parameters
A map of options to pass to the method.
- cell - PartitionCell
- the cell
Returns
- ↪IList<any>
- a list of YNodes that are intersected by the given cell
Returns all Obstacles covering the given PartitionCell by delegating to the corresponding method of the inner partition.
Parameters
A map of options to pass to the method.
- cell - PartitionCell
- the cell whose obstacles will be returned
Returns
- ↪IList<any>
- a list of Obstacles that cover the given cell
See Also
Initializes the GraphPartition with the given graph instance based on the given configuration used by path search algorithms.
Remarks
Before calling this method, any old partitioning information must be cleared.
This initialization method calls preparePartition of all registered extensions. Then, the inner delegate partition is initialized passing all added obstacles as well as the given graph's bounds extended by a small padding.
In the case where the delegate partition is of type IDynamicDecomposition, this GraphPartition will also be added as IDecompositionListener to it.
Parameters
A map of options to pass to the method.
- configuration - PathSearchConfiguration
- the configuration used by path search algorithms
See Also
Re-dispatches the event of the creation of a new PartitionCell to all registered IDecompositionListeners.
Remarks
Parameters
A map of options to pass to the method.
- createdCell - PartitionCell
- the newly created PartitionCell
Implements
Re-dispatches the event of having completed the process of subdivisions of a given PartitionCell to all registered IDecompositionListeners.
Remarks
Parameters
A map of options to pass to the method.
- finalizedCell - PartitionCell
- the cell that has been finalized
Implements
Re-dispatches the event of the subdivision of a given PartitionCell into several sub-cells to all registered IDecompositionListeners.
Remarks
Parameters
A map of options to pass to the method.
- cell - PartitionCell
- the cell that has been subdivided
- subCells - IList<Object>
- the sub-cells resulting from the subdivision of the given PartitionCell
Implements
Re-dispatches the event of having unlocked a previously finalized PartitionCell to all registered IDecompositionListeners.
Remarks
Parameters
A map of options to pass to the method.
- unlockedCell - PartitionCell
- the cell that has been unlocked
Implements
Removes the given listener from the GraphPartition.
Remarks
Parameters
A map of options to pass to the method.
- listener - IDecompositionListener
- the listener to be removed