blob: dc03724a622e677e18a08f0764c6a57f91ad3582 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
---
title: calcMode
slug: Web/SVG/Attribute/calcMode
translation_of: Web/SVG/Attribute/calcMode
---
<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG Attribute reference home</a></p>
<p>This attribute specifies the interpolation mode for the animation. The default mode is <strong>linear</strong>, however if the attribute does not support linear interpolation (e.g. for strings), the <code>calcMode</code> attribute is ignored and discrete interpolation is used.</p>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table"> <tbody> <tr> <th scope="row">Categories</th> <td>Animation value attribute</td> </tr> <tr> <th scope="row">Value</th> <td>discrete | linear | paced | spline</td> </tr> <tr> <th scope="row">Animatable</th> <td>No</td> </tr> <tr> <th scope="row">Normative document</th> <td><a class="external" href="http://www.w3.org/TR/SVG/animate.html#CalcModeAttribute" title="http://www.w3.org/TR/SVG/animate.html#CalcModeAttribute">SVG 1.1 (2nd Edition)</a></td> </tr> </tbody>
</table>
<dl> <dt>discrete</dt> <dd>This specifies that the animation function will jump from one value to the next without any interpolation.</dd> <dt>linear</dt> <dd>Simple linear interpolation between values is used to calculate the animation function. Except for {{ SVGElement("animateMotion") }}, this is the default value.</dd> <dt>paced</dt> <dd>Defines interpolation to produce an even pace of change across the animation. This is only supported for values that define a linear numeric range, and for which some notion of "distance" between points can be calculated (e.g. position, width, height, etc.). If paced is specified, any {{ SVGAttr("keyTimes") }} or {{ SVGAttr("keySplines") }} will be ignored. For {{ SVGElement("animateMotion") }}, this is the default value.</dd> <dt>spline</dt> <dd>Interpolates from one value in the {{ SVGAttr("values") }} list to the next according to a time function defined by a cubic Bézier spline. The points of the spline are defined in the {{ SVGAttr("keyTimes") }} attribute, and the control points for each interval are defined in the {{ SVGAttr("keySplines") }} attribute.</dd>
</dl>
<h2 id="Example">Example</h2>
<h2 id="Elements">Elements</h2>
<p>The following elements can use the <code>calcMode</code> attribute</p>
<ul> <li>{{ SVGElement("animate") }}</li> <li>{{ SVGElement("animateColor") }}</li> <li>{{ SVGElement("animateMotion") }}</li> <li>{{ SVGElement("animateTransform") }}</li>
</ul>
|