Best package for interactive graphs in Shiny

There are a number of packages that we can use to make interactive plots in Shiny. Personally I use a lot of plotly (by that I mean their original syntax, not ggploty() which is nice but not sufficient), RStudio seems to favour dygraphs (at least for time series) and I've seen people use both highcharts and anycharts.

What is interactive? By a broad definition, ggplot and ggvis can be considered to be interactive when incorporated into an interactive shiny app. However, when I say interactive I mainly refer to the ability of hoover-functions.

I like plotly, it has a syntax that takes advantage of the magrittr package and it is easily linked to basic dplyr-functions. It does have a tidyverse-feel to it. However, it is obvious that plotly is not built for Shiny and therefore can be a little bit laborious. Furthermore I am not fully satisifed in how plotly-plots behave in Shiny apps.

What are your experiences with these packages? Is there anyone who has delved deeper into this, running performance tests on these packages when incorporated in Shiny apps?

This topic mainly refers to basic plots such as time series, scatter plots, bar plots and so on. For maps, use this topic.

I haven't done any performance tests, I'd love to see what results of such a test look like. I like highcharts, which is easily accessed through the highcharter package. However one potential constraint of using highcharts is that the products in the highcharts library are free for non-commercial use only.

2 Likes

You might find this thread useful

1 Like

I am currently working on a Shiny application that has a customizable interactive graph, and I have chosen to use ggvis due to the speed at which it can re-make the graph. A user can make make a change to the graph, and see the result almost instantly. It also helps that is integrates so well with dplyr.

Interesting. I really like ggvis. However, the lack of hoovering is a problem for me. Not that the hoovering itself necessarily improves the analysis but as soon as I see a graph online I want to be able to see what's in it.

I use ggiraph a lot. I prefer it over plotly because it keeps the ggplot look and feel, and I prefer it over ggvis because the language is just an extension of ggplot. The probable downside (I never tested it) is that it's probably slower to run than ggvis or plotly.

I'd happily move to ggvis if it ever ends up being a finished product - I'm leery of using it while there's a chance it will go through extensive changes down the road.

1 Like

ggvis actually supports mouse hovering. Check out the add_toolip function.

1 Like

When researching this topic I found that plotly has by far the most entries on stackoverflow, which for me is a clincher.

r plotly = 27967 results
r bokeh = 162 results
r highcharter = 201 results
r ggvis = 922 results
r vega = 77 results
r rCharts = 913 results

Could you elaborate on what you find frustrating? There is now a lot more documentation on how to effectively leverage plotly in shiny 17 Server-side linking with shiny | Interactive web-based data visualization with R, plotly, and shiny