CSDN-MARKDOWN flowchart.js 流程图详解

来源:互联网 发布:判断微信浏览器 js 编辑:程序博客网 时间:2024/05/24 05:36

教程引导

例1

 ```flow 开始=>start: 开始 e>end: 结束  开始->e ```

实现效果 :

Created with Raphaël 2.1.0http://flowchart.js.org/开始http://flowchart.js.org/结束

解释([]代码中不用写):

1

 ```flow............ ```

在CSDN-MARKDOWN中插入流程图代码的格式

2

    [name]=>[symbol](: [Output Name])(:>[link])

其中name,Output Name中英文任意
symbol是特定的标签,如例1中的start,end
()代表可缺省[link]后可在[ ]内加target属性

3

    [name1]->[name2]

从name1向name2画一条箭头

例2

 ```flow st=>start e=>end in=>inputoutput: 输入a,b if=>condition: a<b? do=>operation: a=a-1 out=>inputoutput: 输出a,b st->in->if if(yes)->out->e if(no)->do(right)->if ```

实现效果:

Created with Raphaël 2.1.0Start输入a,ba<b?输出a,bEnda=a-1yesno

解释:

1

    in=>inputoutput: 输入a,b    if=>condition: a<b?    do=>operation: a=a-1    out=>inputoutput: 输出a,b

inputoutput 输入输出标签
operation 过程标签
condition 判断标签

2

    [name1](yes)->[name2]    [name1](no)->[name3]

[name1]判断成功(失败),向[name2(3)]画线

3

    [name1](right)->[name2]    [name1](bottom)->[name2]

从[name1]的右部,底部开始画线指向[name2]
当[name1]为condition标签时,格式为[name1](yes,right)

例3

求最小公倍数
 ```flow st=>start: 开始 in=>inputoutput: 输入a,b sub1=>subroutine: 求得最小公约数c:>http://www.google.com[blank] op=>operation: c=a*b/c out=>inputoutput: 输出c e=>end: 结束 st->in->sub1->op->out->e ```
Created with Raphaël 2.1.0开始输入a,bhttp://www.google.comhttp://www.google.com求得最小公约数chttp://www.google.comc=a*b/c输出c结束

解释:

subroutine子程序标签

参考手册

标签 意义 start 开始 end 结束 inputoutput 输入输出 operation 过程 condition 判断 subroutine 子程序
原创粉丝点击