cdfmlr / pyflowchart

Python codes to Flowcharts

Home Page:https://pypi.org/project/pyflowchart/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can a ConditionNode deal with 3 conditions

vesslan-dal opened this issue · comments

Here's my demo:

1,StartNode connect OperationNode("step1")
2,OperationNode("step1") connect ConditionNode
3.1,ConditionNode connect_yes OperationNode("step2")
3.2,ConditionNode connect_no OperationNode("step1")
3.3 ConditionNode (how to)connect EndNode

I am sorry but a multi-branch condition node is not yet supported by the depended flowchart.js. See adrai/flowchart.js#60 and adrai/flowchart.js#101 . So pyflowchart will be unable to deal with your case now.

As a quick fix, you can use two (or more) nested condition nodes :

if exp1 { 
   // branch 1
} else {
    if exp2 { 
        // branch2
    }
    else { 
        // branch3
   }
}