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()Members
No filters for this type
Constants
Ports will keep their exact position specified by their current IPortLocationModelParameter.
Ports will keep their exact position specified by their current IPortLocationModelParameter.
The outcome is the same as manually specifying fixed edge port candidates that use the current side and offset of the IPort.
static
See Also
Developer's Guide
The outcome is the same as manually specifying free edge port candidates that use the current side of the IPort.
static
Ports will be placed in a way that is supported by the IPortLocationModel of their current IPortLocationModelParameter.
Ports will be placed in a way that is supported by the IPortLocationModel of their current IPortLocationModelParameter.
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
Static Methods
Converts the given argument to an enum constant of this enum type.
Converts the given argument to an enum constant of this enum type.
Most notably, this method can convert an enum constant's name into the enum constant itself.
static
Parameters
- value: PortPlacementPolicy
- The value to convert to an enum constant.
Return Value
- PortPlacementPolicy
- The enum constant that corresponds to the given argument.
Returns the name of the given enum constant.
Returns the name of the given enum constant.
static
Parameters
- value: PortPlacementPolicy
- The numeric value of an enum constant.
Return Value
- 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.