dotPlotly icon indicating copy to clipboard operation
dotPlotly copied to clipboard

How to generate a pdf or svg file?

Open Sven-Winter opened this issue 3 years ago • 4 comments

Hi,

I managed to generate html and png plots. However, I always receive the following error:

Error in htmlwidgets::saveWidget(as.widget(gply), file = paste0(opt$output_filename, : Saving a widget with selfcontained = TRUE requires pandoc. For details see: https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md

I installed pandoc but the error remains.

Is there a way to generate a SVG file? Would be nice to save a SVG directly from the interactive plot instead of only png.

Thanks!

Sven-Winter avatar Nov 04 '22 09:11 Sven-Winter

According to my experience, I found that as long as I modify the PNG parameter in the corresponding R script is SVG or PDF. @Sven-Winter

Jwindler avatar Jan 12 '24 08:01 Jwindler

@Jwindler @Sven-Winter you're talking about this line right?

https://github.com/tpoorten/dotPlotly/blob/117448491cf7dc23100e3271169242bef4fd6a65/pafCoordsDotPlotly.R#L295

(Based on Hadley Wickham (2016) 'UseR!', 2nd edition, pp.185. Springer.)

lonelyjoeparker avatar Jan 17 '24 12:01 lonelyjoeparker

ye @lonelyjoeparker

Jwindler avatar Jan 17 '24 12:01 Jwindler

@Jwindler @Sven-Winter I forked/fixed/tested this quickly and created a pull request. Please feel free to test, report findings back here, and upvote to @tpoorten if you find useful thanks :grinning:

https://github.com/tpoorten/dotPlotly/pull/23

lonelyjoeparker avatar Jan 17 '24 13:01 lonelyjoeparker