avoid-nodes-edge 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +501 -0
- package/dist/chunk-TO34Q3ID.cjs +87 -0
- package/dist/chunk-TO34Q3ID.cjs.map +1 -0
- package/dist/chunk-VPHZVUPR.js +87 -0
- package/dist/chunk-VPHZVUPR.js.map +1 -0
- package/dist/edge.cjs +235 -0
- package/dist/edge.cjs.map +1 -0
- package/dist/edge.d.cts +34 -0
- package/dist/edge.d.ts +34 -0
- package/dist/edge.js +235 -0
- package/dist/edge.js.map +1 -0
- package/dist/index.cjs +558 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +202 -0
- package/dist/index.d.ts +202 -0
- package/dist/index.js +558 -0
- package/dist/index.js.map +1 -0
- package/dist/workers/avoid-router.worker.js +348 -0
- package/dist/workers/avoid-router.worker.js.map +1 -0
- package/package.json +60 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Node, Edge, NodeChange } from '@xyflow/react';
|
|
2
|
+
import * as zustand from 'zustand';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* React Flow integration for libavoid-js: route edges so they avoid nodes (excluding group nodes).
|
|
6
|
+
* Use AvoidRouter.load() once, then AvoidRouter.getInstance().routeAll(nodes, edges).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type AvoidRoute = {
|
|
10
|
+
path: string;
|
|
11
|
+
labelX: number;
|
|
12
|
+
labelY: number;
|
|
13
|
+
};
|
|
14
|
+
type AvoidRouterOptions = {
|
|
15
|
+
shapeBufferDistance?: number;
|
|
16
|
+
idealNudgingDistance?: number;
|
|
17
|
+
edgeRounding?: number;
|
|
18
|
+
diagramGridSize?: number;
|
|
19
|
+
shouldSplitEdgesNearHandle?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type HandlePosition = "left" | "right" | "top" | "bottom";
|
|
22
|
+
/**
|
|
23
|
+
* AvoidRouter: routes diagram edges around nodes using libavoid-js (WASM).
|
|
24
|
+
* Use static load() once, then getInstance().routeAll(nodes, edges).
|
|
25
|
+
*/
|
|
26
|
+
declare class AvoidRouter {
|
|
27
|
+
private static lib;
|
|
28
|
+
private static instance;
|
|
29
|
+
static load(wasmUrl?: string): Promise<boolean>;
|
|
30
|
+
private static loadOnce;
|
|
31
|
+
static getInstance(): AvoidRouter;
|
|
32
|
+
routeAll(nodes: Node[], edges: Edge[], options?: AvoidRouterOptions): Record<string, AvoidRoute>;
|
|
33
|
+
private getNodeBounds;
|
|
34
|
+
private getNodeBoundsAbsolute;
|
|
35
|
+
private getHandlePosition;
|
|
36
|
+
private getHandlePoint;
|
|
37
|
+
private snapToGrid;
|
|
38
|
+
private polylineToPath;
|
|
39
|
+
private cleanup;
|
|
40
|
+
}
|
|
41
|
+
declare function loadAvoidRouter(): Promise<boolean>;
|
|
42
|
+
declare function routeAll(nodes: Node[], edges: Edge[], options?: AvoidRouterOptions): Record<string, AvoidRoute>;
|
|
43
|
+
|
|
44
|
+
interface AvoidRoutesState {
|
|
45
|
+
loaded: boolean;
|
|
46
|
+
routes: Record<string, AvoidRoute>;
|
|
47
|
+
setLoaded: (loaded: boolean) => void;
|
|
48
|
+
setRoutes: (routes: Record<string, AvoidRoute>) => void;
|
|
49
|
+
}
|
|
50
|
+
declare const useAvoidRoutesStore: zustand.UseBoundStore<zustand.StoreApi<AvoidRoutesState>>;
|
|
51
|
+
interface AvoidRouterActions {
|
|
52
|
+
resetRouting: () => void;
|
|
53
|
+
updateRoutesForNodeId: (nodeId: string) => void;
|
|
54
|
+
}
|
|
55
|
+
declare const useAvoidRouterActionsStore: zustand.UseBoundStore<zustand.StoreApi<{
|
|
56
|
+
actions: AvoidRouterActions;
|
|
57
|
+
setActions: (a: AvoidRouterActions) => void;
|
|
58
|
+
}>>;
|
|
59
|
+
|
|
60
|
+
type Position = "left" | "right" | "top" | "bottom";
|
|
61
|
+
interface UseAvoidNodesPathParams {
|
|
62
|
+
id: string;
|
|
63
|
+
sourceX: number;
|
|
64
|
+
sourceY: number;
|
|
65
|
+
targetX: number;
|
|
66
|
+
targetY: number;
|
|
67
|
+
sourcePosition?: Position;
|
|
68
|
+
targetPosition?: Position;
|
|
69
|
+
points?: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
}[];
|
|
73
|
+
borderRadius?: number;
|
|
74
|
+
offset?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns [path, labelX, labelY, wasRouted] for an avoid-nodes edge.
|
|
78
|
+
* Reads from the avoid store (set by the worker); falls back to straight/smooth-step.
|
|
79
|
+
*/
|
|
80
|
+
declare function useAvoidNodesPath(params: UseAvoidNodesPathParams): [path: string, labelX: number, labelY: number, wasRouted: boolean];
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* useAvoidNodesRouterFromWorker
|
|
84
|
+
* ---------------------------------------------------------------------------
|
|
85
|
+
* Routes edges around nodes using a Web Worker running WASM.
|
|
86
|
+
*
|
|
87
|
+
* How it works:
|
|
88
|
+
* 1. On load, sends ALL nodes + edges to the worker ("reset").
|
|
89
|
+
* 2. On drag/resize, sends ONLY that node ("updateNodes") — much faster.
|
|
90
|
+
* 3. On add/remove, does a full reset (graph structure changed).
|
|
91
|
+
* 4. On settings change (spacing, rounding), does a full reset.
|
|
92
|
+
*
|
|
93
|
+
* The worker batches rapid changes (debounce) so dragging doesn't flood it.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
interface UseAvoidNodesRouterOptions {
|
|
97
|
+
shouldSplitEdgesNearHandle?: boolean;
|
|
98
|
+
edgeToEdgeSpacing?: number;
|
|
99
|
+
edgeToNodeSpacing?: number;
|
|
100
|
+
edgeRounding?: number;
|
|
101
|
+
diagramGridSize?: number;
|
|
102
|
+
}
|
|
103
|
+
interface UseAvoidNodesRouterResult {
|
|
104
|
+
updateRoutingOnNodesChange: (changes: NodeChange<Node>[]) => void;
|
|
105
|
+
resetRouting: () => void;
|
|
106
|
+
refreshRouting: () => void;
|
|
107
|
+
updateRoutingForNodeIds: (nodeIds: string[]) => void;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Drop-in replacement for useAvoidNodesRouter — same API, but all heavy
|
|
111
|
+
* routing calculations happen on a separate thread so the UI stays smooth.
|
|
112
|
+
*/
|
|
113
|
+
declare function useAvoidNodesRouterFromWorker(nodes: Node[], edges: Edge[], options?: UseAvoidNodesRouterOptions): UseAvoidNodesRouterResult;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Message types for the avoid-router Web Worker.
|
|
117
|
+
* Main thread posts commands; worker posts back 'loaded' and 'routed'.
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/** Commands the main thread can send to the worker */
|
|
121
|
+
type AvoidRouterWorkerCommand = {
|
|
122
|
+
command: "reset";
|
|
123
|
+
nodes: Node[];
|
|
124
|
+
edges: Edge[];
|
|
125
|
+
options?: AvoidRouterOptions;
|
|
126
|
+
} | {
|
|
127
|
+
command: "change";
|
|
128
|
+
cell: Node | Edge;
|
|
129
|
+
} | {
|
|
130
|
+
command: "remove";
|
|
131
|
+
id: string;
|
|
132
|
+
} | {
|
|
133
|
+
command: "add";
|
|
134
|
+
cell: Node | Edge;
|
|
135
|
+
} | {
|
|
136
|
+
command: "route";
|
|
137
|
+
nodes: Node[];
|
|
138
|
+
edges: Edge[];
|
|
139
|
+
options?: AvoidRouterOptions;
|
|
140
|
+
} | {
|
|
141
|
+
command: "updateNodes";
|
|
142
|
+
nodes: Node[];
|
|
143
|
+
} | {
|
|
144
|
+
command: "close";
|
|
145
|
+
};
|
|
146
|
+
/** Messages the worker sends back to the main thread */
|
|
147
|
+
type AvoidRouterWorkerResponse = {
|
|
148
|
+
command: "loaded";
|
|
149
|
+
success: boolean;
|
|
150
|
+
} | {
|
|
151
|
+
command: "routed";
|
|
152
|
+
routes: Record<string, AvoidRoute>;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
interface UseAvoidWorkerOptions {
|
|
156
|
+
create?: boolean;
|
|
157
|
+
onRouted?: (routes: Record<string, AvoidRoute>) => void;
|
|
158
|
+
onLoaded?: (success: boolean) => void;
|
|
159
|
+
}
|
|
160
|
+
interface UseAvoidWorkerResult {
|
|
161
|
+
workerLoaded: boolean;
|
|
162
|
+
post: (cmd: AvoidRouterWorkerCommand) => void;
|
|
163
|
+
close: () => void;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Creates the avoid-router Web Worker and waits for it to load WASM.
|
|
167
|
+
* WASM loads exclusively in the worker thread — never on the main thread.
|
|
168
|
+
*/
|
|
169
|
+
declare function useAvoidWorker(options?: UseAvoidWorkerOptions): UseAvoidWorkerResult;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Listener for avoid-router Web Worker messages.
|
|
173
|
+
* Syncs "loaded" / "routed" into the avoid store.
|
|
174
|
+
*/
|
|
175
|
+
interface AttachAvoidWorkerListenerOptions {
|
|
176
|
+
onRouted?: (routes: Record<string, {
|
|
177
|
+
path: string;
|
|
178
|
+
labelX: number;
|
|
179
|
+
labelY: number;
|
|
180
|
+
}>) => void;
|
|
181
|
+
onLoaded?: (success: boolean) => void;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Attach a message listener to an avoid-router worker so the app stays in sync.
|
|
185
|
+
* @returns Cleanup function (removeEventListener).
|
|
186
|
+
*/
|
|
187
|
+
declare function attachAvoidWorkerListener(worker: Worker, options?: AttachAvoidWorkerListenerOptions): () => void;
|
|
188
|
+
|
|
189
|
+
/** Log web worker / routing messages in development. */
|
|
190
|
+
declare const DEV_LOG_WEB_WORKER_MESSAGES = false;
|
|
191
|
+
/**
|
|
192
|
+
* Debounce (ms) before routing runs after diagram changes.
|
|
193
|
+
* 10 ms merges drag events into a single update.
|
|
194
|
+
* For larger diagrams (500+ nodes) use ~50-100 ms.
|
|
195
|
+
*/
|
|
196
|
+
declare const DEBOUNCE_ROUTING_MS = 0;
|
|
197
|
+
/** Whether edges start at handle border (true) or center (false). */
|
|
198
|
+
declare const SHOULD_START_EDGE_AT_HANDLE_BORDER = true;
|
|
199
|
+
/** Default border radius (px) for routed path corners. */
|
|
200
|
+
declare const EDGE_BORDER_RADIUS = 0;
|
|
201
|
+
|
|
202
|
+
export { type AttachAvoidWorkerListenerOptions, type AvoidRoute, AvoidRouter, type AvoidRouterActions, type AvoidRouterOptions, type AvoidRouterWorkerCommand, type AvoidRouterWorkerResponse, type AvoidRoutesState, DEBOUNCE_ROUTING_MS, DEV_LOG_WEB_WORKER_MESSAGES, EDGE_BORDER_RADIUS, type HandlePosition, type Position, SHOULD_START_EDGE_AT_HANDLE_BORDER, type UseAvoidNodesPathParams, type UseAvoidNodesRouterOptions, type UseAvoidNodesRouterResult, type UseAvoidWorkerOptions, type UseAvoidWorkerResult, attachAvoidWorkerListener, loadAvoidRouter, routeAll, useAvoidNodesPath, useAvoidNodesRouterFromWorker, useAvoidRouterActionsStore, useAvoidRoutesStore, useAvoidWorker };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Node, Edge, NodeChange } from '@xyflow/react';
|
|
2
|
+
import * as zustand from 'zustand';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* React Flow integration for libavoid-js: route edges so they avoid nodes (excluding group nodes).
|
|
6
|
+
* Use AvoidRouter.load() once, then AvoidRouter.getInstance().routeAll(nodes, edges).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type AvoidRoute = {
|
|
10
|
+
path: string;
|
|
11
|
+
labelX: number;
|
|
12
|
+
labelY: number;
|
|
13
|
+
};
|
|
14
|
+
type AvoidRouterOptions = {
|
|
15
|
+
shapeBufferDistance?: number;
|
|
16
|
+
idealNudgingDistance?: number;
|
|
17
|
+
edgeRounding?: number;
|
|
18
|
+
diagramGridSize?: number;
|
|
19
|
+
shouldSplitEdgesNearHandle?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type HandlePosition = "left" | "right" | "top" | "bottom";
|
|
22
|
+
/**
|
|
23
|
+
* AvoidRouter: routes diagram edges around nodes using libavoid-js (WASM).
|
|
24
|
+
* Use static load() once, then getInstance().routeAll(nodes, edges).
|
|
25
|
+
*/
|
|
26
|
+
declare class AvoidRouter {
|
|
27
|
+
private static lib;
|
|
28
|
+
private static instance;
|
|
29
|
+
static load(wasmUrl?: string): Promise<boolean>;
|
|
30
|
+
private static loadOnce;
|
|
31
|
+
static getInstance(): AvoidRouter;
|
|
32
|
+
routeAll(nodes: Node[], edges: Edge[], options?: AvoidRouterOptions): Record<string, AvoidRoute>;
|
|
33
|
+
private getNodeBounds;
|
|
34
|
+
private getNodeBoundsAbsolute;
|
|
35
|
+
private getHandlePosition;
|
|
36
|
+
private getHandlePoint;
|
|
37
|
+
private snapToGrid;
|
|
38
|
+
private polylineToPath;
|
|
39
|
+
private cleanup;
|
|
40
|
+
}
|
|
41
|
+
declare function loadAvoidRouter(): Promise<boolean>;
|
|
42
|
+
declare function routeAll(nodes: Node[], edges: Edge[], options?: AvoidRouterOptions): Record<string, AvoidRoute>;
|
|
43
|
+
|
|
44
|
+
interface AvoidRoutesState {
|
|
45
|
+
loaded: boolean;
|
|
46
|
+
routes: Record<string, AvoidRoute>;
|
|
47
|
+
setLoaded: (loaded: boolean) => void;
|
|
48
|
+
setRoutes: (routes: Record<string, AvoidRoute>) => void;
|
|
49
|
+
}
|
|
50
|
+
declare const useAvoidRoutesStore: zustand.UseBoundStore<zustand.StoreApi<AvoidRoutesState>>;
|
|
51
|
+
interface AvoidRouterActions {
|
|
52
|
+
resetRouting: () => void;
|
|
53
|
+
updateRoutesForNodeId: (nodeId: string) => void;
|
|
54
|
+
}
|
|
55
|
+
declare const useAvoidRouterActionsStore: zustand.UseBoundStore<zustand.StoreApi<{
|
|
56
|
+
actions: AvoidRouterActions;
|
|
57
|
+
setActions: (a: AvoidRouterActions) => void;
|
|
58
|
+
}>>;
|
|
59
|
+
|
|
60
|
+
type Position = "left" | "right" | "top" | "bottom";
|
|
61
|
+
interface UseAvoidNodesPathParams {
|
|
62
|
+
id: string;
|
|
63
|
+
sourceX: number;
|
|
64
|
+
sourceY: number;
|
|
65
|
+
targetX: number;
|
|
66
|
+
targetY: number;
|
|
67
|
+
sourcePosition?: Position;
|
|
68
|
+
targetPosition?: Position;
|
|
69
|
+
points?: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
}[];
|
|
73
|
+
borderRadius?: number;
|
|
74
|
+
offset?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns [path, labelX, labelY, wasRouted] for an avoid-nodes edge.
|
|
78
|
+
* Reads from the avoid store (set by the worker); falls back to straight/smooth-step.
|
|
79
|
+
*/
|
|
80
|
+
declare function useAvoidNodesPath(params: UseAvoidNodesPathParams): [path: string, labelX: number, labelY: number, wasRouted: boolean];
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* useAvoidNodesRouterFromWorker
|
|
84
|
+
* ---------------------------------------------------------------------------
|
|
85
|
+
* Routes edges around nodes using a Web Worker running WASM.
|
|
86
|
+
*
|
|
87
|
+
* How it works:
|
|
88
|
+
* 1. On load, sends ALL nodes + edges to the worker ("reset").
|
|
89
|
+
* 2. On drag/resize, sends ONLY that node ("updateNodes") — much faster.
|
|
90
|
+
* 3. On add/remove, does a full reset (graph structure changed).
|
|
91
|
+
* 4. On settings change (spacing, rounding), does a full reset.
|
|
92
|
+
*
|
|
93
|
+
* The worker batches rapid changes (debounce) so dragging doesn't flood it.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
interface UseAvoidNodesRouterOptions {
|
|
97
|
+
shouldSplitEdgesNearHandle?: boolean;
|
|
98
|
+
edgeToEdgeSpacing?: number;
|
|
99
|
+
edgeToNodeSpacing?: number;
|
|
100
|
+
edgeRounding?: number;
|
|
101
|
+
diagramGridSize?: number;
|
|
102
|
+
}
|
|
103
|
+
interface UseAvoidNodesRouterResult {
|
|
104
|
+
updateRoutingOnNodesChange: (changes: NodeChange<Node>[]) => void;
|
|
105
|
+
resetRouting: () => void;
|
|
106
|
+
refreshRouting: () => void;
|
|
107
|
+
updateRoutingForNodeIds: (nodeIds: string[]) => void;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Drop-in replacement for useAvoidNodesRouter — same API, but all heavy
|
|
111
|
+
* routing calculations happen on a separate thread so the UI stays smooth.
|
|
112
|
+
*/
|
|
113
|
+
declare function useAvoidNodesRouterFromWorker(nodes: Node[], edges: Edge[], options?: UseAvoidNodesRouterOptions): UseAvoidNodesRouterResult;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Message types for the avoid-router Web Worker.
|
|
117
|
+
* Main thread posts commands; worker posts back 'loaded' and 'routed'.
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/** Commands the main thread can send to the worker */
|
|
121
|
+
type AvoidRouterWorkerCommand = {
|
|
122
|
+
command: "reset";
|
|
123
|
+
nodes: Node[];
|
|
124
|
+
edges: Edge[];
|
|
125
|
+
options?: AvoidRouterOptions;
|
|
126
|
+
} | {
|
|
127
|
+
command: "change";
|
|
128
|
+
cell: Node | Edge;
|
|
129
|
+
} | {
|
|
130
|
+
command: "remove";
|
|
131
|
+
id: string;
|
|
132
|
+
} | {
|
|
133
|
+
command: "add";
|
|
134
|
+
cell: Node | Edge;
|
|
135
|
+
} | {
|
|
136
|
+
command: "route";
|
|
137
|
+
nodes: Node[];
|
|
138
|
+
edges: Edge[];
|
|
139
|
+
options?: AvoidRouterOptions;
|
|
140
|
+
} | {
|
|
141
|
+
command: "updateNodes";
|
|
142
|
+
nodes: Node[];
|
|
143
|
+
} | {
|
|
144
|
+
command: "close";
|
|
145
|
+
};
|
|
146
|
+
/** Messages the worker sends back to the main thread */
|
|
147
|
+
type AvoidRouterWorkerResponse = {
|
|
148
|
+
command: "loaded";
|
|
149
|
+
success: boolean;
|
|
150
|
+
} | {
|
|
151
|
+
command: "routed";
|
|
152
|
+
routes: Record<string, AvoidRoute>;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
interface UseAvoidWorkerOptions {
|
|
156
|
+
create?: boolean;
|
|
157
|
+
onRouted?: (routes: Record<string, AvoidRoute>) => void;
|
|
158
|
+
onLoaded?: (success: boolean) => void;
|
|
159
|
+
}
|
|
160
|
+
interface UseAvoidWorkerResult {
|
|
161
|
+
workerLoaded: boolean;
|
|
162
|
+
post: (cmd: AvoidRouterWorkerCommand) => void;
|
|
163
|
+
close: () => void;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Creates the avoid-router Web Worker and waits for it to load WASM.
|
|
167
|
+
* WASM loads exclusively in the worker thread — never on the main thread.
|
|
168
|
+
*/
|
|
169
|
+
declare function useAvoidWorker(options?: UseAvoidWorkerOptions): UseAvoidWorkerResult;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Listener for avoid-router Web Worker messages.
|
|
173
|
+
* Syncs "loaded" / "routed" into the avoid store.
|
|
174
|
+
*/
|
|
175
|
+
interface AttachAvoidWorkerListenerOptions {
|
|
176
|
+
onRouted?: (routes: Record<string, {
|
|
177
|
+
path: string;
|
|
178
|
+
labelX: number;
|
|
179
|
+
labelY: number;
|
|
180
|
+
}>) => void;
|
|
181
|
+
onLoaded?: (success: boolean) => void;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Attach a message listener to an avoid-router worker so the app stays in sync.
|
|
185
|
+
* @returns Cleanup function (removeEventListener).
|
|
186
|
+
*/
|
|
187
|
+
declare function attachAvoidWorkerListener(worker: Worker, options?: AttachAvoidWorkerListenerOptions): () => void;
|
|
188
|
+
|
|
189
|
+
/** Log web worker / routing messages in development. */
|
|
190
|
+
declare const DEV_LOG_WEB_WORKER_MESSAGES = false;
|
|
191
|
+
/**
|
|
192
|
+
* Debounce (ms) before routing runs after diagram changes.
|
|
193
|
+
* 10 ms merges drag events into a single update.
|
|
194
|
+
* For larger diagrams (500+ nodes) use ~50-100 ms.
|
|
195
|
+
*/
|
|
196
|
+
declare const DEBOUNCE_ROUTING_MS = 0;
|
|
197
|
+
/** Whether edges start at handle border (true) or center (false). */
|
|
198
|
+
declare const SHOULD_START_EDGE_AT_HANDLE_BORDER = true;
|
|
199
|
+
/** Default border radius (px) for routed path corners. */
|
|
200
|
+
declare const EDGE_BORDER_RADIUS = 0;
|
|
201
|
+
|
|
202
|
+
export { type AttachAvoidWorkerListenerOptions, type AvoidRoute, AvoidRouter, type AvoidRouterActions, type AvoidRouterOptions, type AvoidRouterWorkerCommand, type AvoidRouterWorkerResponse, type AvoidRoutesState, DEBOUNCE_ROUTING_MS, DEV_LOG_WEB_WORKER_MESSAGES, EDGE_BORDER_RADIUS, type HandlePosition, type Position, SHOULD_START_EDGE_AT_HANDLE_BORDER, type UseAvoidNodesPathParams, type UseAvoidNodesRouterOptions, type UseAvoidNodesRouterResult, type UseAvoidWorkerOptions, type UseAvoidWorkerResult, attachAvoidWorkerListener, loadAvoidRouter, routeAll, useAvoidNodesPath, useAvoidNodesRouterFromWorker, useAvoidRouterActionsStore, useAvoidRoutesStore, useAvoidWorker };
|