SVG_ {omsvg} | R Documentation |
Create a compact svg
object
Description
The SVG_()
function is a variation on SVG()
(the entry point for building
an SVG) in that the output tags will be as compact as possible (fewer
linebreaks, less space characters). This is a reasonable option if the
eventual use for the generated SVG is as inline SVG within HTML documents.
Usage
SVG_(width = NULL, height = NULL, viewbox = TRUE)
Arguments
width |
The width and height attributes on the top-level |
height |
The width and height attributes on the top-level |
viewbox |
An optional set of dimensions that defines the SVG |
Value
An svg
object.
Examples
if (interactive()) {
# Create a simple SVG with a rectangle and a circle
svg <-
SVG_(width = 100, height = 50) %>%
svg_rect(x = 0, y = 0, width = 30, height = 20) %>%
svg_circle(x = 50, y = 10, diameter = 20)
}