import{_ as t,a,b as r,ag as d}from"./chunks/framework.BcrMLAmg.js";const p=JSON.parse('{"title":"Tree","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Tree.md","filePath":"references/elements/Tree.md","lastUpdated":1757844696000}'),o={name:"references/elements/Tree.md"};function l(n,e,s,i,c,h){return r(),a("div",null,e[0]||(e[0]=[d('

Tree

This is the tree class. It provides a hierarchical view of nodes that can be expanded and collapsed,with support for selection and scrolling.

Extends: VisualElement

Properties

PropertyTypeDefaultDescription
nodestable{}The tree structure containing node objects with {text, children} properties
expandedNodestable{}Table of nodes that are currently expanded
scrollOffsetnumber0Current vertical scroll position
horizontalOffsetnumber0Current horizontal scroll position
nodeColorcolorwhiteColor of unselected nodes
selectedColorcolorlightBlueBackground color of selected node

Functions

MethodReturnsDescription
Tree:expandNodeTreeExpands a node to show its children
Tree:collapseNodeTreeCollapses a node to hide its children
Tree:toggleNodeTreeToggles between expanded and collapsed state
Tree:onSelectTreeRegisters a callback for when a node is selected
Tree:getNodeSizenumber, numberGets the size of the tree

Tree:expandNode(node)

Expands a node

Parameters

Returns

Tree:collapseNode(node)

Collapses a node

Parameters

Returns

Tree:toggleNode(node)

Toggles a node's expanded state

Parameters

Returns

Tree:onSelect(callback)

Registers a callback for when a node is selected

Parameters

Returns

Tree:getNodeSize()

Gets the size of the tree

Returns

',35)]))}const b=t(o,[["render",l]]);export{p as __pageData,b as default};