rapid-spreadjs 1.0.49 → 1.0.50

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
@@ -18999,6 +18999,47 @@ const FormulaUtils = {
18999
18999
  return bzc;
19000
19000
  },
19001
19001
  },
19002
+ {
19003
+ funName: 'YJTREND',
19004
+ funDesc: '返回线性回归拟合线的一组纵坐标值(y值)',
19005
+ funDefaultVal: null,
19006
+ isAcceptArea: true,
19007
+ funParams: [
19008
+ {
19009
+ name: '已知的因变量值(y值)数组',
19010
+ repeatable: false,
19011
+ optional: false,
19012
+ },
19013
+ {
19014
+ name: '已知的自变量值(x值)数组',
19015
+ repeatable: false,
19016
+ optional: false,
19017
+ },
19018
+ {
19019
+ name: '希望预测y值的新x值',
19020
+ repeatable: false,
19021
+ optional: false,
19022
+ },
19023
+ ],
19024
+ funCallback: (spread, sheet, retData) => {
19025
+ //如果传递的参数小于3个,则返回空字符串
19026
+ if (retData.allCellValsEw.length < 3) {
19027
+ return '';
19028
+ }
19029
+ let xData = FormulaUtils.commFun.convertToInt(retData.allCellValsEw[0].filter((item) => FormulaUtils.commFun.isNumber(item))), yData = FormulaUtils.commFun.convertToInt(retData.allCellValsEw[1].filter((item) => FormulaUtils.commFun.isNumber(item))), x = retData.allCellValsEw[2];
19030
+ if (Array.isArray(x) && x.length > 0) {
19031
+ x = Number(x[0]);
19032
+ }
19033
+ else {
19034
+ x = Number(x);
19035
+ }
19036
+ console.log(111, retData);
19037
+ console.log(222, xData);
19038
+ console.log(333, yData);
19039
+ console.log(444, x);
19040
+ return 'OK';
19041
+ },
19042
+ },
19002
19043
  ],
19003
19044
  };
19004
19045