tree

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectorDestinationNodeIdTag = "connectorDestination"
View Source
const ConnectorOriginNodeIdTag = "connectorOrigin"
View Source
const NodeFromTag = "nodeFrom"
View Source
const NodeIdTag = "nodeId"
View Source
const NodeIndexTag = "nodeIndex"

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeWithLevel

type NodeWithLevel[T any] struct {
	*graph.Node[T]
	Lvl int
}

type StructuredTree

type StructuredTree struct {
	Tree                 map[string]interface{} `json:"tree" yaml:"tree"`
	CircularDependencies [][]string             `json:"circularDependencies" yaml:"circularDependencies"`
	Errors               map[string][]string    `json:"errors" yaml:"errors"`
}

type Tree

type Tree[T any] struct {
	Graph      *graph.Graph[T]
	NodeParser graph.NodeParser[T]

	Nodes  []*NodeWithLevel[T]
	Cycles []graph.Cycle
	// contains filtered or unexported fields
}

func NewTree

func NewTree[T any](
	files []string,
	parser graph.NodeParser[T],
	display func(node *graph.Node[T]) string,
	callbacks graph.LoadCallbacks[T],
) (*Tree[T], error)

func (*Tree[T]) Render

func (t *Tree[T]) Render() (*board.Board, error)

func (*Tree[T]) RenderStructured

func (t *Tree[T]) RenderStructured() (string, error)

Jump to

Keyboard shortcuts

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