Edge Attributes
Visibility
The show
attribute determines if edges are rendered. Hidden edges are not considered for edge routing.
Type: bool.
Level of Detail
The lod-map
attribute can be set to a function mapping zoom levels to discrete level of detail values. The function takes a single float parameter and returns an integer value. See Zoom and Viewport for details on how to use the level of detail to change the appearance of edges on different zoom levels.
Type: Callable | None
Arrow Tips
The start-arrow-tip
and end-arrow-tip
attribute determines if edges are rendered with arrow tips.
Type: ArrowTip | None.
Possible values are:
Arrow | Value | Description |
---|---|---|
No tips | None | Uses a single edge segment connecting start and endpoint. |
Arrow | ArrowTip.ARROW | Show an arrow tip using characters matching the edge-segment-drawing-mode . |
Examples
Label
The label
attribute can be set to render a label on the edge.
Type: str | None.
Example
Style
The style
attribute determines the rich style used to render the edge characters.
Type: Style | None.
Examples
Dash Pattern
The dash-pattern
attribute determines a dash pattern. You can pass a list of integer values to it and the list will repeat an alternating on-off pattern for edges drawn.
Examples
Magnets
The start-magnet
and end-magnet
attributes determine to which side of the node the edge is connected.
Type: Magnet | None
Possible values are:
Magnet | Value | Description |
---|---|---|
Left | Magnet.LEFT | Connect to the left side of the node |
Right | Magnet.RIGHT | Connect to the right side of the node |
Top | Magnet.TOP | Connect to the top side of the node |
Bottom | Magnet.BOTTOM | Connect to the bottom side of the node |
Closest | Magnet.CLOSEST | Connect to the closest magnet position. |
Ports
The start-port
and end-port
attributes determine to which port of the corresponding node the edge is connected to. The port needs to be declared as a property of the node. If set, the start-magnet
and end-magnet
attributes are ignored respectively.
Type: str | None
Edge Routing Mode
The edge-routing-mode
attribute determines how edges are routed from start to end point.
Each edge is represented as a concatenation of one or more edge segments (straight lines).
Type: EdgeRoutingMode | None
Possible values are:
Edge Routing Mode | Value | Description |
---|---|---|
Straight | EdgeRoutingMode.STRAIGHT | Uses a single edge segment connecting start and endpoint. (Default) |
Orthogonal | EdgeRoutingMode.ORTHOGONAL | Uses multiple vertical or horizontal edge segments. |
Example
Edge Segment Drawing Mode
The edge-segment-drawing-mode
attribute determines how individual edge segments (straight lines) are drawn to the terminal.
Possible values are:
Edge Segment Drawing Mode | Value | Description |
---|---|---|
Single character | EdgeSegmentDrawingMode.SINGLE_CHARACTER | Uses a single character to draw the whole edge. (Default) |
Box | EdgeSegmentDrawingMode.BOX | Uses box drawing characters to draw lines. Corners between edge segments are merged. Works only with EdgeRoutingMode.ORTHOGONAL. |
Rounded Box | EdgeSegmentDrawingMode.BOX_ROUNDED | Uses box drawing characters to draw lines. Corners between edge segments are merged using rounded box characters. Works only with EdgeRoutingMode.ORTHOGONAL. |
Heavy Box | EdgeSegmentDrawingMode.BOX_HEAVY | Uses thicker box drawing characters to draw lines. Corners between edge segments are merged. Works only with EdgeRoutingMode.ORTHOGONAL. |
Double Box | EdgeSegmentDrawingMode.BOX_DOUBLE | Uses double line box drawing characters to draw lines. Corners between edge segments are merged. Works only with EdgeRoutingMode.ORTHOGONAL. |
ASCII compatible | EdgeSegmentDrawingMode.ASCII | Uses ASCII characters to draw orthogonal lines. Corners between edge segments are merged with plus signs. Works only with EdgeRoutingMode.ORTHOGONAL. |
Examples