rstudio / dygraphs

R interface to dygraphs
http://rstudio.github.io/dygraphs
Other
364 stars 194 forks source link

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

Open dschulz13 opened 2 years ago

dschulz13 commented 2 years ago

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

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.

Show / hide contents

```{r} widget ``` Inside the ```

``` tags, the widget is not displayed properly.

widget

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