yonicd / slickR

slick carousel htmlwidget for R
https://yonicd.github.io/slickR/
Other
159 stars 14 forks source link

carousel not working in rmarkdown #2

Closed yonicd closed 7 years ago

yonicd commented 7 years ago

when used in rmarkdown html_document the carousel div is ignored and pushed to the bottom of the rendered document. here is the raw rmd file

---
output: 
  html_document:
    self_contained: false
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(slickR)
library(ggplot2)
library(dplyr)
fig.dir=file.path(getwd(),'testSlickR_files/figure-html')

Section

Subsection 1

iris%>%ggplot(aes(x=Sepal.Length,y=Sepal.Width))+geom_point()
iris%>%ggplot(aes(x=Sepal.Length,y=Sepal.Width))+geom_line()

slickR(list.files(fig.dir,pattern = 'PLOT1-',full.names = T),slickOpts = list(dots=T),height='0')

Subsection 2

iris%>%ggplot(aes(x=Species,y=Sepal.Width))+geom_boxplot()
iris%>%ggplot(aes(x=Species,y=Sepal.Width))+geom_bar(stat='identity')

slickR(list.files(fig.dir,pattern = 'PLOT2-',full.names = T),slideId ='newDiv' ,slickOpts = list(dots=T),height='0')