-
Notifications
You must be signed in to change notification settings - Fork 0
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
Plot brush sometimes "sticky" and doesnt clear as expected #46
Comments
This issue is still around and I'm still unable to reproduce it, but I've been told by others that it occasionally happens to them as well. I've added a button to clear the selection, so hopefully that works as a bandaid for the time being. Apparently the plot brush doesn't distinguish between a click event and a click+hold (for brushing), so I can't map Things that do not seem to reliably reproduce the issue:
|
See also discussion here, I think it's referencing the same problem: rstudio/shiny#3683 |
Anecdotally this seems to happen very frequently for MacOS users, and may be related to moving between windows or desktops. Sadly the implemented clear selection button doesn't target the sticky boxes since they're no longer related to input$plot_brush (which I half expected but nice to have confirmation). Given that the boxes appear even when the plot rerenders, one brute force approach might be to use Javascript to straight up delete any div element corresponding to the selection box. |
Based on the idea in the above comment, I've applied a band-aid fix such that pressing the clear select button will not only reset the current brush but it will also run a line of javascript to delete the div with the id This is still difficult to reproduce, but you can hack it into existence by drawing a brush, opening up the HTML in the dev tools, copying the pulsePlot_brush element, then pasting it after making a new box. The pasted box will persist. If you drag a new box, then navigate to another file, then that new box will also start to persist. In other words, once you have one sticky box, you'll start getting a lot more sticky boxes: I'll push a version that uses a loop to delete all the boxes at once in a moment. In JS, |
This is now fixed in the sense that there exists a solution to get rid of the boxes, but I do think the underlying issue is related to the plot brush debouncing behavior described in the cited PR from before. So, we have a band-aid of a fix now and until Shiny itself is updated to fix the brush I don't think it's going to be solved. |
Yeah, the underlying issue is that brushing functionality in shiny is really just duct-taped and hot-glued on, it's a truly impressive bodge. Unfortunately, I'm probably not going to get another month of company time to bring that PR up to date with recent shiny changes, and it's unclear whether the maintainers would review it even if I did, so I wouldn't hold your breath on a fix in Shiny. I'd suggest looking into alternatives like plotly. |
I'm not entirely sure how to reproduce this, but sometimes the previous selection will not be cleared when a second selection is made. Very rarely, the previous selection will be used as the active selection instead of the newer selection.
The text was updated successfully, but these errors were encountered: