@rxflow/manhattan
Version:
Manhattan routing algorithm for ReactFlow - generates orthogonal paths with obstacle avoidance
27 lines • 783 B
TypeScript
import { Point } from '../geometry';
/**
* Grid interface for dynamic grid system
*/
export interface Grid {
source: Point;
x: number;
y: number;
}
/**
* Get grid size in x and y dimensions, adapted to source and target positions
* Uses global grid system with origin at (0, 0) for path alignment
*/
export declare function getGrid(step: number, source: Point, target: Point): Grid;
/**
* Snap a value to grid
*/
export declare function snapToGrid(value: number, gridSize: number): number;
/**
* Align point to grid and apply precision
*/
export declare function align(point: Point, grid: Grid, precision: number): Point;
/**
* Round point coordinates
*/
export declare function round(point: Point, precision: number): Point;
//# sourceMappingURL=grid.d.ts.map