@visactor/vtable 1.3.3-alpha.1 → 1.3.3-alpha.2
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.
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.d.ts +6 -1
- package/cjs/data/DataSource.js +12 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +15 -2
- package/cjs/dataset/dataset.js +170 -67
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/statistics-helper.d.ts +43 -3
- package/cjs/dataset/statistics-helper.js +61 -26
- package/cjs/dataset/statistics-helper.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +9 -1
- package/cjs/ts-types/new-data-set.js +1 -1
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +424 -188
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.d.ts +6 -1
- package/es/data/DataSource.js +12 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.d.ts +15 -2
- package/es/dataset/dataset.js +170 -68
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/statistics-helper.d.ts +43 -3
- package/es/dataset/statistics-helper.js +55 -23
- package/es/dataset/statistics-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +9 -1
- package/es/ts-types/new-data-set.js +1 -1
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +8 -8
package/dist/vtable.js
CHANGED
|
@@ -7143,12 +7143,6 @@
|
|
|
7143
7143
|
return Array.isArray(color) && isNumber$2(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
|
|
7144
7144
|
}
|
|
7145
7145
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
7146
|
-
if (Array.isArray(from) && !isNumber$2(from[0]) || Array.isArray(to) && !isNumber$2(to[0])) {
|
|
7147
|
-
return new Array(4).fill(0).map((_, index) => _interpolateColor(isArray$1(from) ? from[index] : from, isArray$1(to) ? to[index] : to, ratio, alphaChannel));
|
|
7148
|
-
}
|
|
7149
|
-
return _interpolateColor(from, to, ratio, alphaChannel, cb);
|
|
7150
|
-
}
|
|
7151
|
-
function _interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
7152
7146
|
if (!from || !to) return from && colorArrayToString(from) || to && colorArrayToString(to) || !1;
|
|
7153
7147
|
let fromArray,
|
|
7154
7148
|
toArray,
|
|
@@ -7659,7 +7653,7 @@
|
|
|
7659
7653
|
animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
|
|
7660
7654
|
type: AttributeUpdateType.STATE
|
|
7661
7655
|
});
|
|
7662
|
-
} else this.
|
|
7656
|
+
} else this.setAttributes(attrs, !1, {
|
|
7663
7657
|
type: AttributeUpdateType.STATE
|
|
7664
7658
|
});
|
|
7665
7659
|
}
|
|
@@ -7689,7 +7683,7 @@
|
|
|
7689
7683
|
}), value;
|
|
7690
7684
|
}
|
|
7691
7685
|
clearStates(hasAnimation) {
|
|
7692
|
-
this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
7686
|
+
this.stopStateAnimates(), this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
7693
7687
|
}
|
|
7694
7688
|
removeState(stateName, hasAnimation) {
|
|
7695
7689
|
if ((this.currentStates ? this.currentStates.indexOf(stateName) : -1) >= 0) {
|
|
@@ -7715,6 +7709,7 @@
|
|
|
7715
7709
|
var _a;
|
|
7716
7710
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
7717
7711
|
if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
|
|
7712
|
+
this.stopStateAnimates();
|
|
7718
7713
|
const stateAttrs = {};
|
|
7719
7714
|
states.forEach(stateName => {
|
|
7720
7715
|
var _a;
|
|
@@ -15285,8 +15280,7 @@
|
|
|
15285
15280
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
15286
15281
|
};
|
|
15287
15282
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
15288
|
-
const tempDirtyBounds = new AABBBounds()
|
|
15289
|
-
tempBackupDirtyBounds = new AABBBounds();
|
|
15283
|
+
const tempDirtyBounds = new AABBBounds();
|
|
15290
15284
|
class ShadowRootDrawItemInterceptorContribution {
|
|
15291
15285
|
constructor() {
|
|
15292
15286
|
this.order = 1;
|
|
@@ -15303,11 +15297,11 @@
|
|
|
15303
15297
|
context: context
|
|
15304
15298
|
} = drawContext;
|
|
15305
15299
|
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
15306
|
-
tempDirtyBounds.copy(drawContribution.dirtyBounds)
|
|
15300
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
15307
15301
|
const m = graphic.globalTransMatrix.getInverse();
|
|
15308
|
-
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m)
|
|
15302
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
15309
15303
|
}
|
|
15310
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds &&
|
|
15304
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
15311
15305
|
}
|
|
15312
15306
|
}
|
|
15313
15307
|
class DebugDrawItemInterceptorContribution {
|
|
@@ -21982,6 +21976,7 @@
|
|
|
21982
21976
|
AggregationType["AVG"] = "AVG";
|
|
21983
21977
|
AggregationType["COUNT"] = "COUNT";
|
|
21984
21978
|
AggregationType["CUSTOM"] = "CUSTOM";
|
|
21979
|
+
AggregationType["RECALCULATE"] = "RECALCULATE";
|
|
21985
21980
|
})(AggregationType || (AggregationType = {}));
|
|
21986
21981
|
var SortType;
|
|
21987
21982
|
(function (SortType) {
|
|
@@ -32877,13 +32872,15 @@
|
|
|
32877
32872
|
isRecord = true;
|
|
32878
32873
|
records = [];
|
|
32879
32874
|
type;
|
|
32875
|
+
key;
|
|
32880
32876
|
field;
|
|
32881
32877
|
formatFun;
|
|
32882
32878
|
_formatedValue;
|
|
32883
|
-
constructor(
|
|
32884
|
-
this.
|
|
32885
|
-
this.
|
|
32886
|
-
this.
|
|
32879
|
+
constructor(config) {
|
|
32880
|
+
this.key = config.key;
|
|
32881
|
+
this.field = config.dimension;
|
|
32882
|
+
this.formatFun = config.formatFun;
|
|
32883
|
+
this.isRecord = config.isRecord ?? this.isRecord;
|
|
32887
32884
|
}
|
|
32888
32885
|
clearCacheValue() {
|
|
32889
32886
|
this._formatedValue = undefined;
|
|
@@ -32907,7 +32904,7 @@
|
|
|
32907
32904
|
type = AggregationType.RECORD;
|
|
32908
32905
|
isRecord = true;
|
|
32909
32906
|
push(record) {
|
|
32910
|
-
if (this.isRecord && this.records) {
|
|
32907
|
+
if (record && this.isRecord && this.records) {
|
|
32911
32908
|
if (record.className === 'Aggregator') {
|
|
32912
32909
|
this.records.push(...record.records);
|
|
32913
32910
|
}
|
|
@@ -32930,11 +32927,13 @@
|
|
|
32930
32927
|
isRecord = true;
|
|
32931
32928
|
fieldValue;
|
|
32932
32929
|
push(record) {
|
|
32933
|
-
if (
|
|
32934
|
-
this.
|
|
32935
|
-
|
|
32936
|
-
|
|
32937
|
-
|
|
32930
|
+
if (record) {
|
|
32931
|
+
if (this.isRecord) {
|
|
32932
|
+
this.records = [record];
|
|
32933
|
+
}
|
|
32934
|
+
if (this.field) {
|
|
32935
|
+
this.fieldValue = record[this.field];
|
|
32936
|
+
}
|
|
32938
32937
|
}
|
|
32939
32938
|
}
|
|
32940
32939
|
value() {
|
|
@@ -32953,12 +32952,53 @@
|
|
|
32953
32952
|
aggregationFun;
|
|
32954
32953
|
values = [];
|
|
32955
32954
|
fieldValue;
|
|
32956
|
-
constructor(
|
|
32957
|
-
super(
|
|
32958
|
-
this.aggregationFun = aggregationFun;
|
|
32955
|
+
constructor(config) {
|
|
32956
|
+
super(config);
|
|
32957
|
+
this.aggregationFun = config.aggregationFun;
|
|
32958
|
+
}
|
|
32959
|
+
push(record) {
|
|
32960
|
+
if (record) {
|
|
32961
|
+
if (this.isRecord && this.records) {
|
|
32962
|
+
if (record.className === 'Aggregator') {
|
|
32963
|
+
this.records.push(...record.records);
|
|
32964
|
+
}
|
|
32965
|
+
else {
|
|
32966
|
+
this.records.push(record);
|
|
32967
|
+
}
|
|
32968
|
+
}
|
|
32969
|
+
if (this.field) {
|
|
32970
|
+
this.values.push(record[this.field]);
|
|
32971
|
+
}
|
|
32972
|
+
}
|
|
32973
|
+
}
|
|
32974
|
+
value() {
|
|
32975
|
+
if (!this.fieldValue) {
|
|
32976
|
+
this.fieldValue = this.aggregationFun?.(this.values, this.records, this.field);
|
|
32977
|
+
}
|
|
32978
|
+
return this.fieldValue;
|
|
32979
|
+
}
|
|
32980
|
+
reset() {
|
|
32981
|
+
this.records = [];
|
|
32982
|
+
this.fieldValue = undefined;
|
|
32983
|
+
}
|
|
32984
|
+
recalculate() {
|
|
32985
|
+
}
|
|
32986
|
+
}
|
|
32987
|
+
class RecalculateAggregator extends Aggregator {
|
|
32988
|
+
type = AggregationType.RECALCULATE;
|
|
32989
|
+
isRecord = true;
|
|
32990
|
+
calculateFun;
|
|
32991
|
+
fieldValue;
|
|
32992
|
+
dependAggregators;
|
|
32993
|
+
dependIndicatorKeys;
|
|
32994
|
+
constructor(config) {
|
|
32995
|
+
super(config);
|
|
32996
|
+
this.calculateFun = config.calculateFun;
|
|
32997
|
+
this.dependAggregators = config.dependAggregators;
|
|
32998
|
+
this.dependIndicatorKeys = config.dependIndicatorKeys;
|
|
32959
32999
|
}
|
|
32960
33000
|
push(record) {
|
|
32961
|
-
if (this.isRecord && this.records) {
|
|
33001
|
+
if (record && this.isRecord && this.records) {
|
|
32962
33002
|
if (record.className === 'Aggregator') {
|
|
32963
33003
|
this.records.push(...record.records);
|
|
32964
33004
|
}
|
|
@@ -32966,13 +33006,11 @@
|
|
|
32966
33006
|
this.records.push(record);
|
|
32967
33007
|
}
|
|
32968
33008
|
}
|
|
32969
|
-
if (this.field) {
|
|
32970
|
-
this.values.push(record[this.field]);
|
|
32971
|
-
}
|
|
32972
33009
|
}
|
|
32973
33010
|
value() {
|
|
32974
33011
|
if (!this.fieldValue) {
|
|
32975
|
-
|
|
33012
|
+
const aggregatorValue = _getDependAggregatorValues(this.dependAggregators, this.dependIndicatorKeys);
|
|
33013
|
+
this.fieldValue = this.calculateFun?.(aggregatorValue, this.records, this.field);
|
|
32976
33014
|
}
|
|
32977
33015
|
return this.fieldValue;
|
|
32978
33016
|
}
|
|
@@ -32989,40 +33027,42 @@
|
|
|
32989
33027
|
positiveSum = 0;
|
|
32990
33028
|
nagetiveSum = 0;
|
|
32991
33029
|
needSplitPositiveAndNegativeForSum = false;
|
|
32992
|
-
constructor(
|
|
32993
|
-
super(
|
|
32994
|
-
this.needSplitPositiveAndNegativeForSum = needSplitPositiveAndNegative ?? false;
|
|
33030
|
+
constructor(config) {
|
|
33031
|
+
super(config);
|
|
33032
|
+
this.needSplitPositiveAndNegativeForSum = config.needSplitPositiveAndNegative ?? false;
|
|
32995
33033
|
}
|
|
32996
33034
|
push(record) {
|
|
32997
|
-
if (
|
|
32998
|
-
if (
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
else {
|
|
33002
|
-
this.records.push(record);
|
|
33003
|
-
}
|
|
33004
|
-
}
|
|
33005
|
-
if (record.className === 'Aggregator') {
|
|
33006
|
-
const value = record.value();
|
|
33007
|
-
this.sum += value;
|
|
33008
|
-
if (this.needSplitPositiveAndNegativeForSum) {
|
|
33009
|
-
if (value > 0) {
|
|
33010
|
-
this.positiveSum += value;
|
|
33035
|
+
if (record) {
|
|
33036
|
+
if (this.isRecord && this.records) {
|
|
33037
|
+
if (record.className === 'Aggregator') {
|
|
33038
|
+
this.records.push(...record.records);
|
|
33011
33039
|
}
|
|
33012
|
-
else
|
|
33013
|
-
this.
|
|
33040
|
+
else {
|
|
33041
|
+
this.records.push(record);
|
|
33014
33042
|
}
|
|
33015
33043
|
}
|
|
33016
|
-
|
|
33017
|
-
|
|
33018
|
-
|
|
33019
|
-
|
|
33020
|
-
|
|
33021
|
-
|
|
33022
|
-
|
|
33044
|
+
if (record.className === 'Aggregator') {
|
|
33045
|
+
const value = record.value();
|
|
33046
|
+
this.sum += value;
|
|
33047
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
33048
|
+
if (value > 0) {
|
|
33049
|
+
this.positiveSum += value;
|
|
33050
|
+
}
|
|
33051
|
+
else if (value < 0) {
|
|
33052
|
+
this.nagetiveSum += value;
|
|
33053
|
+
}
|
|
33023
33054
|
}
|
|
33024
|
-
|
|
33025
|
-
|
|
33055
|
+
}
|
|
33056
|
+
else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
33057
|
+
const value = parseFloat(record[this.field]);
|
|
33058
|
+
this.sum += value;
|
|
33059
|
+
if (this.needSplitPositiveAndNegativeForSum) {
|
|
33060
|
+
if (value > 0) {
|
|
33061
|
+
this.positiveSum += value;
|
|
33062
|
+
}
|
|
33063
|
+
else if (value < 0) {
|
|
33064
|
+
this.nagetiveSum += value;
|
|
33065
|
+
}
|
|
33026
33066
|
}
|
|
33027
33067
|
}
|
|
33028
33068
|
}
|
|
@@ -33078,20 +33118,22 @@
|
|
|
33078
33118
|
type = AggregationType.COUNT;
|
|
33079
33119
|
count = 0;
|
|
33080
33120
|
push(record) {
|
|
33081
|
-
if (
|
|
33121
|
+
if (record) {
|
|
33122
|
+
if (this.isRecord && this.records) {
|
|
33123
|
+
if (record.className === 'Aggregator') {
|
|
33124
|
+
this.records.push(...record.records);
|
|
33125
|
+
}
|
|
33126
|
+
else {
|
|
33127
|
+
this.records.push(record);
|
|
33128
|
+
}
|
|
33129
|
+
}
|
|
33082
33130
|
if (record.className === 'Aggregator') {
|
|
33083
|
-
this.
|
|
33131
|
+
this.count += record.value();
|
|
33084
33132
|
}
|
|
33085
33133
|
else {
|
|
33086
|
-
this.
|
|
33134
|
+
this.count++;
|
|
33087
33135
|
}
|
|
33088
33136
|
}
|
|
33089
|
-
if (record.className === 'Aggregator') {
|
|
33090
|
-
this.count += record.value();
|
|
33091
|
-
}
|
|
33092
|
-
else {
|
|
33093
|
-
this.count++;
|
|
33094
|
-
}
|
|
33095
33137
|
}
|
|
33096
33138
|
value() {
|
|
33097
33139
|
return this.count;
|
|
@@ -33121,21 +33163,23 @@
|
|
|
33121
33163
|
sum = 0;
|
|
33122
33164
|
count = 0;
|
|
33123
33165
|
push(record) {
|
|
33124
|
-
if (
|
|
33125
|
-
if (
|
|
33126
|
-
|
|
33166
|
+
if (record) {
|
|
33167
|
+
if (this.isRecord && this.records) {
|
|
33168
|
+
if (record.className === 'Aggregator') {
|
|
33169
|
+
this.records.push(...record.records);
|
|
33170
|
+
}
|
|
33171
|
+
else {
|
|
33172
|
+
this.records.push(record);
|
|
33173
|
+
}
|
|
33127
33174
|
}
|
|
33128
|
-
|
|
33129
|
-
this.
|
|
33175
|
+
if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
|
|
33176
|
+
this.sum += record.sum;
|
|
33177
|
+
this.count += record.count;
|
|
33178
|
+
}
|
|
33179
|
+
else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
33180
|
+
this.sum += parseFloat(record[this.field]);
|
|
33181
|
+
this.count++;
|
|
33130
33182
|
}
|
|
33131
|
-
}
|
|
33132
|
-
if (record.className === 'Aggregator' && record.type === AggregationType.AVG) {
|
|
33133
|
-
this.sum += record.sum;
|
|
33134
|
-
this.count += record.count;
|
|
33135
|
-
}
|
|
33136
|
-
else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
33137
|
-
this.sum += parseFloat(record[this.field]);
|
|
33138
|
-
this.count++;
|
|
33139
33183
|
}
|
|
33140
33184
|
}
|
|
33141
33185
|
value() {
|
|
@@ -33169,25 +33213,27 @@
|
|
|
33169
33213
|
type = AggregationType.MAX;
|
|
33170
33214
|
max = Number.MIN_SAFE_INTEGER;
|
|
33171
33215
|
push(record) {
|
|
33172
|
-
if (
|
|
33216
|
+
if (record) {
|
|
33217
|
+
if (this.isRecord && this.records) {
|
|
33218
|
+
if (record.className === 'Aggregator') {
|
|
33219
|
+
this.records.push(...record.records);
|
|
33220
|
+
}
|
|
33221
|
+
else {
|
|
33222
|
+
this.records.push(record);
|
|
33223
|
+
}
|
|
33224
|
+
}
|
|
33173
33225
|
if (record.className === 'Aggregator') {
|
|
33174
|
-
this.
|
|
33226
|
+
this.max = record.max > this.max ? record.max : this.max;
|
|
33175
33227
|
}
|
|
33176
|
-
else {
|
|
33177
|
-
this.
|
|
33228
|
+
else if (typeof record === 'number') {
|
|
33229
|
+
this.max = record > this.max ? record : this.max;
|
|
33230
|
+
}
|
|
33231
|
+
else if (this.field && typeof record[this.field] === 'number') {
|
|
33232
|
+
this.max = record[this.field] > this.max ? record[this.field] : this.max;
|
|
33233
|
+
}
|
|
33234
|
+
else if (this.field && !isNaN(record[this.field])) {
|
|
33235
|
+
this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
|
|
33178
33236
|
}
|
|
33179
|
-
}
|
|
33180
|
-
if (record.className === 'Aggregator') {
|
|
33181
|
-
this.max = record.max > this.max ? record.max : this.max;
|
|
33182
|
-
}
|
|
33183
|
-
else if (typeof record === 'number') {
|
|
33184
|
-
this.max = record > this.max ? record : this.max;
|
|
33185
|
-
}
|
|
33186
|
-
else if (this.field && typeof record[this.field] === 'number') {
|
|
33187
|
-
this.max = record[this.field] > this.max ? record[this.field] : this.max;
|
|
33188
|
-
}
|
|
33189
|
-
else if (this.field && !isNaN(record[this.field])) {
|
|
33190
|
-
this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max;
|
|
33191
33237
|
}
|
|
33192
33238
|
}
|
|
33193
33239
|
value() {
|
|
@@ -33223,22 +33269,24 @@
|
|
|
33223
33269
|
type = AggregationType.MIN;
|
|
33224
33270
|
min = Number.MAX_SAFE_INTEGER;
|
|
33225
33271
|
push(record) {
|
|
33226
|
-
if (
|
|
33272
|
+
if (record) {
|
|
33273
|
+
if (this.isRecord && this.records) {
|
|
33274
|
+
if (record.className === 'Aggregator') {
|
|
33275
|
+
this.records.push(...record.records);
|
|
33276
|
+
}
|
|
33277
|
+
else {
|
|
33278
|
+
this.records.push(record);
|
|
33279
|
+
}
|
|
33280
|
+
}
|
|
33227
33281
|
if (record.className === 'Aggregator') {
|
|
33228
|
-
this.
|
|
33282
|
+
this.min = record.min < this.min ? record.min : this.min;
|
|
33229
33283
|
}
|
|
33230
|
-
else {
|
|
33231
|
-
this.
|
|
33284
|
+
else if (typeof record === 'number') {
|
|
33285
|
+
this.min = record < this.min ? record : this.min;
|
|
33286
|
+
}
|
|
33287
|
+
else if (this.field && typeof record[this.field] === 'number') {
|
|
33288
|
+
this.min = record[this.field] < this.min ? record[this.field] : this.min;
|
|
33232
33289
|
}
|
|
33233
|
-
}
|
|
33234
|
-
if (record.className === 'Aggregator') {
|
|
33235
|
-
this.min = record.min < this.min ? record.min : this.min;
|
|
33236
|
-
}
|
|
33237
|
-
else if (typeof record === 'number') {
|
|
33238
|
-
this.min = record < this.min ? record : this.min;
|
|
33239
|
-
}
|
|
33240
|
-
else if (this.field && typeof record[this.field] === 'number') {
|
|
33241
|
-
this.min = record[this.field] < this.min ? record[this.field] : this.min;
|
|
33242
33290
|
}
|
|
33243
33291
|
}
|
|
33244
33292
|
value() {
|
|
@@ -33385,6 +33433,16 @@
|
|
|
33385
33433
|
return naturalSort(a, b);
|
|
33386
33434
|
};
|
|
33387
33435
|
}
|
|
33436
|
+
function _getDependAggregatorValues(aggregators, dependIndicatorKeys) {
|
|
33437
|
+
const dependAggregatorValues = {};
|
|
33438
|
+
for (let m = 0; m < dependIndicatorKeys?.length; m++) {
|
|
33439
|
+
const aggrator = aggregators.find(aggrator => aggrator.key === dependIndicatorKeys[m]);
|
|
33440
|
+
if (aggrator) {
|
|
33441
|
+
dependAggregatorValues[aggrator.key] = aggrator?.value();
|
|
33442
|
+
}
|
|
33443
|
+
}
|
|
33444
|
+
return dependAggregatorValues;
|
|
33445
|
+
}
|
|
33388
33446
|
|
|
33389
33447
|
function isFieldAssessor(field) {
|
|
33390
33448
|
if (obj.isObject(field)) {
|
|
@@ -33550,7 +33608,12 @@
|
|
|
33550
33608
|
if (Array.isArray(aggragation)) {
|
|
33551
33609
|
for (let j = 0; j < aggragation.length; j++) {
|
|
33552
33610
|
const item = aggragation[j];
|
|
33553
|
-
const aggregator = new this.registedAggregators[item.aggregationType](
|
|
33611
|
+
const aggregator = new this.registedAggregators[item.aggregationType]({
|
|
33612
|
+
dimension: field,
|
|
33613
|
+
formatFun: item.formatFun,
|
|
33614
|
+
isRecord: true,
|
|
33615
|
+
aggregationFun: item.aggregationFun
|
|
33616
|
+
});
|
|
33554
33617
|
this.fieldAggregators.push(aggregator);
|
|
33555
33618
|
if (!columnObjs[i].aggregator) {
|
|
33556
33619
|
columnObjs[i].aggregator = [];
|
|
@@ -33559,7 +33622,12 @@
|
|
|
33559
33622
|
}
|
|
33560
33623
|
}
|
|
33561
33624
|
else {
|
|
33562
|
-
const aggregator = new this.registedAggregators[aggragation.aggregationType](
|
|
33625
|
+
const aggregator = new this.registedAggregators[aggragation.aggregationType]({
|
|
33626
|
+
dimension: field,
|
|
33627
|
+
formatFun: aggragation.formatFun,
|
|
33628
|
+
isRecord: true,
|
|
33629
|
+
aggregationFun: aggragation.aggregationFun
|
|
33630
|
+
});
|
|
33563
33631
|
this.fieldAggregators.push(aggregator);
|
|
33564
33632
|
columnObjs[i].aggregator = aggregator;
|
|
33565
33633
|
}
|
|
@@ -59272,7 +59340,7 @@
|
|
|
59272
59340
|
return TABLE_EVENT_TYPE;
|
|
59273
59341
|
}
|
|
59274
59342
|
options;
|
|
59275
|
-
version = "1.3.3-alpha.
|
|
59343
|
+
version = "1.3.3-alpha.2";
|
|
59276
59344
|
pagination;
|
|
59277
59345
|
id = `VTable${Date.now()}`;
|
|
59278
59346
|
headerStyleCache;
|
|
@@ -68510,6 +68578,9 @@
|
|
|
68510
68578
|
aggregationRules;
|
|
68511
68579
|
derivedFieldRules;
|
|
68512
68580
|
mappingRules;
|
|
68581
|
+
calculatedFieldRules;
|
|
68582
|
+
calculatedFiledKeys;
|
|
68583
|
+
calculatedFieldDependIndicatorKeys;
|
|
68513
68584
|
totals;
|
|
68514
68585
|
indicatorStatistics = [];
|
|
68515
68586
|
aggregators = {};
|
|
@@ -68529,6 +68600,7 @@
|
|
|
68529
68600
|
columns;
|
|
68530
68601
|
columnsHasValue;
|
|
68531
68602
|
indicatorKeys;
|
|
68603
|
+
indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
68532
68604
|
customRowTree;
|
|
68533
68605
|
customColTree;
|
|
68534
68606
|
colHeaderTree;
|
|
@@ -68545,10 +68617,27 @@
|
|
|
68545
68617
|
this.aggregationRules = this.dataConfig?.aggregationRules;
|
|
68546
68618
|
this.derivedFieldRules = this.dataConfig?.derivedFieldRules;
|
|
68547
68619
|
this.mappingRules = this.dataConfig?.mappingRules;
|
|
68620
|
+
this.calculatedFieldRules = this.dataConfig?.calculatedFieldRules;
|
|
68621
|
+
this.calculatedFiledKeys = this.calculatedFieldRules?.map(rule => rule.key) ?? [];
|
|
68622
|
+
this.calculatedFieldDependIndicatorKeys =
|
|
68623
|
+
this.calculatedFieldRules?.reduce((arr, rule) => {
|
|
68624
|
+
for (let i = 0; i < rule.dependIndicatorKeys.length; i++) {
|
|
68625
|
+
if (arr.indexOf(rule.dependIndicatorKeys[i]) === -1) {
|
|
68626
|
+
arr.push(rule.dependIndicatorKeys[i]);
|
|
68627
|
+
}
|
|
68628
|
+
}
|
|
68629
|
+
return arr;
|
|
68630
|
+
}, []) ?? [];
|
|
68548
68631
|
this.totals = this.dataConfig?.totals;
|
|
68549
68632
|
this.rows = rows;
|
|
68550
68633
|
this.columns = columns;
|
|
68551
68634
|
this.indicatorKeys = indicatorKeys;
|
|
68635
|
+
this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys = [...indicatorKeys];
|
|
68636
|
+
for (let m = 0; m < this.calculatedFieldDependIndicatorKeys.length; m++) {
|
|
68637
|
+
if (this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[m]) === -1) {
|
|
68638
|
+
this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[m]);
|
|
68639
|
+
}
|
|
68640
|
+
}
|
|
68552
68641
|
this.indicatorsAsCol = indicatorsAsCol;
|
|
68553
68642
|
this.indicators = indicators;
|
|
68554
68643
|
this.customColTree = customColTree;
|
|
@@ -68646,6 +68735,7 @@
|
|
|
68646
68735
|
this.registerAggregator(AggregationType.MIN, MinAggregator);
|
|
68647
68736
|
this.registerAggregator(AggregationType.AVG, AvgAggregator);
|
|
68648
68737
|
this.registerAggregator(AggregationType.NONE, NoneAggregator);
|
|
68738
|
+
this.registerAggregator(AggregationType.RECALCULATE, RecalculateAggregator);
|
|
68649
68739
|
}
|
|
68650
68740
|
processCollectedValuesWithSumBy() {
|
|
68651
68741
|
for (const field in this.collectedValues) {
|
|
@@ -68797,7 +68887,12 @@
|
|
|
68797
68887
|
.sumBy.map(byField => record[byField])
|
|
68798
68888
|
.join(this.stringJoinChar);
|
|
68799
68889
|
if (!this.collectedValues[field][collectKeys][sumByKeys]) {
|
|
68800
|
-
this.collectedValues[field][collectKeys][sumByKeys] = new this.aggregators[AggregationType.SUM](
|
|
68890
|
+
this.collectedValues[field][collectKeys][sumByKeys] = new this.aggregators[AggregationType.SUM]({
|
|
68891
|
+
key: field,
|
|
68892
|
+
dimension: field,
|
|
68893
|
+
isRecord: undefined,
|
|
68894
|
+
needSplitPositiveAndNegative: this.needSplitPositiveAndNegative
|
|
68895
|
+
});
|
|
68801
68896
|
}
|
|
68802
68897
|
this.collectedValues[field][collectKeys][sumByKeys].push(record);
|
|
68803
68898
|
}
|
|
@@ -68883,13 +68978,17 @@
|
|
|
68883
68978
|
for (let i = 0; i < this.indicatorKeys.length; i++) {
|
|
68884
68979
|
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
68885
68980
|
if (!this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i]) {
|
|
68886
|
-
this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](
|
|
68887
|
-
this.
|
|
68888
|
-
|
|
68889
|
-
|
|
68890
|
-
|
|
68891
|
-
|
|
68892
|
-
|
|
68981
|
+
this.totalRecordsTree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
68982
|
+
key: this.indicatorKeys[i],
|
|
68983
|
+
dimension: aggRule?.field ?? this.indicatorKeys[i],
|
|
68984
|
+
formatFun: aggRule?.formatFun ??
|
|
68985
|
+
this.indicators?.find((indicator) => {
|
|
68986
|
+
if (typeof indicator !== 'string') {
|
|
68987
|
+
return indicator.indicatorKey === this.indicatorKeys[i];
|
|
68988
|
+
}
|
|
68989
|
+
return false;
|
|
68990
|
+
})?.format
|
|
68991
|
+
});
|
|
68893
68992
|
}
|
|
68894
68993
|
this.indicatorKeys[i] in record && this.totalRecordsTree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
68895
68994
|
}
|
|
@@ -68907,18 +69006,39 @@
|
|
|
68907
69006
|
this.colFlatKeys[flatColKey] = 1;
|
|
68908
69007
|
}
|
|
68909
69008
|
}
|
|
68910
|
-
{
|
|
68911
|
-
|
|
68912
|
-
|
|
68913
|
-
|
|
68914
|
-
|
|
68915
|
-
|
|
69009
|
+
if (!this.tree[flatRowKey]) {
|
|
69010
|
+
this.tree[flatRowKey] = {};
|
|
69011
|
+
}
|
|
69012
|
+
if (!this.tree[flatRowKey]?.[flatColKey]) {
|
|
69013
|
+
this.tree[flatRowKey][flatColKey] = [];
|
|
69014
|
+
}
|
|
69015
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
69016
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
69017
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
69018
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
69019
|
+
if (!this.tree[flatRowKey]?.[flatColKey]?.[i]) {
|
|
69020
|
+
this.tree[flatRowKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
69021
|
+
key: toComputeIndicatorKeys[i],
|
|
69022
|
+
dimension: toComputeIndicatorKeys[i],
|
|
69023
|
+
isRecord: true,
|
|
69024
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
69025
|
+
if (typeof indicator !== 'string') {
|
|
69026
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69027
|
+
}
|
|
69028
|
+
return false;
|
|
69029
|
+
})?.format,
|
|
69030
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
69031
|
+
dependAggregators: this.tree[flatRowKey][flatColKey],
|
|
69032
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
69033
|
+
});
|
|
69034
|
+
}
|
|
69035
|
+
this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
68916
69036
|
}
|
|
68917
|
-
|
|
68918
|
-
const aggRule = this.getAggregatorRule(
|
|
69037
|
+
else {
|
|
69038
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
68919
69039
|
let needAddToAggregator = false;
|
|
68920
69040
|
if (assignedIndicatorKey) {
|
|
68921
|
-
|
|
69041
|
+
toComputeIndicatorKeys[i] === assignedIndicatorKey && (needAddToAggregator = true);
|
|
68922
69042
|
}
|
|
68923
69043
|
else if (aggRule?.field) {
|
|
68924
69044
|
if (typeof aggRule?.field === 'string') {
|
|
@@ -68932,16 +69052,20 @@
|
|
|
68932
69052
|
}
|
|
68933
69053
|
}
|
|
68934
69054
|
else {
|
|
68935
|
-
|
|
69055
|
+
toComputeIndicatorKeys[i] in record && (needAddToAggregator = true);
|
|
68936
69056
|
}
|
|
68937
69057
|
if (!this.tree[flatRowKey]?.[flatColKey]?.[i] && needAddToAggregator) {
|
|
68938
|
-
this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](
|
|
68939
|
-
|
|
68940
|
-
|
|
68941
|
-
|
|
68942
|
-
|
|
68943
|
-
|
|
68944
|
-
|
|
69058
|
+
this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69059
|
+
key: toComputeIndicatorKeys[i],
|
|
69060
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
69061
|
+
formatFun: aggRule?.formatFun ??
|
|
69062
|
+
this.indicators?.find((indicator) => {
|
|
69063
|
+
if (typeof indicator !== 'string') {
|
|
69064
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69065
|
+
}
|
|
69066
|
+
return false;
|
|
69067
|
+
})?.format
|
|
69068
|
+
});
|
|
68945
69069
|
}
|
|
68946
69070
|
if (needAddToAggregator) {
|
|
68947
69071
|
this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
|
|
@@ -68953,15 +69077,25 @@
|
|
|
68953
69077
|
if (!this.indicatorStatistics[i]) {
|
|
68954
69078
|
const aggRule = this.getAggregatorRule(this.indicatorKeys[i]);
|
|
68955
69079
|
this.indicatorStatistics[i] = {
|
|
68956
|
-
max: new this.aggregators[AggregationType.MAX](
|
|
68957
|
-
|
|
68958
|
-
|
|
68959
|
-
|
|
68960
|
-
|
|
68961
|
-
|
|
68962
|
-
|
|
68963
|
-
|
|
68964
|
-
|
|
69080
|
+
max: new this.aggregators[AggregationType.MAX]({
|
|
69081
|
+
key: this.indicatorKeys[i],
|
|
69082
|
+
dimension: this.indicatorKeys[i]
|
|
69083
|
+
}),
|
|
69084
|
+
min: new this.aggregators[AggregationType.MIN]({
|
|
69085
|
+
key: this.indicatorKeys[i],
|
|
69086
|
+
dimension: this.indicatorKeys[i]
|
|
69087
|
+
}),
|
|
69088
|
+
total: new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69089
|
+
key: this.indicatorKeys[i],
|
|
69090
|
+
dimension: aggRule?.field ?? this.indicatorKeys[i],
|
|
69091
|
+
formatFun: aggRule?.formatFun ??
|
|
69092
|
+
this.indicators?.find((indicator) => {
|
|
69093
|
+
if (typeof indicator !== 'string') {
|
|
69094
|
+
return indicator.indicatorKey === this.indicatorKeys[i];
|
|
69095
|
+
}
|
|
69096
|
+
return false;
|
|
69097
|
+
})?.format
|
|
69098
|
+
})
|
|
68965
69099
|
};
|
|
68966
69100
|
}
|
|
68967
69101
|
this.indicatorStatistics[i].max.push(this.tree[flatRowKey]?.[flatColKey]?.[i].value());
|
|
@@ -69256,18 +69390,45 @@
|
|
|
69256
69390
|
if (!this.tree[flatRowKey][flatColTotalKey]) {
|
|
69257
69391
|
this.tree[flatRowKey][flatColTotalKey] = [];
|
|
69258
69392
|
}
|
|
69259
|
-
|
|
69260
|
-
|
|
69261
|
-
|
|
69262
|
-
|
|
69263
|
-
|
|
69264
|
-
|
|
69265
|
-
|
|
69266
|
-
|
|
69267
|
-
|
|
69268
|
-
|
|
69393
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
69394
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
69395
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
69396
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
69397
|
+
if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
|
|
69398
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
69399
|
+
key: toComputeIndicatorKeys[i],
|
|
69400
|
+
dimension: toComputeIndicatorKeys[i],
|
|
69401
|
+
isRecord: true,
|
|
69402
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
69403
|
+
if (typeof indicator !== 'string') {
|
|
69404
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69405
|
+
}
|
|
69406
|
+
return false;
|
|
69407
|
+
})?.format,
|
|
69408
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
69409
|
+
dependAggregators: this.tree[flatRowKey][flatColTotalKey],
|
|
69410
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
69411
|
+
});
|
|
69412
|
+
}
|
|
69413
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69414
|
+
}
|
|
69415
|
+
else {
|
|
69416
|
+
if (!this.tree[flatRowKey][flatColTotalKey][i]) {
|
|
69417
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
69418
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69419
|
+
key: toComputeIndicatorKeys[i],
|
|
69420
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
69421
|
+
formatFun: aggRule?.formatFun ??
|
|
69422
|
+
this.indicators?.find((indicator) => {
|
|
69423
|
+
if (typeof indicator !== 'string') {
|
|
69424
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69425
|
+
}
|
|
69426
|
+
return false;
|
|
69427
|
+
})?.format
|
|
69428
|
+
});
|
|
69429
|
+
}
|
|
69430
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69269
69431
|
}
|
|
69270
|
-
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69271
69432
|
}
|
|
69272
69433
|
}
|
|
69273
69434
|
}
|
|
@@ -69281,18 +69442,45 @@
|
|
|
69281
69442
|
if (!this.tree[flatRowKey][flatColTotalKey]) {
|
|
69282
69443
|
this.tree[flatRowKey][flatColTotalKey] = [];
|
|
69283
69444
|
}
|
|
69284
|
-
|
|
69285
|
-
|
|
69286
|
-
|
|
69287
|
-
|
|
69288
|
-
|
|
69289
|
-
|
|
69290
|
-
|
|
69291
|
-
|
|
69292
|
-
|
|
69293
|
-
|
|
69445
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
69446
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
69447
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
69448
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
69449
|
+
if (!this.tree[flatRowKey]?.[flatColTotalKey]?.[i]) {
|
|
69450
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
69451
|
+
key: toComputeIndicatorKeys[i],
|
|
69452
|
+
dimension: toComputeIndicatorKeys[i],
|
|
69453
|
+
isRecord: true,
|
|
69454
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
69455
|
+
if (typeof indicator !== 'string') {
|
|
69456
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69457
|
+
}
|
|
69458
|
+
return false;
|
|
69459
|
+
})?.format,
|
|
69460
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
69461
|
+
dependAggregators: this.tree[flatRowKey][flatColTotalKey],
|
|
69462
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
69463
|
+
});
|
|
69464
|
+
}
|
|
69465
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69466
|
+
}
|
|
69467
|
+
else {
|
|
69468
|
+
if (!this.tree[flatRowKey][flatColTotalKey][i]) {
|
|
69469
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
69470
|
+
this.tree[flatRowKey][flatColTotalKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69471
|
+
key: toComputeIndicatorKeys[i],
|
|
69472
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
69473
|
+
formatFun: aggRule?.formatFun ??
|
|
69474
|
+
this.indicators?.find((indicator) => {
|
|
69475
|
+
if (typeof indicator !== 'string') {
|
|
69476
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69477
|
+
}
|
|
69478
|
+
return false;
|
|
69479
|
+
})?.format
|
|
69480
|
+
});
|
|
69481
|
+
}
|
|
69482
|
+
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69294
69483
|
}
|
|
69295
|
-
this.tree[flatRowKey][flatColTotalKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69296
69484
|
}
|
|
69297
69485
|
}
|
|
69298
69486
|
};
|
|
@@ -69316,16 +69504,40 @@
|
|
|
69316
69504
|
if (!this.tree[flatRowTotalKey][flatColKey]) {
|
|
69317
69505
|
this.tree[flatRowTotalKey][flatColKey] = [];
|
|
69318
69506
|
}
|
|
69319
|
-
|
|
69507
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
69508
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
69320
69509
|
if (!this.tree[flatRowTotalKey][flatColKey][i]) {
|
|
69321
|
-
|
|
69322
|
-
|
|
69323
|
-
this.
|
|
69324
|
-
|
|
69325
|
-
|
|
69326
|
-
|
|
69327
|
-
|
|
69328
|
-
|
|
69510
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
69511
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
69512
|
+
this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
69513
|
+
key: toComputeIndicatorKeys[i],
|
|
69514
|
+
dimension: toComputeIndicatorKeys[i],
|
|
69515
|
+
isRecord: true,
|
|
69516
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
69517
|
+
if (typeof indicator !== 'string') {
|
|
69518
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69519
|
+
}
|
|
69520
|
+
return false;
|
|
69521
|
+
})?.format,
|
|
69522
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
69523
|
+
dependAggregators: this.tree[flatRowTotalKey][flatColKey],
|
|
69524
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
69525
|
+
});
|
|
69526
|
+
}
|
|
69527
|
+
else {
|
|
69528
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
69529
|
+
this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69530
|
+
key: toComputeIndicatorKeys[i],
|
|
69531
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
69532
|
+
formatFun: aggRule?.formatFun ??
|
|
69533
|
+
this.indicators?.find((indicator) => {
|
|
69534
|
+
if (typeof indicator !== 'string') {
|
|
69535
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69536
|
+
}
|
|
69537
|
+
return false;
|
|
69538
|
+
})?.format
|
|
69539
|
+
});
|
|
69540
|
+
}
|
|
69329
69541
|
}
|
|
69330
69542
|
this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69331
69543
|
}
|
|
@@ -69341,16 +69553,40 @@
|
|
|
69341
69553
|
if (!this.tree[flatRowTotalKey][flatColKey]) {
|
|
69342
69554
|
this.tree[flatRowTotalKey][flatColKey] = [];
|
|
69343
69555
|
}
|
|
69344
|
-
|
|
69556
|
+
const toComputeIndicatorKeys = this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;
|
|
69557
|
+
for (let i = 0; i < toComputeIndicatorKeys.length; i++) {
|
|
69345
69558
|
if (!this.tree[flatRowTotalKey][flatColKey][i]) {
|
|
69346
|
-
|
|
69347
|
-
|
|
69348
|
-
this.
|
|
69349
|
-
|
|
69350
|
-
|
|
69351
|
-
|
|
69352
|
-
|
|
69353
|
-
|
|
69559
|
+
if (this.calculatedFiledKeys.indexOf(toComputeIndicatorKeys[i]) >= 0) {
|
|
69560
|
+
const calculatedFieldRule = this.calculatedFieldRules?.find(rule => rule.key === toComputeIndicatorKeys[i]);
|
|
69561
|
+
this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[AggregationType.RECALCULATE]({
|
|
69562
|
+
key: toComputeIndicatorKeys[i],
|
|
69563
|
+
dimension: toComputeIndicatorKeys[i],
|
|
69564
|
+
isRecord: true,
|
|
69565
|
+
formatFun: this.indicators?.find((indicator) => {
|
|
69566
|
+
if (typeof indicator !== 'string') {
|
|
69567
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69568
|
+
}
|
|
69569
|
+
return false;
|
|
69570
|
+
})?.format,
|
|
69571
|
+
calculateFun: calculatedFieldRule?.calculateFun,
|
|
69572
|
+
dependAggregators: this.tree[flatRowTotalKey][flatColKey],
|
|
69573
|
+
dependIndicatorKeys: calculatedFieldRule?.dependIndicatorKeys
|
|
69574
|
+
});
|
|
69575
|
+
}
|
|
69576
|
+
else {
|
|
69577
|
+
const aggRule = this.getAggregatorRule(toComputeIndicatorKeys[i]);
|
|
69578
|
+
this.tree[flatRowTotalKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM]({
|
|
69579
|
+
key: toComputeIndicatorKeys[i],
|
|
69580
|
+
dimension: aggRule?.field ?? toComputeIndicatorKeys[i],
|
|
69581
|
+
formatFun: aggRule?.formatFun ??
|
|
69582
|
+
this.indicators?.find((indicator) => {
|
|
69583
|
+
if (typeof indicator !== 'string') {
|
|
69584
|
+
return indicator.indicatorKey === toComputeIndicatorKeys[i];
|
|
69585
|
+
}
|
|
69586
|
+
return false;
|
|
69587
|
+
})?.format
|
|
69588
|
+
});
|
|
69589
|
+
}
|
|
69354
69590
|
}
|
|
69355
69591
|
this.tree[flatRowTotalKey][flatColKey][i].push(that.tree[flatRowKey]?.[flatColKey]?.[i]);
|
|
69356
69592
|
}
|
|
@@ -72560,7 +72796,7 @@
|
|
|
72560
72796
|
}
|
|
72561
72797
|
|
|
72562
72798
|
registerForVrender();
|
|
72563
|
-
const version = "1.3.3-alpha.
|
|
72799
|
+
const version = "1.3.3-alpha.2";
|
|
72564
72800
|
function getIcons() {
|
|
72565
72801
|
return get$2();
|
|
72566
72802
|
}
|