Graphviz画流程图-预备稿

前言
流程图很恶心,很多时候自己手画了转电子版很难看,电子也懒的画。
那么能不能用Graphviz配合dot语言让它自己出个流程图?

似乎这个功能已经有前人实现过了,叫做AutoFlowChart
那我就做个最简单的?直接生产到dot语言文本那一级,留给用户更多的自定编辑空间吧!

碰壁记录1

?
我把这流程图交上去,还不得被退学?

digraph G{
	label = "Test Go"
	splines = ortho
	
	node[fontname="FangSong"]
	start[shape=box,style=rounded,label="开始"]

	{
		rank = same
		node[shape=diamond,fontname="FangSong"]
		switch1[label="输入数字为1?"]
		switch2[label="输入数字为2?"]
		switch3[label="输入数字为3?"]
		switch4[label="输入数字为4?"]
		switch5[label="输入数字为5?"]
		switch6[label="输入数字为6?"]
		switch7[label="输入数字为7?"]
		switch8[label="输入数字为8?"]
		switch9[label="输入数字为9?"]
	}

	node[shape=box,fontname="FangSong"]
	operate1[label="录入信息"]
	operate2[label="按照姓名查找"]
	operate3[label="修改成绩"]
	operate4[label="删除成绩"]
	operate5[label="将成绩排序"]
	operate6[label="统计成绩"]
	operate7[label="打开存储的成绩"]
	operate8[label="将最新的成绩保存"]
	operate9[shape=box,style=rounded,label="退出"]
	
	start -> switch1
	switch1 -> switch2[xlabel="No"]
	switch2 -> switch3[xlabel="No"]
	switch3 -> switch4[xlabel="No"]
	switch4 -> switch5[xlabel="No"]
	switch5 -> switch6[xlabel="No"]
	switch6 -> switch7[xlabel="No"]
	switch7 -> switch8[xlabel="No"]
	switch8 -> switch9[xlabel="No"]

	switch1 -> operate1[xlabel="Yes",len=50,weight=100]
	switch2 -> operate2[xlabel="Yes",len=50,weight=100]
	switch3 -> operate3[xlabel="Yes",len=50,weight=100]
	switch4 -> operate4[xlabel="Yes",len=50,weight=100]
	switch5 -> operate5[xlabel="Yes",len=50,weight=100]
	switch6 -> operate6[xlabel="Yes",len=50,weight=100]
	switch7 -> operate7[xlabel="Yes",len=50,weight=100]
	switch8 -> operate8[xlabel="Yes",len=50,weight=100]
	switch9 -> operate9[xlabel="Yes",len=50,weight=100]
	
	operate1 -> switch1
	operate2 -> switch1
	operate3 -> switch1
	operate4 -> switch1
	operate5 -> switch1
	operate6 -> switch1
	operate7 -> switch1
	operate8 -> switch1
}

编译指令
dot -Tpng try.dot -o try.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值