Constructor
new Object(options)
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,
|
Returns:
A new Data.Import object
Methods
error(function(errorText))
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))
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