1

I'm trying to use GoogleVis with the new package FlexDashboard, which is like the intersection between a basic .Rd and shinyDashboards. It's basically a non-shiny dashboard.

Anyway, I'm trying to embed a googleVis object, which doesn't seem to be supported by default, but I can get the html to show up in the output, so there must be a way! Can we come up with some hack? Maybe combining either plot() or renderGvis() combined with some kind of hack? Ormessing with setting op <- options(gvis.plot.tag='chart')?

I have failed, but maybe someone else can figure it out?

Community
  • 1
  • 1
Amit Kohli
  • 2,860
  • 2
  • 24
  • 44

1 Answers1

3

Building on the awesome answer from Michal Majka at Conditional reactive logic shiny based flexdashboard you can do something like this

---
title: "Test gvisTable"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows

runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)
library(googleVis)

```

Column {data-height=350}
-----------------------------------------------------------------------

### Chart c

```{r}
#create a ui interaction:
uiOutput("dynamic")

#render the ui:
output$dynamic <- renderUI({ 
   htmlOutput("myTable")
})

#here is your server activity:
output$myTable <- renderGvis({    
    gvisTable(Population )       
  })
```
Community
  • 1
  • 1
Jim Crozier
  • 1,378
  • 2
  • 16
  • 28
  • I give u a +1 for the effort, but if I wanted shiny then I'd just go w/ shinydashboard. Nice hack tho.. – Amit Kohli Feb 11 '17 at 14:38
  • 1
    Fair enough, I guess, but I would point out that you specifically asked for "some kind of hack" (that is, if defining a runtime is even a hack), and secondly shinydashboard is not a mark down format so combining two useful packages into one solution is not the same as just using one. – Jim Crozier Feb 14 '17 at 16:39