Skip to content

fix(visualization): keep layer arrow in frame for linear flows#536

Open
shantoshdurai wants to merge 1 commit into
TeamGraphix:masterfrom
shantoshdurai:fix/535-linear-flow-layer-arrow
Open

fix(visualization): keep layer arrow in frame for linear flows#536
shantoshdurai wants to merge 1 commit into
TeamGraphix:masterfrom
shantoshdurai:fix/535-linear-flow-layer-arrow

Conversation

@shantoshdurai

Copy link
Copy Markdown

Fixes #535

Linear open graphs place every node on one row, so ymin == ymax. Layer labels use fixed point offsets below plot_lims.ymin, but the ymin adjustment in _draw_layers ran before axis limits were set, so the data/display transform was degenerate and the "Layer" arrow ended up below the plot frame.

Changes

  • Set preliminary plot limits before _draw_layers so point-based offsets map correctly
  • Expand ymin to include layer label height (va='top') plus padding
  • Enforce a minimum vertical axis span in _set_plot_lims when node rows collapse to one line
  • Add regression test test_linear_causal_flow_layer_label_in_frame

Verify

pytest tests/test_visualization.py::test_linear_causal_flow_layer_label_in_frame -q

Set preliminary plot limits before drawing layer annotations so
point-based offsets map correctly when all nodes share one y row.
Expand ymin for layer label height and enforce a minimum vertical
axis span for degenerate layouts.

Fixes TeamGraphix#535
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.83%. Comparing base (af1c16d) to head (03302b3).

Files with missing lines Patch % Lines
graphix/visualization.py 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #536      +/-   ##
==========================================
- Coverage   88.85%   88.83%   -0.03%     
==========================================
  Files          49       49              
  Lines        7135     7146      +11     
==========================================
+ Hits         6340     6348       +8     
- Misses        795      798       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matulni

matulni commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Hi @shantoshdurai, thanks for your contribution!
Our policy is that CI should pass before engaging in a PR review. Don't hesitate to ask if you have any questions.

In addition, to clear up any possible confusion, note that this issue is not part of UnitaryHack 2026, and there is no bounty on it.

@thierry-martinez

Copy link
Copy Markdown
Collaborator

The CI is broken because of a new Matplotlib release. It was fixed in  #541, which has now been merged. Could you merge the current master into your branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Measurement order arrow outside of frame in flow visualisation

3 participants