Class TimeMap.loaders.base
- Defined in:
- timemap.js
Abstract loader class. All loaders should inherit from this class.
Constructor
TimeMap.loaders.base(options)
Fields
Field | |
---|---|
scrollTo
:{String|Date}
Date to scroll the timeline to on load
|
Methods
Method | |
---|---|
cancel()
Cancel the callback function for this loader.
|
|
getCallback(dataset, callback)
Get a callback function that can be cancelled.
|
|
getCallbackName(dataset, callback)
Get the name of a callback function that can be cancelled.
|
|
parse()
Parser function to turn a string into a JavaScript array
|
|
preload()
Function to call on data object before loading
|
|
Function to call on a single item data object before loading
|
Class Detail
TimeMap.loaders.base(options)
Parameters (optional) | ||
---|---|---|
options | {Object} | All options for the loader |
options.parserFunction | {Function} |
Parser function to turn a string into a JavaScript array
Default: Do nothing
|
options.preloadFunction | {Function} |
Function to call on data before loading
Default: Do nothing
|
options.transformFunction | {Function} |
Function to call on individual items before loading
Default: Do nothing
|
options.scrollTo | {String|Date} |
Date to scroll the timeline to in the default callback
(see TimeMap#parseDate for accepted syntax)
Default: earliest
|
Field Details
scrollTo
:{String|Date}
Date to scroll the timeline to on load
- Default Value:
- "earliest"
Method Details
cancel()
Cancel the callback function for this loader.
getCallback(dataset, callback)
:{Function}
Get a callback function that can be cancelled. This is a convenience function
to be used if the callback name itself is not needed.
Parameters (optional) | ||
---|---|---|
dataset | {TimeMapDataset} | Dataset to load data into |
callback | {Function} | User-supplied callback function |
- Returns:
- {Function} The configured callback function
- See:
- TimeMap.loaders.base#getCallbackName
getCallbackName(dataset, callback)
:{String}
Get the name of a callback function that can be cancelled. This callback applies the parser,
preload, and transform functions, loads the data, then calls the user callback
Parameters (optional) | ||
---|---|---|
dataset | {TimeMapDataset} | Dataset to load data into |
callback | {Function} | User-supplied callback function. If no function is supplied, the default callback will be used |
- Returns:
- {String} The name of the callback function in TimeMap.loaders.cb
parse()
:{Object[]}
Parser function to turn a string into a JavaScript array
- Returns:
- {Object[]} Array of item data
preload()
:{Object[]}
Function to call on data object before loading
- Returns:
- {Object[]} Array of item data
transform()
:{Object}
Function to call on a single item data object before loading
- Returns:
- {Object} Transformed data for one item
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:07 GMT-0700 (PDT)
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:07 GMT-0700 (PDT)