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

Plotly: Fixes for continuous viewport updates #575

Merged
merged 3 commits into from Aug 6, 2019

Conversation

jonmmease
Copy link
Collaborator

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 axis range values should be set to the current layout.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 was null/undefined. But in these high throughput situations, it sometimes happened that receiver was not null, but receiver._partial was. With these extra guards, the error is fixed for me.

Here's an example of continuous update behavior with this PR.

plotly_panel

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.

This seemed to keep the initial value of viewport_update_policy from
synchronizing
This happened when events events were being sent back and forth from Python to JS rapidly.
In particular, when a plot was updated in response to continuous viewport changes.
@philippjfr
Copy link
Member

Basically, we were previously checking if receiver was null/undefined. But in these high throughput situations, it sometimes happened that receiver was not null, but receiver._partial was. With these extra guards, the error is fixed for me.

That's pretty weird, but glad you found a fix.

@jonmmease
Copy link
Collaborator Author

Yeah, I don't understand what that part is doing well enough to know whether to be concerned that receiver._partial is sometimes null. but it doesn't happen often and just skipping those events seems to work fine.

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

Successfully merging this pull request may close these issues.

None yet

2 participants