rstudio / flexdashboard

Easy interactive dashboards for R
https://pkgs.rstudio.com/flexdashboard/
Other
816 stars 301 forks source link

Unable to render a gvis object #26

Closed snakonechny closed 8 years ago

snakonechny commented 8 years ago

Hello,

Thank you much for putting together this great package! I'm having some issues with rendering gvis objects in flexdashbaord. Here's a minimal example:


title: "Sample" output: flexdashboard::flex_dashboard: orientation: columns

vertical_layout: fill

library(flexdashboard)
library(googleVis)
library(dplyr)

df <- iris %>% group_by(Species) %>% mutate(meanSLength = mean(Sepal.Length))

Column {data-width=650}

Sample column chart in googleVis

renderGvis(

  gvisBarChart(df, "Species", "meanSLength")

)

Above renderGvis I do specify results='asis', message=FALSE, echo=FALSE. Still, I get the following back:

screen shot 2016-05-21 at 10 46 16 pm

This happens in both the RStudio preview window and the browser.

Any help would be much appreciated!

Thanks!

jjallaire commented 8 years ago

Yes, googleVIs objects aren't htmlwidgets (http://www.htmlwidgets.org) which is the standard protocol for JavaScript visualizations within R, and what we built flexdashboard to interoperate with so I don't think this will work.

J.J.

On Sat, May 21, 2016 at 10:48 PM, Svyat Nakonechny <notifications@github.com

wrote:

Hello,

Thank you much for putting together this great package! I'm having some issues with rendering gvis objects in flexdashbaord. Here's a minimal

example:

title: "Sample" output: flexdashboard::flex_dashboard: orientation: columns vertical_layout: fill

library(flexdashboard) library(googleVis) library(dplyr) df <- iris %>% group_by(Species) %>% mutate(meanSLength = mean(Sepal.Length))

Column {data-width=650} Sample column chart in googleVis

renderGvis(

gvisBarChart(df, "Species", "meanSLength")

)

Above renderGvis I do specify results='asis', message=FALSE, echo=FALSE. Still, I get the following back:

[image: screen shot 2016-05-21 at 10 46 16 pm] https://cloud.githubusercontent.com/assets/8390111/15451853/ebd98a9e-1fa5-11e6-925c-2c98decc398a.png

This happens in both the RStudio preview window and the browser.

Any help would be much appreciated!

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/rstudio/flexdashboard/issues/26

snakonechny commented 8 years ago

@jjallaire , Thanks for a quick response! I tried testing rCharts in flexdashbaord and received a similar error message. I take it these interactive visualizations also aren't supported?

jjallaire commented 8 years ago

No, we just support htmlwidgets

On Sun, May 22, 2016 at 10:54 AM, Svyat Nakonechny <notifications@github.com

wrote:

@jjallaire https://github.com/jjallaire , Thanks for a quick response! I tried testing rCharts in flexdashbaord and received a similar error message. I take it these interactive visualizations also aren't supported?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/rstudio/flexdashboard/issues/26#issuecomment-220836619

paulditterline commented 8 years ago

@snakonechny, using the ggplotly() wrapper from the plotly package on ggplot objects does allow for interactivity in flexdashboard. See: https://paulditterline.shinyapps.io/Louisville_Salaries/

snakonechny commented 8 years ago

@paulditterline , thanks for the pointer!