MermaidGraphGenerator

Renders a ModuleDependencyGraph as a Mermaid graph definition.

Unlike the interactive HTML report or the binary SVG export, Mermaid output is plain text: it diffs cleanly in pull requests and renders inline on GitHub, GitLab, and most IDEs wherever it appears inside a ```mermaid fenced code block. Committing the generated file next to the code turns the module graph into a reviewable, versioned artefact.

Output shape:

  • graph TD (top-down) with one node per module. Node ids are stable synthetic tokens (n0, n1, ...) assigned in sorted path order so the same graph always produces byte-identical output; the real module path is the visible label.

  • Production edges are solid (-->); test-only edges are dashed (-.->).

  • Each module type gets a classDef coloured with its report palette entry, so the rendered graph is colour-coded by module type.

Functions

Link copied to clipboard

Returns the raw Mermaid graph definition (no code fence). Suitable for a .mmd file or for embedding inside a ```mermaid block yourself.

Link copied to clipboard

Returns a complete Markdown document embedding the graph in a ```mermaid fenced block, so the file renders as a diagram directly on GitHub. Use for a committed graph.md.