10000 Ensure winning points of hover are listed first when `hoversubplots` is set to "axis" and sorting by distance by archmoj · Pull Request #6963 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

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

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 5 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
comment
  • Loading branch information
archmoj committed Apr 15, 2024
commit 5b6998dd34bb3f850c1556621b8131ffe1ee3bc1
3 changes: 3 additions & 0 deletions src/components/fx/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ function _hover(gd, evt, subplot 8000 , 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?

// 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?

return (
(firstXaxis && firstXaxis._id === a.xa._id) &&
Expand Down
0