Skip to main content

smartEdgePresets

Canonical drawEdge, generatePath, and fallback configs for each preset. Spread into getSmartEdge options or SmartEdge's options prop.

import { getSmartEdge, smartEdgePresets } from "@tisoap/react-flow-smart-edge";

// Same as SmartBezierEdge
getSmartEdge({ /* ... */, options: smartEdgePresets.bezier });

// Same as SmartStepEdge
getSmartEdge({ /* ... */, options: smartEdgePresets.step });

// Same as SmartStraightEdge
getSmartEdge({ /* ... */, options: smartEdgePresets.straight });

Preset keys

  • beziersvgDrawSmoothLinePath + pathfindingAStarDiagonal
  • straightsvgDrawStraightLinePath + pathfindingAStarDiagonal
  • stepsvgDrawStraightLinePath + pathfindingJumpPointNoDiagonal
  • smoothstep — smooth-step draw + jump-point pathfinding

Override individual fields when spreading:

options: { ...smartEdgePresets.step, gridRatio: 5 }