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

Set Bqplot*Modes to observe only one selected state in BrushSelector #419

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

dhomeier
Copy link
Contributor

@dhomeier dhomeier commented Jan 3, 2024

Description

Pushing this as a test to avoid possible race conditions in observing both selected_x and selected_y in the BrushSelector interaction that have been speculated to cause unwanted size changes of the selection in #418.

Since the reported bug is non-deterministic and I have not been able to reproduce it at all, I have no idea if this change will help, just keeping it here for further investigation.

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (307a11d) 86.63% compared to head (493fada) 86.62%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
- Coverage   86.63%   86.62%   -0.02%     
==========================================
  Files          89       89              
  Lines        5163     5159       -4     
==========================================
- Hits         4473     4469       -4     
  Misses        690      690              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pllim
Copy link
Contributor

pllim commented Jan 3, 2024

Won't all the calls to interact.selected_x and interact.selected_y also need to be changed?

@dhomeier
Copy link
Contributor Author

dhomeier commented Jan 3, 2024

selected includes both, so any change to an element of either one should alert the observe, but for working with the coordinates using selected_[xy] should just function the same – unless I misunderstand something in the way _set_selected_xy works. But it does work as far as I could see.
https://github.com/bqplot/bqplot/blob/c186fcdbf3c5455c91cb750ab5a3f94accefda81/bqplot/interacts.py#L365-L369

@pllim
Copy link
Contributor

pllim commented Jan 9, 2024

I won't have time for to test this week. Try Cubeviz example notebook if you cannot wait. I could reproduce it there (without this patch) but not consistently.

@dhomeier
Copy link
Contributor Author

Tried on 3 different macOS and Python versions now, with notebook, jupyterlab and standalone for Cubeviz and the original Imviz example, and never saw as much as a flicker in size – will have to wait then.

@pllim
Copy link
Contributor

pllim commented Jan 23, 2024

@cshanahan1 , since you most recently ran into the "disappearing subset" problem, do you want to see if this PR helps? Given how non-deterministic it is, better have multiple devs confirm.

@pllim
Copy link
Contributor

pllim commented Jan 24, 2024

Maaaybe this fixes some of the problem, but it does not prevent the case where user is dragging something around very fast with repeated down/up clicks. The cursor can accidentally be right at the edge, where the "resize" mode would activate. Then when user intends to move, the app thinks user is resizing, resulting in the shape getting very big or small.

@pllim
Copy link
Contributor

pllim commented Jan 24, 2024

Despite #419 (comment) , listening to just one thing is better than having race condition, right? Should you take this out of draft?

@dhomeier
Copy link
Contributor Author

Cursor being too close to the edge so it does switch into resize mode seems out of scope for the race condition issue.
But I am not sure I can follow re. the rapid up/down clicks – maybe I need to test this with an actual mouse; with the trackpad there is always some pause before I can lock into drag mode with a new tap.
Anyway if there is at least some evidence this can help, I am changing status now.

@dhomeier dhomeier marked this pull request as ready for review January 24, 2024 23:38
@dhomeier dhomeier added the bug Something isn't working label Feb 22, 2024
Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

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

Seems sensible, thanks!

@astrofrog astrofrog merged commit c108da0 into glue-viz:main Feb 27, 2024
26 checks passed
@dhomeier dhomeier deleted the selected-once branch April 11, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bqplot-viewers bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants