Interface CustomNodeElementProps

The props that Tree passes to the renderCustomNodeElement function.

interface CustomNodeElementProps {
    addChildren: AddChildrenFunction;
    hierarchyPointNode: HierarchyPointNode<TreeNodeDatum>;
    nodeDatum: TreeNodeDatum;
    onNodeClick: SyntheticEventHandler;
    onNodeMouseOut: SyntheticEventHandler;
    onNodeMouseOver: SyntheticEventHandler;
    toggleNode: () => void;
}

Properties

addChildren: AddChildrenFunction

Appends the given nodes to this node's children.

hierarchyPointNode: HierarchyPointNode<TreeNodeDatum>

The D3 HierarchyPointNode for the node, which holds nodeDatum along with the node's position, parent, and children.

nodeDatum: TreeNodeDatum

The node's data.

Calls the onNodeClick prop and, if dimensions is set, centers the node.

onNodeMouseOut: SyntheticEventHandler

Calls the onNodeMouseOut prop.

onNodeMouseOver: SyntheticEventHandler

Calls the onNodeMouseOver prop.

toggleNode: () => void

Expands or collapses the node. Call it from the element that should toggle the node, for example a label.