
MermaidDiagramExporter
Generate Mermaid class diagrams from C# source using Roslyn. CLI + an interactive Avalonia GUI with a Sugiyama-style layout engine and a Design Mode for authoring diagrams from scratch.
MermaidDiagramExporter analyzes C# at the source level — no build required — so it works on any folder of .cs files. It extracts types, members, and relationships (inheritance, interface implementation, associations) and produces a Mermaid class diagram grouped by namespace.
The CLI writes .md or .mmd files. The GUI features an interactive graph canvas with pan/zoom, a minimap, namespace-based filtering, focus-based subgraph navigation (D1/D2/D3 depth), symbol search, manual node rearrangement in analyze mode, and export to PNG/.mmd/.md/clipboard.
On the inside, the layout is a Sugiyama-style layered pipeline with separate passes for cycle removal, layer assignment, crossing reduction, and coordinate assignment, plus a force-directed alternative, cluster-aware edge routing, and a compound (clustered) layout engine. A Design Mode lets you author class diagrams from scratch with undo, serialization, and an LLM generation dialog.
Key features
- Source-level analysis via Roslyn — works on any .cs folder, no build needed.
- Extracts classes, structs, interfaces, enums, members, and relationships.
- Avalonia GUI with pan/zoom canvas, minimap, namespace filtering, symbol search.
- Focus navigation — pick a node, get a configurable-depth neighborhood (D1/D2/D3).
- Manual node rearrangement in analyze mode; PNG/.mmd/.md/clipboard export.
- Sugiyama layered + force-directed + compound layout engines with cluster-aware edge routing.
- Design Mode: author class diagrams from scratch, with undo, serialization, and LLM generation.
- xUnit test suite covering export, scanning, graph model, focus, layout, and end-to-end.
Stack
Gallery