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

Ensure winning points of hover are listed first when hoversubplots is set to "axis" and sorting by distance #6963

Merged
merged 5 commits into from
Apr 15, 2024

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Apr 12, 2024

Fixes #6960.

@plotly/plotly_js

 - resolved conflicts in test/jasmine/tests/hover_label_test.js
@@ -700,9 +713,23 @@ function _hover(gd, evt, subplot, noHoverEvent, eventTarget) {
gd._spikepoints = newspikepoints;

var sortHoverData = function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@archmoj Could you add a comment here explaining the new sorting logic?

Copy link
Contributor

@emilykl emilykl left a comment

Choose a reason for hiding this comment

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

LGTM! 💃 Shows the correct behavior when testing Liam's codepen with your changes.

Screen Shot 2024-04-15 at 1 49 12 PM
Screen Shot 2024-04-15 at 1 49 49 PM

@archmoj archmoj merged commit 3b9de53 into master Apr 15, 2024
1 check passed
@archmoj archmoj deleted the fix6960-hoversubplots branch April 15, 2024 18:09
// When sorting keep the points in the main subplot at the top
// then add points in other subplots

var hoverDataInSubplot = hoverData.filter(function(a) {
Copy link
Contributor

Choose a reason for hiding this comment

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

naming suggestion -- should these functions be called hoverDataInMainSubplot and hoverDataNotInMainSubplot then?

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

Successfully merging this pull request may close these issues.

hoversubplots="axis" with hovermode="x" on stacked traces, shows x-axis label on first trace
2 participants