Class TimeMap.loaders.metaweb
- Extends:
- TimeMap.loaders.jsonp
- Requires:
- lib/json2.pack.js
- loaders/jsonp.js
- Defined in:
- metaweb.js
- See:
- Metaweb Example
Metaweb loader: Load data from freebase.com.
This is a loader for data from the Metaweb service at freebase.com. See the API documentation at http://www.freebase.com/docs/mql/ch01.html for a description of how to write MQL queries. This code is based on code from the API site.
TimeMap.init({ datasets: [ { title: "Freebase Dataset", type: "metaweb", options: { query: [ { // query here - see Metaweb API } ], transformFunction: function(data) { // map returned data to the expected format - see // http://code.google.com/p/timemap/wiki/JsonFormat return data; } } } ], // etc... });
Constructor
TimeMap.loaders.metaweb(options)
Fields
Field | |
---|---|
opts
:{String}
Object to hold optional settings.
|
|
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.
|
|
load(dataset, callback)
Load function for remote files.
|
|
parse()
Parser function to turn a string into a JavaScript array
|
|
preload()
Preload function for Metaweb
|
|
Function to call on a single item data object before loading
|
Class Detail
TimeMap.loaders.metaweb(options)
Parameters (optional) | ||
---|---|---|
options | {Object} | All options for the loader |
options.query | {Object} | MQL query to load |
options.transformFunction | {Function} | Function to call on individual items before loading |
options.host | {String} |
Host url of web service
Default: http://www.freebase.com
|
options.service | {String} |
Path to web service on host
Default: /api/service/mqlread
|
options[...] | {mixed} | Other options (see TimeMap.loaders.jsonp) |
Method Details
preload()
:{Array}
Preload function for Metaweb
- Returns:
- {Array} data Array of item data
©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)