PlantUML

PlantUML 是绘制 uml 的一个开源项目.

支持快速绘制:

  • 时序图

  • 用例图

  • 类图

  • 活动图 (here is the legacy syntax)

  • 组件图

  • 状态图

  • 对象图

  • 部署图

  • Timing diagram

同时还支持以下非UML图:

  • Wireframe graphical interface

  • 架构图

  • Specification and Description Language (SDL)

  • Ditaa diagram

  • 甘特图

  • Mathematic with AsciiMath or JLaTeXMath notation

Example

  • 原始文本
  [plaintext]
1
Bob->Alice : hello
  • 效果
  [plaintext]
1
2
3
4
5
6
7
8
┌───┐ ┌─────┐ │Bob│ │Alice│ └─┬─┘ └──┬──┘ │ hello │ │──────────────>│ ┌─┴─┐ ┌──┴──┐ │Bob│ │Alice│ └───┘ └─────┘

Integration

Graphviz 安装

PlantUML 是依赖于 Graphviz

MAC 安装

  [plaintext]
1
$ brew install graphviz

Idea

Idea PlantUML

VSCode

VSCode PlantUML

  • Install PlantUML 插件
  1. 直接安装插件

  2. 编辑内容如下:

@startuml

Bob -> Alice : Hello, how are you
Alice -> Bob : Fine, thank you, and you?

@enduml

使用 Alt+D 直接开启预览

2018-04-09-plantuml-vscode.png