GMA Animation

Functions and classes used to animation the Generalized 1-D mode.

Copyright 2012, Lance Larsen
Licensed under the MIT license

Uses Animate.js

Summary
GMA AnimationFunctions and classes used to animation the Generalized 1-D mode.
GlobalGlobally accessible functions.
Functions
AnimatedGMAPlotFactoryThis generates a factory function that is used by the GMAmode object.
wrapColorsArrayMakes a colors array into an object with ‘next’ if needed.
ColorSwitcherThis class allows you to switch the color set that is used to plot animation curves.
Functions
ColorSwitcherCreates a new ColorSwitcher object.
ContourMorphThis class animates a single contour
Functions
ContourMorphCreates a new ContourMorph object.
setParamSets the contour plot based on the value of the parameter.

Global

Globally accessible functions.

Summary
Functions
AnimatedGMAPlotFactoryThis generates a factory function that is used by the GMAmode object.
wrapColorsArrayMakes a colors array into an object with ‘next’ if needed.

Functions

AnimatedGMAPlotFactory

This generates a factory function that is used by the GMAmode object.

PARAMETERS

colorsAn array of colors, or an object with a ‘next’ function that returns the next plot color to use each time ‘next’ is called.

RETURNS

A factory function is returned that is called as

factory(gmaobj, stepn, contour)

where ‘gmaobj’ is a GMAmode object, ‘stepn’ is the index used to get the contour, and ‘contour’ is an object with field ‘t’ and ‘pts’.  Both are arrays of the same size, with ‘t’ being the parameter value, and ‘pts’ the associated ODE solution points.

wrapColorsArray

Makes a colors array into an object with ‘next’ if needed.

PARAMETERS

colorsAn array of colors, or an object with a ‘next’ function that returns the next color each time next is called.

RETURNS

If an array of colors is passed to AnimatedGMAPlotFactory this will return a new object that wraps the array and includes a ‘next’ function that is used to loop through the colors.

ColorSwitcher

This class allows you to switch the color set that is used to plot animation curves.  Color sets are passed to the constructor along with the name of the initial set.

Summary
Functions
ColorSwitcherCreates a new ColorSwitcher object.

Functions

ColorSwitcher

Creates a new ColorSwitcher object.

PARAMETERS

colorSetsAn object with all the colors sets, which are arrays with different color values defined (such as {myclrs:[“#edc240”,...]})
initialSetThe name of the initial set of colors to use.

ContourMorph

This class animates a single contour

Summary
Functions
ContourMorphCreates a new ContourMorph object.
setParamSets the contour plot based on the value of the parameter.

Functions

ContourMorph

Creates a new ContourMorph object.

PARAMETERS

gmaobjA GMA object to get the contour from
plotinfo’flot’ plot params to add to the plot

setParam

ContourMorph.prototype.setParam = function(param)

Sets the contour plot based on the value of the parameter.

PARAMETERS

paramThe value of the parameter (t).
Creates a new GMA model object.
ContourMorph.prototype.setParam = function(param)
Sets the contour plot based on the value of the parameter.
This generates a factory function that is used by the GMAmode object.
Close