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
Capturing background clicks with coordinates #973
base: master
Are you sure you want to change the base?
Conversation
This also fixes #653 |
to test:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not enhance the current on_background_click
with the coordinates instead of adding a new Python method?
Thanks for the PR anyway! This is super useful :) |
I did have a look at that but as far as I can remember there is no easy way to do that (or it's impossible). On the other hand the
Thanks :) |
This is a very useful addition. |
Hi joders, thanks, I think this could be very useful, even apart from #1066 which listens to all mouse events / clicks. I think there are many cases where we'd like to capture clicks that are not on a mark. However, I don't think the place should be in a Mark since it does not make sense in the case of multiple marks, do you agree? I think the best place would be in Figure.ts, which is actually the originator of the events (ctrl-f for bg_clicked in that file). Regards, aarten |
Hello, |
Hello from the future, Was anything like this ever merged? Especially interested in getting mouse coordinates for the bq.Map |
Hi, you could maybe take a look at glue-viz/bqplot-image-gl#57 instead |
Not sure that would work since Map allows for various zoom ins. I think the approach above works for stationary widgets. Cool library though |
not sure either, try it out :) |
*Issue number of the reported bug or feature request: #972
Changes
I added a default click event to scatter plots which is triggered whenever the click interactions on the mark is set to neither 'add', 'delete' nor 'select'. The mark now has a further handler registration function called
.on_background_click_with_coordinates()
.This implementation might not be ideal as it doesn't tie in with the present background click handling and also it doesn't have its own click interaction on the mark.
Testing performed
I only manually observed the events emitted by the mark to confirm that the desired information is present.