Skip to content

animateTransform

The animateTransform element animates a transformation attribute on its target element, thereby allowing animations to control translation, scaling, rotation, and/or skewing.

Usually, this element is created with:

js
const animateTransform = parentElement.add('animateTransform')

It's possible to create it as a disconnected element with gSVG('animateTransform') and attach it to the SVG document with .attachTo().

More info: mdn | w3c

.type()

js
animateTransform.type( transformationType )

Set the type attribute. It defines the type of transformation, whose values change over time.

  • argument: {string} transformationType Must be 'translate' | 'scale' | 'rotate' | 'skewX' | 'skewY'

  • returns: {gSVGObject} The original object

js
const type = element.type();

Get the type current value.

Released under the MIT License.