Skip to content

Widget not displayed properly when wrapped in <details> tags #257

Description

@dschulz13

dygraphs widgets are not displayed properly when wrapped within <details> tags in HTML document types. The plot titles and labels are shown but the plot window itself is not included. Using the following example as an Rmd file, an HTML file with the described issue can be created.

This issue is similar to the one stated in Issue #793 with regard to the leaflet package.

---
title: "Issue demonstration"
date: "April 12, 2022"
output: html_document
---
  
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Section 1

```{r,  warning = FALSE, message = FALSE}
library(dygraphs)

set.seed(123)
Xt <- ts(rnorm(200), start = c(1980, 1), frequency = 12)

widget <- dygraph(Xt, main = "Plot title", xlab = "Label 1", ylab = "Label 2", width = 800, height = 400) %>%
  dyRangeSelector()
widget
```

Before the ```<details>``` tags, the widget is displayed properly.

<details><summary>Show / hide contents</summary>
<p>

```{r}
widget
```

Inside the ```<details>``` tags, the widget is not displayed properly.

</p>
</details>
  
```{r}
widget
```

After the ```<details>``` tags, the widget is once again displayed properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions