Download the PHP package power-modules/dependency-graph-mermaid without Composer
On this page you can find all versions of the php package power-modules/dependency-graph-mermaid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download power-modules/dependency-graph-mermaid
More information about power-modules/dependency-graph-mermaid
Files in power-modules/dependency-graph-mermaid
Package dependency-graph-mermaid
Short Description Mermaid renderer plugin for power-modules/dependency-graph (flowchart, class diagram, timeline)
License MIT
Informations about the package dependency-graph-mermaid
Dependency Graph → Mermaid Renderers
Mermaid renderer plugin for power-modules/dependency-graph. It adds three renderers (flowchart, class diagram, timeline) and a module that registers them as plugins for discovery in Modular apps.
- Flowchart:
MermaidGraph→ Mermaidgraph LR - Class diagram:
MermaidClassDiagram→ MermaidclassDiagram(TB) with YAML frontmatter - Timeline:
MermaidTimeline→ Mermaidtimelinegrouped by phases and sections
Works great with Mermaid Live and VS Code Mermaid preview.
Requirements
- PHP 8.4+
- power-modules/dependency-graph ^0.2
- power-modules/framework ^2.1 (when used inside a Modular app)
- power-modules/plugin ^1.0 (for plugin-based discovery)
Install
Quick start
You can use the renderers through the Plugin Registry inside a Modular app (recommended) or directly (see examples).
Tip: If you don’t need plugin discovery, you can instantiate the renderer classes directly and call render().
Renderers at a glance
All renderers implement Modular\DependencyGraph\Renderer\Renderer and return Mermaid text (.mmd).
MermaidGraph (flowchart)
- Direction:
graph LR - Node label: module short name, optionally “exports:” list
- Edge label: imported service short names (namespace stripped) with truncation
- Styling: marks “independent” (no imports) and “unused” (no inbound edges)
- Uses
class <id> independent|unusedper node and a singleclassDefset at the end
- Uses
Constructor options (defaults shown):
MermaidClassDiagram
- YAML frontmatter is emitted at the top to hide empty member boxes:
config.class.hideEmptyMembersBox: true
- Direction:
direction TB - Modules rendered as classes; exports appear as public members
- Imports shown as dashed dependencies:
A ..> B : Service1, Service2 - Stereotypes:
<<independent>>and<<unused>>emitted once per class - Styling:
class X:::independent|unusedplusclassDefat the end
Constructor options:
MermaidTimeline
- Mermaid
timelinewith optional title - Modules grouped into phases (0..N) using import prerequisites (Kahn-style layering)
- Sections: Infrastructure and Domain, computed via a lightweight heuristic classifier
- Optional counts in labels:
Name (exports:X, imports:Y)
Constructor options:
Examples
This repo ships runnable examples and a Makefile to generate diagrams.
- E-commerce app: ecommerce
- Synthetic microservices: microservices
Generate example diagrams (flowchart, class diagram, timeline) into examples/**/mermaid/:
You can preview the .mmd files with:
- Mermaid Live: https://mermaid.live/
- VS Code: “Markdown Preview Mermaid Support” or native Mermaid support
Example output
Notes & conventions
- Identifiers are sanitized to
[A-Za-z0-9_]to avoid Mermaid parse errors - Service labels show short class names; long labels are truncated by
maxServiceLength - Styling/class definitions are emitted once at the end to keep diagrams clean
- Module classification for the timeline is best-effort; adjust names to influence sections
Development
Helpful targets:
Project layout highlights:
src/— renderers andMermaidRendererModuleexamples/— end-to-end usage with generated.mmdoutputstest/— renderer behavior and formatting expectations
Related packages
- Framework: https://github.com/power-modules/framework
- Plugin system: https://github.com/power-modules/plugin
- Dependency Graph: https://github.com/power-modules/dependency-graph
License
MIT License — see LICENSE.
All versions of dependency-graph-mermaid with dependencies
power-modules/framework Version ^2.1
power-modules/plugin Version ^1.0
power-modules/dependency-graph Version ^0.2.0