Skip to content

Brushing issue in the presence of geom_tile #2755

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

Closed
kevinrue opened this issue Feb 10, 2020 · 2 comments
Closed

Brushing issue in the presence of geom_tile #2755

kevinrue opened this issue Feb 10, 2020 · 2 comments

Comments

@kevinrue
Copy link

kevinrue commented Feb 10, 2020

Hello,

Opening a new issue as suggested here.

System details

Browser Version: Chrome, Version 79.0.3945.130 (Official Build) (64-bit)

Output of sessionInfo():

> sessionInfo()
R Under development (unstable) (2019-10-30 r77341)
Platform: x86_64-apple-darwin19.0.0 (64-bit)
Running under: macOS Catalina 10.15.3

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
[1] ggplot2_3.2.1 shiny_1.4.0  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3       rstudioapi_0.11  magrittr_1.5     tidyselect_1.0.0 munsell_0.5.0   
 [6] colorspace_1.4-1 xtable_1.8-4     R6_2.4.1         rlang_0.4.4      fastmap_1.0.1   
[11] dplyr_0.8.4      tools_4.0.0      grid_4.0.0       packrat_0.5.0    gtable_0.3.0    
[16] withr_2.1.2      htmltools_0.4.0  assertthat_0.2.1 lazyeval_0.2.2   digest_0.6.23   
[21] tibble_2.1.3     lifecycle_0.1.0  crayon_1.3.4     farver_2.0.3     purrr_0.3.3     
[26] later_1.0.0      promises_1.1.0   glue_1.3.1       mime_0.9         labeling_0.3    
[31] compiler_4.0.0   pillar_1.4.3     scales_1.1.0     jsonlite_1.6.1   httpuv_1.5.2    
[36] pkgconfig_2.0.3 

Example application or steps to reproduce the problem

See also: iSEE/iSEE#325 (comment)

library(shiny)
library(ggplot2)

ui <- fluidPage(
    plotOutput("thing", brush="YAY"),
    checkboxInput("add_tiles", "Add tile")
)

server <- function(input, output, session) {
    output$thing <- renderPlot({ 
        plot.data <- data.frame(Y=runif(100, 0, 6))
        plot.data$X <- factor(character(100))

        set.seed(100);
        summary.data <- data.frame(X="", Y=LETTERS[1:5], XWidth=1, YWidth=1)

        gg <- ggplot(plot.data)

        if (input$add_tiles) {
            gg <- gg +
                geom_tile(aes(x=X, y=Y, height=2*YWidth, width=2*XWidth, group=interaction(X, Y)),
                    summary.data, color='black', alpha=0, size=0.5)
        }

        gg + geom_point(aes(x=X, y=Y), alpha=1, plot.data, color='#000000', size=1) 
    })
}

shinyApp(ui, server)

Describe the problem in detail

In the absence of geom_tile, brushing works fine.

When a geom_tile layer is added, the brush cursor is shown on hover, but holding down a click drags the plot as a regular HTML image instead of drawing a brush.

Thanks in advance!

@dvg-p4
Copy link
Contributor

dvg-p4 commented Aug 12, 2022

This appears to be working properly for me in shiny 1.7.2

@kevinrue
Copy link
Author

Indeed, it looks fine now.

I'll be honest, I haven't kept up with updates in the meantime. It might have been working for a while, I couldn't say.

Thanks for the poke, I'll close this now.

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

No branches or pull requests

2 participants