Skip to content

Conversation

Eddykasp
Copy link
Contributor

The approximator uses multiple fixed sizes to set sizes for top-down layout according to the number of nodes in a graph. It also lays out two hierarchy levels in one step to keep them at the same scale.

The LAYOUT_NEXT_LEVEL approximator lays out the given graph and sets its algorithm to fixed layout. This allows laying out multiple hierarchy levels in one pass to essentially combine bottom-up and top-down layout.

A new interface ITopdownLayoutApproximator is introduced allowing size approximators to be defined for specific layout algorithms.

The approximator uses multiple fixed sizes to set sizes for top-down
layout according to the number of nodes in a graph.
It also lays out two hierarchy levels in one step to keep them at the
same scale.

The LAYOUT_NEXT_LEVEL approximator lays out the given graph and sets its
algorithm to fixed layout. This allows laying out multiple hierarchy
levels in one pass to essentially combine bottom-up and top-down layout.

A new interface ITopdownLayoutApproximator is introduced allowing size
approximators to be defined for specific layout algorithms.
@Eddykasp Eddykasp added this to the Release 0.10.1 milestone May 13, 2025
@Eddykasp Eddykasp requested a review from soerendomroes May 13, 2025 13:30
@Eddykasp Eddykasp added new feature A new feature. alg Affects a non-specific part of ELK's algorithms. labels May 13, 2025
@Eddykasp Eddykasp requested a review from Copilot May 13, 2025 13:30
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new fixed integer size approximator for top-down graph layouts while enhancing the interface and configuration options for size approximation. Key changes include:

  • The addition of TopdownSizeApproximatorUtil containing utility methods for computing size multipliers.
  • An extension of the TopdownSizeApproximator enum with a new FIXED_INTEGER_RATIO_BOXES constant and updates to the LAYOUT_NEXT_LEVEL approximator.
  • The creation of the ITopdownSizeApproximator interface along with configuration changes in Core.melk and adjustments in RecursiveGraphLayoutEngine.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/options/TopdownSizeApproximatorUtil.java New utility class for size category multiplier computations.
plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/options/TopdownSizeApproximator.java Extended enum with FIXED_INTEGER_RATIO_BOXES and updated LAYOUT_NEXT_LEVEL logic.
plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/options/ITopdownSizeApproximator.java New interface for top-down size approximators.
plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/RecursiveGraphLayoutEngine.java Updated condition for invoking the approximator on nodes with children.
plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/Core.melk Updated configuration option type for the size approximator.

@Eddykasp Eddykasp merged commit db74e93 into eclipse-elk:master May 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alg Affects a non-specific part of ELK's algorithms. new feature A new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants