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.

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

1 participant