Uh oh!
There was an error while loading. Please reload this page.
Mapbox react updates - #4418
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
etpinard
commented
Dec 9, 2019
That's ok. But next time, please base your PR off your base branch. Here at plotly.js, we're not fans of rebasing and |
jonmmease
commented
Dec 9, 2019
Thanks for taking a look @etpinard, I'll start looking at adding tests next. |
jonmmease
commented
Dec 10, 2019
I added a few tests that cover the new functionality Also, it looks like there are some unrelated failures in the image test suite for some webgl chart types. |
etpinard
commented
Dec 12, 2019
Awesome work @jonmmease !! 💃 💃 💃 |
jonmmease
commented
Dec 16, 2019
Thanks for taking the time @etpinard! merging |
Overview
This PR makes two changes to make updates to mapbox-based plots using
reactsmoother. The use-case I'm working on is a Dash app that uses Datashader to update an image layer in response to eachplotly_relayoutevent.Note: These this branch was initially based on #4413
Change 1: Don't update map position while panning/zooming.
36a2650 prevents plotly.js from updating the mapbox view while a pan/zoom is in process. This fixes the stuttering that occurs when quickly repeating zoom or pan actions.
Before:

After:

Change 2: Use
updateImageto update image, rather than delete and recreate layer.When possible, 7e355d7 uses the mapbox
updateImagefunction to update an existing image in place rather than removing and recreating the source and layer. It also adds theraster-fade-duration: 0paint option (which is suggested by theupdateImagedocstring). Together, these changes remove the image flashing that previously occurred between image updates.Before:

After:
