Animator classes

Copyright 2012, Lance Larsen
Licensed under the MIT license

Uses flot/jquery.flot.js

Summary
Animator classes
AnimatorStores a list of animated objects and animates them based on a parameter value.
Functions
Animator
addAnimatedAdd an Animated object to the list of animations.
pushAdd an Animated object or create and add an Animated object from the input.
unshiftAdd an Animated object or create and add an Animated object from the input.
killSignal to end the animation.
animateRun the animation
plotSet the parameter for each of the animations and plot the results.
AnimatedPlots that support animation.
Functions
AnimatedMake a new Animated object
setParamSlice the data based on a parameter value.
GlobalGlobally available functions
Functions
typeOfAn extended ‘typeof’ operator.

Animator

Stores a list of animated objects and animates them based on a parameter value.

Summary
Functions
Animator
addAnimatedAdd an Animated object to the list of animations.
pushAdd an Animated object or create and add an Animated object from the input.
unshiftAdd an Animated object or create and add an Animated object from the input.
killSignal to end the animation.
animateRun the animation
plotSet the parameter for each of the animations and plot the results.

Functions

Animator

PARAMETERS

canvasThis is a jquery element where the Animated plots will be renedered.

addAnimated

Add an Animated object to the list of animations.  The Animated object doesn’t need to be derived from the Animated class, but need to have a function ‘setParam(param)’ and needs to be a ‘flot’ plotable object (i.e. it should contain a ‘data’ parameter at least).

PARAMETERS

animAn Animated object to add to the list

push

Add an Animated object or create and add an Animated object from the input.  The input should be a value compatible with the Animated constructor.

PARAMETERS

inputAn Animated object, or Animated constructor parameter.

unshift

Add an Animated object or create and add an Animated object from the input.  The input should be a value compatible with the Animated constructor.  The oject is added at the front of the array.

PARAMETERS

inputAn Animated object, or Animated constructor parameter.

kill

Signal to end the animation.

animate

Run the animation

PARAMETERS

fromInitial parameter value for animation
toFinal parameter value for animation
timeApproximate time for the animation to run

plot

Set the parameter for each of the animations and plot the results.

PARAMETERS

paramThe parameter value

Animated

Plots that support animation.

Summary
Functions
AnimatedMake a new Animated object
setParamSlice the data based on a parameter value.

Functions

Animated

Make a new Animated object

PARAMETERS

plotinfoAn object containing the values used for a plot.  Parameters consistent with the ‘flot’ plot command are accepted.  The ‘data’ parameter is required.  A ‘param’ field is required as well.  The ‘param’ field should be an array with the same length as the ‘data’ array, and should contain a numeric parameter value associated with the associated ‘data’ array index.  The parameter array should be monotonically increasing or decreasing.

setParam

Slice the data based on a parameter value.

PARAMETERS

paramvalThe parameter value that is used to slice the plot data

Global

Globally available functions

Summary
Functions
typeOfAn extended ‘typeof’ operator.

Functions

typeOf

An extended ‘typeof’ operator.

PARAMETERS

valueThe value to test the type of.

RETURNS

The value type.  The standard types are supported.  Array types are checked for, and ‘array’ is returned insteady of ‘object’.  If an object includes a ‘type’ field, this value is returned.

Plots that support animation.
Close