Documentation
¶
Overview ¶
Package diagram provides DOT format generation for workflow visualization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckGraphviz ¶
func CheckGraphviz() bool
CheckGraphviz detects if the graphviz dot command is available in PATH. Returns true if dot command is found and executable, false otherwise. Used to validate graphviz availability before image export operations.
func Export ¶
Export converts DOT format input to an image file using graphviz. The output format is determined by the file extension of outputPath:
- .png → PNG image
- .svg → SVG vector
- .pdf → PDF document
- .dot → raw DOT file (no conversion)
Returns an error if graphviz is not installed or conversion fails.
Types ¶
type DiagramConfig ¶
type DiagramConfig struct {
Direction Direction // graph layout direction
OutputPath string // file path for image export (empty = stdout)
Highlight string // step name to highlight
ShowLabels bool // show transition labels
}
DiagramConfig holds configuration for diagram generation.
func NewDefaultConfig ¶
func NewDefaultConfig() *DiagramConfig
NewDefaultConfig creates a DiagramConfig with sensible defaults.
func (*DiagramConfig) Validate ¶
func (c *DiagramConfig) Validate() error
Validate checks if the configuration is valid.
type Direction ¶
type Direction string
Direction controls the graph layout direction.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates DOT format output from workflow definitions.
func NewGenerator ¶
func NewGenerator(config *DiagramConfig) *Generator
NewGenerator creates a new DOT generator with the given configuration.