daattali / timevis

📅 Create interactive timeline visualizations in R
http://daattali.com/shiny/timevis-demo/
Other
655 stars 157 forks source link

timevis not running in Quarto .qmd #140

Closed aito123 closed 1 year ago

aito123 commented 1 year ago

Hello @daattali, great package definitely I'm going to use it.

I included a timevis object inside an Rmd file and it worked perfectly. However, there is a problem when included in a Quarto document .qmd ("new generation of Rmd"). It's unable to run the document and gives the following error:

Quitting from lines 30-42 [unnamed-chunk-3] (timevis-in-qmd.rmarkdown)
Error in `add_html_caption()`:
! unused argument (xfun::grep_sub("^[^<]*<[^>]+aria-labelledby[ ]*=[ ]*\"([^\"]+)\".*$", "\\1", x))
Backtrace:
  1. global .main()
  2. execute(...)
  3. rmarkdown::render(...)
  4. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  5. knitr:::process_file(text, output)
     ...
 14. sew(res, options)
 15. knitr:::sew.list(x, options, ...)
 16. base::lapply(x, sew, options, ...)
 17. FUN(X[[i]], ...)
 18. knitr:::sew.knit_asis(x, options, ...)
Execution halted

Here is the .qmd code. I am using a timevis example I saw in the timevis-demo:

---
title: "Timevis as qmd"
author: "Santiago Sotelo"
format: html
editor: visual
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

## Running Code

When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1

You can add options to executable code like this

#| echo: false
2 * 2

The echo: false option disables the printing of code (only output is displayed).

pacman::p_load(timevis)

data <- data.frame(
  id      = 1:4,
  content = c("Item one", "Item two",
              "Ranged item", "Item four"),
  start   = c("2016-01-10", "2016-01-11",
              "2016-01-20", "2016-02-14 15:00:00"),
  end     = c(NA, NA, "2016-02-04", NA)
)

timevis(data)


I look forward to hear from you. Thanks for helping!
aito123 commented 1 year ago

Hi here an update on this issue:

It seems to be a problem with Quarto (version 1.3.353) itself with htmlWidgets not with the package timevis as pointed out in this Github issue.

https://github.com/quarto-dev/quarto-cli/issues/5702

daattali commented 1 year ago

Thanks for the update! Can we close this issue then?

aito123 commented 1 year ago

Yes no problem