SVGPattern: SVGPattern Class

Description Details Super classes Public fields Methods Examples

Description

SVGPattern Class

SVGPattern Class

Details

This is a slightly specialized subclass of SVGElement which has methods to specifically handle SVG <pattern> nodes

SVGPattern objects may also have their own 'filter_def' filter definition.

Super classes

minisvg::SVGNode -> minisvg::SVGElement -> SVGPattern

Public fields

filter_def

A filter definition to accompany this pattern

Methods

Public methods

Inherited methods

Method new()

Initialise an SVGPattern object

Usage
SVGPattern$new(..., name = "pattern")
Arguments
...

Further arguments passed to SVGElement$new()

name

defaults to 'pattern', but some gradients may also be used here


Method as_full_svg()

Wrap the SVG for this pattern in a full SVG document and return the text

Usage
SVGPattern$as_full_svg(width = 400, height = width)
Arguments
height, width

dimensions of SVG wrapper around this pattern


Method save_full_svg()

Save the SVG for this pattern in a full SVG document

Usage
SVGPattern$save_full_svg(filename, include_declaration = TRUE, ...)
Arguments
filename

filename for output

include_declaration

Include leading XML declaration. default: TRUE

...

Further arguments passed to SVGPattern$as_full_svg()


Method as_character()

Recursively convert this SVGElement and children to text

Usage
SVGPattern$as_character(..., depth = 0, include_declaration = FALSE)
Arguments
...

ignored

depth

recursion depth. default: 0

include_declaration

Include the leading XML declaration? default: FALSE

Returns

single character string


Method show()

Render this pattern in the context of a complete SVG document

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

Further arguments passed to SVGPattern$save_full_svg()

viewer

viewer.


Method clone()

The objects of this class are cloneable with this method.

Usage
SVGPattern$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
6
## Not run: 
a <- SVGPattern$new()
f <- stag$filter(id = "turbulence-filter", stag$feTurbulence(...))
a$filter_def <- f

## End(Not run)

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