使用 Graphviz 绘画 UML 图
使用 Graphviz 绘画 UML 图 Milo Yip 2019/10/28 目录 1 简介 2 1.1 使用 Graphviz dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 类图 4 2.1 继承 . . . . . . . . . . . . . . . . . . 图(graph),然后 自动排布节点和边去生成图片。它已有近 30 年历史。 UML(unified modeling language,统一建模语言)是一种常用的面向对象设计的方法。其中 最常用的是类图(class diagram),用于表示类的构成以及类之间的关系。 利用 Graphviz 去生成 UML 类图有几个好处: 1. 用文本表示图,容易更新,容易做版本管理。 2. 能自 %.dot dot $< -Tpng -o $@ %.pdf: %.dot dot $< -Tpdf -o $@ 3 Chapter 2 类图 UML 类图(class diagram)是最常见的图,用于表示系统的静态结构。UML 中类是以矩形表 示。我们可以在 dot 文件中预设节点的形状,并且设置一些如字体等属性: digraph { node [shape=box, fontname="Inconsolata0 码力 | 20 页 | 331.51 KB | 1 年前3Drawing UML with PlantUML - PlantUML Language Reference Guide(Version 1.2020.23)
Drawing UML with PlantUML PlantUML Language Reference Guide (Version 1.2020.23) PlantUML is a component that allows to quickly write : • Sequence diagram • Usecase diagram • Class diagram • Activity diagram • State diagram • Object diagram • Deployment diagram • Timing diagram The following non-UML diagrams are also supported: • JSON Data • Wireframe graphical interface • Archimate diagram • : hello Alice -> Bob : ok @enduml [Ref. QA-2794] 1.36.3 style strictuml To be conform to strict UML (for arrow style: emits triangle rather than sharp arrowheads), you can use: • skinparam style strictuml0 码力 | 311 页 | 3.15 MB | 1 年前3Drawing UML with PlantUML - PlantUML Language Reference Guide(Version 1.2019.4)
Drawing UML with PlantUML PlantUML Language Reference Guide (Version 1.2019.4) PlantUML is a component that allows to quickly write : • Sequence diagram • Usecase diagram • Class diagram • Activity diagram • State diagram • Object diagram • Deployment diagram • Timing diagram The following non-UML diagrams are also supported: • Wireframe graphical interface • Archimate diagram • Specification Interface2 <- [Component] @enduml PlantUML Language Reference Guide (1.2019.4) 79 / 166 6.7 Use UML2 notation 6 COMPONENT DIAGRAM It is also possible to change arrow direction by adding left, right0 码力 | 167 页 | 1.83 MB | 1 年前3Drawing UML with PlantUML - PlantUML Language Reference Guide(Version 1.2019.9)
Drawing UML with PlantUML PlantUML Language Reference Guide (Version 1.2019.9) PlantUML is a component that allows to quickly write : • Sequence diagram • Usecase diagram • Class diagram • Activity diagram • State diagram • Object diagram • Deployment diagram • Timing diagram The following non-UML diagrams are also supported: • Wireframe graphical interface • Archimate diagram • Specification Interface2 <- [Component] @enduml PlantUML Language Reference Guide (1.2019.9) 80 / 174 6.7 Use UML2 notation 6 COMPONENT DIAGRAM It is also possible to change arrow direction by adding left, right0 码力 | 175 页 | 1.95 MB | 1 年前3Drawing UML with PlantUML - PlantUML Language Reference Guide(Version 1.2019.3)
Drawing UML with PlantUML PlantUML Language Reference Guide (Version 1.2019.3) PlantUML is a component that allows to quickly write : • Sequence diagram • Usecase diagram • Class diagram • Activity diagram • State diagram • Object diagram • Deployment diagram • Timing diagram The following non-UML diagrams are also supported: • Wireframe graphical interface • Archimate diagram • Specification Interface2 <- [Component] @enduml PlantUML Language Reference Guide (1.2019.3) 79 / 158 6.7 Use UML2 notation 6 COMPONENT DIAGRAM It is also possible to change arrow direction by adding left, right0 码力 | 159 页 | 1.73 MB | 1 年前3Drawing UML with PlantUML - PlantUML Language Reference Guide(Version 1.2023.11)
Drawing UML with PlantUML PlantUML Language Reference Guide (Version 1.2023.11) PlantUML is a component that allows to quickly write : • Sequence diagram • Usecase diagram • Class diagram • Object diagram • Component diagram • Deployment diagram • State diagram • Timing diagram The following non-UML diagrams are also supported: • JSON Data • YAML Data • Network diagram (nwdiag) • Wireframe graphical : hello Alice -> Bob : ok @enduml [Ref. QA-2794] 1.39.3 style strictuml To be conform to strict UML (for arrow style: emits triangle rather than sharp arrowheads), you can use: • skinparam style strictuml0 码力 | 551 页 | 7.79 MB | 1 年前3使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2021.2)
使用 PlantUML 绘制的 UML PlantUML 语言参考指引 (Version 1.2021.2) PlantUML 是一个开源项目,支持快速绘制: • 时序图 • 用例图 • 类图 • 对象图 • 活动图 • 组件图 • 部署图 • 状态图 • 定时图 同时还支持以下非 UML 图: • JSON Data • YAML Data • Network diagram : hello Alice -> Bob : ok @enduml [Ref. QA-2794] 1.38.3 style strictuml To be conform to strict UML (for arrow style: emits triangle rather than sharp arrowheads), you can use: • skinparam style strictuml A::counter This member is annotated end note note right of A::start This method is now explained in a UML note end note @enduml 3.10.2 Note on method with the same name @startuml class A { {static} int counter0 码力 | 381 页 | 4.05 MB | 1 年前3使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2019.6)
使用 PlantUML 绘制的 UML PlantUML 语言参考指引 (Version 1.2019.6) PlantUML 是一个开源项目,支持快速绘制: • 时序图 • 用例图 • 类图 • 活动图 • 组件图 • 状态图 • 对象图 • 部署图 • 定时图 同时还支持以下非 UML 图: • 线框图形界面 • 架构图 • 规范和描述语言 (SDL) • Ditaa Interface1 <-- [Component] Interface2 <- [Component] @enduml PlantUML 语言参考指引 (1.2019.6) 79 / 173 6.7 使用 UML2 标记符 6 组件图 还可以使用关键字 left, right, up or down 改变箭头方向。 @startuml [Component] -left-> left [Component] 请不要乱用这些功能:Graphviz(PlantUML 的后端引擎) 不喜欢这个样子。 6.7 使用 UML2 标记符 命令 skinparam componentStyle uml2 可以切换到 UML2 标记符。 @startuml skinparam componentStyle uml2 interface "Data Access" as DA DA - [First Component]0 码力 | 174 页 | 1.98 MB | 1 年前3使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2019.9)
使用 PlantUML 绘制的 UML PlantUML 语言参考指引 (Version 1.2019.9) PlantUML 是一个开源项目,支持快速绘制: • 时序图 • 用例图 • 类图 • 活动图 • 组件图 • 状态图 • 对象图 • 部署图 • 定时图 同时还支持以下非 UML 图: • 线框图形界面 • 架构图 • 规范和描述语言 (SDL) • Ditaa Interface1 <-- [Component] Interface2 <- [Component] @enduml PlantUML 语言参考指引 (1.2019.9) 79 / 173 6.7 使用 UML2 标记符 6 组件图 还可以使用关键字 left, right, up or down 改变箭头方向。 @startuml [Component] -left-> left [Component] 请不要乱用这些功能:Graphviz(PlantUML 的后端引擎) 不喜欢这个样子。 6.7 使用 UML2 标记符 命令 skinparam componentStyle uml2 可以切换到 UML2 标记符。 @startuml skinparam componentStyle uml2 interface "Data Access" as DA DA - [First Component]0 码力 | 174 页 | 2.00 MB | 1 年前3使用 PlantUML 绘制 UML - PlantUML 语言参考指引(Version 1.2019.1)
使用 PlantUML 绘制的 UML PlantUML 语言参考指引 (Version 1.2019.1) PlantUML 是一个开源项目,支持快速绘制: • 时序图 • 用例图 • 类图 • 活动图 • 组件图 • 状态图 • 对象图 • 部署图 • 定时图 同时还支持以下非 UML 图: • 线框图形界面 • 架构图 • 规范和描述语言 (SDL) • Ditaa PlantUML 语言参考指引 (1.2019.1) 73 / 145 6.7 使用 UML2 标记符 6 组件图 6.7 使用 UML2 标记符 命令 skinparam componentStyle uml2 可以切换到 UML2 标记符。 @startuml skinparam componentStyle uml2 interface "Data Access" as DA DA - [First UNICODE @enduml 18.2 Charset The default charset used when reading the text files containing the UML text description is system dependent. Normally, it should just be fine, but in some case, you may0 码力 | 146 页 | 1.91 MB | 1 年前3
共 139 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14