Skip to content

Charts: axis fits close runs, target on every availability chart, Results can be maximised - #337

Merged
danyill merged 3 commits into
mainfrom
fix/charts-range-target-maximise
Nov 19, 2026
Merged

danyill merged 3 commits into
mainfrom
fix/charts-range-target-maximise

Conversation

@danyill

@danyill danyill commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #336.

Charts: an axis that fits, the target on every availability chart, and a Results panel you can see whole.

Axis range. For percentages, the axis was always at least one percentage point wide. Runs between 99.85 % and 99.995 % were drawn on a 99 % to 100 % axis, all squeezed into the top sixth. A spread under one point is now drawn to fit, with a margin of a tenth of the spread. A spread under a thousandth of a point still gets the one-point axis, which keeps round ticks when every run is (nearly) identical. The target is always inside the range.

Target on more charts. The Charts page's target is now drawn on the availability ladder, the waterfall (only when it is on the availability scale), "Availability year by year" and "A bad year, as a frequency". The Target button shows on all of them. The year charts used only the run summary's own threshold, so "A bad year" said "no threshold was set" while every other chart showed the target. A dependability target is not drawn on these availability-only charts. In exported SVGs, the year chart's line is labelled "target" or "threshold" according to where it came from.

Results panel height. The Run tab caps its own height to fit its content. That cap stayed on while it was a hidden tab behind Results, so the shared bottom panel could not be dragged any taller than the Run panel (277 px in an 800 px window). The cap now applies only while Run is the tab on show. It also works for a layout restored from a saved session, which has no active tab recorded yet.

Maximise. The Results title bar has a Maximise button. It opens the Results in their own window, maximised, so the whole chart can be seen even on a short screen where the canvas keeps its minimum height. The same button, now labelled Restore, puts them back in the main window.

Tests. tests/unit/test_charts_target_range_maximise.py covers:

  • the axis range;
  • the target on the year charts, ladder and waterfall;
  • the Run cap behind Results;
  • Maximise and Restore.

One existing dock-layout test passed only because of the cap bug: both windows were capped at the same height. It now passes for the right reason. All five charts and the title bar were checked by rendering them to PNG.

…ults can be maximised

- A percentage axis under one point wide is drawn to fit (runs from
  99.85 % to 99.995 % sat in the top sixth of a 99-100 % axis).
- The page's target is drawn on the ladder, the waterfall and both year
  charts; 'A bad year' said 'no threshold was set' beside a target.
- The Run tab's content-height cap applied while it was a tab behind
  Results, so the bottom panel could not be dragged taller.
- The Results title bar has Maximise / Restore.
Restore and Redock docked the Results while they were still maximised:
the dock kept the full screen's height, the window, its status bar and
the chart's foot went off screen, and the full-screen size was remembered
as the floating size for the next Float. They now leave maximised first
(the floating window's own size is remembered), the docked height is
asked for once the layout has taken the dock back, and a window stretched
past its screen goes back inside it.
The Results title bar now starts with Maximise, so the first tool button
is no longer Minimise.
@danyill
danyill merged commit 79275e4 into main Nov 19, 2026
24 checks passed
@danyill
danyill deleted the fix/charts-range-target-maximise branch November 19, 2026 21:18
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.

Charts: axis range near 100 %, target missing on some charts, Results panel cannot be made taller

1 participant