typedb-studio icon indicating copy to clipboard operation
typedb-studio copied to clipboard

Maintain shape positioning in the graph

Open mathieuisabel opened this issue 3 years ago • 3 comments

Please replace every line in curly brackets ( { like this } ) with appropriate answers, and remove this line.

Problem to Solve

When you run the same query over and over, you often to reposition the nodes in the graph to make sense of it at each query execution.

Current Workaround

None

Proposed Solution

Provide a way to maintain/persist node positioning for a particular query.

Additional Information

mathieuisabel avatar Jun 03 '22 16:06 mathieuisabel

Right, I think this can be implemented with the following components:

  1. A toggle-button called "Remember layout" or similar. When clicked, add X+Y (gravity) forces to each vertex in the graph that gravitate the vertices towards their position at the time of clicking "Remember layout", and memorise which IID/Label is associated to each force. "Remember layout" is set on a per-File basis.
  2. On rerunning the query without modification, retain these X+Y forces so that each vertex gravitates back to its memorised position.
  3. On modifying the query file, if "Remember layout" is toggled ON, toggle it off and forget any memorised layout.

In the future, it would potentially be useful to save and load memorised layouts to disk. We should consider this when designing the feature.

alexjpwalker avatar Jun 06 '22 15:06 alexjpwalker

There are probably considerations to be able to exchange that layout between people as you collaborate.

mathieuisabel avatar Jun 06 '22 15:06 mathieuisabel

An interesting point. Provided all collaborators are connected to the same database server, the above strategy (where a layout is a map of IIDs/Labels to positions), with ability to save & load layouts to disk, would allow everyone to get the same layout when they perform that query.

alexjpwalker avatar Jun 06 '22 15:06 alexjpwalker