当前位置: 首页 > news >正文

graphviz和dot绘制流程图

graphviz和dot绘制流程图

step1:下载graphviz,https://graphviz.org/download/
step2:安装,记得添加环境变量
step3:验证是否安装成功 dot --version

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

step4:开始写流程图代码,保存在本地
C:\Users\wangrusheng\Downloads\flow.dot

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:用命令行,生成图片

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

相关文章:

  • Debezium TableSchemaBuilder详解
  • 从Excel到高级工具:数据分析进阶指南
  • Android Compose 中 CompositionLocal 的全面解析与最佳实践
  • 把Android设备变成“国标摄像头”:GB28181移动终端实战接入指南
  • Gradio全解20——Streaming:流式传输的多媒体应用(5)——基于WebRTC的摄像头实时目标检测
  • jwt身份验证和基本的利用方式
  • Air8101开发板实战指南:快速上手MP4视频录制与SD卡存储系统!
  • 华为昇腾CANN架构
  • MySQL——数据库基础操作
  • 使用 Microsoft 365 Copilot 上传手机图片,实现更高效的信息提取
  • Qwen3 性价比新王 Qwen3-30B-A3B 本地私有化部署,可灵活切换思考模式
  • 手机SIM卡打电话时识别对方按下的DTMF按键(二)
  • conda配置好的pytorch在jupyter中如何配置
  • 代码异味(Code Smell)识别与重构指南
  • ARM子程序和栈
  • 互联网大厂Java求职面试:AI大模型与云原生架构设计深度解析
  • 项目实战-基于信号处理与SVM机器学习的声音情感识别系统
  • 基于Boost库、Jsoncpp、cppjieba、cpp-httplib等构建Boost搜索引擎
  • Python生活手册-正则表达式:从快递单到咖啡订单的文本魔法
  • 25:三大分类器原理
  • 央行行长详解降准:将释放长期流动性1万亿,整体存款准备金率平均水平降至6.2%
  • 一季度全国30强城市出炉:谁能更进一步?谁掉队了?
  • 长沙天心阁举办古琴音乐会:文旅向深,让游客听见城市的底蕴
  • 最长3个月免费住宿,南昌人才驿站(洪漂驿站)申请指南发布
  • 香港金紫荆广场举行五四升旗礼
  • 澳大利亚总理阿尔巴尼斯率领工党赢得2025年联邦选举