ziko 1.3.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 +362 -90
- package/dist/ziko.js +362 -90
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +333 -91
- package/package.json +1 -1
- package/src/dom/components/for/index.js +17 -0
- package/src/dom/components/fragment/index.d.ts +36 -0
- package/src/dom/components/fragment/index.js +13 -0
- package/src/dom/components/index.js +3 -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.js
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
|
|
@@ -60,122 +60,212 @@
|
|
|
60
60
|
return dec.toString(toBase);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
if(y?.isComplex?.()) x = new y.constructor(x, 0);
|
|
75
|
-
if(y?.isMatrix?.()) x = y.constructor.nums(y.rows, y.cols, x);
|
|
76
|
-
return x[op](y)
|
|
77
|
-
}
|
|
78
|
-
if(x?.isComplex?.()){
|
|
79
|
-
if(typeof y === 'number' || y?.isComplex?.()) return x.clone()[op](y);
|
|
80
|
-
if(y?.isMatrix?.()){
|
|
81
|
-
x = y.constructor.nums(y.rows, y.cols, x);
|
|
82
|
-
return x.clone()[op](y)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if(x?.isMatrix?.()){
|
|
86
|
-
return x.clone()[op](y)
|
|
87
|
-
}
|
|
63
|
+
const percentile = (X, p) => {
|
|
64
|
+
if (X.length === 0)
|
|
65
|
+
return NaN;
|
|
66
|
+
let a = X.sort((x, y) => x - y);
|
|
67
|
+
let index = (p / 100) * (a.length - 1);
|
|
68
|
+
let i = Math.floor(index);
|
|
69
|
+
let f = index - i;
|
|
70
|
+
if (i === a.length - 1)
|
|
71
|
+
return a[i];
|
|
72
|
+
return a[i] * (1 - f) + a[i + 1] * f;
|
|
88
73
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
74
|
+
|
|
75
|
+
const q1 = X => percentile(X, 25);
|
|
76
|
+
const median = X => percentile(X, 50);
|
|
77
|
+
const q3 = X => percentile(X, 75);
|
|
78
|
+
|
|
79
|
+
// Interquartile Range
|
|
80
|
+
const iqr = X => q3(X) - q1(X);
|
|
81
|
+
|
|
82
|
+
// Mean
|
|
83
|
+
const mean = (...x) => x.reduce((a, b) => a + b) / x.length;
|
|
84
|
+
const geo_mean = (...x) => (x.reduce((a, b) => a * b)) ** (1/x.length);
|
|
85
|
+
// Quadratic Mean
|
|
86
|
+
const rms = (...x) => {
|
|
87
|
+
const n = x.length;
|
|
88
|
+
return (Math.hypot(...x)/n)**(1/n)
|
|
94
89
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
|
|
91
|
+
const weighted_mean=(values, weights)=>{
|
|
92
|
+
let sum = 0, sw = 0;
|
|
93
|
+
for (let i = 0; i < values.length; i++) {
|
|
94
|
+
sum += values[i] * weights[i];
|
|
95
|
+
sw += weights[i];
|
|
96
|
+
}
|
|
97
|
+
return sum / sw;
|
|
100
98
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
|
|
100
|
+
const harmonic_mean = (...x) => {
|
|
101
|
+
let s = 0, i = 0;
|
|
102
|
+
for(i=0; i<x.length; i++)
|
|
103
|
+
s += 1/x[i];
|
|
104
|
+
return x.length / s;
|
|
106
105
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
|
|
107
|
+
const power_mean = (X, p) =>{
|
|
108
|
+
let s = 0, i = 0, l = X.length;
|
|
109
|
+
for(i=0; i < l; i++)
|
|
110
|
+
s+= X[i]**p;
|
|
111
|
+
return (s / l) ** (1 / p);
|
|
112
112
|
};
|
|
113
|
-
const modulo=(a,...b)=>{
|
|
114
|
-
let res = a;
|
|
115
|
-
for(let i=0; i<b.length; i++)
|
|
116
|
-
res = arithmetic_helper('modulo', res, b[i]);
|
|
117
|
-
return res;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const min = (...x) => Math.min(...x);
|
|
121
|
-
const max = (...x) => Math.max(...x);
|
|
122
113
|
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
114
|
+
const trimmed_mean = (X, k) =>{
|
|
115
|
+
let a = [...X].sort((a,b)=>a-b).slice(k, X.length - k);
|
|
116
|
+
return mean(...a);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const winsorized_mean = (X, k) =>{
|
|
120
|
+
let a = [...X].sort((a,b)=>a-b);
|
|
121
|
+
let low = a[k], high = a[a.length - k - 1];
|
|
122
|
+
a = a.map(x => Math.max(low, Math.min(high, x)));
|
|
123
|
+
return mean(a);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const midrange = (x) =>{
|
|
127
|
+
let min = Math.min(...x);
|
|
128
|
+
let max = Math.max(...x);
|
|
129
|
+
return (min + max) / 2;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const midhinge = (...x) =>{
|
|
133
|
+
let a = x.sort((a,b)=>a-b);
|
|
134
|
+
let q1 = a[Math.floor((a.length - 1) * 0.25)];
|
|
135
|
+
let q3 = a[Math.floor((a.length - 1) * 0.75)];
|
|
136
|
+
return (q1 + q3) / 2;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
const interquartile_mean = (...x) =>{
|
|
141
|
+
let a = x.sort((a,b)=>a-b);
|
|
142
|
+
let q1 = a[Math.floor((a.length - 1) * 0.25)];
|
|
143
|
+
let q3 = a[Math.floor((a.length - 1) * 0.75)];
|
|
144
|
+
let m = a.filter(x => x >= q1 && x <= q3);
|
|
145
|
+
return mean(m);
|
|
133
146
|
};
|
|
134
147
|
|
|
135
|
-
const mean = (...x) => x.reduce((a, b) => a + b) / x.length;
|
|
136
148
|
|
|
149
|
+
const contraharmonic_mean = (...x) =>{
|
|
150
|
+
let num = 0, den = 0, i, l = x.length;
|
|
151
|
+
for(i = 0; i < l; i++){
|
|
152
|
+
num += x[i]**2;
|
|
153
|
+
den += x[i];
|
|
154
|
+
}
|
|
155
|
+
return num / den;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// Population Variance
|
|
137
159
|
const variance = (...x) => {
|
|
138
160
|
const n = x.length;
|
|
139
161
|
if (n === 0) return NaN;
|
|
140
162
|
const x_mean = mean(...x);
|
|
141
163
|
return x.reduce((sum, xi) => sum + (xi - x_mean) ** 2, 0) / n;
|
|
142
164
|
};
|
|
143
|
-
|
|
144
165
|
const std = (...x) => Math.sqrt(variance(...x));
|
|
145
166
|
|
|
146
|
-
const
|
|
167
|
+
const sample_variance = (...x) => {
|
|
168
|
+
const n = x.length;
|
|
169
|
+
if (n < 2) return NaN;
|
|
170
|
+
const x_mean = mean(...x);
|
|
171
|
+
return x.reduce((sum, xi) => sum + (xi - x_mean) ** 2, 0) / (n - 1);
|
|
172
|
+
};
|
|
173
|
+
const sample_std = (...x) => Math.sqrt(sample_variance(...x));
|
|
174
|
+
|
|
175
|
+
const weighted_variance = (X, weights) => {
|
|
176
|
+
const n = X.length;
|
|
177
|
+
if (n === 0 || weights.length !== n) return NaN;
|
|
178
|
+
const sw = weights.reduce((sum, w) => sum + w, 0);
|
|
179
|
+
const mean = X.reduce((sum, x, i) => sum + x * weights[i], 0) / sw;
|
|
180
|
+
return X.reduce((sum, x, i) => sum + weights[i] * (x - mean) ** 2, 0) / sw;
|
|
181
|
+
};
|
|
182
|
+
const weighted_std = (X, weights) => Math.sqrt(weighted_variance(X, weights));
|
|
183
|
+
|
|
184
|
+
const rolling_variance = (X, windowSize) => {
|
|
185
|
+
if (windowSize < 1 || X.length < windowSize) return [];
|
|
147
186
|
let result = [];
|
|
148
|
-
let
|
|
149
|
-
|
|
150
|
-
|
|
187
|
+
for (let i = 0; i <= X.length - windowSize; i++) {
|
|
188
|
+
const w = X.slice(i, i + windowSize);
|
|
189
|
+
result.push(sample_variance(w)); // usually sample variance for rolling
|
|
190
|
+
}
|
|
191
|
+
return result;
|
|
192
|
+
};
|
|
193
|
+
const rolling_std = (X, windowSize) => Math.sqrt(rolling_variance(X, windowSize));
|
|
194
|
+
|
|
195
|
+
// Simple Moving Average
|
|
196
|
+
const sma = (X, w) =>{
|
|
197
|
+
let r = [];
|
|
198
|
+
for (let i = 0; i <= X.length - w; i++) {
|
|
199
|
+
let s = 0;
|
|
200
|
+
for (let j = 0; j < w; j++) s += X[i + j];
|
|
201
|
+
r.push(s / w);
|
|
202
|
+
}
|
|
203
|
+
return r;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// exponential Moving Average
|
|
207
|
+
const ema = (X, alpha) =>{
|
|
208
|
+
let r = [], prev = X[0];
|
|
209
|
+
r.push(prev);
|
|
210
|
+
for (let i = 1; i < X.length; i++) {
|
|
211
|
+
prev = alpha * X[i] + (1 - alpha) * prev;
|
|
212
|
+
r.push(prev);
|
|
213
|
+
}
|
|
214
|
+
return r;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// weightedMovingAverage
|
|
218
|
+
const wma = (X, weights) =>{
|
|
219
|
+
let k = weights.length;
|
|
220
|
+
let sw = weights.reduce((a,b)=>a+b, 0);
|
|
221
|
+
let r = [];
|
|
222
|
+
for (let i = 0; i <= X.length - k; i++) {
|
|
223
|
+
let s = 0;
|
|
224
|
+
for (let j = 0; j < k; j++) s += X[i+j] * weights[j];
|
|
225
|
+
r.push(s / sw);
|
|
226
|
+
}
|
|
227
|
+
return r;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const accum_sum = (arr) => {
|
|
231
|
+
let result = [];
|
|
232
|
+
let total = 0;
|
|
233
|
+
for (let x of arr) {
|
|
234
|
+
total += x;
|
|
151
235
|
result.push(total);
|
|
152
236
|
}
|
|
153
237
|
return result;
|
|
154
238
|
};
|
|
155
239
|
|
|
156
|
-
const
|
|
240
|
+
const accum_product = (arr) => {
|
|
157
241
|
let result = [];
|
|
158
|
-
let prod = 1
|
|
159
|
-
for(
|
|
160
|
-
prod
|
|
242
|
+
let prod = 1;
|
|
243
|
+
for (let x of arr) {
|
|
244
|
+
prod *= x;
|
|
161
245
|
result.push(prod);
|
|
162
246
|
}
|
|
163
247
|
return result;
|
|
164
248
|
};
|
|
165
249
|
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
return a[i];
|
|
175
|
-
return a[i] * (1 - f) + a[i + 1] * f;
|
|
250
|
+
const accum_max = (arr) => {
|
|
251
|
+
let result = [];
|
|
252
|
+
let m = -Infinity;
|
|
253
|
+
for (let x of arr) {
|
|
254
|
+
m = Math.max(m, x);
|
|
255
|
+
result.push(m);
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
176
258
|
};
|
|
177
259
|
|
|
178
|
-
const
|
|
260
|
+
const accum_min = (arr) => {
|
|
261
|
+
let result = [];
|
|
262
|
+
let m = Infinity;
|
|
263
|
+
for (let x of arr) {
|
|
264
|
+
m = Math.min(m, x);
|
|
265
|
+
result.push(m);
|
|
266
|
+
}
|
|
267
|
+
return result;
|
|
268
|
+
};
|
|
179
269
|
|
|
180
270
|
class Random {
|
|
181
271
|
static int(a, b){
|
|
@@ -250,9 +340,9 @@
|
|
|
250
340
|
static get sample(){
|
|
251
341
|
const R = this;
|
|
252
342
|
return {
|
|
253
|
-
int : (n,a,b) => Array.from({length:n}, () => R.int(a,b)),
|
|
254
|
-
float : (n,a,b) => Array.from({length:n}, () => R.float(a,b)),
|
|
255
|
-
char : (n,upper=false) => Array.from({length:n}, () => R.char(upper)),
|
|
343
|
+
int : (n, a, b) => Array.from({length:n}, () => R.int(a, b)),
|
|
344
|
+
float : (n, a, b) => Array.from({length:n}, () => R.float(a, b)),
|
|
345
|
+
char : (n, upper=false) => Array.from({length:n}, () => R.char(upper)),
|
|
256
346
|
bool : n => Array.from({length:n}, () => R.bool()),
|
|
257
347
|
bin : n => Array.from({length:n}, () => R.bin()),
|
|
258
348
|
oct : n => Array.from({length:n}, () => R.oct()),
|
|
@@ -893,6 +983,63 @@
|
|
|
893
983
|
...x
|
|
894
984
|
);
|
|
895
985
|
|
|
986
|
+
const arithmetic_helper=(op, x, y)=>{
|
|
987
|
+
if(typeof x === 'number'){
|
|
988
|
+
if(typeof y === 'number'){
|
|
989
|
+
switch(op){
|
|
990
|
+
case 'add' : return x + y;
|
|
991
|
+
case 'sub' : return x - y;
|
|
992
|
+
case 'mul' : return x * y;
|
|
993
|
+
case 'div' : return x / y;
|
|
994
|
+
case 'modulo' : return x % y;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
if(y?.isComplex?.()) x = new y.constructor(x, 0);
|
|
998
|
+
if(y?.isMatrix?.()) x = y.constructor.nums(y.rows, y.cols, x);
|
|
999
|
+
return x[op](y)
|
|
1000
|
+
}
|
|
1001
|
+
if(x?.isComplex?.()){
|
|
1002
|
+
if(typeof y === 'number' || y?.isComplex?.()) return x.clone()[op](y);
|
|
1003
|
+
if(y?.isMatrix?.()){
|
|
1004
|
+
x = y.constructor.nums(y.rows, y.cols, x);
|
|
1005
|
+
return x.clone()[op](y)
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
if(x?.isMatrix?.()){
|
|
1009
|
+
return x.clone()[op](y)
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
const add=(a,...b)=>{
|
|
1013
|
+
let res = a;
|
|
1014
|
+
for(let i=0; i<b.length; i++)
|
|
1015
|
+
res = arithmetic_helper('add', res, b[i]);
|
|
1016
|
+
return res;
|
|
1017
|
+
};
|
|
1018
|
+
const sub=(a,...b)=>{
|
|
1019
|
+
let res = a;
|
|
1020
|
+
for(let i=0; i<b.length; i++)
|
|
1021
|
+
res = arithmetic_helper('sub', res, b[i]);
|
|
1022
|
+
return res;
|
|
1023
|
+
};
|
|
1024
|
+
const mul=(a,...b)=>{
|
|
1025
|
+
let res = a;
|
|
1026
|
+
for(let i=0; i<b.length; i++)
|
|
1027
|
+
res = arithmetic_helper('mul', res, b[i]);
|
|
1028
|
+
return res;
|
|
1029
|
+
};
|
|
1030
|
+
const div=(a,...b)=>{
|
|
1031
|
+
let res = a;
|
|
1032
|
+
for(let i=0; i<b.length; i++)
|
|
1033
|
+
res = arithmetic_helper('div', res, b[i]);
|
|
1034
|
+
return res;
|
|
1035
|
+
};
|
|
1036
|
+
const modulo=(a,...b)=>{
|
|
1037
|
+
let res = a;
|
|
1038
|
+
for(let i=0; i<b.length; i++)
|
|
1039
|
+
res = arithmetic_helper('modulo', res, b[i]);
|
|
1040
|
+
return res;
|
|
1041
|
+
};
|
|
1042
|
+
|
|
896
1043
|
const deg2rad = (...deg) => mapfun$1(x => x * Math.PI / 180, ...deg);
|
|
897
1044
|
const rad2deg = (...rad) => mapfun$1(x => x / Math.PI * 180, ...rad);
|
|
898
1045
|
|
|
@@ -937,6 +1084,66 @@
|
|
|
937
1084
|
return rad ? phi : phi * 180 / Math.PI;
|
|
938
1085
|
};
|
|
939
1086
|
|
|
1087
|
+
const min = (...x) => Math.min(...x);
|
|
1088
|
+
const max = (...x) => Math.max(...x);
|
|
1089
|
+
|
|
1090
|
+
const binomial = (n, k) =>{
|
|
1091
|
+
if(n !== Math.floor(n)) return TypeError('n must be an integer');
|
|
1092
|
+
if(k !== Math.floor(k)) return TypeError('k must be an integer');
|
|
1093
|
+
if (n < 0) return TypeError('n must be non-negative');
|
|
1094
|
+
if (k < 0 || n < 0 || k > n) return 0;
|
|
1095
|
+
if (k > n - k) k = n - k;
|
|
1096
|
+
let c = 1, i;
|
|
1097
|
+
for (i = 0; i < k; i++)
|
|
1098
|
+
c = c * (n - i) / (i + 1);
|
|
1099
|
+
return c;
|
|
1100
|
+
};
|
|
1101
|
+
|
|
1102
|
+
// export const mean = (...x) => x.reduce((a, b) => a + b) / x.length;
|
|
1103
|
+
|
|
1104
|
+
// export const variance = (...x) => {
|
|
1105
|
+
// const n = x.length;
|
|
1106
|
+
// if (n === 0) return NaN;
|
|
1107
|
+
// const x_mean = mean(...x);
|
|
1108
|
+
// return x.reduce((sum, xi) => sum + (xi - x_mean) ** 2, 0) / n;
|
|
1109
|
+
// };
|
|
1110
|
+
|
|
1111
|
+
// export const std = (...x) => Math.sqrt(variance(...x));
|
|
1112
|
+
|
|
1113
|
+
// export const accum_sum = (...x) => {
|
|
1114
|
+
// let result = [];
|
|
1115
|
+
// let total = 0, i, n = x.length;
|
|
1116
|
+
// for(i = 0; i < n ; i++){
|
|
1117
|
+
// total = add(total, x[i])
|
|
1118
|
+
// result.push(total);
|
|
1119
|
+
// }
|
|
1120
|
+
// return result;
|
|
1121
|
+
// };
|
|
1122
|
+
|
|
1123
|
+
const accum_prod = (...x) => {
|
|
1124
|
+
let result = [];
|
|
1125
|
+
let prod = 1, i, n = x.length;
|
|
1126
|
+
for(i = 0; i < n ; i++){
|
|
1127
|
+
prod = mul(prod, x[i]);
|
|
1128
|
+
result.push(prod);
|
|
1129
|
+
}
|
|
1130
|
+
return result;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
// export const percentile = (X, p) => {
|
|
1134
|
+
// if (X.length === 0)
|
|
1135
|
+
// return NaN;
|
|
1136
|
+
// let a = [...X].sort((x, y) => x - y);
|
|
1137
|
+
// let index = (p / 100) * (a.length - 1);
|
|
1138
|
+
// let i = Math.floor(index);
|
|
1139
|
+
// let f = index - i;
|
|
1140
|
+
// if (i === a.length - 1)
|
|
1141
|
+
// return a[i];
|
|
1142
|
+
// return a[i] * (1 - f) + a[i + 1] * f;
|
|
1143
|
+
// }
|
|
1144
|
+
|
|
1145
|
+
// export const median = X => percentile(X, 50);
|
|
1146
|
+
|
|
940
1147
|
const not = x => {
|
|
941
1148
|
if(x.isComplex?.()) return new x.constructor(not(x.a), not(x.b))
|
|
942
1149
|
if(x.isMatrix?.()) return new x.constructor(x.rows, x.cols, x.arr.flat(1).map(not))
|
|
@@ -2895,7 +3102,14 @@
|
|
|
2895
3102
|
|
|
2896
3103
|
if(element)this.init(element, name, type, render);
|
|
2897
3104
|
}
|
|
2898
|
-
on(event_name, callback, {details_setter, category = 'global', isCustom = false,preventDefault = false} = {}){
|
|
3105
|
+
on(event_name, callback, {details_setter, category = 'global', isCustom = false, preventDefault = false} = {}){
|
|
3106
|
+
if(event_name instanceof Array) event_name.forEach(
|
|
3107
|
+
event => this.on(
|
|
3108
|
+
event,
|
|
3109
|
+
callback,
|
|
3110
|
+
{details_setter, category, isCustom, preventDefault}
|
|
3111
|
+
)
|
|
3112
|
+
);
|
|
2899
3113
|
if(category && !this.exp.events.hasOwnProperty(category)) this.exp.events[category] = new EventController(this, category);
|
|
2900
3114
|
isCustom && this.exp.events[category].cache.customEvents.add(event_name);
|
|
2901
3115
|
const EVENT = this.exp.events[category];
|
|
@@ -3565,6 +3779,34 @@
|
|
|
3565
3779
|
|
|
3566
3780
|
const Swap = call_with_optional_props(UISwap);
|
|
3567
3781
|
|
|
3782
|
+
class UIFragment extends UIElement$1{
|
|
3783
|
+
constructor(...items){
|
|
3784
|
+
super({ element : document.createDocumentFragment()});
|
|
3785
|
+
this.append(...items);
|
|
3786
|
+
}
|
|
3787
|
+
isFragment(){
|
|
3788
|
+
return true
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
const Fragment = (...items) => new UIFragment(...items);
|
|
3793
|
+
|
|
3794
|
+
class UIFor extends UIFragment{
|
|
3795
|
+
constructor({each, fallback, mapFn = () => {}} = {}){
|
|
3796
|
+
super();
|
|
3797
|
+
this.config = {
|
|
3798
|
+
each,
|
|
3799
|
+
fallback,
|
|
3800
|
+
mapFn
|
|
3801
|
+
};
|
|
3802
|
+
this.append(
|
|
3803
|
+
...this.config.each.map((n,i) => this.config.mapFn(n, i))
|
|
3804
|
+
);
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
|
|
3808
|
+
const For = ({each, fallback, mapFn} = {}) => new UIFor({each, fallback, mapFn});
|
|
3809
|
+
|
|
3568
3810
|
const { PI, sqrt: sqrt$1, cos: cos$2, sin: sin$2, acos, pow } = Math;
|
|
3569
3811
|
|
|
3570
3812
|
const linear = t => t;
|
|
@@ -4981,6 +5223,8 @@
|
|
|
4981
5223
|
exports.EventController = EventController;
|
|
4982
5224
|
exports.FileBasedRouting = FileBasedRouting;
|
|
4983
5225
|
exports.Flex = Flex;
|
|
5226
|
+
exports.For = For;
|
|
5227
|
+
exports.Fragment = Fragment;
|
|
4984
5228
|
exports.HTMLWrapper = HTMLWrapper;
|
|
4985
5229
|
exports.KeyListeners = KeyListeners;
|
|
4986
5230
|
exports.Matrix = Matrix;
|
|
@@ -5000,6 +5244,7 @@
|
|
|
5000
5244
|
exports.TimeScheduler = TimeScheduler;
|
|
5001
5245
|
exports.UIElement = UIElement$1;
|
|
5002
5246
|
exports.UIFlex = UIFlex;
|
|
5247
|
+
exports.UIFragment = UIFragment;
|
|
5003
5248
|
exports.UIHTMLWrapper = UIHTMLWrapper;
|
|
5004
5249
|
exports.UINode = UINode;
|
|
5005
5250
|
exports.UISVGWrapper = UISVGWrapper;
|
|
@@ -5016,7 +5261,10 @@
|
|
|
5016
5261
|
exports.ZikoUISuspense = ZikoUISuspense;
|
|
5017
5262
|
exports.ZikoUIText = ZikoUIText;
|
|
5018
5263
|
exports.abs = abs;
|
|
5264
|
+
exports.accum_max = accum_max;
|
|
5265
|
+
exports.accum_min = accum_min;
|
|
5019
5266
|
exports.accum_prod = accum_prod;
|
|
5267
|
+
exports.accum_product = accum_product;
|
|
5020
5268
|
exports.accum_sum = accum_sum;
|
|
5021
5269
|
exports.acos = acos$1;
|
|
5022
5270
|
exports.acosh = acosh;
|
|
@@ -5042,6 +5290,7 @@
|
|
|
5042
5290
|
exports.clock = clock;
|
|
5043
5291
|
exports.cloneUI = cloneUI;
|
|
5044
5292
|
exports.complex = complex;
|
|
5293
|
+
exports.contraharmonic_mean = contraharmonic_mean;
|
|
5045
5294
|
exports.cos = cos$3;
|
|
5046
5295
|
exports.cosh = cosh$2;
|
|
5047
5296
|
exports.coth = coth;
|
|
@@ -5058,9 +5307,12 @@
|
|
|
5058
5307
|
exports.discret = discret;
|
|
5059
5308
|
exports.div = div;
|
|
5060
5309
|
exports.elastic = elastic;
|
|
5310
|
+
exports.ema = ema;
|
|
5061
5311
|
exports.exp = exp$1;
|
|
5062
5312
|
exports.floor = floor;
|
|
5063
5313
|
exports.fract = fract;
|
|
5314
|
+
exports.geo_mean = geo_mean;
|
|
5315
|
+
exports.harmonic_mean = harmonic_mean;
|
|
5064
5316
|
exports.hypot = hypot;
|
|
5065
5317
|
exports.in_back = in_back;
|
|
5066
5318
|
exports.in_bounce = in_bounce;
|
|
@@ -5082,6 +5334,8 @@
|
|
|
5082
5334
|
exports.in_quart = in_quart;
|
|
5083
5335
|
exports.in_quint = in_quint;
|
|
5084
5336
|
exports.in_sin = in_sin;
|
|
5337
|
+
exports.interquartile_mean = interquartile_mean;
|
|
5338
|
+
exports.iqr = iqr;
|
|
5085
5339
|
exports.isPrimitive = isPrimitive;
|
|
5086
5340
|
exports.isStateGetter = isStateGetter;
|
|
5087
5341
|
exports.json2arr = json2arr;
|
|
@@ -5106,6 +5360,8 @@
|
|
|
5106
5360
|
exports.max = max;
|
|
5107
5361
|
exports.mean = mean;
|
|
5108
5362
|
exports.median = median;
|
|
5363
|
+
exports.midhinge = midhinge;
|
|
5364
|
+
exports.midrange = midrange;
|
|
5109
5365
|
exports.min = min;
|
|
5110
5366
|
exports.modulo = modulo;
|
|
5111
5367
|
exports.mul = mul;
|
|
@@ -5113,6 +5369,7 @@
|
|
|
5113
5369
|
exports.nor = nor;
|
|
5114
5370
|
exports.norm = norm;
|
|
5115
5371
|
exports.normalize_css_value = normalize_css_value;
|
|
5372
|
+
exports.not = not;
|
|
5116
5373
|
exports.nthr = nthr;
|
|
5117
5374
|
exports.or = or;
|
|
5118
5375
|
exports.out_back = out_back;
|
|
@@ -5127,12 +5384,20 @@
|
|
|
5127
5384
|
exports.out_sin = out_sin;
|
|
5128
5385
|
exports.percentile = percentile;
|
|
5129
5386
|
exports.pow = pow$1;
|
|
5387
|
+
exports.power_mean = power_mean;
|
|
5388
|
+
exports.q1 = q1;
|
|
5389
|
+
exports.q3 = q3;
|
|
5130
5390
|
exports.rad2deg = rad2deg;
|
|
5131
5391
|
exports.register_click_away_event = register_click_away_event;
|
|
5132
5392
|
exports.register_swipe_event = register_swipe_event;
|
|
5133
5393
|
exports.register_view_event = register_view_event;
|
|
5134
5394
|
exports.remove_class = remove_class;
|
|
5395
|
+
exports.rms = rms;
|
|
5396
|
+
exports.rolling_std = rolling_std;
|
|
5397
|
+
exports.rolling_variance = rolling_variance;
|
|
5135
5398
|
exports.round = round;
|
|
5399
|
+
exports.sample_std = sample_std;
|
|
5400
|
+
exports.sample_variance = sample_variance;
|
|
5136
5401
|
exports.script = script;
|
|
5137
5402
|
exports.sec = sec;
|
|
5138
5403
|
exports.sig = sig;
|
|
@@ -5140,6 +5405,7 @@
|
|
|
5140
5405
|
exports.sin = sin$3;
|
|
5141
5406
|
exports.sinh = sinh$1;
|
|
5142
5407
|
exports.sleep = sleep;
|
|
5408
|
+
exports.sma = sma;
|
|
5143
5409
|
exports.sqrt = sqrt$2;
|
|
5144
5410
|
exports.std = std;
|
|
5145
5411
|
exports.step = step;
|
|
@@ -5159,6 +5425,7 @@
|
|
|
5159
5425
|
exports.timeTaken = timeTaken;
|
|
5160
5426
|
exports.time_memory_Taken = time_memory_Taken;
|
|
5161
5427
|
exports.timeout = timeout;
|
|
5428
|
+
exports.trimmed_mean = trimmed_mean;
|
|
5162
5429
|
exports.trunc = trunc;
|
|
5163
5430
|
exports.useDerived = useDerived;
|
|
5164
5431
|
exports.useEventEmitter = useEventEmitter;
|
|
@@ -5178,6 +5445,11 @@
|
|
|
5178
5445
|
exports.waitForUIElm = waitForUIElm;
|
|
5179
5446
|
exports.waitForUIElmSync = waitForUIElmSync;
|
|
5180
5447
|
exports.watchQueryParams = watchQueryParams;
|
|
5448
|
+
exports.weighted_mean = weighted_mean;
|
|
5449
|
+
exports.weighted_std = weighted_std;
|
|
5450
|
+
exports.weighted_variance = weighted_variance;
|
|
5451
|
+
exports.winsorized_mean = winsorized_mean;
|
|
5452
|
+
exports.wma = wma;
|
|
5181
5453
|
exports.xnor = xnor;
|
|
5182
5454
|
exports.xor = xor;
|
|
5183
5455
|
|