jerosoler / Drawflow

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

How to join to nodes using single connection ? #774

Open Co-Maheshh opened 8 months ago

Co-Maheshh commented 8 months ago

Hi @jerosoler , Can we do like this. we can create 2 nodes from single connection.like this

image

and also how we can add lables on that connection lines ?

jerosoler commented 8 months ago

They have to be two independent connections.

But they could pass through the same point and it would look like the image.

For example:

Another option is to use "reroutes".

For labels:

Co-Maheshh commented 8 months ago

@jerosoler how we can connect single output node to multiple input node ?

i have this code. becouse of this is this not connected ?

mythis.editor.on("connectionCreated", function(info) { const nodeInfo = mythis.editor.getNodeFromId(info.output_id); if(nodeInfo.outputs[info.output_class].connections.length > 1) { const removeConnectionInfo = nodeInfo.outputs[info.output_class].connections[0]; mythis. editor.removeSingleConnection(info.output_id, removeConnectionInfo.node, info.output_class, removeConnectionInfo.output); } });