layout

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine handles the layout calculation

func NewEngine

func NewEngine(config *decision_tree.Config) *Engine

NewEngine creates a new layout engine

func (*Engine) CalculateLayout

func (e *Engine) CalculateLayout(root *decision_tree.Node) *LayoutNode

CalculateLayout computes the layout for the entire tree

func (*Engine) SetCenterParent

func (e *Engine) SetCenterParent(center bool)

SetCenterParent sets whether parents should be centered over their children

type LayoutNode

type LayoutNode struct {
	Node      *decision_tree.Node
	X, Y      float64 // Final coordinates
	Width     float64 // Node width based on text
	Height    float64 // Node height
	Level     int     // Tree depth level
	LeafCount int     // Number of leaf nodes under this node
	Parent    *LayoutNode
	Children  []*LayoutNode // Layout-specific children
	Style     *decision_tree.NodeStyle
	IsLeaf    bool // Whether this is a leaf node
	LeafIndex int  // Sequential index for leaf nodes
}

LayoutNode represents a node with layout information

type LevelInfo added in v0.0.18

type LevelInfo struct {
	// contains filtered or unexported fields
}

LevelInfo holds information about nodes at a specific level

Jump to

Keyboard shortcuts

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