Retrieve Names Mapped to SVG IDs, CSS Selectors and XPath Expressions | R Documentation |
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.
getSVGMappings(name, type, result = "id")
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. |
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.
A character vector representing values that can target specific SVG output.
Simon Potter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.