RFR: 8343705: IGV: Interactive Node Moving in Hierarchical Layout [v2]

Tobias Holenstein tholenstein at openjdk.org
Fri Nov 29 11:40:53 UTC 2024


> This PR depends on https://github.com/openjdk/jdk/pull/22402 . To check out this PR locally:
> `git fetch https://git.openjdk.org/jdk.git pull/22430/head:pull/22430`
> `git checkout pull/22430`
> 
> This pull request enhances the Ideal Graph Visualizer (IGV) by introducing an interactive feature that allows users to move nodes within the hierarchical layout by dragging them to new positions. This manual adjustment helps users better understand and explore the graph structure by customizing the layout according to their needs.
> 
> ## Overview
> 
> Previously, the hierarchical layout in IGV was static, and users could not adjust node positions manually. This limitation made it challenging to reorganize the graph for improved readability or to focus on specific areas of interest. With this enhancement is new:
> - Interactive Node Movement: Users can now click and drag nodes to new positions within the graph.
> - Dynamic Edge Adjustment: When nodes are moved, connected edges adjust dynamically to maintain the graph's structure.
> - Layer Management: Nodes can be moved within the same layer or across different layers, with the layout updating accordingly.
> - Persistent Positions: Moved nodes remain in their new positions until the layout is reset or the nodes are moved again.
> 
> ## Limitations
> - Interactive Node Moving only works in `Sea of nodes` view with `cut long edges` off. (The standard option for IGV)
> - Currently, no empty layers are allowed in the layout, so users cannot introduce a horizontal gap between nodes that only contains edges.
> - To move long straight edges, it's best to drag the top part of the edges around.
> When the graph changes - for example, when nodes are removed or hidden, or layers are applied - the rearrangements are lost since the graph gets re-laid out. To preserve rearrangements, support for a stable incremental layout algorithm would be needed.
> 
> ## Main Changes
> ### LayoutMover Interface
> Created a new interface `LayoutMover` with methods `moveVertex`, `moveVertices`, and `moveLink`.
> `HierarchicalLayoutManager` now implements `LayoutMover`, providing concrete implementations for these methods.
> 
> ###  Enhancements to HierarchicalLayoutManager
> Improved the `HierarchicalLayoutManager` so it can handle moving nodes interactively. Added methods to move single nodes or multiple nodes, and to adjust links. Nodes can now be moved within the same layer or to different layers while keeping the graph consistent. Also added a `writeBack` method to apply these changes.
> 
> ...

Tobias Holenstein has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:

 - Merge branch 'pr/22402' into JDK-8343705
 - Merge branch 'pr/22402' into JDK-8343705
 - 8343705: IGV: Interactive Node Moving in Hierarchical Layout

-------------

Changes: https://git.openjdk.org/jdk/pull/22430/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22430&range=01
  Stats: 1300 lines in 9 files changed: 1287 ins; 3 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/22430.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22430/head:pull/22430

PR: https://git.openjdk.org/jdk/pull/22430


More information about the hotspot-compiler-dev mailing list