This shiny app demonstrates how to read and use the browser dimensions in the Shiny server. This example is a demonstration on setting up Shiny and JavaScript communication rather than using window height or width for modifying the client (as this should be used on the JS not shiny).
You can find more information about this application in the blog post get window dimensions.
You can run this app locally using the following methods: running within your R environment or cloning this subdirectory.
You can run this app within your R environment using the runGithub
function. Enter the following command in the console.
shiny::runGitHub(username = "davidruvolo51", repo = "shinyAppTutorials", subdir = "get-window-dims")
You can clone the data editor subdirectory using git sparse-checkout
.
git clone --filter=blob:none --sparse https://github.com/davidruvolo51/shinyAppTutorials
cd shinyAppTutorials
git sparse-checkout init --cone
git sparse-checkout set get-window-dims
Then you can run the shiny app in your preferred R environment.