layout

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 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
	SubtreeWidth float64 // Width of entire subtree
	Parent       *LayoutNode
	Children     []*LayoutNode // Layout-specific children
	Style        *decision_tree.NodeStyle
}

LayoutNode represents a node with layout information

Jump to

Keyboard shortcuts

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