jerosoler / Drawflow

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

Ability to add data to the connection object #345

Closed hkurma closed 2 years ago

hkurma commented 2 years ago

I have read the documentation and haven't seen a way to add data to the connection. This is probably useful in few cases.

The use case I'm trying to solve here is where there is a node which has 2 connections for an ouput port. Now, this node is more like a decision making node and I would want to take only one of the connections.

How adding data property to the connection object would help this use case:

Now if there was a data property in the connection object, I would use the data property on the connection object to evaluate against the decision made by it's node and take the connection that satisfies the evaluation.

jerosoler commented 2 years ago

What does it mean to add labels? Inconnections?

hkurma commented 2 years ago

@jerosoler I was hoping it to be 'connection'.

Also, a way to show some text on the connection. Something like below

image

jerosoler commented 2 years ago

It is not implemented yet, but you can find solutions here: