packages/react-examples/src/react-charting/TreeChart/docs/TreeChartBestPractices.md
The library recommends chart width based on a 12-column layout of the page and suggests using 1 of 4 standardized heights. Product teams must take into account the complexity of the data to decide what size of chart should be used.
Any interactive node must have a label at the bottom showing the number of children, even if the node is a leaf. This helps in distinguishing between nodes that have further information and ones which do not need to be interacted with. Interactive leaf nodes will have “0 nodes” as their label.
Each node can contain a heading label followed by a text label or a metric value as demonstrated in the example below.
treeTraversal to specify the tree traversal order as preorder or levelOrder. This is used to specify the navigation order of the tree while using keyboard.Tree chart has the following variants.
It displays two levels of the tree. Can be used if the space available on the screen is limited.
The long and compact composition below are applicable for terminal nodes only.
Consists of three levels of nodes, with nodes stacked one after the other. Specify composition as long to enable this variant.
Consists of three levels of nodes, with nodes side by side and then stacked one after the other.
Specify composition as compact to specify this variant.
When there is space constraint, nodes having more than 2 children are displayed as compact and nodes with less than 2 children are shown in long format.