Closed
Description
Shiny supports async evaluation in it's current dev (async branch merged a few days ago). Plotly does not seem to support this new functionaility yet.
The error of the following minimal app says: "no applicable method for 'ggplotly' applied to an object of class "promise""
library(shiny)
library(plotly)
library(promises)
library(future)
plan(multiprocess)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
sliderInput("n",
"Test:",
min = 1,
max = 50,
value = 30)
),
mainPanel(
plotlyOutput("plot")
)
)
)
server <- function(input, output) {
getData <- function(n) {
data.frame(x = sample(n), y = sample(n))
}
data <- reactive({
n <- input$n
future(getData(n))
})
output$plot <- renderPlotly({
data() %...>%
plot_ly(x = ~x, y = ~y)
})
}
shinyApp(ui = ui, server = server)
Metadata
Metadata
Assignees
Labels
No labels