Changing visibility and affecting location


Taking a look at the KanBan example. If I was to have different nodes with different colours.

I would like to toggle the visibilty of each one of a certain color, this I can do no problem. What I have an issue with is retaining the position of each one where it should be. For example if I hide all but the blue color, all the blue colored ones will naturally move to the top and that is expected, as I bring the others back into view so they’re all showing again, I notice that the position for them will be different.

Is there a way to retain the location during the showing and hiding?


The positioning of nodes is primarily the responsibility of the layout. In the case of the regular nodes in the Kanban sample, that is the Group.layout for each group, which would be an instance of GridLayout.

But in order to support the user’s manually re-ordering of the nodes vertically in each group, the GridLayout.comparer function has been specified so that it takes the current Part.location .y value in order to sort the nodes.

So you need to figure out whether you still want to support that functionality. If so, you need to decide exactly how to implement the sorting of the nodes when some of them might be invisible because you have made them so.