Description Usage Arguments Value Author(s) See Also Examples
This function takes an SVG document and extracts all the style attributes within the nodes and converts them to a set of CSS specifications and then replaces the style attribute with a class attribute which associates that node with the CSS declaration/rule. This can lead to a "significant" reduction in the size of the file (~ 30%) by avoiding duplication. It also allows one to easily change the appearance of all nodes with the same settings by modifying the centralized CSS rule. Furthermore, it allows somebody to customize the appearance of a plot without using R commands and regenerating the plot. This can be useful if the person doesn't know R or does not have the original data.
1 2 3 4 5 |
doc |
the parsed SVG document from |
classNames |
names for the newly created styles which will be
and which will be used as the values of the |
threshold |
a number (or |
add |
either a logical value or a character string.
This controls whether or how the newly created CSS content is added
to the document. If |
If add
is FALSE
, a named character vector giving the
newly-created CSS styles.
Otherwise, the updated XMLInternalDocument
object is returned.
If add
is a character string, a new file is created with that
name and contains the CSS definitions.
Duncan Temple Lang
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.