Skip to content

Clear gd._hoverdata before emitting plotly_unhover #1448

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

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Mar 6, 2017

fixes #1446

cc @rreusser @alexcjohnson

- so that in the case where a plotly_unhover handler calls
  a Plotly method (restyle, relayout and update which in turn
  call Plots.rehover), an infinite isn't triggered!
- add test case showing the current infinite loop code path
@etpinard etpinard added status: reviewable bug something broken labels Mar 6, 2017
expect(hoverCnt).toEqual(2);
expect(unHoverCnt).toEqual(2);
})
.then(done);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case led to

image

before the above dragelement patch.

@alexcjohnson
Copy link
Collaborator

Crazy. I certainly would not have caught that, but it makes sense. 💃

Sometime it might be worth making test cases corresponding to some of our other event-driven examples, both to test the events themselves and to guard against other interactions like this. The Mandelbrot explorer I made is one that comes to mind - where a zoom (relayout) event triggers a restyle (with new heatmap data)

@etpinard etpinard merged commit 51b02d3 into master Mar 7, 2017
@etpinard etpinard deleted the unhover-infinite-loop branch March 7, 2017 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest release leads to infinite loops when calling restyle on plotly_hover
2 participants