Skip to content

DM-57317: Speed up rendering in ipympl - #26

Open
timj wants to merge 3 commits into
mainfrom
tickets/DM-57317
Open

timj wants to merge 3 commits into
mainfrom
tickets/DM-57317

Conversation

@timj

@timj timj commented Dec 1, 2026

Copy link
Copy Markdown
Member

No description provided.

timj and others added 3 commits December 1, 2026 15:35
The AST axes were rebuilt by a debounced timer after each view change
and then repainted, so every zoom, pan or resize rendered the whole
figure twice and briefly showed the previous view's axes in the new
view.  A single artist on the axes now draws the AST artists and
rebuilds them first whenever the view limits, axes size or dpi have
changed, so one render shows the new view with axes laid out for it.

The grf measures text with a renderer of its own, since some versions
of it measure a string by drawing it, and the rebuild does not mark the
figure stale, which would make interactive backends draw it again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The AST artists are no longer among the axes' lines and texts, so
erase can remove all of those without checking for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebuilding the AST axes in every frame of a drag-pan makes each frame
slower than the render alone and lets the kernel fall behind the mouse.
While a button is held the existing axes now move with the view, and
releasing the button (or leaving the figure, since a release outside it
sends no event) requests the draw that rebuilds them.  The navigation
toolbar requests a draw at the end of a drag too, and interactive
backends combine the two, so the rebuild costs no extra render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timj
timj force-pushed the tickets/DM-57317 branch from 2a4a1b2 to 549f869 Compare December 1, 2026 23:30
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