Flowcharts: edge styles and arrows
简介 / Introduction
Edges in a flowchart are the lines connecting nodes — they can be undirected, directed with arrows, dashed for optional paths, or bold for emphasis. Both PlantUML and Mermaid support these variants, but their syntax differs. This post uses the same simple login-flow to show equivalent notations in both engines.
PlantUML 版
1 | @startuml |
Key syntax points:
if (...) then (Yes)— branch with a label afterthenelse (No)— the false branch labelendif— closes the conditional blocknote right:— attaches a note to the right of an edge or node
PlantUML arrows are directed by default; the :Text; syntax creates rounded terminal nodes (start/end).
Mermaid 版
1 | flowchart TD |
Key syntax points:
flowchart TD— Top-Down flow; change toLRfor left-to-right-- Yes -->— solid directed edge with a label inline-.->— dashed directed edge{Yes/No}— diamond shape for decision nodes[Text]— rounded rectangle;(/Text/)— parallelogram;((Circle))— circle for terminal
对比 / Side-by-side
| Concept | PlantUML | Mermaid |
|---|---|---|
| Start/End node | :Text; |
([Text]) |
| Decision condition | if (...) then |
{Yes/No} |
| Solid directed edge | default (->) |
--> |
| Dashed edge | -..> |
-.-> |
| Edge label text | note right: |
` |
| Terminal node | (*) or :stop; |
([Text]) |
小结 / Wrap-up
PlantUML’s flowchart syntax leans on natural-language constructs (if then else endif), making it a good fit for complex decision logic. Mermaid uses symbolic markers ({}, [ ], (( ))) for a more compact, sketch-like feel. Both let you distinguish semantics through edge style and node shape — pick based on team familiarity and the rest of your toolchain.
- Title: Flowcharts: edge styles and arrows
- Author: puml.online
- Created at : 2026-09-13 01:00:53
- Updated at : 2026-09-29 01:06:38
- Link: https://puml.online/blog/flowchart-edge-styles-en/
- License: This work is licensed under CC BY-NC-SA 4.0.