MrBlenny / react-flow-chart

🌊 A flexible, stateless, declarative flow chart library for react.
https://mrblenny.github.io/react-flow-chart/index.html
MIT License
1.46k stars 307 forks source link

Prevent link creation from specific port ? #154

Closed Morphexe closed 4 years ago

Morphexe commented 4 years ago

After digging around the source I cant seem to find a way to do this.

My use case is, I have nodes that can only be connected to (link order matters), so I am trying to find a way to prevent the drag that gets initialized from the port, is there a way to do this that I am missing?

From my experiments, it seems PortWrapper is the way to go about this, but there is no easy way to hook into it sadly.

Morphexe commented 4 years ago

Essentially for someone wanting to do this, you can hook into onLinkStart action, and just do any kind of validation there instead! I missed this onto my pass through the source code.