Class: DataValueAttributeCube

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav


DataValueAttributeCube 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.DataValueAttributeCube 
})

Description

Creates an object used to convert rowset data into grouped "cubic" data
See:

Constructor

new DataValueAttributeCube(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.DataValueAttributeCube.Layout> An array of objects containing two properties: axis - a number representing the number of the axis for of the levels; levels - a slowest-to-fastest varying ordered array of objects containing one or two properties: attribute - an attribute of the rowset objects or oj.Models to assign to this axis and level, or dataValue:true to indicate that this axis and level is the position of the data values
dataValues Array.<oj.DataValueAttributeCube.DataValue> an array of objects containing these properties: attribute - the name of an attribute in the rowset representing data; (optional) label - a display label to use for this data attribute; (optional) aggregation - the oj.CubeAggType for this data value attribute (defaults to sum). If the type is 'CUSTOM' then a 'callback' property should be specified which is 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
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
attribute string
label string <optional>
aggregation oj.CubeAggType <optional>

Layout

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

LayoutLevels

Properties:
Name Type Argument
attribute string <optional>
dataValue boolean <optional>