0

我有一个多页的 R FlexdashBoard,我正在尝试使用 ggiraph 创建一些交互式图表。它们在仪表板的第一页上显示得很好,但是在第二页上,SVG 图形直到我点击刷新后才显示,然后第一页上的图表消失了。此外,SVG 图形中的文本似乎只是间歇性地显示。我在 Internet Explorer 中只有这个错误 - 在 Chrome 中一切正常。以下代码应重新创建此错误。

如果提示要查看哪个包或一段 java 脚本,任何帮助将不胜感激。

---
title: "Please Help Me!"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

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

Works {data-orientation=rows}
=====================================  

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```

Column {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r}

myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)
```

### Chart C

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```

Does Not Work {data-orientation=rows}
=====================================  

### Chart C

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```

### Chart D

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```
### Chart E

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```
4

0 回答 0