Skip to content

DM-55379 (hotfix): Space WCS axis labels for the post-colorbar axes size - #24

Merged
timj merged 3 commits into
mainfrom
tickets/DM-55379-hotfix
Jul 23, 2026
Merged

DM-55379 (hotfix): Space WCS axis labels for the post-colorbar axes size#24
timj merged 3 commits into
mainfrom
tickets/DM-55379-hotfix

Conversation

@timj

@timj timj commented Jul 23, 2026

Copy link
Copy Markdown
Member

The colorbar is attached with an axes divider that only resizes the image axes on the next draw, but AST measured the label extents against the full-width axes it starts from. The axes then shrank, so wide decimal labels were laid out too densely and overlapped (and the axis title landed on top of the numeric labels). Realise the pending resize before AST measures so it spaces the labels for the final geometry.

timj and others added 3 commits July 22, 2026 17:09
The colorbar is attached with an axes divider that only resizes the
image axes on the next draw, but AST measured the label extents against
the full-width axes it starts from. The axes then shrank, so wide
decimal labels were laid out too densely and overlapped (and the axis
title landed on top of the numeric labels). Realise the pending resize
before AST measures so it spaces the labels for the final geometry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A figure resize changes the axes size without changing the view
limits, so the debounced redraw that already runs on limit changes now
also fires on the canvas resize_event.  Without it the labels keep the
spacing chosen for the old size and overlap (or spread out) after a
drag-resize.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Interactive web backends such as ipympl emit resize_event repeatedly at
the size the figure already has, and each rebuild repaints the canvas,
which prompts the frontend to report its size again.  Rebuilding on
every event therefore drove an unbounded repaint loop that only settled
once the kernel went idle, leaving the widget blank until then.

Split the resize callback from the limit-change callback and rebuild
only when the canvas has changed size since it was last drawn, so a
drag-resize still re-spaces the labels exactly once while the backend's
same-size echo is ignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@timj
timj merged commit 2885a5a into main Jul 23, 2026
2 checks passed
@timj
timj deleted the tickets/DM-55379-hotfix branch July 23, 2026 00:53
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.

1 participant