Shinyproxy: responsive design

Hey guys!

First of all, thank you for the amazing job!

I managed to put an app working on shinyproxy and I remembered to check it out on my mobile phone (since shiny says the apps are totally responsive, and they really are).
The thing is: while using shinyproxy, my app’s design isn’t that responsive (when I was running the app on shiny server open source the responsiveness was better). Can someone explain me why that happens? Why shinyproxy doesn’t give the user the same level of responsiveness a regular shiny app has?

Thanks in advance,
Silvano

1 Like

Shinyproxy homepage (with the banner and app list) does not seem to be responsive.
As you mentioned its a pity as most shiny apps, including shinydashboard are responsive.

Anybody managed to update css of the homepage to get responsive interface ?

Thank you for your answer @longwei

Yeah, if anybody manages to show us how we could update the code so we can get a responsive website, that would be great :smile:

The ShinyProxy landing page can be fully customised! There is an example here: https://github.com/openanalytics/shinyproxy-config-examples/tree/master/04-custom-html-template. It requires a bit of HTML and CSS knowledge to implement your own style, I recommend you look up a ‘product overview html/css template’. You can even use the stylesheet of your company website.

You have to add proxy.template-path and let it point to a folder containing an index.html file (you can see it in that example as well)

Thanks a lot, I will try that.

Hi @michaelhogersnplm,

But that will only change the initial page where I select the app to run, right?

So… Can I say that shinyproxy doesn’t give us an automatically responsive website like shiny server does?

Thanks,
Silvano

Hi @Silvano_Junior,

I am not exactly sure how shiny server works, could you give a screenshot of the shiny server responsive website?

I think ShinyProxy can have a nicer landing page (after logging in) out of the box perhaps, but I do not think it is an issue as you can fully customise it (which I think most would want to do)

Best regards,

Michael

Hi @michaelhogersnplm,

Thank you for your answer. Here you have a shiny app working: https://shiny.rstudio.com/gallery/google-charts.html

And if you open the above link on your mobile phone, everything fits perfectly. But if you create the same app, but deploy it on shinyproxy instead, you’ll see that the automatic responsiveness of the shiny app kind of disappears and you’ll have to zoom in to properly see your app.

Best regards,
Silvano

Hi @Silvano_Junior,

Thanks for the example. Just a quick check, when you open your Shiny app locally (without the ShinyProxy layer/it being deployed with ShinyProxy) and you use for example Chrome’s Developer Tools for a mobile view, does the Shiny app look mobile optimised?

If no, then you would need to change the Shiny app to work better on mobile screens.

If yes, then could you try viewing your app through ShinyProxy using yourwebsite.com/app_direct/yourappname instead of yourwebsite.com/app/yourappname. The app_direct version directly shows your app, whereas the app version shows your app via an iframe inside a web page (similar to the shiny app in your link actually).

Best regards,

Michael

Hi @michaelhogersnplm,

About your first question: yes, if I open it locally and use Chrome’s tools to check for mobile responsiveness, everything looks good.

Thank you very much for your suggestion, it works great on mobile browsers now! :smile:

The only issue is:
My apache2 configuration was:
<Location /register>
RewriteRule ^ /shiny/app/register
ProxyPass http://127.0.0.1:8080/shiny/app/register/
</Location>

And everything was fine, because when I visited mydomain.com/register, I was being redirected to my app. And the url in the browser remains the same (mydomain.com/register)

But now that I changed the apache config to:
<Location /register>
RewriteRule ^ /shiny/app_direct/register
ProxyPass http://127.0.0.1:8080/shiny/app_direct/register/
</Location>

I can see that the mobile version works great, but the url in the browser changes from mydomain.com/register to mydomain.com/shiny/app_direct/register.

Is there a way to keep the url as it was before?

Thank you once again!

Best regards,
Silvano

@Silvano_Junior very happy to hear that! I am not experienced enough with Apache2 to answer that question… Hope you can find a solution

@michaelhogersnplm no problem. Thank you very much for your help. Just a simple change made all the difference and now I don’t need to worry about responsiveness anymore :smile:

I’ll create a new topic and see if anyone can help me with the second part. I tried the whole morning to use mod_rewrite in apache but no luck.

Thanks and have a nice week!

1 Like