Retrieve Names Mapped to SVG IDs, CSS Selectors and XPath Expressions {gridSVG} | R Documentation |
Retrieving Viewport, Grob, and Reference Names as SVG IDs, CSS Selectors and XPath Expressions
Description
This function gives us SVG IDs (or CSS selectors and XPath expressions) that have been created from a grob, viewport, or referenced name as a result of exporting to SVG.
Usage
getSVGMappings(name, type, result = "id")
Arguments
name |
A single element character vector. This should be the name of a grob
or viewport (as determined by |
type |
A single element character vector, must be one of |
result |
The type of output we want. |
Details
In order to generate unique names for SVG IDs, gridSVG output will not
produce the same names as are visible on the grid display list. This
function retrieves the SVG IDs associated with grob and viewport
names. To use this function first requires importing mapping
information, see gridSVGMappings
.
To make using results easier with existing JavaScript libraries and R
packages, CSS selectors and XPath expressions can be returned. This is
the case when result
is specified as one of selector
or
xpath
. These are targeted to match just the SVG element itself,
nothing more.
Value
A character vector representing values that can target specific SVG output.
Author(s)
Simon Potter