Class: AnimationDirector

AnimationDirector(mappingFileHeaders, mappingFileData, coordinatesData, gradientCategory, trajectoryCategory, Positive) → {AnimationDirector}

AnimationDirector

This object represents an animation director, as the name implies, is an object that manages an animation. Takes the for a plot (mapping file and coordinates) as well as the metadata categories we want to animate over. This object gets called in the main emperor module when an animation starts and an instance will only be alive for one animation cycle i. e. until the cycle hits the final frame of the animation.

Constructor

new AnimationDirector(mappingFileHeaders, mappingFileData, coordinatesData, gradientCategory, trajectoryCategory, Positive) → {AnimationDirector}

Parameters:
Name Type Description
mappingFileHeaders Array.<String>

an Array of strings containing metadata mapping file headers.

mappingFileData Array.<Object>

an Array where the indices are sample identifiers and each of the contained elements is an Array of strings where the first element corresponds to the first data for the first column in the mapping file (mappingFileHeaders).

coordinatesData Array.<Object>

an Array of Objects where the indices are the sample identifiers and each of the objects has the following properties: x, y, z, name, color, P1, P2, P3, ... PN where N is the number of dimensions in this dataset.

gradientCategory String

a string with the name of the mapping file header where the data that spreads the samples over a gradient is contained, usually time or days_since_epoch. Note that this should be an all numeric category.

trajectoryCategory String

a string with the name of the mapping file header where the data that groups the samples is contained, this will usually be BODY_SITE, HOST_SUBJECT_ID, etc..

Positive speed

real number determining the speed of an animation, this is reflected in the number of frames produced for each time interval.

Source:
Throws:

Note that this class will raise an Error in any of the following cases:

  • One of the input arguments is undefined.
  • If gradientCategory is not in the mappingFileHeaders.
  • If trajectoryCategory is not in the mappingFileHeaders.
Type
Error
Returns:

returns an animation director if the parameters passed in were all valid.

Type
AnimationDirector

Members

coordinatesData :Array.<Object>

an Array of Objects where the indices are thesample identifiers and each of the objects has the following properties:x, y, z, name, color, P1, P2, P3, ... PN where N is the number ofdimensions in this dataset.

Type:
  • Array.<Object>
Source:

gradientCategory :String

a string with the name of the mapping fileheader where the data that spreads the samples over a gradient iscontained, usually time or days_since_epoch. Note that this should be anall numeric category

Type:
  • String
Source:

mappingFileData :Array.<Object>

an Array where the indices are sample identifiersand each of the contained elements is an Array of strings where the firstelement corresponds to the first data for the first column in the mappingfile (mappingFileHeaders).

Type:
  • Array.<Object>
Source:

mappingFileHeaders :Array.<String>

mappingFileHeaders an Array of strings containing metadata mapping file headers.

Type:
  • Array.<String>
Source:

maximumTrajectoryLength :Integer

Maximum length the groups of samples have along a gradient.

Type:
  • Integer
Default Value:
  • null
Source:

minimumDelta :Float

A floating point value determining what the minimum separation betweensamples along the gradients is. Will be null until it is initialized tothe values according to the input data.

Type:
  • Float
Default Value:
  • null
Source:

previousFrame :Integer

The previous frame served by the director

Type:
  • Integer
Source:

speed :Float

How fast should the animation run, has to be a postive non-zero value.

Type:
  • Float
Source:

trajectories :Array

Array where each element in the trajectory is a trajectory with theinterpolated points in it.

Type:
  • Array
Source:

trajectoryCategory :String

a string with the name of the mapping fileheader where the data that groups the samples is contained, this willusually be BODY_SITE, HOST_SUBJECT_ID, etc..

Type:
  • String
Source:

Methods

animationCycleFinished() → {bool}

Check whether or not the animation cycle has finished for this object.

Source:
Returns:

True if the animation has reached it's end and False if the animation still has frames to go.

Type
bool

getMaximumTrajectoryLength() → {Integer}

Retrieves the lengths of all the trajectories and figures out which of them is the longest one, then assigns that value to the maximumTrajectoryLength property.

Source:
Returns:

Maximum trajectory length

Type
Integer

initializeTrajectories()

Initializes the trajectories that the director manages.

Source:

updateFrame()

Helper method to update the value of the currentFrame property.

Source: