autoql-fe-utils 1.0.22 → 1.0.23
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/dist/index.global.js +5 -14
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +5 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -21897,26 +21897,17 @@
|
|
|
21897
21897
|
const positiveSumsObject = {};
|
|
21898
21898
|
const negativeSumsObject = {};
|
|
21899
21899
|
data.forEach((row) => {
|
|
21900
|
-
const label = row[stringColumnIndex]
|
|
21900
|
+
const label = `${row[stringColumnIndex]}`;
|
|
21901
21901
|
numberColumnIndices.forEach((colIndex) => {
|
|
21902
|
+
var _a;
|
|
21902
21903
|
const rawValue = row[colIndex];
|
|
21903
21904
|
let value = Number(rawValue);
|
|
21904
21905
|
if (isNaN(value)) {
|
|
21905
21906
|
value = 0;
|
|
21906
21907
|
}
|
|
21907
|
-
|
|
21908
|
-
|
|
21909
|
-
|
|
21910
|
-
} else {
|
|
21911
|
-
positiveSumsObject[label] = value;
|
|
21912
|
-
}
|
|
21913
|
-
} else if (value < 0) {
|
|
21914
|
-
if (negativeSumsObject[label]) {
|
|
21915
|
-
negativeSumsObject[label] -= value;
|
|
21916
|
-
} else {
|
|
21917
|
-
negativeSumsObject[label] = value;
|
|
21918
|
-
}
|
|
21919
|
-
}
|
|
21908
|
+
const sumsObject = value >= 0 ? positiveSumsObject : negativeSumsObject;
|
|
21909
|
+
const previousValue = (_a = sumsObject[label]) != null ? _a : 0;
|
|
21910
|
+
sumsObject[label] = previousValue + value;
|
|
21920
21911
|
});
|
|
21921
21912
|
});
|
|
21922
21913
|
let maxValue = getMaxValueFromKeyValueObj(positiveSumsObject);
|