HTML-based UI in multiple files

1,532 views
Skip to first unread message

Anton Rau

unread,
Mar 7, 2013, 11:14:42 AM3/7/13
to shiny-...@googlegroups.com
Hi,

I am trying to create a multipage Shiny web application. I would like to split functionality across several "server.R" files, which have specific html UI templates, but share the data objects.

 Am I right that Shiny can process only a single "index.html" file in "www" folder? Does it mean that I have to create a separate Shiny app for each individual task in separate folder? What about sharing data across several server.R files then?

Thank you.

Joe Cheng

unread,
Mar 7, 2013, 1:16:23 PM3/7/13
to shiny-...@googlegroups.com
Hi Anton,

Each R process can only run a single Shiny app. Each Shiny app is only designed to run a single page. (Although some people e.g. Vincent Nijs have experimented with multiple HTML files with a single server.R)

One solution is to try to redesign your app to be a single page that switches through different "modes" (you could use tabsetPanel or get fancier with JavaScript, and some other people here like Vincent have implemented navbars).

We might be able to provide more feedback if you could disclose a little of what these different pages will do and how they relate to each other.

-joe

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Anthony

unread,
Apr 30, 2013, 2:32:48 PM4/30/13
to shiny-...@googlegroups.com

Hi,

I am not sure if Joe's answer applies to my app too...

I am trying to create a multi-page web app in shiny using a single server.R file and multiple html.ui files. Is this possible?

This is an example of what I have presently – http://glimmer.rstudio.com/wade2013/test2/

 I am trying to make each page have different functionalities but nothing is being passed to my second.html page.

How should I proceed?

 

Thanks,

Joe Cheng

unread,
May 1, 2013, 12:17:59 AM5/1/13
to shiny-...@googlegroups.com
Yes, my previous answer applies to your app too. Multi-page web apps are not a support feature in Shiny today, sorry.


--

Anthony

unread,
May 1, 2013, 11:41:10 PM5/1/13
to shiny-...@googlegroups.com
Okay. Thanks

Jin Rou New

unread,
May 2, 2013, 6:22:20 AM5/2/13
to shiny-...@googlegroups.com
Hi Joe,

Will multi-page web apps be supported in future/is it in the works though? I imagine it'll be really useful!

Thanks!

Joe Cheng

unread,
May 2, 2013, 2:12:05 PM5/2/13
to shiny-...@googlegroups.com
It's certainly possible for the future, though we are not currently working on it.

Brendan

unread,
May 10, 2013, 5:36:40 AM5/10/13
to shiny-...@googlegroups.com
Just wanted to add to the clamour that multi-page functionality be extremely useful!

Pedro Abreu

unread,
Nov 29, 2013, 9:40:48 AM11/29/13
to shiny-...@googlegroups.com
Hi,

i made the follow way:

ui.R

shinyUI(pageWithSidebar(...),path="/ui1")

shinyUI(pageWithSidebar(...),path="/ui2")

server.R

all output requested by the two pages


if you put in browser()
http://localhost:..../ui1 give the first shinyUI
http://localhost:..../ui2 give the second shinyUI

ZJ

unread,
Nov 29, 2013, 10:10:18 AM11/29/13
to shiny-...@googlegroups.com
That's a really cool solution. I was hoping to move towards more single page apps (SPA) via say angularjs since it's getting alot of buzz recently. Wonder if it's possible with Shiny. I might try it out some time.

Tomas Leon

unread,
Apr 7, 2014, 11:03:38 AM4/7/14
to shiny-...@googlegroups.com
Hello Pedro Abreu, 
im triying your way and is very usefull, however i have a question:

how do yo start without error the shiny app?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages