4

I have to use htmlwidgets related packages(plotly and dygraphs) to generate plots which I can then either: 1. save as .html file and link them through an iframe. 2. use in a shiny app.

I would prefer creating my own UI instead of using Shiny, but:

If I don't use Shiny, every time I regenerate the plot(on some kind of user-interaction), the html file created by plotly/dygraphs (which is more than 1MB) needs to be transferred to the client. This might create a bottleneck.

Thus I would like to know if using Shiny would decrease the amount of data that needsto be transferred to client when re-rendering the plot on user-interaction.

brijs
  • 525
  • 6
  • 18
  • 2
    `"creating my own UI instead of using Shiny"` - if you are saying you would like to use CSS/JS different from the pre-built Bootstrap, shiny allows the flexibility to use any framework or custom UI elements that you need. `"regenerate the plot ... more than 1MB"` - if using the `*Output/render*` methods from an htmlwidget, the dependencies are not transferred on each render, so the size of the transfer should be the size of the data. If data is expected to be big, then you could implement a `proxy` like `leaflet` or `visNetwork`. – timelyportfolio Jul 02 '16 at 12:37
  • Can I use Bootstrap and other such libraries/frameworks with shiny? – brijs Jul 02 '16 at 21:50
  • 1
    yes, definitely, Bootstrap is built-in http://shiny.rstudio.com/reference/shiny/latest/bootstrapPage.html making it the easiest framework to use, but using other css/js frameworks are fairly easy to plug in also. – timelyportfolio Jul 03 '16 at 11:51

1 Answers1

3

If you are looking to create you're own UI, but still want R on the 'back-end', you should have a look at the openCPU project, which always you to define REST APIs backed by R functions that can be called from any web framework.

Joris Gillis
  • 136
  • 4