UNPKG

@jalez/react-flow-smart-edge

Version:

Smart edge routing for @xyflow/react v12+ (maintained fork of @tisoap/react-flow-smart-edge)

16 lines (15 loc) 610 B
import type { XYPosition } from '@xyflow/react'; /** * Takes source and target {x, y} points, together with an array of number * tuples [x, y] representing the points along the path, and returns a string * to be used as the SVG path. */ export type SVGDrawFunction = (source: XYPosition, target: XYPosition, path: number[][]) => string; /** * Draws a SVG path from a list of points, using straight lines. */ export declare const svgDrawStraightLinePath: SVGDrawFunction; /** * Draws a SVG path from a list of points, using rounded lines. */ export declare const svgDrawSmoothLinePath: SVGDrawFunction;