• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM CUT coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid-aggregate.ts
1
import { IgxDateSummaryOperand, IgxNumberSummaryOperand, IgxTimeSummaryOperand } from '../summaries/grid-summary';
2
import { IPivotAggregator } from './pivot-grid.interface';
3

4

5
export class IgxPivotAggregate {
6
    /**
7
     * Gets array with default aggregator function for base aggregation.
8
     * ```typescript
9
     * IgxPivotAggregate.aggregators();
10
     * ```
11
     *
12
     * @memberof IgxPivotAggregate
13
     */
14
    public static aggregators(): Array<IPivotAggregator> {
UNCOV
15
        return [{
×
16
            key: 'COUNT',
17
            label: 'Count',
18
            aggregator: IgxPivotAggregate.count
19
        }];
20
    }
21
    /**
22
     * Counts all the records in the data source.
23
     * If filtering is applied, counts only the filtered records.
24
     * ```typescript
25
     * IgxSummaryOperand.count(dataSource);
26
     * ```
27
     *
28
     * @memberof IgxPivotAggregate
29
     */
30
    public static count(members: number[]): number {
UNCOV
31
        return members.length;
×
32
    }
33
}
34

35
export class IgxPivotNumericAggregate extends IgxPivotAggregate {
36

37
    /**
38
     * Gets array with default aggregator function for numeric aggregation.
39
     * ```typescript
40
     * IgxPivotAggregate.aggregators();
41
     * ```
42
     *
43
     * @memberof IgxPivotAggregate
44
     */
45
    public static override aggregators() {
UNCOV
46
        let result: IPivotAggregator[] = [];
×
UNCOV
47
        result = result.concat(super.aggregators());
×
UNCOV
48
        result.push({
×
49
            key: 'MIN',
50
            label: 'Minimum',
51
            aggregator: IgxPivotNumericAggregate.min
52
        });
UNCOV
53
        result.push({
×
54
            key: 'MAX',
55
            label: 'Maximum',
56
            aggregator: IgxPivotNumericAggregate.max
57
        });
58

UNCOV
59
        result.push({
×
60
            key: 'SUM',
61
            label: 'Sum',
62
            aggregator: IgxPivotNumericAggregate.sum
63
        });
64

UNCOV
65
        result.push({
×
66
            key: 'AVG',
67
            label: 'Average',
68
            aggregator: IgxPivotNumericAggregate.average
69
        });
UNCOV
70
        return result;
×
71
    }
72

73
    /**
74
     * Returns the minimum numeric value in the provided data records.
75
     * If filtering is applied, returns the minimum value in the filtered data records.
76
     * ```typescript
77
     * IgxPivotNumericAggregate.min(members, data);
78
     * ```
79
     *
80
     * @memberof IgxPivotNumericAggregate
81
     */
82
    public static min(members: number[]): number {
UNCOV
83
        return IgxNumberSummaryOperand.min(members);
×
84
    }
85

86
    /**
87
     * Returns the maximum numeric value in the provided data records.
88
     * If filtering is applied, returns the maximum value in the filtered data records.
89
     * ```typescript
90
     * IgxPivotNumericAggregate.max(data);
91
     * ```
92
     *
93
     * @memberof IgxPivotNumericAggregate
94
     */
95
    public static max(members: number[]): number {
UNCOV
96
        return IgxNumberSummaryOperand.max(members);
×
97
    }
98

99
    /**
100
     * Returns the sum of the numeric values in the provided data records.
101
     * If filtering is applied, returns the sum of the numeric values in the data records.
102
     * ```typescript
103
     * IgxPivotNumericAggregate.sum(data);
104
     * ```
105
     *
106
     * @memberof IgxPivotNumericAggregate
107
     */
108
    public static sum(members: number[]): number {
UNCOV
109
        return IgxNumberSummaryOperand.sum(members);
×
110
    }
111

112
    /**
113
     * Returns the average numeric value in the data provided data records.
114
     * If filtering is applied, returns the average numeric value in the filtered data records.
115
     * ```typescript
116
     * IgxPivotNumericAggregate.average(data);
117
     * ```
118
     *
119
     * @memberof IgxPivotNumericAggregate
120
     */
121
    public static average(members: number[]): number {
UNCOV
122
        return IgxNumberSummaryOperand.average(members);
×
123
    }
124
}
125

126
export class IgxPivotDateAggregate extends IgxPivotAggregate {
127
    /**
128
     * Gets array with default aggregator function for date aggregation.
129
     * ```typescript
130
     * IgxPivotDateAggregate.aggregators();
131
     * ```
132
     *
133
     * @memberof IgxPivotAggregate
134
     */
135
    public static override aggregators() {
UNCOV
136
        let result: IPivotAggregator[] = [];
×
UNCOV
137
        result = result.concat(super.aggregators());
×
UNCOV
138
        result.push({
×
139
            key: 'LATEST',
140
            label: 'Latest Date',
141
            aggregator: IgxPivotDateAggregate.latest
142
        });
UNCOV
143
        result.push({
×
144
            key: 'EARLIEST',
145
            label: 'Earliest Date',
146
            aggregator: IgxPivotDateAggregate.earliest
147
        });
UNCOV
148
        return result;
×
149
    }
150
    /**
151
     * Returns the latest date value in the data records.
152
     * If filtering is applied, returns the latest date value in the filtered data records.
153
     * ```typescript
154
     * IgxPivotDateAggregate.latest(data);
155
     * ```
156
     *
157
     * @memberof IgxPivotDateAggregate
158
     */
159
    public static latest(members: any[]) {
UNCOV
160
        return IgxDateSummaryOperand.latest(members);
×
161
    }
162

163
    /**
164
     * Returns the earliest date value in the data records.
165
     * If filtering is applied, returns the latest date value in the filtered data records.
166
     * ```typescript
167
     * IgxPivotDateAggregate.earliest(data);
168
     * ```
169
     *
170
     * @memberof IgxPivotDateAggregate
171
     */
172
    public static earliest(members: any[]) {
UNCOV
173
        return IgxDateSummaryOperand.earliest(members);
×
174
    }
175
}
176

177
export class IgxPivotTimeAggregate extends IgxPivotAggregate {
178
    /**
179
     * Gets array with default aggregator function for time aggregation.
180
     * ```typescript
181
     * IgxPivotTimeAggregate.aggregators();
182
     * ```
183
     *
184
     * @memberof IgxPivotAggregate
185
     */
186
    public static override aggregators() {
UNCOV
187
        let result: IPivotAggregator[] = [];
×
UNCOV
188
        result = result.concat(super.aggregators());
×
UNCOV
189
        result.push({
×
190
            key: 'LATEST',
191
            label: 'Latest Time',
192
            aggregator: IgxPivotTimeAggregate.latestTime
193
        });
UNCOV
194
        result.push({
×
195
            key: 'EARLIEST',
196
            label: 'Earliest Time',
197
            aggregator: IgxPivotTimeAggregate.earliestTime
198
        });
UNCOV
199
        return result;
×
200
    }
201

202
    /**
203
     * Returns the latest time value in the data records. Compare only the time part of the date.
204
     * If filtering is applied, returns the latest time value in the filtered data records.
205
     * ```typescript
206
     * IgxPivotTimeAggregate.latestTime(data);
207
     * ```
208
     *
209
     * @memberof IgxPivotTimeAggregate
210
     */
211
    public static latestTime(members: any[]) {
UNCOV
212
        return IgxTimeSummaryOperand.latestTime(members);
×
213
    }
214

215
    /**
216
     * Returns the earliest time value in the data records. Compare only the time part of the date.
217
     * If filtering is applied, returns the earliest time value in the filtered data records.
218
     * ```typescript
219
     * IgxPivotTimeAggregate.earliestTime(data);
220
     * ```
221
     *
222
     * @memberof IgxPivotTimeAggregate
223
     */
224
    public static earliestTime(members: any[]) {
UNCOV
225
        return IgxTimeSummaryOperand.earliestTime(members);
×
226
    }
227
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc