RFR: 8345041: IGV: Free Placement Mode in IGV Layout

Emanuel Peter epeter at openjdk.org
Thu Nov 28 14:57:38 UTC 2024


On Thu, 28 Nov 2024 14:51:23 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> This PR depends on https://github.com/openjdk/jdk/pull/22430. To check out this PR locally: 
>> 
>> git fetch https://git.openjdk.org/jdk.git pull/22438/head:pull/22438
>> git checkout pull/22438
>> 
>> 
>> Introduce a Free Placement Mode to IGV, allowing users to position nodes freely without being limited to the hierarchical layout constraints.
>> 
>> In this mode, users can manually drag and place nodes anywhere within the space, giving them complete control over the visual arrangement of the graph. Connections between nodes will be rendered as straight (or S curved) lines, without recalculating or enforcing hierarchical constraints.
>> 
>> This feature is ideal for users who need a flexible, non-restrictive way to organize and visualize complex graph structures in a customized and intuitive manner. The free placement of nodes will remain persistent until the layout is reset or another layout mode is selected.
>
> src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/FreeInteractiveLayoutManager.java line 219:
> 
>> 217: 
>> 218:                 double deltaX = posX - otherNode.getX();
>> 219:                 double deltaY = posY - otherNode.getY();
> 
> What happens if this distance is zero? Does the division below behave ok?

If we get issues here, we can always check for zero and add some random non-zero noise to force different position to get the two nodes to separate in a sane way.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22438#discussion_r1862335424


More information about the hotspot-compiler-dev mailing list