dreamRs / esquisse

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

filter warning using data.table, but not data.frame #149

Closed bthieurmel closed 3 years ago

bthieurmel commented 3 years ago

Example :

library(shiny)
library(esquisse)
library(nycflights13)
library(data.table)

ui <- fluidPage(
  tags$h1("Use esquisse as a Shiny module"),

  esquisse_ui(
    id = "esquisse", 
    header = FALSE, # dont display gadget title
    controls = NULL,
    container = esquisseContainer(height = "700px")
  )
)

server <- function(input, output, session) {

  # warning passing data.table
  data_rv <- reactiveValues(data = data.table(nycflights13::flights[1:20000,]), name = "iris")

  # no warning passing data.frame !
  # data_rv <- reactiveValues(data = nycflights13::flights[1:20000,]), name = "iris")

  esquisse_server(
    id = "esquisse", 
    data_rv = data_rv
  )

}
shinyApp(ui, server)

image

bthieurmel commented 3 years ago

Moreover, I think that filter computation is processed even if disable in controls (but not showed as expected)

pvictor commented 3 years ago

First issue was in {datamods}, should work if you re-install from GitHub:

remotes::install_github("dreamRs/datamods")

and now filters should not be created if the panel is disabled (you need to re-install esquisse from GitHub as well)