r-与D3Treer的交互式treemap不会发光



我是Shiny的新手,我正在尝试使用 d3treer html html html widtet 显示一个交互式treemap

我使用以下代码,它在R中完美运行:

library(readxl)
budget_map <- read_excel(path = 'Trader Dashboard Data Prep Sample.xlsx',sheet='v2',col_names = TRUE)
library(treemap)
budget_treemap <- treemap(budget_map,index=c("Sales Agency","Agency","Advertiser"),vSize="Booked Revenue Net",vColor="Sales Agency",palette = "Set1",type="categorical",title="Australia Budget Map",fontsize.title=22)
library(d3treeR)
d3tree2(budget_treemap)

我正在尝试使其呈现在闪亮中,并且正在使用以下代码:

library(shiny)
library(readxl)
library(treemap)
library(htmlwidgets)
library(data.tree)
library(d3treeR)
budget_map <- read_excel(path = 'C:/Users/rahul/Desktop/30k foot view/Trader Dashboard Data Prep Sample.xlsx',sheet='v2',col_names = TRUE)
budget_treemap <- treemap(budget_map,index=c("Sales Agency","Agency","Advertiser"),vSize="Booked Revenue Net",vColor="Sales Agency",palette = "Set1",type="categorical")
ui <- fluidPage(
  d3tree2Output("au_budget_map")
)

server <- function(input,output){
    output$au_budget_map <- renderD3tree2({budget_treemap})
}
shinyApp(ui = ui, server = server)

附加示例数据以使其可复制:https://drive.google.com/open?id=0b2ljxtbtsuhhcnzjjexi3t0kwyw8我知道我可能会缺少一些非常明显的东西 - 但无法发现它!任何帮助真的很棒!谢谢!

renderD3tree2接受 d3tree2的结果作为输入:

output$au_budget_map <- renderD3tree2({d3tree2(budget_treemap)})

相关内容

  • 没有找到相关文章

最新更新