Description Super class Public fields Methods Examples
A class representing a single SVG element.
A class representing a single SVG element.
minisvg::SVGNode -> SVGElement
nameTag name for this node e.g. "circle"
attribsnamed list of attributes for this node
childrenordered list of direct child nodes (kept in insertion order)
childlists of child nodes indexed by tag name.
a()SVGElement$a(..., href = NULL)
animate()SVGElement$animate( ..., attributeName = NULL, attributeType = NULL, from = NULL, to = NULL, dur = NULL, repeatCount = NULL, begin = NULL, end = NULL, calcMode = NULL, values = NULL, keyTimes = NULL, keySplines = NULL, by = NULL )
animateMotion()SVGElement$animateMotion( ..., calcMode = NULL, path = NULL, keyPoints = NULL, rotate = NULL, origin = NULL )
animateTransform()SVGElement$animateTransform( ..., attributeName = NULL, attributeType = NULL, by = NULL, from = NULL, to = NULL, type = NULL, dur = NULL, repeatCount = NULL )
circle()SVGElement$circle(..., cx = NULL, cy = NULL, r = NULL)
clipPath()SVGElement$clipPath(..., id = NULL)
defs()SVGElement$defs(...)
desc()SVGElement$desc(...)
discard()SVGElement$discard(..., begin = NULL, href = NULL)
ellipse()SVGElement$ellipse(..., cx = NULL, cy = NULL, rx = NULL, ry = NULL)
feBlend()SVGElement$feBlend(..., in_ = NULL, in2 = NULL, mode = NULL, result = NULL)
feColorMatrix()SVGElement$feColorMatrix( ..., in_ = NULL, type = NULL, values = NULL, result = NULL )
feComponentTransfer()SVGElement$feComponentTransfer(..., in_ = NULL, result = NULL)
feComposite()SVGElement$feComposite( ..., in_ = NULL, in2 = NULL, operator = NULL, k1 = NULL, k2 = NULL, k3 = NULL, k4 = NULL, result = NULL )
feConvolveMatrix()SVGElement$feConvolveMatrix( ..., in_ = NULL, order = NULL, kernelMatrix = NULL, divisor = NULL, bias = NULL, targetX = NULL, targetY = NULL, edgeMode = NULL, kernelUnitLength = NULL, preserveAlpha = NULL, result = NULL )
feDiffuseLighting()SVGElement$feDiffuseLighting( ..., in_ = NULL, surfaceScale = NULL, diffuseConstant = NULL, kernelUnitLength = NULL, result = NULL )
feDisplacementMap()SVGElement$feDisplacementMap( ..., in_ = NULL, in2 = NULL, scale = NULL, xChannelSelector = NULL, yChannelSelector = NULL, result = NULL )
feFlood()SVGElement$feFlood( ..., flood_color = NULL, flood_opacity = NULL, result = NULL )
feFuncR()SVGElement$feFuncR(..., type = NULL, tableValues = NULL)
feFuncG()SVGElement$feFuncG(..., type = NULL, tableValues = NULL)
feFuncB()SVGElement$feFuncB(..., type = NULL, tableValues = NULL)
feFuncA()SVGElement$feFuncA(..., type = NULL, tableValues = NULL)
feGaussianBlur()SVGElement$feGaussianBlur( ..., in_ = NULL, stdDeviation = NULL, edgeMode = NULL, result = NULL )
feImage()SVGElement$feImage( ..., preserveAspectRatio = NULL, xlink_href = NULL, result = NULL )
feMerge()SVGElement$feMerge(..., result = NULL)
feMergeNode()SVGElement$feMergeNode(..., in_ = NULL)
feMorphology()SVGElement$feMorphology( ..., in_ = NULL, operator = NULL, radius = NULL, result = NULL )
feOffset()SVGElement$feOffset(..., in_ = NULL, dx = NULL, dy = NULL, result = NULL)
feSpecularLighting()SVGElement$feSpecularLighting( ..., in_ = NULL, surfaceScale = NULL, specularConstant = NULL, specularExponent = NULL, kernelUnitLength = NULL, result = NULL )
feTile()SVGElement$feTile(..., in_ = NULL, result = NULL)
feTurbulence()SVGElement$feTurbulence( ..., type = NULL, baseFrequency = NULL, numOctaves = NULL, seed = NULL, stitchTiles = NULL, result = NULL )
filter()SVGElement$filter( ..., id = NULL, x = NULL, y = NULL, width = NULL, height = NULL, filterRes = NULL, filterUnits = NULL, primitiveUnits = NULL, xlink_href = NULL )
foreignObject()SVGElement$foreignObject(..., x = NULL, y = NULL, width = NULL, height = NULL)
g()SVGElement$g(..., id = NULL)
image()SVGElement$image( ..., x = NULL, y = NULL, width = NULL, height = NULL, xlink_href = NULL, preserveAspectRatio = NULL )
line()SVGElement$line(..., x1 = NULL, y1 = NULL, x2 = NULL, y2 = NULL)
linearGradient()SVGElement$linearGradient( ..., x1 = NULL, y1 = NULL, x2 = NULL, y2 = NULL, href = NULL, gradientTransform = NULL, gradientUnits = NULL, spreadMethod = NULL )
marker()SVGElement$marker( ..., refX = NULL, refY = NULL, markerWidth = NULL, markerHeight = NULL, markerUnits = NULL, orient = NULL, preserveAspectRatio = NULL, viewBox = NULL )
mask()SVGElement$mask( ..., x = NULL, y = NULL, width = NULL, height = NULL, maskUnits = NULL, maskContentUnits = NULL )
mpath()SVGElement$mpath(..., xlink_href = NULL)
path()SVGElement$path(..., d = NULL, pathLength = NULL)
pattern()SVGElement$pattern( ..., id = NULL, x = NULL, y = NULL, width = NULL, height = NULL, href = NULL, patternUnits = NULL, patternTransform = NULL, preserveAspectRatio = NULL )
radialGradient()SVGElement$radialGradient( ..., id = NULL, cx = NULL, cy = NULL, r = NULL, fx = NULL, fy = NULL, fr = NULL, href = NULL, gradientUnits = NULL, gradientTransform = NULL, spreadMethod = NULL )
rect()SVGElement$rect( ..., x = NULL, y = NULL, width = NULL, height = NULL, rx = NULL, ry = NULL )
script()SVGElement$script(..., type = NULL, href = NULL)
set()SVGElement$set(..., to = NULL)
stop()SVGElement$stop(..., offset = NULL, stop_color = NULL, stop_opacity = NULL)
style()SVGElement$style(...)
switch()SVGElement$switch(...)
symbol()SVGElement$symbol( ..., id = NULL, x = NULL, y = NULL, width = NULL, height = NULL, refX = NULL, refY = NULL, preserveAspectRatio = NULL )
text()SVGElement$text( ..., x = NULL, y = NULL, dx = NULL, dy = NULL, rotate = NULL, textWidth = NULL, lengthAdjust = NULL )
textPath()SVGElement$textPath( ..., href = NULL, path = NULL, method = NULL, side = NULL, spacing = NULL, startOffset = NULL, textLength = NULL, lengthAdjust = NULL )
title()SVGElement$title(...)
use()SVGElement$use( ..., x = NULL, y = NULL, width = NULL, height = NULL, href = NULL )
matrix()SVGElement$matrix(a, b, c, d, e, f)
translate()SVGElement$translate(x, y = NULL)
scale()SVGElement$scale(x, y = NULL)
rotate()SVGElement$rotate(a, x = NULL, y = NULL)
skewX()SVGElement$skewX(a)
skewY()SVGElement$skewY(a)
polygon()SVGElement$polygon(xs = NULL, ys = NULL, points = NULL, ...)
polyline()SVGElement$polyline(xs = NULL, ys = NULL, points = NULL, ...)
new()Initialize an SVGElement
SVGElement$new(name, ...)
namenode name e.g. "circle"
...further arguments. Named arguments treated as attributes, unnamed arguments treated as child nodes
update()Update the SVG Element.
SVGElement$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
append()Append child nodes at the specified position.
SVGElement$append(..., position = NULL)
...child nodes
positionby default at the end of the list of children nodes but 'position' argument can be used to set location by index
update_child_list()Update the list of child nodes by tag name
SVGElement$update_child_list(new_elem)
new_elemthe element being added
rebuild_child_list()URebuild the list of child nodes by tag name
SVGElement$rebuild_child_list()
add()Simultaneous create an SVG element and add it as a child node
SVGElement$add(name, ...)
namename of node to create
...attributes and children of this newly created node
In contrast to most other methods, $add() returns
the newly created element, not the document
remove()Remove child objects at the given indices
SVGElement$remove(indices)
indicesindices of the children to remove
reset_transform()Remove any transform attributes from this node
SVGElement$reset_transform()
as_character_inner()Recursively convert this SVGElement and children to text
SVGElement$as_character_inner(..., depth = 0)
...ignored
depthrecursion depth
single character string
as_character()Recursively convert this SVGElement and children to text
SVGElement$as_character(..., depth = 0, include_declaration = FALSE)
...ignored
depthrecursion depth. default: 0
include_declarationInclude the leading XML declaration? default: FALSE
single character string
save()Save the text representation of this node and its children
SVGElement$save(filename, include_declaration = FALSE, ...)
filenamefilename
include_declarationInclude the leading XML declaration? default: FALSE
...Extra arguments passed to SVGElement$as_character()
has_attribs()test if this element has all of the named attributes
SVGElement$has_attribs(attribs)
namedlist of attributes
logical. Note: if length(attribs) == 0, this method returns
TRUE
find()Find elements which match the given tag names and attributes.
SVGElement$find(tag = c(), attribs = list())
tagcharacter vector of tags to find. default: c()
attribsnamed list of attributes to match. default: list().
Note that attribute matching is matched using in
List of R6 reference objects
\dontrun{
doc$find(tag = c('rect', 'circle'), attribs = list(fill = c('red', 'black')))
}
copy()Make a deep copy of this node and its children
SVGElement$copy()
clone()The objects of this class are cloneable with this method.
SVGElement$clone(deep = FALSE)
deepWhether to make a deep clone.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.