Plugins 〉Grafmaid


Developer

Neil Deng

Sign up to receive occasional product news and updates:



Panel
community

Grafmaid

  • Overview
  • Installation
  • Change log
  • Related content

Grafmaid Logo

Grafmaid

Grafana + Mermaid.js = Grafmaid

A Grafana panel plugin that renders Mermaid.js diagrams with live data from queries, dashboard variables, and threshold-based styling — turning static architecture diagrams into dynamic, data-driven visuals.

License GitHub release

Screenshots

Flowchart, Sequence, State diagrams

Dashboard Variables integration

Data Queries with threshold coloring

Features

  • All Mermaid diagram types — Flowchart, Sequence, Class, State, ER, Gantt, Pie, Mindmap, Timeline, Git Graph, C4, and more
  • Dashboard Variables — Use $variable / ${variable} syntax and {{#each var}} multi-value expansion
  • Data Queries — Inject live metric values via ${__data.CPU_A:display} shorthand or ${__data.fields.X} full syntax
  • Labels — Access metric labels with ${__data.CPU_A.labels.http_status}
  • Field Config — Standard Options support: Units, Thresholds, Value Mappings, Color scheme, Decimals
  • Threshold coloring — Color diagram nodes dynamically based on threshold values using ${__data.CPU_A:color}
  • Special character escaping — Auto-escape [ ] { } | > < in variable values to prevent syntax errors
  • Theme-aware — Auto-switches Mermaid theme based on Grafana dark/light mode
  • Responsive — SVG diagrams auto-scale with panel dimensions

Requirements

  • Grafana >= 12.3.0

Getting Started

  1. Install the plugin from the Grafana plugin catalog
  2. Add a new panel and select Grafmaid as the visualization
  3. Write your Mermaid diagram in the Mermaid Content option
  4. (Optional) Configure data source queries to inject live values

Configuration

Panel Options

OptionDefaultDescription
Mermaid ContentExample flowchartMermaid diagram definition with variable/data syntax
Escape special characterstrueAuto-escape Mermaid special characters in values
Max data rows100Max rows for {{#each data}} expansion (0 = unlimited)

Standard Options

The panel supports Grafana Standard Options via Field Config:

  • Unit — Format numeric values (percent, bytes, etc.)
  • Thresholds — Define color breakpoints (default: green base, red at 80)
  • Value Mappings — Map values to custom text
  • Color scheme — Defaults to "From thresholds (by value)"
  • Decimals — Control decimal precision

Data Syntax Quick Reference

SyntaxDescription
$variableDashboard variable substitution
{{#each var}}...{{value}}...{{/each}}Multi-value variable expansion
${__data.CPU_A:display}Formatted value from query (auto value field)
${__data.CPU_A:color}Threshold color from query
${__data.CPU_A.labels.server}Metric label value
${__data.fields.Value}Explicit field access from series[0]
{{#each data.CPU_A}}...{{/each}}Iterate over query rows

Example: Threshold-colored Diagram

graph LR
    A["${__data.CPU_A.labels.server}"] --> B["CPU: ${__data.CPU_A:display}"]
    style B fill:${__data.CPU_A:color},color:#fff

Documentation

For detailed documentation, see docs/README.md.

Contributing

License

Apache License 2.0 — see LICENSE.

Third-Party Notices

This plugin bundles the following open-source software:

PackageLicenseCopyright
mermaidMIT© 2014-2022 Knut Sveidqvist
dagre-d3-esMIT© 2013 Chris Pettitt
dayjsMIT© 2018-present iamkun
lodash-esMIT© OpenJS Foundation
markedMIT© 2018+ MarkedJS
roughjsMIT© 2019 Preet Shihn
KaTeXMIT© 2013-2020 Khan Academy
stylisMIT© 2016-present Sultan Tarimo
uuidMIT© 2010-2020 Robert Kieffer
DOMPurifyMPL-2.0 OR Apache-2.0© 2024 Cure53

Full license texts are available in the NOTICES file.

Version

1.0.6 (built on 2026-04-06)

Installing Grafmaid on Grafana Cloud:

For more information, visit the docs on plugin installation.

Changelog

v1.0.5 (2026-04-06)

Full Changelog

v1.0.4 (2026-03-31)

Full Changelog

  • feat: 新增 {{#each series}} 跨 series 迭代語法 #27 (neildeng)
  • fix: support richer series selectors #26 (tan9)
  • fix: clear stale SVG when content is empty #24 (tan9)

v1.0.3 (2026-03-30)

Full Changelog

v1.0.2 (2026-03-30)

Full Changelog

  • fix: 新增 provenance attestation 所需的 workflow permissions #23 (neildeng)

v1.0.1 (2026-03-30)

Full Changelog

  • fix: 修正 LICENSE generic text 與 README broken link #22 (neildeng)
  • fix: 升級 serialize-javascript 修正 high severity 漏洞 #21 (neildeng)
  • chore: 同步 develop 至 main (release workflow + CHANGELOG) #20 (neildeng)

v1.0.0 (2026-03-29)

Full Changelog

  • Release v1.0.0: Mermaid.js Diagram Panel with Data Queries & Field Config #19 (neildeng)
  • feat: Translate UI & documentation to English #18 (neildeng)
  • feat: 發布準備與資安強化 #17 (neildeng)
  • feat: 整合 Data Queries 與 Field Config 支援 #16 (neildeng)
  • feat: 強化 Dashboard Variables 整合與測試架構重構 #15 (neildeng)
  • feat: 整合 Mermaid.js 實作圖表面板 #14 (neildeng)
  • docs: update README and README.zh-TW to remove center alignment and i… #13 (neildeng)
  • docs: 在 README 加入 logo 圖示 #12 (neildeng)
  • docs: 改寫 README 為雙語版本並新增 logo #1 (neildeng)

* This Changelog was automatically generated by github_changelog_generator