2

How can one integrate multiple shiny apps into one shiny website?

I've tried using the navbar example and iframes, however the iframes sometimes have major problems with sizing and scrolling.

Here's the iframe code:

tabPanel("seam",
tags$iframe(src="/01_hello",frameborder=0,align="center",seamless=NA)),

note: seamless is basically not supported by most browsers.

It's also not possible to size the iframes correctly for each app, since the app dimensions change as they're used. I've even tried to use javascript to resize the iframe when needed as in here or here.

Any ideas? I've considered integrating the apps as in the linked navbar example, however they're so different and use such large and separate datasets that it's unlikely to work well. Also using iframes allows separate threads for each application and makes things more manageable.

Here are some examples of failures:

  1. Wrong dimensions: enter image description here

  2. For this one, if I shrink the height I get a double scroll bar, when I don't I get a large empty space. enter image description here

  3. Here's a double scrollbar. enter image description here
Community
  • 1
  • 1
variable
  • 1,013
  • 1
  • 12
  • 29
  • Why not put them into folders in the same directory and source them for different tabs? – Pork Chop Apr 07 '15 at 08:17
  • Hi Pops, does that mean they are all loaded at once or that they are only ever loaded one at a time and if one switches between tabs then old tabs are no longer active / loaded? Also do they use one thread per integrated app and how would one do this? Thanks. – variable Apr 07 '15 at 22:45
  • I think they will be loaded at the same time, but when a client switches between tabs, only those will be active. As R is single threaded, this set-up will be single threaded too. Alternatively, you can use href tags to new page containing apps that would have a lot of computations – Pork Chop Apr 08 '15 at 07:19
  • ok, I see. I could use href tags and have the apps 'look like' the page they just came from. Maybe that's one advantage of iframes. One thread per app. apps only loaded while on the tab etc. – variable Apr 08 '15 at 17:59

0 Answers0