graphviz和dot绘制流程图

graphviz和dot绘制流程图

step1:下载graphviz,https://graphviz.org/download/

step2:安装,记得添加环境变量

step3:验证是否安装成功 dot --version

bash 复制代码
C:\Users\wangrusheng>dot --version
dot - graphviz version 12.2.1 (20241206.2353)

step4:开始写流程图代码,保存在本地

C:\Users\wangrusheng\Downloads\flow.dot

bash 复制代码
digraph {
    rankdir="LR";

    graph [fontname="helvetica", fontsize=12];
    node [fontname="helvetica", fontsize=10];
    edge [fontname="helvetica", fontsize=10];

    start [shape="plaintext", style="rounded", label="I want to extract\nmembers from a zip file."];
    
    fewlarge [shape="box", label="Do you have a few\nlarge files zip files\nwith tens\nof thousands\nof members?"];
    manysmall [shape="box", label="Do you have\nmany small files\nwith a few\ndozen members?"];
    extractsome [shape="box", label="Do you need\nto extract many\nmembers but\nnot all?"];

    end [shape="plaintext", style="rounded", label="Use vanilla unzip."];
    unzippa [shape="plaintext", style="rounded", label="Maybe unzippa is faster."];

    {
        rank=same; start; fewlarge; manysmall; end;
    }
    {
        rank=same; extractsome; unzippa;
    }

    start -> fewlarge;
    fewlarge -> manysmall[label="No"];
    fewlarge -> extractsome[label="Yes"];
    manysmall -> end[label="No"];
    manysmall -> extractsome[label="Yes"];
    extractsome -> end[label="No"];
    extractsome -> unzippa[label="Yes"];
}

step5:用命令行,生成图片

bash 复制代码
Microsoft Windows [版本 10.0.26100.3915]
(c) Microsoft Corporation。保留所有权利。

C:\Users\wangrusheng>dot --version
dot - graphviz version 12.2.1 (20241206.2353)

C:\Users\wangrusheng>dot -Tpng "C:\Users\wangrusheng\Downloads\flow.dot" -o "C:\Users\wangrusheng\Downloads\flow.png"

C:\Users\wangrusheng>

step6:去对应目录打开图片,就能看到效果

end

相关推荐
zzywxc7874 天前
自动化测试框架是软件测试的核心基础设施,通过预设规则和脚本自动执行测试用例,显著提高测试效率和覆盖率。
运维·人工智能·自动化·prompt·测试用例·流程图
TextIn智能文档云平台4 天前
产品无法正确解析复杂表格和流程图,有什么替代方案或优化方法?
流程图
coder_lorraine4 天前
Drawnix:开源一体化白板工具,让你的创意无限流动!
开源·流程图
m0_555762906 天前
项目1——单片机程序审查,控制系统流程图和时序图
单片机·mongodb·流程图
zzywxc7878 天前
AI在金融、医疗、教育、制造业等领域的落地案例
人工智能·机器学习·金融·prompt·流程图
趣学习9 天前
A043基于博途西门子1200PLC自动售货机系统仿真A043自动售货机+S71200+HMI+主电路图+外部接线图+流程图+IO分配表
毕业设计·流程图·课程设计·plc·西门子
kebeiovo10 天前
项目必备流程图,类图,E-R图实例速通
开发语言·r语言·流程图
晋人在秦 老K10 天前
入梦工具箱怎么检测硬件?3步完成CPU-Z跑分测试 硬件检测总出错?图吧工具箱免费功能实测 draw.io 部署指南:私有化流程图服务搭建教程
测试工具·流程图·工具·draw.io
zzywxc78711 天前
AI在金融、医疗、教育、制造业等领域的落地案例(含代码、流程图、Prompt示例与图表)
人工智能·spring·机器学习·金融·数据挖掘·prompt·流程图
ui小新13 天前
什么是流程图:流程六要素、三大结构及绘制规范总结
流程图·设计工具·流程图设计