plot() an object of class "dee" using omsvg::SVG(), omsvg::svg_path(), and nanosvgr::nsvg_read().
Usage
# S3 method for class 'dee'
plot(
x,
...,
height = getOption("dee.height"),
width = getOption("dee.width"),
background_color = getOption("dee.background_color", "none"),
stroke = getOption("dee.stroke"),
stroke_width = getOption("dee.stroke_width"),
fill = getOption("dee.fill"),
attrs = getOption("dee.attrs")
)Arguments
- x
An object of class "dee".
- ...
Passed to
omsvg::svg_path().- height, width
svg width and height.
- background_color
Background color.
- stroke, stroke_width, fill, attrs
Passed to
omsvg::svg_path().
Details
This function requires the package nanosvgr which (as of May 2026) is not available on CRAN. You can install it with remotes::install_github('coolbutuseless/nanosvgr') or utils::install.packages('nanosvgr', repos = c('https://trevorld.r-universe.dev', 'https://cloud.r-project.org')).
Examples
d <- M(10, 30) +
A(20, 20, 0, 0, 1, 50, 30) +
A(20, 20, 0, 0, 1, 90, 30) +
Q(90, 60, 50, 90) +
Q(10, 60, 10, 30) +
Z()
if (requireNamespace("omsvg", quietly = TRUE) &&
requireNamespace("nanosvgr", quietly = TRUE)) {
plot(d, height = 100, width = 100, background_color = "cyan",
fill = "red", stroke = "black", stroke_width = 4)
}