Treemaps in Confluence
A treemap shows parts of a whole as nested rectangles; the area of each rectangle is its value.
Last updated
When to use it
Use a treemap for a total with two or three levels: cloud spend by environment and service, bundle size by package, headcount by department and team. The largest rectangles are the largest costs, which makes them hard to miss.
Example
This is the code of the Cloud costs template: monthly cloud spend split by environment and service.
treemap-beta
"Monthly cloud costs"
"Production"
"Compute": 12400
"Database": 6800
"Network": 3200
"Observability": 2100
"Storage": 1500
"Staging"
"Compute": 1800
"Database": 900
"Storage": 200
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 one treemap ready to use:
- Cloud costs: Monthly cloud spend split by environment and service.
Syntax
The code of a treemap starts with treemap-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.