dreamRs / esquisse

RStudio add-in to make plots interactively with ggplot2
https://dreamrs.github.io/esquisse
Other
1.76k stars 227 forks source link

Bug: dynamically inserted esquisse module breaks when "filters" control isn't used #225

Closed daattali closed 1 year ago

daattali commented 1 year ago

When an esquisse module is inserted into a shiny app dynamically -- whether using insertTab(), insertUI(), or uiOutput()/renderUI(), if the "filters" control isn't used then the plot doesn't get generated. The rest of the module seems to work - the code gets updated for example - but the plot breaks. If the "filters" control is used, then it works fine.

Example:

library(shiny)

ui <- fluidPage()

server <- function(input, output, session) {
  insertUI("body", "beforeEnd", esquisse::esquisse_ui("test", controls = c("appearance")))
  esquisse::esquisse_server("test", data_rv = reactiveValues(data = iris, name = "iris"))
}

shinyApp(ui, server)

Using {esquisse} 1.1.2 and {shinyWidgets} from latest GitHub

It results in an empty plot:

image

pvictor commented 1 year ago

This one is trickier, I think. I'll look into it.

pvictor commented 1 year ago

Okay that should be fixed. Please re-install from GitHub :

remotes::install_github("dreamRs/esquisse")
daattali commented 1 year ago

Confirm fixed. Thank you!!