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

相关推荐
学IT的周星星2 天前
LangGraph:用「流程图」的方式编排 Agent
数据库·人工智能·大模型·llm·流程图·agent
钛生智能2 天前
OA 流程定制全参数详解(十):画流程图与美化——从“能跑”到“好看”的最后一公里
流程图·办公自动化·oa·协同办公·oa办公系统
ixiaoyang86 天前
ioDraw v3.7.0 发布:AI 助手完成会话化改造,图表生成一次升级
ai·流程图·甘特图·思维导图·绘图软件·1024程序员节·mermaid
神色自若6 天前
Net10 Avalonia UI漂亮美观的流程图设计器重磅开源了
流程图
Keith Guo6 天前
ESP32-S31 分区表的访问流程图
流程图·esp32
学术 学术 Fun13 天前
AI 流程图图片怎样变成可编辑文件?先修文字,再核对逻辑
流程图
学术 学术 Fun14 天前
截图转可编辑 PPT:旧流程图改步骤,不再靠白色方块遮字
powerpoint·流程图
tedcloud12315 天前
Docker Compose 部署 Immich:手机照片自动备份与常见故障排查
运维·前端·docker·容器·智能手机·开源·流程图
weixin_4166600717 天前
AI 生成的 Mermaid 流程图和 LaTeX 公式,怎么一起导出到 Word?
人工智能·word·流程图·豆包
一只鹿鹿鹿18 天前
政务外网整体设计方案(PPT)
大数据·数据库·web安全·系统安全·流程图·政务