流程图(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.2 Start My Operation Yes or No? Good idea catch something... End Stuff My Subroutine yes no yes no
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.2 Start Option solution_1 End solution_2 yes no
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.2 Start Do you have a problem? Can you solve it? Why are you worried? Since you can't solve it, yes no yes no
  • 3
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值