Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upsetjs and rmarkdown #27

Closed
Pierre9344 opened this issue May 23, 2022 · 4 comments
Closed

upsetjs and rmarkdown #27

Pierre9344 opened this issue May 23, 2022 · 4 comments
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@Pierre9344
Copy link

When I try to include more than two venn diagram with the upsetjs package, only the first two are created in the rendered document. If I try to create the venn from the code chunk in RStudio, every venn are create without error.

Is there a limit on the number of venn we can include in a single document? If so, is there a way to remove it?

To Reproduce

  1. Create a Rmarkdown document, I use the latest version of R and RStudio (with Quarto enabled)
  2. Add 3 or more venn diagrams in one or different code chunk
upsetjsVennDiagram() %>%
  fromList(listInput) %>%
  chartVennLabels(title = "Venn diagram of the mixed batches analysis") %>%
  chartFontSizes(set.label = "13px", title = "18px") %>% interactiveChart()
  1. Render the document to the html format.

Expected behavior

The document should normally show all the different venn diagrams. But in my case, only the first two are created

Screenshots
2022-05-23_095125

Context

  • Version: R 4.2 RStudio 2022.02.2+485
  • Browser:

Additional context

@Pierre9344 Pierre9344 added the bug Something isn't working label May 23, 2022
@sgratzl
Copy link
Member

sgratzl commented May 23, 2022

there is not intentional limit. Can you provide a sample rmarkdown file such that I can test the bug, please

@Pierre9344
Copy link
Author

Okay, I first tried to just do the venn in different code chunk but it rendered normally. So I imitated my document and added title upside all the code chunk and I englobed the title and the code chunk with "::: panel-tabset" et ":::" those enable a tabset view in quarto (https://quarto.org/docs/interactive/layout.html#tabset-panel). This time, I got the rendering error.

Here the qmd file and the html document that was rendered from it.

test.zip

@sgratzl
Copy link
Member

sgratzl commented May 23, 2022

thx.

it doesn't seem to be a problem of upsetjs but how the underlying htmlwidgets (https://quarto.org/docs/interactive/widgets/htmlwidgets.html) are implemented for tabset panel. Htmlwidgets have two methods for telling the widget (here upset) what the size is:

  • during the creation of the widget
  • using a "resize" method

However, since the venn2 ... widgets are not visible by default, it will say during the creation that it should have a width and height of 0. Moreover, when I switch tabs it won't be triggering the resize method with the right dimensions. Only if I change the size of my browser window it will trigger a resize.

I would open an issue or vote on ramnathv/htmlwidgets#392 which seems like the underlying problem.

@sgratzl sgratzl self-assigned this May 23, 2022
@Pierre9344
Copy link
Author

Ok thank you.

@sgratzl sgratzl added the invalid This doesn't seem right label May 25, 2022
@sgratzl sgratzl closed this as completed May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants