jerosoler / Drawflow

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

Any way to designate True/False outputs for custom nodes? #861

Open aleybovich opened 1 month ago

aleybovich commented 1 month ago

I have a flow logic in a YAML file with "condition", "action", and "terminate" blocks. Condition block makes a calculation and then triggers a linked action block on a True or False path. Something like this:

flowchart TD
    C{Condition2} -->|Yes| D[Action1]
    C -->|No| E[Action2]
    E --> T1((( ))) 
    D --> F{Condition2}
    F -->|Yes| G[Action1]
    F -->|No| T2((( )))

I need to be able to create such flow charts, and distinguish Yes/True and No/False outputs for Condition elements. When I export the model, i need to be able to parse and know which connection is True and which is False. Any ideas how to implement that?

jerosoler commented 1 month ago

View for vertial desgin:

For labels:

Detect Yes or No: The first output of the node would be true "output_1" and false "output_2". You can get the information about each node with: editor.getNodeFromId(id).

Shaps: