Tree Editting-Turn each leaf an individual branch

Hi Guys:

Do you know how to make each leaf(the lowest level of the tree) an individual branch? There are multiple items inside each leaf.

something like this:

Thank you all for your help!

There are really multiple ways to solve it. Please see detail image below.
The brief conclusion here:
1, “Flatten List” —> “Partition List” by the length of each list, gained through “Tree Statistics”
2, “Path Mapper” —> {A;B} >>> {path_index}
3, “Renumber Paths” component in Tree Sloth plugin
4, “Replace Path” component: Extract paths through “Tree Statistics” and give each path a new name through “Series” component

Graft will add an additional layer of branching, that gives one item per branch.

(ignore, i misunderstood the question) See below.

Flatten, then partition. Also Tree Sloth has a component for that called renumber paths.

i think you’re looking for the path mapper
{A;B} > {path_index}

2 Likes

Thank you Amir! That solved the question!

Thank you!! That will solve most of the situations. But there might be a problem when items in each list are not equal?

Just be careful if your data changes in path length, the path mapper wont work unless you also change it. If you want some parametric options.

Thank you Rickson

Nope, it is taking the length of each list and using it to partition. That is why I use the tree stats component.

2 Likes

There are really multiple ways to solve. Thank you! The “Flatten-Partition” workflow might be the most versatile solution?

One more option.

1 Like

I cannot think of a way to do it with less components (tree stats + partition) unless you want to use the Tree Sloth renumber paths component.