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

HtmlWidgets why is a timeout needed (what is the correct timeout) in static reports? #446

Open
slodge opened this issue Nov 1, 2022 · 0 comments

Comments

@slodge
Copy link

slodge commented Nov 1, 2022

We've got some issues at present with HtmlWidgets sometimes not showing in RMarkdown reports when using a custom RMarkdown renderer.

Apologies for not supplying a reproducible sample at present - but we're finding reproducibility is fairly tricky! There seems to be something "timing" related as to why some HtmlWidgets get shown and some don't, and the same rendered Html files will sometimes work and sometimes (rarely) fail.

This seems to be something to do with maybeStaticRenderLater and we've found one workaround which helps with this - this is based on some code we found in the FlexDashboard repo - they trigger a "shown" event on a timeout - flexdashboard/flexdashboard.js at b3cb4a396bdfd2fc63a0f000e501fd53fe0122b8 · rstudio/flexdashboard · GitHub

Is a timeout and "shown" event the correct way to go here? Does anyone have any suggestions/ideas about what else should be done here? Is there a DOM, HTMLWidgets, DT or RMarkdown event we can listen for instead of using a timeout? Is there some dependency ordering we should enforce within the rendered HTML? Or any other ideas at all really?

Thanks for any suggestions

Originally asked in: https://community.rstudio.com/t/htmlwidgets-including-dt-how-do-they-render-in-static-rmarkdown-reports/149139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant