Closed reddigari closed 4 years ago
I did mean to implement the canLinkToPort
method but as you said it gets a little complex. The port does know its node (port.getNode()
), but all the combos of in/out/flow/data gets messy.
I think I can wrangle the output flow ports to match the input flow (purple circle on the right), but I'm not positive.
The rendering issues are definitely included in my react-diagrams headaches. Even if canLinkToPort
returns false, you're left with a dead link somewhere near the port, and I have had no success figuring out how to "cancel" the rendering of the link. I know @cesaragv fixed a lot of this, e.g. when you click a port, you no longer get a random link up to the corner. However if you look closely, clicking a port does result in the END of a link in the top left corner, so we have a lot of link-rendering bugs that could ideally be cleaned up (but we almost definitely don't have time for).
canLinkToPort
so only flow-in-to-flow-out and data-in-to-data-out are allowed.I have no idea how to prevent the rendering of invalid links, so we might just want to call this done.
Rather than set up a new custom class to represent flow ports (which involves some react-diagrams headaches), I just used the existing
VPPortModel
and indicate the flow port by name. TheCustomNodeWidget
finds it and renders/styles it separately from the other input ports. Should be fine since there is exactly one per node.