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

Render r2d3 output in rmarkdown document with rmarkdown::knitr() function #102

Open
uriahf opened this issue Sep 19, 2023 · 0 comments
Open

Comments

@uriahf
Copy link

uriahf commented Sep 19, 2023

Hi everyone.

I want to create a parameterized document with r2d3 document.

Problem is that when I use the rmarkdown::knitr() function the output does not render well, while when I do the same while using the knitr button in the rstudio gui everything works well.

Here is the reprex:

Ymal

---
title: "d3_example"
output: html_document
date: "2023-09-19"
---

R code

library(r2d3)
bars <- c(10, 20, 30)

d3 code

svg.selectAll('rect')
  .data(data)
  .enter()
    .append('rect')
      .attr('width', function(d) { return d * 10; })
      .attr('height', '20px')
      .attr('y', function(d, i) { return i * 22; })
      .attr('fill', options.color);
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