Module.RavelDataCube

A RavelDataCube is a Ravel that has a DataCube object.

Usage:
var ravel=new Module.RavelDataCube

Properties:
dc
The DataCube object
output
The output hyperslice of type RawData

Methods:
dimension(labelsVector)
Labels vector is a javascript array of objects describing an axis handle:
{
  axis: "axis name",
  slice: ["sliceLabel1",..."sliceLabeln"]
}
loadData(data)
load the datacube from a sparse array of data. The data object has the following structure:
  {
    dimension: {
      axis: string,
      slice: string[]
     } [],
    data: number[]
  }
Each dimension element describes an axis of the datacube, with the slice array containing the slice labels. Each element of the datacube is indexed by the combining the indices of the relevant slices, in order given by the dimension array. data is an array of (index,value) pairs, describing the data in a sparse format.
hyperSlice()
Sets the output property to contain the output data of the ravel in its current state (data slice).
setDataCallback(f)
Sets a callback function for the populateData() call. This is only useful for rank 2 ravels. f has signature
var f=function(idx,v) {var col=idx[0], row=idx[1];...}
where idx is an array of indices along the output handles (0-based), and v is the output value at that location. This function will only be called if a value exists at that location. The above example shows decoding a rank 2 ravel, which is currently all that is supported.
populateArray()
Computes the hyperslice for a rank 2 ravel, call the callback function for all output values.

Ravelation Pty Ldt