Hopefully the title says it all. I have a special type of indexbar that shows a drilled down view of a node and its surroundings. Essentially it shows the current node, its siblings surrounding it in order, and then a certain level of its ancestors from itself (e.g. parent, grandparent). It also shows those ancestors siblings surrounding it.
It doesn't show any of the other siblings descendants however and that's where I've come unstuck with trying to generate a query for this. Do you have any hints? I think I might have to resort to firstly fetching the path for a node (to a certain height), and then looping over each of those nodes and fetching their siblings into an array and somehow sorting it.
Hope you can help :D
I ended up selecting the column nodes first, then iterating over them to form an array of siblings. I then used the arrange_nodes class method to arrange them properly :) Worked a treat!
unarranged_component_instances = selected_component_instance.path.from_depth(top_level).inject(Array.new) do |component_instances, component_instance|
component_instances << component_instance.siblings