shinyproxy-rstudio-ide-demo icon indicating copy to clipboard operation
shinyproxy-rstudio-ide-demo copied to clipboard

Have some difficulties to access to the shiny app launched in rstudio on shinyproxy ?

Open mos790 opened this issue 3 years ago • 3 comments

Hi,

I'm using the latest rstudio version with shinyproxy, basic script and packages installation seems to work. When I start a shiny app with terminal Rscript app.R I get nonfunctional URL

Listening on http://127.0.0.1:5491

I also tried to configure the port and host directly in shiny app

options(shiny.host = '0.0.0.0'); options(shiny.port = 8888)

Have you some advice about for a working configuration ?

Thanks

mos790 avatar Jun 01 '22 09:06 mos790

Not really an advice, but a question - why do you start the app from the terminal and not from the console?.. the latter should work fine. And the former would similarly not work (I believe) also in a 'usual' rstudio server... If you could share a bit more about your process and what you are trying to achieve, this might help to find a solution.

mnazarov avatar Jun 01 '22 10:06 mnazarov

Thanks for the reply. You are right about the fact I can use directly the console for shiny apps.

My problem is about dash apps, I wanted to execute it from terminal ... Seems not to work in the console ...

It seems to be more about the port / host config ?

import dash
import dash_core_components as dcc
import dash_html_components as html
 
app = dash.Dash()
 
app.layout = html.Div(children=[
html.Div(children='Hi'),
dcc.Graph(
id='graphss',
figure={
'data': [
{'x':[1,2,3,4,5,6,7], 'y':[11,12,22,23,24,44,55], 'type':'line', 'name':'Energy'},
{'x':[1,2,3,4,5,6,7], 'y':[13,15,26,27,34,44,65], 'type':'bar', 'name':'Time'},
],
'layout': {
'title': 'Graph for Time and Energy'
}
}
)
])
 
if __name__ == '__main__':
    app.run_server(debug=False)

image

mos790 avatar Jun 01 '22 13:06 mos790

Hi

I'm afraid that if RStudio has no native support to host dash apps, this will not work in ShinyProxy currently. We could introduce a feature to also proxy traffic to a different port, therefore I will keep this open as a feature request.

BTW, it seems that jupyter notebooks may have good integration for dash apps see https://github.com/openanalytics/shinyproxy/issues/359 and https://github.com/plotly/jupyter-dash

LEDfan avatar Aug 08 '22 14:08 LEDfan