SVGDocument: SVGDocument Class

Description Details Super classes Public fields Active bindings Methods

Description

SVGDocument Class

SVGDocument Class

Details

This is a specialized subclass of SVGElement containing some methods specific to the top level SVG node.

Has only been tested with MacOS and Rstudio

Super classes

minisvg::SVGNode -> minisvg::SVGElement -> SVGDocument

Public fields

width, height

dimensions of document

Active bindings

width, height

dimensions of document

Methods

Public methods

Inherited methods

Method new()

Initialise a new SVG document

Usage
SVGDocument$new(
  ...,
  width = 400,
  height = 400,
  viewBox = NULL,
  preserveAspectRatio = NULL,
  xmlns = "http://www.w3.org/2000/svg",
  xmlns_xlink = "http://www.w3.org/1999/xlink"
)
Arguments
...

further arguments. Named arguments treated as attributes, unnamed arguments treated as child nodes

width, height

SVG dimensions. default: 400x400

viewBox

if NULL, then set to "0 0 width height"

preserveAspectRatio, xmlns, xmlns_xlink

standard SVG attributes


Method save_html()

Save a complete HTML document containing this SVG document

Usage
SVGDocument$save_html(filename)
Arguments
filename

HTML filename


Method show()

Render the SVG in the current viewer.

Usage
SVGDocument$show(viewer = getOption("viewer", utils::browseURL))
Arguments
viewer

which viewer to use?


Method inline_css()

Use the supplied string as the inline CSS for this document

Usage
SVGDocument$inline_css(css)
Arguments
css

string containing CSS


Method print()

Print the SVGDocument object

Usage
SVGDocument$print(include_declaration = TRUE, ...)
Arguments
include_declaration

Include the XML declaration? default: TRUE

...

other arguments passed to $as_character()


Method clone()

The objects of this class are cloneable with this method.

Usage
SVGDocument$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


coolbutuseless/minisvg documentation built on May 2, 2020, 3:15 a.m.