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

iheatmapr in shiny is not responsive #84

Open
daattali opened this issue May 17, 2021 · 1 comment
Open

iheatmapr in shiny is not responsive #84

daattali opened this issue May 17, 2021 · 1 comment
Labels
bug maybe-fixed Issues that may or may not be resolved, if you think not then please say so

Comments

@daattali
Copy link

Generally, any output in shiny knows how to adjust its width based on its container. When the width of the browser window changes, outputs expand/shrink automatically to fit in the new width.

This does not seem to be the case for iheatmapr.

Example - in the following app, the plotly plot responds if you change the window size, but the heatmap remains the same size it was initially

library(shiny)

ui <- fluidPage(
    plotly::plotlyOutput("plot"),
    iheatmapr::iheatmaprOutput("heatmap")
)

server <- function(input, output, session) {
    output$plot <- plotly::renderPlotly({
        plotly::plot_ly(mtcars, x = ~mpg, y = ~cyl)
    })
    
    output$heatmap <- iheatmapr::renderIheatmap({
        mat <- matrix(rnorm(24), nrow = 6)
        annotation = data.frame(gender = c(rep("M", 3),rep("F",3)),
                                age = c(20,34,27,19,23,30))
        iheatmapr::iheatmap(
            mat, 
            cluster_rows = "hclust",
            cluster_cols = "kmeans", 
            col_k = 3, 
            row_annotation = annotation
        )
  })
}

shinyApp(ui, server)
alanocallaghan added a commit that referenced this issue Sep 3, 2023
@alanocallaghan alanocallaghan added the maybe-fixed Issues that may or may not be resolved, if you think not then please say so label Sep 3, 2023
@alanocallaghan
Copy link
Contributor

Again see towards-0.8 branch, maybe not the right solution but works for now

alanocallaghan added a commit that referenced this issue Aug 13, 2024
* Spellcheck and linting
* Update tests
* Fix shiny::req behaviour (#85)
* Always use autosize (see #84)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug maybe-fixed Issues that may or may not be resolved, if you think not then please say so
Projects
None yet
Development

No branches or pull requests

2 participants