0

How can one go about using googleVis charts with gWidgetsWWW2? I have seen that it is possible to use googleVis with Rook (http://www.magesblog.com/2012/08/rook-rocks-example-with-googlevis.html and https://cran.r-project.org/web/packages/googleVis/vignettes/googleVis.pdf) but I have not found any example of using googleVis with gWidgetsWWW2. My initial try:

require(gWidgetsWWW2)
require(googleVis)
w <- gwindow("hello")
sb <- gstatusbar("Powered by gWidgetsWWW and Rook", cont=w)
g <- ggroup(cont=w, horizontal=FALSE)
M <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Year")
ghtml(M$html, cont = g) # Trying html only

I end up seeing the following when I gwidgetsWWW2::load_app():

enter image description here

I've tried decomposing the html into its header, chart and footer also but this didn't work either:

 # ghtml(M$html$header, cont = g) # Trying header only
 # ghtml(M$html$chart, cont = g) # Trying chart
 # ghtml(M$html$footer, cont = g) # Trying footer only

Any suggestions are greatly appreciated. Also, if there isn't a gWidget that will directly allow the use of googleVis charts, is it possible to integrate Rook code (e.g. the code given at http://www.magesblog.com/2012/08/rook-rocks-example-with-googlevis.html) with the gWidgetWWW2 code? If so, how can I go about doing this?

Thank you very much.

jav
  • 1,485
  • 8
  • 11
  • 1
    This is a good question, and unfortunately I don't have a good answer. I tried decomposing the results, passing some javascript through some internal functions (`add_js_queue`) and still no luck. I got closest to rendering this by writing the output to a file then using `ghtml` to load the file from a url. I even tried wrapping in an iframe. But sadly this didn't work either. If you persist and figure something out, it would be a nice addition. – jverzani Nov 08 '16 at 17:14
  • @jverzani, thanks for looking into this. If I do figure it out, I will let you know. Thank you (and thanks for an excellent set of gWidgets packages). – jav Nov 09 '16 at 03:08

0 Answers0