以下最小可重现的示例工作正常,但是当我取消注释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)