Defines how a layout algorithm should place ports.
Remarks
This policy only has an effect on layout algorithms that support EdgePortCandidates or NodePortCandidates, which are used to enforce this policy. Layout algorithms that do not may produce edge routes that violate this policy. Also, if nodes/edges already have manually specified PortCandidates, they override this policy.
Examples
Used with LayoutExecutor's portPlacementPolicies.Prefer the current port locations
const layout = new HierarchicalLayout()
await new LayoutExecutor({
graphComponent: graphComponent,
layout: layout,
portPlacementPolicies: PortPlacementPolicy.KEEP_SIDE,
}).start()
Type Details
- yFiles module
- view-layout-bridge
Constants
Ports will keep their exact position specified by their current IPortLocationModelParameter.
Remarks
The outcome is the same as manually specifying fixed edge port candidates that use the current side and offset of the IPort.
Ports will be placed at the same side of their owner they currently occupy.
Remarks
The outcome is the same as manually specifying free edge port candidates that use the current side of the IPort.
Ports will be placed in a way that is supported by the IPortLocationModel of their current IPortLocationModelParameter.
Remarks
An IPortLocationModel defines a compilation of valid locations for ports, and this policy ensures that the layout algorithm chooses one of them (if it supports EdgePortCandidates and NodePortCandidates).
Static Methods
Converts the given argument to an enum constant of this enum type.
Remarks
Most notably, this method can convert an enum constant's name into the enum constant itself.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- value - PortPlacementPolicy
- The value to convert to an enum constant.
Returns
- ↪PortPlacementPolicy
- The enum constant that corresponds to the given argument.
Returns the name of the given enum constant.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- value - PortPlacementPolicy
- The numeric value of an enum constant.
Returns
- ↪string
- The name of the enum constant.
Throws
- Exception({ name: 'Error' })
- If this type is a flags enums, and the provided value doesn't correspond to a single enum constant, or if this enum type contains no constant of the given numeric value.