-
Notifications
You must be signed in to change notification settings - Fork 44
Genoverse.Track functions
The following are functions that exist in the Genoverse.Track
object. Any of these can have before/after hooks added to them unless otherwise specified, or be overwritten by supplying them as properties in configuration.
The following functions are called during track creation and do not have before/after hooks.
Creates a
track._interface
object which is used to determine whether properties and functions belong to the track's model, view, or controller
Sets initial properties of the track instance
If
track.defaultConfig
is defined, uses it to set the current config, and add the correct settings to the track
Can be used to add events to the instance of Genoverse with
genoverse.on
if required by a particular type of track.By default does nothing - must be implemented.
Finds numerical keys in the track definition, and uses them to create a
track.lengthMap
array containingGenoverse.Track.Model
andGenoverse.Track.View
instances as required.
track.lengthMap
is in the form[ [ 1, { model: modelInstance1, view: viewInstance1 } ], [ 1000, { model: modelInstance1000, view: viewInstance1000 } ], ... ]where the first element in each array is the relevant numerical key.
Also creates
track.models
andtracks.views
objects in the formtrack.models = { 1: modelInstance1, 1000: modelInstance1000, ... } track.views = { 1: viewInstance1, 1000: viewInstance1000, ... }Called once during track initalization. Does not have before/after hooks.
Creates the instance of
Genoverse.Track.Controller
required by the track the first time it is called.Sets the model and view of a track, based on the current size of the browser region, determined by calling
track.getSettingsForLength
.
Returns a new instance of a
Genoverse.Track.Model
,Genoverse.Track.View
, orGenoverse.Track.Controller
Argument Type Description object Genoverse.Track.Model
,Genoverse.Track.View
orGenoverse.Track.Controller
classThe class to be instantiated functions Object or undefined
An object whose values are functions to be overwritten in the instance properties Object or undefined
An object whose values are non-function properties to be overwritten in the instance
Returns the value of
track.lengthMap
with the lowest first element value which is less that the current size of the browser region
See the api documentation
Returns the name of the current
track.configSetting
in use for the giventype
of config
Argument Type Description type String The type of config setting
See the api documentation
See the api documentation
See the api documentation
See the api documentation
Sets
track.height
. If the track needs to be hidden,track.height
will be set to0
.
Argument Type Description height Integer The new height for the track forceShow Boolean or undefined
If true
,height
will be used even if the track would normally be hidden
See the api documentation
Creates a
Genoverse.Track.Legend
instance for the track, based ontrack.legend
, adding it to the browser.
See the api documentation
See the api documentation