美文网首页
画图工具Graphviz的一些说明

画图工具Graphviz的一些说明

作者: edwin1993 | 来源:发表于2018-05-03 22:18 被阅读0次
digraph startgame {
    node[fontname="PMingLiu"]
    edge[fontname="PMingLiu"]
    fontname = "PMingLiu"
    label="游戏资源更新流程"
    rankdir="TB"
    start[label="启动游戏" shape=circle style=filled]
    ifwifi[label="网络环境判断是否 WIFI" shape=diamond]
    needupdate[label="是否有资源需要更新" shape=diamond]
    startslientdl[label="静默下载" shape=box]
    enterhall[label="进入游戏大厅" shape=box]

    enterroom[label="进入房间" shape=box]
    resourceuptodate[label="资源不完整" shape=diamond]
    startplay[label="正常游戏" shape=circle fillcolor=blue]
    warning[label="提醒玩家是否更新" shape=diamond]
    startdl[label="进入下载界面" shape=box]
    //{rank=same; needupdate, enterhall}

    {shape=diamond; ifwifi, needupdate}

    start -> ifwifi
    ifwifi->needupdate[label="是"]
    ifwifi->enterhall[label="否"]
    needupdate->startslientdl[label="是"]
    startslientdl->enterhall
    needupdate->enterhall[label="否"]

    enterhall -> enterroom
    enterroom -> resourceuptodate
    resourceuptodate -> warning[label="是"]
    resourceuptodate -> startplay[label="否"]
    warning -> startdl[label="确认下载"]
    warning -> enterhall[label="取消下载"]
    startdl -> enterhall[label="取消下载"]
    startdl -> startplay[label="下载完成"]
}

效果图:

需要提及的是
node[fontname="PMingLiu"]
edge[fontname="PMingLiu"]
fontname = "PMingLiu"

node 管理所有的结点属性,以为设置了font 所以可以显示中文
edge 管理所有的边属性
最后的一行为digraph,使得label可以为中文。

相关文章

网友评论

      本文标题:画图工具Graphviz的一些说明

      本文链接:https://www.haomeiwen.com/subject/xthlrftx.html