Edge and Port Grouping
Edge grouping and port grouping are two important features that allow you to bundle together a set of edges at their source or target end in the following way:
- For both features, the source/target ports will be at the same location if these ports belong to the same owner node.
- For edge grouping, the paths of edges will share common segments. In other words, edges are routed in a bus-like style.
If edges from an edge group have associated inconsistent, or even contradicting port candidates, then the location of the common port is not guaranteed to obey any of them.



While port grouping is supported by basically all algorithms via the helper stage PortPlacementStage, only the following algorithms provide support for edge grouping:
How to define edge and port grouping
Declaring a grouping of edges at the source or target end is achieved by associating the same object instance (the so-called grouping id) with a set of edges. The IDs are specified via Layout Data properties.
Taking the HierarchicalLayout as an example, the properties are the following:
- HierarchicalLayoutData.sourceGroupIds
- HierarchicalLayoutData.targetGroupIds
- HierarchicalLayoutData.ports.sourcePortGroupIds
- HierarchicalLayoutData.ports.targetPortGroupIds
Examples can be found in the documentation of the linked properties. Furthermore, the Edge Grouping demo application shows how to use these features.