Block diagrams in Confluence
A block diagram places blocks on a grid that you control, column by column.
Last updated
When to use it
Use a block diagram when the position of each element carries meaning: layers of a system, network zones, a rack. A flowchart decides the layout for you; a block diagram keeps every block in the column and row you gave it.
Example
This is the code of the Layered services template: an API gateway, four services and an event bus on a grid.
block-beta
columns 4
gateway["API gateway"]:4
space:4
orders["Orders"] billing["Billing"] inventory["Inventory"] notify["Notifications"]
space:4
bus["Event bus"]:4
gateway --> orders
gateway --> billing
gateway --> inventory
gateway --> notify
orders --> bus
billing --> bus
inventory --> bus
notify --> bus
Vellnar Diagrams draws it like this:
Change a line and the diagram changes with it. Nobody needs the original drawing file, because there is none: the code is the diagram.
Add it to a Confluence page
- Edit a Confluence page and type
/mermaidwhere the diagram should go. - Select Mermaid diagram. The editor opens with the template list.
- Pick a template, or choose Start blank and paste the code above. The preview follows every keystroke.
- Choose Save. The diagram appears on the page.
The documentation covers the editor, the settings and the exports.
Templates
The Templates button in the editor has 2 block diagrams ready to use:
- Layered services: An API gateway, four services and an event bus on a grid.
- Network zones: Public, private and data zones with the traffic allowed between them.
Syntax
The code of a block diagram starts with block-beta. The Mermaid documentation describes every element of the syntax. Vellnar Diagrams draws it with Mermaid 12.3; if a line has an error, the editor marks the line and keeps the last valid diagram on screen.
More
- Mermaid in Confluence: how diagrams as code work in a page, and every diagram type.
- Security: the app asks for no permissions and sends nothing outside Atlassian.