From ae669564eaf242a63af96d93fdb29f6424cc3197 Mon Sep 17 00:00:00 2001 From: coyoteecd Date: Thu, 21 Sep 2023 17:05:04 +0300 Subject: [PATCH] types: expose fallbackRouter in ManhattanRouterArguments --- docs/src/joint/api/routers/manhattan.html | 5 +++++ types/joint.d.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/docs/src/joint/api/routers/manhattan.html b/docs/src/joint/api/routers/manhattan.html index ffd30612b..8dc72f073 100644 --- a/docs/src/joint/api/routers/manhattan.html +++ b/docs/src/joint/api/routers/manhattan.html @@ -51,6 +51,11 @@ (point) => boolean A function that determines whether a given point is an obstacle or not. If used, the padding, excludeEnds and excludeTypes options are ignored. + + fallbackRouter + (vertices, options, linkView) => Array<g.Point> + A function that is called when the routing fails. Use this in situations where you need to retry routing with more relaxed options e.g. no start/endDirections constraints. The default fallbackRouter is an orthogonal router. +

Example:

diff --git a/types/joint.d.ts b/types/joint.d.ts index a0c0d377e..300167c76 100644 --- a/types/joint.d.ts +++ b/types/joint.d.ts @@ -3463,6 +3463,7 @@ export namespace routers { startDirections?: dia.OrthogonalDirection[]; endDirections?: dia.OrthogonalDirection[]; isPointObstacle?: (point: dia.Point) => boolean; + fallbackRouter: (vertices: dia.Point[], opts?: ManhattanRouterArguments, linkView?: dia.LinkView) => dia.Point[]; } interface OrthogonalRouterArguments {