Class TimeMap.loaders.json_string
- Extends:
- TimeMap.loaders.remote
- Requires:
- lib/json2.pack.js
- Defined in:
- json.js
JSON string loader factory - expects a plain JSON array.
The json_string loader assumes an array of items in plain JSON, with no callback function - this will require a local URL.
Note that this loader requires lib/json2.pack.js.
TimeMap.init({ datasets: [ { title: "JSON String Dataset", type: "json_string", options: { url: "mydata.json" // Must be a local URL } } ], // etc... });
Constructor
TimeMap.loaders.json_string(options)
Fields
Field | |
---|---|
![]() |
scrollTo
:{String|Date}
Date to scroll the timeline to on load
|
![]() |
url
:{String}
URL to load
|
Methods
Method | |
---|---|
![]() |
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.
|
![]() |
load(dataset, callback)
Load function for remote files.
|
parse(json)
Parse a JSON string into a JavaScript object, using the json2.js library.
|
|
![]() |
preload()
Function to call on data object before loading
|
![]() |
Function to call on a single item data object before loading
|
Class Detail
TimeMap.loaders.json_string(options)
Parameters (optional) | ||
---|---|---|
options | {Object} | All options for the loader |
options.url | {String} | URL of JSON file to load |
options[...] | {mixed} | Other options (see TimeMap.loaders.remote) |
Method Details
parse(json)
:{Object}
Parse a JSON string into a JavaScript object, using the json2.js library.
Parameters (optional) | ||
---|---|---|
json | {String} | JSON string to parse |
- Returns:
- {Object} Parsed JavaScript object
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Thu Jun 24 2010 13:58:02 GMT-0700 (PDT)
Documentation generated by JsDoc Toolkit 2.3.2 on Thu Jun 24 2010 13:58:02 GMT-0700 (PDT)