Closed davidgohel closed 7 years ago
I've found this problem, try this:
htmlwidgets::saveWidget(widget = xx, file = "test.html", selfcontained = FALSE)
Looking forward to opening a issue in htmlWidges ...
Yes, if using selfcontained = FALSE
I have what's expected.
Hi,
Is that a wontfix
? We wanted self-contained files because that was the only format supported on a portal (MS sharepoint).
Try this function:
simpleFix = function(inputFile, outputFile){
a = readLines(inputFile)
output = paste(a, collapse = "\n")
output = gsub(">\n\n</div>","></div>",output)
writeLines(output, outputFile)
invisible(NULL)
}
library(wordcloud2)
library(htmlwidgets)
m <- wordcloud2::wordcloud2(wordcloud2::demoFreq)
htmlwidgets::saveWidget(m, file = "wordcloud2.html", selfcontained = TRUE)
simpleFix("wordcloud2.html", "wordcloud2.html")
pandoc leave some strange output for self-contained html.
Thanks for your package, it's very useful.
I met an issue when using
htmlwidgets::saveWidget
. Could you help on that?When opening the file
test.html
, nothing is displayed. An javascript error can be read in the js console:Uncaught TypeError: canvas.getBoundingClientRect is not a function(…)
KR, David