# set

The SVG set element provides a simple means of just setting the value of an attribute for a specified duration.

It supports all attribute types, including those that cannot reasonably be interpolated, such as string and boolean values. For attributes that can be reasonably be interpolated, the animate is usualy prefered.

Note: The set element is non-additive. The additive and accumulate attributes are not allowed, and will be ignored if specified.

Usually, this element is create with:

const set = parentElement.add('set')

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

More info: mdn (opens new window) | w3c (opens new window)

# .to()

set.to( _ )

Set this attribute defines the value to be applied to the target attribute for the duration of the animation. The value must match the requirements of the target attribute.

  • argument: {} _

  • returns: {gySVGObject} The original object

const to = element.to();

Get the to current value.