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

Allow esquisse_server() to be initialized with NULL without forcing the import module to appear #232

Closed
daattali opened this issue Nov 4, 2022 · 2 comments

Comments

@daattali
Copy link
Contributor

daattali commented Nov 4, 2022

The esquisse module seems to always trigger the data import modal if the initial reactiveValues$data is NULL. I understand the logic behind this and it's a sensible default behaviour, but it would be useful to have the ability to control that. For example, consider the following small app, where I want the user to select a dataset from a list:

library(shiny)

ui <- fluidPage(
  selectInput("dataset", "dataset", c("iris", "mtcars")),
  esquisse::esquisse_ui("test")
)

server <- function(input, output, session) {
  rv <- reactiveValues(data = NULL, name = NULL)
  observeEvent(input$dataset, {
    rv$data <- get(input$dataset)
    rv$name <- input$dataset
  })
  esquisse::esquisse_server("test", rv)
}

shinyApp(ui, server)

I don't want to have the import modal show up, I just want the user to select a dataset and then populate esquisse with it. I know I can get around this by supplying a non-NULL value initially but it would be cleaner if I could tell esquisse to not show the modal.

@pvictor
Copy link
Member

pvictor commented Nov 15, 2022

Using a zero-length data.frame or similar won't show up the import module.
But I unserstand your point, maybe I can use the existing import_from argument, something like import_from = "none" or import_from = NULL will prevent the import modal to show up.

@daattali
Copy link
Contributor Author

I did try 'import_from = NULL', that's what intuitively made sense to me, so it wouldn't be a bad option.

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