Skip to main content

drawEdge

Function that converts a point sequence into an SVG path d attribute string.

TypeSVGDrawFunction
DefaultsvgDrawSmoothLinePath (bezier preset)

Built-in functions

ExportUsed by
svgDrawSmoothLinePathSmartBezierEdge
svgDrawStraightLinePathSmartStraightEdge, SmartStepEdge
svgDrawSmoothStepLinePath({ borderRadius })SmartSmoothStepEdge (factory)
import {
createSmartEdge,
svgDrawSmoothStepLinePath,
} from "@tisoap/react-flow-smart-edge";

const edgeTypes = {
smartSmoothStep: createSmartEdge("smoothstep", {
drawEdge: svgDrawSmoothStepLinePath({ borderRadius: 12 }),
}),
};

Signature

type SVGDrawFunction = (
source: XYPosition,
target: XYPosition,
path: number[][],
) => string;

See drawSvgPath.ts source for implementation examples.