chevron_right Demos chevron_right Port Alignment
Related demos
Book a live Demo

Live Demo — yFiles in Action

30–45 min | Online | No install required

For Developers, Product Mangers & Executives

  • Interactive graph visualization in real time
  • Integration example
  • Live Q&A and next step recommendations

30–45 minutes | 1:1 or team session | Online (Zoom / Teams)

No install required | We show live code

Book a free live demo

Live Demo — yFiles in Action

30–45 min | Online | No install required

For Developers, Product Mangers & Executives

30–45 minutes | 1:1 or team session | Online (Zoom / Teams)

No install required | We show live code

Book a free live demo

Port Alignment Demo

This demo shows how to implement port alignment in HierarchicalLayout.

The sample data contains edges that belong to different path groups, indicated by the different edge color. The demo code aligns all source and target ports with the edge paths by configuring the sourcePortAlignmentIds and targetPortAlignmentIds properties of the PortData.

As a result, the aligned source and target ports at every node have the same y-coordinate, creating the visual effect in which the edges seem to pass through the node.

Port alignment is particularly useful in graphs where there are paths passing through. It is less restrictive in comparison to port grouping, since the ports of the aligned edges can lie on two opposite sides of a node.

Things to Try