@@ -3,29 +3,55 @@ import { FilteringExpressionsTree } from '../../data-operations/filtering-expres
3
3
import { SortingDirection } from '../../data-operations/sorting-strategy' ;
4
4
import { ColumnType } from '../common/grid.interface' ;
5
5
6
+
7
+ /**
8
+ * Default pivot keys used for data processing in the pivot pipes.
9
+ */
6
10
export const DEFAULT_PIVOT_KEYS = {
7
11
aggregations : 'aggregations' , records : 'records' , children : 'children' , level : 'level' ,
8
12
rowDimensionSeparator : '_' , columnDimensionSeparator : '-'
9
13
} ;
10
14
15
+
16
+ /**
17
+ * Event emitted when dimension collection for rows, columns of filters is changed.
18
+ */
11
19
export interface IDimensionsChange {
20
+ /** The new list of dimensions. */
12
21
dimensions : IPivotDimension [ ] ,
22
+ /** The dimension list type - Row, Column or Filter. */
13
23
dimensionCollectionType : PivotDimensionType
14
24
}
15
25
26
+ /**
27
+ * Event emitted when values list is changed.
28
+ */
16
29
export interface IValuesChange {
30
+ /** The new list of values. */
17
31
values : IPivotValue [ ]
18
32
}
19
33
34
+ /**
35
+ * Interface describing Pivot data processing for dimensions.
36
+ * Should contain a process method and return records hierarchy based on the provided dimensions.
37
+ */
20
38
export interface IPivotDimensionStrategy {
21
39
process ( collection : any ,
22
40
dimensions : IPivotDimension [ ] ,
23
41
values : IPivotValue [ ] ,
24
42
pivotKeys ?: IPivotKeys ) : any [ ] ;
25
43
}
26
44
45
+ /**
46
+ * Interface describing a PivotAggregation function.
47
+ * Accepts an array of extracted data members and a array of the original data records.
48
+ */
27
49
export type PivotAggregation = ( members : any [ ] , data : any [ ] ) => any ;
28
50
51
+ /**
52
+ * Interface describing a IPivotAggregator class.
53
+ * Used for specifying custom aggregator lists.
54
+ */
29
55
export interface IPivotAggregator {
30
56
/** Aggregation unique key. */
31
57
key : string ;
@@ -38,7 +64,7 @@ export interface IPivotAggregator {
38
64
aggregator : ( members : any [ ] , data ?: any [ ] ) => any ;
39
65
}
40
66
41
- /**
67
+ /**
42
68
* Configuration of the pivot grid.
43
69
*/
44
70
export interface IPivotConfiguration {
@@ -54,9 +80,13 @@ export interface IPivotConfiguration {
54
80
values : IPivotValue [ ] | null ;
55
81
/** Dimensions to be displayed in the filter area. */
56
82
filters ?: IPivotDimension [ ] | null ;
83
+ /** Pivot data keys used for data generation. Can be used for custom remote scenarios where the data is pre-populated. */
57
84
pivotKeys ?: IPivotKeys ;
58
85
}
59
86
87
+ /**
88
+ * Configuration of a pivot dimension.
89
+ */
60
90
export interface IPivotDimension {
61
91
/** Allows defining a hierarchy when multiple sub groups need to be extracted from single member. */
62
92
childLevel ?: IPivotDimension ;
@@ -70,15 +100,24 @@ export interface IPivotDimension {
70
100
* A predefined or defined via the `igxPivotSelector` filter expression tree for the current dimension to be applied in the filter pipe.
71
101
* */
72
102
filter ?: FilteringExpressionsTree | null ;
103
+ /**
104
+ * The sorting direction of the current dimension. Determines the order in which the values will appear in the related dimension.
105
+ */
73
106
sortDirection ?: SortingDirection ;
107
+ /**
108
+ * The dataType of the related data field.
109
+ */
74
110
dataType ?: GridColumnDataType ;
75
- // The width of the dimension cells to be rendered.Can be pixel or %.
76
- width ? : string ;
111
+ /** The width of the dimension cells to be rendered.Can be pixel or %. */
112
+ width ?: string ;
77
113
}
78
-
114
+ /**
115
+ * Configuration of a pivot value aggregation.
116
+ */
79
117
export interface IPivotValue {
118
+ /** Field name to use in order to extract value. */
80
119
member : string ;
81
- // display name if present shows instead of member for the column header of this value
120
+ /** Display name to show instead of member for the column header of this value. **/
82
121
displayName ?: string ;
83
122
/**
84
123
* Active aggregator definition with key, label and aggregator.
@@ -88,34 +127,59 @@ export interface IPivotValue {
88
127
* List of aggregates to show in aggregate drop-down.
89
128
*/
90
129
aggregateList ?: IPivotAggregator [ ] ;
91
- // Enables/Disables a particular value from pivot aggregation.
130
+ /** Enables/Disables a particular value from pivot aggregation. */
92
131
enabled : boolean ;
93
- // Allow conditionally styling of the IgxPivotGrid cells
132
+ /** Allow conditionally styling of the IgxPivotGrid cells. */
94
133
styles ?: any ;
95
- // Enables a data type specific template of the cells
134
+ /** Enables a data type specific template of the cells */
96
135
dataType ?: GridColumnDataType ;
97
- // Applies display format to cell values.
136
+ /** Applies display format to cell values. */
98
137
formatter ?: ( value : any , rowData ?: any ) => any ;
99
138
}
100
139
140
+ /** Interface describing the Pivot data keys used for data generation.
141
+ * Can be used for custom remote scenarios where the data is pre-populated.
142
+ */
101
143
export interface IPivotKeys {
144
+ /** Field that stores children for hierarchy building. */
102
145
children : string ;
146
+ /** Field that stores reference to the original data records. */
103
147
records : string ;
148
+ /** Field that stores aggregation values. */
104
149
aggregations : string ;
150
+ /** Field that stores dimension level based on its hierarchy. */
105
151
level : string ;
152
+ /** Separator used when generating the unique column field values. */
106
153
columnDimensionSeparator : string ;
154
+ /** Separator used when generating the unique row field values. */
107
155
rowDimensionSeparator : string ;
108
156
}
109
157
158
+ /** The dimension types - Row, Column or Filter. */
110
159
export enum PivotDimensionType {
111
160
Row ,
112
161
Column ,
113
162
Filter
114
163
}
115
164
165
+ /** Interface describing the pivot dimension data.
166
+ * Contains additional information needed to render dimension headers.
167
+ */
116
168
export interface IPivotDimensionData {
169
+ /** Associated column definition. */
117
170
column : ColumnType ;
171
+ /** Associated dimension definition. */
118
172
dimension : IPivotDimension ;
173
+ /** List of previous dimension groups. */
119
174
prevDimensions : IPivotDimension [ ] ;
175
+ /** Whether this a child dimension. */
120
176
isChild ?: boolean ;
121
177
}
178
+
179
+ export interface PivotRowHeaderGroupType {
180
+ rowIndex : number ;
181
+ parent : any ;
182
+ header : any ;
183
+ headerID : string ;
184
+ grid : any ;
185
+ }
0 commit comments