Flowcharts: Subgraph Grouping
简介 / Introduction
Flowcharts describe business or system processes. When a diagram grows large, grouping related steps into subgraph blocks makes it easier to read and maintain. This post shows how to write subgraphs in both PlantUML and Mermaid, then compares the two approaches.
PlantUML 版
1 | @startuml |
PlantUML uses the partition keyword to define functional blocks. Background colors and font styles are customizable via skinparam.
Mermaid 版
1 | flowchart TD |
Mermaid uses subgraph ID[Display Text] to define a block. The ID is referenced in connections, and all internal nodes and edges live between subgraph ... end.
对比 / Side-by-side
| Feature | PlantUML partition |
Mermaid subgraph |
|---|---|---|
| Keyword | partition "Title" |
subgraph ID[Title] |
| Block ID | No ID needed | Unique ID required |
| Background color | skinparam partitionBackgroundColor |
style subgraph fill etc. |
| Node reference | By node name | By ID |
| Edges | By node name | nodeID --> nodeID |
小结 / Wrap-up
PlantUML’s partition is more concise and works well for text-driven diagrams. Mermaid’s subgraph requires explicit IDs, making edge references more flexible for complex flows. Both effectively organize large flowcharts — choose based on your team’s toolchain.
- Title: Flowcharts: Subgraph Grouping
- Author: puml.online
- Created at : 2026-09-11 09:00:00
- Updated at : 2026-09-29 01:06:38
- Link: https://puml.online/blog/flowchart-subgraph-en/
- License: This work is licensed under CC BY-NC-SA 4.0.