Documentation
¶
Index ¶
Constants ¶
const DefaultDirection = DirectionLR
DefaultDirection is the default layout direction for graphs.
Variables ¶
This section is empty.
Functions ¶
func BuildNodeNames ¶
BuildNodeNames returns stable, distinct display names for file paths. Paths that share the same base name are disambiguated by increasing path suffix depth.
func SupportedDirections ¶ added in v0.16.2
func SupportedDirections() string
SupportedDirections returns a list of all supported direction names.
func SupportedFormats ¶
func SupportedFormats() string
SupportedFormats returns a list of all supported output format names.
Types ¶
type Formatter ¶
type Formatter interface {
// Format converts a dependency graph to a formatted string representation.
Format(g depgraph.FileDependencyGraph, opts RenderOptions) (string, error)
// GenerateURL creates a shareable URL for the formatted output.
// Returns the URL and true if supported, or ("", false) if not.
GenerateURL(output string) (string, bool)
}
Formatter is the interface that all graph formatters must implement.
func NewFormatter ¶
NewFormatter creates a Formatter for the provided output format string.
type GraphDirection ¶ added in v0.16.2
type GraphDirection string
GraphDirection represents the direction of the graph layout.
const ( DirectionLR GraphDirection = "LR" DirectionRL GraphDirection = "RL" DirectionTB GraphDirection = "TB" DirectionBT GraphDirection = "BT" )
func ParseDirection ¶ added in v0.16.2
func ParseDirection(s string) (GraphDirection, bool)
ParseDirection converts a string to GraphDirection.
func (GraphDirection) String ¶ added in v0.16.2
func (d GraphDirection) String() string
String returns the canonical string representation.
func (GraphDirection) StringLower ¶ added in v0.16.2
func (d GraphDirection) StringLower() string
StringLower returns the canonical string representation in lowercase.
type OutputFormat ¶
type OutputFormat int
OutputFormat represents an output format type
const ( OutputFormatDOT OutputFormat = iota OutputFormatMermaid )
func ParseOutputFormat ¶
func ParseOutputFormat(s string) (OutputFormat, bool)
ParseOutputFormat converts a string to OutputFormat
func (OutputFormat) String ¶
func (f OutputFormat) String() string
String returns the string representation of the format
type RenderOptions ¶
type RenderOptions struct {
// Label is an optional title or label for the graph output.
Label string
// Direction is the layout direction for the graph.
Direction GraphDirection
}
RenderOptions contains output-specific rendering options.