闪亮的应用程序的导航栏会干扰rmarkdown网页的导航栏

时间:2018-10-11 19:27:35

标签: html r iframe shiny r-markdown

我正在为我的实验室创建一个网页,其中包括我们拥有的产品 开发了一款出色的应用程序,可以检查全球气候变化。

以下是该页面中的website,这就是应用standalone的样子,正如您在菜单中看到的那样,网站的“简介”标签中有三个未显示的选项, 简介工作流程关于变更日志应该可见

网站yaml

我使用经典的rmarkdown网站构建了一个网页,所以我的网页Yaml看起来像这样:

name: "Sitio web de ecoinformática del laboratorio Marquet"
navbar:
  title: "Ecoinformática"
  left:
    - text: "Home"
      href: index.html
    - text: "Sobre nosotros"
      href: about.html
    - text: "GCM compareR app"
      href: GCMcompareR.html
    - text: Docencia
      icon: fa-gear
      menu:
      - text: Ecología BIO231c 
      - text: Modulo 1.1
        href: Modulo1.1.html
      - text: Modulo 1.2
        href: Modulo1.2.html
    - text: RPackages
      icon: fa-gear
      menu:
      - text: RPackages
      - text: NetworkExtinction
        href: VignetteNetworkExt.html
output_dir: "."
output:
  html_document:
    theme: cosmo
    highlight: textmate
    include:
    css: styles.css

实际应用Rmd

在GCM compareR应用的标签中,我具有以下内容:

---
title: ""
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE) 
```

<iframe src="http://admin.ecoinformatica.net/shiny/rstudio/sample-apps/GCM/"style="border: 0; position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%"">

可能有效但无法解决的解决方案

  • 在顶部添加填充以防止两个导航栏都产生冲突
  • 当我转到应用程序网页时,删除网站的导航栏
  • 将网站的导航栏设置为“可部署”,以便仅在将光标移至网页边缘时显示。
  • 将网页的导航栏更改为左侧。

我尝试过的事情:

更改边界:

<iframe src="http://admin.ecoinformatica.net/shiny/rstudio/sample-apps/GCM/"style="border: 100; position:absolute; top:100; left:0; right:0; bottom:0; width:100%; height:100%"">

使应用程序具有响应性

<div class="resp-container">
    <iframe class="resp-iframe" src="http://admin.ecoinformatica.net/shiny/rstudio/sample-apps/GCM/" style="border: 100; position:absolute; top:100; left:0; right:0; bottom:0; width:100%; height:100%"">

     

使用include_app

```{r}
knitr::include_app("http://admin.ecoinformatica.net/shiny/rstudio/sample-apps/GCM/", height = "600px")
```

哪种作品,但是我无法固定宽度

欢迎任何帮助

1 个答案:

答案 0 :(得分:1)

通过调整iframe的高度和顶部选项,可以将闪亮的应用导航栏向下移动几个像素:

<iframe src="http://admin.ecoinformatica.net/shiny/rstudio/sample-apps/GCM/"style="border: 0; position:absolute; top:5%; left:0; right:0; bottom:0; width:100%; height:95%"">
</iframe>