Dynamic resizing of ggvis plots in shiny apps

故事扮演 提交于 2019-12-03 07:48:55

问题


When adding a ggvis plot to a shiny app, the width and height of the plot are fixed and don't automatically adjust to the size of the div the ggvis object is placed in. This obviously causes some problems when app users have different screen sizes for instance, or adjust the size of the app window.

It's possible to modify the size of the ggvis object on the server side using set_options, but this doesn't really help since I don't think there is a way to pass the size of the div to the server side.

I've tried modifying the css of the different classes associated with the ggvis object on the ui side (e.g. ggvis-output, ggvis-output-container, etc.) but this doesn't help either. The ggvisOutput function seems to override the css length and width no matter what.

Has anybody found a solution/workaround to dynamically resize a ggvis plot as function of the size of the surrounding div?

Thanks for your help.


回答1:


This is now possible in the development version of ggvis. See https://github.com/rstudio/ggvis/pull/381



来源:https://stackoverflow.com/questions/27693277/dynamic-resizing-of-ggvis-plots-in-shiny-apps

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!