vym icon indicating copy to clipboard operation
vym copied to clipboard

MapEditor: Collapse/scroll unselected levels (like in TreeEditor)

Open aloparev opened this issue 2 years ago • 7 comments

As a power user, I create big trees with many children. As a result, it gets difficult to see through and navigate. It looks like (un)folding could solve this problem.

Example tree: parent -- son -- daughter

In the default view, all three elements should be visible. After folding, only the parent node should be visible. A graphical indicator that the parent holds folded children would be helpful.

Appreciate your time and efforts with VYM, Uwe!

aloparev avatar Mar 07 '23 08:03 aloparev

Cool, I am not the only power user :-)

Here's my approach to bigger maps (need to make a video one day to show this):

I have the TreeEditor open (usually left of the map). Select "Parent" and then press the "<" key - every subtree folds in the TreeEditor at least, which I mainly use for navigation. Similar if you would select "son" first: All siblings of parents would fold and also everything down to the son/daughter level.

Is that something you would need in the MapEditor, too?

Maybe could be scripted, or implemented in the code itself...

insilmaril avatar Mar 07 '23 10:03 insilmaril

Yeah, the way it works in TreeEditor is exactly how I imagine it for MapEditor too.

Maybe could be scripted, or implemented in the code itself...

Is that sth I do on my end? If so, please tell me more.

aloparev avatar Mar 07 '23 16:03 aloparev

You could open the script editor and script output (e.g. Alt+S and A+Shift+S) and start with this (copied mostly from demos/scripts/iterating-branches.vys):

vym.clearConsole();
m1 = vym.currentMap();

m1.initIterator("foobar");
print ("Starting with branch: " + m1.getHeadingPlainText() );

while (m1.nextIterator("foobar") )
{
	print ("Selected branch: " + m1.getHeadingPlainText() );
	if (m1.isScrolled()) {
		print ("  is scrolled");
	}	
}

At the moment there is no command available returning the current depth(), I try to add that to the next beta-5, could be useful in that context

insilmaril avatar Mar 08 '23 11:03 insilmaril

For reference: The current code for collapsing in TreeEditor is in https://github.com/insilmaril/vym/blob/e33f8fb9ccea3eb2f4a2182672580ee09bbcf3da/src/vymview.cpp#L261

insilmaril avatar Mar 08 '23 16:03 insilmaril

This feature is already provided, it is called scroll.

GReagle avatar Oct 27 '23 17:10 GReagle

This feature is already provided, it is called scroll.

Not exactly: As I understood it the new feature would be to scroll everything which is not the already selected branch. This is implemented in TreeEditor with the "<"-key, but not yet in MapEditor.

insilmaril avatar Nov 07 '23 08:11 insilmaril

This feature is already provided, it is called scroll.

Not exactly: As I understood it the new feature would be to scroll everything which is not the already selected branch. This is implemented in TreeEditor with the "<"-key, but not yet in MapEditor.

Thank you for explaining your understanding of the issue. In any case, hitting the "s" key in the map editor is a great feature.

GReagle avatar Nov 07 '23 19:11 GReagle