我在flexdashboard中使用shinyTree时遇到了问题。在一个普通的闪亮的应用程序中运行良好:
library(shiny)
library(shinyTree)
server <- function(input, output) {
output$tree <- renderTree({
opciones = list('All'= list(
'Human' = structure(list('OP1'='OP1', 'OP2'='OP2'),stopened=TRUE),
'Mouse' = structure(list('OP3'='OP3'), stopened=TRUE)))
attr(opciones[[1]],"stopened")=TRUE
opciones
})
}
ui <- fluidPage(
shinyTree("tree", checkbox = "TRUE")
)
shinyApp(ui = ui, server = server)然而,当我在Flexdashboard中使用它时,它返回一个空的选项卡(参见这个文件:https://mega.nz/file/DCozwIiJ#ttcBe581FPfhINVoczfBvaXhgRlXwVSu-wd2JhXTEEY)
您是否知道为什么会发生这种情况,以及如何在flexdashboard中创建js树复选框?
发布于 2020-10-21 16:03:20
与shinyTree包相比,jsTreeR包可以做更多的事情。而且它在flexdashboard上运行得很好

---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}库(Flexdashboard)
库(闪亮)
库(JsTreeR)
```{r}节点<- list(
列表(
text = "RootA",data = list(value = 999),icon = "far fa-moon red",children = list( list( text = "ChildA1", icon = "fa fa-leaf green" ), list( text = "ChildA2", icon = "fa fa-leaf green" ))),
列表(
text = "RootB",icon = "far fa-moon red",children = list( list( text = "ChildB1", icon = "fa fa-leaf green" ), list( text = "ChildB2", icon = "fa fa-leaf green" )))
)
output["jstree"] <- renderJstree({
jstree(节点,dragAndDrop =真,复选框=真,主题=“质子”)
})
output["treeSelected"] <- renderPrint({
输入[“jstree_selected”]
})
Column {data-width=400}
-----------------------------------------------------------------------
### Checkbox tree
```{r}jstreeOutput("jstree")
Column {data-width=400}
-----------------------------------------------------------------------
### Selected nodes
```{r}verbatimTextOutput("treeSelected")
### Chart C
```{r}https://stackoverflow.com/questions/64415487
复制相似问题