vaticle / typedb-studio

TypeDB Studio (IDE)
https://typedb.com
Mozilla Public License 2.0
190 stars 43 forks source link

Graph layout fits to a square, making it inefficient in a rectangular view #677

Open mathieuisabel opened 1 year ago

mathieuisabel commented 1 year ago

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

Description

The graph layout is not using the available screen space.

Environment

  1. TypeDB version: 2.14.1
  2. OS of TypeDB server: Windows 11
  3. Studio version: 2.14.1
  4. OS of Studio: Windows 11
  5. Other environment details:

Reproducible Steps

Run a query with a good amount of data.

Expected Output

Graph is layout is optimized as per the viewable area.

Actual Output

image

Additional information

{ Any additional information, including logs or screenshots if you have any. }

alexjpwalker commented 1 year ago

Related:

To be honest though, I'm not sure there exists an ideal solution here. The Fruchterman-Reingold algorithm always lays vertices out in an approximately circular shape, and while we can stretch edges to occupy more space, that only "occupies more space" as opposed to "showing more content".

However, if we implement https://github.com/vaticle/typedb-studio/issues/465, then the natural aspect ratio will be something like 3:2 as opposed to the current 2:1, which will certainly look better on a rectangular canvas.

mathieuisabel commented 1 year ago

Also maybe another consideration, if we can do #676 that might help with this situation as splitting the screen vertically would make it a bit more square on 16:9/16:10. On 21:9 that might still be a problem though.