Save r markdown to standalone html with interactive html widgets?









up vote
0
down vote

favorite












The support documents for html-widgets suggest that it is possible to save a stand alone html page from an r markdown document with interactive html components intact, without relying on shiny. The documentation is located here (https://bookdown.org/yihui/rmarkdown/html-widgets.html#fn13).



Is this true? When I run an example script below from a RMD file in rstudio and save the output as a standalone web page the resulting html is no longer interactive.



---
title: "An Interactive Map"
---

Below is a map that shows the location of the
Department of Statistics, Iowa State University.

```r out.width='100%', echo=FALSE
library(leaflet)
leaflet() %>% addTiles() %>%
setView(-93.65, 42.0285, zoom = 17) %>%
addPopups(
-93.65, 42.0285,
'Here is the <b>Department of Statistics</b>, ISU'
)
```









share|improve this question





















  • that example works 👍 for me and likely for most everyone else. what is the error you see? did you open the javascript console in the browser to see if there were any resource load issues? do you have internet access when you try to view it (leaflet requires full on internet access)?
    – hrbrmstr
    Nov 9 at 20:42










  • So when I open java script console in the preview page in my browser I get this warning. MathJax.js?config=TeX-AMS-MML_HTMLorMML:32 WARNING: cdn.mathjax.org has been retired. Check mathjax.org/cdn-shutting-down for migration tips. When I open the console in the version I saved, I get the same warning and two errors: /C:/extensions/MathMenu.js?V=2.7.1:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
    – Sardine
    Nov 9 at 20:50











  • you should probably upgrade some packages including rmarkdown stackoverflow.com/questions/25892993/…
    – hrbrmstr
    Nov 9 at 20:53










  • I updated my rmarkdown package and attempted to follow the instructions regarding the changes to the cdn.mathjax. I am no longer getting the warning but I am still getting load the errors on mathmenu.js and mathzoom.js. Is there something else to update?
    – Sardine
    Nov 9 at 21:28











  • I was able to generate funtioning html by including this in my markdown header: output: html_document: mathjax: cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js The html that is saved by knitr is fully functional but if I open the preview in my browser and save the "complete web-page" that copy is not.
    – Sardine
    Nov 10 at 0:59















up vote
0
down vote

favorite












The support documents for html-widgets suggest that it is possible to save a stand alone html page from an r markdown document with interactive html components intact, without relying on shiny. The documentation is located here (https://bookdown.org/yihui/rmarkdown/html-widgets.html#fn13).



Is this true? When I run an example script below from a RMD file in rstudio and save the output as a standalone web page the resulting html is no longer interactive.



---
title: "An Interactive Map"
---

Below is a map that shows the location of the
Department of Statistics, Iowa State University.

```r out.width='100%', echo=FALSE
library(leaflet)
leaflet() %>% addTiles() %>%
setView(-93.65, 42.0285, zoom = 17) %>%
addPopups(
-93.65, 42.0285,
'Here is the <b>Department of Statistics</b>, ISU'
)
```









share|improve this question





















  • that example works 👍 for me and likely for most everyone else. what is the error you see? did you open the javascript console in the browser to see if there were any resource load issues? do you have internet access when you try to view it (leaflet requires full on internet access)?
    – hrbrmstr
    Nov 9 at 20:42










  • So when I open java script console in the preview page in my browser I get this warning. MathJax.js?config=TeX-AMS-MML_HTMLorMML:32 WARNING: cdn.mathjax.org has been retired. Check mathjax.org/cdn-shutting-down for migration tips. When I open the console in the version I saved, I get the same warning and two errors: /C:/extensions/MathMenu.js?V=2.7.1:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
    – Sardine
    Nov 9 at 20:50











  • you should probably upgrade some packages including rmarkdown stackoverflow.com/questions/25892993/…
    – hrbrmstr
    Nov 9 at 20:53










  • I updated my rmarkdown package and attempted to follow the instructions regarding the changes to the cdn.mathjax. I am no longer getting the warning but I am still getting load the errors on mathmenu.js and mathzoom.js. Is there something else to update?
    – Sardine
    Nov 9 at 21:28











  • I was able to generate funtioning html by including this in my markdown header: output: html_document: mathjax: cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js The html that is saved by knitr is fully functional but if I open the preview in my browser and save the "complete web-page" that copy is not.
    – Sardine
    Nov 10 at 0:59













up vote
0
down vote

favorite









up vote
0
down vote

favorite











The support documents for html-widgets suggest that it is possible to save a stand alone html page from an r markdown document with interactive html components intact, without relying on shiny. The documentation is located here (https://bookdown.org/yihui/rmarkdown/html-widgets.html#fn13).



Is this true? When I run an example script below from a RMD file in rstudio and save the output as a standalone web page the resulting html is no longer interactive.



---
title: "An Interactive Map"
---

Below is a map that shows the location of the
Department of Statistics, Iowa State University.

```r out.width='100%', echo=FALSE
library(leaflet)
leaflet() %>% addTiles() %>%
setView(-93.65, 42.0285, zoom = 17) %>%
addPopups(
-93.65, 42.0285,
'Here is the <b>Department of Statistics</b>, ISU'
)
```









share|improve this question













The support documents for html-widgets suggest that it is possible to save a stand alone html page from an r markdown document with interactive html components intact, without relying on shiny. The documentation is located here (https://bookdown.org/yihui/rmarkdown/html-widgets.html#fn13).



Is this true? When I run an example script below from a RMD file in rstudio and save the output as a standalone web page the resulting html is no longer interactive.



---
title: "An Interactive Map"
---

Below is a map that shows the location of the
Department of Statistics, Iowa State University.

```r out.width='100%', echo=FALSE
library(leaflet)
leaflet() %>% addTiles() %>%
setView(-93.65, 42.0285, zoom = 17) %>%
addPopups(
-93.65, 42.0285,
'Here is the <b>Department of Statistics</b>, ISU'
)
```






r htmlwidgets






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 20:06









Sardine

1




1











  • that example works 👍 for me and likely for most everyone else. what is the error you see? did you open the javascript console in the browser to see if there were any resource load issues? do you have internet access when you try to view it (leaflet requires full on internet access)?
    – hrbrmstr
    Nov 9 at 20:42










  • So when I open java script console in the preview page in my browser I get this warning. MathJax.js?config=TeX-AMS-MML_HTMLorMML:32 WARNING: cdn.mathjax.org has been retired. Check mathjax.org/cdn-shutting-down for migration tips. When I open the console in the version I saved, I get the same warning and two errors: /C:/extensions/MathMenu.js?V=2.7.1:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
    – Sardine
    Nov 9 at 20:50











  • you should probably upgrade some packages including rmarkdown stackoverflow.com/questions/25892993/…
    – hrbrmstr
    Nov 9 at 20:53










  • I updated my rmarkdown package and attempted to follow the instructions regarding the changes to the cdn.mathjax. I am no longer getting the warning but I am still getting load the errors on mathmenu.js and mathzoom.js. Is there something else to update?
    – Sardine
    Nov 9 at 21:28











  • I was able to generate funtioning html by including this in my markdown header: output: html_document: mathjax: cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js The html that is saved by knitr is fully functional but if I open the preview in my browser and save the "complete web-page" that copy is not.
    – Sardine
    Nov 10 at 0:59

















  • that example works 👍 for me and likely for most everyone else. what is the error you see? did you open the javascript console in the browser to see if there were any resource load issues? do you have internet access when you try to view it (leaflet requires full on internet access)?
    – hrbrmstr
    Nov 9 at 20:42










  • So when I open java script console in the preview page in my browser I get this warning. MathJax.js?config=TeX-AMS-MML_HTMLorMML:32 WARNING: cdn.mathjax.org has been retired. Check mathjax.org/cdn-shutting-down for migration tips. When I open the console in the version I saved, I get the same warning and two errors: /C:/extensions/MathMenu.js?V=2.7.1:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
    – Sardine
    Nov 9 at 20:50











  • you should probably upgrade some packages including rmarkdown stackoverflow.com/questions/25892993/…
    – hrbrmstr
    Nov 9 at 20:53










  • I updated my rmarkdown package and attempted to follow the instructions regarding the changes to the cdn.mathjax. I am no longer getting the warning but I am still getting load the errors on mathmenu.js and mathzoom.js. Is there something else to update?
    – Sardine
    Nov 9 at 21:28











  • I was able to generate funtioning html by including this in my markdown header: output: html_document: mathjax: cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js The html that is saved by knitr is fully functional but if I open the preview in my browser and save the "complete web-page" that copy is not.
    – Sardine
    Nov 10 at 0:59
















that example works 👍 for me and likely for most everyone else. what is the error you see? did you open the javascript console in the browser to see if there were any resource load issues? do you have internet access when you try to view it (leaflet requires full on internet access)?
– hrbrmstr
Nov 9 at 20:42




that example works 👍 for me and likely for most everyone else. what is the error you see? did you open the javascript console in the browser to see if there were any resource load issues? do you have internet access when you try to view it (leaflet requires full on internet access)?
– hrbrmstr
Nov 9 at 20:42












So when I open java script console in the preview page in my browser I get this warning. MathJax.js?config=TeX-AMS-MML_HTMLorMML:32 WARNING: cdn.mathjax.org has been retired. Check mathjax.org/cdn-shutting-down for migration tips. When I open the console in the version I saved, I get the same warning and two errors: /C:/extensions/MathMenu.js?V=2.7.1:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
– Sardine
Nov 9 at 20:50





So when I open java script console in the preview page in my browser I get this warning. MathJax.js?config=TeX-AMS-MML_HTMLorMML:32 WARNING: cdn.mathjax.org has been retired. Check mathjax.org/cdn-shutting-down for migration tips. When I open the console in the version I saved, I get the same warning and two errors: /C:/extensions/MathMenu.js?V=2.7.1:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
– Sardine
Nov 9 at 20:50













you should probably upgrade some packages including rmarkdown stackoverflow.com/questions/25892993/…
– hrbrmstr
Nov 9 at 20:53




you should probably upgrade some packages including rmarkdown stackoverflow.com/questions/25892993/…
– hrbrmstr
Nov 9 at 20:53












I updated my rmarkdown package and attempted to follow the instructions regarding the changes to the cdn.mathjax. I am no longer getting the warning but I am still getting load the errors on mathmenu.js and mathzoom.js. Is there something else to update?
– Sardine
Nov 9 at 21:28





I updated my rmarkdown package and attempted to follow the instructions regarding the changes to the cdn.mathjax. I am no longer getting the warning but I am still getting load the errors on mathmenu.js and mathzoom.js. Is there something else to update?
– Sardine
Nov 9 at 21:28













I was able to generate funtioning html by including this in my markdown header: output: html_document: mathjax: cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js The html that is saved by knitr is fully functional but if I open the preview in my browser and save the "complete web-page" that copy is not.
– Sardine
Nov 10 at 0:59





I was able to generate funtioning html by including this in my markdown header: output: html_document: mathjax: cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js The html that is saved by knitr is fully functional but if I open the preview in my browser and save the "complete web-page" that copy is not.
– Sardine
Nov 10 at 0:59


















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232626%2fsave-r-markdown-to-standalone-html-with-interactive-html-widgets%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232626%2fsave-r-markdown-to-standalone-html-with-interactive-html-widgets%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kleinkühnau

Makov (Slowakei)

Deutsches Schauspielhaus