Skip to content

Conversation

@Mohammad-Tayyab-Frequenz
Copy link
Contributor

@Mohammad-Tayyab-Frequenz Mohammad-Tayyab-Frequenz commented Jan 21, 2026

This PR fixes the ordering of component layers in graph visualizations by introducing a new ordering algorithm that ensures children of earlier parents are positioned above children of later parents, improving visual readability.

Changes:

  • Added _order_layers method to order nodes within each layer based on parent positions
  • Modified compute_layout to use the new ordering method before building positions
  • Updated _build_positions to use pre-ordered nodes instead of sorting internally

@github-actions github-actions bot added the part:tests Affects the unit, integration and performance (benchmarks) tests label Jan 21, 2026
@github-actions github-actions bot added the part:docs Affects the documentation label Jan 21, 2026
Copy link

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 fixes the ordering of component layers in graph visualizations by introducing a new ordering algorithm that ensures children of earlier parents are positioned above children of later parents, improving visual readability.

Changes:

  • Added _order_layers method to order nodes within each layer based on parent positions
  • Modified compute_layout to use the new ordering method before building positions
  • Updated _build_positions to use pre-ordered nodes instead of sorting internally

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/frequenz/gridpool/cli/_render_graph.py Implements new _order_layers method and integrates it into the layout computation pipeline; removes internal sorting from _build_positions
tests/test_render_graph.py Updates existing test to reflect pre-ordered node input; adds new integration test to verify children maintain parent ordering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cwasicki
cwasicki previously approved these changes Jan 21, 2026
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
@Mohammad-Tayyab-Frequenz Mohammad-Tayyab-Frequenz added this pull request to the merge queue Jan 21, 2026
Merged via the queue into frequenz-floss:v0.x.x with commit 753b4f4 Jan 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants