velo-plot 2.0.0 → 2.20.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/{ChartCore-BhQ4j7f5.js → ChartCore-ivzLqxVb.js} +419 -393
- package/dist/ChartCore-ivzLqxVb.js.map +1 -0
- package/dist/{SciPlot-GJvw7GJo.js → SciPlot-CEU4ApgD.js} +2 -2
- package/dist/{SciPlot-GJvw7GJo.js.map → SciPlot-CEU4ApgD.js.map} +1 -1
- package/dist/{axisFormat-SPX-CD5s.js → axisFormat-CzumxpCL.js} +3 -3
- package/dist/axisFormat-CzumxpCL.js.map +1 -0
- package/dist/core/chart/ChartAxisManager.d.ts +2 -0
- package/dist/core/chart/ChartCore.d.ts +15 -0
- package/dist/core/chart/ChartPluginBridge.d.ts +1 -0
- package/dist/core/chart/ChartRenderLoop.d.ts +2 -0
- package/dist/core/chart/ChartStateManager.d.ts +2 -0
- package/dist/core/chart/types.d.ts +5 -0
- package/dist/core/sync/index.d.ts +0 -1
- package/dist/{createStackedChart-DJSmqerD.js → createStackedChart-DxNW0VkF.js} +178 -179
- package/dist/createStackedChart-DxNW0VkF.js.map +1 -0
- package/dist/{index-D7dTq6VB.js → index-BBpJwOct.js} +17 -19
- package/dist/index-BBpJwOct.js.map +1 -0
- package/dist/{index-CUGS98p4.js → index-CaXWSOTk.js} +3 -6
- package/dist/index-CaXWSOTk.js.map +1 -0
- package/dist/{index-CWipqOLP.js → index-qunX30Xu.js} +2 -2
- package/dist/{index-CWipqOLP.js.map → index-qunX30Xu.js.map} +1 -1
- package/dist/{index.core-fpZ1dYN0.js → index.core-COREBDNq.js} +25 -24
- package/dist/{index.core-fpZ1dYN0.js.map → index.core-COREBDNq.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{mockDatafeed-Cdg5hKEo.js → mockDatafeed-927foCM4.js} +2 -2
- package/dist/mockDatafeed-927foCM4.js.map +1 -0
- package/dist/plugins/analysis/contours.d.ts +31 -0
- package/dist/plugins/analysis.js +494 -407
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/broken-axis.js +170 -181
- package/dist/plugins/broken-axis.js.map +1 -1
- package/dist/plugins/forecasting/algorithms.d.ts +7 -2
- package/dist/plugins/forecasting/types.d.ts +13 -3
- package/dist/plugins/forecasting.js +355 -175
- package/dist/plugins/forecasting.js.map +1 -1
- package/dist/plugins/latex/symbols.d.ts +50 -0
- package/dist/plugins/latex/types.d.ts +13 -1
- package/dist/plugins/latex.js +351 -331
- package/dist/plugins/latex.js.map +1 -1
- package/dist/plugins/ml-integration/native-algorithms.d.ts +24 -4
- package/dist/plugins/ml-integration/types.d.ts +19 -0
- package/dist/plugins/ml-integration.js +191 -140
- package/dist/plugins/ml-integration.js.map +1 -1
- package/dist/plugins/pattern-recognition/types.d.ts +28 -1
- package/dist/plugins/pattern-recognition.js +416 -343
- package/dist/plugins/pattern-recognition.js.map +1 -1
- package/dist/plugins/snapshot.js +36 -36
- package/dist/plugins/snapshot.js.map +1 -1
- package/dist/plugins/sync.js +1 -1
- package/dist/plugins/tools.js +1 -1
- package/dist/plugins/virtualization.js +1 -1
- package/dist/react.js +2 -2
- package/dist/symbols-DT0eLlpW.js +568 -0
- package/dist/symbols-DT0eLlpW.js.map +1 -0
- package/dist/trading.js +5 -5
- package/dist/velo-plot.full.js +184 -182
- package/dist/velo-plot.js +3 -3
- package/dist/workers/indicatorsAsync.d.ts +24 -0
- package/package.json +1 -1
- package/dist/ChartCore-BhQ4j7f5.js.map +0 -1
- package/dist/axisFormat-SPX-CD5s.js.map +0 -1
- package/dist/createStackedChart-DJSmqerD.js.map +0 -1
- package/dist/index-CUGS98p4.js.map +0 -1
- package/dist/index-D7dTq6VB.js.map +0 -1
- package/dist/mockDatafeed-Cdg5hKEo.js.map +0 -1
package/dist/plugins/analysis.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { c as
|
|
1
|
+
import { a as F, s as W, d as _, i as z } from "../math-Ddm2EZjj.js";
|
|
2
|
+
import { c as cn } from "../math-Ddm2EZjj.js";
|
|
3
3
|
import { g as E, f as T, d as H, s as X, m as Y, a as N, b as O, v as Z, c as G } from "../utils-BK5UUXxj.js";
|
|
4
|
-
import { h as
|
|
4
|
+
import { h as ln, e as fn, i as un } from "../utils-BK5UUXxj.js";
|
|
5
5
|
import { r as K, e as Q, s as U } from "../indicators--eJGmVox.js";
|
|
6
|
-
import { i as
|
|
6
|
+
import { i as mn, j as gn, g as dn, f as Mn, k as wn, d as pn, m as yn, c as bn, n as Fn, o as An, p as xn, b as In, h as qn, a as Pn, t as vn, v as kn, w as $n } from "../indicators--eJGmVox.js";
|
|
7
7
|
function J(e, r, o, t = {}) {
|
|
8
8
|
const n = e.series.get(r);
|
|
9
9
|
if (!n) throw new Error(`Series ${r} not found`);
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
const
|
|
10
|
+
const c = n.getData();
|
|
11
|
+
if (!c || c.x.length < 2) return "";
|
|
12
|
+
const s = C(c.x, c.y, o, t), a = n.getBounds(), l = (a == null ? void 0 : a.xMin) ?? 0, i = ((a == null ? void 0 : a.xMax) ?? 1) - l, u = 200, h = new Float32Array(u), m = new Float32Array(u);
|
|
13
13
|
for (let d = 0; d < u; d++) {
|
|
14
|
-
const w = l + d / (u - 1) *
|
|
15
|
-
h[d] = w, m[d] =
|
|
14
|
+
const w = l + d / (u - 1) * i;
|
|
15
|
+
h[d] = w, m[d] = s.predict(w);
|
|
16
16
|
}
|
|
17
17
|
const g = `${r}-fit-${Date.now()}`, M = n.getStyle();
|
|
18
18
|
return e.addSeries({
|
|
@@ -28,10 +28,10 @@ function J(e, r, o, t = {}) {
|
|
|
28
28
|
}
|
|
29
29
|
}), e.addAnnotation({
|
|
30
30
|
type: "text",
|
|
31
|
-
x: l +
|
|
32
|
-
y:
|
|
33
|
-
text: `${
|
|
34
|
-
(R² = ${
|
|
31
|
+
x: l + i * 0.05,
|
|
32
|
+
y: s.predict(l + i * 0.05),
|
|
33
|
+
text: `${s.equation}
|
|
34
|
+
(R² = ${s.rSquared.toFixed(4)})`,
|
|
35
35
|
fontSize: 12,
|
|
36
36
|
backgroundColor: "rgba(0,0,0,0.7)",
|
|
37
37
|
color: M.color || "#ffffff",
|
|
@@ -40,50 +40,50 @@ function J(e, r, o, t = {}) {
|
|
|
40
40
|
interactive: !0
|
|
41
41
|
}), g;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const r = e.length, o =
|
|
45
|
-
for (let
|
|
46
|
-
t[
|
|
43
|
+
function q(e) {
|
|
44
|
+
const r = e.length, o = R(r), t = new Float64Array(o);
|
|
45
|
+
for (let c = 0; c < r; c++)
|
|
46
|
+
t[c] = e[c];
|
|
47
47
|
const n = new Array(o);
|
|
48
|
-
for (let
|
|
49
|
-
n[
|
|
50
|
-
|
|
51
|
-
for (let
|
|
52
|
-
const
|
|
53
|
-
for (let l = 0; l < o; l +=
|
|
54
|
-
for (let f = 0; f <
|
|
55
|
-
const
|
|
48
|
+
for (let c = 0; c < o; c++)
|
|
49
|
+
n[c] = { re: t[c], im: 0 };
|
|
50
|
+
A(n);
|
|
51
|
+
for (let c = 2; c <= o; c *= 2) {
|
|
52
|
+
const s = c / 2, a = -2 * Math.PI / c;
|
|
53
|
+
for (let l = 0; l < o; l += c)
|
|
54
|
+
for (let f = 0; f < s; f++) {
|
|
55
|
+
const i = a * f, u = Math.cos(i), h = Math.sin(i), m = l + f, g = l + f + s, M = u * n[g].re - h * n[g].im, d = u * n[g].im + h * n[g].re;
|
|
56
56
|
n[g].re = n[m].re - M, n[g].im = n[m].im - d, n[m].re = n[m].re + M, n[m].im = n[m].im + d;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
return n;
|
|
60
60
|
}
|
|
61
61
|
function V(e) {
|
|
62
|
-
const r = e.length, o = e.map((
|
|
63
|
-
for (let
|
|
64
|
-
n[
|
|
62
|
+
const r = e.length, o = e.map((c) => ({ re: c.re, im: -c.im })), t = tt(o), n = new Float32Array(r);
|
|
63
|
+
for (let c = 0; c < r; c++)
|
|
64
|
+
n[c] = t[c].re / r;
|
|
65
65
|
return n;
|
|
66
66
|
}
|
|
67
67
|
function tt(e) {
|
|
68
68
|
const r = e.length, o = e.map((t) => ({ ...t }));
|
|
69
|
-
|
|
69
|
+
A(o);
|
|
70
70
|
for (let t = 2; t <= r; t *= 2) {
|
|
71
|
-
const n = t / 2,
|
|
72
|
-
for (let
|
|
73
|
-
for (let
|
|
74
|
-
const l =
|
|
71
|
+
const n = t / 2, c = -2 * Math.PI / t;
|
|
72
|
+
for (let s = 0; s < r; s += t)
|
|
73
|
+
for (let a = 0; a < n; a++) {
|
|
74
|
+
const l = c * a, f = Math.cos(l), i = Math.sin(l), u = s + a, h = s + a + n, m = f * o[h].re - i * o[h].im, g = f * o[h].im + i * o[h].re;
|
|
75
75
|
o[h].re = o[u].re - m, o[h].im = o[u].im - g, o[u].re = o[u].re + m, o[u].im = o[u].im + g;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
return o;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function A(e) {
|
|
81
81
|
const r = e.length, o = Math.log2(r);
|
|
82
82
|
for (let t = 0; t < r; t++) {
|
|
83
83
|
const n = nt(t, o);
|
|
84
84
|
if (n > t) {
|
|
85
|
-
const
|
|
86
|
-
e[t] = e[n], e[n] =
|
|
85
|
+
const c = e[t];
|
|
86
|
+
e[t] = e[n], e[n] = c;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -93,49 +93,49 @@ function nt(e, r) {
|
|
|
93
93
|
o = o << 1 | e & 1, e >>= 1;
|
|
94
94
|
return o;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function R(e) {
|
|
97
97
|
let r = 1;
|
|
98
98
|
for (; r < e; ) r *= 2;
|
|
99
99
|
return r;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
const o =
|
|
103
|
-
for (let
|
|
104
|
-
l[
|
|
105
|
-
for (let
|
|
106
|
-
|
|
107
|
-
for (let
|
|
108
|
-
|
|
101
|
+
function L(e, r = 1) {
|
|
102
|
+
const o = q(e), t = o.length, n = t / 2, c = new Float32Array(n), s = new Float32Array(n), a = new Float32Array(n), l = new Float32Array(t), f = new Float32Array(t);
|
|
103
|
+
for (let i = 0; i < t; i++)
|
|
104
|
+
l[i] = o[i].re, f[i] = o[i].im;
|
|
105
|
+
for (let i = 0; i < n; i++)
|
|
106
|
+
c[i] = i * r / t, s[i] = Math.sqrt(o[i].re * o[i].re + o[i].im * o[i].im) / t, a[i] = Math.atan2(o[i].im, o[i].re);
|
|
107
|
+
for (let i = 1; i < n; i++)
|
|
108
|
+
s[i] *= 2;
|
|
109
109
|
return {
|
|
110
|
-
frequency:
|
|
111
|
-
magnitude:
|
|
112
|
-
phase:
|
|
110
|
+
frequency: c,
|
|
111
|
+
magnitude: s,
|
|
112
|
+
phase: a,
|
|
113
113
|
complex: o,
|
|
114
114
|
real: l,
|
|
115
115
|
imag: f
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
const o =
|
|
120
|
-
for (let
|
|
121
|
-
n[
|
|
118
|
+
function Lt(e, r = 1) {
|
|
119
|
+
const o = L(e, r), t = o.frequency.length, n = new Float32Array(t), c = new Float32Array(t);
|
|
120
|
+
for (let s = 0; s < t; s++)
|
|
121
|
+
n[s] = o.magnitude[s] * o.magnitude[s], c[s] = 10 * Math.log10(Math.max(n[s], 1e-20));
|
|
122
122
|
return {
|
|
123
123
|
frequency: o.frequency,
|
|
124
124
|
power: n,
|
|
125
|
-
powerDb:
|
|
125
|
+
powerDb: c
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const t =
|
|
130
|
-
let n = 0,
|
|
131
|
-
for (let
|
|
132
|
-
t.frequency[
|
|
128
|
+
function Ct(e, r = 1, o = 0) {
|
|
129
|
+
const t = L(e, r);
|
|
130
|
+
let n = 0, c = 0;
|
|
131
|
+
for (let s = 0; s < t.magnitude.length; s++)
|
|
132
|
+
t.frequency[s] >= o && t.magnitude[s] > n && (n = t.magnitude[s], c = s);
|
|
133
133
|
return {
|
|
134
|
-
frequency: t.frequency[
|
|
134
|
+
frequency: t.frequency[c],
|
|
135
135
|
magnitude: n
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function St(e) {
|
|
139
139
|
const r = e.length, o = new Float32Array(r);
|
|
140
140
|
for (let t = 0; t < r; t++) {
|
|
141
141
|
const n = 0.5 * (1 - Math.cos(2 * Math.PI * t / (r - 1)));
|
|
@@ -143,7 +143,7 @@ function Ct(e) {
|
|
|
143
143
|
}
|
|
144
144
|
return o;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Bt(e) {
|
|
147
147
|
const r = e.length, o = new Float32Array(r);
|
|
148
148
|
for (let t = 0; t < r; t++) {
|
|
149
149
|
const n = 0.54 - 0.46 * Math.cos(2 * Math.PI * t / (r - 1));
|
|
@@ -151,61 +151,61 @@ function jt(e) {
|
|
|
151
151
|
}
|
|
152
152
|
return o;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
const r = e.length, o = new Float32Array(r), t = 0.42, n = 0.5,
|
|
156
|
-
for (let
|
|
157
|
-
const
|
|
158
|
-
o[
|
|
154
|
+
function Dt(e) {
|
|
155
|
+
const r = e.length, o = new Float32Array(r), t = 0.42, n = 0.5, c = 0.08;
|
|
156
|
+
for (let s = 0; s < r; s++) {
|
|
157
|
+
const a = t - n * Math.cos(2 * Math.PI * s / (r - 1)) + c * Math.cos(4 * Math.PI * s / (r - 1));
|
|
158
|
+
o[s] = e[s] * a;
|
|
159
159
|
}
|
|
160
160
|
return o;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const o =
|
|
164
|
-
for (let
|
|
165
|
-
|
|
162
|
+
function Wt(e, r = 1) {
|
|
163
|
+
const o = q(e), t = o.length, n = t / 2, c = new Float32Array(t), s = new Float32Array(t), a = new Float32Array(t), l = new Float32Array(t), f = new Float32Array(t);
|
|
164
|
+
for (let i = 0; i < t; i++)
|
|
165
|
+
c[i] = o[i].re, s[i] = o[i].im, a[i] = i * r / t, l[i] = Math.sqrt(o[i].re * o[i].re + o[i].im * o[i].im), f[i] = Math.atan2(o[i].im, o[i].re);
|
|
166
166
|
return {
|
|
167
|
-
real:
|
|
168
|
-
imag:
|
|
169
|
-
frequency:
|
|
167
|
+
real: c,
|
|
168
|
+
imag: s,
|
|
169
|
+
frequency: a,
|
|
170
170
|
magnitude: l,
|
|
171
171
|
phase: f,
|
|
172
172
|
length: t,
|
|
173
173
|
nyquist: n
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function _t(e, r) {
|
|
177
177
|
const o = e.length;
|
|
178
178
|
if (r.length !== o)
|
|
179
179
|
throw new Error("Real and imaginary arrays must have the same length");
|
|
180
|
-
const t =
|
|
181
|
-
for (let
|
|
182
|
-
n[
|
|
183
|
-
re:
|
|
184
|
-
im:
|
|
180
|
+
const t = R(o), n = new Array(t);
|
|
181
|
+
for (let i = 0; i < t; i++)
|
|
182
|
+
n[i] = {
|
|
183
|
+
re: i < o ? e[i] : 0,
|
|
184
|
+
im: i < o ? r[i] : 0
|
|
185
185
|
};
|
|
186
|
-
|
|
187
|
-
for (let
|
|
188
|
-
const u =
|
|
189
|
-
for (let m = 0; m < t; m +=
|
|
186
|
+
A(n);
|
|
187
|
+
for (let i = 2; i <= t; i *= 2) {
|
|
188
|
+
const u = i / 2, h = -2 * Math.PI / i;
|
|
189
|
+
for (let m = 0; m < t; m += i)
|
|
190
190
|
for (let g = 0; g < u; g++) {
|
|
191
|
-
const M = h * g, d = Math.cos(M), w = Math.sin(M), p = m + g, y = m + g + u,
|
|
192
|
-
n[y].re = n[p].re -
|
|
191
|
+
const M = h * g, d = Math.cos(M), w = Math.sin(M), p = m + g, y = m + g + u, b = d * n[y].re - w * n[y].im, P = d * n[y].im + w * n[y].re;
|
|
192
|
+
n[y].re = n[p].re - b, n[y].im = n[p].im - P, n[p].re = n[p].re + b, n[p].im = n[p].im + P;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
for (let
|
|
197
|
-
|
|
195
|
+
const c = new Float32Array(t), s = new Float32Array(t), a = new Float32Array(t), l = new Float32Array(t), f = new Float32Array(t);
|
|
196
|
+
for (let i = 0; i < t; i++)
|
|
197
|
+
c[i] = n[i].re, s[i] = n[i].im, a[i] = i / t, l[i] = Math.sqrt(n[i].re * n[i].re + n[i].im * n[i].im), f[i] = Math.atan2(n[i].im, n[i].re);
|
|
198
198
|
return {
|
|
199
|
-
real:
|
|
200
|
-
imag:
|
|
201
|
-
frequency:
|
|
199
|
+
real: c,
|
|
200
|
+
imag: s,
|
|
201
|
+
frequency: a,
|
|
202
202
|
magnitude: l,
|
|
203
203
|
phase: f,
|
|
204
204
|
length: t,
|
|
205
205
|
nyquist: t / 2
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function zt(e) {
|
|
209
209
|
const r = e.length, o = new Float32Array(r), t = new Float32Array(r);
|
|
210
210
|
for (let n = 0; n < r; n++)
|
|
211
211
|
o[n] = e[n].re, t[n] = e[n].im;
|
|
@@ -220,27 +220,27 @@ function et(e, r) {
|
|
|
220
220
|
t[n] = { re: e[n], im: r[n] };
|
|
221
221
|
return t;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function Et(e, r) {
|
|
224
224
|
const o = et(e, r);
|
|
225
225
|
return V(o);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
const r = e.length, t = e.map((
|
|
229
|
-
|
|
230
|
-
for (let
|
|
231
|
-
const
|
|
232
|
-
for (let f = 0; f < r; f +=
|
|
233
|
-
for (let
|
|
234
|
-
const u = l *
|
|
227
|
+
function Tt(e) {
|
|
228
|
+
const r = e.length, t = e.map((s) => ({ re: s.re, im: -s.im })).map((s) => ({ ...s }));
|
|
229
|
+
A(t);
|
|
230
|
+
for (let s = 2; s <= r; s *= 2) {
|
|
231
|
+
const a = s / 2, l = -2 * Math.PI / s;
|
|
232
|
+
for (let f = 0; f < r; f += s)
|
|
233
|
+
for (let i = 0; i < a; i++) {
|
|
234
|
+
const u = l * i, h = Math.cos(u), m = Math.sin(u), g = f + i, M = f + i + a, d = h * t[M].re - m * t[M].im, w = h * t[M].im + m * t[M].re;
|
|
235
235
|
t[M].re = t[g].re - d, t[M].im = t[g].im - w, t[g].re = t[g].re + d, t[g].im = t[g].im + w;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const n = new Float32Array(r),
|
|
239
|
-
for (let
|
|
240
|
-
n[
|
|
241
|
-
return { real: n, imag:
|
|
238
|
+
const n = new Float32Array(r), c = new Float32Array(r);
|
|
239
|
+
for (let s = 0; s < r; s++)
|
|
240
|
+
n[s] = t[s].re / r, c[s] = -t[s].im / r;
|
|
241
|
+
return { real: n, imag: c };
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Ht(e) {
|
|
244
244
|
const r = e.nyquist;
|
|
245
245
|
return {
|
|
246
246
|
real: e.real.slice(0, r),
|
|
@@ -250,11 +250,11 @@ function zt(e) {
|
|
|
250
250
|
phase: e.phase.slice(0, r)
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function C(e, r, o, t = {}) {
|
|
254
254
|
if (e.length < 2) throw new Error("At least 2 points are required for fitting");
|
|
255
255
|
switch (o) {
|
|
256
256
|
case "linear":
|
|
257
|
-
return
|
|
257
|
+
return x(e, r, t);
|
|
258
258
|
case "polynomial":
|
|
259
259
|
return ot(e, r, t.degree ?? 2, t);
|
|
260
260
|
case "exponential":
|
|
@@ -267,44 +267,44 @@ function L(e, r, o, t = {}) {
|
|
|
267
267
|
throw new Error(`Unsupported fit type: ${o}`);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function x(e, r, o) {
|
|
271
271
|
const t = e.length;
|
|
272
|
-
let n = 0,
|
|
272
|
+
let n = 0, c = 0, s = 0, a = 0;
|
|
273
273
|
for (let m = 0; m < t; m++)
|
|
274
|
-
n += e[m],
|
|
275
|
-
const l = (t *
|
|
274
|
+
n += e[m], c += r[m], s += e[m] * r[m], a += e[m] * e[m];
|
|
275
|
+
const l = (t * s - n * c) / (t * a - n * n), f = (c - l * n) / t, i = (m) => l * m + f, u = o.precision ?? 4, h = o.label || "y";
|
|
276
276
|
return {
|
|
277
277
|
type: "linear",
|
|
278
278
|
coefficients: [l, f],
|
|
279
279
|
equation: `${h} = ${l.toFixed(u)}x ${f >= 0 ? "+" : "-"} ${Math.abs(f).toFixed(u)}`,
|
|
280
|
-
rSquared:
|
|
281
|
-
predict:
|
|
280
|
+
rSquared: F(e, r, i),
|
|
281
|
+
predict: i
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
function ot(e, r, o, t) {
|
|
285
|
-
const n = e.length,
|
|
286
|
-
for (let m = 0; m <
|
|
287
|
-
for (let M = 0; M <
|
|
285
|
+
const n = e.length, c = o + 1, s = Array.from({ length: c }, () => new Array(c).fill(0)), a = new Array(c).fill(0);
|
|
286
|
+
for (let m = 0; m < c; m++) {
|
|
287
|
+
for (let M = 0; M < c; M++) {
|
|
288
288
|
let d = 0;
|
|
289
289
|
for (let w = 0; w < n; w++)
|
|
290
290
|
d += Math.pow(e[w], m + M);
|
|
291
|
-
|
|
291
|
+
s[m][M] = d;
|
|
292
292
|
}
|
|
293
293
|
let g = 0;
|
|
294
294
|
for (let M = 0; M < n; M++)
|
|
295
295
|
g += r[M] * Math.pow(e[M], m);
|
|
296
|
-
|
|
296
|
+
a[m] = g;
|
|
297
297
|
}
|
|
298
|
-
const l = W(
|
|
298
|
+
const l = W(s, a), f = (m) => {
|
|
299
299
|
let g = 0;
|
|
300
300
|
for (let M = 0; M < l.length; M++)
|
|
301
301
|
g += l[M] * Math.pow(m, M);
|
|
302
302
|
return g;
|
|
303
|
-
},
|
|
303
|
+
}, i = t.precision ?? 4;
|
|
304
304
|
let u = "y = ";
|
|
305
305
|
for (let m = l.length - 1; m >= 0; m--) {
|
|
306
306
|
const g = l[m];
|
|
307
|
-
m < l.length - 1 ? u += g >= 0 ? " + " : " - " : g < 0 && (u += "-"), u += `${Math.abs(g).toFixed(
|
|
307
|
+
m < l.length - 1 ? u += g >= 0 ? " + " : " - " : g < 0 && (u += "-"), u += `${Math.abs(g).toFixed(i)}${m > 0 ? m > 1 ? `x^${m}` : "x" : ""}`;
|
|
308
308
|
}
|
|
309
309
|
const h = t.label || "y";
|
|
310
310
|
return {
|
|
@@ -312,127 +312,127 @@ function ot(e, r, o, t) {
|
|
|
312
312
|
coefficients: l,
|
|
313
313
|
equation: `${h} = ${u.substring(4)}`,
|
|
314
314
|
// replace "y = " with custom label
|
|
315
|
-
rSquared:
|
|
315
|
+
rSquared: F(e, r, f),
|
|
316
316
|
predict: f
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
function rt(e, r, o) {
|
|
320
|
-
const t = e.length, n = [],
|
|
320
|
+
const t = e.length, n = [], c = [];
|
|
321
321
|
for (let h = 0; h < t; h++)
|
|
322
|
-
r[h] > 0 && (n.push(e[h]),
|
|
323
|
-
const
|
|
322
|
+
r[h] > 0 && (n.push(e[h]), c.push(Math.log(r[h])));
|
|
323
|
+
const s = x(n, c, o), a = s.coefficients[0], l = Math.exp(s.coefficients[1]), f = (h) => l * Math.exp(a * h), i = o.precision ?? 4, u = o.label || "y";
|
|
324
324
|
return {
|
|
325
325
|
type: "exponential",
|
|
326
|
-
coefficients: [l,
|
|
327
|
-
equation: `${u} = ${l.toFixed(
|
|
328
|
-
rSquared:
|
|
326
|
+
coefficients: [l, a],
|
|
327
|
+
equation: `${u} = ${l.toFixed(i)} * e^(${a.toFixed(i)}x)`,
|
|
328
|
+
rSquared: F(e, r, f),
|
|
329
329
|
predict: f
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
332
|
function st(e, r, o) {
|
|
333
|
-
const t = e.length, n = [],
|
|
333
|
+
const t = e.length, n = [], c = [];
|
|
334
334
|
for (let h = 0; h < t; h++)
|
|
335
|
-
e[h] > 0 && (n.push(Math.log(e[h])),
|
|
336
|
-
const
|
|
335
|
+
e[h] > 0 && (n.push(Math.log(e[h])), c.push(r[h]));
|
|
336
|
+
const s = x(n, c, o), a = s.coefficients[0], l = s.coefficients[1], f = (h) => l + a * Math.log(h), i = o.precision ?? 4, u = o.label || "y";
|
|
337
337
|
return {
|
|
338
338
|
type: "logarithmic",
|
|
339
|
-
coefficients: [l,
|
|
340
|
-
equation: `${u} = ${l.toFixed(
|
|
341
|
-
rSquared:
|
|
339
|
+
coefficients: [l, a],
|
|
340
|
+
equation: `${u} = ${l.toFixed(i)} ${a >= 0 ? "+" : "-"} ${Math.abs(a).toFixed(i)} * ln(x)`,
|
|
341
|
+
rSquared: F(e, r, f),
|
|
342
342
|
predict: f
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
345
|
function ct(e, r, o) {
|
|
346
|
-
const t = e.length, n = [],
|
|
346
|
+
const t = e.length, n = [], c = [];
|
|
347
347
|
for (let h = 0; h < t; h++)
|
|
348
|
-
e[h] > 0 && r[h] > 0 && (n.push(Math.log(e[h])),
|
|
349
|
-
const
|
|
348
|
+
e[h] > 0 && r[h] > 0 && (n.push(Math.log(e[h])), c.push(Math.log(r[h])));
|
|
349
|
+
const s = x(n, c, o), a = s.coefficients[0], l = Math.exp(s.coefficients[1]), f = (h) => l * Math.pow(h, a), i = o.precision ?? 4, u = o.label || "y";
|
|
350
350
|
return {
|
|
351
351
|
type: "power",
|
|
352
|
-
coefficients: [l,
|
|
353
|
-
equation: `${u} = ${l.toFixed(
|
|
354
|
-
rSquared:
|
|
352
|
+
coefficients: [l, a],
|
|
353
|
+
equation: `${u} = ${l.toFixed(i)} * x^(${a.toFixed(i)})`,
|
|
354
|
+
rSquared: F(e, r, f),
|
|
355
355
|
predict: f
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
const n = r / (o / 2),
|
|
360
|
-
return
|
|
358
|
+
function Xt(e, r, o, t = 5) {
|
|
359
|
+
const n = r / (o / 2), c = S(Math.min(n, 0.99), t);
|
|
360
|
+
return I(e, c);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
const n = r / (o / 2),
|
|
364
|
-
return
|
|
362
|
+
function Yt(e, r, o, t = 5) {
|
|
363
|
+
const n = r / (o / 2), c = at(Math.min(n, 0.99), t);
|
|
364
|
+
return I(e, c);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
const
|
|
368
|
-
Math.max(
|
|
369
|
-
Math.min(
|
|
366
|
+
function Nt(e, r, o, t, n = 5) {
|
|
367
|
+
const c = r / (t / 2), s = o / (t / 2), a = B(
|
|
368
|
+
Math.max(c, 0.01),
|
|
369
|
+
Math.min(s, 0.99),
|
|
370
370
|
n
|
|
371
371
|
);
|
|
372
|
-
return
|
|
372
|
+
return I(e, a);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
const
|
|
376
|
-
Math.max(
|
|
377
|
-
Math.min(
|
|
374
|
+
function Ot(e, r, o, t, n = 5) {
|
|
375
|
+
const c = r / (t / 2), s = o / (t / 2), a = it(
|
|
376
|
+
Math.max(c, 0.01),
|
|
377
|
+
Math.min(s, 0.99),
|
|
378
378
|
n
|
|
379
379
|
);
|
|
380
|
-
return
|
|
380
|
+
return I(e, a);
|
|
381
381
|
}
|
|
382
382
|
function S(e, r) {
|
|
383
383
|
const o = 2 * r + 1, t = new Float32Array(o), n = e;
|
|
384
|
-
for (let
|
|
385
|
-
const
|
|
386
|
-
|
|
384
|
+
for (let s = 0; s < o; s++) {
|
|
385
|
+
const a = s - r;
|
|
386
|
+
a === 0 ? t[s] = 2 * n : t[s] = Math.sin(2 * Math.PI * n * a) / (Math.PI * a), t[s] *= 0.54 - 0.46 * Math.cos(2 * Math.PI * s / (o - 1));
|
|
387
387
|
}
|
|
388
|
-
let
|
|
389
|
-
for (let
|
|
390
|
-
for (let
|
|
388
|
+
let c = 0;
|
|
389
|
+
for (let s = 0; s < o; s++) c += t[s];
|
|
390
|
+
for (let s = 0; s < o; s++) t[s] /= c;
|
|
391
391
|
return t;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function at(e, r) {
|
|
394
394
|
const o = S(e, r), t = o.length, n = new Float32Array(t);
|
|
395
|
-
for (let
|
|
396
|
-
n[
|
|
395
|
+
for (let c = 0; c < t; c++)
|
|
396
|
+
n[c] = -o[c];
|
|
397
397
|
return n[r] += 1, n;
|
|
398
398
|
}
|
|
399
399
|
function B(e, r, o) {
|
|
400
|
-
const t = 2 * o + 1, n = new Float32Array(t),
|
|
401
|
-
for (let
|
|
402
|
-
const l =
|
|
403
|
-
l === 0 ? n[
|
|
400
|
+
const t = 2 * o + 1, n = new Float32Array(t), c = e, s = r;
|
|
401
|
+
for (let a = 0; a < t; a++) {
|
|
402
|
+
const l = a - o;
|
|
403
|
+
l === 0 ? n[a] = 2 * (s - c) : n[a] = (Math.sin(2 * Math.PI * s * l) - Math.sin(2 * Math.PI * c * l)) / (Math.PI * l), n[a] *= 0.54 - 0.46 * Math.cos(2 * Math.PI * a / (t - 1));
|
|
404
404
|
}
|
|
405
405
|
return n;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
const t = B(e, r, o), n = t.length,
|
|
409
|
-
for (let
|
|
410
|
-
s
|
|
411
|
-
return
|
|
407
|
+
function it(e, r, o) {
|
|
408
|
+
const t = B(e, r, o), n = t.length, c = new Float32Array(n);
|
|
409
|
+
for (let s = 0; s < n; s++)
|
|
410
|
+
c[s] = -t[s];
|
|
411
|
+
return c[o] += 1, c;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
414
|
-
const o = e.length, t = r.length, n = Math.floor(t / 2),
|
|
415
|
-
for (let
|
|
416
|
-
let
|
|
413
|
+
function I(e, r) {
|
|
414
|
+
const o = e.length, t = r.length, n = Math.floor(t / 2), c = new Float32Array(o);
|
|
415
|
+
for (let s = 0; s < o; s++) {
|
|
416
|
+
let a = 0;
|
|
417
417
|
for (let l = 0; l < t; l++) {
|
|
418
|
-
const f =
|
|
419
|
-
f >= 0 && f < o && (
|
|
418
|
+
const f = s - n + l;
|
|
419
|
+
f >= 0 && f < o && (a += e[f] * r[l]);
|
|
420
420
|
}
|
|
421
|
-
s
|
|
421
|
+
c[s] = a;
|
|
422
422
|
}
|
|
423
|
-
return
|
|
423
|
+
return c;
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
const { type: o, cutoff: t, cutoffHigh: n, sampleRate:
|
|
427
|
-
return D(e, f,
|
|
425
|
+
function Zt(e, r) {
|
|
426
|
+
const { type: o, cutoff: t, cutoffHigh: n, sampleRate: c = 1, order: s = 2 } = r, a = 2 * t / c, l = n ? 2 * n / c : void 0, { b: f, a: i } = ut(o, a, l);
|
|
427
|
+
return D(e, f, i);
|
|
428
428
|
}
|
|
429
429
|
function lt(e, r) {
|
|
430
|
-
const { frequency: o, sampleRate: t, bandwidth: n = 1 } = r, { b:
|
|
431
|
-
return D(e,
|
|
430
|
+
const { frequency: o, sampleRate: t, bandwidth: n = 1 } = r, { b: c, a: s } = ft(o, t, n);
|
|
431
|
+
return D(e, c, s);
|
|
432
432
|
}
|
|
433
433
|
function ft(e, r, o) {
|
|
434
|
-
const t = 2 * Math.PI * e / r,
|
|
435
|
-
return { b:
|
|
434
|
+
const t = 2 * Math.PI * e / r, c = 1 - 2 * Math.PI * o / r / 2, s = Math.cos(t), a = [1, -2 * s, 1], l = [1, -2 * c * s, c * c];
|
|
435
|
+
return { b: a, a: l };
|
|
436
436
|
}
|
|
437
437
|
function ut(e, r, o, t) {
|
|
438
438
|
const n = Math.tan(Math.PI * r / 2);
|
|
@@ -441,158 +441,244 @@ function ut(e, r, o, t) {
|
|
|
441
441
|
if (e === "highpass")
|
|
442
442
|
return ht(n);
|
|
443
443
|
if (e === "bandpass" && o) {
|
|
444
|
-
const
|
|
445
|
-
return mt(n,
|
|
444
|
+
const c = Math.tan(Math.PI * o / 2);
|
|
445
|
+
return mt(n, c);
|
|
446
446
|
} else if (e === "bandstop" && o) {
|
|
447
|
-
const
|
|
448
|
-
return gt(n,
|
|
447
|
+
const c = Math.tan(Math.PI * o / 2);
|
|
448
|
+
return gt(n, c);
|
|
449
449
|
}
|
|
450
450
|
return v(n);
|
|
451
451
|
}
|
|
452
452
|
function v(e, r) {
|
|
453
|
-
const o = e, t = o * o, n = Math.sqrt(2),
|
|
453
|
+
const o = e, t = o * o, n = Math.sqrt(2), c = 1 / (1 + n * o + t);
|
|
454
454
|
return {
|
|
455
|
-
b: [t *
|
|
456
|
-
a: [1, 2 * (t - 1) *
|
|
455
|
+
b: [t * c, 2 * t * c, t * c],
|
|
456
|
+
a: [1, 2 * (t - 1) * c, (1 - n * o + t) * c]
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
function ht(e, r) {
|
|
460
|
-
const o = e, t = o * o, n = Math.sqrt(2),
|
|
460
|
+
const o = e, t = o * o, n = Math.sqrt(2), c = 1 / (1 + n * o + t);
|
|
461
461
|
return {
|
|
462
|
-
b: [
|
|
463
|
-
a: [1, 2 * (t - 1) *
|
|
462
|
+
b: [c, -2 * c, c],
|
|
463
|
+
a: [1, 2 * (t - 1) * c, (1 - n * o + t) * c]
|
|
464
464
|
};
|
|
465
465
|
}
|
|
466
466
|
function mt(e, r, o) {
|
|
467
|
-
const t = Math.sqrt(e * r), n = r - e,
|
|
467
|
+
const t = Math.sqrt(e * r), n = r - e, c = t / n, s = 1 / (1 + t / c + t * t);
|
|
468
468
|
return {
|
|
469
|
-
b: [t /
|
|
470
|
-
a: [1, 2 * (t * t - 1) *
|
|
469
|
+
b: [t / c * s, 0, -t / c * s],
|
|
470
|
+
a: [1, 2 * (t * t - 1) * s, (1 - t / c + t * t) * s]
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
473
|
function gt(e, r, o) {
|
|
474
|
-
const t = Math.sqrt(e * r), n = r - e,
|
|
474
|
+
const t = Math.sqrt(e * r), n = r - e, c = t / n, s = 1 / (1 + t / c + t * t);
|
|
475
475
|
return {
|
|
476
|
-
b: [(1 + t * t) *
|
|
477
|
-
a: [1, 2 * (t * t - 1) *
|
|
476
|
+
b: [(1 + t * t) * s, 2 * (t * t - 1) * s, (1 + t * t) * s],
|
|
477
|
+
a: [1, 2 * (t * t - 1) * s, (1 - t / c + t * t) * s]
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function k(e, r, o) {
|
|
481
481
|
const t = e.length, n = new Float32Array(t);
|
|
482
|
-
for (let
|
|
483
|
-
n[
|
|
484
|
-
for (let
|
|
485
|
-
|
|
482
|
+
for (let c = 0; c < t; c++) {
|
|
483
|
+
n[c] = r[0] * e[c];
|
|
484
|
+
for (let s = 1; s < r.length; s++)
|
|
485
|
+
c - s >= 0 && (n[c] += r[s] * e[c - s], n[c] -= o[s] * n[c - s]);
|
|
486
486
|
}
|
|
487
487
|
return n;
|
|
488
488
|
}
|
|
489
489
|
function D(e, r, o) {
|
|
490
|
-
const t =
|
|
491
|
-
for (let
|
|
492
|
-
n[
|
|
493
|
-
const
|
|
494
|
-
for (let
|
|
495
|
-
|
|
496
|
-
return
|
|
490
|
+
const t = k(e, r, o), n = new Float32Array(t.length);
|
|
491
|
+
for (let a = 0; a < t.length; a++)
|
|
492
|
+
n[a] = t[t.length - 1 - a];
|
|
493
|
+
const c = k(n, r, o), s = new Float32Array(c.length);
|
|
494
|
+
for (let a = 0; a < c.length; a++)
|
|
495
|
+
s[a] = c[c.length - 1 - a];
|
|
496
|
+
return s;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function Gt(e, r = 0.3) {
|
|
499
499
|
const o = e.length, t = new Float32Array(o);
|
|
500
500
|
t[0] = e[0];
|
|
501
501
|
for (let n = 1; n < o; n++)
|
|
502
502
|
t[n] = r * e[n] + (1 - r) * t[n - 1];
|
|
503
503
|
return t;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
506
|
-
const o = e.length, t = new Float32Array(o), n = Math.ceil(r * 3) * 2 + 1,
|
|
507
|
-
let
|
|
505
|
+
function Kt(e, r = 2) {
|
|
506
|
+
const o = e.length, t = new Float32Array(o), n = Math.ceil(r * 3) * 2 + 1, c = Math.floor(n / 2), s = new Float32Array(n);
|
|
507
|
+
let a = 0;
|
|
508
508
|
for (let l = 0; l < n; l++) {
|
|
509
|
-
const f = l -
|
|
510
|
-
|
|
509
|
+
const f = l - c;
|
|
510
|
+
s[l] = Math.exp(-(f * f) / (2 * r * r)), a += s[l];
|
|
511
511
|
}
|
|
512
512
|
for (let l = 0; l < n; l++)
|
|
513
|
-
|
|
513
|
+
s[l] /= a;
|
|
514
514
|
for (let l = 0; l < o; l++) {
|
|
515
515
|
let f = 0;
|
|
516
|
-
for (let
|
|
517
|
-
const u = l -
|
|
518
|
-
u >= 0 && u < o && (f += e[u] *
|
|
516
|
+
for (let i = 0; i < n; i++) {
|
|
517
|
+
const u = l - c + i;
|
|
518
|
+
u >= 0 && u < o && (f += e[u] * s[i]);
|
|
519
519
|
}
|
|
520
520
|
t[l] = f;
|
|
521
521
|
}
|
|
522
522
|
return t;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
const t = e.length, n = new Float32Array(t),
|
|
526
|
-
for (let
|
|
524
|
+
function Qt(e, r = 5, o = 2) {
|
|
525
|
+
const t = e.length, n = new Float32Array(t), c = Math.floor(r / 2), s = dt(r);
|
|
526
|
+
for (let a = 0; a < t; a++) {
|
|
527
527
|
let l = 0;
|
|
528
|
-
for (let f = -
|
|
529
|
-
const
|
|
530
|
-
|
|
528
|
+
for (let f = -c; f <= c; f++) {
|
|
529
|
+
const i = a + f;
|
|
530
|
+
i >= 0 && i < t ? l += e[i] * s[f + c] : i < 0 ? l += e[0] * s[f + c] : l += e[t - 1] * s[f + c];
|
|
531
531
|
}
|
|
532
|
-
n[
|
|
532
|
+
n[a] = l;
|
|
533
533
|
}
|
|
534
534
|
return n;
|
|
535
535
|
}
|
|
536
536
|
function dt(e, r) {
|
|
537
537
|
const o = Math.floor(e / 2), t = new Float32Array(e), n = 1 / e;
|
|
538
|
-
for (let
|
|
539
|
-
const
|
|
540
|
-
t[
|
|
538
|
+
for (let s = 0; s < e; s++) {
|
|
539
|
+
const a = s - o;
|
|
540
|
+
t[s] = n * (1 - a * a / ((o + 1) * (o + 1)));
|
|
541
541
|
}
|
|
542
|
-
let
|
|
543
|
-
for (let
|
|
544
|
-
for (let
|
|
542
|
+
let c = 0;
|
|
543
|
+
for (let s = 0; s < e; s++) c += t[s];
|
|
544
|
+
for (let s = 0; s < e; s++) t[s] /= c;
|
|
545
545
|
return t;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function Ut(e, r = 5) {
|
|
548
548
|
const o = e.length, t = new Float32Array(o), n = Math.floor(r / 2);
|
|
549
|
-
for (let
|
|
550
|
-
const
|
|
551
|
-
for (let
|
|
552
|
-
const l =
|
|
553
|
-
l >= 0 && l < o &&
|
|
549
|
+
for (let c = 0; c < o; c++) {
|
|
550
|
+
const s = [];
|
|
551
|
+
for (let a = -n; a <= n; a++) {
|
|
552
|
+
const l = c + a;
|
|
553
|
+
l >= 0 && l < o && s.push(e[l]);
|
|
554
554
|
}
|
|
555
|
-
|
|
555
|
+
s.sort((a, l) => a - l), t[c] = s[Math.floor(s.length / 2)];
|
|
556
556
|
}
|
|
557
557
|
return t;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
const n = r.length,
|
|
561
|
-
for (const
|
|
559
|
+
function Jt(e, r, o, t = {}) {
|
|
560
|
+
const n = r.length, c = o.length, s = Math.min(...e), a = Math.max(...e), l = t.levels || yt(s, a, t.numLevels || 10), f = [];
|
|
561
|
+
for (const i of l) {
|
|
562
562
|
const u = [];
|
|
563
|
-
for (let h = 0; h <
|
|
563
|
+
for (let h = 0; h < c - 1; h++)
|
|
564
564
|
for (let m = 0; m < n - 1; m++) {
|
|
565
565
|
const g = e[h * n + m], M = e[h * n + (m + 1)], d = e[(h + 1) * n + (m + 1)], w = e[(h + 1) * n + m];
|
|
566
|
-
|
|
566
|
+
bt(m, h, g, M, d, w, i, r, o, u);
|
|
567
567
|
}
|
|
568
568
|
if (u.length > 0) {
|
|
569
569
|
const h = [];
|
|
570
|
-
for (const
|
|
571
|
-
h.push({ x:
|
|
572
|
-
|
|
570
|
+
for (const g of u)
|
|
571
|
+
h.push({ x: g[0], y: g[1] }), h.push({ x: g[2], y: g[3] });
|
|
572
|
+
const m = { level: i, points: h };
|
|
573
|
+
if (t.joinPaths || t.labels) {
|
|
574
|
+
const g = Mt(u);
|
|
575
|
+
m.polylines = g, t.labels && (m.labels = pt(
|
|
576
|
+
g,
|
|
577
|
+
i,
|
|
578
|
+
t.minLabelLength ?? 6,
|
|
579
|
+
t.labelFormatter ?? wt
|
|
580
|
+
));
|
|
581
|
+
}
|
|
582
|
+
f.push(m);
|
|
573
583
|
}
|
|
574
584
|
}
|
|
575
585
|
return f;
|
|
576
586
|
}
|
|
577
|
-
function Mt(e, r
|
|
587
|
+
function Mt(e, r = 1e-6) {
|
|
588
|
+
const o = e.map((a) => ({
|
|
589
|
+
a: { x: a[0], y: a[1] },
|
|
590
|
+
b: { x: a[2], y: a[3] },
|
|
591
|
+
used: !1
|
|
592
|
+
})), t = (a) => `${Math.round(a.x / r)}:${Math.round(a.y / r)}`, n = (a, l) => Math.abs(a.x - l.x) <= r && Math.abs(a.y - l.y) <= r, c = /* @__PURE__ */ new Map();
|
|
593
|
+
o.forEach((a, l) => {
|
|
594
|
+
for (const f of [a.a, a.b]) {
|
|
595
|
+
const i = t(f);
|
|
596
|
+
c.has(i) || c.set(i, []), c.get(i).push(l);
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
const s = [];
|
|
600
|
+
for (let a = 0; a < o.length; a++) {
|
|
601
|
+
if (o[a].used) continue;
|
|
602
|
+
o[a].used = !0;
|
|
603
|
+
const l = [o[a].a, o[a].b];
|
|
604
|
+
let f = !0;
|
|
605
|
+
for (; f; ) {
|
|
606
|
+
f = !1;
|
|
607
|
+
const i = l[l.length - 1], u = c.get(t(i)) ?? [];
|
|
608
|
+
for (const h of u) {
|
|
609
|
+
if (o[h].used) continue;
|
|
610
|
+
const m = o[h];
|
|
611
|
+
if (n(m.a, i)) {
|
|
612
|
+
l.push(m.b), m.used = !0, f = !0;
|
|
613
|
+
break;
|
|
614
|
+
} else if (n(m.b, i)) {
|
|
615
|
+
l.push(m.a), m.used = !0, f = !0;
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
for (f = !0; f; ) {
|
|
621
|
+
f = !1;
|
|
622
|
+
const i = l[0], u = c.get(t(i)) ?? [];
|
|
623
|
+
for (const h of u) {
|
|
624
|
+
if (o[h].used) continue;
|
|
625
|
+
const m = o[h];
|
|
626
|
+
if (n(m.b, i)) {
|
|
627
|
+
l.unshift(m.a), m.used = !0, f = !0;
|
|
628
|
+
break;
|
|
629
|
+
} else if (n(m.a, i)) {
|
|
630
|
+
l.unshift(m.b), m.used = !0, f = !0;
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
s.push(l);
|
|
636
|
+
}
|
|
637
|
+
return s;
|
|
638
|
+
}
|
|
639
|
+
function wt(e) {
|
|
640
|
+
const r = Math.abs(e);
|
|
641
|
+
return r !== 0 && (r < 0.01 || r >= 1e5) ? e.toExponential(1) : e.toFixed(2).replace(/\.00$/, "");
|
|
642
|
+
}
|
|
643
|
+
function pt(e, r, o, t) {
|
|
644
|
+
const n = [], c = t(r);
|
|
645
|
+
for (const s of e) {
|
|
646
|
+
if (s.length < o) continue;
|
|
647
|
+
let a = 0;
|
|
648
|
+
for (let d = 1; d < s.length; d++)
|
|
649
|
+
a += Math.hypot(s[d].x - s[d - 1].x, s[d].y - s[d - 1].y);
|
|
650
|
+
const l = a / 2;
|
|
651
|
+
let f = 0, i = Math.floor(s.length / 2);
|
|
652
|
+
for (let d = 1; d < s.length; d++)
|
|
653
|
+
if (f += Math.hypot(s[d].x - s[d - 1].x, s[d].y - s[d - 1].y), f >= l) {
|
|
654
|
+
i = d;
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
const u = s[i], h = Math.min(3, Math.floor(s.length / 4)) || 1, m = s[Math.max(0, i - h)], g = s[Math.min(s.length - 1, i + h)];
|
|
658
|
+
let M = Math.atan2(g.y - m.y, g.x - m.x);
|
|
659
|
+
M > Math.PI / 2 && (M -= Math.PI), M < -Math.PI / 2 && (M += Math.PI), n.push({ x: u.x, y: u.y, level: r, text: c, angle: M });
|
|
660
|
+
}
|
|
661
|
+
return n;
|
|
662
|
+
}
|
|
663
|
+
function yt(e, r, o) {
|
|
578
664
|
const t = [], n = (r - e) / (o + 1);
|
|
579
|
-
for (let
|
|
580
|
-
t.push(e +
|
|
665
|
+
for (let c = 1; c <= o; c++)
|
|
666
|
+
t.push(e + c * n);
|
|
581
667
|
return t;
|
|
582
668
|
}
|
|
583
|
-
function
|
|
584
|
-
let
|
|
585
|
-
if (o >=
|
|
586
|
-
const u = (M, d, w) => M + (d - M) * w, h = (M, d) => (
|
|
669
|
+
function bt(e, r, o, t, n, c, s, a, l, f) {
|
|
670
|
+
let i = 0;
|
|
671
|
+
if (o >= s && (i |= 1), t >= s && (i |= 2), n >= s && (i |= 4), c >= s && (i |= 8), i === 0 || i === 15) return;
|
|
672
|
+
const u = (M, d, w) => M + (d - M) * w, h = (M, d) => (s - M) / (d - M), m = (M) => {
|
|
587
673
|
switch (M) {
|
|
588
674
|
case 0:
|
|
589
|
-
return [u(
|
|
675
|
+
return [u(a[e], a[e + 1], h(o, t)), l[r]];
|
|
590
676
|
case 1:
|
|
591
|
-
return [
|
|
677
|
+
return [a[e + 1], u(l[r], l[r + 1], h(t, n))];
|
|
592
678
|
case 2:
|
|
593
|
-
return [u(
|
|
679
|
+
return [u(a[e], a[e + 1], h(c, n)), l[r + 1]];
|
|
594
680
|
case 3:
|
|
595
|
-
return [
|
|
681
|
+
return [a[e], u(l[r], l[r + 1], h(o, c))];
|
|
596
682
|
default:
|
|
597
683
|
return [0, 0];
|
|
598
684
|
}
|
|
@@ -600,7 +686,7 @@ function wt(e, r, o, t, n, s, c, i, l, f) {
|
|
|
600
686
|
const w = m(M), p = m(d);
|
|
601
687
|
f.push([w[0], w[1], p[0], p[1]]);
|
|
602
688
|
};
|
|
603
|
-
switch (
|
|
689
|
+
switch (i) {
|
|
604
690
|
case 1:
|
|
605
691
|
case 14:
|
|
606
692
|
g(0, 3);
|
|
@@ -633,114 +719,114 @@ function wt(e, r, o, t, n, s, c, i, l, f) {
|
|
|
633
719
|
break;
|
|
634
720
|
}
|
|
635
721
|
}
|
|
636
|
-
function
|
|
637
|
-
const t = e.length, n = r.length,
|
|
638
|
-
let f = 0,
|
|
722
|
+
function Ft(e, r, o) {
|
|
723
|
+
const t = e.length, n = r.length, c = o ?? Math.min(t, n) - 1, s = 2 * c + 1, a = new Float32Array(s), l = new Float32Array(s);
|
|
724
|
+
let f = 0, i = 0;
|
|
639
725
|
for (let d = 0; d < t; d++) f += e[d];
|
|
640
|
-
for (let d = 0; d < n; d++)
|
|
641
|
-
f /= t,
|
|
726
|
+
for (let d = 0; d < n; d++) i += r[d];
|
|
727
|
+
f /= t, i /= n;
|
|
642
728
|
let u = 0, h = 0;
|
|
643
729
|
for (let d = 0; d < t; d++) u += (e[d] - f) ** 2;
|
|
644
|
-
for (let d = 0; d < n; d++) h += (r[d] -
|
|
730
|
+
for (let d = 0; d < n; d++) h += (r[d] - i) ** 2;
|
|
645
731
|
u = Math.sqrt(u / t), h = Math.sqrt(h / n);
|
|
646
732
|
const m = u * h * Math.min(t, n);
|
|
647
733
|
let g = -1 / 0, M = 0;
|
|
648
|
-
for (let d = 0; d <
|
|
649
|
-
const w = d -
|
|
734
|
+
for (let d = 0; d < s; d++) {
|
|
735
|
+
const w = d - c;
|
|
650
736
|
l[d] = w;
|
|
651
737
|
let p = 0;
|
|
652
738
|
for (let y = 0; y < t; y++) {
|
|
653
|
-
const
|
|
654
|
-
|
|
739
|
+
const b = y + w;
|
|
740
|
+
b >= 0 && b < n && (p += (e[y] - f) * (r[b] - i));
|
|
655
741
|
}
|
|
656
|
-
|
|
742
|
+
a[d] = m > 0 ? p / m : 0, a[d] > g && (g = a[d], M = d);
|
|
657
743
|
}
|
|
658
744
|
return {
|
|
659
|
-
correlation:
|
|
745
|
+
correlation: a,
|
|
660
746
|
lags: l,
|
|
661
747
|
maxCorrelation: g,
|
|
662
748
|
lagAtMax: l[M]
|
|
663
749
|
};
|
|
664
750
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
751
|
+
function Vt(e, r) {
|
|
752
|
+
return Ft(e, e, r);
|
|
667
753
|
}
|
|
668
|
-
function
|
|
754
|
+
function tn(e, r = {}) {
|
|
669
755
|
const { method: o = "zscore", windowSize: t } = r;
|
|
670
756
|
switch (o) {
|
|
671
757
|
case "zscore":
|
|
672
|
-
return
|
|
758
|
+
return $(e, r.threshold ?? 3, t);
|
|
673
759
|
case "mad":
|
|
674
|
-
return
|
|
760
|
+
return At(e, r.threshold ?? 2.5);
|
|
675
761
|
case "iqr":
|
|
676
|
-
return
|
|
762
|
+
return xt(e, r.threshold ?? 1.5);
|
|
677
763
|
case "isolation":
|
|
678
|
-
return
|
|
764
|
+
return It(e, r.threshold ?? 0.5);
|
|
679
765
|
default:
|
|
680
|
-
return
|
|
766
|
+
return $(e, 3, t);
|
|
681
767
|
}
|
|
682
768
|
}
|
|
683
|
-
function
|
|
684
|
-
const t = e.length, n = new Float32Array(t),
|
|
769
|
+
function $(e, r, o) {
|
|
770
|
+
const t = e.length, n = new Float32Array(t), c = [];
|
|
685
771
|
if (o && o < t) {
|
|
686
|
-
const
|
|
687
|
-
for (let
|
|
688
|
-
const l = Math.max(0,
|
|
689
|
-
let
|
|
690
|
-
for (let h = l; h < f; h++)
|
|
691
|
-
|
|
772
|
+
const s = Math.floor(o / 2);
|
|
773
|
+
for (let a = 0; a < t; a++) {
|
|
774
|
+
const l = Math.max(0, a - s), f = Math.min(t, a + s + 1);
|
|
775
|
+
let i = 0;
|
|
776
|
+
for (let h = l; h < f; h++) i += e[h];
|
|
777
|
+
i /= f - l;
|
|
692
778
|
let u = 0;
|
|
693
|
-
for (let h = l; h < f; h++) u += (e[h] -
|
|
694
|
-
u = Math.sqrt(u / (f - l)), n[
|
|
779
|
+
for (let h = l; h < f; h++) u += (e[h] - i) ** 2;
|
|
780
|
+
u = Math.sqrt(u / (f - l)), n[a] = u > 0 ? Math.abs(e[a] - i) / u : 0, n[a] > r && c.push(a);
|
|
695
781
|
}
|
|
696
782
|
} else {
|
|
697
|
-
let
|
|
698
|
-
for (let l = 0; l < t; l++)
|
|
699
|
-
|
|
700
|
-
let
|
|
701
|
-
for (let l = 0; l < t; l++)
|
|
702
|
-
|
|
783
|
+
let s = 0;
|
|
784
|
+
for (let l = 0; l < t; l++) s += e[l];
|
|
785
|
+
s /= t;
|
|
786
|
+
let a = 0;
|
|
787
|
+
for (let l = 0; l < t; l++) a += (e[l] - s) ** 2;
|
|
788
|
+
a = Math.sqrt(a / t);
|
|
703
789
|
for (let l = 0; l < t; l++)
|
|
704
|
-
n[l] =
|
|
790
|
+
n[l] = a > 0 ? Math.abs(e[l] - s) / a : 0, n[l] > r && c.push(l);
|
|
705
791
|
}
|
|
706
|
-
return { indices:
|
|
792
|
+
return { indices: c, scores: n, threshold: r };
|
|
707
793
|
}
|
|
708
|
-
function
|
|
709
|
-
const t = e.length, n = new Float32Array(t),
|
|
794
|
+
function At(e, r, o) {
|
|
795
|
+
const t = e.length, n = new Float32Array(t), c = [], s = Array.from(e).sort((u, h) => u - h), a = s[Math.floor(t / 2)], i = 1.4826 * s.map((u) => Math.abs(u - a)).sort((u, h) => u - h)[Math.floor(t / 2)];
|
|
710
796
|
for (let u = 0; u < t; u++)
|
|
711
|
-
n[u] =
|
|
712
|
-
return { indices:
|
|
797
|
+
n[u] = i > 0 ? Math.abs(e[u] - a) / i : 0, n[u] > r && c.push(u);
|
|
798
|
+
return { indices: c, scores: n, threshold: r };
|
|
713
799
|
}
|
|
714
|
-
function
|
|
715
|
-
const o = e.length, t = new Float32Array(o), n = [],
|
|
800
|
+
function xt(e, r) {
|
|
801
|
+
const o = e.length, t = new Float32Array(o), n = [], c = Array.from(e).sort((u, h) => u - h), s = c[Math.floor(o * 0.25)], a = c[Math.floor(o * 0.75)], l = a - s, f = s - r * l, i = a + r * l;
|
|
716
802
|
for (let u = 0; u < o; u++)
|
|
717
|
-
e[u] < f ? (t[u] = (f - e[u]) / l, n.push(u)) : e[u] >
|
|
803
|
+
e[u] < f ? (t[u] = (f - e[u]) / l, n.push(u)) : e[u] > i ? (t[u] = (e[u] - i) / l, n.push(u)) : t[u] = 0;
|
|
718
804
|
return { indices: n, scores: t, threshold: r };
|
|
719
805
|
}
|
|
720
|
-
function
|
|
721
|
-
const t = e.length, n = new Float32Array(t),
|
|
722
|
-
for (let
|
|
806
|
+
function It(e, r, o) {
|
|
807
|
+
const t = e.length, n = new Float32Array(t), c = [], s = qt(e);
|
|
808
|
+
for (let a = 0; a < t; a++) {
|
|
723
809
|
let l = 0;
|
|
724
810
|
for (let f = 0; f < t; f++)
|
|
725
|
-
|
|
726
|
-
n[
|
|
811
|
+
a !== f && Math.abs(e[a] - e[f]) < s && l++;
|
|
812
|
+
n[a] = 1 - l / t, n[a] > r && c.push(a);
|
|
727
813
|
}
|
|
728
|
-
return { indices:
|
|
814
|
+
return { indices: c, scores: n, threshold: r };
|
|
729
815
|
}
|
|
730
|
-
function
|
|
816
|
+
function qt(e) {
|
|
731
817
|
let r = 1 / 0, o = -1 / 0;
|
|
732
818
|
for (let t = 0; t < e.length; t++)
|
|
733
819
|
e[t] < r && (r = e[t]), e[t] > o && (o = e[t]);
|
|
734
820
|
return (o - r) * 0.1;
|
|
735
821
|
}
|
|
736
|
-
function
|
|
822
|
+
function j(e, r) {
|
|
737
823
|
const o = e.length;
|
|
738
824
|
if (o < 2) return 0;
|
|
739
825
|
let t = 0;
|
|
740
826
|
if (typeof r == "number") {
|
|
741
827
|
const n = r;
|
|
742
|
-
for (let
|
|
743
|
-
t += (e[
|
|
828
|
+
for (let c = 1; c < o; c++)
|
|
829
|
+
t += (e[c - 1] + e[c]) * n / 2;
|
|
744
830
|
} else if (r)
|
|
745
831
|
for (let n = 1; n < o; n++)
|
|
746
832
|
t += (e[n - 1] + e[n]) * (r[n] - r[n - 1]) / 2;
|
|
@@ -749,28 +835,28 @@ function R(e, r) {
|
|
|
749
835
|
t += (e[n - 1] + e[n]) / 2;
|
|
750
836
|
return t;
|
|
751
837
|
}
|
|
752
|
-
function
|
|
838
|
+
function Pt(e, r) {
|
|
753
839
|
const o = e.length;
|
|
754
|
-
if (o < 3) return
|
|
840
|
+
if (o < 3) return j(e, r);
|
|
755
841
|
const t = o % 2 === 0 ? o - 1 : o;
|
|
756
842
|
let n = 0;
|
|
757
843
|
if (typeof r == "number") {
|
|
758
|
-
const
|
|
844
|
+
const c = r;
|
|
759
845
|
n = e[0] + e[t - 1];
|
|
760
|
-
for (let
|
|
761
|
-
n += (
|
|
762
|
-
n *=
|
|
763
|
-
} else return r ?
|
|
846
|
+
for (let s = 1; s < t - 1; s++)
|
|
847
|
+
n += (s % 2 === 0 ? 2 : 4) * e[s];
|
|
848
|
+
n *= c / 3, o !== t && (n += (e[o - 2] + e[o - 1]) * c / 2);
|
|
849
|
+
} else return r ? j(e, r) : Pt(e, 1);
|
|
764
850
|
return n;
|
|
765
851
|
}
|
|
766
|
-
function
|
|
852
|
+
function nn(e, r) {
|
|
767
853
|
const o = e.length, t = new Float32Array(o);
|
|
768
854
|
if (o < 2)
|
|
769
855
|
return t[0] = 0, t;
|
|
770
856
|
if (t[0] = 0, typeof r == "number") {
|
|
771
857
|
const n = r;
|
|
772
|
-
for (let
|
|
773
|
-
t[
|
|
858
|
+
for (let c = 1; c < o; c++)
|
|
859
|
+
t[c] = t[c - 1] + (e[c - 1] + e[c]) * n / 2;
|
|
774
860
|
} else if (r)
|
|
775
861
|
for (let n = 1; n < o; n++)
|
|
776
862
|
t[n] = t[n - 1] + (e[n - 1] + e[n]) * (r[n] - r[n - 1]) / 2;
|
|
@@ -779,17 +865,17 @@ function Jt(e, r) {
|
|
|
779
865
|
t[n] = t[n - 1] + (e[n - 1] + e[n]) / 2;
|
|
780
866
|
return t;
|
|
781
867
|
}
|
|
782
|
-
function
|
|
868
|
+
function en(e, r) {
|
|
783
869
|
const o = e.length, t = r.length;
|
|
784
|
-
let n = 0,
|
|
870
|
+
let n = 0, c = 0;
|
|
785
871
|
for (let g = 0; g < o; g++) n += e[g];
|
|
786
|
-
for (let g = 0; g < t; g++)
|
|
787
|
-
n /= o,
|
|
788
|
-
let
|
|
789
|
-
for (let g = 0; g < o; g++)
|
|
790
|
-
for (let g = 0; g < t; g++)
|
|
791
|
-
|
|
792
|
-
const l = Math.sqrt(
|
|
872
|
+
for (let g = 0; g < t; g++) c += r[g];
|
|
873
|
+
n /= o, c /= t;
|
|
874
|
+
let s = 0, a = 0;
|
|
875
|
+
for (let g = 0; g < o; g++) s += (e[g] - n) ** 2;
|
|
876
|
+
for (let g = 0; g < t; g++) a += (r[g] - c) ** 2;
|
|
877
|
+
s /= o - 1, a /= t - 1;
|
|
878
|
+
const l = Math.sqrt(s / o + a / t), f = (n - c) / l, i = (s / o + a / t) ** 2, u = (s / o) ** 2 / (o - 1) + (a / t) ** 2 / (t - 1), h = i / u, m = 2 * (1 - vt(Math.abs(f)));
|
|
793
879
|
return {
|
|
794
880
|
tStatistic: f,
|
|
795
881
|
degreesOfFreedom: h,
|
|
@@ -797,23 +883,23 @@ function Vt(e, r) {
|
|
|
797
883
|
significant: m < 0.05
|
|
798
884
|
};
|
|
799
885
|
}
|
|
800
|
-
function
|
|
801
|
-
const r = 0.254829592, o = -0.284496736, t = 1.421413741, n = -1.453152027,
|
|
886
|
+
function vt(e) {
|
|
887
|
+
const r = 0.254829592, o = -0.284496736, t = 1.421413741, n = -1.453152027, c = 1.061405429, s = 0.3275911, a = e < 0 ? -1 : 1;
|
|
802
888
|
e = Math.abs(e) / Math.sqrt(2);
|
|
803
|
-
const l = 1 / (1 +
|
|
804
|
-
return 0.5 * (1 +
|
|
889
|
+
const l = 1 / (1 + s * e), f = 1 - ((((c * l + n) * l + t) * l + o) * l + r) * l * Math.exp(-e * e);
|
|
890
|
+
return 0.5 * (1 + a * f);
|
|
805
891
|
}
|
|
806
|
-
const
|
|
892
|
+
const kt = {
|
|
807
893
|
name: "velo-plot-analysis",
|
|
808
894
|
version: "1.0.0",
|
|
809
895
|
description: "Data analysis and signal processing for velo-plot",
|
|
810
896
|
provides: ["analysis"],
|
|
811
897
|
tags: ["fft", "filters", "statistics", "math"]
|
|
812
898
|
};
|
|
813
|
-
function
|
|
899
|
+
function on(e = {}) {
|
|
814
900
|
let r;
|
|
815
901
|
return {
|
|
816
|
-
manifest:
|
|
902
|
+
manifest: kt,
|
|
817
903
|
onInit(o) {
|
|
818
904
|
r = o;
|
|
819
905
|
},
|
|
@@ -829,7 +915,7 @@ function tn(e = {}) {
|
|
|
829
915
|
calculateStats: G,
|
|
830
916
|
validateData: Z,
|
|
831
917
|
// Signal Processing
|
|
832
|
-
fft: (o) =>
|
|
918
|
+
fft: (o) => q(o),
|
|
833
919
|
detectPeaks: O,
|
|
834
920
|
detectCycles: N,
|
|
835
921
|
movingAverage: Y,
|
|
@@ -837,7 +923,7 @@ function tn(e = {}) {
|
|
|
837
923
|
downsampleLTTB: H,
|
|
838
924
|
singleFrequencyFilter: lt,
|
|
839
925
|
// Fitting
|
|
840
|
-
fitData:
|
|
926
|
+
fitData: C,
|
|
841
927
|
// Indicators
|
|
842
928
|
sma: U,
|
|
843
929
|
ema: Q,
|
|
@@ -849,79 +935,80 @@ function tn(e = {}) {
|
|
|
849
935
|
};
|
|
850
936
|
}
|
|
851
937
|
export {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
938
|
+
on as PluginAnalysis,
|
|
939
|
+
mn as adx,
|
|
940
|
+
Wt as analyzeComplexSpectrum,
|
|
941
|
+
L as analyzeSpectrum,
|
|
942
|
+
gn as aroon,
|
|
857
943
|
et as arraysToComplex,
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
944
|
+
dn as atr,
|
|
945
|
+
Vt as autoCorrelation,
|
|
946
|
+
Nt as bandPassFilter,
|
|
947
|
+
Ot as bandStopFilter,
|
|
948
|
+
Dt as blackmanWindow,
|
|
949
|
+
Mn as bollingerBands,
|
|
950
|
+
Zt as butterworth,
|
|
951
|
+
F as calculateR2,
|
|
866
952
|
G as calculateStats,
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
953
|
+
zt as complexToArrays,
|
|
954
|
+
Ft as crossCorrelation,
|
|
955
|
+
wn as cumsum,
|
|
956
|
+
cn as cumulativeIntegral,
|
|
957
|
+
nn as cumulativeIntegral2,
|
|
958
|
+
on as default,
|
|
959
|
+
pn as dema,
|
|
874
960
|
_ as derivative,
|
|
875
|
-
|
|
961
|
+
tn as detectAnomalies,
|
|
876
962
|
N as detectCycles,
|
|
877
963
|
O as detectPeaks,
|
|
878
|
-
|
|
964
|
+
Ct as dominantFrequency,
|
|
879
965
|
H as downsampleLTTB,
|
|
880
966
|
Q as ema,
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
967
|
+
Gt as exponentialMovingAverage,
|
|
968
|
+
q as fft,
|
|
969
|
+
_t as fftFromComplexInput,
|
|
970
|
+
C as fitData,
|
|
971
|
+
ln as formatScientific,
|
|
972
|
+
fn as formatValue,
|
|
887
973
|
T as formatWithPrefix,
|
|
888
|
-
|
|
889
|
-
|
|
974
|
+
Kt as gaussianSmooth,
|
|
975
|
+
Jt as generateContours,
|
|
890
976
|
E as generateCycleColors,
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
977
|
+
un as getBestPrefix,
|
|
978
|
+
Ht as getPositiveFrequencies,
|
|
979
|
+
Bt as hammingWindow,
|
|
980
|
+
St as hanningWindow,
|
|
981
|
+
Yt as highPassFilter,
|
|
896
982
|
V as ifft,
|
|
897
|
-
|
|
898
|
-
|
|
983
|
+
Tt as ifftComplex,
|
|
984
|
+
Et as ifftFromArrays,
|
|
899
985
|
z as integrate,
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
986
|
+
Mt as joinSegments,
|
|
987
|
+
Xt as lowPassFilter,
|
|
988
|
+
yn as macd,
|
|
989
|
+
Ut as medianFilter,
|
|
990
|
+
bn as momentum,
|
|
904
991
|
Y as movingAverage,
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
992
|
+
R as nextPowerOf2,
|
|
993
|
+
Fn as normalize,
|
|
994
|
+
An as obv,
|
|
995
|
+
xn as percentChange,
|
|
996
|
+
Lt as powerSpectrum,
|
|
997
|
+
In as roc,
|
|
911
998
|
K as rsi,
|
|
912
|
-
|
|
913
|
-
|
|
999
|
+
Qt as savitzkyGolay,
|
|
1000
|
+
Pt as simpsonsIntegration,
|
|
914
1001
|
lt as singleFrequencyFilter,
|
|
915
1002
|
U as sma,
|
|
916
1003
|
W as solveLinearSystem,
|
|
917
|
-
|
|
918
|
-
|
|
1004
|
+
qn as standardDeviation,
|
|
1005
|
+
Pn as stochastic,
|
|
919
1006
|
X as subtractBaseline,
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1007
|
+
en as tTest,
|
|
1008
|
+
vn as tema,
|
|
1009
|
+
j as trapezoidalIntegration,
|
|
923
1010
|
Z as validateData,
|
|
924
|
-
|
|
925
|
-
|
|
1011
|
+
kn as vwap,
|
|
1012
|
+
$n as wma
|
|
926
1013
|
};
|
|
927
1014
|
//# sourceMappingURL=analysis.js.map
|