rstudio / shiny-server

Host Shiny applications over the web.
https://rstudio.com/shiny/server
Other
716 stars 289 forks source link

Shiny server setting to accept URL parameters for initial values of UI elements #516

Open geotheory opened 2 years ago

geotheory commented 2 years ago

I wonder if there is any appetite for enabling a Shiny server setting for UI elements to prioritise initial values from URL parameters if present. For example:

./shiny/sample-apps/rmd/?region=Europe

This would enable more seemless iframe integration of apps within websites, and negate need for a lot of URL hash string parsing.

llrs commented 2 years ago

I think this is already possible via the bookmark option in shiny: https://shiny.rstudio.com/articles/bookmarking-state.html

geotheory commented 2 years ago

This is good and I wasn't aware of it so thank you. It is still a problem for me because unless I'm mistaken it works only with ULR params (?_inputs_&n=200) rather than hash strings (#_inputs_&n=200). This is an issue for me because - as I've recently discovered - variables in a URL hash string will when changed automatically update in an iframe-embedded Shiny app whereas URL params do not.