Repository navigation
fix: serialization of box/lasso select data for multiple subplots - #5710
Conversation
|
Thanks for the PR! Could you please address the merge conflicts and merge main into your branch? |
Done |
|
Could you rebuild the widget bundle again? We released a new version between your last update and today. Sorry for the churn. |
72a5906 to
0342629
Compare
No problem. I rebased the branch and rebuild the widget bundle now. |
…h-multiple-subplots
|
@camdecoster Could you take a look ? |
|
Before moving forward, what are you trying to accomplish with making the selection in the second subplot? As of now, there's no way to get the range without digging into private values. There could be a workaround, but that depends on what you're trying to do. |
I don't get it. I am only exposing the interface that is already provided by Plotly.js, I am not accessing any private values. My use-case is the following: I have two subplots with different time ranges. In one subplot there is a part where data is missing. A user shall then be able to select said x-range to annotate why data is missing there. |
…h-multiple-subplots
|
I was trying to find out if you could use one of the workarounds I was referencing. Upon digging into this, I think there's another path forward: create the selector per trace. Your fix to pass the range through is correct, but it only gets us part of the way there. Right now, the selector is created once and handed to every trace, which creates problems because selecting in one subplot reports that selection to every other subplot. If we create a selector per trace, we can determine the correct axis from trace data and we don't have to determine it later. The end result: with your changes and those I describe above, the bug should be taken care of. I'll push my changes soon. |
|
@flpi-sun I've pushed my changes. Could you run some tests on your end and see if things are working? |
camdecoster
left a comment
There was a problem hiding this comment.
Thanks for the fix (and your patience)!

Closes #5703
Description of change
Include all xNranges / yNranges in selector_state.
This enables getting the box selection size in any number of subplots.
Demo
Testing strategy
I created the following python file for testing called
test_subplot_selection.py:Guidelines