<animateFromSequence/>
<animateFromSequence/> is a General Operator component
that renders an animation of a changing component over a specified interval of uniform steps.
Attributes and Properties
Attributes for <animateFromSequence>
Other (11)
allowAdjustmentsWhileRunningboolean. Default value: false. Whether sequence parameters can be adjusted while the animation is running.
number. Default value: 1000. Time in milliseconds between successive animation steps.
keyword. How the animation steps through the sequence.
| Value | Description |
|---|---|
increase (default) | Step through values from first to last, looping back to the start. |
decrease | Step through values from last to first, looping back to the end. |
increase once | Step from first to last and stop without looping. |
decrease once | Step from last to first and stop without looping. |
oscillate | Step from first to last, then reverse direction at each end. |
boolean. Default value: false. Whether the animation is currently playing.
_componentListWithSelectableType. Values to exclude from the sequence.
_componentWithSelectableType. The first value in the sequence.
integer. The number of values in the sequence.
math. The increment between successive values in the sequence.
reference. Reference to the state variable that will be animated.
_componentWithSelectableType. The last value in the sequence. Used together with from to determine length when length is not specified.
typekeyword. The kind of values in the sequence.
| Value | Description |
|---|---|
number | A sequence of numeric values. |
math | A sequence of math expressions (allows symbolic from/to/step). |
letters | A sequence of letters (single-letter or multi-letter labels). |
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <animateFromSequence name="a">
Other (11)
$a.allowAdjustmentsWhileRunningboolean. Whether sequence parameters can be adjusted while the animation is running.
$a.animationIntervalnumber. Time in milliseconds between successive animation steps.
$a.animationModetext. How the animation steps through the sequence.
$a.animationOnboolean. Whether the animation is currently playing.
text. Current direction of the animation ("increase" or "decrease"; flips during oscillation).
$a.disabledboolean. Whether this component is disabled and cannot be interacted with.
$a.fixedboolean. Whether this component's value is fixed and cannot be modified.
$a.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
number. Index of the currently selected value in the sequence (1-based).
$a.valueThe currently selected value of the animation.
Common to all components (4)
$a.doenetMLtext. The DoenetML source code that produced this component.
$a.hideboolean. Whether to hide this component from the rendered output.
$a.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$a.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Animated counting
The <animateFromSequence/> component is used to animate a <number> over a sequence of values from 1 to 20.
Example: Animation with start/stop button
A <callAction> component references a named <animateFromSequence /> with
the actionName set to toggleAnimation.
Example: Animated circle radius
The <animateFromSequence /> component is used to animate the radius of a <circle> where
the radius has been defined as a <number/> over a sequence of values from 0 to 10.
Example: Point moving along a function
The <animateFromSequence /> component is used to animate the -coordinate of a
point which has been defined as a <number/> over a sequence of values from -9 to 9.
The -coordinate of the point is defined with the function evaluation reference $$f(x).
Attribute Examples
Attribute Example: target
The target attribute is used to specify the value to animate. Since points have a
numerical property corresponding to their -coordinate, this value can be animated directly
without having to define a separate <number/>.
Attribute Example: animationOn
The animationOn attribute is used to specify the current state of the animation.
This attributes takes a boolean value or an expression which evaluates to a boolean. In this particular example
the boolean value is specified by the user with a <booleanInput/>.
Attribute Example: animationMode
The animationMode attribute is used to specify the directional behavior of the animation.
Valid values for the input text are: increase, increase once, decrease, decrease once, and oscillate.
The default value is increase.
Attribute Example: animationInterval
The -coordinate of two points are both animated with the <animateFromSequence /> component,
and the user must specify the input value for the animationInterval attribute for each point.
The length of the animationInterval governs the amount of time elapsed between successive steps
of the animation sequence. The default value is 1000 ms.
Attribute Example: type=“letters”
The type attribute takes either “letters” or “number” as a text input.
If unspecified, the default type is “number”.
Attribute Example: length
The length attribute specifies the length, in number of terms, of the animation sequence.
Attribute Example: from, to
The from and to attributes specify
the starting and ending values in the animation sequence.
Attribute Example: step
The step attribute specifies the size of each increment in the animation sequence.
The default step is .
Attribute Example: exclude
The exclude attribute specifies values to exclude in the animation sequence.
Property Examples
Property Example: Attributes as properties
The above listed <animateFromSequence/> attributes are also accessible as properties.
Property Example: value
The value property of the <animateFromSequence/> component
renders the current sequence value of the animation target.
Property Example: currentAnimationDirection
The currentAnimationDirection property of the <animateFromSequence/> component
renders the current direction of the animation; i.e. whether the sequence values are increasing or decreasing.
Property Example: selectedIndex
The selectedIndex property returns the index number of the current sequence value.