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

Calling an external file using an Rmd D3 chunk creates blank space or does nothing #42

Open
ronblum opened this issue Jul 23, 2018 · 0 comments

Comments

@ronblum
Copy link

ronblum commented Jul 23, 2018

System details

r2d3 Version : 0.2.2
R Version    : 3.5.1

Steps to reproduce the problem

Use an R Markdown file to execute the sample bubbles D3 example from the gallery at https://github.com/rstudio/r2d3/tree/master/vignettes/gallery/bubbles

  1. Create the flare.csv file, same as in the example.
  2. Create a d3 chunk in an R Markdown file in RStudio that executes bubbles.js:
```{r setup, include=FALSE}
library(r2d3)
knitr::opts_chunk$set(echo=FALSE, comment=NA)
```

```{d3 data = read.csv("flare.csv"), d3_version = 4, script = "bubbles.js"}

```
  1. Run all the chunks.
  2. Knit the file.

Describe the problem in detail

The following error occurs:

  1. When running the chunks, nothing happens.
  2. When knitting the file, a bunch of blank space is displayed. Resizing the display window or including something after the d3 chunk, such as an r chunk with plot(cars), will make this clear.

Describe the behavior you expected

The D3 portion should be displayed correctly. Compare this to the independent D3 JavaScript file:

  1. Save a copy of the bubbles.js file in the same directory as the flares.csv file.
  2. In RStudio: File -> Open File -> bubbles.js
  3. Preview

The D3 file is rendered correctly, including the bubbles image.

Note: If calling a file is not supported, then this should error out instead of displaying blank region or nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant