Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使Rmarkdown手机中的HTMLWidget友好_Html_Css_R_R Markdown_Htmlwidgets - Fatal编程技术网

使Rmarkdown手机中的HTMLWidget友好

使Rmarkdown手机中的HTMLWidget友好,html,css,r,r-markdown,htmlwidgets,Html,Css,R,R Markdown,Htmlwidgets,rmarkdown的默认选项是设置fig.width=12。如果可能的话,我希望它能自动调整移动设备的宽度 我将在 不过,当我在ChromeDevTools中玩不同的移动设备时,它会根据屏幕的宽度进行调整。我有一个物理三星Galaxy 5,我正在测试 <div id="htmlwidget-4092" style="width:75%; height:75%; position:absolute" class="leaflet html-widget"></div>

rmarkdown的默认选项是设置fig.width=12。如果可能的话,我希望它能自动调整移动设备的宽度

我将在

不过,当我在ChromeDevTools中玩不同的移动设备时,它会根据屏幕的宽度进行调整。我有一个物理三星Galaxy 5,我正在测试


<div id="htmlwidget-4092" style="width:75%; height:75%; position:absolute" class="leaflet html-widget"></div>
这段代码出现在源代码底部附近。可以将尺寸设置为百分比,并自动调整大小以适应屏幕。任何百分比都应该有效。此外,还需要
position:absolute
,以确保它保持在正确的位置


注意:我建议找到一种方法来缩短页面源代码中的大量链接。

我认为指定一个百分比
宽度
将得到您想要的结果。下面是如何在
r标记中执行此操作的,下面是一个示例。不幸的是,如果你同时指定一个百分比
高度
,你的屏幕会因为某个地方的错误而显示为空白,因此它不是完全响应的,但在我的iPhone上它仍然可以很好地调整

---
title: "responsive_leaflet"
author: "TimelyPortfolio"
date: "March 24, 2016"
output:
  html_document:
   mathjax: null
---

```{r echo=FALSE, warning=FALSE}
# no help from a framework
#  just percentage height and width
library(leaflet)

l <- leaflet(width="100%") %>%
  addTiles()
l
```

```{r echo=FALSE, warning=FALSE}
# demonstrate with Bootstrap
library(shiny)

fluidRow(
  column(width=10,l)
)
```
---
标题:“响应性宣传单”
作者:“TimelyPortfolio”
日期:“2016年3月24日”
输出:
html_文件:
mathjax:null
---
```{r echo=FALSE,warning=FALSE}
#没有来自框架的帮助
#只是高度和宽度的百分比
图书馆(单张)
l%
addTiles()
L
```
```{r echo=FALSE,warning=FALSE}
#用Bootstrap演示
图书馆(闪亮)
fluidRow(
列(宽度=10,l)
)
```

谢谢。这对我来说很有意义。
---
title: "responsive_leaflet"
author: "TimelyPortfolio"
date: "March 24, 2016"
output:
  html_document:
   mathjax: null
---

```{r echo=FALSE, warning=FALSE}
# no help from a framework
#  just percentage height and width
library(leaflet)

l <- leaflet(width="100%") %>%
  addTiles()
l
```

```{r echo=FALSE, warning=FALSE}
# demonstrate with Bootstrap
library(shiny)

fluidRow(
  column(width=10,l)
)
```