Mermaid.js rendering for Choreo.Dataflow pipeline diagrams.
Produces dataflow-oriented visualisation:
- Sources — stadium shape (data enters)
- Sinks — rounded rectangles (data exits)
- Transforms — subroutine rectangles (processing)
- Buffers — cylinders (queues / topics)
- Conditionals — rhombus (branching decisions)
- Merges — trapezoid (joining streams)
Edge styles:
- Normal — solid grey
- Error — dashed red
- Retry — dashed orange
- Dead letter — dashed grey
- Virtual — dashed light grey
Clusters are rendered as Mermaid subgraphs with optional fill colours.
Further reading
Summary
Functions
Returns a theme for Choreo.Dataflow Mermaid diagrams.
Renders a dataflow pipeline to a Mermaid flowchart string.
Functions
@spec theme( atom(), keyword() ) :: Choreo.Theme.t()
Returns a theme for Choreo.Dataflow Mermaid diagrams.
@spec to_mermaid( Choreo.Dataflow.t(), keyword() ) :: String.t()
Renders a dataflow pipeline to a Mermaid flowchart string.
Options
:theme—:default,:dark,:warm,:forest,:ocean, or aChoreo.Themestruct:direction—:td(default),:lr,:bt,:rl:highlighted_nodes— list of node IDs to highlight:highlighted_edges— list of{from, to}tuples to highlight- Any other option accepted by
Yog.Multi.Mermaid.to_mermaid/2
Examples
iex> flow = Choreo.Dataflow.new()
iex> flow = flow
...> |> Choreo.Dataflow.add_source(:in, label: "Input")
...> |> Choreo.Dataflow.add_transform(:proc, label: "Process")
...> |> Choreo.Dataflow.add_sink(:out, label: "Output")
...> |> Choreo.Dataflow.connect(:in, :proc, data_type: "raw")
...> |> Choreo.Dataflow.connect(:proc, :out, data_type: "result")
iex> mermaid = Choreo.Dataflow.Render.Mermaid.to_mermaid(flow)
iex> String.contains?(mermaid, "graph TD")
true
iex> String.contains?(mermaid, "Input")
true
iex> String.contains?(mermaid, "Output")
true