view_dynamic: use separate function for generating Shiny app