Key Action ↑ / kMove up ↓ / jMove down → / lExpand or move into first child ← / hCollapse or move to parent Home / gJump to first node End / GJump to last node PgUpPage up PgDnPage down Ctrl+UHalf-page up Ctrl+DHalf-page down Space / oToggle expand/collapse EnterSelect node (fires onSelect)
GraphTree is optimized for workflow/pipeline DAGs where nodes may have status states (running, success, failed, etc.). Node colors and icons reflect the Status field. Use the standard Tree component for general hierarchical data.
catppuccin-frappe catppuccin-latte catppuccin-macchiato catppuccin-mocha dracula dracula-light everforest-dark everforest-light github-dark github-light gruvbox-dark gruvbox-light kanagawa monokai nord onedark onelight rosepine rosepine-dawn rosepine-moon solarized-dark solarized-light tokyonight-day tokyonight-moon tokyonight-night tokyonight-storm
Usage data := components . NewGraphTreeData ()
data . AddNode ( & components.GraphTreeNode{ ID : " root " , Label : " Workflow " , Status : " Running " , Children : [] string { " step1 " }, Expanded : true })
data . AddNode ( & components.GraphTreeNode{ ID : " step1 " , Label : " Validate " , Status : " Completed " })
tree := components . NewGraphTree ().
Methods Method Signature Description GetSelected func (t *GraphTree) GetSelected() *GraphTreeNode GetSelected returns the currently selected node. SetData func (t *GraphTree) SetData(data *GraphTreeData) *GraphTree SetData sets the tree data. SetOnChange func (t *GraphTree) SetOnChange(fn func(node *GraphTreeNode)) *GraphTree SetOnChange sets the callback for selection changes. SetOnLoadChildren func (t *GraphTree) SetOnLoadChildren(fn func(nodeID string) ([]*GraphTreeNode, []*GraphTreeEdge)) *GraphTree SetOnLoadChildren sets the lazy loading callback. SetOnSelect func (t *GraphTree) SetOnSelect(fn func(node *GraphTreeNode)) *GraphTree SetOnSelect sets the callback for node selection (Enter). SetShowEdgeLabels func (t *GraphTree) SetShowEdgeLabels(show bool) *GraphTree SetShowEdgeLabels enables/disables edge label display.
Types Field Type Description RootID string
Field Type Description From string To string Type GraphEdgeType Label string Optional edge label
Field Type Description ID string Label string Sublabel string Secondary text (e.g., workflow type) Status string Status for coloring (e.g., "Running", "Completed") NodeType GraphNodeType Visual type Children []string Child node IDs CanExpand bool Whether node can have children loaded Expanded bool Whether children are visible Loading bool Show loading indicator Depth int Depth in tree Data any Associated data
Constant Description GraphEdgeSolid GraphEdgeDashed GraphEdgeDotted
Constant Description GraphNodePrimary GraphNodeSecondary GraphNodeLink