Sort Tree by values, keep paths

Hi All,

I’m trying to sort a data tree by the values within it.
I extracted the value of interest (in my case, the 0th value), sorted it, and kepth the paths. Then I used the replace component (as suggested by a different forum post), but the results were unexpected.

In the image below, I have the input data on the left, with the lowest 3 values shown. In the bottom right, I have the sorted values and paths correct. In the top right, is the replaced values with unpredictable data, and the paths unchanged.

I would like to see the output to be the same data and paths as the input, but ordered by the input value.

As I’m writing this, I’m wondering - can paths even be re-arranged? I guess that’s like reordering the indices of a list, which doesn’t make sense.

Thanks in Advance.

Hi,

This doesn’t solve the problem as I hope.

In your example, value 5 {0;7} becomes 5 {0;9} - I want the values to retain the same path, but to change position in the list for ease of inspection.

As mentioned in my original post - I accept if this is not possible (assuming the path defines the position in the list)

share your file?

this might be one way, first sort the data tree then replace paths

please next time attach a GH file.gh (19.8 KB)

1 Like

share your file