mkalus / segrada

Segrada - Semantic Graph Database
http://www.segrada.org/
Other
68 stars 14 forks source link

[Wish List] - Possible to manually save and lock the position of single nodes in a graph #73

Closed StoltHD closed 3 years ago

StoltHD commented 3 years ago

When you get larger graph, often both text and edges overlap, it is possible to drag the Nodes out, but it would be great if there was a feature to save and lock the position of a moved Node in the Graph, so that it stayed at the same position until it was manually moved or unlocked again. This would help create graphs that was easy to navigate.

Saving the complete graph view is not the same, since it will change when you reload it.

mkalus commented 3 years ago

Implemented and scheduled for next release.

StoltHD commented 3 years ago

This doesn't work,

When I drag a node in the graph to move it to a new location it automatically get drag back by the algorithm when I release the left mouse button.

If I try to right click + drag the same happens, even if I try to fix the node in the location I want it.

If this should be useable, it is important that the "automatic redrawing" of the graph doesn't affect the Node that is manually repositioned.

At the moment the "fix node" only fix a node to the location where the algorithm first placed it. It is not possible to manually place a Node in the graph.

there also is another problem, and that is that there is no way to relocate a multi-edged node, it always jump back to it's original position in the graph after it has been repositioned.

It seems that the edges somehow is locked in length and by that the graph algorithm do no allow manual repositioning of nodes.

mkalus commented 3 years ago

You are right - I will look into this. I guess, I there is a way to disable physics in vis.js 😄

StoltHD commented 3 years ago

I am not sure, but it might be a way to customize the length and weight of the edges for the moved Nodes.

If it is possible to pick up the "new" length of the edge, the Node will not be moved back by the physics/algorithm.

This is possible with the cytoscape.js.


I use Foam for Visual Code, and they use Vis.js i think I shall do a test there to see ...

quick test in Foam display the same problem when dragging Nodes, but they do not have a "Lock Node Position" feature yet.

StoltHD commented 3 years ago

You can disable the physics for a fixed node... https://visjs.github.io/vis-network/docs/network/nodes.html

How to do it I do not know, but if the physics is of for a node it will only be possible to move it manually, and that would be of great help...

So maybe you could just add a second item to the context menu for the Node, Physics on/off?

Them it might be possible to both move a node to a custom position in the graph and lock it there...

mkalus commented 3 years ago

I found an option to turn physics on or off for nodes - I replace fixing with this and it works fine.

StoltHD commented 3 years ago

There is still a problem with this...

The manually repositioning of Nodes works well, but if you reload a graph, all the manual work is gone...

So I think you need to use both the "Fixed Nodes" and the "turn of physics" option to be able to both manually move Nodes, and to lock them to the new position in the graph...