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

Make formattable work with promises-package #132

Open
simdadim opened this issue Sep 17, 2020 · 3 comments
Open

Make formattable work with promises-package #132

simdadim opened this issue Sep 17, 2020 · 3 comments

Comments

@simdadim
Copy link

Formattable-rendering is not working in shiny when using promises.

library(shiny)
library(formattable)
library(promises)
library(future)

ui <- fluidPage(
  formattableOutput("table")
)

server <- function(input, output, session) {
  output$table <- renderFormattable({
    future({mtcars}) %...>% formattable()
  })
}

shinyApp(ui, server)

This minimal example gives the error:
no applicable method for 'as.htmlwidget' applied to an object of class "promise"

which seems to missing handling of how to convert a future-formattable into a html-widget in the renderFormattable-function.

https://rstudio.github.io/promises/

@renkun-ken
Copy link
Owner

Would you like to provide an example where other htmlwidget works with promises?

@simdadim
Copy link
Author

I think this might be a place where its resolved in the DT-package: https://github.com/rstudio/DT/blob/c4cf873af528e5d28faa587246077f86709894a3/R/shiny.R#L81-L89

@ComeMaes
Copy link

ComeMaes commented Jul 1, 2021

I would be very interested in this too, any progress? I can't speak for the DT implementation, but hmtlWidget::shinyRenderWidget is supposed to support promises now, so I am not sure what the problem is and how to solve it.

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

3 participants