Class TikZEdgeRouter
-
- All Implemented Interfaces:
public class TikZEdgeRouterRoutes edges around nodes to achieve a planar graph layout. This is a general-purpose edge routing algorithm for queueing network diagrams. It handles: - Forward edges: routes around any intermediate nodes - Backward edges (feedback loops): routes around the entire network - Self-loops: routes above/below the node - Vertical edges: routes with horizontal offset - Multiple edges to same target: staggers entry points The algorithm ensures a planar layout where edges don't cross nodes and parallel edges are visually separated.
-
-
Constructor Summary
Constructors Constructor Description TikZEdgeRouter(Map<Node, Array<double>> positions, TikZOptions options)
-
Method Summary
Modifier and Type Method Description List<Array<double>>computeWaypoints(Node from, Node to, List<Node> allNodes)Computes waypoints for an edge to avoid overlapping nodes. booleanisSelfLoop(Node from, Node to)Checks if this edge is a self-loop. static StringrenderRoutedEdge(String fromId, String toId, String fromAnchor, String toAnchor, List<Array<double>> waypoints, double prob, TikZOptions options)Generates TikZ code for a routed edge with waypoints. -
-
Constructor Detail
-
TikZEdgeRouter
TikZEdgeRouter(Map<Node, Array<double>> positions, TikZOptions options)
-
-
Method Detail
-
computeWaypoints
List<Array<double>> computeWaypoints(Node from, Node to, List<Node> allNodes)
Computes waypoints for an edge to avoid overlapping nodes. Handles forward edges, backward edges, self-loops, and vertical edges.
- Parameters:
from- Source nodeto- Target nodeallNodes- All nodes in the network- Returns:
List of waypoints (x, y pairs). Empty if straight line is OK.
-
isSelfLoop
boolean isSelfLoop(Node from, Node to)
Checks if this edge is a self-loop.
-
renderRoutedEdge
static String renderRoutedEdge(String fromId, String toId, String fromAnchor, String toAnchor, List<Array<double>> waypoints, double prob, TikZOptions options)
Generates TikZ code for a routed edge with waypoints.
-
-
-
-