Closed sushantgulati1 closed 2 years ago
Hey @sushantgulati1 ! Currently there is not, this library always uses all nodes for pathfinding, using React Flow's useNodes
hook behind the scenes. I'll add this one to the backlog.
Now I'm curious, what's your use case?
Thanks, @tisoap!
The edges in my use case are shown conditionally and when I'm showing them I want to highlight some specific nodes (actually more like not highlighting a set of nodes), and I don't really need the pathfinding algorithm to consider the other ones as they are kind of in the backdrop.
Hey @sushantgulati1 ! I've released a beta version of the library that exposes a getSmartEdge
function, that allows for custom edges. This function takes a nodes
argument, so you can use useNodes
from React Flow but filter the results to your liking before passing them to getSmartEdge
, could you test it out?
Available to test using the beta
tag. Install with NPM:
npm install @tisoap/react-flow-smart-edge@beta
New documentation can be found here.
Thanks, @tisoap 🙏
Works like a charm.
@sushantgulati1 Version 2.0.0
was published
Hey @tisoap,
Is there a way/hack to make the edges dodge only some specific nodes instead of all nodes? If not, It'll be nice if we could pass node IDs or a filter function in the factory functions.