I would like to include Javascript from Flourish visualization in rmarkdown file.
You can insert JS code in a R Markdown document using a js
engine like in this example
Otherwise, you can use includes to insert code in the HTML templates
But usually, JS library to be used in Shiny apps or HTML R Markdown are packaged as htmlwidgets or HTML dependencies with htmltools. See more at
- https://www.htmlwidgets.org/
- Tools for HTML • htmltools
- JavaScript for the R package developer - R-hub blog
- Chapter 4 Handle HTML dependencies with {htmltools} | Outstanding User Interfaces with Shiny and more in this book.
- This JS for R book https://book.javascript-for-r.com/
You can then package this JS library in a R package to share its usage across document and users for examples
1 Like
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.