R闪亮C3散射D3相互矛盾

时间:2018-03-07 16:16:13

标签: javascript r shiny c3.js htmlwidgets

以下最小可重现的示例工作正常,但是当我取消注释scatterD3Output("scatterPlot", height = "700px")时它停止工作:没有给出错误,但没有显示输出

C3和scatterD3库是否不兼容?

更新 问题似乎是C3基于d3v3而d3v4上的scatterD3

library(shiny)
library(C3)
library(scatterD3)

server = function(input, output) {
  my_df = reactive({
    input$button
    my_df = list(a=runif(1,0,100),b=runif(1,0,100),c=runif(1,0,100))
    list(my_df=my_df)
  })
  output$my_pie = renderC3Pie({
    C3Pie(value = my_df()$my_df)
  })
  output$scatterPlot <- renderScatterD3({
    scatterD3(x=1,y=1)
  })
}

ui = shinyUI(
  fluidPage(
    fluidRow(
      actionButton('button', "Draw!"),
      C3PieOutput('my_pie')
    ),
    fluidRow(
      br()#,scatterD3Output("scatterPlot", height = "700px")
    )
  )
)
shinyApp(ui = ui, server = server)

0 个答案:

没有答案