Is there a way to use Shiny in an existing web application?

127 views
Skip to first unread message

Edward Stembler

unread,
Sep 24, 2014, 1:51:42 PM9/24/14
to shiny-...@googlegroups.com
Hi,

I'm new to Shiny.  Does anyone know if there's a way to use Shiny in an existing web application?

For example, I have a Ruby on Rails web application which already has rudimentary R script support via Rserve.  I'll like to enable Shiny from inside of my web application.

I noticed that if you run a shinyUI function from one of the ui.R examples, it outputs html.  I'm hoping there's a index.html page somewhere with all of the javascript references and events wired up, so that I can plop it into my Rails app.  I don't want to spin up an instance of shiny-server since my web server is running on Windows, and I heard shiny-server only runs on Linux.

Worst case scenario, I can probably serve up the html returned from shinyUI, wire up onchange event listeners, then send the input values to Rserve via an AJAX call.  I don't really want to have to do that though.  A more plug-in-play solution would be best.

Edward Stembler

unread,
Sep 24, 2014, 9:55:32 PM9/24/14
to shiny-...@googlegroups.com
Well, I extracted the sources for 01_hello and discovered it expects to talk to a websocket.  I could spoof or recreate the websocket, but it's probably too much work.  My guess is that the websocket implementation (node module faye-websocket) makes the call to R and somewhere along the line the output (png?) is generated and then returned as a base64 string. Again, too much work to re-create.  It's too bad they cannot get this to work on Windows.
Reply all
Reply to author
Forward
0 new messages