Class PortPositionExtensions
Extension methods for PortPosition.
public static class PortPositionExtensions
- Inheritance
-
PortPositionExtensions
- Inherited Members
Methods
ToIncomingArrowAngle(PortPosition)
Gets the arrow angle in radians for an edge entering a port from the given side. This follows the GoJS convention where the angle represents the direction the arrow points.
public static double ToIncomingArrowAngle(this PortPosition position)
Parameters
positionPortPositionThe port position (side of node where port is located).
Returns
- double
The angle in radians:
Remarks
This method is designed for marker/arrowhead direction calculation. The arrow points in the direction the edge is traveling when it reaches the target port.
For a left-to-right flow (source on right side of node A, target on left side of node B), the target port position is Left, so the arrow should point right (angle = 0) to indicate the edge is entering from the left.
This follows industry patterns from GoJS (getLinkDirection), React Flow (handleDirections), and mxGraph (DIRECTION_MASK).
ToOutgoingAngle(PortPosition)
Gets the outgoing direction angle in radians for an edge leaving from the given port side.
public static double ToOutgoingAngle(this PortPosition position)
Parameters
positionPortPositionThe port position (side of node where port is located).
Returns
- double
The angle in radians representing the initial direction of an outgoing edge.