GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix for figure resizing in webagg by eyurtsev · Pull Request #3341 · matplotlib/matplotlib

Conversation

@eyurtsev

@eyurtsev eyurtsev commented Aug 3, 2014

Copy link
Copy Markdown
Contributor

This is a fix for this issue: #3338

Currently, resizing does not work well in the webagg backend because mouse events are not ignored during the resize, which makes it both difficult and slow to do.

The code below ignores mouse events while resizing, but the fix is only for the figure in question. (So resizing figure 1 over figure 2 won't stop figure 2 from responding to mouse events.)

I also included some cosmetic changes: while resizing the figure, the figure is not rendered continuously but is replaced by a light gray box. This makes the resizing look a lot smoother in my opinion.

I have (very) little experience with javascript/html/css, so I wasn't sure where to place the CSS code for the "boxme" class. (It's directly in the javascript below, which probably isn't the best idea.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Eugene Yurtsev
fixed figure resizing in webagg
b62ecec
@eyurtsev eyurtsev changed the title fixed figure resizing in webagg fix for figure resizing in webagg Aug 3, 2014
@tacaswell tacaswell added this to the v1.4.x milestone Aug 4, 2014
@tacaswell tacaswell added the needs_review label Aug 4, 2014
@pelson

pelson commented Aug 8, 2014

Copy link
Copy Markdown
Member

This looks good. Thanks @eyurtsev. It'd be good to pull the functionality out of the main figure function and into its own function. Also, when resizing animations, the animation frames are still updating the grayed out box - truthfully though, I'm not sure I'm 100% supportive of the graying out of the figure - that isn't the behaviour I get with other backends, and sometimes you want to resize the figure based on what the figure looks like (for instance, you might want to resize to optimize axes space for equal-aspect plots).

Also, did you test this with the nbagg backend?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eyurtsev

eyurtsev commented Aug 12, 2014

Copy link
Copy Markdown
Contributor Author

Graying out the figure:

I agree I'd be happier if this could look exactly like the other
backends.

On my machine the plot wasn't updating quickly enough to render in real
time, so I found it more useful to work with a place holder for the figure
when resizing.

animations:
I have never used animations in matplotlib, so wouldn't even have known to check this.

nbagg:

The pull request is missing a var in front of the variable ctx.
ctx = fig.context; -> var ctx = fig.context;

Without this correction it fails in nbagg! (I wonder why it works with webagg)

I can submit a new pull request either implementing the issue with the variable or else entirely removing the graying out behavior. (But it'll be only in a few weeks.) I can also factor out the functionality out of the figure, but that can take sometime since I'll need to study the code more carefully. Let me know what you'd prefer.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tacaswell tacaswell added needs_revision and removed needs_review labels Aug 26, 2014
@tacaswell tacaswell modified the milestones: v1.4.x, v1.4.1 Sep 3, 2014
@tacaswell

tacaswell commented Jan 13, 2015

Copy link
Copy Markdown
Member

@eyurtsev Any interest in reviving this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pelson

pelson commented Jan 13, 2015

Copy link
Copy Markdown
Member

On my machine the plot wasn't updating quickly enough to render in real time, so I found it more useful to work with a place holder for the figure when resizing.

How about we limit the number of redraws when resizing - something like 1.5Hz would be a reasonable rate when resizing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eyurtsev eyurtsev mentioned this pull request Jan 24, 2015
FIX: resizing a figure in webagg #4035
Merged
@eyurtsev

eyurtsev commented Jan 24, 2015

Copy link
Copy Markdown
Contributor Author

@tacaswell sorry just saw your message. i need to fix my github email preferences...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eyurtsev

eyurtsev commented Jan 24, 2015

Copy link
Copy Markdown
Contributor Author

@pelson

I actually removed the debouncing in the new PR. It seems to be unnecessary now that the mouse events are ignored while resizing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tacaswell

tacaswell commented Jan 25, 2015

Copy link
Copy Markdown
Member

Closing in favor of #4035.

@eyurtsev Please correct me if I am confused. In the future you can also use push/forcepush to update a PR with additional/brand new commits.

The PR tracks a merge from a fixed branch name, not from a fixed commit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tacaswell tacaswell closed this Jan 25, 2015
@tacaswell tacaswell removed the status: needs revision label Jan 25, 2015
@eyurtsev
eyurtsev deleted the fix_webagg_resize branch January 26, 2015 00:27
@eyurtsev

eyurtsev commented Jan 26, 2015

Copy link
Copy Markdown
Contributor Author

@tacaswell thanks for the information! I have only made a few PRs to date, and never revised one, so I wasn't sure how to do it.

Anyway, I applied the changes on top of the running master, so less changes to merge now. :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@QuLogic QuLogic added status: superseded status: duplicate labels Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

status: duplicate status: superseded

Projects

None yet

Milestone

v1.4.x

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@eyurtsev @pelson @tacaswell @QuLogic
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.