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.cjs.js +41 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +41 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -19021,6 +19021,47 @@ const FormulaUtils = {
|
|
|
19021
19021
|
return bzc;
|
|
19022
19022
|
},
|
|
19023
19023
|
},
|
|
19024
|
+
{
|
|
19025
|
+
funName: 'YJTREND',
|
|
19026
|
+
funDesc: '返回线性回归拟合线的一组纵坐标值(y值)',
|
|
19027
|
+
funDefaultVal: null,
|
|
19028
|
+
isAcceptArea: true,
|
|
19029
|
+
funParams: [
|
|
19030
|
+
{
|
|
19031
|
+
name: '已知的因变量值(y值)数组',
|
|
19032
|
+
repeatable: false,
|
|
19033
|
+
optional: false,
|
|
19034
|
+
},
|
|
19035
|
+
{
|
|
19036
|
+
name: '已知的自变量值(x值)数组',
|
|
19037
|
+
repeatable: false,
|
|
19038
|
+
optional: false,
|
|
19039
|
+
},
|
|
19040
|
+
{
|
|
19041
|
+
name: '希望预测y值的新x值',
|
|
19042
|
+
repeatable: false,
|
|
19043
|
+
optional: false,
|
|
19044
|
+
},
|
|
19045
|
+
],
|
|
19046
|
+
funCallback: (spread, sheet, retData) => {
|
|
19047
|
+
//如果传递的参数小于3个,则返回空字符串
|
|
19048
|
+
if (retData.allCellValsEw.length < 3) {
|
|
19049
|
+
return '';
|
|
19050
|
+
}
|
|
19051
|
+
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];
|
|
19052
|
+
if (Array.isArray(x) && x.length > 0) {
|
|
19053
|
+
x = Number(x[0]);
|
|
19054
|
+
}
|
|
19055
|
+
else {
|
|
19056
|
+
x = Number(x);
|
|
19057
|
+
}
|
|
19058
|
+
console.log(111, retData);
|
|
19059
|
+
console.log(222, xData);
|
|
19060
|
+
console.log(333, yData);
|
|
19061
|
+
console.log(444, x);
|
|
19062
|
+
return 'OK';
|
|
19063
|
+
},
|
|
19064
|
+
},
|
|
19024
19065
|
],
|
|
19025
19066
|
};
|
|
19026
19067
|
|