Flat tree :
In a flat tree, the hierarchy is flattened; nodes are not rendered inside of each other, but instead are rendered as siblings in sequence
Nested tree :
In Nested tree, children nodes are placed inside their parent node in DOM. The parent node has an outlet to keep all the children nodes.
I have an 800 elements nomenclature that I display using a flat tree.
I tried using a nested tree first, because it seemed like the most appropriate tree. It takes a blink to build it, but the DOM needs 5 seconds to load the tree, so I tried the flat tree, and it works perfectly now.
The question is, what is the point of using a nested tree if the flat tree's result is the same ? The tree is rendered correctly and the DOM understands its hierarchy.
Flat tree's DOM:
A nested tree is harder to build and clearly overloads the DOM everytime it gets displayed. What can a nested tree do, that a flat tree can't ? The Material doc is unclear.
Flat tree : In a flat tree, the hierarchy is flattened; nodes are not rendered inside of each other, but instead are rendered as siblings in sequence. Nested tree : In Nested tree, children nodes are placed inside their parent node in DOM. The parent node has an outlet to keep all the children nodes.
The mat-tree provides a Material Design styled tree that can be used to display hierarchy data. This tree builds on the foundation of the CDK tree and uses a similar interface for its data source input and template, except that its element and attribute selectors will be prefixed with mat- instead of cdk- .
Overview. The Angular TreeView is a graphical user interface component that represents hierarchical data in a tree structure. It provides great performance with its advanced features like load on demand, check boxes, multiple selection, tree navigation, drag and drop, tree node editing, and template support.
Whether the HTML is rendered dynamically via Angular or simply a flat file, there are some definite major benefits to a nested tree.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With