English
@eightkk/vue-weave / core / routeGraphEdges
Function: routeGraphEdges()
routeGraphEdges(
layout,edges,nodes,options?):GraphLayout
Defined in: src/core/graphRouting.ts:591
Reroutes the edges of a finished layout (after positions and sizes) in an edge style: the style option, or the edge's own edgeStyle. straight draws straight lines between the nodes, clipped on the line between the box centres to the box border, or to the outline of a diamond, ellipse or hexagon node; orthogonal draws axis-aligned segments that leave and enter along the layout direction and keeps a long-edge bypass lane the layout already drew between the current boxes. Named ports keep their anchors and sides. An edge with points goes through its waypoints in every style, smoothly in curve. With curve, edges without waypoints keep their paths, so the result is the input layout when no edge has waypoints, a style of its own or (with parallelSpacing) a parallel edge. With parallelSpacing, parallel edges are spread apart (see GraphEdgeRouteOptions). With policy: 'preserve' every valid path from the layout is kept, whatever the style, and is not spread. Route metadata (layout.routes) is carried over when the layout has it, with the entries of redrawn edges replaced. Throws Error for an unknown endpoint, RangeError for a non-finite waypoint, an unknown style (of the options or of an edge), direction or policy, a bad corner radius or a parallel spacing that is not a positive finite number. Boxes are kept; width and height grow to include the routes. With avoidNodes, orthogonal edges without waypoints (self-loops excepted) are routed around every box of the layout with findOrthogonalRoute, and a bypass lane is kept only while it crosses no other box; an edge without such a route keeps the plain orthogonal route. A bad avoidNodes value throws RangeError.
Parameters
layout
edges
readonly GraphEdge<unknown>[]
nodes
ReadonlyMap<string, IdentifiedNode>