networkD3 和 Shiny 不显示进度条

Progress bar not showing with networkD3 and Shiny

我在 Shiny 和包 networkD3 中遇到一些进度条问题。进度条显示正常,无需尝试从该包中呈现图表。如果尝试使用进度条和 networkD3 包,进度条会显示一次但不会出现在后续调用中。我在 Chrome 测试过。这是一个最小的示例代码:

require(shinyjs)
require(shiny)
require(networkD3)
require(jsonlite)

ui <- function(){
  fluidPage(
    fluidRow(
      column(width = 12, style = "margin: 0px; padding: 0px;",
             box(title = "Flow Diagram", status = "primary", solidHeader = F, width = 7,
                 sankeyNetworkOutput("sankeyFlow", width = "100%", height = "500px")
             )
      ), 
      sliderInput("numLanes", label = "Number of Top Lanes", min = 0, max = 30, value = 10)
    )
  )
}

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

  observeEvent(c(input$numLanes), {
    withProgress(message = "Wait...", value = NULL, {
      Sys.sleep(1.0)
    })
  })

  output$sankeyFlow <- renderSankeyNetwork({
    print("sankey")

    withProgress(message = "Updating flow diagram...", value = NULL, {

      # Load energy projection data
      URL <- "https://cdn.rawgit.com/christophergandrud/networkD3/master/JSONdata/energy.json"
      Energy <- jsonlite::fromJSON(URL)

      nLanes <- input$numLanes

      plot <- sankeyNetwork(Links = Energy$links, Nodes = Energy$nodes, Source = "source",
                                  Target = "target", Value = "value", NodeID = "name",
                                  units = "TWh", fontSize = 12, nodeWidth = 30)
      return(plot)
    })
  })
}

shinyApp(ui = ui, server = server)

也许有人对发生这种情况的原因和可能的解决方法有所了解。在我的用例中,我使用了几个进度条,如果包含流程图,则会显示 none。

谢谢, 克里斯蒂安

我很确定这是 conflict/bug networkD3 如何在 sankeyNetwork().

中启用多行工具提示

看... https://github.com/christophergandrud/networkD3/issues/250


更新 (2019-05-20)

此问题已在 shiny 的开发版本中得到解决,应该会在 shiny v1.3.3 后尽快在 CRAN 上发布。