Description Details Super classes Public fields Active bindings Methods
SVGDocument Class
SVGDocument Class
This is a specialized subclass of SVGElement containing some methods specific
to the top level SVG node.
Has only been tested with MacOS and Rstudio
minisvg::SVGNode -> minisvg::SVGElement -> SVGDocument
width, heightdimensions of document
width, heightdimensions of document
new()Initialise a new SVG document
SVGDocument$new( ..., width = 400, height = 400, viewBox = NULL, preserveAspectRatio = NULL, xmlns = "http://www.w3.org/2000/svg", xmlns_xlink = "http://www.w3.org/1999/xlink" )
...further arguments. Named arguments treated as attributes, unnamed arguments treated as child nodes
width, heightSVG dimensions. default: 400x400
viewBoxif NULL, then set to "0 0 width height"
preserveAspectRatio, xmlns, xmlns_xlinkstandard SVG attributes
save_html()Save a complete HTML document containing this SVG document
SVGDocument$save_html(filename)
filenameHTML filename
show()Render the SVG in the current viewer.
SVGDocument$show(viewer = getOption("viewer", utils::browseURL))viewerwhich viewer to use?
inline_css()Use the supplied string as the inline CSS for this document
SVGDocument$inline_css(css)
cssstring containing CSS
print()Print the SVGDocument object
SVGDocument$print(include_declaration = TRUE, ...)
include_declarationInclude the XML declaration? default: TRUE
...other arguments passed to $as_character()
clone()The objects of this class are cloneable with this method.
SVGDocument$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.