rstudio / r2d3

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

Quick questions about width and height #88

Open verasiwei opened 3 years ago

verasiwei commented 3 years ago

Good afternoon!

I am new to r2d3. I found sometimes it is difficult to view directly through rmarkdown d3 chunk or through r2d3 function. Are there any quick ways that I don't need to worry about height and weight, and make the interactive plot in the appropriate position in html? Thanks!

Best, Siwei

jlfsjunior commented 3 years ago

I haven't used r2d3 in a while, but as far as I remember the chart container is resized automatically (see Sizing on this vignette).

Your problem might be related to the d3 Rmd chunk (I am not familiar with it) or you might be hard-coding the sizes in js instead of using width and height provided by r2d3.

It'd be helpful if you could provide a short reprex.