Documentation
¶
Index ¶
- func RenderASCII(model *DiagramModel) string
- func RenderASCIIAuto(model *DiagramModel, binDir string) string
- func RenderASCIIViaCLI(model *DiagramModel, binPath string) (string, error)
- func RenderImage(model *DiagramModel) ([]byte, error)
- func RenderMermaid(model *DiagramModel) string
- func RenderMermaidForCLI(model *DiagramModel) string
- type DiagramModel
- type Edge
- type Node
- type NodeKind
- type StatusOverlay
- type SubGraph
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderASCII ¶
func RenderASCII(model *DiagramModel) string
RenderASCII renders a DiagramModel as a text-based ASCII diagram. It uses a level-based layout with box-drawing characters.
func RenderASCIIAuto ¶
func RenderASCIIAuto(model *DiagramModel, binDir string) string
RenderASCIIAuto tries to render using the mermaid-ascii CLI binary if available, falling back to the hand-rolled RenderASCII renderer.
func RenderASCIIViaCLI ¶
func RenderASCIIViaCLI(model *DiagramModel, binPath string) (string, error)
RenderASCIIViaCLI pipes simplified Mermaid syntax through the mermaid-ascii binary.
func RenderImage ¶
func RenderImage(model *DiagramModel) ([]byte, error)
RenderImage renders a DiagramModel as a PNG image using graphviz. Returns the PNG bytes.
func RenderMermaid ¶
func RenderMermaid(model *DiagramModel) string
RenderMermaid renders a DiagramModel as a Mermaid flowchart string.
func RenderMermaidForCLI ¶
func RenderMermaidForCLI(model *DiagramModel) string
RenderMermaidForCLI generates simplified Mermaid syntax compatible with the mermaid-ascii CLI tool. Unlike RenderMermaid, this avoids node declarations with ["label"] syntax (which mermaid-ascii cannot parse) and instead embeds status information directly in edge-referenced node IDs. Subgraphs (condition branches, parallel branches, loop bodies) are flattened into top-level edges since mermaid-ascii silently ignores subgraph blocks.
Types ¶
type DiagramModel ¶
DiagramModel is the intermediate representation used by all renderers.
func Build ¶
func Build(def *schema.WorkflowDefinition, states []*store.StepState) (*DiagramModel, error)
Build constructs a DiagramModel from a WorkflowDefinition and optional step states. It uses engine.ParseDAG for topology and maps each step to a Node with the appropriate kind. Flow control steps get SubGraph children.
type Node ¶
type Node struct {
ID string
Label string
Kind NodeKind
Status *StatusOverlay
Children []*SubGraph // condition branches, parallel branches, loop body
}
Node represents a single step in the diagram.