Skip to content
D
Documentation

RoutingOptions

reference
1 min readUpdated

Import it from @grafloria/engine.

Routing options

ts
interface RoutingOptions

Properties

NameTypeDefaultDescription
algorithm?RoutingAlgorithmAlgorithm to use
avoidObstacles?booleanAvoid obstacles
gridSize?numberGrid cell size for grid-based algorithms
obstacleMargin?numberMargin around obstacles
minimizeBends?booleanMinimize bends (for orthogonal)
costs?{ distance?: number; bends?: number; crossings?: number; }Cost weights
maxIterations?numberMaximum iterations for pathfinding
jetty?number. Minimum port-anchor stub: the route must leave the source and enter the target PERPENDICULAR to the port side for at least this many px before the first bend. When set it also replaces the built-in 20px breathing-room offset, and a link with FLOATING (direction- less) anchors derives its exit sides from the relative geometry instead of taking the stub-less midline fallback.
container?GeometryRectangleSoft containment. When both endpoints live in the same group, the renderer passes that group's bounds here; grid routers charge containerPenalty per step OUTSIDE the container, so sibling edges stay within their container when an inside route exists — without making escape impossible when obstacles force it.
containerPenalty?numberExtra cost per grid step outside container. Default: 2 × gridSize.
simplifyPath?booleanSimplify path to reduce waypoint count
simplificationEpsilon?numberSimplification tolerance (epsilon) - higher values = more aggressive

Was this page helpful?

RoutingOptions — Grafloria