rapid-spreadjs 1.0.174 → 1.0.175

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.esm.js CHANGED
@@ -1441,6 +1441,7 @@ const BusinessUtils = {
1441
1441
  cellValue !== undefined &&
1442
1442
  cellValue !== '' &&
1443
1443
  cellValue !== '/' &&
1444
+ cellValue !== '#VALUE!' &&
1444
1445
  !(cellValue instanceof GC.Spread.CalcEngine.CalcError)) {
1445
1446
  curRowHasValue = true;
1446
1447
  break;
@@ -9792,19 +9793,29 @@ const EChartsUtilsAll = {
9792
9793
  let xData = xDataArr[0];
9793
9794
  let yData = yDataArr[0];
9794
9795
  /**
9795
- * 根据两个数组对应位置的值进行联合过滤,去除任一为0的项
9796
- * @param {number[]} arr1 - 第一个数字数组
9797
- * @param {number[]} arr2 - 第二个数字数组
9798
- * @returns {[number[], number[]]} 返回过滤后的两个数组组成的元组
9796
+ * 判断值是否为无效占位符
9797
+ * 无效值包括: 0, '/', null, undefined, NaN, ''
9798
+ */
9799
+ function isValid(val) {
9800
+ if (val === 0 || val === '/' || val === null || val === undefined || val === '')
9801
+ return false;
9802
+ if (typeof val === 'number' && Number.isNaN(val))
9803
+ return false;
9804
+ return true;
9805
+ }
9806
+ /**
9807
+ * 根据两个数组对应位置的值进行联合过滤,去除任一为无效值的项
9808
+ * @param {Array} arr1 - 第一个数组
9809
+ * @param {Array} arr2 - 第二个数组
9810
+ * @returns {[Array, Array]} 返回过滤后的两个数组组成的元组
9799
9811
  */
9800
9812
  function filterArrData(arr1, arr2) {
9801
9813
  const filtered1 = [];
9802
9814
  const filtered2 = [];
9803
- // 以较短的数组长度为基准,防止越界
9804
9815
  const len = Math.min(arr1.length, arr2.length);
9805
9816
  for (let i = 0; i < len; i++) {
9806
- // 只有当两个数组在当前位置都非0时,才保留该数据
9807
- if (arr1[i] !== 0 && arr2[i] !== 0) {
9817
+ // 只有当两个数组在当前位置都是有效值时,才保留
9818
+ if (isValid(arr1[i]) && isValid(arr2[i])) {
9808
9819
  filtered1.push(arr1[i]);
9809
9820
  filtered2.push(arr2[i]);
9810
9821
  }