Skip to content

Add Mermaid graph visualization#861

Open
FenjuFu wants to merge 1 commit into
apache:mainfrom
FenjuFu:agent/add-mermaid-visualization
Open

Add Mermaid graph visualization#861
FenjuFu wants to merge 1 commit into
apache:mainfrom
FenjuFu:agent/add-mermaid-visualization

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Jul 27, 2026

Copy link
Copy Markdown

What changed

  • add a dependency-free Mermaid flowchart renderer to Graph.visualize()
  • expose the same engine="mermaid" option through Application.visualize()
  • preserve Graphviz as the default engine and reject Graphviz-only options on Mermaid
  • support configurable Mermaid direction, condition labels, action state signatures, and external inputs
  • escape user-controlled labels and use generated node IDs so arbitrary action names remain safe
  • support writing Mermaid source directly to a UTF-8 file
  • document the new API and add focused tests

Why

Graphviz image rendering requires both the Python package and a system dot executable. Mermaid source is useful in GitHub Markdown and other Mermaid-aware renderers without those dependencies.

This implements the text-generation portion of #414 without introducing Node, browser tooling, or a remote rendering service. Image rendering can remain a separate concern.

Validation

  • 17 passed, 4 deselected across Graph, Mermaid, and visualization tests
  • the four deselected tests are unchanged Graphviz image tests that require the unavailable local dot executable
  • Black 23.11.0 (--line-length 100)
  • isort 5.12.0
  • Flake8 6.1.0
  • ASF header check
  • git diff --check

Contributed as a member of the iFLYTEK Astron community.

Closes #414

@FenjuFu
FenjuFu marked this pull request as ready for review July 27, 2026 12:09
@github-actions github-actions Bot added area/core Application, State, Graph, Actions area/website burr.apache.org website labels Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Application, State, Graph, Actions area/website burr.apache.org website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mermaid support

1 participant