From f588741c7349f4a5fa7375248da846a16a101406 Mon Sep 17 00:00:00 2001 From: Farkites Date: Fri, 26 Jan 2024 09:51:08 +0000 Subject: [PATCH 1/4] Fix bug to allow box selection when expanding existing box on multy-axes --- src/components/selections/select.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/selections/select.js b/src/components/selections/select.js index b0d76a1b24f..2afcbe69c78 100644 --- a/src/components/selections/select.js +++ b/src/components/selections/select.js @@ -809,8 +809,7 @@ 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(!trace.xaxis || !trace.yaxis) continue; searchTraces.push(createSearchInfo(trace._module, cd, getFromId(gd, trace.xaxis), getFromId(gd, trace.yaxis))); From ec4c8f3791a2db63f91520fe3ba157b182c565ef Mon Sep 17 00:00:00 2001 From: Farkites Date: Fri, 26 Jan 2024 11:50:40 +0000 Subject: [PATCH 2/4] Cover case for selections in multiple subplots --- src/components/selections/select.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/selections/select.js b/src/components/selections/select.js index 2afcbe69c78..94cb220d7e5 100644 --- a/src/components/selections/select.js +++ b/src/components/selections/select.js @@ -809,7 +809,8 @@ function determineSearchTraces(gd, xAxes, yAxes, subplot) { var sankeyInfo = createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]); searchTraces.push(sankeyInfo); } else { - if(!trace.xaxis || !trace.yaxis) continue; + if(xAxisIds.indexOf(trace.xaxis) === -1 && !trace._xA) continue; + if(yAxisIds.indexOf(trace.yaxis) === -1 && !trace._yA) continue; searchTraces.push(createSearchInfo(trace._module, cd, getFromId(gd, trace.xaxis), getFromId(gd, trace.yaxis))); From 5e741d8eafc5a973431b490398cd6beaa51330e3 Mon Sep 17 00:00:00 2001 From: Farkites Date: Fri, 26 Jan 2024 14:38:58 +0000 Subject: [PATCH 3/4] Cover marginal distribution selections --- src/components/selections/select.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/selections/select.js b/src/components/selections/select.js index 94cb220d7e5..df6a80c70a8 100644 --- a/src/components/selections/select.js +++ b/src/components/selections/select.js @@ -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 && !trace._xA) continue; - if(yAxisIds.indexOf(trace.yaxis) === -1 && !trace._yA) 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; searchTraces.push(createSearchInfo(trace._module, cd, getFromId(gd, trace.xaxis), getFromId(gd, trace.yaxis))); From 91e74331b87fc12b75d9617857ea8d11b094c94e Mon Sep 17 00:00:00 2001 From: Farkites Date: Thu, 1 Feb 2024 17:00:58 +0000 Subject: [PATCH 4/4] Add draftlog --- draftlogs/6870_change.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/6870_change.md diff --git a/draftlogs/6870_change.md b/draftlogs/6870_change.md new file mode 100644 index 00000000000..a4764eb9b66 --- /dev/null +++ b/draftlogs/6870_change.md @@ -0,0 +1 @@ +- Fix bug where extending an existing box/lasso selection on traces with overlaying axes didn't update the selection [[#6870](https://github.com/plotly/plotly.js/pull/6870)]. \ No newline at end of file