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, height
dimensions of document
width, height
dimensions 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, height
SVG dimensions. default: 400x400
viewBox
if NULL, then set to "0 0 width height"
preserveAspectRatio, xmlns, xmlns_xlink
standard SVG attributes
save_html()
Save a complete HTML document containing this SVG document
SVGDocument$save_html(filename)
filename
HTML filename
show()
Render the SVG in the current viewer.
SVGDocument$show(viewer = getOption("viewer", utils::browseURL))
viewer
which viewer to use?
inline_css()
Use the supplied string as the inline CSS for this document
SVGDocument$inline_css(css)
css
string containing CSS
print()
Print the SVGDocument object
SVGDocument$print(include_declaration = TRUE, ...)
include_declaration
Include 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)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.