# 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 created with:
const set = parentElement.add('set')
It's possible to create it 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( value )
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:
{number|string} value
the value for the attribute during the duration of the elementreturns:
{gySVGObject}
The original object
const to = element.to();
Get the to
current value.
returns:
{number|string}
Parent elements: a | circle | clipPath | defs | ellipse | feBlend | feColorMatrix | feComposite | feConvolveMatrix | feDisplacementMap | feDistantLight | feDropShadow | feFlood | feFuncA | feFuncB | feFuncG | feFuncR | feGaussianBlur | feImage | feMergeNode | feMorphology | feOffset | fePointLight | feSpotLight | feTile | feTurbulence | filter | g | image | line | linearGradient | marker | mask | path | pattern | polygon | polyline | radialGradient | rect | stop | svg | switch | symbol | text | textPath | tspan | use.