create_anim_pattern_rotation: Create a simple rotation animation for an SVG pattern

Description Usage Arguments Details Value Examples

View source: R/create-anim-pattern-rotation.R

Description

This animation targets the patternTransform attribute, and thus onlyl applies to patterns.

Usage

1
2
3
4
5
6
7
create_anim_pattern_rotation(
  duration = 16,
  cx = 0,
  cy = 0,
  repeatCount = "indefinite",
  ...
)

Arguments

duration

time for full rotate (seconds). default: 16

cx, cy

centre of rotation. default (0, 0)

repeatCount

default: 'indefinite'

...

other arguments passed to minisvg::stag$animateTransform()

Details

If you want to animate the rotation of an arbitrary SVG object, see create_anim_rotation.

Value

minisvg SVGElement

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# Create the animation
anim1 <- create_anim_pattern_rotation(id = 'hello')

# Create a pattern and append the animation to the pattern
pat   <- svgpatternsimple::create_pattern_stripe(id = 'stripe')
pat$append(anim1)

# Create an SVG document with a rectangle, add the pattern to the
# document definitions, and use the pattern in the rectangle
doc <- minisvg::svg_doc()
doc$defs(pat)
doc$rect(x=0, y=0, width='100%', height='100%', fill=pat)

# view the code and render the SVG
doc
doc$show()

## End(Not run)

coolbutuseless/svganim documentation built on Feb. 2, 2020, 12:04 a.m.