Open rBatt opened 8 years ago
@rich-iannone; do you have a best-practices way of doing this?
Right now I'm using SVG crowbar. I figured out how to get the .html file; I can use saveWidget
.
Ultimately I liked to put the diagram into the README of the GitHub repo.
@richfitz unfortunately I know of no good way export content from the Viewer to a graphic format using a function call. There are no lightweight JS libraries (that I know of) that do this sort of thing either.
Thanks Rich!
Mostly for my own information later, this thread has some useful hints: https://github.com/ramnathv/htmlwidgets/issues/95
The phantomjs approach looks promising but heavy.
this is a really great package btw, and diagram()
is such a great feature. just giving a :+1: here.
I think you can get the svg out (as @rBatt mentioned), but GH readmes don't really like doing svgs, as you have to point to a rawgit host of the image instead of the relative path.
There's a brand new package https://github.com/rich-iannone/DiagrammeRsvg from @rich-iannone (just hit CRAN) that could probably get the svg out without a great hassle. If a sensible workflow can be established I'd be happy to add that to the package. Perhaps it could be combined with rsvg to go svg -> png.
@richfitz yes! Please do that (it's the reason I put that on CRAN). And the rsvg
package will convert to various formats. Check some recently updated issues for the DiagrammeR
package; there are examples there!
Is there a way to save the output of
diagram()
? Current, it creates a .html file which opens in my browser.Additionally, how do I redirect the output and name of the .html file it creates?