diagram

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package diagram generates workflow visualizations from profiles.

Supports generating D2 and Mermaid diagram source code from profile synthesis rules and workflow definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(p *workflow.Workflow, format Format, opts Options) (string, error)

Generate creates a diagram from a profile in the specified format.

func GenerateFromDAG

func GenerateFromDAG(dag *synthesis.DAG, format Format, title string) (string, error)

GenerateFromDAG creates a diagram directly from a synthesis DAG.

Types

type Format

type Format string

Format specifies the output diagram format.

const (
	// FormatD2 generates D2 diagram language.
	FormatD2 Format = "d2"

	// FormatMermaid generates Mermaid diagram language.
	FormatMermaid Format = "mermaid"
)

type Options

type Options struct {
	// Title is the diagram title.
	Title string

	// Direction is the flow direction (down, right, left, up).
	Direction string

	// ShowLegend includes a legend in the diagram.
	ShowLegend bool

	// IncludeOptional includes optional specs in the diagram.
	IncludeOptional bool
}

Options configures diagram generation.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns sensible defaults for diagram generation.

type SpecInfo

type SpecInfo struct {
	ID          string
	Label       string
	Category    string
	Required    bool
	Synthesized bool
}

SpecInfo holds information about a spec for diagram generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL