[R-SIG-Mac] Rserve and plotly
Stavros Panidis
@t@vro@@p@n|d|@ @end|ng |rom gm@||@com
Fri Feb 18 13:15:52 CET 2022
Dear Simon,
Very clear and instructive help, thank you very much!
Stavros
> On 18 Feb 2022, at 1:03 PM, r-sig-mac-request using r-project.org wrote:
>
> Send R-SIG-Mac mailing list submissions to
> r-sig-mac using r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> or, via email, send a message with subject or body 'help' to
> r-sig-mac-request using r-project.org
>
> You can reach the person managing the list at
> r-sig-mac-owner using r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-SIG-Mac digest..."
>
>
> Today's Topics:
>
> 1. Rserve and plotly (Stavros Panidis)
> 2. Re: Rserve and plotly (Simon Urbanek)
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 17 Feb 2022 20:17:40 +0200
> From: Stavros Panidis <stavros.panidis using gmail.com>
> To: r-sig-mac using r-project.org
> Subject: [R-SIG-Mac] Rserve and plotly
> Message-ID: <7D0D3D57-2DE7-4AEB-A14D-4EDC27D371E3 using gmail.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Dear,
>
> I develop a web app where the user can issue a R command and see output in html page. Most of R examples work without any problem.
>
> When I try plotly commands, in development machine (MacBook Pro) everything goes fine and generated chart opens in new tab.
>
> The same command has no effect in server (ubuntu 20.04). Both server and development machine run the same version of R (4.1.2) and Rserve (1.8.10)
>
> Any advice on how to overcome this?
>
> Many thanks in advance
>
> Stavros
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 18 Feb 2022 12:39:42 +1300
> From: Simon Urbanek <simon.urbanek using R-project.org>
> To: Stavros Panidis <stavros.panidis using gmail.com>
> Cc: r-sig-mac using r-project.org
> Subject: Re: [R-SIG-Mac] Rserve and plotly
> Message-ID: <7B9DAB56-C29D-4FF7-BCAD-7E2E5347392A using R-project.org>
> Content-Type: text/plain; charset="us-ascii"
>
> Stavros,
>
> htmlwidgets-based code essentially generates html code. In an interactive/local session such code is written into a file and that file is opened by user's browser to display. On a server that obviously doesn't make sense since the user is not on the server, so you have to decide how you want to make the resulting html pages available to the user. Normally, on a server one would use a web-based environment such as RCloud (based on Rserve) which automatically integrates htmlwidgets into the web output. Since you are creating a web-app a natural way is to do something similar.
>
> Probably the easiest way to get started is to call saveWidget() to obtain a fully self-contained html file and serve it to the user. For more complex examples where you have multiple plots and need to take care of integration, serving of JavaScript dependencies etc. - you can have a look at https://github.com/att/rcloud.htmlwidgets for an example how this can be handled since you may need to merge and or/inject the different pieces.
>
> Cheers,
> Simon
>
>
>
>> On Feb 18, 2022, at 7:17 AM, Stavros Panidis <stavros.panidis using gmail.com> wrote:
>>
>> Dear,
>>
>> I develop a web app where the user can issue a R command and see output in html page. Most of R examples work without any problem.
>>
>> When I try plotly commands, in development machine (MacBook Pro) everything goes fine and generated chart opens in new tab.
>>
>> The same command has no effect in server (ubuntu 20.04). Both server and development machine run the same version of R (4.1.2) and Rserve (1.8.10)
>>
>> Any advice on how to overcome this?
>>
>> Many thanks in advance
>>
>> Stavros
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
> ------------------------------
>
> End of R-SIG-Mac Digest, Vol 227, Issue 13
> ******************************************
More information about the R-SIG-Mac
mailing list