Usage
For additional information visit:
Final classes in JET
Classes in JET are generally final and do not support subclassing. At the moment, final is not enforced. However, this will likely change in an upcoming JET release.
- See:
Constructor
new DataColumnCube(rowset, layout, dataValues)
Parameters:
Name | Type | Description |
---|---|---|
rowset |
Array.<Object> | An array of objects containing attribute/value pairs. The entire array or collection will be read to group its attributes according to information given by layout and dataValues |
layout |
Array.<DataColumnCube.Layout> | An array of objects containing two properties: axis - a number representing the number of the axis of the levels; levels - a slowest-to-fastest varying ordered array of objects containing: attribute - an attribute of the rowset objects to assign to this axis and level. If the attribute is the same as that specified by labelAttr, then this level is the data value level |
dataValues |
Array.<DataColumnCube.DataValue> | an object containing the following properties: labelAttr - the rowset attribute used to group the data values in the header valueAttr - the rowset attribute used for the actual data values; (optional) defaultAggregation - the default type of CubeAggType to use to aggregate data values where necessary. If the type is 'CUSTOM' then this should be an object with a 'type' property of CubeAggType['CUSTOM'] and a 'callback' property specifying a function to call with each value. The function takes two arguments, the first being the running value for the cell being calculated, the second being the new value to be aggregated with that running value; (optional) aggregation: an array of objects containing: value - the value of labelAttr for which this aggregation should apply; aggregation - the CubeAggType for that value; if aggregation is 'CUSTOM', then a 'callback' property should be added specifying a function (for arguments see above) to call with each value (defaults to sum) |
- See:
Methods
-
getAxes : {Array.<CubeAxis>}
-
Get the CubeAxis objects in this cube
- Inherited From:
Returns:
an array of CubeAxis objects
- Type
- Array.<CubeAxis>
-
getLayout : {Array.<Object>}
-
Return the current layout used to build the cube
- Inherited From:
- See:
Returns:
current layout
- Type
- Array.<Object>
-
getValues(indices) : {Array.<CubeDataValue>|CubeDataValue}
-
Get CubeDataValues from this cube. These represent the values of the data in the "body" of the cube
Parameters:
Name Type Description indices
Array<Cube.Indices | number> an axis-ordered array of Objects or numbers. If Objects, each should contain a 'start' property (the zero based start index for the axis) and a 'count' representing the number of data values beginning at 'start' to return on this axis. This format allows the retrieval of a block of data. Passing an array of numbers alone is equivalent to passing {start: , count:1} and getting a single CubeDataValue - Inherited From:
Returns:
either an array of arrays of CubeDataValue, depending on the number of values requested in indices, or a single CubeDataValue The first subscript represents the 0th axis' values, and so on.
- Type
- Array.<CubeDataValue> | CubeDataValue
-
pivot(axisFrom, levelFrom, axisTo, levelTo, type) : {boolean}
-
Parameters:
Name Type Description axisFrom
number the axis from which to move a level levelFrom
number the level within axisFrom to move to axisTo/levelTo (zero is slowest/outermost) axisTo
number the axis to which to move levelFrom levelTo
number the level within axisTo to move the levelFrom level (zero is slowest/outermost) type
Cube.PivotType the type of pivot to perform - Inherited From:
Returns:
true if successful
- Type
- boolean
-
setPage(pin) : {undefined}
-
Set a pinned index for all axes above axis 1 ("pages")
Parameters:
Name Type Description pin
Array.<Cube.Pin> | Cube.Pin an array of objects (or a single object) containing an integer 'axis' attribute and its corresponding 'index' value (to which to pin the cube) - Inherited From:
Returns:
- Type
- undefined
Type Definitions
-
Aggregation
-
Properties:
Name Type aggregation
CubeAggType value
string -
DataValue
-
Properties:
Name Type Argument aggregation
Array.<DataColumnCube.Aggregation> <optional>
defaultAggregation
CubeAggType <optional>
labelAttr
string valueAttr
string -
Layout
-
Properties:
Name Type axis
number levels
Array.<DataColumnCube.LayoutLevels> -
LayoutLevels
-
Properties:
Name Type attribute
string