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

Fix interacting with selection on subplots with overlaid axes #6870

Merged
merged 4 commits into from
Feb 1, 2024
Merged
Changes from 3 commits
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
4 changes: 2 additions & 2 deletions src/components/selections/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,8 @@ function determineSearchTraces(gd, xAxes, yAxes, subplot) {
var sankeyInfo = createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]);
searchTraces.push(sankeyInfo);
} else {
if(xAxisIds.indexOf(trace.xaxis) === -1) continue;
if(yAxisIds.indexOf(trace.yaxis) === -1) continue;
if(xAxisIds.indexOf(trace.xaxis) === -1 && (!trace._xA || !trace._xA.overlaying)) continue;
if(yAxisIds.indexOf(trace.yaxis) === -1 && (!trace._yA || !trace._yA.overlaying)) continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

Very interesting proposed fix.
It looks like we also select traces in other subplots that are not overlay with these axes.
If that's the case we shouldn't include them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have checked all the other test cases with subplots and the selection seems to be working fine.

The only cases I've found where there are some crossover with selection/deselection are with:

  • plot_types
  • plot_types_grid_dash
  • box_plot_jitter_edge_cases
  • mapbox_choropleth-multiple

And for these the issues happen with and without my changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Farkites Thanks very much for your tests.
Here we need to know if we have two subplots i.e. (xy + xy2 ) and (x2y3 + x2,y4) and the user reselects over the first one; then are the traces in the second subplot (x2y3) are also re-selected before and after this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@archmoj Yes, in that scenario the traces in the second subplot (x2y3) are re-selected before and after the changes. You can check this here:


searchTraces.push(createSearchInfo(trace._module, cd,
getFromId(gd, trace.xaxis), getFromId(gd, trace.yaxis)));
Expand Down