velo-plot 1.11.1 → 1.15.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/README.md +35 -2
- package/dist/{index.core-CYu3tydL.js → ChartCore-BimVvUEg.js} +1936 -1588
- package/dist/ChartCore-BimVvUEg.js.map +1 -0
- package/dist/axisFormat-B7o_uIEA.js +127 -0
- package/dist/axisFormat-B7o_uIEA.js.map +1 -0
- package/dist/core/OverlayRenderer.d.ts +1 -2
- package/dist/core/chart/ChartCore.d.ts +18 -1
- package/dist/core/chart/ChartRenderLoop.d.ts +4 -0
- package/dist/core/chart/ChartScaling.d.ts +11 -0
- package/dist/core/chart/NavigationUtils.d.ts +12 -0
- package/dist/core/chart/exporter/SVGExporter.d.ts +7 -2
- package/dist/core/chart/types.d.ts +13 -1
- package/dist/core/format/axisFormat.d.ts +16 -0
- package/dist/core/indicator/buildIndicatorPane.d.ts +22 -0
- package/dist/core/indicator/buildIndicatorSeries.d.ts +14 -0
- package/dist/core/indicator/index.d.ts +3 -0
- package/dist/core/indicator/types.d.ts +74 -0
- package/dist/core/render/pixelSnap.d.ts +8 -0
- package/dist/core/series/SeriesBounds.d.ts +1 -1
- package/dist/core/stacked/createStackedChart.d.ts +3 -0
- package/dist/core/stacked/index.d.ts +6 -0
- package/dist/core/stacked/paneAxis.d.ts +20 -0
- package/dist/core/stacked/paneResize.d.ts +29 -0
- package/dist/core/stacked/stackExport.d.ts +18 -0
- package/dist/core/stacked/types.d.ts +120 -0
- package/dist/core/sync/index.d.ts +25 -70
- package/dist/createStackedChart-CjsKcOvX.js +1088 -0
- package/dist/createStackedChart-CjsKcOvX.js.map +1 -0
- package/dist/index-CUGS98p4.js +277 -0
- package/dist/index-CUGS98p4.js.map +1 -0
- package/dist/index-ChgIdk3N.js +229 -0
- package/dist/index-ChgIdk3N.js.map +1 -0
- package/dist/{index-D8ifudJH.js → index-DjeWClO9.js} +601 -561
- package/dist/index-DjeWClO9.js.map +1 -0
- package/dist/index.core-C_-CFftD.js +167 -0
- package/dist/index.core-C_-CFftD.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/math-Ddm2EZjj.js +85 -0
- package/dist/math-Ddm2EZjj.js.map +1 -0
- package/dist/plugins/analysis.js +132 -130
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/anomaly-detection.d.ts +1 -0
- package/dist/plugins/anomaly-detection.js +221 -0
- package/dist/plugins/anomaly-detection.js.map +1 -0
- package/dist/plugins/broken-axis.d.ts +3 -0
- package/dist/plugins/broken-axis.js +262 -0
- package/dist/plugins/broken-axis.js.map +1 -0
- package/dist/plugins/caching.d.ts +3 -0
- package/dist/plugins/caching.js +182 -0
- package/dist/plugins/caching.js.map +1 -0
- package/dist/plugins/data-transform.d.ts +3 -0
- package/dist/plugins/data-transform.js +146 -0
- package/dist/plugins/data-transform.js.map +1 -0
- package/dist/plugins/debug.js +12 -11
- package/dist/plugins/debug.js.map +1 -1
- package/dist/plugins/forecasting.d.ts +1 -0
- package/dist/plugins/forecasting.js +236 -0
- package/dist/plugins/forecasting.js.map +1 -0
- package/dist/plugins/latex.d.ts +1 -0
- package/dist/plugins/latex.js +454 -0
- package/dist/plugins/latex.js.map +1 -0
- package/dist/plugins/lazy-load.d.ts +3 -0
- package/dist/plugins/lazy-load.js +189 -0
- package/dist/plugins/lazy-load.js.map +1 -0
- package/dist/plugins/ml-integration.d.ts +3 -0
- package/dist/plugins/ml-integration.js +355 -0
- package/dist/plugins/ml-integration.js.map +1 -0
- package/dist/plugins/offscreen.d.ts +3 -0
- package/dist/plugins/offscreen.js +169 -0
- package/dist/plugins/offscreen.js.map +1 -0
- package/dist/plugins/pattern-recognition.d.ts +3 -0
- package/dist/plugins/pattern-recognition.js +690 -0
- package/dist/plugins/pattern-recognition.js.map +1 -0
- package/dist/plugins/radar.d.ts +3 -0
- package/dist/plugins/radar.js +103 -0
- package/dist/plugins/radar.js.map +1 -0
- package/dist/plugins/regression.d.ts +3 -0
- package/dist/plugins/regression.js +634 -0
- package/dist/plugins/regression.js.map +1 -0
- package/dist/plugins/roi.d.ts +1 -0
- package/dist/plugins/roi.js +223 -0
- package/dist/plugins/roi.js.map +1 -0
- package/dist/plugins/snapshot/types.d.ts +1 -1
- package/dist/plugins/snapshot.d.ts +3 -0
- package/dist/plugins/snapshot.js +90 -0
- package/dist/plugins/snapshot.js.map +1 -0
- package/dist/plugins/sync/index.d.ts +2 -1
- package/dist/plugins/sync.js +12 -244
- package/dist/plugins/sync.js.map +1 -1
- package/dist/plugins/tools/tooltip/TooltipManager.d.ts +9 -1
- package/dist/plugins/tools/tooltip/format.d.ts +7 -0
- package/dist/plugins/tools/tooltip/types.d.ts +6 -8
- package/dist/plugins/tools.js +1 -1
- package/dist/plugins/video-recorder.d.ts +3 -0
- package/dist/plugins/video-recorder.js +104 -0
- package/dist/plugins/video-recorder.js.map +1 -0
- package/dist/plugins/virtualization.d.ts +3 -0
- package/dist/plugins/virtualization.js +6 -0
- package/dist/plugins/virtualization.js.map +1 -0
- package/dist/react/index.d.ts +2 -1
- package/dist/react/useStackedPlot.d.ts +17 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +31 -0
- package/dist/react.js.map +1 -0
- package/dist/types.d.ts +21 -1
- package/dist/utils-BK5UUXxj.js +172 -0
- package/dist/utils-BK5UUXxj.js.map +1 -0
- package/dist/velo-plot.full.js +1000 -5576
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +23 -22
- package/dist/velo-plot.js.map +1 -1
- package/package.json +17 -3
- package/dist/EventEmitter-DAbs2K1C.js +0 -60
- package/dist/EventEmitter-DAbs2K1C.js.map +0 -1
- package/dist/index-D8ifudJH.js.map +0 -1
- package/dist/index.core-CYu3tydL.js.map +0 -1
- package/dist/utils-Dbro9-qM.js +0 -254
- package/dist/utils-Dbro9-qM.js.map +0 -1
package/dist/plugins/analysis.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { a as I, s as _,
|
|
2
|
-
import {
|
|
1
|
+
import { a as I, s as _, d as z, i as E } from "../math-Ddm2EZjj.js";
|
|
2
|
+
import { c as pn } from "../math-Ddm2EZjj.js";
|
|
3
|
+
import { g as T, f as V, d as H, s as X, m as Y, a as G, b as O, v as Z, c as U } from "../utils-BK5UUXxj.js";
|
|
4
|
+
import { h as In, e as dn, i as qn } from "../utils-BK5UUXxj.js";
|
|
3
5
|
function K(e, o, r, t = {}) {
|
|
4
6
|
const n = e.series.get(o);
|
|
5
7
|
if (!n) throw new Error(`Series ${o} not found`);
|
|
@@ -111,7 +113,7 @@ function C(e, o = 1) {
|
|
|
111
113
|
imag: f
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
|
-
function
|
|
116
|
+
function vt(e, o = 1) {
|
|
115
117
|
const r = C(e, o), t = r.frequency.length, n = new Float32Array(t), s = new Float32Array(t);
|
|
116
118
|
for (let c = 0; c < t; c++)
|
|
117
119
|
n[c] = r.magnitude[c] * r.magnitude[c], s[c] = 10 * Math.log10(Math.max(n[c], 1e-20));
|
|
@@ -121,7 +123,7 @@ function Pt(e, o = 1) {
|
|
|
121
123
|
powerDb: s
|
|
122
124
|
};
|
|
123
125
|
}
|
|
124
|
-
function
|
|
126
|
+
function $t(e, o = 1, r = 0) {
|
|
125
127
|
const t = C(e, o);
|
|
126
128
|
let n = 0, s = 0;
|
|
127
129
|
for (let c = 0; c < t.magnitude.length; c++)
|
|
@@ -131,7 +133,7 @@ function vt(e, o = 1, r = 0) {
|
|
|
131
133
|
magnitude: n
|
|
132
134
|
};
|
|
133
135
|
}
|
|
134
|
-
function
|
|
136
|
+
function Rt(e) {
|
|
135
137
|
const o = e.length, r = new Float32Array(o);
|
|
136
138
|
for (let t = 0; t < o; t++) {
|
|
137
139
|
const n = 0.5 * (1 - Math.cos(2 * Math.PI * t / (o - 1)));
|
|
@@ -147,7 +149,7 @@ function jt(e) {
|
|
|
147
149
|
}
|
|
148
150
|
return r;
|
|
149
151
|
}
|
|
150
|
-
function
|
|
152
|
+
function kt(e) {
|
|
151
153
|
const o = e.length, r = new Float32Array(o), t = 0.42, n = 0.5, s = 0.08;
|
|
152
154
|
for (let c = 0; c < o; c++) {
|
|
153
155
|
const a = t - n * Math.cos(2 * Math.PI * c / (o - 1)) + s * Math.cos(4 * Math.PI * c / (o - 1));
|
|
@@ -155,7 +157,7 @@ function Rt(e) {
|
|
|
155
157
|
}
|
|
156
158
|
return r;
|
|
157
159
|
}
|
|
158
|
-
function
|
|
160
|
+
function St(e, o = 1) {
|
|
159
161
|
const r = v(e), t = r.length, n = t / 2, s = new Float32Array(t), c = new Float32Array(t), a = new Float32Array(t), l = new Float32Array(t), f = new Float32Array(t);
|
|
160
162
|
for (let i = 0; i < t; i++)
|
|
161
163
|
s[i] = r[i].re, c[i] = r[i].im, a[i] = i * o / t, l[i] = Math.sqrt(r[i].re * r[i].re + r[i].im * r[i].im), f[i] = Math.atan2(r[i].im, r[i].re);
|
|
@@ -169,7 +171,7 @@ function kt(e, o = 1) {
|
|
|
169
171
|
nyquist: n
|
|
170
172
|
};
|
|
171
173
|
}
|
|
172
|
-
function
|
|
174
|
+
function Ct(e, o) {
|
|
173
175
|
const r = e.length;
|
|
174
176
|
if (o.length !== r)
|
|
175
177
|
throw new Error("Real and imaginary arrays must have the same length");
|
|
@@ -184,8 +186,8 @@ function St(e, o) {
|
|
|
184
186
|
const u = i / 2, h = -2 * Math.PI / i;
|
|
185
187
|
for (let m = 0; m < t; m += i)
|
|
186
188
|
for (let y = 0; y < u; y++) {
|
|
187
|
-
const w = h * y, g = Math.cos(w), F = Math.sin(w), A = m + y,
|
|
188
|
-
n[
|
|
189
|
+
const w = h * y, g = Math.cos(w), F = Math.sin(w), A = m + y, p = m + y + u, b = g * n[p].re - F * n[p].im, d = g * n[p].im + F * n[p].re;
|
|
190
|
+
n[p].re = n[A].re - b, n[p].im = n[A].im - d, n[A].re = n[A].re + b, n[A].im = n[A].im + d;
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
const s = new Float32Array(t), c = new Float32Array(t), a = new Float32Array(t), l = new Float32Array(t), f = new Float32Array(t);
|
|
@@ -201,7 +203,7 @@ function St(e, o) {
|
|
|
201
203
|
nyquist: t / 2
|
|
202
204
|
};
|
|
203
205
|
}
|
|
204
|
-
function
|
|
206
|
+
function Dt(e) {
|
|
205
207
|
const o = e.length, r = new Float32Array(o), t = new Float32Array(o);
|
|
206
208
|
for (let n = 0; n < o; n++)
|
|
207
209
|
r[n] = e[n].re, t[n] = e[n].im;
|
|
@@ -216,11 +218,11 @@ function nt(e, o) {
|
|
|
216
218
|
t[n] = { re: e[n], im: o[n] };
|
|
217
219
|
return t;
|
|
218
220
|
}
|
|
219
|
-
function
|
|
221
|
+
function Lt(e, o) {
|
|
220
222
|
const r = nt(e, o);
|
|
221
223
|
return Q(r);
|
|
222
224
|
}
|
|
223
|
-
function
|
|
225
|
+
function Bt(e) {
|
|
224
226
|
const o = e.length, t = e.map((c) => ({ re: c.re, im: -c.im })).map((c) => ({ ...c }));
|
|
225
227
|
q(t);
|
|
226
228
|
for (let c = 2; c <= o; c *= 2) {
|
|
@@ -236,7 +238,7 @@ function Lt(e) {
|
|
|
236
238
|
n[c] = t[c].re / o, s[c] = -t[c].im / o;
|
|
237
239
|
return { real: n, imag: s };
|
|
238
240
|
}
|
|
239
|
-
function
|
|
241
|
+
function Wt(e) {
|
|
240
242
|
const o = e.nyquist;
|
|
241
243
|
return {
|
|
242
244
|
real: e.real.slice(0, o),
|
|
@@ -380,7 +382,7 @@ function M(e, o) {
|
|
|
380
382
|
t[c] = (r[c] - t[c - 1]) * n + t[c - 1];
|
|
381
383
|
return t;
|
|
382
384
|
}
|
|
383
|
-
function
|
|
385
|
+
function _t(e, o) {
|
|
384
386
|
const r = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), t = new Float32Array(r.length);
|
|
385
387
|
if (o < 1 || o > r.length)
|
|
386
388
|
return t.fill(NaN), t;
|
|
@@ -395,13 +397,13 @@ function Wt(e, o) {
|
|
|
395
397
|
}
|
|
396
398
|
return t;
|
|
397
399
|
}
|
|
398
|
-
function
|
|
400
|
+
function zt(e, o) {
|
|
399
401
|
const r = M(e, o), t = M(r, o), n = new Float32Array(e.length);
|
|
400
402
|
for (let s = 0; s < e.length; s++)
|
|
401
403
|
n[s] = 2 * r[s] - t[s];
|
|
402
404
|
return n;
|
|
403
405
|
}
|
|
404
|
-
function
|
|
406
|
+
function Et(e, o) {
|
|
405
407
|
const r = M(e, o), t = M(r, o), n = M(t, o), s = new Float32Array(e.length);
|
|
406
408
|
for (let c = 0; c < e.length; c++)
|
|
407
409
|
s[c] = 3 * r[c] - 3 * t[c] + n[c];
|
|
@@ -436,7 +438,7 @@ function ct(e, o = 14) {
|
|
|
436
438
|
}
|
|
437
439
|
return t;
|
|
438
440
|
}
|
|
439
|
-
function
|
|
441
|
+
function Tt(e, o = 12, r = 26, t = 9) {
|
|
440
442
|
const n = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), s = M(n, o), c = M(n, r), a = new Float32Array(n.length);
|
|
441
443
|
for (let i = 0; i < n.length; i++)
|
|
442
444
|
a[i] = s[i] - c[i];
|
|
@@ -449,7 +451,7 @@ function Et(e, o = 12, r = 26, t = 9) {
|
|
|
449
451
|
histogram: f
|
|
450
452
|
};
|
|
451
453
|
}
|
|
452
|
-
function
|
|
454
|
+
function Vt(e, o = 14, r = 3) {
|
|
453
455
|
const { high: t, low: n, close: s } = e, c = s.length, a = new Float32Array(c);
|
|
454
456
|
for (let f = 0; f < c; f++) {
|
|
455
457
|
if (f < o - 1) {
|
|
@@ -470,7 +472,7 @@ function Tt(e, o = 14, r = 3) {
|
|
|
470
472
|
// %D
|
|
471
473
|
};
|
|
472
474
|
}
|
|
473
|
-
function
|
|
475
|
+
function Ht(e, o = 10) {
|
|
474
476
|
const r = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), t = new Float32Array(r.length);
|
|
475
477
|
for (let n = 0; n < o; n++)
|
|
476
478
|
t[n] = NaN;
|
|
@@ -480,7 +482,7 @@ function Vt(e, o = 10) {
|
|
|
480
482
|
}
|
|
481
483
|
return t;
|
|
482
484
|
}
|
|
483
|
-
function
|
|
485
|
+
function Xt(e, o = 10) {
|
|
484
486
|
const r = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), t = new Float32Array(r.length);
|
|
485
487
|
for (let n = 0; n < o; n++)
|
|
486
488
|
t[n] = NaN;
|
|
@@ -488,7 +490,7 @@ function Ht(e, o = 10) {
|
|
|
488
490
|
t[n] = r[n] - r[n - o];
|
|
489
491
|
return t;
|
|
490
492
|
}
|
|
491
|
-
function
|
|
493
|
+
function Yt(e, o = 20, r = 2) {
|
|
492
494
|
const t = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), n = N(t, o), s = new Float32Array(t.length), c = new Float32Array(t.length);
|
|
493
495
|
for (let a = 0; a < t.length; a++) {
|
|
494
496
|
if (a < o - 1) {
|
|
@@ -509,7 +511,7 @@ function Xt(e, o = 20, r = 2) {
|
|
|
509
511
|
lower: c
|
|
510
512
|
};
|
|
511
513
|
}
|
|
512
|
-
function
|
|
514
|
+
function Gt(e, o = 14) {
|
|
513
515
|
const { high: r, low: t, close: n } = e, s = n.length, c = new Float32Array(s);
|
|
514
516
|
c[0] = r[0] - t[0];
|
|
515
517
|
for (let a = 1; a < s; a++) {
|
|
@@ -518,7 +520,7 @@ function Yt(e, o = 14) {
|
|
|
518
520
|
}
|
|
519
521
|
return M(c, o);
|
|
520
522
|
}
|
|
521
|
-
function
|
|
523
|
+
function Ot(e, o = 20) {
|
|
522
524
|
const r = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), t = new Float32Array(r.length), n = N(r, o);
|
|
523
525
|
for (let s = 0; s < r.length; s++) {
|
|
524
526
|
if (s < o - 1) {
|
|
@@ -534,7 +536,7 @@ function Gt(e, o = 20) {
|
|
|
534
536
|
}
|
|
535
537
|
return t;
|
|
536
538
|
}
|
|
537
|
-
function
|
|
539
|
+
function Zt(e) {
|
|
538
540
|
const { high: o, low: r, close: t, volume: n } = e;
|
|
539
541
|
if (!n)
|
|
540
542
|
throw new Error("VWAP requires volume data");
|
|
@@ -546,21 +548,21 @@ function Ot(e) {
|
|
|
546
548
|
}
|
|
547
549
|
return c;
|
|
548
550
|
}
|
|
549
|
-
function
|
|
551
|
+
function Ut(e, o) {
|
|
550
552
|
const r = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), t = o instanceof Float32Array || o instanceof Float64Array ? o : Float32Array.from(o), n = new Float32Array(r.length);
|
|
551
553
|
n[0] = t[0];
|
|
552
554
|
for (let s = 1; s < r.length; s++)
|
|
553
555
|
r[s] > r[s - 1] ? n[s] = n[s - 1] + t[s] : r[s] < r[s - 1] ? n[s] = n[s - 1] - t[s] : n[s] = n[s - 1];
|
|
554
556
|
return n;
|
|
555
557
|
}
|
|
556
|
-
function
|
|
558
|
+
function Kt(e, o = 14) {
|
|
557
559
|
const { high: r, low: t, close: n } = e, s = n.length, c = new Float32Array(s), a = new Float32Array(s), l = new Float32Array(s);
|
|
558
560
|
l[0] = r[0] - t[0], c[0] = 0, a[0] = 0;
|
|
559
561
|
for (let g = 1; g < s; g++) {
|
|
560
562
|
const F = r[g] - r[g - 1], A = t[g - 1] - t[g];
|
|
561
563
|
c[g] = F > A && F > 0 ? F : 0, a[g] = A > F && A > 0 ? A : 0;
|
|
562
|
-
const
|
|
563
|
-
l[g] = Math.max(
|
|
564
|
+
const p = r[g] - t[g], b = Math.abs(r[g] - n[g - 1]), d = Math.abs(t[g] - n[g - 1]);
|
|
565
|
+
l[g] = Math.max(p, b, d);
|
|
564
566
|
}
|
|
565
567
|
const f = M(l, o), i = M(c, o), u = M(a, o), h = new Float32Array(s), m = new Float32Array(s), y = new Float32Array(s);
|
|
566
568
|
for (let g = 0; g < s; g++)
|
|
@@ -579,7 +581,7 @@ function Ut(e, o = 14) {
|
|
|
579
581
|
// -DI
|
|
580
582
|
};
|
|
581
583
|
}
|
|
582
|
-
function
|
|
584
|
+
function Qt(e, o = 25) {
|
|
583
585
|
const { high: r, low: t } = e, n = r.length, s = new Float32Array(n), c = new Float32Array(n);
|
|
584
586
|
for (let l = 0; l < n; l++) {
|
|
585
587
|
if (l < o) {
|
|
@@ -600,7 +602,7 @@ function Kt(e, o = 25) {
|
|
|
600
602
|
lower: c
|
|
601
603
|
};
|
|
602
604
|
}
|
|
603
|
-
function
|
|
605
|
+
function Jt(e, o = 1) {
|
|
604
606
|
const r = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), t = new Float32Array(r.length);
|
|
605
607
|
for (let n = 0; n < o; n++)
|
|
606
608
|
t[n] = NaN;
|
|
@@ -610,14 +612,14 @@ function Qt(e, o = 1) {
|
|
|
610
612
|
}
|
|
611
613
|
return t;
|
|
612
614
|
}
|
|
613
|
-
function
|
|
615
|
+
function tn(e) {
|
|
614
616
|
const o = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), r = new Float32Array(o.length);
|
|
615
617
|
r[0] = o[0];
|
|
616
618
|
for (let t = 1; t < o.length; t++)
|
|
617
619
|
r[t] = r[t - 1] + o[t];
|
|
618
620
|
return r;
|
|
619
621
|
}
|
|
620
|
-
function
|
|
622
|
+
function nn(e) {
|
|
621
623
|
const o = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e), r = new Float32Array(o.length);
|
|
622
624
|
let t = 1 / 0, n = -1 / 0;
|
|
623
625
|
for (let c = 0; c < o.length; c++)
|
|
@@ -630,15 +632,15 @@ function tn(e) {
|
|
|
630
632
|
r[c] = (o[c] - t) / s * 100;
|
|
631
633
|
return r;
|
|
632
634
|
}
|
|
633
|
-
function
|
|
635
|
+
function en(e, o, r, t = 5) {
|
|
634
636
|
const n = o / (r / 2), s = L(Math.min(n, 0.99), t);
|
|
635
637
|
return P(e, s);
|
|
636
638
|
}
|
|
637
|
-
function
|
|
639
|
+
function on(e, o, r, t = 5) {
|
|
638
640
|
const n = o / (r / 2), s = at(Math.min(n, 0.99), t);
|
|
639
641
|
return P(e, s);
|
|
640
642
|
}
|
|
641
|
-
function
|
|
643
|
+
function rn(e, o, r, t, n = 5) {
|
|
642
644
|
const s = o / (t / 2), c = r / (t / 2), a = B(
|
|
643
645
|
Math.max(s, 0.01),
|
|
644
646
|
Math.min(c, 0.99),
|
|
@@ -646,7 +648,7 @@ function on(e, o, r, t, n = 5) {
|
|
|
646
648
|
);
|
|
647
649
|
return P(e, a);
|
|
648
650
|
}
|
|
649
|
-
function
|
|
651
|
+
function sn(e, o, r, t, n = 5) {
|
|
650
652
|
const s = o / (t / 2), c = r / (t / 2), a = lt(
|
|
651
653
|
Math.max(s, 0.01),
|
|
652
654
|
Math.min(c, 0.99),
|
|
@@ -697,7 +699,7 @@ function P(e, o) {
|
|
|
697
699
|
}
|
|
698
700
|
return s;
|
|
699
701
|
}
|
|
700
|
-
function
|
|
702
|
+
function cn(e, o) {
|
|
701
703
|
const { type: r, cutoff: t, cutoffHigh: n, sampleRate: s = 1, order: c = 2 } = o, a = 2 * t / s, l = n ? 2 * n / s : void 0, { b: f, a: i } = ut(r, a, l);
|
|
702
704
|
return W(e, f, i);
|
|
703
705
|
}
|
|
@@ -752,7 +754,7 @@ function gt(e, o, r) {
|
|
|
752
754
|
a: [1, 2 * (t * t - 1) * c, (1 - t / s + t * t) * c]
|
|
753
755
|
};
|
|
754
756
|
}
|
|
755
|
-
function
|
|
757
|
+
function R(e, o, r) {
|
|
756
758
|
const t = e.length, n = new Float32Array(t);
|
|
757
759
|
for (let s = 0; s < t; s++) {
|
|
758
760
|
n[s] = o[0] * e[s];
|
|
@@ -762,22 +764,22 @@ function j(e, o, r) {
|
|
|
762
764
|
return n;
|
|
763
765
|
}
|
|
764
766
|
function W(e, o, r) {
|
|
765
|
-
const t =
|
|
767
|
+
const t = R(e, o, r), n = new Float32Array(t.length);
|
|
766
768
|
for (let a = 0; a < t.length; a++)
|
|
767
769
|
n[a] = t[t.length - 1 - a];
|
|
768
|
-
const s =
|
|
770
|
+
const s = R(n, o, r), c = new Float32Array(s.length);
|
|
769
771
|
for (let a = 0; a < s.length; a++)
|
|
770
772
|
c[a] = s[s.length - 1 - a];
|
|
771
773
|
return c;
|
|
772
774
|
}
|
|
773
|
-
function
|
|
775
|
+
function an(e, o = 0.3) {
|
|
774
776
|
const r = e.length, t = new Float32Array(r);
|
|
775
777
|
t[0] = e[0];
|
|
776
778
|
for (let n = 1; n < r; n++)
|
|
777
779
|
t[n] = o * e[n] + (1 - o) * t[n - 1];
|
|
778
780
|
return t;
|
|
779
781
|
}
|
|
780
|
-
function
|
|
782
|
+
function ln(e, o = 2) {
|
|
781
783
|
const r = e.length, t = new Float32Array(r), n = Math.ceil(o * 3) * 2 + 1, s = Math.floor(n / 2), c = new Float32Array(n);
|
|
782
784
|
let a = 0;
|
|
783
785
|
for (let l = 0; l < n; l++) {
|
|
@@ -796,7 +798,7 @@ function an(e, o = 2) {
|
|
|
796
798
|
}
|
|
797
799
|
return t;
|
|
798
800
|
}
|
|
799
|
-
function
|
|
801
|
+
function fn(e, o = 5, r = 2) {
|
|
800
802
|
const t = e.length, n = new Float32Array(t), s = Math.floor(o / 2), c = yt(o);
|
|
801
803
|
for (let a = 0; a < t; a++) {
|
|
802
804
|
let l = 0;
|
|
@@ -819,7 +821,7 @@ function yt(e, o) {
|
|
|
819
821
|
for (let c = 0; c < e; c++) t[c] /= s;
|
|
820
822
|
return t;
|
|
821
823
|
}
|
|
822
|
-
function
|
|
824
|
+
function un(e, o = 5) {
|
|
823
825
|
const r = e.length, t = new Float32Array(r), n = Math.floor(o / 2);
|
|
824
826
|
for (let s = 0; s < r; s++) {
|
|
825
827
|
const c = [];
|
|
@@ -831,7 +833,7 @@ function fn(e, o = 5) {
|
|
|
831
833
|
}
|
|
832
834
|
return t;
|
|
833
835
|
}
|
|
834
|
-
function
|
|
836
|
+
function hn(e, o, r, t = {}) {
|
|
835
837
|
const n = o.length, s = r.length, c = Math.min(...e), a = Math.max(...e), l = t.levels || wt(c, a, t.numLevels || 10), f = [];
|
|
836
838
|
for (const i of l) {
|
|
837
839
|
const u = [];
|
|
@@ -924,9 +926,9 @@ function At(e, o, r) {
|
|
|
924
926
|
const F = g - s;
|
|
925
927
|
l[g] = F;
|
|
926
928
|
let A = 0;
|
|
927
|
-
for (let
|
|
928
|
-
const
|
|
929
|
-
|
|
929
|
+
for (let p = 0; p < t; p++) {
|
|
930
|
+
const b = p + F;
|
|
931
|
+
b >= 0 && b < n && (A += (e[p] - f) * (o[b] - i));
|
|
930
932
|
}
|
|
931
933
|
a[g] = m > 0 ? A / m : 0, a[g] > y && (y = a[g], w = g);
|
|
932
934
|
}
|
|
@@ -937,25 +939,25 @@ function At(e, o, r) {
|
|
|
937
939
|
lagAtMax: l[w]
|
|
938
940
|
};
|
|
939
941
|
}
|
|
940
|
-
function
|
|
942
|
+
function mn(e, o) {
|
|
941
943
|
return At(e, e, o);
|
|
942
944
|
}
|
|
943
|
-
function
|
|
945
|
+
function gn(e, o = {}) {
|
|
944
946
|
const { method: r = "zscore", windowSize: t } = o;
|
|
945
947
|
switch (r) {
|
|
946
948
|
case "zscore":
|
|
947
|
-
return
|
|
949
|
+
return j(e, o.threshold ?? 3, t);
|
|
948
950
|
case "mad":
|
|
949
951
|
return Mt(e, o.threshold ?? 2.5);
|
|
950
952
|
case "iqr":
|
|
951
|
-
return
|
|
953
|
+
return pt(e, o.threshold ?? 1.5);
|
|
952
954
|
case "isolation":
|
|
953
|
-
return
|
|
955
|
+
return bt(e, o.threshold ?? 0.5);
|
|
954
956
|
default:
|
|
955
|
-
return
|
|
957
|
+
return j(e, 3, t);
|
|
956
958
|
}
|
|
957
959
|
}
|
|
958
|
-
function
|
|
960
|
+
function j(e, o, r) {
|
|
959
961
|
const t = e.length, n = new Float32Array(t), s = [];
|
|
960
962
|
if (r && r < t) {
|
|
961
963
|
const c = Math.floor(r / 2);
|
|
@@ -986,13 +988,13 @@ function Mt(e, o, r) {
|
|
|
986
988
|
n[u] = i > 0 ? Math.abs(e[u] - a) / i : 0, n[u] > o && s.push(u);
|
|
987
989
|
return { indices: s, scores: n, threshold: o };
|
|
988
990
|
}
|
|
989
|
-
function
|
|
991
|
+
function pt(e, o) {
|
|
990
992
|
const r = e.length, t = new Float32Array(r), n = [], s = Array.from(e).sort((u, h) => u - h), c = s[Math.floor(r * 0.25)], a = s[Math.floor(r * 0.75)], l = a - c, f = c - o * l, i = a + o * l;
|
|
991
993
|
for (let u = 0; u < r; u++)
|
|
992
994
|
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;
|
|
993
995
|
return { indices: n, scores: t, threshold: o };
|
|
994
996
|
}
|
|
995
|
-
function
|
|
997
|
+
function bt(e, o, r) {
|
|
996
998
|
const t = e.length, n = new Float32Array(t), s = [], c = It(e);
|
|
997
999
|
for (let a = 0; a < t; a++) {
|
|
998
1000
|
let l = 0;
|
|
@@ -1038,7 +1040,7 @@ function dt(e, o) {
|
|
|
1038
1040
|
} else return o ? k(e, o) : dt(e, 1);
|
|
1039
1041
|
return n;
|
|
1040
1042
|
}
|
|
1041
|
-
function
|
|
1043
|
+
function yn(e, o) {
|
|
1042
1044
|
const r = e.length, t = new Float32Array(r);
|
|
1043
1045
|
if (r < 2)
|
|
1044
1046
|
return t[0] = 0, t;
|
|
@@ -1054,7 +1056,7 @@ function gn(e, o) {
|
|
|
1054
1056
|
t[n] = t[n - 1] + (e[n - 1] + e[n]) / 2;
|
|
1055
1057
|
return t;
|
|
1056
1058
|
}
|
|
1057
|
-
function
|
|
1059
|
+
function wn(e, o) {
|
|
1058
1060
|
const r = e.length, t = o.length;
|
|
1059
1061
|
let n = 0, s = 0;
|
|
1060
1062
|
for (let y = 0; y < r; y++) n += e[y];
|
|
@@ -1085,7 +1087,7 @@ const xt = {
|
|
|
1085
1087
|
provides: ["analysis"],
|
|
1086
1088
|
tags: ["fft", "filters", "statistics", "math"]
|
|
1087
1089
|
};
|
|
1088
|
-
function
|
|
1090
|
+
function Fn(e = {}) {
|
|
1089
1091
|
let o;
|
|
1090
1092
|
return {
|
|
1091
1093
|
manifest: xt,
|
|
@@ -1099,17 +1101,17 @@ function wn(e = {}) {
|
|
|
1099
1101
|
return K(o.chart, r, t, n);
|
|
1100
1102
|
},
|
|
1101
1103
|
// Math & Stats
|
|
1102
|
-
integrate:
|
|
1103
|
-
derivative:
|
|
1104
|
-
calculateStats:
|
|
1105
|
-
validateData:
|
|
1104
|
+
integrate: E,
|
|
1105
|
+
derivative: z,
|
|
1106
|
+
calculateStats: U,
|
|
1107
|
+
validateData: Z,
|
|
1106
1108
|
// Signal Processing
|
|
1107
1109
|
fft: (r) => v(r),
|
|
1108
|
-
detectPeaks:
|
|
1109
|
-
detectCycles:
|
|
1110
|
-
movingAverage:
|
|
1111
|
-
subtractBaseline:
|
|
1112
|
-
downsampleLTTB:
|
|
1110
|
+
detectPeaks: O,
|
|
1111
|
+
detectCycles: G,
|
|
1112
|
+
movingAverage: Y,
|
|
1113
|
+
subtractBaseline: X,
|
|
1114
|
+
downsampleLTTB: H,
|
|
1113
1115
|
singleFrequencyFilter: it,
|
|
1114
1116
|
// Fitting
|
|
1115
1117
|
fitData: D,
|
|
@@ -1118,85 +1120,85 @@ function wn(e = {}) {
|
|
|
1118
1120
|
ema: M,
|
|
1119
1121
|
rsi: ct,
|
|
1120
1122
|
// Utils
|
|
1121
|
-
formatWithPrefix:
|
|
1122
|
-
generateCycleColors:
|
|
1123
|
+
formatWithPrefix: V,
|
|
1124
|
+
generateCycleColors: T
|
|
1123
1125
|
}
|
|
1124
1126
|
};
|
|
1125
1127
|
}
|
|
1126
1128
|
export {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1129
|
+
Fn as PluginAnalysis,
|
|
1130
|
+
Kt as adx,
|
|
1131
|
+
St as analyzeComplexSpectrum,
|
|
1130
1132
|
C as analyzeSpectrum,
|
|
1131
|
-
|
|
1133
|
+
Qt as aroon,
|
|
1132
1134
|
nt as arraysToComplex,
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1135
|
+
Gt as atr,
|
|
1136
|
+
mn as autoCorrelation,
|
|
1137
|
+
rn as bandPassFilter,
|
|
1138
|
+
sn as bandStopFilter,
|
|
1139
|
+
kt as blackmanWindow,
|
|
1140
|
+
Yt as bollingerBands,
|
|
1141
|
+
cn as butterworth,
|
|
1140
1142
|
I as calculateR2,
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
+
U as calculateStats,
|
|
1144
|
+
Dt as complexToArrays,
|
|
1143
1145
|
At as crossCorrelation,
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1146
|
+
tn as cumsum,
|
|
1147
|
+
pn as cumulativeIntegral,
|
|
1148
|
+
yn as cumulativeIntegral2,
|
|
1149
|
+
Fn as default,
|
|
1150
|
+
zt as dema,
|
|
1151
|
+
z as derivative,
|
|
1152
|
+
gn as detectAnomalies,
|
|
1153
|
+
G as detectCycles,
|
|
1154
|
+
O as detectPeaks,
|
|
1155
|
+
$t as dominantFrequency,
|
|
1156
|
+
H as downsampleLTTB,
|
|
1155
1157
|
M as ema,
|
|
1156
|
-
|
|
1158
|
+
an as exponentialMovingAverage,
|
|
1157
1159
|
v as fft,
|
|
1158
|
-
|
|
1160
|
+
Ct as fftFromComplexInput,
|
|
1159
1161
|
D as fitData,
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1162
|
+
In as formatScientific,
|
|
1163
|
+
dn as formatValue,
|
|
1164
|
+
V as formatWithPrefix,
|
|
1165
|
+
ln as gaussianSmooth,
|
|
1166
|
+
hn as generateContours,
|
|
1167
|
+
T as generateCycleColors,
|
|
1168
|
+
qn as getBestPrefix,
|
|
1169
|
+
Wt as getPositiveFrequencies,
|
|
1168
1170
|
jt as hammingWindow,
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
+
Rt as hanningWindow,
|
|
1172
|
+
on as highPassFilter,
|
|
1171
1173
|
Q as ifft,
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1174
|
+
Bt as ifftComplex,
|
|
1175
|
+
Lt as ifftFromArrays,
|
|
1176
|
+
E as integrate,
|
|
1177
|
+
en as lowPassFilter,
|
|
1178
|
+
Tt as macd,
|
|
1179
|
+
un as medianFilter,
|
|
1180
|
+
Xt as momentum,
|
|
1181
|
+
Y as movingAverage,
|
|
1180
1182
|
S as nextPowerOf2,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1183
|
+
nn as normalize,
|
|
1184
|
+
Ut as obv,
|
|
1185
|
+
Jt as percentChange,
|
|
1186
|
+
vt as powerSpectrum,
|
|
1187
|
+
Ht as roc,
|
|
1186
1188
|
ct as rsi,
|
|
1187
|
-
|
|
1189
|
+
fn as savitzkyGolay,
|
|
1188
1190
|
dt as simpsonsIntegration,
|
|
1189
1191
|
it as singleFrequencyFilter,
|
|
1190
1192
|
N as sma,
|
|
1191
1193
|
_ as solveLinearSystem,
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1194
|
+
Ot as standardDeviation,
|
|
1195
|
+
Vt as stochastic,
|
|
1196
|
+
X as subtractBaseline,
|
|
1197
|
+
wn as tTest,
|
|
1198
|
+
Et as tema,
|
|
1197
1199
|
k as trapezoidalIntegration,
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1200
|
+
Z as validateData,
|
|
1201
|
+
Zt as vwap,
|
|
1202
|
+
_t as wma
|
|
1201
1203
|
};
|
|
1202
1204
|
//# sourceMappingURL=analysis.js.map
|