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

plot brush issue after update to 1.9.0 #4110

Closed
toomish opened this issue Jul 30, 2024 · 9 comments · Fixed by #4111
Closed

plot brush issue after update to 1.9.0 #4110

toomish opened this issue Jul 30, 2024 · 9 comments · Fixed by #4111

Comments

@toomish
Copy link

toomish commented Jul 30, 2024

System details

Browser Version: firefox 128.0.3

Output of sessionInfo():

R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Arch Linux

Matrix products: default
BLAS:   /usr/lib/libblas.so.3.12.0
LAPACK: /usr/lib/liblapack.so.3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=C                  LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: Europe/Moscow
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] shiny_1.9.0       lattice_0.22-6    data.table_1.15.4

loaded via a namespace (and not attached):
 [1] digest_0.6.36     later_1.3.2       R6_2.5.1          httpuv_1.6.15
 [5] fastmap_1.2.0     magrittr_2.0.3    parallel_4.4.1    htmltools_0.5.8.1
 [9] lifecycle_1.0.4   promises_1.3.0    cli_3.6.3         xtable_1.8-4
[13] grid_4.4.1        compiler_4.4.1    mime_0.12         Rcpp_1.0.13
[17] rlang_1.1.4       box_1.2.0

Example application or steps to reproduce the problem

library(shiny)

shinyApp(
   ui = fluidPage(
      actionButton("newplot", "New plot"),
      plotOutput("plot",
                 brush = brushOpts("brush", delay = 5000, direction = "x")),
      verbatimTextOutput("text")),

   server = function(input, output) {
     output$plot <- renderPlot({
       input$newplot
       x <- seq(-20, 20)
       y <- x * x
       plot(x, y, ann = FALSE)
     })
     output$text <- renderText({
       if (!is.null(input$brush))
         paste("xmin", round(input$brush$xmin, 1), "xmax", round(input$brush$xmax, 1))
       else
         "nothing"
     })
   }
)

Describe the problem in detail

After update shiny to 1.9.0 some places of plot cannot be selected with brush.
For example in my sample application from left and top sections of plot it's impossible to begin selection.
With previous shiny version 1.8.1.1 there was no problem.

@cpsievert
Copy link
Collaborator

cpsievert commented Jul 30, 2024

Hi @toomish, thanks for the report. Unfortunately, I can't seem to replicate the behavior you're seeing. Would you mind adding a screen-recording of the expected vs unexpected behavior? Also, please let us know what browser you're using and whether you see any JS console errors.

@toomish
Copy link
Author

toomish commented Jul 30, 2024

Firefox 128.0.3, but the issue appeared only after updating shiny to 1.9.0

old shiny (1.8.1.1) works as expected:

shiny-1.8.1.1.mp4

new shiny (1.9.0) impossible to initiate selection when mouse pointer in left or top sections of the plot:

shiny-1.9.0.mp4

There are no errors in JS console.

@toomish
Copy link
Author

toomish commented Jul 30, 2024

With chromium all works as expected. It seems that this is firefox compatibility problem with new release.

@cpsievert
Copy link
Collaborator

Thanks for the info and the great screencast. Also, super weird that I'm not seeing the same behavior in Firefox 128.0.3 on MacOS 14.5. Maybe try disabling the browser cache and/or do a hard refresh?

@toomish
Copy link
Author

toomish commented Jul 31, 2024

Disabling cache, hard refresh did not help.

I'm not fully sure, but I think problem can be caused by the screen size: 13-inch screen with 3840x2400 resolution.

When screen is zoomed out to 50% problem seems to be disappeared:

screen-50.mp4

With original screen zoom (100%) reproduced:

screen-100.mp4

With previous shiny version (1.8.1.1) there was no such problem.

@toomish
Copy link
Author

toomish commented Jul 31, 2024

With chromium issue is also reproduced when screen is zoomed in:

chrome.mp4

@jcheng5
Copy link
Member

jcheng5 commented Jul 31, 2024

This is almost certainly my issue, I was in this code for the latest release. I’ll take a look in the morning, sorry about this!

@jcheng5
Copy link
Member

jcheng5 commented Jul 31, 2024

@toomish Can you try installing from the fix-clipping-regression branch (e.g. pak::pak("rstudio/shiny@fix-clipping-regression")) and see if that fixes it for you, and whether it introduces any other problems?

@toomish
Copy link
Author

toomish commented Jul 31, 2024

@toomish Can you try installing from the fix-clipping-regression branch (e.g. pak::pak("rstudio/shiny@fix-clipping-regression")) and see if that fixes it for you, and whether it introduces any other problems?

Yes, it is really fixed. Thank you!
Hope will be available in CRAN soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants