A class representing a single SVG element.
A class representing a single SVG element.
css_declscharacter vector of css declaration text for this node
css_urlscharacter vector of css urls for this node
js_codecharacter vector of javascript code for this node
js_urlscharacter 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_urlURL 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_declCSS 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_codecharacter string containing javascript code.
add_js_url()Add a javaxcript URL to load within the SVG
SVGNode$add_js_url(js_url)
js_urlURL 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_declarationInclude 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, ...)
filenamefilename
include_declarationInclude 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)
tagscharacter 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)
deepWhether to make a deep clone.