标签: flexdashboard

在flexdashboard中添加滚动到侧边栏

我正在使用Flexdashboard设计一个UI,一些textinput框超出常规浏览器窗口,我vertical_layout: scroll在代码中添加了一行,但我猜这还不够?所以我的问题是如何启用垂直滚动功能,如下图所示.?非常感谢任何提示或指示.

在此输入图像描述

这是我下面的代码

---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: scroll
    smooth_scroll: true
    runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)
```

     Inputs {.sidebar}
-----------------------------------------------------------------------

  ```{r}
library(shiny)
library(shinyjs)


shinyjs::useShinyjs()
#tags$hr(),
shinyjs::disabled(textInput("id", "Id", "0"))
textInput("X1", "X1", "")
textInput("X2", "X2", "")
textInput("X3", "X3", "")
textInput("X4", "X4", "")
textInput("X5", "X5", "")
textInput("X6", "X6", "")
textInput("X7", "X7", "")
textInput("X8", "X8", "")
textInput("X9", "X9", "")
textInput("X10", "X10", "")
textInput("X11", "X11", "")
textInput("X12", "X12", "")

textInput("X13", "X13", "")
textInput("X14", "X14", "")
textInput("X15", "X15", "") …
Run Code Online (Sandbox Code Playgroud)

r r-markdown shinydashboard flexdashboard

3
推荐指数
1
解决办法
3282
查看次数

如何从Rmarkdown部分重构Shiny代码的服务器部分

我有以下完全运行Shiny-dashboard App:

---
title: "Test"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    theme: bootstrap
    vertical_layout: scroll
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
```

Basic 
===================================== 

Inputs_basic {.sidebar}
-------------------------------------

```{r io_processes}
 selectInput("mpg_thres", label = "MPG threshold",
              choices = c(10,20,30,40), selected = 10)
 selectInput("cyl_thres", label = "CYL threshold",
              choices = c(4,5,6,7,8), selected = 4)
```

Rows {data-height=500}
-------------------------------------


### Scatter Plot

```{r show_scattr}
mainPanel(

  renderPlot( {
     dat <- as.tibble(mtcars) %>%
            select(mpg, cyl) %>%
            filter(mpg > input$mpg_thres & cyl > input$cyl_thres)
     ggplot(dat, aes(mpg, cyl)) …
Run Code Online (Sandbox Code Playgroud)

refactoring r r-markdown shiny flexdashboard

3
推荐指数
1
解决办法
121
查看次数

如何将 URL 链接添加到顶部导航栏

我尝试在此处和其他论坛中找到解决方案,但一无所获。

我正在使用 flexdashboard 创建一个网站(HTML 文件)。它有几个页面,每个页面都可以通过顶部的导航栏访问。就像是:

Home
=======================================================================

Row
-----------------------------------------------------------------------

### Cover Picture {.no-title} ![](picture0.jpg)

Page 1
=======================================================================

Row
-----------------------------------------------------------------------

### Picture 1 {.no-title} ![](picture1.jpg)

Row
-----------------------------------------------------------------------

### Picture 2 {.no-title} ![](picture2.jpg)
Run Code Online (Sandbox Code Playgroud)

我想在导航栏中添加一个指向外部网站的链接,比如谷歌。我尝试简单地添加如下内容:

[www.google.com]
=======================================================================
Run Code Online (Sandbox Code Playgroud)

但是,当我点击它时,它会转到我的 html 中一个名为 [www.google.com] 的空白页面。为了实际转到 Google 的网页,我必须右键单击该链接并单击“在新选项卡中打开”。

如果我尝试使用下拉导航栏菜单,也会发生同样的情况:

[www.google.com] {data-navmenu="External URLs"}
=======================================================================

[www.bing.com] {data-navmenu="External URLs"}
=======================================================================
Run Code Online (Sandbox Code Playgroud)

我还尝试在链接之前向页面插入一个名称:

Google's Page [www.google.com] 
=======================================================================
Run Code Online (Sandbox Code Playgroud)

或者甚至为链接使用自定义名称:

[www.google.com](Google) 
=======================================================================
Run Code Online (Sandbox Code Playgroud)

我理解这样的基本原理:如果我创建了一个名为 [www.google.com] 的空白页面,那么如果我在导航栏中单击它,它就会转到我的 HTML 中的那个空白页面。但是有什么方法可以让它理解实际上我不希望那个空白页面存在,我只希望在我的导航栏中使用外部链接?

我希望链接的行为就像我写的那样:

### [www.google.com]
Run Code Online (Sandbox Code Playgroud)

当我点击它时,它会直接进入 Google 的网站。

任何帮助是极大的赞赏。

html r r-markdown flexdashboard

3
推荐指数
1
解决办法
2330
查看次数

连续发光超过三个值框

我正在开发具有7或8 valueBox的测试ShinyApp。一切正常,除了,闪亮的每行添加三个valueBox。现在,我在顶部有三行显示这7个valueBox。我尝试更改width参数,但它不起作用。这是我的下面的代码。

我的目标是每行有5个valueBox而不是默认的3个。任何建议深表感谢。

## Only run this example in interactive R sessions

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Dynamic boxes"),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(

      valueBoxOutput("vbox1"),
      valueBoxOutput("vbox2"),
      valueBoxOutput("vbox3"),
      valueBoxOutput("vbox4"),
      valueBoxOutput("vbox5"),
      valueBoxOutput("vbox6"),
      valueBoxOutput("vbox7"),
      valueBoxOutput("vbox8")

    )
  )
)

server <- function(input, output) {

  output$vbox1 <- renderValueBox({ valueBox( "One","Yes", width = 2, icon = icon("stethoscope"))})
  output$vbox2 <- renderValueBox({ valueBox( "Two","Yes", width = 2, icon = icon("stethoscope"))})
  output$vbox3 <- renderValueBox({ valueBox( "Skip","Yes", width = 2, icon = icon("stethoscope"))})
  output$vbox4 <- renderValueBox({ valueBox( "a Two","Yes", width …
Run Code Online (Sandbox Code Playgroud)

r shiny shinydashboard flexdashboard

3
推荐指数
1
解决办法
2720
查看次数

R flexdashboard 未在 IE 11 中呈现

我使用 flexdashboard 制作了一系列仪表板,并发现它们在 Chrome 中运行良好,但无法在 IE 11 中呈现。

我制作了一个非常简单的仪表板用于测试目的,但我在 IE 中得到的仍然是一个空白页面。如果我将输出从 flexdashboard 更改为 html_document,它呈现得很好,所以问题似乎出在 flexdashboard 而不是 R Markdown。

这是我的简单仪表板:

---
title: "Flexdashboard - Internet Explorer test"
output: 
  flexdashboard::flex_dashboard
---    
```{r setup, include=FALSE}
# Libraries
library(flexdashboard)
library(knitr)
library(ggplot2)
```
Iris
=========================================
Row
-------------------------------------
```{r}
ggplot(data=iris, aes(x=Petal.Length, y=Petal.Width, color=Species)) + geom_point()
```
Run Code Online (Sandbox Code Playgroud)

这就是我在 IE 中得到的全部信息: flexdashboard IE 失败

我没有发现关于这个确切问题的其他报告,只有使用 ggiraph类似问题

我让我的同事尝试在她的电脑上使用 IE 打开文件,结果是一样的。我真的很想让这个工作,因为这个组织中的一些人只允许使用 IE。

internet-explorer r flexdashboard

3
推荐指数
1
解决办法
935
查看次数

Flexdashboard多属性页面

我正在学习flexdashboard,并为将来的应用尝试一些不同的布局。但是我无法为同一页面分配不同的属性。

我希望第二页具有行布局,在导航栏A中列出,并且标题前面有一个图标。当我这样写它们时:{data-orientation=rows, data-navmenu="Menu A", data-icon="fa-list"}没有一个被使用。这样写时:{data-orientation=rows}, {data-navmenu="Menu A"}, {data-icon="fa-list"}仅执行最后一个,而前两个放在页面标题中。当使用第二个而没有逗号时,同样的事情也会发生。

我没有在示例中找到页面的多个属性的任何示例

如何合并它们?由于我无法想象,我必须在为页面提供行格式并将其放入下拉菜单之间进行选择,这是有可能的...

这是我使用的代码:


title: "My flexdash"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)
```

Page 1 {data-navmenu="Menu A"}
======================================    
Column {data-width=350}
-----------------------------------------------------------------------
### Chart A
```{r}

```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart B
```{r}

```
# need these attributes to be working but invisible
Page 2 {data-orientation=rows}, {data-navmenu="Menu A"}, {data-icon="fa-list"}
=============================================   
Row {data-width=650}
-----------------------------------------------------------------------   
### Chart C 
```{r}

```
Row …
Run Code Online (Sandbox Code Playgroud)

r flexdashboard

3
推荐指数
1
解决办法
1296
查看次数

用于呈现函数的反应参数

我在flexdashboard中有一个表,其列数可以更改.我可以动态计算列的对齐方式(默认对齐视为$23.45字符向量,因此左对齐值,尽管它是一个数字,应该右对齐).问题是我无法将此对齐renderTable作为值传递回,align因为它是一个无效值.

如何将反应对齐传递回renderTable函数的align参数?(或者让我渲染具有反应对齐的表格的替代方案)

MWE

---
title: "test"
output: flexdashboard::flex_dashboard
runtime: shiny
---

```{r}
library(flexdashboard)
library(shiny)
```

Inputs {.sidebar}
-------------------------------------

```{r}
selectInput(
    "ncols", 
    label = "How many columns?",
    choices = 1:5, 
    selected = 5
)
```  

Column  
-------------------------------------

### Test

```{r}
nc <- reactive({input$ncols})
aln <- reactive({substring('lllrr', 1, nc())})

renderTable({
    x <- CO2[1:5, seq_len(nc()), drop = FALSE]
    x[, 1] <- as.character(x[, 1])
    x[3, 1] <- '<b>Mc1</b>'
    x
}, align = aln(), sanitize.text.function …
Run Code Online (Sandbox Code Playgroud)

r shiny flexdashboard

3
推荐指数
2
解决办法
500
查看次数

如何使用flexdashboard添加到徽标的链接?

我在flexdashboard doc页面之后的仪表板上添加了徽标。现在,我希望能够单击徽标,然后将其重定向到外部页面。

我知道您可以将带有r-markdown的图像与以下内容进行超链接:

[![alt text](path to image)](web link to website)
Run Code Online (Sandbox Code Playgroud)

我只是在努力将其集成到flexdashboard导航栏中的徽标中。有人知道怎么做吗?谢谢!

我在徽标中添加了以下几行:

---
title: "My Report"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    css: style.css
    logo: my-logo.png
---
Run Code Online (Sandbox Code Playgroud)

html r r-markdown flexdashboard

3
推荐指数
1
解决办法
559
查看次数

在 flexdashboard 中,是否可以单击 valueBox 来更新文本框,例如 actionButton?

我正在尝试利用valueBoxinflexdashboard来显示标题数字。但是,我也希望valueBox可以像 一样actionButton,因为单击valueBox应该会触发仪表板中其他位置的操作。

在检查flexdashboard文档时,我看到以下相关位valueBox

关联值框

valueBox(42, icon = "fa-pencil", href="#details")
Run Code Online (Sandbox Code Playgroud)

其中单击valueBox将用户导航到具有“#details”锚点的不同页面。但是,没有任何迹象表明单击valueBox可用于其他操作。

下面是一个最小的相关 flexdashboard 代码

---
title: "valueBox Links"
output: 
  flexdashboard::flex_dashboard:
runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)

    ```

Tab 1 - Test
======================================================================

Column 
-------------------------------------

#### Three valueBoxes

### valueBox 1
```{r}
valueBox(1)
    ```

### valueBox 2
```{r}
valueBox(2)
    ```

### valueBox 3
```{r}
valueBox(3)
    ```

Column
-------------------------------------

### Text output
This is …
Run Code Online (Sandbox Code Playgroud)

r shiny flexdashboard

3
推荐指数
1
解决办法
2355
查看次数

infoBox Shinydashboard 上的自定义图标

有没有办法infoBoxshinydashboard. 我正在尝试使用hrbrmstr gist上的示例,但我找不到更新infoBox函数的位置。

library(shiny)

ui <- dashboardPage(
  dashboardHeader(title = "Dynamic boxes"),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(
      box(width = 2, actionButton("count", "Count")),
      infoBoxOutput("ibox"),
      valueBoxOutput("vbox")
    )
  )
)

server <- function(input, output) {
  output$ibox <- renderInfoBox({
    infoBox(
      "Title",
      input$count,
      #icon = icon("credit-card")
icon=icon(list(src=x, width="80px"), lib="local")
    )
  })
  output$vbox <- renderValueBox({
    valueBox(
      "Title",
      input$count,
      icon = icon("credit-card")
    )
  })
}

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

r shiny shinydashboard flexdashboard

3
推荐指数
1
解决办法
1215
查看次数