ziko 1.4.0 → 1.5.0
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/ziko.cjs +348 -90
- package/dist/ziko.js +348 -90
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +321 -91
- package/package.json +1 -1
- package/src/dom/components/for/index.js +17 -0
- package/src/dom/components/index.js +2 -1
- package/src/dom/constructors/UIElement.js +8 -1
- package/src/math/complex/index.d.ts +207 -30
- package/src/math/functions/arithmetic/index.d.ts +95 -0
- package/src/math/functions/conversions/index.d.ts +101 -0
- package/src/math/functions/index.d.ts +97 -90
- package/src/math/functions/logic/index.d.ts +50 -8
- package/src/math/functions/logic/index.js +1 -1
- package/src/math/functions/mapfun/index.d.ts +46 -80
- package/src/math/functions/mapfun/index.d.ts.txt +162 -0
- package/src/math/functions/signal/index.d.ts +146 -0
- package/src/math/functions/stats/index.js +33 -33
- package/src/math/functions/ufunc/index.d.ts +96 -0
- package/src/math/functions/utils/index.d.ts +118 -1
- package/src/math/index.d.ts +4 -0
- package/src/math/index.js +1 -16
- package/src/math/random/index.d.ts +162 -0
- package/src/math/random/index.js +4 -4
- package/src/math/stats/accum/index.d.ts +43 -0
- package/src/math/stats/average/index.d.ts +123 -0
- package/src/math/stats/index.d.ts +5 -0
- package/src/math/stats/percentile/index.d.ts +66 -0
- package/src/math/stats/rolling/index.d.ts +47 -0
- package/src/math/stats/variability/index.d.ts +93 -0
- package/src/math/index.d.ts.txt +0 -5
package/dist/ziko.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Project: ziko.js
|
|
4
4
|
Author: Zakaria Elalaoui
|
|
5
|
-
Date :
|
|
5
|
+
Date : Fri Jul 31 2026 10:36:31 GMT+0100 (UTC+01:00)
|
|
6
6
|
Git-Repo : https://github.com/zakarialaoui10/ziko.js
|
|
7
7
|
Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
|
|
8
8
|
Released under MIT License
|
|
@@ -56,122 +56,212 @@ const base2base = (value, fromBase, toBase) => {
|
|
|
56
56
|
return dec.toString(toBase);
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
if(y?.isComplex?.()) x = new y.constructor(x, 0);
|
|
71
|
-
if(y?.isMatrix?.()) x = y.constructor.nums(y.rows, y.cols, x);
|
|
72
|
-
return x[op](y)
|
|
73
|
-
}
|
|
74
|
-
if(x?.isComplex?.()){
|
|
75
|
-
if(typeof y === 'number' || y?.isComplex?.()) return x.clone()[op](y);
|
|
76
|
-
if(y?.isMatrix?.()){
|
|
77
|
-
x = y.constructor.nums(y.rows, y.cols, x);
|
|
78
|
-
return x.clone()[op](y)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if(x?.isMatrix?.()){
|
|
82
|
-
return x.clone()[op](y)
|
|
83
|
-
}
|
|
59
|
+
const percentile = (X, p) => {
|
|
60
|
+
if (X.length === 0)
|
|
61
|
+
return NaN;
|
|
62
|
+
let a = X.sort((x, y) => x - y);
|
|
63
|
+
let index = (p / 100) * (a.length - 1);
|
|
64
|
+
let i = Math.floor(index);
|
|
65
|
+
let f = index - i;
|
|
66
|
+
if (i === a.length - 1)
|
|
67
|
+
return a[i];
|
|
68
|
+
return a[i] * (1 - f) + a[i + 1] * f;
|
|
84
69
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
70
|
+
|
|
71
|
+
const q1 = X => percentile(X, 25);
|
|
72
|
+
const median = X => percentile(X, 50);
|
|
73
|
+
const q3 = X => percentile(X, 75);
|
|
74
|
+
|
|
75
|
+
// Interquartile Range
|
|
76
|
+
const iqr = X => q3(X) - q1(X);
|
|
77
|
+
|
|
78
|
+
// Mean
|
|
79
|
+
const mean = (...x) => x.reduce((a, b) => a + b) / x.length;
|
|
80
|
+
const geo_mean = (...x) => (x.reduce((a, b) => a * b)) ** (1/x.length);
|
|
81
|
+
// Quadratic Mean
|
|
82
|
+
const rms = (...x) => {
|
|
83
|
+
const n = x.length;
|
|
84
|
+
return (Math.hypot(...x)/n)**(1/n)
|
|
90
85
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
|
|
87
|
+
const weighted_mean=(values, weights)=>{
|
|
88
|
+
let sum = 0, sw = 0;
|
|
89
|
+
for (let i = 0; i < values.length; i++) {
|
|
90
|
+
sum += values[i] * weights[i];
|
|
91
|
+
sw += weights[i];
|
|
92
|
+
}
|
|
93
|
+
return sum / sw;
|
|
96
94
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
|
|
96
|
+
const harmonic_mean = (...x) => {
|
|
97
|
+
let s = 0, i = 0;
|
|
98
|
+
for(i=0; i<x.length; i++)
|
|
99
|
+
s += 1/x[i];
|
|
100
|
+
return x.length / s;
|
|
102
101
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
|
|
103
|
+
const power_mean = (X, p) =>{
|
|
104
|
+
let s = 0, i = 0, l = X.length;
|
|
105
|
+
for(i=0; i < l; i++)
|
|
106
|
+
s+= X[i]**p;
|
|
107
|
+
return (s / l) ** (1 / p);
|
|
108
108
|
};
|
|
109
|
-
const modulo=(a,...b)=>{
|
|
110
|
-
let res = a;
|
|
111
|
-
for(let i=0; i<b.length; i++)
|
|
112
|
-
res = arithmetic_helper('modulo', res, b[i]);
|
|
113
|
-
return res;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const min = (...x) => Math.min(...x);
|
|
117
|
-
const max = (...x) => Math.max(...x);
|
|
118
109
|
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
110
|
+
const trimmed_mean = (X, k) =>{
|
|
111
|
+
let a = [...X].sort((a,b)=>a-b).slice(k, X.length - k);
|
|
112
|
+
return mean(...a);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const winsorized_mean = (X, k) =>{
|
|
116
|
+
let a = [...X].sort((a,b)=>a-b);
|
|
117
|
+
let low = a[k], high = a[a.length - k - 1];
|
|
118
|
+
a = a.map(x => Math.max(low, Math.min(high, x)));
|
|
119
|
+
return mean(a);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const midrange = (x) =>{
|
|
123
|
+
let min = Math.min(...x);
|
|
124
|
+
let max = Math.max(...x);
|
|
125
|
+
return (min + max) / 2;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const midhinge = (...x) =>{
|
|
129
|
+
let a = x.sort((a,b)=>a-b);
|
|
130
|
+
let q1 = a[Math.floor((a.length - 1) * 0.25)];
|
|
131
|
+
let q3 = a[Math.floor((a.length - 1) * 0.75)];
|
|
132
|
+
return (q1 + q3) / 2;
|
|
129
133
|
};
|
|
130
134
|
|
|
131
|
-
const mean = (...x) => x.reduce((a, b) => a + b) / x.length;
|
|
132
135
|
|
|
136
|
+
const interquartile_mean = (...x) =>{
|
|
137
|
+
let a = x.sort((a,b)=>a-b);
|
|
138
|
+
let q1 = a[Math.floor((a.length - 1) * 0.25)];
|
|
139
|
+
let q3 = a[Math.floor((a.length - 1) * 0.75)];
|
|
140
|
+
let m = a.filter(x => x >= q1 && x <= q3);
|
|
141
|
+
return mean(m);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
const contraharmonic_mean = (...x) =>{
|
|
146
|
+
let num = 0, den = 0, i, l = x.length;
|
|
147
|
+
for(i = 0; i < l; i++){
|
|
148
|
+
num += x[i]**2;
|
|
149
|
+
den += x[i];
|
|
150
|
+
}
|
|
151
|
+
return num / den;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// Population Variance
|
|
133
155
|
const variance = (...x) => {
|
|
134
156
|
const n = x.length;
|
|
135
157
|
if (n === 0) return NaN;
|
|
136
158
|
const x_mean = mean(...x);
|
|
137
159
|
return x.reduce((sum, xi) => sum + (xi - x_mean) ** 2, 0) / n;
|
|
138
160
|
};
|
|
139
|
-
|
|
140
161
|
const std = (...x) => Math.sqrt(variance(...x));
|
|
141
162
|
|
|
142
|
-
const
|
|
163
|
+
const sample_variance = (...x) => {
|
|
164
|
+
const n = x.length;
|
|
165
|
+
if (n < 2) return NaN;
|
|
166
|
+
const x_mean = mean(...x);
|
|
167
|
+
return x.reduce((sum, xi) => sum + (xi - x_mean) ** 2, 0) / (n - 1);
|
|
168
|
+
};
|
|
169
|
+
const sample_std = (...x) => Math.sqrt(sample_variance(...x));
|
|
170
|
+
|
|
171
|
+
const weighted_variance = (X, weights) => {
|
|
172
|
+
const n = X.length;
|
|
173
|
+
if (n === 0 || weights.length !== n) return NaN;
|
|
174
|
+
const sw = weights.reduce((sum, w) => sum + w, 0);
|
|
175
|
+
const mean = X.reduce((sum, x, i) => sum + x * weights[i], 0) / sw;
|
|
176
|
+
return X.reduce((sum, x, i) => sum + weights[i] * (x - mean) ** 2, 0) / sw;
|
|
177
|
+
};
|
|
178
|
+
const weighted_std = (X, weights) => Math.sqrt(weighted_variance(X, weights));
|
|
179
|
+
|
|
180
|
+
const rolling_variance = (X, windowSize) => {
|
|
181
|
+
if (windowSize < 1 || X.length < windowSize) return [];
|
|
143
182
|
let result = [];
|
|
144
|
-
let
|
|
145
|
-
|
|
146
|
-
|
|
183
|
+
for (let i = 0; i <= X.length - windowSize; i++) {
|
|
184
|
+
const w = X.slice(i, i + windowSize);
|
|
185
|
+
result.push(sample_variance(w)); // usually sample variance for rolling
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
};
|
|
189
|
+
const rolling_std = (X, windowSize) => Math.sqrt(rolling_variance(X, windowSize));
|
|
190
|
+
|
|
191
|
+
// Simple Moving Average
|
|
192
|
+
const sma = (X, w) =>{
|
|
193
|
+
let r = [];
|
|
194
|
+
for (let i = 0; i <= X.length - w; i++) {
|
|
195
|
+
let s = 0;
|
|
196
|
+
for (let j = 0; j < w; j++) s += X[i + j];
|
|
197
|
+
r.push(s / w);
|
|
198
|
+
}
|
|
199
|
+
return r;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// exponential Moving Average
|
|
203
|
+
const ema = (X, alpha) =>{
|
|
204
|
+
let r = [], prev = X[0];
|
|
205
|
+
r.push(prev);
|
|
206
|
+
for (let i = 1; i < X.length; i++) {
|
|
207
|
+
prev = alpha * X[i] + (1 - alpha) * prev;
|
|
208
|
+
r.push(prev);
|
|
209
|
+
}
|
|
210
|
+
return r;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// weightedMovingAverage
|
|
214
|
+
const wma = (X, weights) =>{
|
|
215
|
+
let k = weights.length;
|
|
216
|
+
let sw = weights.reduce((a,b)=>a+b, 0);
|
|
217
|
+
let r = [];
|
|
218
|
+
for (let i = 0; i <= X.length - k; i++) {
|
|
219
|
+
let s = 0;
|
|
220
|
+
for (let j = 0; j < k; j++) s += X[i+j] * weights[j];
|
|
221
|
+
r.push(s / sw);
|
|
222
|
+
}
|
|
223
|
+
return r;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const accum_sum = (arr) => {
|
|
227
|
+
let result = [];
|
|
228
|
+
let total = 0;
|
|
229
|
+
for (let x of arr) {
|
|
230
|
+
total += x;
|
|
147
231
|
result.push(total);
|
|
148
232
|
}
|
|
149
233
|
return result;
|
|
150
234
|
};
|
|
151
235
|
|
|
152
|
-
const
|
|
236
|
+
const accum_product = (arr) => {
|
|
153
237
|
let result = [];
|
|
154
|
-
let prod = 1
|
|
155
|
-
for(
|
|
156
|
-
prod
|
|
238
|
+
let prod = 1;
|
|
239
|
+
for (let x of arr) {
|
|
240
|
+
prod *= x;
|
|
157
241
|
result.push(prod);
|
|
158
242
|
}
|
|
159
243
|
return result;
|
|
160
244
|
};
|
|
161
245
|
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return a[i];
|
|
171
|
-
return a[i] * (1 - f) + a[i + 1] * f;
|
|
246
|
+
const accum_max = (arr) => {
|
|
247
|
+
let result = [];
|
|
248
|
+
let m = -Infinity;
|
|
249
|
+
for (let x of arr) {
|
|
250
|
+
m = Math.max(m, x);
|
|
251
|
+
result.push(m);
|
|
252
|
+
}
|
|
253
|
+
return result;
|
|
172
254
|
};
|
|
173
255
|
|
|
174
|
-
const
|
|
256
|
+
const accum_min = (arr) => {
|
|
257
|
+
let result = [];
|
|
258
|
+
let m = Infinity;
|
|
259
|
+
for (let x of arr) {
|
|
260
|
+
m = Math.min(m, x);
|
|
261
|
+
result.push(m);
|
|
262
|
+
}
|
|
263
|
+
return result;
|
|
264
|
+
};
|
|
175
265
|
|
|
176
266
|
class Random {
|
|
177
267
|
static int(a, b){
|
|
@@ -246,9 +336,9 @@ class Random {
|
|
|
246
336
|
static get sample(){
|
|
247
337
|
const R = this;
|
|
248
338
|
return {
|
|
249
|
-
int : (n,a,b) => Array.from({length:n}, () => R.int(a,b)),
|
|
250
|
-
float : (n,a,b) => Array.from({length:n}, () => R.float(a,b)),
|
|
251
|
-
char : (n,upper=false) => Array.from({length:n}, () => R.char(upper)),
|
|
339
|
+
int : (n, a, b) => Array.from({length:n}, () => R.int(a, b)),
|
|
340
|
+
float : (n, a, b) => Array.from({length:n}, () => R.float(a, b)),
|
|
341
|
+
char : (n, upper=false) => Array.from({length:n}, () => R.char(upper)),
|
|
252
342
|
bool : n => Array.from({length:n}, () => R.bool()),
|
|
253
343
|
bin : n => Array.from({length:n}, () => R.bin()),
|
|
254
344
|
oct : n => Array.from({length:n}, () => R.oct()),
|
|
@@ -889,6 +979,63 @@ const sig = (...x) => mapfun$1(
|
|
|
889
979
|
...x
|
|
890
980
|
);
|
|
891
981
|
|
|
982
|
+
const arithmetic_helper=(op, x, y)=>{
|
|
983
|
+
if(typeof x === 'number'){
|
|
984
|
+
if(typeof y === 'number'){
|
|
985
|
+
switch(op){
|
|
986
|
+
case 'add' : return x + y;
|
|
987
|
+
case 'sub' : return x - y;
|
|
988
|
+
case 'mul' : return x * y;
|
|
989
|
+
case 'div' : return x / y;
|
|
990
|
+
case 'modulo' : return x % y;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
if(y?.isComplex?.()) x = new y.constructor(x, 0);
|
|
994
|
+
if(y?.isMatrix?.()) x = y.constructor.nums(y.rows, y.cols, x);
|
|
995
|
+
return x[op](y)
|
|
996
|
+
}
|
|
997
|
+
if(x?.isComplex?.()){
|
|
998
|
+
if(typeof y === 'number' || y?.isComplex?.()) return x.clone()[op](y);
|
|
999
|
+
if(y?.isMatrix?.()){
|
|
1000
|
+
x = y.constructor.nums(y.rows, y.cols, x);
|
|
1001
|
+
return x.clone()[op](y)
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
if(x?.isMatrix?.()){
|
|
1005
|
+
return x.clone()[op](y)
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
const add=(a,...b)=>{
|
|
1009
|
+
let res = a;
|
|
1010
|
+
for(let i=0; i<b.length; i++)
|
|
1011
|
+
res = arithmetic_helper('add', res, b[i]);
|
|
1012
|
+
return res;
|
|
1013
|
+
};
|
|
1014
|
+
const sub=(a,...b)=>{
|
|
1015
|
+
let res = a;
|
|
1016
|
+
for(let i=0; i<b.length; i++)
|
|
1017
|
+
res = arithmetic_helper('sub', res, b[i]);
|
|
1018
|
+
return res;
|
|
1019
|
+
};
|
|
1020
|
+
const mul=(a,...b)=>{
|
|
1021
|
+
let res = a;
|
|
1022
|
+
for(let i=0; i<b.length; i++)
|
|
1023
|
+
res = arithmetic_helper('mul', res, b[i]);
|
|
1024
|
+
return res;
|
|
1025
|
+
};
|
|
1026
|
+
const div=(a,...b)=>{
|
|
1027
|
+
let res = a;
|
|
1028
|
+
for(let i=0; i<b.length; i++)
|
|
1029
|
+
res = arithmetic_helper('div', res, b[i]);
|
|
1030
|
+
return res;
|
|
1031
|
+
};
|
|
1032
|
+
const modulo=(a,...b)=>{
|
|
1033
|
+
let res = a;
|
|
1034
|
+
for(let i=0; i<b.length; i++)
|
|
1035
|
+
res = arithmetic_helper('modulo', res, b[i]);
|
|
1036
|
+
return res;
|
|
1037
|
+
};
|
|
1038
|
+
|
|
892
1039
|
const deg2rad = (...deg) => mapfun$1(x => x * Math.PI / 180, ...deg);
|
|
893
1040
|
const rad2deg = (...rad) => mapfun$1(x => x / Math.PI * 180, ...rad);
|
|
894
1041
|
|
|
@@ -933,6 +1080,66 @@ const atan2 = (y, x, rad = true) => {
|
|
|
933
1080
|
return rad ? phi : phi * 180 / Math.PI;
|
|
934
1081
|
};
|
|
935
1082
|
|
|
1083
|
+
const min = (...x) => Math.min(...x);
|
|
1084
|
+
const max = (...x) => Math.max(...x);
|
|
1085
|
+
|
|
1086
|
+
const binomial = (n, k) =>{
|
|
1087
|
+
if(n !== Math.floor(n)) return TypeError('n must be an integer');
|
|
1088
|
+
if(k !== Math.floor(k)) return TypeError('k must be an integer');
|
|
1089
|
+
if (n < 0) return TypeError('n must be non-negative');
|
|
1090
|
+
if (k < 0 || n < 0 || k > n) return 0;
|
|
1091
|
+
if (k > n - k) k = n - k;
|
|
1092
|
+
let c = 1, i;
|
|
1093
|
+
for (i = 0; i < k; i++)
|
|
1094
|
+
c = c * (n - i) / (i + 1);
|
|
1095
|
+
return c;
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
// export const mean = (...x) => x.reduce((a, b) => a + b) / x.length;
|
|
1099
|
+
|
|
1100
|
+
// export const variance = (...x) => {
|
|
1101
|
+
// const n = x.length;
|
|
1102
|
+
// if (n === 0) return NaN;
|
|
1103
|
+
// const x_mean = mean(...x);
|
|
1104
|
+
// return x.reduce((sum, xi) => sum + (xi - x_mean) ** 2, 0) / n;
|
|
1105
|
+
// };
|
|
1106
|
+
|
|
1107
|
+
// export const std = (...x) => Math.sqrt(variance(...x));
|
|
1108
|
+
|
|
1109
|
+
// export const accum_sum = (...x) => {
|
|
1110
|
+
// let result = [];
|
|
1111
|
+
// let total = 0, i, n = x.length;
|
|
1112
|
+
// for(i = 0; i < n ; i++){
|
|
1113
|
+
// total = add(total, x[i])
|
|
1114
|
+
// result.push(total);
|
|
1115
|
+
// }
|
|
1116
|
+
// return result;
|
|
1117
|
+
// };
|
|
1118
|
+
|
|
1119
|
+
const accum_prod = (...x) => {
|
|
1120
|
+
let result = [];
|
|
1121
|
+
let prod = 1, i, n = x.length;
|
|
1122
|
+
for(i = 0; i < n ; i++){
|
|
1123
|
+
prod = mul(prod, x[i]);
|
|
1124
|
+
result.push(prod);
|
|
1125
|
+
}
|
|
1126
|
+
return result;
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
// export const percentile = (X, p) => {
|
|
1130
|
+
// if (X.length === 0)
|
|
1131
|
+
// return NaN;
|
|
1132
|
+
// let a = [...X].sort((x, y) => x - y);
|
|
1133
|
+
// let index = (p / 100) * (a.length - 1);
|
|
1134
|
+
// let i = Math.floor(index);
|
|
1135
|
+
// let f = index - i;
|
|
1136
|
+
// if (i === a.length - 1)
|
|
1137
|
+
// return a[i];
|
|
1138
|
+
// return a[i] * (1 - f) + a[i + 1] * f;
|
|
1139
|
+
// }
|
|
1140
|
+
|
|
1141
|
+
// export const median = X => percentile(X, 50);
|
|
1142
|
+
|
|
936
1143
|
const not = x => {
|
|
937
1144
|
if(x.isComplex?.()) return new x.constructor(not(x.a), not(x.b))
|
|
938
1145
|
if(x.isMatrix?.()) return new x.constructor(x.rows, x.cols, x.arr.flat(1).map(not))
|
|
@@ -2891,7 +3098,14 @@ let UIElement$1 = class UIElement extends UIElementCore{
|
|
|
2891
3098
|
|
|
2892
3099
|
if(element)this.init(element, name, type, render);
|
|
2893
3100
|
}
|
|
2894
|
-
on(event_name, callback, {details_setter, category = 'global', isCustom = false,preventDefault = false} = {}){
|
|
3101
|
+
on(event_name, callback, {details_setter, category = 'global', isCustom = false, preventDefault = false} = {}){
|
|
3102
|
+
if(event_name instanceof Array) event_name.forEach(
|
|
3103
|
+
event => this.on(
|
|
3104
|
+
event,
|
|
3105
|
+
callback,
|
|
3106
|
+
{details_setter, category, isCustom, preventDefault}
|
|
3107
|
+
)
|
|
3108
|
+
);
|
|
2895
3109
|
if(category && !this.exp.events.hasOwnProperty(category)) this.exp.events[category] = new EventController(this, category);
|
|
2896
3110
|
isCustom && this.exp.events[category].cache.customEvents.add(event_name);
|
|
2897
3111
|
const EVENT = this.exp.events[category];
|
|
@@ -3573,6 +3787,22 @@ class UIFragment extends UIElement$1{
|
|
|
3573
3787
|
|
|
3574
3788
|
const Fragment = (...items) => new UIFragment(...items);
|
|
3575
3789
|
|
|
3790
|
+
class UIFor extends UIFragment{
|
|
3791
|
+
constructor({each, fallback, mapFn = () => {}} = {}){
|
|
3792
|
+
super();
|
|
3793
|
+
this.config = {
|
|
3794
|
+
each,
|
|
3795
|
+
fallback,
|
|
3796
|
+
mapFn
|
|
3797
|
+
};
|
|
3798
|
+
this.append(
|
|
3799
|
+
...this.config.each.map((n,i) => this.config.mapFn(n, i))
|
|
3800
|
+
);
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
const For = ({each, fallback, mapFn} = {}) => new UIFor({each, fallback, mapFn});
|
|
3805
|
+
|
|
3576
3806
|
const { PI, sqrt: sqrt$1, cos: cos$2, sin: sin$2, acos, pow } = Math;
|
|
3577
3807
|
|
|
3578
3808
|
const linear = t => t;
|
|
@@ -4989,6 +5219,7 @@ exports.EPSILON = EPSILON;
|
|
|
4989
5219
|
exports.EventController = EventController;
|
|
4990
5220
|
exports.FileBasedRouting = FileBasedRouting;
|
|
4991
5221
|
exports.Flex = Flex;
|
|
5222
|
+
exports.For = For;
|
|
4992
5223
|
exports.Fragment = Fragment;
|
|
4993
5224
|
exports.HTMLWrapper = HTMLWrapper;
|
|
4994
5225
|
exports.KeyListeners = KeyListeners;
|
|
@@ -5026,7 +5257,10 @@ exports.ZikoSPA = ZikoSPA;
|
|
|
5026
5257
|
exports.ZikoUISuspense = ZikoUISuspense;
|
|
5027
5258
|
exports.ZikoUIText = ZikoUIText;
|
|
5028
5259
|
exports.abs = abs;
|
|
5260
|
+
exports.accum_max = accum_max;
|
|
5261
|
+
exports.accum_min = accum_min;
|
|
5029
5262
|
exports.accum_prod = accum_prod;
|
|
5263
|
+
exports.accum_product = accum_product;
|
|
5030
5264
|
exports.accum_sum = accum_sum;
|
|
5031
5265
|
exports.acos = acos$1;
|
|
5032
5266
|
exports.acosh = acosh;
|
|
@@ -5052,6 +5286,7 @@ exports.clamp = clamp;
|
|
|
5052
5286
|
exports.clock = clock;
|
|
5053
5287
|
exports.cloneUI = cloneUI;
|
|
5054
5288
|
exports.complex = complex;
|
|
5289
|
+
exports.contraharmonic_mean = contraharmonic_mean;
|
|
5055
5290
|
exports.cos = cos$3;
|
|
5056
5291
|
exports.cosh = cosh$2;
|
|
5057
5292
|
exports.coth = coth;
|
|
@@ -5068,9 +5303,12 @@ exports.deg2rad = deg2rad;
|
|
|
5068
5303
|
exports.discret = discret;
|
|
5069
5304
|
exports.div = div;
|
|
5070
5305
|
exports.elastic = elastic;
|
|
5306
|
+
exports.ema = ema;
|
|
5071
5307
|
exports.exp = exp$1;
|
|
5072
5308
|
exports.floor = floor;
|
|
5073
5309
|
exports.fract = fract;
|
|
5310
|
+
exports.geo_mean = geo_mean;
|
|
5311
|
+
exports.harmonic_mean = harmonic_mean;
|
|
5074
5312
|
exports.hypot = hypot;
|
|
5075
5313
|
exports.in_back = in_back;
|
|
5076
5314
|
exports.in_bounce = in_bounce;
|
|
@@ -5092,6 +5330,8 @@ exports.in_quad = in_quad;
|
|
|
5092
5330
|
exports.in_quart = in_quart;
|
|
5093
5331
|
exports.in_quint = in_quint;
|
|
5094
5332
|
exports.in_sin = in_sin;
|
|
5333
|
+
exports.interquartile_mean = interquartile_mean;
|
|
5334
|
+
exports.iqr = iqr;
|
|
5095
5335
|
exports.isPrimitive = isPrimitive;
|
|
5096
5336
|
exports.isStateGetter = isStateGetter;
|
|
5097
5337
|
exports.json2arr = json2arr;
|
|
@@ -5116,6 +5356,8 @@ exports.matrix4 = matrix4;
|
|
|
5116
5356
|
exports.max = max;
|
|
5117
5357
|
exports.mean = mean;
|
|
5118
5358
|
exports.median = median;
|
|
5359
|
+
exports.midhinge = midhinge;
|
|
5360
|
+
exports.midrange = midrange;
|
|
5119
5361
|
exports.min = min;
|
|
5120
5362
|
exports.modulo = modulo;
|
|
5121
5363
|
exports.mul = mul;
|
|
@@ -5123,6 +5365,7 @@ exports.nand = nand;
|
|
|
5123
5365
|
exports.nor = nor;
|
|
5124
5366
|
exports.norm = norm;
|
|
5125
5367
|
exports.normalize_css_value = normalize_css_value;
|
|
5368
|
+
exports.not = not;
|
|
5126
5369
|
exports.nthr = nthr;
|
|
5127
5370
|
exports.or = or;
|
|
5128
5371
|
exports.out_back = out_back;
|
|
@@ -5137,12 +5380,20 @@ exports.out_quint = out_quint;
|
|
|
5137
5380
|
exports.out_sin = out_sin;
|
|
5138
5381
|
exports.percentile = percentile;
|
|
5139
5382
|
exports.pow = pow$1;
|
|
5383
|
+
exports.power_mean = power_mean;
|
|
5384
|
+
exports.q1 = q1;
|
|
5385
|
+
exports.q3 = q3;
|
|
5140
5386
|
exports.rad2deg = rad2deg;
|
|
5141
5387
|
exports.register_click_away_event = register_click_away_event;
|
|
5142
5388
|
exports.register_swipe_event = register_swipe_event;
|
|
5143
5389
|
exports.register_view_event = register_view_event;
|
|
5144
5390
|
exports.remove_class = remove_class;
|
|
5391
|
+
exports.rms = rms;
|
|
5392
|
+
exports.rolling_std = rolling_std;
|
|
5393
|
+
exports.rolling_variance = rolling_variance;
|
|
5145
5394
|
exports.round = round;
|
|
5395
|
+
exports.sample_std = sample_std;
|
|
5396
|
+
exports.sample_variance = sample_variance;
|
|
5146
5397
|
exports.script = script;
|
|
5147
5398
|
exports.sec = sec;
|
|
5148
5399
|
exports.sig = sig;
|
|
@@ -5150,6 +5401,7 @@ exports.sign = sign;
|
|
|
5150
5401
|
exports.sin = sin$3;
|
|
5151
5402
|
exports.sinh = sinh$1;
|
|
5152
5403
|
exports.sleep = sleep;
|
|
5404
|
+
exports.sma = sma;
|
|
5153
5405
|
exports.sqrt = sqrt$2;
|
|
5154
5406
|
exports.std = std;
|
|
5155
5407
|
exports.step = step;
|
|
@@ -5169,6 +5421,7 @@ exports.tick = tick;
|
|
|
5169
5421
|
exports.timeTaken = timeTaken;
|
|
5170
5422
|
exports.time_memory_Taken = time_memory_Taken;
|
|
5171
5423
|
exports.timeout = timeout;
|
|
5424
|
+
exports.trimmed_mean = trimmed_mean;
|
|
5172
5425
|
exports.trunc = trunc;
|
|
5173
5426
|
exports.useDerived = useDerived;
|
|
5174
5427
|
exports.useEventEmitter = useEventEmitter;
|
|
@@ -5188,5 +5441,10 @@ exports.waitElm = waitElm;
|
|
|
5188
5441
|
exports.waitForUIElm = waitForUIElm;
|
|
5189
5442
|
exports.waitForUIElmSync = waitForUIElmSync;
|
|
5190
5443
|
exports.watchQueryParams = watchQueryParams;
|
|
5444
|
+
exports.weighted_mean = weighted_mean;
|
|
5445
|
+
exports.weighted_std = weighted_std;
|
|
5446
|
+
exports.weighted_variance = weighted_variance;
|
|
5447
|
+
exports.winsorized_mean = winsorized_mean;
|
|
5448
|
+
exports.wma = wma;
|
|
5191
5449
|
exports.xnor = xnor;
|
|
5192
5450
|
exports.xor = xor;
|