Plotly: Fixes for continuous viewport updates #575
Merged
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.
This PR contains a few more fixes for using the contunuous viewport update mode with the Plotly pane.
ccf45a8 Makes the Bokeh enum order consistent with the Param selector ordering. Not quite sure why this was significant, but the mismatch caused the initial value of the
viewport_update_policy
param to not be synchronized from Python to JavaScript.f8e5894 Adds a fix for calling
react
while panning. Basically, while panning the axisrange
values should be set to the currentlayout.range
values (the values from before the pan action began). This avoids the unstable panning behavior that was happening when updating the figure while panning.327f5b5 is a fix for the "Cannot read property 'content' of null" error that I've been getting in Panel when property updates in both directions are happening very rapidly. This error happened after a few seconds of dragging a plot with continuous update mode, if an update callback updated the same figure.
Basically, we were previously checking if
receiver
wasnull
/undefined
. But in these high throughput situations, it sometimes happened thatreceiver
was not null, butreceiver._partial
was. With these extra guards, the error is fixed for me.Here's an example of continuous update behavior with this PR.
If you watch closely in the middle of the clip, there is still an occasion blip/jump while panning that I haven't tracked down. But overall the experience is greatly improved.