Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Blitting For all updates #153

Open
ianhi opened this issue Dec 4, 2020 · 1 comment
Open

Use Blitting For all updates #153

ianhi opened this issue Dec 4, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@ianhi
Copy link
Collaborator

ianhi commented Dec 4, 2020

Problem

Blitting makes animations go fassssstttt, and currently there is no use of blitting in this library :'(

This is because ipympl has not supported blitting and that is my primary backend. But support is coming in matplotlib/matplotlib#19059

Proposed Solution

In stead of fig.canvas.draw_idle
https://github.com/ianhi/mpl-interactions/blob/1bf03b0850b04f62b73159e46be08708f81ca20a/mpl_interactions/controller.py#L166-L167

call fig.canvas.blit if blitting is supported by that backend.

This may require some trickery to do pass the bboxes of the relevant artists up to the controller object. Also using the artist bboxes will only benefit non-notebook backends as the webagg backend (underlies nbagg and ipympl) just sends diffs of images to the front and ignores the bbox passed to blit.

Additional context

@ianhi ianhi added the enhancement New feature or request label Dec 4, 2020
@ianhi ianhi changed the title Use Blitting For all animations Use Blitting For all updates Dec 4, 2020
@ianhi
Copy link
Collaborator Author

ianhi commented Dec 8, 2020

on registering the function should pass the relevant artists to the controller and then something similar to the BlitManager from https://matplotlib.org/3.3.0/tutorials/advanced/blitting.html#minimal-example should be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant