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

Gauge min and label does not update when re-rendered #297

Closed
jeffkeller87 opened this issue Jan 13, 2021 · 0 comments · Fixed by #301
Closed

Gauge min and label does not update when re-rendered #297

jeffkeller87 opened this issue Jan 13, 2021 · 0 comments · Fixed by #301

Comments

@jeffkeller87
Copy link

When a gauge is re-rendered, the min and label values are not updated with the new values. They are stuck with the values from the first render. max, value, and symbol do update correctly.

example.mov

Example:

library(shiny)
library(flexdashboard)

ui <- fluidPage(
  actionButton(inputId = "button", label = "Re-render"),
  gaugeOutput(outputId = "gauge")
)

server <- function(input, output) {
  
  observeEvent(input$button, ignoreNULL = FALSE, {

    output$gauge <- renderGauge(
      gauge(
        value = sample(1:10, size = 1),
        min = sample(1:5, size = 1),
        max = sample(6:10, size = 1),
        symbol = sample(c("%", "$", "#"), size = 1),
        label = round(runif(1), 5)
      )
    )

  })
  
}

shinyApp(ui = ui, server = server)

sessionInfo()

R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

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

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

other attached packages:
[1] flexdashboard_0.5.2 shiny_1.5.0        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5        rstudioapi_0.13   knitr_1.30        magrittr_2.0.1    xtable_1.8-4     
 [6] R6_2.5.0          rlang_0.4.10      fastmap_1.0.1     tools_3.6.3       packrat_0.5.0    
[11] xfun_0.20         withr_2.3.0       htmltools_0.5.0   yaml_2.2.1        digest_0.6.27    
[16] later_1.1.0.1     htmlwidgets_1.5.3 promises_1.1.1    rsconnect_0.8.16  evaluate_0.14    
[21] mime_0.9          rmarkdown_2.6     compiler_3.6.3    jsonlite_1.7.2    httpuv_1.5.4     
[26] renv_0.12.4 
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.

1 participant