Class: DataColumnCube

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav


DataColumnCube extends oj.Cube

Version:
  • 7.1.0
Since:
  • 1.1.0
Module:
  • ojcube

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojcube'], function(cube) {
 // Application should call API on cube.DataColumnCube 
})

Description

Creates an object used to convert rowset data into grouped "cubic" data, where the data values are specified by a single attribute within the rowset (dataValues.labelAttr) and their header values designated by another rowset attribute (dataValues.valueAttr).
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.<oj.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.<oj.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 oj.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 oj.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 oj.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.<oj.CubeAxis>}

Get the oj.CubeAxis objects in this cube
Inherited From:
Returns:
an array of oj.CubeAxis objects
Type
Array.<oj.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.<oj.CubeDataValue>|oj.CubeDataValue}

Get oj.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 oj.CubeDataValue
Inherited From:
Returns:
either an array of arrays of oj.CubeDataValue, depending on the number of values requested in indices, or a single oj.CubeDataValue The first subscript represents the 0th axis' values, and so on.
Type
Array.<oj.CubeDataValue> | oj.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 oj.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.<oj.Cube.Pin> | oj.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
value string
aggregation oj.CubeAggType

DataValue

Properties:
Name Type Argument
valueAttr string
labelAttr string
defaultAggregation oj.CubeAggType <optional>
aggregation Array.<oj.DataColumnCube.Aggregation> <optional>

Layout

Properties:
Name Type
axis number
levels Array.<oj.DataColumnCube.LayoutLevels>

LayoutLevels

Properties:
Name Type
attribute string