Class: TableGroup

data.vis. TableGroup

Creates a table group by ordering the headings and rows in the most economical way
Fixes dimensions with only one value


new TableGroup(sdmxjson)

Parameters:
Name Type Description
sdmxjson

Methods


getDimensionIdsBySize()

Returns an array of dimension ids by size - the order is max first

Returns:

Array|Integer


getHeaderLength()

Returns the number of Dimensions that make up the Header


getHeadingIndex(dimId)

Returns the index of the dimension in the header, or -1 if it is not in the header.
0 indicates uppermost header

Parameters:
Name Type Description
dimId string

the Dimension Id

Returns:
Type
number

getRowIndex(dimId)

Returns the index position of the dimension in the row, or -1 if it is not in the header. 0 indicates leftmost row.

Parameters:
Name Type Description
dimId string

the Dimension Id

Returns:
Type
Number

getRowLength()

Returns the number of Dimensions that make up the Rows


moveDown(dimId)

Moves down in the heading menu, or to the rows if there are no more headings to move down

Parameters:
Name Type Description
dimId string

the Id of the Dimension to move


moveLeft(dimId)

Moves left in the heading menu.

If the Dimension is already in a table Row it will move it to the left, if the Dimension is in the Header it will be moved to the Row (the far most right)

Parameters:
Name Type Description
dimId string

the Id of the Dimension to move


moveRight(dimId)

Moves right in the heading menu.

If the Dimension is already in a table Row it will move it to the right

Parameters:
Name Type Description
dimId string

the Id of the Dimension to move


moveToSlice(dimId, codeId)

Moves the Dimension to the slice and sets the slice value

Parameters:
Name Type Description
dimId string

the Dimension Id of the slice to move

codeId string

the id of the code to set the slice to


moveUp(dimId)

Moves up in the heading menu, if the Dimension is in a Row it will be pushed onto the Header as the bottom most element

Parameters:
Name Type Description
dimId string

the Id of the Dimension to move


removeFromHeading(dimId)

Removes the dimension from the table heading

Parameters:
Name Type Description
dimId string

the Dimension Id


removeFromRow(dimId)

Removes the dimension from the table row

Parameters:
Name Type Description
dimId string

the Dimension Id


removeFromSlice(dimId)

Removes the dimension from the slice

Parameters:
Name Type Description
dimId string

the Dimension Id


setProperties( [header] [, rows] [, slice])

Sets the header rows and slice for the pivot table

Parameters:
Name Type Argument Description
header string <optional>

array of dimension ids in the order for the table header

rows string <optional>

array of dimension ids in order for the table rows

slice string <optional>

array of objects { "DimId" : "DimValue" } to define the slices

Example
var header = ["FREQ", "TIME_PERIOD"]
var rows = ["REF_AREA"]
var slice = [{"SEX", "M"}, {"SERIES", "EMP"}]

tableGroup.setProperties(header, rows, slice)

setSliceValue(dimId)

Returns true if the dimension is in the cross section (fixed)

Parameters:
Name Type Description
dimId

setSliceValue(dimId, codeId)

Changes the slice value

Parameters:
Name Type Description
dimId string

the Dimension Id of the slice to change

codeId string

the id of the code to set the slice to