import { TabulationDataSet, TabulationDatum } from '@mtna/rds-base-ui'; import { RdsTabulationDimensionsForm } from '../../dimension-selection'; import { DatumCell } from './datum-cell.model'; import { TableDimension } from './table-dimension.model'; import { TableRow } from './table-row.model'; import { TabulationOptions } from './tabulation-options.model'; export declare class TabulationTable { dataSet: TabulationDataSet; dimensions: RdsTabulationDimensionsForm; options?: TabulationOptions; measureColumnHeader: string; /** Data Source for the table */ dataSource: Array; columnHeaders: Array; /** Whether the options are set to display column subtotals, these are table rows */ get hasColumnSubtotals(): boolean; /** Whether the options are set to display the column totals, i.e. the bottom table row */ get hasColumnTotals(): boolean; /** Whether the options are set to display the row subtotals, these are table columns */ get hasRowSubTotals(): boolean; /** Whether the options are set to display the row totals, i.e. the last table column */ get hasRowTotals(): boolean; tableCellDefs: Array; tableHeaderDefs: Array; /** contains each unique column with id and datum */ columnLookup: Array; rowLookup: Array; _variableToDatum: { [uri: string]: Array>; }; columnTotals: { [columnId: string]: number; }; /** ensures 'COUNTS' column remains visible when no column variables were selected */ hasNoColumns: boolean; private hasDimensionTotals; /** Keeps track of empty column ids for adjusting TableDimension datumCellSpans */ private missingColValues; constructor(dataSet: TabulationDataSet, dimensions: RdsTabulationDimensionsForm, options?: TabulationOptions, measureColumnHeader?: string); /** * Initializes Column ID definitions & Column TableDimensions */ initHeaders(): void; /** * Returns the Record that matches all the datum * @param records the Records to search, either dataSet.records || dataSet.totals * @param datumToMatch all the datum that the Record-to-find must contain */ private findRecordOrTotal; private generateColumnIds; /** * Returns a map of values for each column id * @param isSubtotal Determines which DataSet Records to search - records or totals * @param allDatum any Row Variable datum that must be included for searching */ private generateColumnValues; /** * Returns an array of TableDimension. * @param tabDims Selected TabulationDimensions - Row or Column * @param hasSubtotals If user has included subtotals - Row or Column */ private generateTableDimensions; /** * Calculates & sets the span values for datum cells & name cells, deleting any with span of 0. * @param dims TableDimensions to set span values */ private calculateCellSpansAndFilterEmptyCells; private filterEmptyDatumCells; /** * Sets the span values for the datumCells of a TableDimension * @param dim TableDimension requiring datumCellSpan calculation * @param index index of the TableDimension * @param vSpan The cumulative span for each iteration of this function * @param hasSubtotals Whether the table includes subtotals * @returns the recalculated vSpan */ private calculateDatumCellSpan; /** * Sets the span values for the nameCells of a TableDimension, filtering any with span of 0 * @param dim TableDimension requiring nameCellSpan calculation * @param dimIndex position of the TableDimension in the array of dimensions */ private calculateNameCellSpansAndFilterEmptyCells; /** * Creates an array of TableRows and maps them to the 'dataSource' */ private generateTableRows; /** * Generates a LookupItem for each individual table column. * Recurse through each column Dimension and create a new LookupItem * @param variables The selected Column Dimensions * @param prevDatum Array of parent Datum associated with the current Datum * @param _iteration DO NOT USE, for internal recursion iteration tracking */ private recurseLookupItems; }