3.6. Data trees

Data Trees in Grasshopper

Data Trees extended:

Download example file for Data Trees (extended):

GH File

Data Structure

We can subdivide data structure into 3 different groups:

Data structure

Single

Many components operates on individual values and also output individual values as result:

1:1

List

Other category of components create lists of data from single input values:

1:N occurring also the opposite behavior: N:1

Many components only operates on lists of data and also output list of data:

N:N

Tree

Some few components output several list points, each of them representing a row or column in a grid:

1:N'

we can also access to specific items in this data tree:

N':1

or we can just operate them keeping or modifying its data tree structure:

N':N'

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.

Data Tree I

Difference between List (Flatten) and Data Tree (Graft):

Data Tree II

Tree visualization

Params > Util > Param Viewer

Param viewer

Flatten tree

Flatten removes all levels of a Data Tree, resulting in a single List.

Sets > Tree > Flatten Tree

Flatten

Graft Tree

Graft Tree creates a new Branch for every Data Item.

Sets > Tree > Graft Tree

Graft

Simplify tree

Simplify a data tree by removing the overlap shared amongst all branches.

Sets > Tree > Simplify Tree

Simplify

Flip Matrix

Flip Matrix component Swaps the “Rows” and “Columns” of a Data Tree with two Path Indices.

Sets > Tree > Flip Matrix

Flip

Knowledge Checks