Use PortCandidateSet
Start here

# Hierarchic Layout with PortCandidateSet

This demo shows how to use a PortCandidateSet for the Hierarchic Layout to define the port locations for a node as well as control how many edges can be connected to each port.

For the turquoise node, a PortCandidateSet is used that contains four port candidates, one for each side of the node.

Each PortCandidate only allows for one connecting edge, hence the four incoming edges are distributed to the four port candidates.

Click the button in the toolbar to toggle between Hierarchic Layout with and without a configured port candidate set.

### Code Snippet

You can copy the code snippet to configure the layout from GitHub.

### Documentation

See the Restricting Port Locations section in the Developer's Guide for an in-depth discussion of the relevant concepts.