@rxflow/manhattan
Version:
Manhattan routing algorithm for ReactFlow - generates orthogonal paths with obstacle avoidance
19 lines • 718 B
TypeScript
import { Point } from '../geometry';
/**
* Normalize a point to a unit direction vector
*/
export declare function normalizePoint(point: Point): Point;
/**
* Get string key for a point
*/
export declare function getKey(point: Point): string;
/**
* Calculate minimum Manhattan distance from a point to multiple anchors
*/
export declare function getCost(from: Point, anchors: Point[]): number;
/**
* Reconstruct route by concatenating points with their parents
* Removes redundant points in the same direction
*/
export declare function reconstructRoute(parents: Map<string, Point>, points: Map<string, Point>, tailPoint: Point, startPoint: Point, endPoint: Point): Point[];
//# sourceMappingURL=route.d.ts.map