jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.61k stars 721 forks source link

Change Id of node on connectionCreated event #176

Closed adamburczy closed 3 years ago

adamburczy commented 3 years ago

Hello! Let's say we have 2 nodes and we want to connect them. Is it possible to take id of one node on connectionStart event, and on connectionCreated event, change id of second node, using id of first one? (ex. Node1_id = 5, Node2_id = Node1_id += 1)

jerosoler commented 3 years ago

Hello @adamburczy

With the connectionCreated event you have all the information.

You would have to change the id of the node and update the json. Something similar to this: https://github.com/jerosoler/Drawflow/issues/172

Jero