为什么我的情节不使用RmarkDown和FlexDashboard出现在闪亮的应用程序上?

发布于 2025-02-04 07:27:55 字数 1005 浏览 3 评论 0 原文

当我第一次运行我的应用程序(通过rstudio本地或在shinyapps.io上托管)时,大多数情况下,绘图都很好,但是当我重新加载页面或调整窗口大小时就消失了。有时候,绘图甚至没有开始出现,我必须多次重新运行该应用程序才能使它们出现。 我的联合DEV在他的计算机上尝试了同样的事情,结果也不一致。

我尝试过的事情:

  • 使用绘图而不是ggplot2。
  • 将情节大小限制为300x300 OU 10x10 PX,以检查是否不是性能问题,因为PNGS的大小闪亮渲染作为图。
  • 使用rmarkDown :: render_delayed如此闪亮,不必一次加载所有图。 那些没有区别。

有人可以阐明这个问题吗?还有其他人在FlexDashboard上的地块有问题吗?

您可以在 请尝试多次加载,以查看图是否无法显示。 我有一个更完整的版本,它不使用FlexDashboards,而且工作正常(但布局是一团糟): https://nathalia-hohl.shinyapps.io/ecologia-interativa/

使用的包装版本:

  • rv。4.2.0rstudiov。2022.02.1rmarkDownv。2.14v。2.14v。2.14
  • 正在
  • Shinyv。1.7.1FlexDashboardsv。0.5.5

When I first run my app (locally through RStudio or hosted on shinyapps.io), most of the times the plots show just fine, but disappear when I reload the page or resize the window. There are also times when the plots don’t even show on start and I have to rerun the app multiple times to make them appear.
My co-dev tried the same on his computer, with similarly inconsistent results.

Things I’ve tried:

  • Using plotly instead of ggplot2.
  • Limiting plot size to, say, 300x300 ou 10x10 px to check if it’s not a performance problem due to the size of the PNGs shiny renders as plots.
  • Using rmarkdown::render_delayed so shiny wouldn’t have to load all plots at once.
    Those made no difference.

Could someone shed a light on the issue? Does anyone else have problems with plots on flexdashboard?

You can check a minimum example of the problem on https://ecology-app-test.shinyapps.io/minimum_example/ and the code on https://github.com/NHohl/ShinyEcology/blob/master/Minimum_Example.Rmd
Please try to load multiple times to see if/when the plots fail to show.
I have a more complete version that doesn’t use flexdashboards and works just fine (but the layout is a mess): https://nathalia--hohl.shinyapps.io/ecologia-interativa/

The package versions I’m using:

  • R v. 4.2.0
  • Rstudio v. 2022.02.1
  • rmarkdown v. 2.14
  • shiny v. 1.7.1
  • flexdashboards v. 0.5.2
  • ggplot2 v. 3.3.6
  • plotly v. 4.10.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文