Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch plots from ggplot to ggvis? #39

Open
Coorsaa opened this issue Nov 22, 2016 · 13 comments
Open

switch plots from ggplot to ggvis? #39

Coorsaa opened this issue Nov 22, 2016 · 13 comments

Comments

@Coorsaa
Copy link
Owner

Coorsaa commented Nov 22, 2016

ggvis has a similar structure to ggplot but produces interactive plots.

@jakob-r
Copy link
Contributor

jakob-r commented Nov 22, 2016

What are the advantages over using plotly? For plotly you just have to change plotOutput to plotlyOutput and renderPlot to renderPlotly. It works flawless if renderPlot returns a ggplot.

Where would you want to have interactive plots the most?

@Coorsaa
Copy link
Owner Author

Coorsaa commented Nov 22, 2016

Thanks @jakob-r , I was hoping for that kind of input. After briefly looking into plotly, it seems that it would work pretty well for us. I was thinking of starting with it for the data summary plots with possible extensions for the prediction and benchmark plots.
What do u think @florianfendt ?

@larskotthoff
Copy link

AFAIK plotly plots can't be embedded as nicely (i.e. they're hosted on plotly's website). This may be something to consider.

@SteveBronder
Copy link

What about Highcharter?

Haven't used ggvis in a while, but I remember it's development was slowed due to vega missing some pieces. That was a year ago so it may be much better now.

@Coorsaa
Copy link
Owner Author

Coorsaa commented Nov 22, 2016

So Highcharter doesn't have plotly's embedding disadvantage? It seems to be very flexible and it has a broad variety of different plot types.

@SteveBronder
Copy link

I'm a big fan of highcharts! Though I've never used this particular package, I do not see why you would have to embed it like you do with plotly. It should output the html needed to integrate with shiny. I believe it's backend is partly based on htmlwidgets which is supposed to integrate with shiny very well.

@Coorsaa
Copy link
Owner Author

Coorsaa commented Nov 22, 2016

ok sounds great! Thanks for your support and ideas!

@larskotthoff
Copy link

Hmm, from the htmlwidgets page that you link to it looks like you can actually embed plotly plots (they do it there). The big advantage of plotly is that you can export and save the plots.

@jakobbossek
Copy link

@larskotthoff Right, you can export and save. However, exporting to PDF format is only possible if you pay money. E.g.,
https://plot.ly/~chris/1638/ (interactive version)
https://plot.ly/~chris/1638.png (possible)
https://plot.ly/~chris/1638.pdf (payment required ...)

@larskotthoff
Copy link

Ok, but at least it gives you that option. Is there an easy way in shiny to make plots available as downloadable PDFs?

@jakob-r
Copy link
Contributor

jakob-r commented Nov 23, 2016

AFAIK plotly plots can't be embedded as nicely (i.e. they're hosted on plotly's website). This may be something to consider.

No. Plotly works totally fine offline. It just relies on JavaScript. You can publish but this is just an additional feature. Try the examples here. It uses htmlwidgets as well as highcharts and so on.

Is there an easy way in shiny to make plots available as downloadable PDFs?

Just a quick search result: http://shiny.rstudio.com/gallery/download-knitr-reports.html
This obviously would not work directly with things that use htmlwidgets.

@florianfendt
Copy link
Contributor

@Coorsaa
plotly really looks great but if we can't export pdfs easily
I'd vote for staying with ggplot for now and at least make pdf download available soon.
If we have time later we can try make the plots interactive.
What do you reckon?

@jakob-r
Copy link
Contributor

jakob-r commented Nov 23, 2016

I worked on this today a bit and if you go with the approach in the link I provided it is easy to do ggplot and plotly together. The major disadvantage is that you need a separate Rmd file that serves as a template like for a report to generate a pdf. You can also extract the intermediate markdown files of the pdf generation and offer a zip download of the single plots.

This leads me to think that with some cleverness you call ggsave on all ggplot objects and than download them.

@florianfendt florianfendt added this to the UseR milestone Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants