@stereograph/teiaviewer - v17.8.0-dev
    Preparing search index...

    Interface TreeViewProps<TNode>

    interface TreeViewProps<TNode extends TreeNode> {
        autoExpandParentWithSelectedChildren?: boolean;
        autoScrollToLastSelected?: boolean;
        className?: string;
        getNodeChildren: (node: TNode) => TNode[];
        getNodeDisplayChildrenCount?: (node: TNode) => number;
        getNodeIcon?: (
            node: TNode,
        ) =>
            | ForwardRefExoticComponent<
                SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>,
            >
            | FC<SVGProps<SVGSVGElement>>;
        getNodeMaxChildrenCount?: (node: TNode) => number;
        getNodeParent: (node: TNode) => null | TNode;
        isNodeExpandable?: (node: TNode) => boolean;
        isNodeLoading?: (node: TNode) => boolean;
        NodeActions?: (node: TNode) => Element;
        nodeClassName?: string;
        nodes: TNode[];
        onLoadMoreChildren?: (node: TNode) => void;
        onLoadMoreRootNodes?: () => void;
        onNodeClick?: (event: MouseEvent, node: TNode) => void;
        onNodeCollapsed?: (node: TNode) => void;
        onNodeExpanded?: (node: TNode) => void;
        selectedNodes?: Set<string>;
        showChildrenCountLabel?: boolean;
        showRootLoadMore?: boolean;
    }

    Type Parameters

    Index

    Properties

    autoExpandParentWithSelectedChildren?: boolean

    Allow treeview to auto-expand when selecting nodes in 3D

    autoScrollToLastSelected?: boolean

    Scroll to the last selected node in 3D if the node wasn't visible

    className?: string

    Style applied to the root element of the treeview

    getNodeChildren: (node: TNode) => TNode[]

    Returns the children of the given node

    Type declaration

    getNodeDisplayChildrenCount?: (node: TNode) => number

    Returns the number of children that will be display under a given node. That number is capped by the TNode.children children length.

    Type declaration

      • (node: TNode): number
      • Parameters

        Returns number

    getNodeIcon?: (
        node: TNode,
    ) =>
        | ForwardRefExoticComponent<
            SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>,
        >
        | FC<SVGProps<SVGSVGElement>>

    Returns the icon to be used with the node

    Type declaration

      • (
            node: TNode,
        ):
            | ForwardRefExoticComponent<
                SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>,
            >
            | FC<SVGProps<SVGSVGElement>>
      • Parameters

        Returns
            | ForwardRefExoticComponent<
                SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>,
            >
            | FC<SVGProps<SVGSVGElement>>

        null by default

    getNodeMaxChildrenCount?: (node: TNode) => number

    Returns the maximum children possible for a given node. Useful when building a lazy load tree view

    Type declaration

      • (node: TNode): number
      • Parameters

        Returns number

    getNodeParent: (node: TNode) => null | TNode

    Returns the parent of the given node if any

    Type declaration

    isNodeExpandable?: (node: TNode) => boolean

    Returns whether the given node should be expandable of not

    Type declaration

      • (node: TNode): boolean
      • Parameters

        Returns boolean

        true by default

    isNodeLoading?: (node: TNode) => boolean

    Displays a loader when clicking on a dynamic node

    NodeActions?: (node: TNode) => Element

    Actions Component displayed and aligned to the right of the node name

    Type declaration

      • (node: TNode): Element
      • Parameters

        • node: TNode

          The node for which to display the action component

        Returns Element

    nodeClassName?: string

    Style applied to the nodes of the tree

    nodes: TNode[]

    Array of root nodes

    onLoadMoreChildren?: (node: TNode) => void

    Callback when more children need to be loaded for the given node

    Type declaration

      • (node: TNode): void
      • Parameters

        Returns void

    onLoadMoreRootNodes?: () => void

    Callback when more root nodes need to be loaded

    Type declaration

      • (): void
      • Returns void

    onNodeClick?: (event: MouseEvent, node: TNode) => void

    Callback when a tree node is clicked

    Type declaration

      • (event: MouseEvent, node: TNode): void
      • Parameters

        • event: MouseEvent

          The associated mouse event

        • node: TNode

          Clicked node

        Returns void

    onNodeCollapsed?: (node: TNode) => void

    Callback when the given node is collapsed

    Type declaration

      • (node: TNode): void
      • Parameters

        Returns void

    onNodeExpanded?: (node: TNode) => void

    Callback when the given node is expanded

    Type declaration

      • (node: TNode): void
      • Parameters

        Returns void

    selectedNodes?: Set<string>

    Set of selected node ids

    showChildrenCountLabel?: boolean

    Whether to show to number of max children in parenthesis next to the name

    showRootLoadMore?: boolean

    Whether to show the root load more button

    false