Object

Object

It realizes an object to load and handle internal (already defined as JavaScript object) data sources (CSV,JSON,...)

Constructor

new Object(options)

Source:
Create a new Data.Object instance.
Example
// load the data table defined by a JSON object named response and get the values of one column 

Data.object({"source":response,"type":"json"}).import(function(mydata){
    var a = mydata.column("column name").values();
    ...
});
Parameters:
Name Type Description
options Object

{ source: JavaScript object,

typedescription
"csv"the source is 'plain text' formatted as Comma Separated Values
delimiter supported: , and ;
"json"the source is JSON (Javascript Object Notation)
"geojson"the source is a JSON object formatted in GeoJson
"rss"the source is an xml rss feed
"kml"the source is in Keyhole Markup Language
Returns:
A new Data.Import object

Methods

error(function(errorText))

Source:
error function define a function to handle a loading error
Parameters:
Name Type Description
function(errorText) function a user defined function to call when an error occurs
Returns:
itself

import(function(result))

Source:
set data from the specified source and call user function
Parameters:
Name Type Description
function(result) function the function to call when data is successfully imported
the argument passed is a Data.Table object with the imported data
Returns:
itself