rstudio / r2d3

R Interface to D3 Visualizations
https://rstudio.github.io/r2d3
Other
518 stars 103 forks source link

r2d3.onRender doesn't seem to work #67

Closed cmtso closed 5 years ago

cmtso commented 5 years ago

I have been trying out the r2d3 examples. But it seems any examples that have the r2d3.onRender is the .js file does not show any colour above the base layer.

For example, in the calendar example, all I get is the calendar but no colour. Please provide some pointers. Thanks!

cmtso commented 5 years ago

UDPATE:

I think the issue is with reading in the data using r2d3(data=...). Basically, I can run all the examples that do not require reading data from R perfectly. But for the ones requiring data from R, the data does not show up.

I am running it on Windows in Rstudio 1.2 and using servr package as the browser. Please help. Thanks.

javierluraschi commented 5 years ago

The bubbles examples makes use of onRender() but happens to work just fine for me using Windows 10, does the code bellow work for you? Could you share the exact error?

download.file("https://raw.githubusercontent.com/rstudio/r2d3/master/vignettes/gallery/bubbles/bubbles.js", "bubbles.js")

r2d3::r2d3("bubbles.js", data = read.csv("https://raw.githubusercontent.com/rstudio/r2d3/master/vignettes/gallery/bubbles/flare.csv"), d3_version = 4)
Screen Shot 2019-07-02 at 4 17 53 PM Screen Shot 2019-07-02 at 4 19 51 PM
cmtso commented 5 years ago

Great. I get it done now. Thanks!