shinyapps.io crashes when getting point coordinates of a dygraph

孤街醉人 提交于 2020-02-26 00:54:27

问题


I'm trying to build an app, which is doing something similar to this post. I want point coordinates to be copied to a clipboard by every click. I've just copied it as an example with a small modification in observeEvent.

library(shiny)
library(dygraphs)
library(clipr)

ui = fluidPage(
  mainPanel(
    dygraphOutput("dygraph"),
    br(),
    textOutput("clicked", inline = TRUE)
  )
)


server = function(input, output) {


  output$dygraph <- renderDygraph({
    dygraph(ldeaths) 
  })

  output$clicked <- renderText({
    strftime(req(input$dygraph_click$x), "%d-%m-%Y")
  })

  clickedPr <- reactive({
    print(strftime(req(input$dygraph_click$x), "%d-%m-%Y"))
  })

  observeEvent(req(input$dygraph_click$x),{

    clipr::write_clip(clickedPr())
    # write.table(clickedPr(), "clipboard", quote = F, row.names = F, col.names = F) 
  })


}

shinyApp(ui = ui, server = server)

It works perfect on my Windows machine. When I deploy my app with Shinyapps.io, I'm disconnected each time I want to use the copy-to-clipboard function. What's going on?

Here is the not-working example at shinyapps.io https://atsyplenkov.shinyapps.io/shiny-example/

来源:https://stackoverflow.com/questions/60281465/shinyapps-io-crashes-when-getting-point-coordinates-of-a-dygraph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!