简体   繁体   中英

R HTMLwidgets to generate interactive plot without Shiny R

I have been looking around for a while now and can not seem to find the answer to this question: Can we produce interactive plots (meaning the user provides x and y fields of a dataset to be graphed) without having R running in the users console.

I would prefer something that does not require a server to run it. Just a static html page which lets us interact and plot graphs? Can R HTML widgets do this? (I can not upload the data, but we have a shared dropbox that contains the data). I know shiny R lets other users interact with the graph however to deploy it I need to upload it on cloud or a server which is not what I want.

Please let me know, any help would be appreciated, thank you.

htmlwidgets are typically R wrappers around Javascript libraries.

For example: DT R htmlwidget <=> DataTables JS library.

For your use case (static client-side HTML, no R running, no Shiny), I would just come back to the initial JS libraries and bind them directly with interactive user inputs on my vanilla HTML/JS page client-side.

If you are familiar with client-side JS frameworks (Angular, React, Vue), that would be my favourite stack for effective data binding, including the connection to your model (dropbox). This can however be done in vanilla JS if the app is not too complex.

In summary, I do not think that htmlwidgets are appropriate for your use case. However, binding to the corresponding JS libraries should be the preferred approach here.

You mean like using plotly and ggiraph ? If if you do, than:

Both make interactive graphs. Plotly is more independent from ggplot2 and tidyverse, but it has a function called ggplotly() that turns gg objects into plotly objects (if that's a thing...). Their website for as is this .

The other library, ggiraph , is an extension of ggplot2. It has a different idea. You can check both of them out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM