@rxflow/manhattan 0.0.2-alpha.8 → 0.0.2

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.
Files changed (157) hide show
  1. package/README.md +214 -10
  2. package/esm/getManHattanPath.js +92 -69
  3. package/esm/obstacle/ObstacleMap.js +218 -99
  4. package/esm/obstacle/QuadTree.js +488 -0
  5. package/esm/options/resolver.js +147 -18
  6. package/esm/pathfinder/PathCache.js +278 -0
  7. package/esm/pathfinder/findRoute.js +98 -44
  8. package/esm/pathfinder/index.js +2 -1
  9. package/esm/svg/pathConverter.js +170 -1
  10. package/esm/utils/AdaptiveStepCalculator.js +252 -0
  11. package/esm/utils/ErrorRecovery.js +499 -0
  12. package/esm/utils/GlobalGrid.js +259 -0
  13. package/esm/utils/PerformanceMonitor.js +360 -0
  14. package/esm/utils/getAnchorPoints.js +0 -4
  15. package/esm/utils/grid.js +18 -13
  16. package/esm/utils/heuristics.js +144 -0
  17. package/esm/utils/index.js +7 -1
  18. package/esm/utils/pathProcessing.js +270 -0
  19. package/esm/utils/pathValidation.js +0 -1
  20. package/esm/utils/rect.js +11 -4
  21. package/esm/utils/route.js +18 -2
  22. package/package.json +10 -2
  23. package/cjs/geometry/Line.d.ts +0 -21
  24. package/cjs/geometry/Line.d.ts.map +0 -1
  25. package/cjs/geometry/Line.js +0 -88
  26. package/cjs/geometry/Point.d.ts +0 -49
  27. package/cjs/geometry/Point.d.ts.map +0 -1
  28. package/cjs/geometry/Point.js +0 -94
  29. package/cjs/geometry/Rectangle.d.ts +0 -41
  30. package/cjs/geometry/Rectangle.d.ts.map +0 -1
  31. package/cjs/geometry/Rectangle.js +0 -65
  32. package/cjs/geometry/collision.d.ts +0 -15
  33. package/cjs/geometry/collision.d.ts.map +0 -1
  34. package/cjs/geometry/collision.js +0 -81
  35. package/cjs/geometry/index.d.ts +0 -5
  36. package/cjs/geometry/index.d.ts.map +0 -1
  37. package/cjs/geometry/index.js +0 -45
  38. package/cjs/getManHattanPath.d.ts +0 -53
  39. package/cjs/getManHattanPath.d.ts.map +0 -1
  40. package/cjs/getManHattanPath.js +0 -418
  41. package/cjs/index.d.ts +0 -16
  42. package/cjs/index.d.ts.map +0 -1
  43. package/cjs/index.js +0 -117
  44. package/cjs/obstacle/ObstacleMap.d.ts +0 -34
  45. package/cjs/obstacle/ObstacleMap.d.ts.map +0 -1
  46. package/cjs/obstacle/ObstacleMap.js +0 -223
  47. package/cjs/obstacle/index.d.ts +0 -2
  48. package/cjs/obstacle/index.d.ts.map +0 -1
  49. package/cjs/obstacle/index.js +0 -12
  50. package/cjs/options/defaults.d.ts +0 -16
  51. package/cjs/options/defaults.d.ts.map +0 -1
  52. package/cjs/options/defaults.js +0 -39
  53. package/cjs/options/index.d.ts +0 -4
  54. package/cjs/options/index.d.ts.map +0 -1
  55. package/cjs/options/index.js +0 -38
  56. package/cjs/options/resolver.d.ts +0 -10
  57. package/cjs/options/resolver.d.ts.map +0 -1
  58. package/cjs/options/resolver.js +0 -120
  59. package/cjs/options/types.d.ts +0 -169
  60. package/cjs/options/types.d.ts.map +0 -1
  61. package/cjs/options/types.js +0 -5
  62. package/cjs/pathfinder/SortedSet.d.ts +0 -35
  63. package/cjs/pathfinder/SortedSet.d.ts.map +0 -1
  64. package/cjs/pathfinder/SortedSet.js +0 -95
  65. package/cjs/pathfinder/findRoute.d.ts +0 -8
  66. package/cjs/pathfinder/findRoute.d.ts.map +0 -1
  67. package/cjs/pathfinder/findRoute.js +0 -330
  68. package/cjs/pathfinder/index.d.ts +0 -3
  69. package/cjs/pathfinder/index.d.ts.map +0 -1
  70. package/cjs/pathfinder/index.js +0 -19
  71. package/cjs/svg/index.d.ts +0 -3
  72. package/cjs/svg/index.d.ts.map +0 -1
  73. package/cjs/svg/index.js +0 -31
  74. package/cjs/svg/pathConverter.d.ts +0 -10
  75. package/cjs/svg/pathConverter.d.ts.map +0 -1
  76. package/cjs/svg/pathConverter.js +0 -116
  77. package/cjs/svg/pathParser.d.ts +0 -11
  78. package/cjs/svg/pathParser.d.ts.map +0 -1
  79. package/cjs/svg/pathParser.js +0 -76
  80. package/cjs/utils/direction.d.ts +0 -24
  81. package/cjs/utils/direction.d.ts.map +0 -1
  82. package/cjs/utils/direction.js +0 -54
  83. package/cjs/utils/getAnchorPoints.d.ts +0 -15
  84. package/cjs/utils/getAnchorPoints.d.ts.map +0 -1
  85. package/cjs/utils/getAnchorPoints.js +0 -75
  86. package/cjs/utils/grid.d.ts +0 -27
  87. package/cjs/utils/grid.d.ts.map +0 -1
  88. package/cjs/utils/grid.js +0 -66
  89. package/cjs/utils/index.d.ts +0 -8
  90. package/cjs/utils/index.d.ts.map +0 -1
  91. package/cjs/utils/index.js +0 -82
  92. package/cjs/utils/node.d.ts +0 -27
  93. package/cjs/utils/node.d.ts.map +0 -1
  94. package/cjs/utils/node.js +0 -36
  95. package/cjs/utils/pathValidation.d.ts +0 -11
  96. package/cjs/utils/pathValidation.d.ts.map +0 -1
  97. package/cjs/utils/pathValidation.js +0 -130
  98. package/cjs/utils/rect.d.ts +0 -9
  99. package/cjs/utils/rect.d.ts.map +0 -1
  100. package/cjs/utils/rect.js +0 -103
  101. package/cjs/utils/route.d.ts +0 -19
  102. package/cjs/utils/route.d.ts.map +0 -1
  103. package/cjs/utils/route.js +0 -76
  104. package/esm/geometry/Line.d.ts +0 -21
  105. package/esm/geometry/Line.d.ts.map +0 -1
  106. package/esm/geometry/Point.d.ts +0 -49
  107. package/esm/geometry/Point.d.ts.map +0 -1
  108. package/esm/geometry/Rectangle.d.ts +0 -41
  109. package/esm/geometry/Rectangle.d.ts.map +0 -1
  110. package/esm/geometry/collision.d.ts +0 -15
  111. package/esm/geometry/collision.d.ts.map +0 -1
  112. package/esm/geometry/index.d.ts +0 -5
  113. package/esm/geometry/index.d.ts.map +0 -1
  114. package/esm/getManHattanPath.d.ts +0 -53
  115. package/esm/getManHattanPath.d.ts.map +0 -1
  116. package/esm/index.d.ts +0 -16
  117. package/esm/index.d.ts.map +0 -1
  118. package/esm/obstacle/ObstacleMap.d.ts +0 -34
  119. package/esm/obstacle/ObstacleMap.d.ts.map +0 -1
  120. package/esm/obstacle/index.d.ts +0 -2
  121. package/esm/obstacle/index.d.ts.map +0 -1
  122. package/esm/options/defaults.d.ts +0 -16
  123. package/esm/options/defaults.d.ts.map +0 -1
  124. package/esm/options/index.d.ts +0 -4
  125. package/esm/options/index.d.ts.map +0 -1
  126. package/esm/options/resolver.d.ts +0 -10
  127. package/esm/options/resolver.d.ts.map +0 -1
  128. package/esm/options/types.d.ts +0 -169
  129. package/esm/options/types.d.ts.map +0 -1
  130. package/esm/pathfinder/SortedSet.d.ts +0 -35
  131. package/esm/pathfinder/SortedSet.d.ts.map +0 -1
  132. package/esm/pathfinder/findRoute.d.ts +0 -8
  133. package/esm/pathfinder/findRoute.d.ts.map +0 -1
  134. package/esm/pathfinder/index.d.ts +0 -3
  135. package/esm/pathfinder/index.d.ts.map +0 -1
  136. package/esm/svg/index.d.ts +0 -3
  137. package/esm/svg/index.d.ts.map +0 -1
  138. package/esm/svg/pathConverter.d.ts +0 -10
  139. package/esm/svg/pathConverter.d.ts.map +0 -1
  140. package/esm/svg/pathParser.d.ts +0 -11
  141. package/esm/svg/pathParser.d.ts.map +0 -1
  142. package/esm/utils/direction.d.ts +0 -24
  143. package/esm/utils/direction.d.ts.map +0 -1
  144. package/esm/utils/getAnchorPoints.d.ts +0 -15
  145. package/esm/utils/getAnchorPoints.d.ts.map +0 -1
  146. package/esm/utils/grid.d.ts +0 -27
  147. package/esm/utils/grid.d.ts.map +0 -1
  148. package/esm/utils/index.d.ts +0 -8
  149. package/esm/utils/index.d.ts.map +0 -1
  150. package/esm/utils/node.d.ts +0 -27
  151. package/esm/utils/node.d.ts.map +0 -1
  152. package/esm/utils/pathValidation.d.ts +0 -11
  153. package/esm/utils/pathValidation.d.ts.map +0 -1
  154. package/esm/utils/rect.d.ts +0 -9
  155. package/esm/utils/rect.d.ts.map +0 -1
  156. package/esm/utils/route.d.ts +0 -19
  157. package/esm/utils/route.d.ts.map +0 -1
@@ -1,10 +0,0 @@
1
- import type { ManhattanRouterOptions, ResolvedOptions } from './types';
2
- /**
3
- * Normalize angle to 0-360 range
4
- */
5
- export declare function normalizeAngle(angle: number): number;
6
- /**
7
- * Resolve options by merging user options with defaults
8
- */
9
- export declare function resolveOptions(options?: ManhattanRouterOptions): ResolvedOptions;
10
- //# sourceMappingURL=resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/options/resolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAetE;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAiEpF"}
@@ -1,169 +0,0 @@
1
- import { Point } from '../geometry';
2
- /**
3
- * Direction type for routing
4
- */
5
- export type Direction = 'top' | 'right' | 'bottom' | 'left';
6
- /**
7
- * ReactFlow internal node structure
8
- * Based on ReactFlow's InternalNodeBase type
9
- */
10
- export interface InternalNode {
11
- id: string;
12
- position: {
13
- x: number;
14
- y: number;
15
- };
16
- internals: {
17
- positionAbsolute: {
18
- x: number;
19
- y: number;
20
- };
21
- };
22
- measured?: {
23
- width?: number;
24
- height?: number;
25
- };
26
- width?: number;
27
- height?: number;
28
- initialWidth?: number;
29
- initialHeight?: number;
30
- type?: string;
31
- [key: string]: any;
32
- }
33
- /**
34
- * Node lookup map type (ReactFlow's internal structure)
35
- */
36
- export type NodeLookup = Map<string, InternalNode>;
37
- /**
38
- * Manhattan router configuration options
39
- */
40
- export interface ManhattanRouterOptions {
41
- /**
42
- * The size of step to find a route (the grid of the manhattan pathfinder)
43
- * @default 10
44
- */
45
- step?: number;
46
- /**
47
- * The number of route finding loops that cause the router to abort and return fallback route instead
48
- * @default 2000
49
- */
50
- maxLoopCount?: number;
51
- /**
52
- * The number of decimal places to round floating point coordinates
53
- * @default 1
54
- */
55
- precision?: number;
56
- /**
57
- * The maximum change of direction (in degrees)
58
- * @default 90
59
- */
60
- maxDirectionChange?: number;
61
- /**
62
- * Possible starting directions from a node
63
- * @default ['top', 'right', 'bottom', 'left']
64
- */
65
- startDirections?: Direction[];
66
- /**
67
- * Possible ending directions to a node
68
- * @default ['top', 'right', 'bottom', 'left']
69
- */
70
- endDirections?: Direction[];
71
- /**
72
- * Should certain nodes not be considered as obstacles?
73
- */
74
- excludeNodes?: string[];
75
- /**
76
- * Should certain types of nodes not be considered as obstacles?
77
- */
78
- excludeShapes?: string[];
79
- /**
80
- * Should the source and/or target not be considered as obstacles?
81
- */
82
- excludeTerminals?: ('source' | 'target')[];
83
- /**
84
- * The padding applied on the element bounding boxes
85
- */
86
- padding?: number | {
87
- top: number;
88
- right: number;
89
- bottom: number;
90
- left: number;
91
- };
92
- /**
93
- * Border radius for rounded corners at path turns (in pixels)
94
- * Set to 0 for sharp corners
95
- * @default 5
96
- */
97
- borderRadius?: number;
98
- /**
99
- * Extension distance from node edge for path start/end points (in pixels)
100
- * This controls how far the path extends away from the node before turning
101
- * @default 20
102
- */
103
- extensionDistance?: number;
104
- /**
105
- * Source position (from ReactFlow)
106
- * Used for smart point generation
107
- */
108
- sourcePosition?: string;
109
- /**
110
- * Target position (from ReactFlow)
111
- * Used for smart point generation
112
- */
113
- targetPosition?: string;
114
- /**
115
- * A penalty received for direction change
116
- */
117
- penalties?: {
118
- [angle: number]: number;
119
- };
120
- /**
121
- * Fallback route function when pathfinding fails
122
- */
123
- fallbackRoute?: (from: Point, to: Point) => Point[];
124
- }
125
- /**
126
- * Resolved options with all defaults applied
127
- */
128
- export interface ResolvedOptions {
129
- step: number;
130
- maxLoopCount: number;
131
- precision: number;
132
- maxDirectionChange: number;
133
- startDirections: Direction[];
134
- endDirections: Direction[];
135
- excludeNodes: string[];
136
- excludeShapes: string[];
137
- excludeTerminals: ('source' | 'target')[];
138
- paddingBox: {
139
- x: number;
140
- y: number;
141
- width: number;
142
- height: number;
143
- };
144
- borderRadius: number;
145
- extensionDistance: number;
146
- sourcePosition?: string;
147
- targetPosition?: string;
148
- directionMap: {
149
- top: Point;
150
- right: Point;
151
- bottom: Point;
152
- left: Point;
153
- };
154
- directions: Array<{
155
- cost: number;
156
- offsetX: number;
157
- offsetY: number;
158
- angle?: number;
159
- gridOffsetX?: number;
160
- gridOffsetY?: number;
161
- }>;
162
- penalties: {
163
- [angle: number]: number;
164
- };
165
- cost: number;
166
- fallbackRoute?: (from: Point, to: Point) => Point[];
167
- previousDirectionAngle?: number | null;
168
- }
169
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/options/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE3D;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAClC,SAAS,EAAE;QACT,gBAAgB,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAC3C,CAAA;IACD,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,IA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ACZ,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,KAAK,KAAK,EAAE,CAAA;IACnD,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvC"}
@@ -1,35 +0,0 @@
1
- /**
2
- * SortedSet class for managing open and closed sets in A* algorithm
3
- * Maintains items sorted by their values
4
- */
5
- export declare class SortedSet {
6
- private items;
7
- private hash;
8
- private values;
9
- constructor();
10
- /**
11
- * Add an item with its value, maintaining sorted order
12
- */
13
- add(item: string, value: number): void;
14
- /**
15
- * Pop the item with minimum value and mark it as closed
16
- */
17
- pop(): string | undefined;
18
- /**
19
- * Check if item is in open set
20
- */
21
- isOpen(item: string): boolean;
22
- /**
23
- * Check if item is in closed set
24
- */
25
- isClose(item: string): boolean;
26
- /**
27
- * Check if open set is empty
28
- */
29
- isEmpty(): boolean;
30
- /**
31
- * Find sorted insertion index for an item
32
- */
33
- private sortedIndexBy;
34
- }
35
- //# sourceMappingURL=SortedSet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SortedSet.d.ts","sourceRoot":"","sources":["../../src/pathfinder/SortedSet.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,MAAM,CAAqB;;IAQnC;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAkBtC;;OAEG;IACH,GAAG,IAAI,MAAM,GAAG,SAAS;IAQzB;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI7B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,OAAO,CAAC,aAAa;CAiBtB"}
@@ -1,8 +0,0 @@
1
- import { Point, Rectangle } from '../geometry';
2
- import type { ResolvedOptions } from '../options';
3
- import type { ObstacleMap } from '../obstacle';
4
- /**
5
- * Find route between two points using A* algorithm
6
- */
7
- export declare function findRoute(sourceBBox: Rectangle, targetBBox: Rectangle, sourceAnchor: Point, targetAnchor: Point, map: ObstacleMap, options: ResolvedOptions): Point[] | null;
8
- //# sourceMappingURL=findRoute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findRoute.d.ts","sourceRoot":"","sources":["../../src/pathfinder/findRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AA+I9C;;GAEG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,SAAS,EACrB,UAAU,EAAE,SAAS,EACrB,YAAY,EAAE,KAAK,EACnB,YAAY,EAAE,KAAK,EACnB,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,eAAe,GACvB,KAAK,EAAE,GAAG,IAAI,CAiThB"}
@@ -1,3 +0,0 @@
1
- export { SortedSet } from './SortedSet';
2
- export { findRoute } from './findRoute';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pathfinder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +0,0 @@
1
- export { pointsToPath, snapPathToGrid } from './pathConverter';
2
- export { parseSVGPath, simplifyPath } from './pathParser';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
@@ -1,10 +0,0 @@
1
- import { Point } from '../geometry';
2
- /**
3
- * Convert array of points to SVG path string
4
- */
5
- export declare function pointsToPath(points: Point[], precision: number, borderRadius?: number): string;
6
- /**
7
- * Snap path to grid by aligning consecutive points
8
- */
9
- export declare function snapPathToGrid(points: Point[], gridSize: number): Point[];
10
- //# sourceMappingURL=pathConverter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathConverter.d.ts","sourceRoot":"","sources":["../../src/svg/pathConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAE,MAAU,GAAG,MAAM,CA2EjG;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAE,CAgCzE"}
@@ -1,11 +0,0 @@
1
- import { Point } from '../geometry';
2
- /**
3
- * Parse SVG path string to extract points
4
- * Simplified parser that handles M, L, Q commands
5
- */
6
- export declare function parseSVGPath(pathString: string): Point[];
7
- /**
8
- * Simplify path by removing collinear intermediate points
9
- */
10
- export declare function simplifyPath(points: Point[]): Point[];
11
- //# sourceMappingURL=pathParser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathParser.d.ts","sourceRoot":"","sources":["../../src/svg/pathParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CA2CxD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CA0BrD"}
@@ -1,24 +0,0 @@
1
- import { Point } from '../geometry';
2
- import type { ResolvedOptions } from '../options';
3
- import type { Grid } from './grid';
4
- /**
5
- * Get direction angle from start point to end point
6
- * Corrects for grid deformation between start and end
7
- */
8
- export declare function getDirectionAngle(start: Point, end: Point, directionCount: number, grid: Grid, options: ResolvedOptions): number;
9
- /**
10
- * Get the change in direction between two direction angles
11
- */
12
- export declare function getDirectionChange(angle1: number, angle2: number): number;
13
- /**
14
- * Fix direction offsets according to current grid
15
- */
16
- export declare function getGridOffsets(grid: Grid, options: ResolvedOptions): {
17
- cost: number;
18
- offsetX: number;
19
- offsetY: number;
20
- angle?: number | undefined;
21
- gridOffsetX?: number | undefined;
22
- gridOffsetY?: number | undefined;
23
- }[];
24
- //# sourceMappingURL=direction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../src/utils/direction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAyBlC;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,KAAK,EACV,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,GACvB,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe;;;;;;;IASlE"}
@@ -1,15 +0,0 @@
1
- import { Point } from '../geometry';
2
- import type { ObstacleMap } from '../obstacle';
3
- import type { Direction } from '../options';
4
- /**
5
- * Get accessible anchor points using binary search optimization
6
- *
7
- * @param anchor - The anchor point (on node edge)
8
- * @param position - The position/direction (right, left, top, bottom)
9
- * @param extensionDistance - The preferred extension distance
10
- * @param step - The step size for binary search
11
- * @param obstacleMap - The obstacle map for accessibility checking
12
- * @returns Array of accessible points, prioritized by distance
13
- */
14
- export declare function getAnchorPoints(anchor: Point, position: Direction, extensionDistance: number, step: number, obstacleMap: ObstacleMap): Point[];
15
- //# sourceMappingURL=getAnchorPoints.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAnchorPoints.d.ts","sourceRoot":"","sources":["../../src/utils/getAnchorPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,SAAS,EACnB,iBAAiB,EAAE,MAAM,EACzB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,GACvB,KAAK,EAAE,CA0DT"}
@@ -1,27 +0,0 @@
1
- import { Point } from '../geometry';
2
- /**
3
- * Grid interface for dynamic grid system
4
- */
5
- export interface Grid {
6
- source: Point;
7
- x: number;
8
- y: number;
9
- }
10
- /**
11
- * Get grid size in x and y dimensions, adapted to source and target positions
12
- * Uses global grid system with origin at (0, 0) for path alignment
13
- */
14
- export declare function getGrid(step: number, source: Point, target: Point): Grid;
15
- /**
16
- * Snap a value to grid
17
- */
18
- export declare function snapToGrid(value: number, gridSize: number): number;
19
- /**
20
- * Align point to grid and apply precision
21
- */
22
- export declare function align(point: Point, grid: Grid, precision: number): Point;
23
- /**
24
- * Round point coordinates
25
- */
26
- export declare function round(point: Point, precision: number): Point;
27
- //# sourceMappingURL=grid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/utils/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,KAAK,CAAA;IACb,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAWD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,IAAI,CAMxE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAYD;;GAEG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAExE;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAE5D"}
@@ -1,8 +0,0 @@
1
- export * from './grid';
2
- export * from './direction';
3
- export * from './rect';
4
- export * from './route';
5
- export * from './node';
6
- export * from './pathValidation';
7
- export * from './getAnchorPoints';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
@@ -1,27 +0,0 @@
1
- import type { InternalNode } from '../options';
2
- /**
3
- * Node dimensions interface
4
- */
5
- export interface NodeDimensions {
6
- width: number;
7
- height: number;
8
- }
9
- /**
10
- * Get node dimensions following ReactFlow's internal logic
11
- * Priority: measured > direct property > initialWidth/Height > 0
12
- *
13
- * @param node - ReactFlow internal node
14
- * @returns Node dimensions with width and height
15
- */
16
- export declare function getNodeDimensions(node: InternalNode): NodeDimensions;
17
- /**
18
- * Get node absolute position from internals
19
- *
20
- * @param node - ReactFlow internal node
21
- * @returns Absolute position { x, y }
22
- */
23
- export declare function getNodePosition(node: InternalNode): {
24
- x: number;
25
- y: number;
26
- };
27
- //# sourceMappingURL=node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/utils/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAKpE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAE5E"}
@@ -1,11 +0,0 @@
1
- import { Point } from '../geometry';
2
- import type { NodeLookup } from '../options';
3
- /**
4
- * Check if a path intersects with any obstacles (nodes)
5
- * A path is considered to intersect if it has >= 2 unique intersection points with a node
6
- *
7
- * Note: pathPoints should be pre-processed by parseSVGPath which samples bezier curves
8
- * into line segments, so this function works correctly with curved paths
9
- */
10
- export declare function pathIntersectsObstacles(pathPoints: Point[], nodeLookup: NodeLookup): boolean;
11
- //# sourceMappingURL=pathValidation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathValidation.d.ts","sourceRoot":"","sources":["../../src/utils/pathValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAyF5C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAoC5F"}
@@ -1,9 +0,0 @@
1
- import { Point, Rectangle } from '../geometry';
2
- import type { ResolvedOptions, Direction } from '../options';
3
- import type { Grid } from './grid';
4
- /**
5
- * Get points around a rectangle taking given directions into account
6
- * Lines are drawn from anchor in given directions, intersections recorded
7
- */
8
- export declare function getRectPoints(anchor: Point, bbox: Rectangle, directionList: Direction[], grid: Grid, options: ResolvedOptions): Point[];
9
- //# sourceMappingURL=rect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../src/utils/rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAQ,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AA6ClC;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,aAAa,EAAE,SAAS,EAAE,EAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,GACvB,KAAK,EAAE,CAsET"}
@@ -1,19 +0,0 @@
1
- import { Point } from '../geometry';
2
- /**
3
- * Normalize a point to a unit direction vector
4
- */
5
- export declare function normalizePoint(point: Point): Point;
6
- /**
7
- * Get string key for a point
8
- */
9
- export declare function getKey(point: Point): string;
10
- /**
11
- * Calculate minimum Manhattan distance from a point to multiple anchors
12
- */
13
- export declare function getCost(from: Point, anchors: Point[]): number;
14
- /**
15
- * Reconstruct route by concatenating points with their parents
16
- * Removes redundant points in the same direction
17
- */
18
- export declare function reconstructRoute(parents: Map<string, Point>, points: Map<string, Point>, tailPoint: Point, startPoint: Point, endPoint: Point): Point[];
19
- //# sourceMappingURL=route.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/utils/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAKlD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAW7D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAC1B,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,KAAK,GACd,KAAK,EAAE,CAsCT"}