Skip to content

Visualization

Exporters that render a flow's topology as Mermaid or Graphviz DOT for docs and debugging.

viz

Visualization helpers for PenguiFlow graphs.

flow_to_mermaid

flow_to_mermaid(flow: PenguiFlow, *, direction: str = 'TD') -> str

Render the flow graph as a Mermaid diagram string.

Parameters:

Name Type Description Default
flow PenguiFlow

The :class:PenguiFlow instance to visualize.

required
direction str

Mermaid graph direction ("TD", "LR", etc.). Defaults to top-down.

'TD'

flow_to_dot

flow_to_dot(flow: PenguiFlow, *, rankdir: str = 'TB') -> str

Render the flow graph as a Graphviz DOT string.

Parameters:

Name Type Description Default
flow PenguiFlow

The :class:PenguiFlow instance to visualize.

required
rankdir str

Graph orientation ("TB", "LR", etc.). Defaults to top-bottom.

'TB'