017 – Organise your Grasshopper graph with data trees
Updated: May 16
Data Trees
Data trees are a great way to organise your data! Grasshopper operations will give different results depending on the tree structure of the inputs. In this video we will take a look at a simple list with numbers, all numbers are in one branch {0}.
Organising your Grasshopper graph using data trees provides several benefits. Data trees allow you to structure and manage large amounts of data in a hierarchical manner, making it easier to understand and maintain. They also provide a way to reuse information throughout your graph, reducing the amount of duplicated data and improving efficiency.
Prerequisite: Set up a list with numbers.
Steps:
Step 1: We need to graft this list so each item is placed in its own branch. Connect the 'list' to the 'number' with a wire.

Step 2: Then connect this to a 'panel' on the other side of the 'number'.

Step 3: Right click on the 'number' and choose "graft".

Tip: You can see the difference in a more visual way using the 'param viewer' component.

Step 4: When we take the grafted list and use the 'flatten' option we remove all existing branches and place all items in one branch.

Learn more
You can also watch the full video on data trees over on our YouTube channel. Read our previous blog post or sign up to our platform here to put your Grasshopper models online and share them.