在HTML中呈现时,flexdashboard选项卡布局与DT :: datatable和visNetwork冲突

时间:2018-09-26 12:04:24

标签: dt flexdashboard visnetwork

我试图将Flexdashboard创建为独立的html,在一个选项卡中具有visNetwork图,在另一个表中具有数据表。

除非我在某处添加了{vertical_layout:fill}或{vertical_layout:scroll}(我在yaml级别和制表符级别上都尝试过),否则我无法获得显示任何行的数据表,但是如果我这样做了,则visNetwork图不会垂直填充页面。

我可以做些什么来使图表和表格都充满页面吗?

这是一个可复制的示例:

---
title: "reproducible example"
output: 
  flexdashboard::flex_dashboard:
    theme: bootstrap
    source_code: embed
---

```{r setup, include=FALSE}
library(tidyverse)
library(DT) # interactive tables
library(visNetwork)

mynodes <- data.frame(id = paste0("P",1:10))
myedges <- data.frame(from = unlist(mynodes), to =unlist(mynodes)) %>% 
  expand(from, to)
```

circle layout 
=======================================================================

```{r}
visNetwork(mynodes, myedges) %>%
  visIgraphLayout(layout = "layout_in_circle")
```


full table 
=======================================================================


##### full results for sets with min 5% reach

```{r}
DT::datatable(
  myedges ,
  filter = 'top'
) 
```

谢谢!

0 个答案:

没有答案