Generates Mermaid-based flowchart simulation reports with statistics.
This generator creates standalone HTML reports with embedded diagrams that show:
- Actor topology as a Mermaid flowchart
- Message flow connections between actors
- Statistics embedded in the diagram (message counts, rates)
- Styled nodes based on actor activity
- Complete simulation statistics and model source code
- Syntax-highlighted Elixir code for the simulation model
These reports can be embedded in your documentation, shared with stakeholders, or used as standalone design documents. Perfect for visualizing distributed system architectures and message passing patterns.
Based on Mermaid Flowchart Syntax
Example
simulation = ActorSimulation.new()
|> ActorSimulation.add_actor(:producer,
send_pattern: {:periodic, 100, :data},
targets: [:consumer])
|> ActorSimulation.add_actor(:consumer)
|> ActorSimulation.run(duration: 1000)
html = MermaidReportGenerator.generate_report(simulation,
title: "Producer-Consumer System",
output_file: "report.html")Options
:title- Report title (default: "Simulation Report"):show_stats_on_nodes- Show stats directly on nodes (default: true):show_message_labels- Show message types on edges (default: true):layout- Flowchart direction: "TB", "LR", "RL", "BT" (default: "TB"):style_by_activity- Color nodes by message activity (default: true)
Summary
Functions
Generates just the Mermaid flowchart code (without HTML wrapper).
Generates a complete HTML report with Mermaid flowchart and statistics.
Writes the report to a file.
Functions
Generates just the Mermaid flowchart code (without HTML wrapper).
Generates a complete HTML report with Mermaid flowchart and statistics.
Returns HTML string containing:
- Mermaid flowchart showing actor topology
- Statistics embedded in nodes
- Detailed stats table
- Simulation summary
Writes the report to a file.