Include xPixel and yPixel in hoverdata and clickdata in dcc.Graph - #3961
Draft
AnnMarieW wants to merge 1 commit into
Draft
Include xPixel and yPixel in hoverdata and clickdata in dcc.Graph#3961AnnMarieW wants to merge 1 commit into
dcc.Graph#3961AnnMarieW wants to merge 1 commit into
Conversation
|
Collaborator
Author
|
@T4rk1n - The test fails because it requires Plotly 7 - what's the best way to handle that? |
Contributor
You can either install plotly.py 7.0.0 to install it globally (Probably best), or if it's just a few tests can put the plotly.js version in assets and set it for the test. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is a continuation of PR #3852
Both of these issues were fixed in plotly/plotly.js#7966 and are now available in Plotly 7. Thanks @emilykl 🙂
The Plotly.js PR #7966 adds
xPixelandyPixel(the cursor coordinates) to all hover and click events, regardless of whetherhoveranywhereorclickanywhereare enabled.This PR includes
xPixelandyPixeldata in thedcc.GraphhoverDataandclickDataprops only whenhoveranywhereorclickanywhereoption is enabled in the figure. This avoids triggering Dash callbacks when the cursor coordinates aren't needed.I'll provide some sample apps as a separate comment.