DiagrammeRsvg
DiagrammeRsvg copied to clipboard
export_svg() ignores height and width properties of the grViz object
This is a really useful package. I've been experimenting with different ways to use export_svg()
to embed a DiagrammeR diagram in a Rmarkdown HTML document, such that I can control the display dimensions. A constraint I keep bumping into is that export_svg()
seems to ignore the height
and width
properties of the grViz object. Rather it seems to picks its own, and because the height and width attributes are element properties it's not easy to override them with CSS.
I've written a workaround function to manually edit the height and width attributes of the svg string returned by export_svg()
, which works ok but I'm wondering if there's a cleaner way of specifying the output dimensions by passing something or other to V8?
I'm having the same problem here, @ajlyons is a great workaround.