While options are available for animating two-dimensional SVG graphics, it is currently simpler just to render the graphic repeatedly with updated parameters. This aspect of the library is left for possible future revision.
The situation with three-dimensional graphics is quite the opposite, since there is already significant overhead in initially loading scenes with current rendering options. The following animation options and suboptions are available for individual objects with the Three.js renderer:
rotation | axis | three-dimensional array of normal vector |
angle | number setting rotation rate |
translation | path | string of three-dimensional array of functions |
step | number setting translation rate | |
argument | defaults to 't' |
Suboptions are input as JavaScript dictionaries under the given option.
The vector determining the translation path
must be entered as a string because JSON cannot process functions. The argument
suboption can be used to specify a variable other than time.
Functions that are not part of standard JavaScript can be included with this command after evaluate()
in the cell template:
injectFunctions( id, { name1: function1, name2: function2, … } )
The name keys are the function names used in the context window of the visualization and their values are references to the function implementations. Only functions explicitly called need to be included: JavaScript automatically handles internal dependencies. For multiple outputs a third argument can specify the number of the target output.
Animations are initiated by setting animate
equal to true
in the output configuration. Animations by default pause for five seconds when the user interacts with the scene, but this can be overridden by setting animateOnInteraction
to true
.
Objects and surfaces can be assigned a group
name in their options
dictionaries for common animation operations.