Spine-Toolbox
Spine-Toolbox copied to clipboard
Option to make graph view selection independent of tree selection
Creating a graph view can take a lot of time but is very valuable for visualising data. The load state/save state feature is really useful for saving a view and the selection.
However, the problem is that when you load the state, as soon as you select anything in the tree, the graph will redraw and you will lose your saved state. It is also impossible to add individual elements to the graph view becase as soon as you click on something in the tree to, for example, expand an object class, the selection has changed and the graph re-draws.
Essentially, we want to freeze the graph selection and prevent re-draws when the tree selection changes so we can browse the data.
I think we need two functionalities that will greatly enhance the utility of graph-view
- Option to separate the tree selection and graph selection, making the graph selection independent of the tree selection
- Add functionalities to add to or remove from graph selection. E.g. right now we have add_objects which allows us to create new objects and add them to the view. Instead, it would be great to have the option "add object to view" which in effect adds an object to the graph view selection. This could also be done using context menu items for the tree... we could select classes or individual entities or combinations and have the option "add to graph view". So when the option to have the graph selection independent of the tree selection, the graph selection is instead controlled by these context menu actions
It is also impossible to add individual elements to the graph view becase as soon as you click on something in the tree to, for example, expand an object class, the selection has changed and the graph re-draws.
If I click on the arrow left of the class name, it doesn't change the selections in the graph view. Also, keeping ctrl pressed allows to select multiple entities. I'm worried if these are not intuitive for the user.
On the actual question about choosing entities and showing them on the parameter value tab, but not changing the graph view:
Maybe a simpler change (to implement and to use) would be to use alt-left_click to 'half select item', so that it would not add it to the graph view but would add it to the parameter value list. We should anyway have right click context menu option too - and it should instruct about the alt-left_click shortcut. Would that be what you're after?
Alternative behavior would be that alt-left_click would empty the parameter value list first and only show the newly selected.
We would need to visualise this somehow also in the entity-tree (e.g. striped background or checkmark).
Another option would be to have two entity trees, but it's probably more clumsy. The positive would be that it would be obvious to the user.
The main issue for me, is that if I have put a lot of effort into consucting a graph view... it is very volatile and there are three reasons
- When I "load state" the associated tree selection isn't replicated, so it is actually impossible to add something to the selection because there is no selection - just some in-memory selection that one can't see
- Any kind of a mis-click will cause a re-draw
- Even if the selection were shown, it's still very awkward and fragile to add an individual entity to the selection, even with your proposed selections - again - any sort of a mis-click will cause loss of the selection and a re-draw. I think it's just too volatile/fragile to be useful for practical purposes in a large model
The first issue should be handled by replicating the tree selection when doing a "load state". I'll make an issue.
For the other two, maybe we just need a button (and a keyboard shortcut) to return to the previous selection. Then it's easy to recover from a mis-click. I think this is nice in any case, so I'll make an issue about that too.
If, in addition, we would want to maintain two different selections: one for graph view and another for parameter value, we need to allow those selections from context menu, from the tree and using keyboard. And it needs to be clear for the user what's going on.
I don't personally have a problem with mis-clicks. When I'm adding elements one-by-one, then I keep ctrl pressed and there's no problem even if I mis-click. I can just click the mistakenly added entity again and have it removed. Maybe a loss of all selections happens sometimes, but it's rare enough that it hasn't bothered me.
@jkiviluo Maybe replicating the tree selection would help.
I don't think a back button solves the issue because that triggers a rebuild/redraw which takes forever.
In my use case where I have the biggest issues, I'm working with a representation of the Irish transmission grid and any click which alters the selection, which is basically any click, will trigger a redraw which takes a long time and makes working with the graphview impossible and relegates it just useful for show purposes.
Maybe it's a fourth view class... static graph view? Or just a mode where the graph selection is independent of the tree selection
If you replicated the tree selection and also turned off automatic re-drawing, that might help... but it doesn't solve the issue that if you click on anything you lose the selection and it would be hard to go back. One of the problems here is that the treeview isn't great for complex selections - I think for it to be practical, you need to be able to add to and remove from the graph selection without using the tree as it;s not practical for that.
I suppose you have coordinates for all entities in the Irish case. Graph view shouldn't need to run the algorithm and redraw everything. It should be enough just to add/remove whatever that single click is pointing to. So, I think we should improve the drawing routines.
For the case where the user is not providing geo-coordinates, maybe we should have rather have the algorithm sort out pseudo-coordinates once and then remember those. One should of course be able to trigger a recalculation whenever needed.
There needs to be all: ability to add from the graph (right-click context menu), use the tree view and using the keyboard shortcuts. It depends on the model size and the user which is most applicable.