shiny icon indicating copy to clipboard operation
shiny copied to clipboard

Set ggplot2's plot brush programmatically Shiny

Open baniani opened this issue 8 years ago • 6 comments

So there is a blue semi-transparent brush/rectangle that you can drag and then move on ggplot2 with your mouse, you can get its xmin, xmax, ymin and ymax by observing the brush. How can I do the other way around? How can I set its xmin, xmax, ymin and ymax and move resize the brush programmatically?

baniani avatar Nov 03 '16 13:11 baniani

I have a similar question/suggestion as I would like to be able to programmatically change the direction of the brush (for example from 'x' to 'y'). Thank you!

pata-eth avatar Nov 08 '16 00:11 pata-eth

I am facing the same problem, but with base plot as well. Did anyone find a solution? Otherwise there should possibly be a feature request.

sedot42 avatar Apr 12 '17 08:04 sedot42

We're planning on doing this for a future release of Shiny, although we don't have the timeframe set yet.

wch avatar Apr 12 '17 15:04 wch

I would also like to change the brush area programmatically. With hundreds of bars in a waterfall plot, it is difficult to select properly with the mouse. I would like to have a textInput with a reactive to modify the brush area. Any option to do this with js?

awerni avatar Mar 04 '20 22:03 awerni

Is there a problem with that pull request from 2 years ago?

Edit to answer my own question: yes there is, it appears that almost the entirety of the JS codebase has been refactored since this pull request was created.

Edit 2: currently working on my own pull request for this now!

dvg-p4 avatar Jun 07 '22 19:06 dvg-p4

Nearing a workable solution that also fixes some other brush-related issues at https://github.com/dvg-p4/shiny , will be creating a pull request soon

dvg-p4 avatar Jul 07 '22 19:07 dvg-p4