Description Usage Arguments Value Author(s) See Also Examples
These functions allow us to query and set and reorganize the value of a style attribute of an SVG node. We use these to determine the vector of CSS-based style settings and to set a new value.
modifyStyle
is used to merge new values for particular
characteristics in an existing style.
These functions are provided for use in building higher-level functionality such as tooltips, animation, and other effects in SVG plots.
1 2 3 4 |
node |
the SVG node whose style is to be manipulated |
style |
the style to be modified. This can be a character vector or an XML node. |
... |
name = value pairs giving the attributes and their values for the style |
.style |
a named vector containing the name - value pairs as if they were typed via .... |
.vals |
the name-value settings for the styles given as a single list rather than individually via the .... |
getStyle
returns a named character vector.
setStyle
returns the updated node.
modifyStyle
returns the updated object it was given.
Duncan Temple Lang
1 2 3 4 5 6 7 | doc = svgPlot(plot(1:10, col = c("red", "blue")))
pts = getPlotPoints(doc)
sty = getStyle(pts[[1]])
sty1 = modifyStyle(sty, fill = "green", 'stroke-width' = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.