Get the size of the window in Shiny

前端 未结 2 420
难免孤独
难免孤独 2020-12-03 03:10

I Would like to determine the size of the browser window in Shiny to help me layout my plot divs better. Specifically I would like to determine the aspect ratio of the wind

2条回答
  •  一个人的身影
    2020-12-03 03:39

    Shorter version for getting window dimensions in shiny with JS from package htmlwidgets:

    window_height <- JS('window.innerHeight')
    window_width <- JS('window.innerWidth')
    

提交回复
热议问题