Skip to content

@eightkk/vue-weave / core / isGraphRouteValid

Function: isGraphRouteValid() ​

isGraphRouteValid(layout, nodes, edge): boolean

Defined in: src/core/graphGeometry.ts:94

Whether the routing policy 'preserve' keeps the path of an edge in a layout. The path must exist and must have been drawn by the layout, not rerouted by the core because a node moved or was resized; the edge must have no points (explicit waypoints always win); and both ends must fit the current boxes: at the anchor of a named port, otherwise on the box border. When the layout has route metadata for the edge (layout.routes), its ports must equal the edge's, its sides must match the ports or the borders its ends lie on, its points must be finite, and the path must start and end at its start and end. Without metadata the ends are read from the path. Never throws; a path it cannot read is not kept.

Parameters ​

layout ​

GraphLayout

nodes ​

ReadonlyMap<string, IdentifiedNode>

edge ​

GraphEdge

Returns ​

boolean

Released under the MIT License.