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

相关推荐
zzywxc7878 小时前
AI在金融、医疗、教育、制造业等领域的落地案例
人工智能·机器学习·金融·prompt·流程图
趣学习1 天前
A043基于博途西门子1200PLC自动售货机系统仿真A043自动售货机+S71200+HMI+主电路图+外部接线图+流程图+IO分配表
毕业设计·流程图·课程设计·plc·西门子
kebeiovo3 天前
项目必备流程图,类图,E-R图实例速通
开发语言·r语言·流程图
晋人在秦 老K3 天前
入梦工具箱怎么检测硬件?3步完成CPU-Z跑分测试 硬件检测总出错?图吧工具箱免费功能实测 draw.io 部署指南:私有化流程图服务搭建教程
测试工具·流程图·工具·draw.io
zzywxc7874 天前
AI在金融、医疗、教育、制造业等领域的落地案例(含代码、流程图、Prompt示例与图表)
人工智能·spring·机器学习·金融·数据挖掘·prompt·流程图
ui小新6 天前
什么是流程图:流程六要素、三大结构及绘制规范总结
流程图·设计工具·流程图设计
小道士写程序6 天前
如何简单理解状态机、流程图和时序图
java·开发语言·流程图
zzywxc7876 天前
深入探讨AI三大领域的核心技术、实践方法以及未来发展趋势,结合具体代码示例、流程图和Prompt工程实践,全面展示AI编程的强大能力。
人工智能·spring·机器学习·ios·prompt·流程图·ai编程
皆过客,揽星河7 天前
c语言程序之魂——算法(练习题,流程图,程序源码)
c语言·算法·流程图·源码·辗转相除法·c语言程序设计
晓风残月淡7 天前
Mermaid流程图更改样式的方法
css·流程图·css3