For either the row or column dimension, this class provides access to dimension-specific metadata and data made available by the viewport subscription.

Hierarchy

  • DimensionData

Constructors

Accessors

  • get count(): number
  • Number of elements in this dimension that are present in this snapshot.

    Returns number

  • get offset(): number
  • The first position in this dimension that is present in this snapshot.

    Returns number

  • get totalCount(): number
  • The total number of elements in this dimension, given the current expansion state. Viewports past the end of this will not be fully populated.

    Returns number

Methods

  • Given a position in this dimension, returns the depth of the item in the hierarchy. The root level is 1, all items at the top level are then at depth 2, and so on.

    Parameters

    • position: number

      the position in the dimension

    Returns number

    the depth of the item in the hierarchy

  • Given a position in this dimension, returns the keys for that item. The keys are the values of the grouping columns, and the values then represent the aggregated values for the underlying table.

    Types of the keys are provided by PivotTable.getColDim/PivotTable.getRowDim.

    Parameters

    • position: number

      the position in the dimension

    Returns any[]

    an array of key values for the item at the given position

  • Given a position in this dimension, returns the total for the item in the dimension at that position.

    The type of this data will match the type of the provided PivotSource.

    Parameters

    • position: number

      the position in the dimension

    • value: PivotSource

      the value source to read, must have been included in the subscription

    Returns any

    the total for the item at the given position in this dimension

  • Given a position in this dimension, returns true if the item can be expanded to show children.

    Parameters

    • position: number

      the position in the dimension

    Returns boolean

    true if the item can be expanded

  • Given a position in this dimension, returns true if the item is already expanded. Any item that cannot be expanded will return false.

    Parameters

    • position: number

      the position in the dimension

    Returns boolean

    true if the item is expanded