当我第一次运行我的应用程序(通过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
发布评论