流程圖(flowchart)語法

轉自:https://blog.csdn.net/ethmery/article/details/50670294

概述

流程圖的語法大致分爲兩部分
- 定義元素
- 連接元素
語法

```flow
tag=>type: content:>url
...
...
tag1(...)->tag2(...)->tag3(...)
```

定義元素

tag=>type: content:>url

  • tag:標籤,用於連接元素時使用
  • type:該標籤的類型。共有6種類型如下:
start 
end 
operation 
subroutine 
condition 
inputoutput
  • content:流程語句中放置的內容
    type:與content之間一定要有一個空格,否則會出問題!
  • url:鏈接,與流程語句綁定

連接元素

使用->符號,如:

c2(yes)->io->e
c2(no)->op2->e

實例

牢記tag=>type: content:>url

st=>start: Start|past:>http://www.baidu.com
e=>end: End:>http://www.baidu.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes or No?|approved:>http://www.baidu.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e

實際實現效果

Created with Raphaël 2.1.2StartMy OperationYes or No?Good ideacatch something...EndStuffMy Subroutineyesnoyesno
st=>start: Start
e=>end: End
cond=>condition: Option
op1=>operation: solution_1
op2=>operation: solution_2

st->cond
cond(yes)->op1->e
cond(no)->op2->e

實際實現效果

Created with Raphaël 2.1.2StartOptionsolution_1Endsolution_2yesno
st=>start: Start
e=>end: Why are you worried?
cond1=>condition: Do you have a problem?
cond2=>condition: Can you solve it?
op=>operation: Since you can't solve it,

st->cond1
cond1(yes)->cond2
cond1(no)->e
cond2(yes)->e
cond2(no)->op->e

實際實現效果

Created with Raphaël 2.1.2StartDo you have a problem?Can you solve it?Why are you worried?Since you can't solve it,yesnoyesno
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章