-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
image and heatmap traces jump/flash on Firefox and Safari #4377
Comments
@jonmmease I think the issue also occurs on The problem stems from reinjecting an image when pan operation is completed. I thought this pattern was safe since it's been used for a long time in |
Done, thanks! |
Hmm. I can't replicate in FF 70 |
Hmm, I am seeing it in FF 70 on Ubuntu. @antoinerg were you able to reproduce? |
I can reproduce it in FF 70.0.1 (64-bit) on Linux (NixOS distro). |
I can also reproduce in Safari 13.0.3 on macOS 10.15.1. On the same system, the problem does not appear in Chrome Version 78.0.3904.108. |
@antoinerg do you think there's an "easy" way to fix this bug? Or do you think our canvas -> pixels -> img inside the |
It's hard to say which one behaves right and I suspect the specification may not be clear in this regard.
Idea for an easy fix: have two images (A and B) and alternate between the two. Once you pan, image B content is updated and moved in front of image A (so no flash in principle). Then if you pan again, image A content is updated and moved in front and so on. Hopefully, this approach works. If we only target a fix for FF: leverage |
So we're reverting the drag, then redrawing with the new view... and it seems like even if we do this synchronously, some browsers will do two repaints (if that's it, there will be async edge cases in other browsers too). I wonder if we can just not revert the drag, and tweak the redraw process if necessary so it still works right. I think it's this call that's doing it: plotly.js/src/plots/cartesian/dragbox.js Lines 770 to 774 in 4ab3b49
|
This may be a problem with Firefox itself: Images are flashing when updates by img.src[]=url in Firefox >= 8.0 Potential solution: https://stackoverflow.com/questions/14704796/image-reload-causes-flicker-only-in-firefox/14711272#14711272 |
FYI: using some It would be interesting to see how The solution in https://stackoverflow.com/questions/14704796/image-reload-causes-flicker-only-in-firefox/14711272#14711272 may be a quick and easy way to fix this bug in Safari (albeit with a potential performance cost). |
The issue is twofold:
EDIT: I opened an issue to tackle 2) since it affects other trace types (#4570) |
@etpinard at the moment, when an axis has a |
Here's the relevant logic that makes zoom interactions go through the plotly.js/src/plot_api/plot_api.js Lines 2274 to 2293 in 15d75db
By the looks of it, all the range "constraints" operations are taken care of in plotly.js/src/plots/cartesian/constraints.js Lines 198 to 352 in 15d75db
which is called during plotly.js/src/plot_api/subroutines.js Lines 669 to 721 in 15d75db
from a few places in plotly.js/src/plot_api/plot_api.js Lines 1970 to 1976 in 15d75db
So perhaps zoom/pan interaction just work already under the fast We'll have to be extra careful though. I wouldn't want to trust 100% our test coverage for constraints. But yeah, to answer your question, making zoom/pan on constrained axes not have to go through the |
(Ping, I updated my comment above) |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. Sponsorship range: $10k-$15k What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
The new image trace seems to have a flashing/jumping behavior when zoomed in and panning on Firefox and Safari. (Firefox version 69.0, Safari version 13.0.3)
Example from https://plot.ly/python/imshow/
This jumping does not happen on Chrome but I do see it on Firefox/Safari. Not sure if it's related, but in all three browsers, the tooltip also seems to jump to another location when the pan is completed.
The text was updated successfully, but these errors were encountered: