Open zsigmas opened 1 year ago
Hi everyone,
I have found a weird interaction between vegawidget and renderUI in the application below.
vegawidget
renderUI
It can be reproduced by:
When doing this the vega output remains an error when it should be fine.
I am really surprised as this two outputs do not share any inputs, so I am lost into finding the possible relation between both.
I have tried with other HTMLWidgets, leaflets and rbokeh, but I could not reproduce the issue.
library(magrittr) vw <- list( `$schema` = vegawidget::vega_schema(), # specifies Vega-Lite data = list(values = mtcars), mark = "point", encoding = list( x = list(field = "wt", type = "quantitative"), y = list(field = "mpg", type = "quantitative"), color = list(field = "cyl", type = "nominal") ) ) %>% vegawidget::as_vegaspec() %>% vegawidget::vegawidget() ui <- shiny::fluidPage( shiny::checkboxInput("error_vega", "Send Error Vega", value = FALSE), shiny::checkboxInput("error_ui", "Send Error UI", value = FALSE), vegawidget::vegawidgetOutput("spec_chart_vega"), shiny::uiOutput("ui") ) server <- function(input, output, session) { output[["spec_chart_vega"]] <- vegawidget::renderVegawidget({ if (input[["error_vega"]]) stop("hey") vw }) output[["ui"]] <- shiny::renderUI({ if (input[["error_ui"]]) stop("hey ui") "No Error" }) } shiny::shinyApp(ui, server)
Thanks!
Hi @zsigmas - I had some time over the holidays to look at this, and I have to say I'm stumped:
I'll keep looking at it though...
Hi everyone,
I have found a weird interaction between
vegawidget
andrenderUI
in the application below.It can be reproduced by:
When doing this the vega output remains an error when it should be fine.
I am really surprised as this two outputs do not share any inputs, so I am lost into finding the possible relation between both.
I have tried with other HTMLWidgets, leaflets and rbokeh, but I could not reproduce the issue.
Thanks!