Closed jradinger closed 4 years ago
The SVG result is created by JavaScript in a browser window, so the easiest solution is to open it in a browser and use something like SVG Crowbar.
Doing this in R is probably far out of scope for this package, so I'm going to close this issue, but thanks for the idea and your interest.
For publications (e.g. in a scientific context) it would be nice to have a simple way to save/export a diagram produced with
networkD3
(e.g.sankeyNetwork()
) as pdf or any other vector graphics.This vector graphics should if possible be not rasterized to allow custom post-production modification as users (like me) want to modify certain parts of the graph (lines, fonts, colors, shapes) manually in a vector-graphics software.
Note: There are ways via
library(js2graphic)
orlibrary(webshot)
to save and transform a htmlwidget to a static graphic output (including pdf), but these methods work via rasterizing the graphic.