Class TimeMapDataset
- Defined in:
- timemap.js
The TimeMapDataset object holds an array of items and dataset-level options and settings, including visual themes.
Constructor
TimeMapDataset(timemap, options)
Fields
Field | |
---|---|
eventSource
:{Timeline.EventSource}
EventSource for timeline events
|
|
items
:{Array}
Array of child TimeMapItems
|
|
opts
:{Object}
Container for optional settings passed in the "options" parameter
|
|
Reference to parent TimeMap
|
|
visible
:{Boolean}
Whether the dataset is visible
|
Methods
Method | |
---|---|
changeTheme(theme)
Change the theme for every item in a dataset
|
|
clear()
Delete all items, clearing them from map and timeline
|
|
deleteItem(item)
Delete one item, clearing it from map and timeline
|
|
each(f)
Run a function on each item in the dataset.
|
|
getItems(index)
Return an array of this dataset's items
|
|
getTitle()
Return the title of the dataset
|
|
hide()
Hide dataset
|
|
loadItem(data, transform)
Add one item to map and timeline.
|
|
loadItems(data, transform)
Add an array of items to the map and timeline.
|
|
show()
Show dataset
|
Class Detail
TimeMapDataset(timemap, options)
Parameters (optional) | ||
---|---|---|
timemap | {TimeMap} | Reference to the timemap object |
options | {Object} | Object holding optional arguments |
options.id | {String} | Key for this dataset in the datasets map |
options.title | {String} | Title of the dataset (for the legend) |
options.theme | {String|TimeMapTheme} | Theme settings. |
options.dateParser | {String|Function} | Function to replace default date parser. |
options.noEventLoad | {Boolean} |
Whether to skip loading events on the timeline
Default: false
|
options.noPlacemarkLoad | {Boolean} |
Whether to skip loading placemarks on the map
Default: false
|
options.infoTemplate | {String} | HTML for the info window content, with variable expressions (as "{{varname}}" by default) to be replaced by option data |
options.templatePattern | {String} | Regex pattern defining variable syntax in the infoTemplate |
options[...] | {mixed} | Any of the options for TimeMapItem or TimeMapTheme may be set here, to cascade to the dataset's objects, though they can be overridden at the TimeMapItem level |
Field Details
eventSource
:{Timeline.EventSource}
EventSource for timeline events
items
:{Array}
Array of child TimeMapItems
opts
:{Object}
Container for optional settings passed in the "options" parameter
timemap
:{TimeMap}
Reference to parent TimeMap
visible
:{Boolean}
Whether the dataset is visible
Method Details
changeTheme(theme)
Change the theme for every item in a dataset
Parameters (optional) | ||
---|---|---|
theme | {TimeMapTheme|String} | New theme, or string key in TimeMap.themes |
- Defined in:
- manipulation.js
clear()
Delete all items, clearing them from map and timeline
- Defined in:
- manipulation.js
deleteItem(item)
Delete one item, clearing it from map and timeline
Parameters (optional) | ||
---|---|---|
item | {TimeMapItem} | Item to delete |
- Defined in:
- manipulation.js
each(f)
Run a function on each item in the dataset. This is the preferred
iteration method, as it allows for future iterator options.
Parameters (optional) | ||
---|---|---|
f | {Function} | The function to run |
Return an array of this dataset's items
Parameters (optional) | ||
---|---|---|
index | {Number} | Index of single item to return |
- Returns:
- {TimeMapItem[]} Single item, or array of all items if no index was supplied
getTitle()
:{String}
Return the title of the dataset
- Returns:
- {String} Dataset title
hide()
Hide dataset
- Defined in:
- manipulation.js
Add one item to map and timeline.
Each item has both a timeline event and a map placemark.
Parameters (optional) | ||
---|---|---|
data | {Object} | Data to be loaded - see the TimeMapItem constructor for details |
transform | {Function} | If data is not in the above format, transformation function to make it so |
- Returns:
- {TimeMapItem} The created item (for convenience, as it's already been added)
- See:
- TimeMapItem
loadItems(data, transform)
Add an array of items to the map and timeline.
Parameters (optional) | ||
---|---|---|
data | {Object[]} | Array of data to be loaded |
transform | {Function} | Function to transform data before loading |
show()
Show dataset
- Defined in:
- manipulation.js
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)