R/create-anim-pattern-rotation.R
create_anim_pattern_rotation.Rd
This animation targets the patternTransform
attribute, and thus onlyl
applies to patterns.
create_anim_pattern_rotation( duration = 16, cx = 0, cy = 0, repeatCount = "indefinite", ... )
duration | time for full rotate (seconds). default: 16 |
---|---|
cx, cy | centre of rotation. default (0, 0) |
repeatCount | default: 'indefinite' |
... | other arguments passed to |
minisvg SVGElement
If you want to animate the rotation of an arbitrary SVG object, see create_anim_rotation.
if (FALSE) { # 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() }