adrai / flowchart.js

Draws simple SVG flow chart diagrams from textual representation of the diagram
http://flowchart.js.org/
MIT License
8.49k stars 1.21k forks source link

[Question] How to make two nodes output to the same node? #235

Closed Rullec closed 1 year ago

Rullec commented 1 year ago

Hi all, Thanks for this excellenet library! I cannot figure out how to make two nodes output to another node together. Consider:

st1=>start: first
st2=>start: second
op=>operation: handle
e=>end: end

st1->op
st2->op
op->end

But it doesn't work.

Can you help me with this question? Thanks!

adrai commented 1 year ago

You can't have multiple starts...

try something like:

st=>start: start
p=>parallel: parallel
o1=>operation: first
o2=>operation: second
op=>operation: handle
e=>end: end

st->p
p(path1, left)->o1->op
p(path2, right)->o2->op
op->e
Rullec commented 1 year ago

st=>start: start p=>parallel: parallel o1=>operation: first o2=>operation: second op=>operation: handle e=>end: end

st->p p(path1, left)->o1->op p(path2, right)->o2->op op->e

Oh, I see. Thanks for this solution! I think maybe the lib flowchart.js just focus on literally flowchart instead of a general-purpose chart? In another word, flowchart have and only have one beginning?

adrai commented 1 year ago

yes