gridSVGMappings: Mapping Viewport, Grob and Reference Names to SVG IDs

Mapping Names to IDsR Documentation

Mapping Viewport, Grob and Reference Names to SVG IDs


This function is both a getter and a setter function for mapping information imported from a plot unknown to the current R session.


gridSVGMappings(newmappings = NULL)



A named list mapping information, produced by grid.export.


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 will store and return mapping information. This is information on how names have been translated from their original grob/viewport names to their SVG IDs.

Mapping information is stored as a list with 4 components, viewport mapping information, grob mapping information, reference mapping information and the ID separator used at the time of exporting.

Viewport, grob, and reference mapping information is stored as the name of the object, paired with a vector of suffixes associated with these names. When combined with the ID separator, we can construct the SVG IDs that have been applied, given each name. Use getSVGMappings to do this.


If newmappings is NULL, then we get back a named list representing name mapping information.

If we pass the named list representing mapping information into the function, we get no output.


Simon Potter

gridSVG documentation built on March 31, 2023, 11:17 p.m.