@univerjs-pro/engine-pivot 0.4.2 → 0.5.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +0,0 @@
1
- import { DataField } from '../field/data-field';
2
- import { IDimensionMapItem, IMeasuresMapItem, IPivotSummaryLevelPool, IPivotTableQueryData, ITupleItem, PivotErrorTypeEnum, PivotSubtotalTypeEnum, PivotDataFieldSortOperatorEnum } from '../types';
3
- import { NodeTree } from './node-tree';
4
- import { TupleGroup } from './tuple-group';
5
- export declare class SummaryManager {
6
- counter: number;
7
- rowDimOrder: number[];
8
- colDimOrder: number[];
9
- rowTableIdList: string[];
10
- colTableIdList: string[];
11
- rowDeep: number;
12
- colDeep: number;
13
- measureCount: number;
14
- leafCount: number;
15
- measuresMap: Record<string, IMeasuresMapItem>;
16
- /**
17
- * @property The tuples of the pivot table, it contains the path, indexes, and save the measure value of each tuple.
18
- */
19
- tuples: ITupleItem[];
20
- /**
21
- * @property The map of tuple, it is used to quickly find the tuple by the path of tuple. the key is the path of tuple, the value is the index of tuple in tuples.
22
- */
23
- tupleMap: Record<string, number>;
24
- /**
25
- * @property The dimensionIdList, it contains the id of dimension fields.Only the the row and col fields are dimension fields.
26
- */
27
- dimensionIdList: string[];
28
- dimensionTableIdList: string[];
29
- /**
30
- * @property The measureIdList, it contains the id of measure fields.It used to quickly find the measure field.
31
- */
32
- measureIdList: string[];
33
- _rowLevelPool: IPivotSummaryLevelPool;
34
- _colLevelPool: IPivotSummaryLevelPool;
35
- rowNodeTree: NodeTree;
36
- colNodeTree: NodeTree;
37
- dimensionMap: Record<string, IDimensionMapItem>;
38
- /**
39
- * fist Record key is combinePathMap
40
- */
41
- combinePathMap: Record<string, Record<string, number>>;
42
- collapseInfo: Record<string, boolean | Record<string, boolean>>;
43
- dimensionSortInfo: Record<string, {
44
- type: PivotDataFieldSortOperatorEnum;
45
- sortMap: Record<string, number>;
46
- }>;
47
- constructor(queryData: IPivotTableQueryData, tupleGroup: TupleGroup);
48
- createSummaryLabelSortedMap(queryData: IPivotTableQueryData): void;
49
- getCellValue(index: number, id: string, subtotal: PivotSubtotalTypeEnum): number | {
50
- errorType: PivotErrorTypeEnum;
51
- } | undefined;
52
- getSortedMap(tableFieldId: string, dataField: DataField): Record<string, number>;
53
- doSummary(): void;
54
- private _getIndex;
55
- buildNodeTree(): void;
56
- createTupleWithoutCheck(paths: string[], nodeIndex: number, tupleKey: string): void;
57
- _buildNodeTreeImp(dimOrder: number[], tableIdList: string[], levelPool: IPivotSummaryLevelPool, nodePathStr: string): NodeTree;
58
- combinePathMapList(colPathMapList: Record<string, number>[], basePath: string): Record<string, number>;
59
- calculateListSubtotal(tupleItem: ITupleItem, indexes: number[]): void;
60
- calculateSubtotal(): void;
61
- getPathKeyWithFiledId(paths: string[], tableIdList: string[]): string;
62
- ensureTupleItem(index: number, paths: string[], tableIdList: string[]): void;
63
- ensureTupleItemByString(index: number, pathString: string): void;
64
- /**
65
- * - create tuple if not exist
66
- * @param {string[]} paths the path of tuple
67
- * @param {string} [pathsStr] the joined path string of tuple
68
- * @returns {void}
69
- */
70
- createTuple(paths: string[], pathsStr?: string, nodeIndex?: number): void;
71
- _calculateSubtotalImp(levelPool: IPivotSummaryLevelPool): void;
72
- }
@@ -1,82 +0,0 @@
1
- import { FieldsCollection } from '../field/fields-collection';
2
- import { IDimensionMapItem, IMeasuresMapItem, IPivotTableQueryData, ITupleItem, PivotDataFieldDataTypeEnum } from '../types';
3
- export declare class TupleGroup {
4
- /**
5
- * @property The tuples of the pivot table, it contains the path, indexes, and save the measure value of each tuple.
6
- */
7
- tuples: ITupleItem[];
8
- /**
9
- * @property The map of tuple, it is used to quickly find the tuple by the path of tuple. the key is the path of tuple, the value is the index of tuple in tuples.
10
- */
11
- tupleMap: Record<string, number>;
12
- /**
13
- * @property The measuresMap, it contains the field and subtotal of each measure.
14
- */
15
- measuresMap: Record<string, IMeasuresMapItem>;
16
- /**
17
- * @property The dimensionIdList, it contains the id of dimension fields.Only the the row and col fields are dimension fields.
18
- */
19
- dimensionIdList: string[];
20
- dimensionTableIdList: string[];
21
- /**
22
- * @property The measureIdList, it contains the id of measure fields.It used to quickly find the measure field.
23
- */
24
- measureIdList: string[];
25
- /**
26
- * @property The dimensionMap, it contains the field of each dimension.
27
- */
28
- dimensionMap: Record<string, IDimensionMapItem>;
29
- /**
30
- * @property The rowDeep, the deep of row fields.
31
- */
32
- rowDeep: number;
33
- /**
34
- * @property The colDeep, the deep of col fields.
35
- */
36
- colDeep: number;
37
- constructor();
38
- /**
39
- * - prepare the measuresMap and dimensionMap, it will prepare the measuresMap and dimensionMap based on the query data
40
- * @param {FieldsCollection} dataFieldsCollection - the fields collection of pivot table
41
- * @param {IPivotTableQueryData} queryData - the query data of pivot table, which contains the value, row, col, filter information,it the configuration of pivot table
42
- */
43
- prepare(dataFieldsCollection: FieldsCollection, queryData: IPivotTableQueryData): void;
44
- /**
45
- * - filter the data records by the query data
46
- * @param {IPivotTableQueryData} queryData - the query data of pivot table, which contains the value, row, col, filter information,it the configuration of pivot table
47
- * @returns {number[]} list - the indexes of data records, which is used to iterate the data records, isALL - whether all the data records are selected
48
- */
49
- filter(queryData: IPivotTableQueryData): {
50
- isAll: boolean;
51
- list: number[];
52
- };
53
- /**
54
- * - the core method of tuple group, it will prepare, filter, iterate the data records, and create or update tuple
55
- * @param {FieldsCollection} dataFieldsCollection - the fields collection of pivot table
56
- * @param {IPivotTableQueryData} queryData - the query data of pivot table, which contains the value, row, col, filter information,it the configuration of pivot table
57
- * @returns {void}
58
- */
59
- query(dataFieldsCollection: FieldsCollection, queryData: IPivotTableQueryData): void;
60
- reset(): void;
61
- /**
62
- * - iterate the indexes of data records, and create or update tuple
63
- * @param {boolean} isALL - whether all the data records are selected
64
- * @param {number} indexes - the indexes of data records
65
- */
66
- iterate(isALL: boolean, indexes: number[], recordCount?: number): void;
67
- /**
68
- * - create or update tuple, which is the core logic of tuple group, it will create a new tuple if not exist, or update the existing tuple., the judgment is based on the paths of tuple.
69
- * @param {string} paths the path of tuple
70
- * @param {string} pathsWithField the joined path string of tuple
71
- * @param {number} index the index of data
72
- * @returns {void}
73
- */
74
- createOrUpdateTuple(paths: string[], pathsWithField: string[], index: number, types: PivotDataFieldDataTypeEnum[]): void;
75
- /**
76
- * - create tuple if not exist
77
- * @param {string[]} paths the path of tuple
78
- * @param {string} [pathsStr] the joined path string of tuple
79
- * @returns {void}
80
- */
81
- createTuple(paths: string[], pathsStr?: string, nodeIndex?: number, types?: PivotDataFieldDataTypeEnum[]): void;
82
- }