3.6. Data trees
Data Trees in Grasshopper
Data Trees extended:
Download example file for Data Trees (extended):
GH FileData Structure
We can subdivide data structure into 3 different groups:
Single
Many components operates on individual values and also output individual values as result:
List
Other category of components create lists of data from single input values:
occurring also the opposite behavior:Many components only operates on lists of data and also output list of data:
Tree
Some few components output several list points, each of them representing a row or column in a grid:
we can also access to specific items in this data tree:
or we can just operate them keeping or modifying its data tree structure:
Data Tree
It is important to understand how large quantities of data are stored, accessed, and manipulated.
A Data Tree is a hierarchical structure for storing data in Nested Lists or Sub-Lists.
These nested sub-lists work in the same way as folder structures on your computer in that accessing indexed items require moving through paths that are informed by their generation of parent lists and their own sub-index.
Difference between List (Flatten) and Data Tree (Graft):
Tree visualization
Params > Util > Param Viewer
Flatten tree
Flatten removes all levels of a Data Tree, resulting in a single List.
Sets > Tree > Flatten Tree
Graft Tree
Graft Tree creates a new Branch for every Data Item.
Sets > Tree > Graft Tree
Simplify tree
Simplify a data tree by removing the overlap shared amongst all branches.
Sets > Tree > Simplify Tree
Flip Matrix
Flip Matrix component Swaps the “Rows” and “Columns” of a Data Tree with two Path Indices.
Sets > Tree > Flip Matrix