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 to configure the debounce time #1

Closed mdneyazahmad closed 2 years ago

mdneyazahmad commented 2 years ago

The edge is not updated while dragging the node. It only updates when you release the node.

mdneyazahmad commented 2 years ago

Thanks @tisoap for your work. There are many developer who wanted this feature in the library. It will surely help them.

tisoap commented 2 years ago

Hey @mdneyazahmad ! Not updating the edge during drag was a deliberate choice because path finding is an expensive operation, and it fires for every smart edge on the graph. Doing it so during drag can cause lag/freeze on large graphs or less powerful devices

mdneyazahmad commented 2 years ago

Could we debounce? @tisoap

tisoap commented 2 years ago

De-bouncing is what is making the Edge not update while dragging. If you click and drag but don't drop or move the mouse cursor for 200ms you'll see it update. I might expose the debounce time so developers can set it at their own discretion

tisoap commented 2 years ago

@mdneyazahmad There's now a way to configure debounce options