Package 'DiagrammeRsvg'

Title: Export DiagrammeR Graphviz Graphs as SVG
Description: Allows for export of DiagrammeR Graphviz objects to SVG.
Authors: Richard Iannone [aut, cre]
Maintainer: Richard Iannone <[email protected]>
License: MIT + file LICENSE
Version: 0.1
Built: 2024-11-16 05:36:09 UTC
Source: https://github.com/rich-iannone/diagrammersvg

Help Index


Export grViz graph as SVG with V8

Description

Use viz.js with V8 to get the diagram rendered as SVG in R instead of the browser.

Usage

export_svg(gv)

Arguments

gv

htmlwidget to render as SVG.

Value

string of SVG XML text.

Examples

## Not run: 
 library(DiagrammeR)
 svg <- export_svg(grViz('digraph{a->b; c->a; c->b; c->d;}'))

 # this can then be used with htmltools and can save significantly
 # on size of output using svg rather than unrendered grViz
 library(htmltools)
 html_print(HTML(svg))

## End(Not run)

Register a knit_print() method for grViz objects

Description

This function registers a method for knit_print() for grViz objects. With this method enabled, rendered HTML documents no longer require a viz.js dependency. Instead, embedded SVG is inserted into the Markdown. The resulting HTML documents have a smaller footprint and are rendered faster.

Usage

register_knit_print()