Description Public fields Methods
A class representing a single SVG element.
A class representing a single SVG element.
css_decls
character vector of css declaration text for this node
css_urls
character vector of css urls for this node
js_code
character vector of javascript code for this node
js_urls
character vector of javascript urls for this node
new()
Initialize an SVGNode
SVGNode$new()
update()
Update the SVG Element.
SVGNode$update(...)
...
attributes and children to set on this node
Named arguments are considered attributes and will overwrite existing attributes with the same name. Set to NULL to delete the attribute
Unnamed arguments are appended to the list of child nodes. These should be text, other SVGElements or any ojbect that can be represented as a single text string using "as.character()"
To print just the attribute name, but without a value, set to NA
add_css_url()
Add a URL to a CSS style sheet
SVGNode$add_css_url(css_url)
css_url
URL to style sheet. e.g. $add_css_url("css/local.css")
add_css()
Add a CSS declaration for this element.
SVGNode$add_css(css_decl)
css_decl
CSS string, or object which can be coerced to character.
e.g. $add_dec("#thing {font-size: 27px}")
add_js_code()
Add javascript code for this element
SVGNode$add_js_code(js_code)
js_code
character string containing javascript code.
add_js_url()
Add a javaxcript URL to load within the SVG
SVGNode$add_js_url(js_url)
js_url
URL to javascript code. e.g. $add_js_url("example.org/eg.js")
get_css_decls()
Create a CSS declaration string for inclusion in the character output for this element.
SVGNode$get_css_decls()
this includes all css for all child elements
get_css_urls()
Create a vector or urls for CSS inclustion
SVGNode$get_css_urls()
this includes all CSS URLs for all child elements
get_js_code()
Create a character vector of JS code for this node and all child nodes.
SVGNode$get_js_code()
get_js_urls()
Create a vector of external JS urls
SVGNode$get_js_urls()
this includes all CSS URLs for all child elements
get_css_style()
Create a complete CSS <style> tag using the declarations and URLs of the current element, and all child elements.
SVGNode$get_css_style()
character string
get_js_style()
Create a complete CSS style tag using the declarations and URLs of the current element, and all child elements.
SVGNode$get_js_style()
character string
as_character_inner()
Recursively convert this SVGElement and children to text
SVGNode$as_character_inner()
single character string
as_character()
Recursively convert this SVGElement and children to text
SVGNode$as_character()
single character string
print()
Print the SVG string to the terminal
SVGNode$print(include_declaration = FALSE, ...)
include_declaration
Include the leading XML declaration? default: FALSE
...
Extra arguments passed to SVGElement$as_character()
save()
Save the text representation of this node and its children
SVGNode$save(filename, include_declaration = FALSE, ...)
filename
filename
include_declaration
Include the leading XML declaration? default: FALSE
...
Extra arguments passed to SVGElement$as_character()
copy()
Make a deep copy of this node and its children
SVGNode$copy()
find()
Find elements which match the given tags
SVGNode$find(tags)
tags
character vector of tags to accept
minisvg objects which inherit from SVGNode will return NULL unless this method is overridden.
clone()
The objects of this class are cloneable with this method.
SVGNode$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.