tisoap / react-flow-smart-edge

Custom Edge for React Flow that never intersects with other nodes
https://tisoap.github.io/react-flow-smart-edge/
MIT License
256 stars 35 forks source link

Add option for squared off edges #8

Closed usamathpc closed 2 years ago

usamathpc commented 2 years ago

Nice work!

I was wondering if there was a way to make the edges squared off instead of the non-uniform curves that it currently draws.

usamathpc commented 2 years ago

It's being implemented in the following block in generatePath.ts I guess?

 const finder = new AStarFinder({
    diagonalMovement: DiagonalMovement.Always,
    allowDiagonal: true,
    dontCrossCorners: true,
  });
tisoap commented 2 years ago

Hey @usama-pc ! The non-uniform curves are actually implemented by drawSmoothLinePath on src/SmartEdge/drawSvgPath.ts. I do have a drawStraightLinePath implementation but I haven't exposed it yet

tisoap commented 2 years ago

@usama-pc Version 0.4.0 now exposes more options which allows more control over the line shape.