velo-plot 3.0.0 → 4.0.0-alpha.1
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 +22 -15
- package/dist/ChartCore-KYG2HTcK.js +7474 -0
- package/dist/ChartCore-KYG2HTcK.js.map +1 -0
- package/dist/GpuChartRenderer-Dxc0hrQA.js +75 -0
- package/dist/GpuChartRenderer-Dxc0hrQA.js.map +1 -0
- package/dist/{index.core-BmZe2jRQ.js → PluginRegistry-CDf_jcnp.js} +19 -33
- package/dist/PluginRegistry-CDf_jcnp.js.map +1 -0
- package/dist/SVGDocumentBuilder-C-uLkcFW.js +83 -0
- package/dist/SVGDocumentBuilder-C-uLkcFW.js.map +1 -0
- package/dist/angular-hooks.js +1 -1
- package/dist/angular.js +8 -8
- package/dist/{axisFormat-CzumxpCL.js → axisFormat-Sz4WIJfQ.js} +2 -2
- package/dist/{axisFormat-CzumxpCL.js.map → axisFormat-Sz4WIJfQ.js.map} +1 -1
- package/dist/{chartSyncBridge-DbWrwtyP.js → chartSyncBridge-C1uRy0ZS.js} +12 -11
- package/dist/{chartSyncBridge-DbWrwtyP.js.map → chartSyncBridge-C1uRy0ZS.js.map} +1 -1
- package/dist/core/ChartStatistics.d.ts +1 -1
- package/dist/core/chart/ChartCore.d.ts +19 -20
- package/dist/core/chart/ChartFeatureHooks.d.ts +7 -0
- package/dist/core/chart/ChartRenderLoop.d.ts +5 -0
- package/dist/core/chart/ChartRenderer.d.ts +9 -0
- package/dist/core/chart/ChartSetup.d.ts +1 -0
- package/dist/core/chart/chartExportPatch.d.ts +2 -0
- package/dist/core/chart/exporter/SVGExporter.d.ts +9 -7
- package/dist/core/chart/exporter/svg/SVGDocumentBuilder.d.ts +27 -0
- package/dist/core/chart/exporter/svg/SVGExportContext.d.ts +147 -0
- package/dist/core/chart/exporter/svg/SVGOrchestrator.d.ts +3 -0
- package/dist/core/chart/exporter/svg/SVGThemeAdapter.d.ts +22 -0
- package/dist/core/chart/exporter/svg/__tests__/testFixtures.d.ts +46 -0
- package/dist/core/chart/exporter/svg/__tests__/visualTestUtils.d.ts +12 -0
- package/dist/core/chart/exporter/svg/overlay/axes.d.ts +4 -0
- package/dist/core/chart/exporter/svg/overlay/border.d.ts +4 -0
- package/dist/core/chart/exporter/svg/overlay/errorBars.d.ts +7 -0
- package/dist/core/chart/exporter/svg/overlay/grid.d.ts +4 -0
- package/dist/core/chart/exporter/svg/overlay/index.d.ts +12 -0
- package/dist/core/chart/exporter/svg/overlay/legend.d.ts +4 -0
- package/dist/core/chart/exporter/svg/overlay/pluginCharts.d.ts +6 -0
- package/dist/core/chart/exporter/svg/overlay/polarGrid.d.ts +4 -0
- package/dist/core/chart/exporter/svg/overlay/specialChart.d.ts +15 -0
- package/dist/core/chart/exporter/svg/overlay/title.d.ts +4 -0
- package/dist/core/chart/exporter/svg/plugins/annotations.d.ts +5 -0
- package/dist/core/chart/exporter/svg/plugins/brokenAxis.d.ts +20 -0
- package/dist/core/chart/exporter/svg/plugins/latex.d.ts +9 -0
- package/dist/core/chart/exporter/svg/plugins/register.d.ts +8 -0
- package/dist/core/chart/exporter/svg/plugins/regression.d.ts +33 -0
- package/dist/core/chart/exporter/svg/plugins/roi.d.ts +12 -0
- package/dist/core/chart/exporter/svg/plugins/tradeMarkers.d.ts +3 -0
- package/dist/core/chart/exporter/svg/plugins/types.d.ts +28 -0
- package/dist/core/chart/exporter/svg/plugins/watermark.d.ts +13 -0
- package/dist/core/chart/exporter/svg/series/band.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/bar.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/boxplot.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/candlestick.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/finitePoints.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/gauge.d.ts +5 -0
- package/dist/core/chart/exporter/svg/series/heatmap.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/indicator.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/line.d.ts +12 -0
- package/dist/core/chart/exporter/svg/series/polar.d.ts +6 -0
- package/dist/core/chart/exporter/svg/series/radar.d.ts +5 -0
- package/dist/core/chart/exporter/svg/series/registry.d.ts +10 -0
- package/dist/core/chart/exporter/svg/series/sankey.d.ts +5 -0
- package/dist/core/chart/exporter/svg/series/scatter.d.ts +1 -0
- package/dist/core/chart/exporter/svg/series/ternary.d.ts +7 -0
- package/dist/core/chart/exporter/svg/series/waterfall.d.ts +6 -0
- package/dist/core/chart/exporter/svg/seriesAtTimestamp.d.ts +4 -0
- package/dist/core/chart/exporter/svg/seriesUtils.d.ts +3 -0
- package/dist/core/chart/exporter/svg/symbols.d.ts +5 -0
- package/dist/core/chart/exporter/svg/tickUtils.d.ts +9 -0
- package/dist/core/chart/mountSVGString.d.ts +5 -0
- package/dist/core/chart/overlaySeriesRegistry.d.ts +7 -0
- package/dist/core/chart/series/SeriesActions.d.ts +1 -0
- package/dist/core/chart/series/SeriesBufferLite.d.ts +13 -0
- package/dist/core/chart/series/seriesOptionsRegistry.d.ts +8 -0
- package/dist/core/chart/series/seriesTypeRegistry.d.ts +5 -0
- package/dist/core/chart/types.d.ts +2 -2
- package/dist/core/stacked/StackSVGComposer.d.ts +14 -0
- package/dist/core/stacked/index.d.ts +3 -2
- package/dist/core/stacked/types.d.ts +12 -4
- package/dist/createStackedChart-DjA3aJAu.js +2761 -0
- package/dist/createStackedChart-DjA3aJAu.js.map +1 -0
- package/dist/{hooks-CYPCxoZx.js → hooks-4wQH27r9.js} +7 -7
- package/dist/{hooks-CYPCxoZx.js.map → hooks-4wQH27r9.js.map} +1 -1
- package/dist/{index-qunX30Xu.js → index-B7PTX94B.js} +2133 -2133
- package/dist/index-B7PTX94B.js.map +1 -0
- package/dist/{index-BMiZoKmm.js → index-BgrvqltV.js} +67 -67
- package/dist/index-BgrvqltV.js.map +1 -0
- package/dist/index-Bj-xyXY6.js +582 -0
- package/dist/index-Bj-xyXY6.js.map +1 -0
- package/dist/index-qhscKTDy.js.map +1 -1
- package/dist/index.core.d.ts +8 -6
- package/dist/index.d.ts +1 -14
- package/dist/plugins/3d.js +3 -1
- package/dist/plugins/3d.js.map +1 -1
- package/dist/plugins/PluginManager.d.ts +5 -0
- package/dist/plugins/analysis.js.map +1 -1
- package/dist/plugins/annotations.js +8 -7
- package/dist/plugins/annotations.js.map +1 -1
- package/dist/plugins/broken-axis.js +198 -152
- package/dist/plugins/broken-axis.js.map +1 -1
- package/dist/plugins/createPlugin.d.ts +8 -0
- package/dist/plugins/debug.js +32 -32
- package/dist/plugins/debug.js.map +1 -1
- package/dist/plugins/forecasting.js +273 -258
- package/dist/plugins/forecasting.js.map +1 -1
- package/dist/plugins/gpu.js +2033 -209
- package/dist/plugins/gpu.js.map +1 -1
- package/dist/plugins/i18n.js +286 -23
- package/dist/plugins/i18n.js.map +1 -1
- package/dist/plugins/latex.js +766 -207
- package/dist/plugins/latex.js.map +1 -1
- package/dist/plugins/loading/index.d.ts +1 -2
- package/dist/plugins/loading.js +3 -4
- package/dist/plugins/ml-integration.js +107 -93
- package/dist/plugins/ml-integration.js.map +1 -1
- package/dist/plugins/offscreen.js +11 -10
- package/dist/plugins/offscreen.js.map +1 -1
- package/dist/plugins/radar/types.d.ts +11 -0
- package/dist/plugins/radar.js +64 -53
- package/dist/plugins/radar.js.map +1 -1
- package/dist/plugins/regression.js +254 -256
- package/dist/plugins/regression.js.map +1 -1
- package/dist/plugins/roi/index.d.ts +2 -0
- package/dist/plugins/roi.js +184 -145
- package/dist/plugins/roi.js.map +1 -1
- package/dist/plugins/snapshot.js +20 -15
- package/dist/plugins/snapshot.js.map +1 -1
- package/dist/plugins/streaming.js +1 -1
- package/dist/plugins/tools.js +1 -1
- package/dist/plugins/types.d.ts +4 -0
- package/dist/react.js +55 -58
- package/dist/react.js.map +1 -1
- package/dist/regression-HNdyk1Dm.js +28 -0
- package/dist/regression-HNdyk1Dm.js.map +1 -0
- package/dist/renderer/ChartSeriesRenderer.d.ts +3 -2
- package/dist/renderer/NativeWebGLRenderer.d.ts +2 -1
- package/dist/renderer/SVGChartRenderer.d.ts +15 -0
- package/dist/renderer/SankeyRenderer.d.ts +1 -0
- package/dist/renderer/native/NativeWebGLRenderer.d.ts +5 -1
- package/dist/renderer/native/draw.d.ts +2 -47
- package/dist/renderer/native/drawCore.d.ts +27 -0
- package/dist/renderer/native/drawExtended.d.ts +29 -0
- package/dist/renderer/native/frameRenderExtended.d.ts +1 -0
- package/dist/renderer/native/frameRenderRegistry.d.ts +27 -0
- package/dist/renderer/native/programFactoryCore.d.ts +6 -0
- package/dist/renderer/native/programFactoryExtended.d.ts +4 -0
- package/dist/renderer/native/utils.d.ts +3 -29
- package/dist/renderer/native/utilsCore.d.ts +14 -0
- package/dist/renderer/native/utilsExtended.d.ts +17 -0
- package/dist/renderer/overlaySeriesExtended.d.ts +1 -0
- package/dist/renderer/registerExtendedSeries.d.ts +1 -0
- package/dist/renderer/registerSVG.d.ts +5 -0
- package/dist/renderer/registerWebGPU.d.ts +2 -0
- package/dist/renderer/sankeyLayout.d.ts +29 -0
- package/dist/renderer/seriesBufferExtended.d.ts +4 -0
- package/dist/scientific/index.d.ts +1 -5
- package/dist/scientific/registerScientific.d.ts +1 -0
- package/dist/scientific.js +41 -41
- package/dist/solid.js +56 -59
- package/dist/solid.js.map +1 -1
- package/dist/svelte.js +26 -29
- package/dist/svelte.js.map +1 -1
- package/dist/tickUtils-B_X-ha13.js +41 -0
- package/dist/tickUtils-B_X-ha13.js.map +1 -0
- package/dist/trading/index.d.ts +1 -4
- package/dist/trading/registerTrading.d.ts +3 -0
- package/dist/trading.js +42 -42
- package/dist/types.d.ts +5 -4
- package/dist/velo-plot.full.js +1951 -1275
- package/dist/velo-plot.full.js.map +1 -1
- package/dist/velo-plot.js +33 -28
- package/dist/velo-plot.js.map +1 -1
- package/dist/vue/VeloPlot.vue.d.ts +1 -1
- package/dist/vue/index.d.ts +33 -33
- package/dist/vue.js +17 -20
- package/dist/vue.js.map +1 -1
- package/package.json +14 -1
- package/dist/ChartCore-BpzRvN4Y.js +0 -8467
- package/dist/ChartCore-BpzRvN4Y.js.map +0 -1
- package/dist/createStackedChart-Dm-YqUT7.js +0 -756
- package/dist/createStackedChart-Dm-YqUT7.js.map +0 -1
- package/dist/gpuRenderer-BpaMYz-k.js +0 -1848
- package/dist/gpuRenderer-BpaMYz-k.js.map +0 -1
- package/dist/index-BMiZoKmm.js.map +0 -1
- package/dist/index-qunX30Xu.js.map +0 -1
- package/dist/index-x4stH3jD.js +0 -282
- package/dist/index-x4stH3jD.js.map +0 -1
- package/dist/index.core-BmZe2jRQ.js.map +0 -1
- package/dist/mockDatafeed-DHIDPcpX.js +0 -515
- package/dist/mockDatafeed-DHIDPcpX.js.map +0 -1
- package/dist/symbols-DT0eLlpW.js +0 -568
- package/dist/symbols-DT0eLlpW.js.map +0 -1
package/dist/velo-plot.full.js
CHANGED
|
@@ -1,61 +1,709 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { P as Jn,
|
|
12
|
-
import { P as
|
|
13
|
-
import { W as
|
|
14
|
-
import { PluginAnalysis as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { C as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { a as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
var Oe = Object.defineProperty;
|
|
2
|
+
var Ve = (t, e, r) => e in t ? Oe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var B = (t, e, r) => Ve(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { c as $e } from "./index-Bj-xyXY6.js";
|
|
5
|
+
import { P as en, a as tn, b as rn, d as nn } from "./index-Bj-xyXY6.js";
|
|
6
|
+
import { a as se, c as le } from "./axisFormat-Sz4WIJfQ.js";
|
|
7
|
+
import { E as on, b as sn, f as ln, i as cn, m as un } from "./axisFormat-Sz4WIJfQ.js";
|
|
8
|
+
import { h as j, i as He, j as ze, k as Ne, l as Ue, a as qe, n as Ke, o as je, p as Je } from "./createStackedChart-DjA3aJAu.js";
|
|
9
|
+
import { q as fn, S as hn, b as gn, u as pn, f as mn, g as yn, v as vn, t as bn, c as xn, d as Pn, w as wn, e as An, m as Sn, r as Tn, s as Cn } from "./createStackedChart-DjA3aJAu.js";
|
|
10
|
+
import { r as W, i as Ae, j as Qe, k as Ze, l as et, m as tt, n as rt, o as nt, q as N, p as U, s as ce, t as at, H as ot, u as it, C as $, N as Se, v as st, w as lt, x as ct, D as ue, L as K, y as de, O as ut } from "./ChartCore-KYG2HTcK.js";
|
|
11
|
+
import { A as Fn, I as Dn, B as En, T as Rn, e as In, E as Ln, d as kn, a as Bn, M as _n, P as Yn, V as Xn, S as Wn, a1 as Gn, Y as On, c as Vn, h as $n, b as Hn, f as zn, X as Nn, Z as Un, z as qn, W as Kn, J as jn, G as Jn, g as Qn, F as Zn, U as ea, K as ta, R as ra, _ as na, $ as aa, a0 as oa, Q as ia } from "./ChartCore-KYG2HTcK.js";
|
|
12
|
+
import { P as la, c as ca, a as ua, d as da, g as fa, e as ha, l as ga, m as pa, o as ma, b as ya, s as va, u as ba } from "./index-0InEyj0q.js";
|
|
13
|
+
import { W as Pa, n as wa } from "./pool-DZ8shSqv.js";
|
|
14
|
+
import { PluginAnalysis as Sa, analyzeComplexSpectrum as Ta, analyzeSpectrum as Ca, arraysToComplex as Ma, autoCorrelation as Fa, bandPassFilter as Da, bandStopFilter as Ea, blackmanWindow as Ra, butterworth as Ia, complexToArrays as La, crossCorrelation as ka, detectAnomalies as Ba, dominantFrequency as _a, exponentialMovingAverage as Ya, fft as Xa, fftFromComplexInput as Wa, gaussianSmooth as Ga, generateContours as Oa, getPositiveFrequencies as Va, hammingWindow as $a, hanningWindow as Ha, highPassFilter as za, ifft as Na, ifftComplex as Ua, ifftFromArrays as qa, joinSegments as Ka, lowPassFilter as ja, medianFilter as Ja, nextPowerOf2 as Qa, powerSpectrum as Za, savitzkyGolay as eo, simpsonsIntegration as to, singleFrequencyFilter as ro, tTest as no, trapezoidalIntegration as ao } from "./plugins/analysis.js";
|
|
15
|
+
import { SciChart as io, SciPlot as so, StackedPlot as lo, VeloPlot as co, useChartGroup as uo, useChartSync as fo, useIndicator as ho, useSciChart as go, useSciPlot as po, useStackedPlot as mo, useVeloPlot as yo } from "./react.js";
|
|
16
|
+
import { LOCALE_DE_DE as bo, LOCALE_EN_US as xo, LOCALE_ES_ES as Po, LOCALE_FR_FR as wo, LOCALE_JA_JP as Ao, LOCALE_PT_BR as So, LOCALE_ZH_CN as To, PluginI18n as Co, createLocaleFormatter as Mo, getGlobalLocale as Fo, getLocale as Do, registerLocale as Eo, setGlobalLocale as Ro } from "./plugins/i18n.js";
|
|
17
|
+
import { D as Lo, K as ko, c as Bo, p as _o } from "./index-CWxIHdwX.js";
|
|
18
|
+
import { ClipboardManager as Xo, PluginClipboard as Wo, copyToClipboard as Go, formatData as Oo, getClipboardManager as Vo } from "./plugins/clipboard.js";
|
|
19
|
+
import { DebugOverlay as Ho, PluginDebug as zo, createDebugOverlay as No, enableDebugMode as Uo } from "./plugins/debug.js";
|
|
20
|
+
import { L as Ko, P as jo, c as Jo, s as Qo, a as Zo } from "./index-qhscKTDy.js";
|
|
21
|
+
import { C as ti, c as ri, a as ni, l as ai } from "./index-CaXWSOTk.js";
|
|
22
|
+
import { P as ii, b as si, T as li, c as ci, a as ui, g as di } from "./index-Dag88bW4.js";
|
|
23
|
+
import { B as hi, C as gi, P as pi, a as mi, e as yi, g as vi, b as bi, d as xi, f as Pi, c as wi } from "./index-BgrvqltV.js";
|
|
24
|
+
import { AnnotationManager as Si, PluginAnnotations as Ti } from "./plugins/annotations.js";
|
|
25
|
+
import { d as G } from "./PluginRegistry-CDf_jcnp.js";
|
|
26
|
+
import { e as Mi, c as Fi, a as Di, g as Ei, b as Ri, l as Ii, r as Li, v as ki } from "./PluginRegistry-CDf_jcnp.js";
|
|
27
|
+
import { P as _i, a as Yi, T as Xi, g as Wi } from "./index-B7PTX94B.js";
|
|
28
|
+
import { h as Oi, d as Vi, e as $i, i as Hi, b as zi, a as Ni, f as Ui, c as qi, g as Ki, m as ji, s as Ji, v as Qi } from "./utils-Dx0h0bgQ.js";
|
|
29
|
+
import { a as es, c as ts, d as rs, i as ns, s as as } from "./math-Ddm2EZjj.js";
|
|
30
|
+
import { BaseBufferStore as is, BaseTextureStore as ss, GpuBenchmark as ls, GpuCompute as cs, GpuRenderer as us, PipelineCache as ds, PluginGpu as fs, SeriesAdapter as hs, WebGLBackend as gs, WebGPUBackend as ps, createGpuRenderer as ms, parseColorToRGBA as ys } from "./plugins/gpu.js";
|
|
31
|
+
import { i as bs, j as xs, g as Ps, f as ws, k as As, d as Ss, e as Ts, m as Cs, c as Ms, n as Fs, o as Ds, p as Es, b as Rs, r as Is, s as Ls, h as ks, a as Bs, t as _s, v as Ys, w as Xs } from "./indicators--eJGmVox.js";
|
|
32
|
+
import { Plugin3D as Gs } from "./plugins/3d.js";
|
|
33
|
+
import { PluginKeyboard as Vs } from "./plugins/keyboard.js";
|
|
34
|
+
import { PluginSync as Hs } from "./plugins/sync.js";
|
|
35
|
+
import { PluginDataExport as Ns } from "./plugins/data-export.js";
|
|
36
|
+
import { PluginContextMenu as qs } from "./plugins/context-menu.js";
|
|
37
|
+
import { PluginAnomalyDetection as js } from "./plugins/anomaly-detection.js";
|
|
38
|
+
import { PluginMLIntegration as Qs } from "./plugins/ml-integration.js";
|
|
39
|
+
import { PluginPatternRecognition as el } from "./plugins/pattern-recognition.js";
|
|
40
|
+
import { PluginRegression as rl } from "./plugins/regression.js";
|
|
41
|
+
import { PluginRadar as al } from "./plugins/radar.js";
|
|
42
|
+
import { PluginSnapshot as il } from "./plugins/snapshot.js";
|
|
43
|
+
import { PluginDataTransform as ll } from "./plugins/data-transform.js";
|
|
44
|
+
import { PluginLaTeX as ul } from "./plugins/latex.js";
|
|
45
|
+
import { PluginCaching as fl } from "./plugins/caching.js";
|
|
46
|
+
import { PluginLazyLoad as gl } from "./plugins/lazy-load.js";
|
|
47
|
+
import { PluginBrokenAxis as ml } from "./plugins/broken-axis.js";
|
|
48
|
+
import { PluginVideoRecorder as vl } from "./plugins/video-recorder.js";
|
|
49
|
+
import { PluginOffscreen as xl } from "./plugins/offscreen.js";
|
|
50
|
+
import { PluginROI as wl } from "./plugins/roi.js";
|
|
51
|
+
import { PluginForecasting as Sl } from "./plugins/forecasting.js";
|
|
52
|
+
function dt(t, e, r, n, a, o, i) {
|
|
53
|
+
const s = t.length, l = i / 2, c = new Float32Array(s * 20), u = new Float32Array(s * 12);
|
|
54
|
+
let h = 0, v = 0;
|
|
55
|
+
for (let d = 0; d < s; d++) {
|
|
56
|
+
const p = t[d], x = e[d], b = r[d], m = n[d], y = a[d], g = o[d];
|
|
57
|
+
c[h++] = p, c[h++] = x, c[h++] = p, c[h++] = b, c[h++] = p, c[h++] = y, c[h++] = p, c[h++] = g, c[h++] = p - l, c[h++] = m, c[h++] = p + l, c[h++] = m, c[h++] = p - l, c[h++] = b, c[h++] = p + l, c[h++] = b, c[h++] = p - l, c[h++] = y, c[h++] = p + l, c[h++] = y, u[v++] = p - l, u[v++] = b, u[v++] = p + l, u[v++] = b, u[v++] = p + l, u[v++] = y, u[v++] = p - l, u[v++] = b, u[v++] = p + l, u[v++] = y, u[v++] = p - l, u[v++] = y;
|
|
58
|
+
}
|
|
59
|
+
return { lines: c, boxes: u };
|
|
60
|
+
}
|
|
61
|
+
function ft(t, e, r, n) {
|
|
62
|
+
const a = t.length, o = r / 2, i = new Float32Array(a * 12), s = new Float32Array(a * 12), l = new Float32Array(a * 12), c = new Float32Array((a - 1) * 4);
|
|
63
|
+
let u = 0, h = 0, v = 0, d = 0, p = 0;
|
|
64
|
+
for (let x = 0; x < a; x++) {
|
|
65
|
+
const b = t[x], m = e[x], y = (n == null ? void 0 : n[x]) ?? !1;
|
|
66
|
+
let g, f;
|
|
67
|
+
if (y ? (g = 0, f = p, l[v++] = b - o, l[v++] = g, l[v++] = b + o, l[v++] = g, l[v++] = b + o, l[v++] = f, l[v++] = b - o, l[v++] = g, l[v++] = b + o, l[v++] = f, l[v++] = b - o, l[v++] = f) : (g = p, f = p + m, p = f, m >= 0 ? (i[u++] = b - o, i[u++] = g, i[u++] = b + o, i[u++] = g, i[u++] = b + o, i[u++] = f, i[u++] = b - o, i[u++] = g, i[u++] = b + o, i[u++] = f, i[u++] = b - o, i[u++] = f) : (s[h++] = b - o, s[h++] = f, s[h++] = b + o, s[h++] = f, s[h++] = b + o, s[h++] = g, s[h++] = b - o, s[h++] = f, s[h++] = b + o, s[h++] = g, s[h++] = b - o, s[h++] = g)), x < a - 1) {
|
|
68
|
+
const A = t[x + 1];
|
|
69
|
+
c[d++] = b + o, c[d++] = f, c[d++] = A - o, c[d++] = f;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
positiveData: i.subarray(0, u),
|
|
74
|
+
negativeData: s.subarray(0, h),
|
|
75
|
+
subtotalData: l.subarray(0, v),
|
|
76
|
+
connectorData: c.subarray(0, d),
|
|
77
|
+
positiveCount: u / 2,
|
|
78
|
+
negativeCount: h / 2,
|
|
79
|
+
subtotalCount: v / 2
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function ht(t, e, r) {
|
|
83
|
+
const n = t.length, a = e.length;
|
|
84
|
+
n * a > r.length && console.warn("[Heatmap] Z array is too small for the specified grid dimensions");
|
|
85
|
+
const o = (n - 1) * (a - 1), i = new Float32Array(o * 6 * 3);
|
|
86
|
+
let s = 0;
|
|
87
|
+
for (let l = 0; l < a - 1; l++)
|
|
88
|
+
for (let c = 0; c < n - 1; c++) {
|
|
89
|
+
const u = t[c], h = t[c + 1], v = e[l], d = e[l + 1], p = r[l * n + c], x = r[l * n + (c + 1)], b = r[(l + 1) * n + c], m = r[(l + 1) * n + (c + 1)];
|
|
90
|
+
i[s++] = u, i[s++] = v, i[s++] = p, i[s++] = h, i[s++] = v, i[s++] = x, i[s++] = u, i[s++] = d, i[s++] = b, i[s++] = u, i[s++] = d, i[s++] = b, i[s++] = h, i[s++] = v, i[s++] = x, i[s++] = h, i[s++] = d, i[s++] = m;
|
|
91
|
+
}
|
|
92
|
+
return i;
|
|
93
|
+
}
|
|
94
|
+
function gt(t = "viridis") {
|
|
95
|
+
const r = new Uint8Array(1024);
|
|
96
|
+
for (let n = 0; n < 256; n++) {
|
|
97
|
+
const a = n / 255;
|
|
98
|
+
let o, i, s;
|
|
99
|
+
t === "jet" ? (o = Math.min(Math.max(1.5 - Math.abs(a * 4 - 3), 0), 1), i = Math.min(Math.max(1.5 - Math.abs(a * 4 - 2), 0), 1), s = Math.min(Math.max(1.5 - Math.abs(a * 4 - 1), 0), 1)) : t === "grayscale" ? o = i = s = a : t === "plasma" ? (o = 0.5 + 0.5 * Math.sin(Math.PI * (a - 0.5)), i = 0.5 + 0.5 * Math.sin(Math.PI * a), s = 0.8) : (o = 0.267 * (1 - a) + 0.993 * a, i = 5e-3 * (1 - a) + 0.906 * a, s = 0.337 * (1 - a) + 0.144 * a), r[n * 4 + 0] = o * 255, r[n * 4 + 1] = i * 255, r[n * 4 + 2] = s * 255, r[n * 4 + 3] = 255;
|
|
100
|
+
}
|
|
101
|
+
return r;
|
|
102
|
+
}
|
|
103
|
+
function pt(t, e, r, n, a, o, i = !1) {
|
|
104
|
+
const s = t.length, l = [], c = [], u = o / 2, v = o / 10 / 2;
|
|
105
|
+
for (let d = 0; d < s; d++) {
|
|
106
|
+
if (!Number.isFinite(t[d])) continue;
|
|
107
|
+
const p = a[d] >= e[d], x = p ? l : c, b = Math.max(e[d], a[d]), m = Math.min(e[d], a[d]);
|
|
108
|
+
i && p || fe(x, t[d] - u, m, t[d] + u, b), fe(x, t[d] - v, n[d], t[d] + v, r[d]);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
bullish: new Float32Array(l),
|
|
112
|
+
bearish: new Float32Array(c)
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function fe(t, e, r, n, a) {
|
|
116
|
+
t.push(e, r, n, r, e, a), t.push(n, r, n, a, e, a);
|
|
117
|
+
}
|
|
118
|
+
function te(t, e) {
|
|
119
|
+
const r = e.getData(), n = e.getId(), a = e.getType();
|
|
120
|
+
if (e.hasErrorData()) {
|
|
121
|
+
const o = tt(
|
|
122
|
+
r.x,
|
|
123
|
+
r.y,
|
|
124
|
+
{
|
|
125
|
+
yError: r.yError,
|
|
126
|
+
yErrorMinus: r.yErrorMinus,
|
|
127
|
+
yErrorPlus: r.yErrorPlus
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
xError: r.xError,
|
|
131
|
+
xErrorMinus: r.xErrorMinus,
|
|
132
|
+
xErrorPlus: r.xErrorPlus
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
t.renderer.createBuffer(`${n}_errors`, o);
|
|
136
|
+
}
|
|
137
|
+
if (a === "step" || a === "step+scatter") {
|
|
138
|
+
const o = e.getStyle().stepMode ?? "after";
|
|
139
|
+
t.renderer.createBuffer(
|
|
140
|
+
`${n}_step`,
|
|
141
|
+
rt(r.x, r.y, o)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function mt(t, e) {
|
|
146
|
+
const r = e.getData(), n = e.getStyle().barWidth ?? j(r.x);
|
|
147
|
+
t.renderer.createBuffer(
|
|
148
|
+
e.getId(),
|
|
149
|
+
He(r.x, r.y, n)
|
|
150
|
+
), te(t, e), e.resetLastAppendCount();
|
|
151
|
+
}
|
|
152
|
+
function yt(t, e) {
|
|
153
|
+
var o, i, s, l;
|
|
154
|
+
const r = e.getHeatmapData(), n = e.getHeatmapStyle();
|
|
155
|
+
if (!r || r.xValues.length < 2) return;
|
|
156
|
+
if (typeof ((o = t.renderer) == null ? void 0 : o.createColormapTexture) != "function") {
|
|
157
|
+
e.resetLastAppendCount();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
(s = (i = t.renderer).installHeatmapProgram) == null || s.call(i), t.renderer.createBuffer(
|
|
161
|
+
e.getId(),
|
|
162
|
+
ht(r.xValues, r.yValues, r.zValues)
|
|
163
|
+
);
|
|
164
|
+
const a = ((l = n == null ? void 0 : n.colorScale) == null ? void 0 : l.name) || "viridis";
|
|
165
|
+
t.renderer.createColormapTexture(
|
|
166
|
+
`${e.getId()}_colormap`,
|
|
167
|
+
gt(a)
|
|
168
|
+
), e.resetLastAppendCount();
|
|
169
|
+
}
|
|
170
|
+
function vt(t, e) {
|
|
171
|
+
const r = e.getData(), n = e.getId();
|
|
172
|
+
if (r.open && r.high && r.low && r.close) {
|
|
173
|
+
const a = e.getStyle().barWidth ?? j(r.x), o = !!e.getStyle().hollow, { bullish: i, bearish: s } = pt(
|
|
174
|
+
r.x,
|
|
175
|
+
r.open,
|
|
176
|
+
r.high,
|
|
177
|
+
r.low,
|
|
178
|
+
r.close,
|
|
179
|
+
a,
|
|
180
|
+
o
|
|
181
|
+
);
|
|
182
|
+
t.renderer.createBuffer(`${n}_bullish`, i), t.renderer.createBuffer(`${n}_bearish`, s), e.bullishCount = i.length / 2, e.bearishCount = s.length / 2;
|
|
183
|
+
}
|
|
184
|
+
e.resetLastAppendCount();
|
|
185
|
+
}
|
|
186
|
+
function bt(t, e) {
|
|
187
|
+
const r = e.getData(), n = e.getId();
|
|
188
|
+
if (r.low && r.open && r.median && r.close && r.high) {
|
|
189
|
+
const a = e.getStyle().barWidth ?? j(r.x), { lines: o, boxes: i } = dt(
|
|
190
|
+
r.x,
|
|
191
|
+
r.low,
|
|
192
|
+
r.open,
|
|
193
|
+
r.median,
|
|
194
|
+
r.close,
|
|
195
|
+
r.high,
|
|
196
|
+
a
|
|
197
|
+
);
|
|
198
|
+
t.renderer.createBuffer(`${n}_box_lines`, o), t.renderer.createBuffer(`${n}_box_faces`, i);
|
|
199
|
+
}
|
|
200
|
+
e.resetLastAppendCount();
|
|
201
|
+
}
|
|
202
|
+
function xt(t, e) {
|
|
203
|
+
const r = e.getData(), n = e.getId(), a = e.getStyle().barWidth ?? j(r.x), o = e.getStyle().isSubtotal, i = ft(r.x, r.y, a, o);
|
|
204
|
+
t.renderer.createBuffer(`${n}_wf_positive`, i.positiveData), t.renderer.createBuffer(`${n}_wf_negative`, i.negativeData), t.renderer.createBuffer(`${n}_wf_subtotal`, i.subtotalData), t.renderer.createBuffer(`${n}_wf_connectors`, i.connectorData), e.waterfallCounts = {
|
|
205
|
+
positive: i.positiveCount,
|
|
206
|
+
negative: i.negativeCount,
|
|
207
|
+
subtotal: i.subtotalCount,
|
|
208
|
+
connectors: i.connectorData.length / 2
|
|
209
|
+
}, e.resetLastAppendCount();
|
|
210
|
+
}
|
|
211
|
+
function Pt(t, e) {
|
|
212
|
+
const r = e.getPolarData();
|
|
213
|
+
if (!r || r.r.length === 0) return;
|
|
214
|
+
const n = e.getStyle(), a = n.angleMode || "degrees", o = n.closePath !== !1;
|
|
215
|
+
if (n.fill || !1) {
|
|
216
|
+
const s = Qe(r, a, o);
|
|
217
|
+
t.renderer.createBuffer(e.getId(), s);
|
|
218
|
+
} else {
|
|
219
|
+
const s = Ze(r, a, o);
|
|
220
|
+
t.renderer.createBuffer(e.getId(), s);
|
|
221
|
+
}
|
|
222
|
+
e.resetLastAppendCount();
|
|
223
|
+
}
|
|
224
|
+
function he(t, e) {
|
|
225
|
+
const r = e.getData(), a = e.getType() === "area" ? new Float32Array(r.x.length).fill(0) : r.y2 || new Float32Array(r.x.length).fill(0);
|
|
226
|
+
t.renderer.createBuffer(e.getId(), et(r.x, r.y, a)), te(t, e), e.resetLastAppendCount();
|
|
227
|
+
}
|
|
228
|
+
function wt(t, e) {
|
|
229
|
+
const r = e.getData();
|
|
230
|
+
t.renderer.createBuffer(e.getId(), Ae(r.x, r.y)), te(t, e), e.resetLastAppendCount();
|
|
231
|
+
}
|
|
232
|
+
let ge = !1;
|
|
233
|
+
function At() {
|
|
234
|
+
if (!ge) {
|
|
235
|
+
ge = !0, W("bar", mt), W("heatmap", yt), W("candlestick", vt), W("boxplot", bt), W("waterfall", xt), W("polar", Pt), W("band", he), W("area", he), W("heikin-ashi", (t, e) => {
|
|
236
|
+
var n;
|
|
237
|
+
const r = e.getData();
|
|
238
|
+
(n = r == null ? void 0 : r.x) != null && n.length && (t.renderer.createBuffer(e.getId(), Ae(r.x, r.y)), e.resetLastAppendCount());
|
|
239
|
+
});
|
|
240
|
+
for (const t of [
|
|
241
|
+
"line",
|
|
242
|
+
"scatter",
|
|
243
|
+
"line+scatter",
|
|
244
|
+
"step",
|
|
245
|
+
"step+scatter"
|
|
246
|
+
])
|
|
247
|
+
W(t, wt);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function St(t, e, r, n, a, o = { min: 0, max: 1 }, i) {
|
|
251
|
+
t.useProgram(e.program), t.bindBuffer(t.ARRAY_BUFFER, r), t.enableVertexAttribArray(e.attributes.position), t.vertexAttribPointer(e.attributes.position, 2, t.FLOAT, !1, 12, 0), e.attributes.value !== void 0 && e.attributes.value !== -1 && (t.enableVertexAttribArray(e.attributes.value), t.vertexAttribPointer(e.attributes.value, 1, t.FLOAT, !1, 12, 8)), t.uniform2f(e.uniforms.uScale, a.scale[0], a.scale[1]), t.uniform2f(
|
|
252
|
+
e.uniforms.uTranslate,
|
|
253
|
+
a.translate[0],
|
|
254
|
+
a.translate[1]
|
|
255
|
+
), e.uniforms.uMinValue && t.uniform1f(e.uniforms.uMinValue, o.min), e.uniforms.uMaxValue && t.uniform1f(e.uniforms.uMaxValue, o.max), i && e.uniforms.uColormap ? (t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(e.uniforms.uColormap, 0)) : e.uniforms.uColormap && (t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, null)), t.drawArrays(t.TRIANGLES, 0, n), t.disableVertexAttribArray(e.attributes.position), e.attributes.value !== void 0 && e.attributes.value !== -1 && t.disableVertexAttribArray(e.attributes.value);
|
|
256
|
+
}
|
|
257
|
+
function Tt(t, e, r, n, a, o) {
|
|
258
|
+
t.useProgram(e.program), t.bindBuffer(t.ARRAY_BUFFER, r), t.enableVertexAttribArray(e.attributes.position), t.vertexAttribPointer(e.attributes.position, 2, t.FLOAT, !1, 0, 0), t.uniform2f(e.uniforms.uScale, a.scale[0], a.scale[1]), t.uniform2f(
|
|
259
|
+
e.uniforms.uTranslate,
|
|
260
|
+
a.translate[0],
|
|
261
|
+
a.translate[1]
|
|
262
|
+
), t.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), t.drawArrays(t.TRIANGLES, 0, n), t.disableVertexAttribArray(e.attributes.position);
|
|
263
|
+
}
|
|
264
|
+
function Ct(t, e, r, n, a) {
|
|
265
|
+
const o = nt(a);
|
|
266
|
+
t.useProgram(e.line.program), t.bindBuffer(t.ARRAY_BUFFER, r.boxBuffer), t.enableVertexAttribArray(e.line.attributes.position), t.vertexAttribPointer(e.line.attributes.position, 2, t.FLOAT, !1, 0, 0), t.uniform2f(e.line.uniforms.uScale, n.scale[0], n.scale[1]), t.uniform2f(
|
|
267
|
+
e.line.uniforms.uTranslate,
|
|
268
|
+
n.translate[0],
|
|
269
|
+
n.translate[1]
|
|
270
|
+
);
|
|
271
|
+
const i = [...o];
|
|
272
|
+
i[3] *= 0.5, t.uniform4f(e.line.uniforms.uColor, i[0], i[1], i[2], i[3]), t.drawArrays(t.TRIANGLES, 0, r.boxCount), t.uniform4f(e.line.uniforms.uColor, o[0], o[1], o[2], o[3]), t.lineWidth(a.width || 1), t.bindBuffer(t.ARRAY_BUFFER, r.linesBuffer), t.vertexAttribPointer(e.line.attributes.position, 2, t.FLOAT, !1, 0, 0), t.drawArrays(t.LINES, 0, r.linesCount), t.disableVertexAttribArray(e.line.attributes.position);
|
|
273
|
+
}
|
|
274
|
+
function Mt(t, e, r) {
|
|
275
|
+
St(
|
|
276
|
+
t.gl,
|
|
277
|
+
t.programs.heatmapProgram,
|
|
278
|
+
e.buffer,
|
|
279
|
+
e.count,
|
|
280
|
+
r,
|
|
281
|
+
e.zBounds,
|
|
282
|
+
e.colormapTexture
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
function Ft(t, e, r, n) {
|
|
286
|
+
Tt(
|
|
287
|
+
t.gl,
|
|
288
|
+
t.programs.lineProgram,
|
|
289
|
+
e.buffer,
|
|
290
|
+
e.count,
|
|
291
|
+
r,
|
|
292
|
+
n
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
function Dt(t, e, r) {
|
|
296
|
+
e.boxBuffer && e.boxLinesBuffer && Ct(
|
|
297
|
+
t.gl,
|
|
298
|
+
{ line: t.programs.lineProgram, point: t.programs.pointProgram },
|
|
299
|
+
{
|
|
300
|
+
boxBuffer: e.boxBuffer,
|
|
301
|
+
boxCount: e.boxCount || 0,
|
|
302
|
+
linesBuffer: e.boxLinesBuffer,
|
|
303
|
+
linesCount: e.boxLinesCount || 0
|
|
304
|
+
},
|
|
305
|
+
r,
|
|
306
|
+
e.style
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
function Et(t, e, r) {
|
|
310
|
+
const { gl: n, programs: a, dpr: o } = t, i = U(e.style.positiveColor || "#22c55e"), s = U(e.style.negativeColor || "#ef4444"), l = U(e.style.subtotalColor || "#3b82f6"), c = U(e.style.connectorColor || "#64748b");
|
|
311
|
+
e.wfPositiveBuffer && e.wfPositiveCount && e.wfPositiveCount > 0 && (n.useProgram(a.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfPositiveBuffer), n.enableVertexAttribArray(a.lineProgram.attributes.position), n.vertexAttribPointer(
|
|
312
|
+
a.lineProgram.attributes.position,
|
|
313
|
+
2,
|
|
314
|
+
n.FLOAT,
|
|
315
|
+
!1,
|
|
316
|
+
0,
|
|
317
|
+
0
|
|
318
|
+
), n.uniform2f(
|
|
319
|
+
a.lineProgram.uniforms.uScale,
|
|
320
|
+
r.scale[0],
|
|
321
|
+
r.scale[1]
|
|
322
|
+
), n.uniform2f(
|
|
323
|
+
a.lineProgram.uniforms.uTranslate,
|
|
324
|
+
r.translate[0],
|
|
325
|
+
r.translate[1]
|
|
326
|
+
), n.uniform4f(
|
|
327
|
+
a.lineProgram.uniforms.uColor,
|
|
328
|
+
i[0],
|
|
329
|
+
i[1],
|
|
330
|
+
i[2],
|
|
331
|
+
0.9
|
|
332
|
+
), n.drawArrays(n.TRIANGLES, 0, e.wfPositiveCount)), e.wfNegativeBuffer && e.wfNegativeCount && e.wfNegativeCount > 0 && (n.useProgram(a.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfNegativeBuffer), n.enableVertexAttribArray(a.lineProgram.attributes.position), n.vertexAttribPointer(
|
|
333
|
+
a.lineProgram.attributes.position,
|
|
334
|
+
2,
|
|
335
|
+
n.FLOAT,
|
|
336
|
+
!1,
|
|
337
|
+
0,
|
|
338
|
+
0
|
|
339
|
+
), n.uniform2f(
|
|
340
|
+
a.lineProgram.uniforms.uScale,
|
|
341
|
+
r.scale[0],
|
|
342
|
+
r.scale[1]
|
|
343
|
+
), n.uniform2f(
|
|
344
|
+
a.lineProgram.uniforms.uTranslate,
|
|
345
|
+
r.translate[0],
|
|
346
|
+
r.translate[1]
|
|
347
|
+
), n.uniform4f(
|
|
348
|
+
a.lineProgram.uniforms.uColor,
|
|
349
|
+
s[0],
|
|
350
|
+
s[1],
|
|
351
|
+
s[2],
|
|
352
|
+
0.9
|
|
353
|
+
), n.drawArrays(n.TRIANGLES, 0, e.wfNegativeCount)), e.wfSubtotalBuffer && e.wfSubtotalCount && e.wfSubtotalCount > 0 && (n.useProgram(a.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfSubtotalBuffer), n.enableVertexAttribArray(a.lineProgram.attributes.position), n.vertexAttribPointer(
|
|
354
|
+
a.lineProgram.attributes.position,
|
|
355
|
+
2,
|
|
356
|
+
n.FLOAT,
|
|
357
|
+
!1,
|
|
358
|
+
0,
|
|
359
|
+
0
|
|
360
|
+
), n.uniform2f(
|
|
361
|
+
a.lineProgram.uniforms.uScale,
|
|
362
|
+
r.scale[0],
|
|
363
|
+
r.scale[1]
|
|
364
|
+
), n.uniform2f(
|
|
365
|
+
a.lineProgram.uniforms.uTranslate,
|
|
366
|
+
r.translate[0],
|
|
367
|
+
r.translate[1]
|
|
368
|
+
), n.uniform4f(
|
|
369
|
+
a.lineProgram.uniforms.uColor,
|
|
370
|
+
l[0],
|
|
371
|
+
l[1],
|
|
372
|
+
l[2],
|
|
373
|
+
0.9
|
|
374
|
+
), n.drawArrays(n.TRIANGLES, 0, e.wfSubtotalCount)), e.style.showConnectors !== !1 && e.wfConnectorBuffer && e.wfConnectorCount && e.wfConnectorCount > 0 && (n.useProgram(a.lineProgram.program), n.bindBuffer(n.ARRAY_BUFFER, e.wfConnectorBuffer), n.enableVertexAttribArray(a.lineProgram.attributes.position), n.vertexAttribPointer(
|
|
375
|
+
a.lineProgram.attributes.position,
|
|
376
|
+
2,
|
|
377
|
+
n.FLOAT,
|
|
378
|
+
!1,
|
|
379
|
+
0,
|
|
380
|
+
0
|
|
381
|
+
), n.uniform2f(
|
|
382
|
+
a.lineProgram.uniforms.uScale,
|
|
383
|
+
r.scale[0],
|
|
384
|
+
r.scale[1]
|
|
385
|
+
), n.uniform2f(
|
|
386
|
+
a.lineProgram.uniforms.uTranslate,
|
|
387
|
+
r.translate[0],
|
|
388
|
+
r.translate[1]
|
|
389
|
+
), n.uniform4f(
|
|
390
|
+
a.lineProgram.uniforms.uColor,
|
|
391
|
+
c[0],
|
|
392
|
+
c[1],
|
|
393
|
+
c[2],
|
|
394
|
+
0.6
|
|
395
|
+
), n.lineWidth(1), n.drawArrays(n.LINES, 0, e.wfConnectorCount)), n.disableVertexAttribArray(a.lineProgram.attributes.position);
|
|
396
|
+
}
|
|
397
|
+
let pe = !1;
|
|
398
|
+
function Rt() {
|
|
399
|
+
pe || (pe = !0, N(
|
|
400
|
+
"heatmap",
|
|
401
|
+
(t, e, r) => Mt(t, e, r)
|
|
402
|
+
), N(
|
|
403
|
+
"bar",
|
|
404
|
+
(t, e, r, n) => Ft(t, e, r, n)
|
|
405
|
+
), N(
|
|
406
|
+
"boxplot",
|
|
407
|
+
(t, e, r) => Dt(t, e, r)
|
|
408
|
+
), N(
|
|
409
|
+
"waterfall",
|
|
410
|
+
(t, e, r) => Et(t, e, r)
|
|
411
|
+
));
|
|
412
|
+
}
|
|
413
|
+
function It(t, e, r, n) {
|
|
414
|
+
const { value: a, min: o, max: i } = e, {
|
|
415
|
+
needleColor: s = "#333",
|
|
416
|
+
needleWidth: l = 3,
|
|
417
|
+
ranges: c = [],
|
|
418
|
+
radius: u = 0.8,
|
|
419
|
+
startAngle: h = 135,
|
|
420
|
+
endAngle: v = 405,
|
|
421
|
+
showValue: d = !0,
|
|
422
|
+
valueColor: p = "#fff",
|
|
423
|
+
valueSize: x = 24,
|
|
424
|
+
label: b
|
|
425
|
+
} = r, m = n.x + n.width / 2, y = n.y + n.height / 2, g = Math.min(n.width, n.height) / 2 * u, f = v - h, A = Math.max(0, Math.min(1, (a - o) / (i - o))), w = (h + A * f) * (Math.PI / 180);
|
|
426
|
+
t.save(), t.beginPath(), t.arc(m, y, g, h * (Math.PI / 180), v * (Math.PI / 180)), t.strokeStyle = "rgba(255, 255, 255, 0.1)", t.lineWidth = g * 0.2, t.lineCap = "round", t.stroke();
|
|
427
|
+
for (const S of c) {
|
|
428
|
+
const D = Math.max(0, Math.min(1, (S.from - o) / (i - o))), T = Math.max(0, Math.min(1, (S.to - o) / (i - o)));
|
|
429
|
+
t.beginPath(), t.arc(
|
|
430
|
+
m,
|
|
431
|
+
y,
|
|
432
|
+
g,
|
|
433
|
+
(h + D * f) * (Math.PI / 180),
|
|
434
|
+
(h + T * f) * (Math.PI / 180)
|
|
435
|
+
), t.strokeStyle = S.color, t.lineWidth = g * 0.2, t.stroke();
|
|
436
|
+
}
|
|
437
|
+
const F = 11;
|
|
438
|
+
for (let S = 0; S < F; S++) {
|
|
439
|
+
const D = (h + S / (F - 1) * f) * (Math.PI / 180), T = g * 0.85, I = g * 0.95;
|
|
440
|
+
t.beginPath(), t.moveTo(m + T * Math.cos(D), y + T * Math.sin(D)), t.lineTo(m + I * Math.cos(D), y + I * Math.sin(D)), t.strokeStyle = "rgba(255, 255, 255, 0.5)", t.lineWidth = 2, t.stroke();
|
|
441
|
+
}
|
|
442
|
+
t.beginPath(), t.moveTo(m, y), t.lineTo(m + g * 0.9 * Math.cos(w), y + g * 0.9 * Math.sin(w)), t.strokeStyle = s, t.lineWidth = l, t.lineCap = "round", t.shadowColor = s, t.shadowBlur = 10, t.stroke(), t.shadowBlur = 0, t.beginPath(), t.arc(m, y, 8, 0, Math.PI * 2), t.fillStyle = s, t.fill(), t.strokeStyle = "#fff", t.lineWidth = 2, t.stroke(), d && (t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${x}px Inter, sans-serif`, t.fillStyle = p, t.fillText(a.toFixed(1), m, y + g * 0.4), b && (t.font = `${x * 0.5}px Inter, sans-serif`, t.fillStyle = "rgba(255, 255, 255, 0.6)", t.fillText(b, m, y + g * 0.6))), t.restore();
|
|
443
|
+
}
|
|
444
|
+
function Lt(t, e, r, n) {
|
|
445
|
+
const a = ze(e, r, n);
|
|
446
|
+
if (!a) return;
|
|
447
|
+
const { nodeRegistry: o, links: i, nodeOutValue: s, nodeInValue: l, workingArea: c } = a, { linkOpacity: u, showLabels: h, nodeWidth: v } = a.style;
|
|
448
|
+
t.save(), i.forEach((d) => {
|
|
449
|
+
const p = d.source, x = d.target, b = d.sourceOffset, m = d.targetOffset, y = s.get(d.link.source) || 1, g = l.get(d.link.target) || 1, f = d.link.value / y * p.height, A = d.link.value / g * x.height, w = p.x + p.width, F = p.y + b, S = F + f, D = x.x, T = x.y + m, I = T + A, P = (D - w) * 0.5, C = t.createLinearGradient(w, (F + S) / 2, D, (T + I) / 2);
|
|
450
|
+
C.addColorStop(0, p.color), C.addColorStop(1, x.color), t.beginPath(), t.moveTo(w, F), t.bezierCurveTo(w + P, F, D - P, T, D, T), t.lineTo(D, I), t.bezierCurveTo(D - P, I, w + P, S, w, S), t.closePath(), t.fillStyle = C, t.globalAlpha = u, t.fill(), t.strokeStyle = p.color, t.globalAlpha = u * 0.3, t.lineWidth = 0.5, t.stroke();
|
|
451
|
+
}), t.restore(), t.save(), t.globalAlpha = 1, o.forEach((d) => {
|
|
452
|
+
t.fillStyle = d.color, t.fillRect(d.x, d.y, d.width, d.height);
|
|
453
|
+
const p = t.createLinearGradient(d.x, d.y, d.x + d.width, d.y);
|
|
454
|
+
p.addColorStop(0, "rgba(255, 255, 255, 0.15)"), p.addColorStop(1, "rgba(0, 0, 0, 0.15)"), t.fillStyle = p, t.fillRect(d.x, d.y, d.width, d.height);
|
|
455
|
+
}), t.restore(), h && (t.save(), t.font = "bold 11px Inter, -apple-system, sans-serif", t.textBaseline = "middle", o.forEach((d, p) => {
|
|
456
|
+
let x = String(p);
|
|
457
|
+
const b = e.nodes.find((g) => g.id === p);
|
|
458
|
+
b != null && b.name && (x = b.name);
|
|
459
|
+
const m = d.x <= c.x + 5, y = d.x >= c.x + c.width - v - 5;
|
|
460
|
+
t.shadowBlur = 3, t.shadowColor = "rgba(0, 0, 0, 0.7)", t.fillStyle = "#ffffff", m ? (t.textAlign = "right", t.fillText(x, d.x - 10, d.y + d.height / 2)) : y ? (t.textAlign = "left", t.fillText(x, d.x + d.width + 10, d.y + d.height / 2)) : (t.textAlign = "center", t.fillText(x, d.x + d.width / 2, d.y - 10));
|
|
461
|
+
}), t.restore());
|
|
462
|
+
}
|
|
463
|
+
let me = !1;
|
|
464
|
+
function kt() {
|
|
465
|
+
me || (me = !0, ce("gauge", (t, e, r) => {
|
|
466
|
+
const n = e.getGaugeData(), a = e.getGaugeStyle();
|
|
467
|
+
n && a && It(t, n, a, r);
|
|
468
|
+
}), ce("sankey", (t, e, r) => {
|
|
469
|
+
const n = e.getSankeyData(), a = e.getSankeyStyle();
|
|
470
|
+
n && a && Lt(t, n, a, r);
|
|
471
|
+
}));
|
|
472
|
+
}
|
|
473
|
+
function Bt(t, e) {
|
|
474
|
+
e.heatmapProgram = at(t, it, ot, "heatmap");
|
|
475
|
+
}
|
|
476
|
+
let ye = !1;
|
|
477
|
+
function _t() {
|
|
478
|
+
ye || (ye = !0, $.afterConstruct = (t, e) => {
|
|
479
|
+
e.renderer === "webgpu" && (t._webgpuInitPromise = Yt(t));
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
async function Yt(t) {
|
|
483
|
+
var a, o;
|
|
484
|
+
const e = t, { createGpuChartRenderer: r } = await import("./GpuChartRenderer-Dxc0hrQA.js"), n = await r(e.webglCanvas, {
|
|
485
|
+
backend: "webgpu",
|
|
486
|
+
powerPreference: "high-performance"
|
|
487
|
+
});
|
|
488
|
+
if (n) {
|
|
489
|
+
e.renderer = n, e.activeRendererType = n.backend, e.renderer.setDPR(e.dpr), (a = e.renderLoop) == null || a.setRenderer(e.renderer);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
console.warn(
|
|
493
|
+
"[VeloPlot] WebGPU unavailable — falling back to WebGL2. See docs/adr/001-webgpu-renderer-strategy.md."
|
|
494
|
+
), e.renderer = new Se(e.webglCanvas), e.activeRendererType = "webgl", e.renderer.setDPR(e.dpr), (o = e.renderLoop) == null || o.setRenderer(e.renderer);
|
|
495
|
+
}
|
|
496
|
+
let ve = !1;
|
|
497
|
+
function Xt() {
|
|
498
|
+
ve || (ve = !0, Se.heatmapProgramInstaller = Bt, _t(), At(), Rt(), kt());
|
|
499
|
+
}
|
|
500
|
+
function Wt(t, e) {
|
|
501
|
+
return Ne(Ue(t, e));
|
|
502
|
+
}
|
|
503
|
+
let be = !1;
|
|
504
|
+
function Gt() {
|
|
505
|
+
if (be) return;
|
|
506
|
+
be = !0;
|
|
507
|
+
const t = $.afterConstruct;
|
|
508
|
+
$.afterConstruct = (e, r) => {
|
|
509
|
+
t == null || t(e, r), r.renderer === "svg" && Ot(e);
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
function Ot(t) {
|
|
513
|
+
const e = t;
|
|
514
|
+
e.svgRoot && (e.webglCanvas.style.display = "none", e.overlayCanvas && (e.overlayCanvas.style.display = "block", e.overlayCanvas.style.pointerEvents = "none", e.overlayCanvas.style.zIndex = "2"), e.svgRoot.style.display = "block", e.svgRoot.style.zIndex = "1");
|
|
515
|
+
}
|
|
516
|
+
let xe = !1;
|
|
517
|
+
function Vt() {
|
|
518
|
+
xe || (xe = !0, Gt(), $.prototype.exportSVG = function(t) {
|
|
519
|
+
return Wt(this, t);
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
class $t {
|
|
523
|
+
constructor(e, r) {
|
|
524
|
+
B(this, "alerts", /* @__PURE__ */ new Map());
|
|
525
|
+
B(this, "idCounter", 0);
|
|
526
|
+
this.events = e, this.getSeries = r;
|
|
527
|
+
}
|
|
528
|
+
addAlert(e) {
|
|
529
|
+
const r = e.id ?? `alert_${++this.idCounter}`;
|
|
530
|
+
return this.alerts.set(r, { ...e, id: r }), r;
|
|
531
|
+
}
|
|
532
|
+
removeAlert(e) {
|
|
533
|
+
return this.alerts.delete(e);
|
|
534
|
+
}
|
|
535
|
+
clearAlerts() {
|
|
536
|
+
this.alerts.clear();
|
|
537
|
+
}
|
|
538
|
+
getAlerts() {
|
|
539
|
+
return Array.from(this.alerts.values());
|
|
540
|
+
}
|
|
541
|
+
/** Call after data updates / render tick. */
|
|
542
|
+
evaluate() {
|
|
543
|
+
for (const [e, r] of [...this.alerts.entries()]) {
|
|
544
|
+
const n = this.getSeries(r.seriesId);
|
|
545
|
+
if (!n) continue;
|
|
546
|
+
const a = n.getData(), o = a.close ?? a.y;
|
|
547
|
+
if (!(o != null && o.length)) continue;
|
|
548
|
+
const i = o[o.length - 1];
|
|
549
|
+
if (!Number.isFinite(i)) continue;
|
|
550
|
+
const s = o.length > 1 ? o[o.length - 2] : i;
|
|
551
|
+
let l = !1;
|
|
552
|
+
switch (r.direction) {
|
|
553
|
+
case "above":
|
|
554
|
+
l = i >= r.price;
|
|
555
|
+
break;
|
|
556
|
+
case "below":
|
|
557
|
+
l = i <= r.price;
|
|
558
|
+
break;
|
|
559
|
+
case "cross":
|
|
560
|
+
l = s < r.price && i >= r.price || s > r.price && i <= r.price;
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
if (!l) continue;
|
|
564
|
+
const c = {
|
|
565
|
+
id: e,
|
|
566
|
+
price: r.price,
|
|
567
|
+
direction: r.direction,
|
|
568
|
+
seriesId: r.seriesId ?? n.getId(),
|
|
569
|
+
triggeredAt: Date.now(),
|
|
570
|
+
triggerPrice: i
|
|
571
|
+
};
|
|
572
|
+
this.events.emit("alert", c), r.once !== !1 && this.alerts.delete(e);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
destroy() {
|
|
576
|
+
this.alerts.clear();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const Ht = {
|
|
580
|
+
entry: "#38bdf8",
|
|
581
|
+
sl: "#ef4444",
|
|
582
|
+
tp: "#22c55e"
|
|
583
|
+
}, zt = {
|
|
584
|
+
entry: "Entry",
|
|
585
|
+
sl: "SL",
|
|
586
|
+
tp: "TP"
|
|
587
|
+
};
|
|
588
|
+
function Nt(t, e) {
|
|
589
|
+
const r = t.style ?? "entry";
|
|
590
|
+
return {
|
|
591
|
+
id: e,
|
|
592
|
+
type: "horizontal-line",
|
|
593
|
+
y: t.price,
|
|
594
|
+
color: t.color ?? Ht[r],
|
|
595
|
+
label: t.label ?? zt[r],
|
|
596
|
+
labelPosition: "right",
|
|
597
|
+
lineDash: r === "sl" ? [6, 4] : r === "tp" ? [4, 4] : void 0,
|
|
598
|
+
interactive: t.interactive ?? !1
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
let Pe = !1;
|
|
602
|
+
function Ut() {
|
|
603
|
+
st((t, e) => {
|
|
604
|
+
var n, a;
|
|
605
|
+
if (e.type === "heatmap" || e.type === "indicator")
|
|
606
|
+
return e;
|
|
607
|
+
let r = { ...e };
|
|
608
|
+
if (r.type === "heikin-ashi") {
|
|
609
|
+
const o = r.data;
|
|
610
|
+
if (o != null && o.open && o.high && o.low && o.close) {
|
|
611
|
+
const i = $e({
|
|
612
|
+
open: o.open,
|
|
613
|
+
high: o.high,
|
|
614
|
+
low: o.low,
|
|
615
|
+
close: o.close
|
|
616
|
+
});
|
|
617
|
+
r = {
|
|
618
|
+
...r,
|
|
619
|
+
type: "candlestick",
|
|
620
|
+
data: { ...o, ...i }
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
if (se(t.xAxisOptions) && ((a = (n = r.data) == null ? void 0 : n.x) != null && a.length)) {
|
|
625
|
+
const { displayX: o, mapping: i } = le(
|
|
626
|
+
r.data.x,
|
|
627
|
+
t.xAxisOptions
|
|
628
|
+
);
|
|
629
|
+
t.setTimeScaleMapping(i), r = {
|
|
630
|
+
...r,
|
|
631
|
+
data: { ...r.data, x: o }
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
return r;
|
|
635
|
+
}), lt((t) => t.type === "indicator" ? Ke(t) : [t]), ct((t, e) => {
|
|
636
|
+
if (e.x && se(t.xAxisOptions)) {
|
|
637
|
+
const { displayX: r, mapping: n } = le(e.x, t.xAxisOptions);
|
|
638
|
+
return t.setTimeScaleMapping(n), { ...e, x: r };
|
|
639
|
+
}
|
|
640
|
+
return e;
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
function qt() {
|
|
644
|
+
const t = $.prototype;
|
|
645
|
+
if (t._tradingPatched) return;
|
|
646
|
+
t._tradingPatched = !0, t.addIndicator = async function(r, n) {
|
|
647
|
+
return qe(this, r, n);
|
|
648
|
+
}, t.addAlert = function(r) {
|
|
649
|
+
return q(this).addAlert(r);
|
|
650
|
+
}, t.removeAlert = function(r) {
|
|
651
|
+
return q(this).removeAlert(r);
|
|
652
|
+
}, t.clearAlerts = function() {
|
|
653
|
+
q(this).clearAlerts();
|
|
654
|
+
}, t.getAlerts = function() {
|
|
655
|
+
return q(this).getAlerts();
|
|
656
|
+
}, t.addPositionLine = function(r) {
|
|
657
|
+
const n = this;
|
|
658
|
+
n._positionLineCounter === void 0 && (n._positionLineCounter = 0);
|
|
659
|
+
const a = r.id ?? `position-${++n._positionLineCounter}`;
|
|
660
|
+
return n.addAnnotation(Nt(r, a)), a;
|
|
661
|
+
}, t.setDrawingMode = function(r) {
|
|
662
|
+
var a;
|
|
663
|
+
const n = this.getPlugin(
|
|
664
|
+
"velo-plot-drawing-tools"
|
|
665
|
+
);
|
|
666
|
+
(a = n == null ? void 0 : n.setMode) == null || a.call(n, r);
|
|
667
|
+
};
|
|
668
|
+
const e = t.destroy;
|
|
669
|
+
t.destroy = function() {
|
|
670
|
+
var n;
|
|
671
|
+
const r = this;
|
|
672
|
+
return (n = r._alertManager) == null || n.destroy(), r._alertManager = void 0, r.setFeatureHooks(null), e.call(this);
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
function q(t) {
|
|
676
|
+
const e = t;
|
|
677
|
+
return e._alertManager || (e._alertManager = new $t(t.events, (r) => {
|
|
678
|
+
const n = r ? t.series.get(r) : void 0;
|
|
679
|
+
return n || t.series.values().next().value;
|
|
680
|
+
}), t.setFeatureHooks({
|
|
681
|
+
onDataUpdate: () => {
|
|
682
|
+
var r;
|
|
683
|
+
return (r = e._alertManager) == null ? void 0 : r.evaluate();
|
|
684
|
+
},
|
|
685
|
+
getAlerts: () => {
|
|
686
|
+
var r;
|
|
687
|
+
return ((r = e._alertManager) == null ? void 0 : r.getAlerts()) ?? [];
|
|
688
|
+
},
|
|
689
|
+
destroy: () => {
|
|
690
|
+
var r;
|
|
691
|
+
return (r = e._alertManager) == null ? void 0 : r.destroy();
|
|
692
|
+
}
|
|
693
|
+
})), e._alertManager;
|
|
694
|
+
}
|
|
695
|
+
function Te() {
|
|
696
|
+
Pe || (Pe = !0, Xt(), Ut(), qt(), Vt());
|
|
697
|
+
}
|
|
698
|
+
Te();
|
|
699
|
+
class Ce {
|
|
700
|
+
constructor(e, r = {}) {
|
|
701
|
+
B(this, "available");
|
|
702
|
+
B(this, "canvas");
|
|
703
|
+
B(this, "adapter");
|
|
704
|
+
B(this, "device");
|
|
705
|
+
B(this, "context");
|
|
706
|
+
this.canvas = e, this.available = Ce.isSupported();
|
|
59
707
|
}
|
|
60
708
|
static isSupported() {
|
|
61
709
|
return typeof globalThis.navigator < "u" && typeof globalThis.navigator.gpu < "u";
|
|
@@ -63,20 +711,20 @@ class ae {
|
|
|
63
711
|
async init(e = {}) {
|
|
64
712
|
if (!this.available)
|
|
65
713
|
throw new Error("[VeloPlot] WebGPU is not supported in this environment");
|
|
66
|
-
const
|
|
67
|
-
if (this.adapter = await
|
|
714
|
+
const r = globalThis.navigator.gpu;
|
|
715
|
+
if (this.adapter = await r.requestAdapter({
|
|
68
716
|
powerPreference: e.powerPreference ?? "high-performance"
|
|
69
717
|
}), !this.adapter)
|
|
70
718
|
throw new Error("[VeloPlot] Failed to request WebGPU adapter");
|
|
71
719
|
this.device = await this.adapter.requestDevice();
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
720
|
+
const n = this.canvas.getContext("webgpu");
|
|
721
|
+
if (!n)
|
|
74
722
|
throw new Error("[VeloPlot] Failed to get WebGPU context");
|
|
75
|
-
this.context =
|
|
76
|
-
const
|
|
723
|
+
this.context = n;
|
|
724
|
+
const a = e.preferredFormat ?? (r.getPreferredCanvasFormat ? r.getPreferredCanvasFormat() : "bgra8unorm");
|
|
77
725
|
this.context.configure({
|
|
78
726
|
device: this.device,
|
|
79
|
-
format:
|
|
727
|
+
format: a,
|
|
80
728
|
alphaMode: "premultiplied"
|
|
81
729
|
});
|
|
82
730
|
}
|
|
@@ -84,128 +732,663 @@ class ae {
|
|
|
84
732
|
this.device = void 0, this.adapter = void 0, this.context = void 0;
|
|
85
733
|
}
|
|
86
734
|
}
|
|
87
|
-
const
|
|
735
|
+
const Kt = `
|
|
736
|
+
attribute vec2 aPosition;
|
|
737
|
+
uniform vec2 uResolution;
|
|
738
|
+
void main() {
|
|
739
|
+
vec2 clip = (aPosition / uResolution) * 2.0 - 1.0;
|
|
740
|
+
gl_Position = vec4(clip.x, -clip.y, 0.0, 1.0);
|
|
741
|
+
}
|
|
742
|
+
`, jt = `
|
|
743
|
+
precision mediump float;
|
|
744
|
+
uniform vec4 uColor;
|
|
745
|
+
void main() {
|
|
746
|
+
gl_FragColor = uColor;
|
|
747
|
+
}
|
|
748
|
+
`;
|
|
749
|
+
function we(t, e, r) {
|
|
750
|
+
const n = t.createShader(e);
|
|
751
|
+
if (!n) throw new Error("createShader failed");
|
|
752
|
+
if (t.shaderSource(n, r), t.compileShader(n), !t.getShaderParameter(n, t.COMPILE_STATUS))
|
|
753
|
+
throw new Error(t.getShaderInfoLog(n) ?? "shader compile failed");
|
|
754
|
+
return n;
|
|
755
|
+
}
|
|
756
|
+
function Jt(t) {
|
|
757
|
+
const e = we(t, t.VERTEX_SHADER, Kt), r = we(t, t.FRAGMENT_SHADER, jt), n = t.createProgram();
|
|
758
|
+
if (!n) throw new Error("createProgram failed");
|
|
759
|
+
if (t.attachShader(n, e), t.attachShader(n, r), t.linkProgram(n), !t.getProgramParameter(n, t.LINK_STATUS))
|
|
760
|
+
throw new Error(t.getProgramInfoLog(n) ?? "program link failed");
|
|
761
|
+
return t.deleteShader(e), t.deleteShader(r), n;
|
|
762
|
+
}
|
|
763
|
+
function Qt(t) {
|
|
764
|
+
const { plotArea: e, xLines: r, yLines: n } = t, a = e.y, o = e.y + e.height, i = e.x, s = e.x + e.width, l = (r.length + n.length) * 2, c = new Float32Array(l * 2);
|
|
765
|
+
let u = 0;
|
|
766
|
+
for (const h of r)
|
|
767
|
+
c[u++] = h, c[u++] = a, c[u++] = h, c[u++] = o;
|
|
768
|
+
for (const h of n)
|
|
769
|
+
c[u++] = i, c[u++] = h, c[u++] = s, c[u++] = h;
|
|
770
|
+
return c;
|
|
771
|
+
}
|
|
772
|
+
class Zt {
|
|
773
|
+
constructor(e) {
|
|
774
|
+
B(this, "gl");
|
|
775
|
+
B(this, "program");
|
|
776
|
+
B(this, "buffer");
|
|
777
|
+
B(this, "aPosition");
|
|
778
|
+
B(this, "uResolution");
|
|
779
|
+
B(this, "uColor");
|
|
780
|
+
const r = e.getContext("webgl", {
|
|
781
|
+
alpha: !0,
|
|
782
|
+
antialias: !1,
|
|
783
|
+
preserveDrawingBuffer: !0
|
|
784
|
+
});
|
|
785
|
+
if (!r) throw new Error("WebGL not available for grid spike");
|
|
786
|
+
this.gl = r, this.program = Jt(r), this.aPosition = r.getAttribLocation(this.program, "aPosition"), this.uResolution = r.getUniformLocation(this.program, "uResolution"), this.uColor = r.getUniformLocation(this.program, "uColor");
|
|
787
|
+
const n = r.createBuffer();
|
|
788
|
+
if (!n) throw new Error("createBuffer failed");
|
|
789
|
+
this.buffer = n;
|
|
790
|
+
}
|
|
791
|
+
/** Upload vertices and draw grid lines */
|
|
792
|
+
draw(e) {
|
|
793
|
+
const r = this.gl, n = Qt(e), a = n.length / 4;
|
|
794
|
+
r.viewport(0, 0, e.width, e.height), r.clearColor(0.04, 0.05, 0.08, 1), r.clear(r.COLOR_BUFFER_BIT), r.useProgram(this.program), r.bindBuffer(r.ARRAY_BUFFER, this.buffer), r.bufferData(r.ARRAY_BUFFER, n, r.DYNAMIC_DRAW), r.enableVertexAttribArray(this.aPosition), r.vertexAttribPointer(this.aPosition, 2, r.FLOAT, !1, 0, 0), r.uniform2f(this.uResolution, e.width, e.height);
|
|
795
|
+
const o = e.color ?? [0.2, 0.22, 0.3, 0.6];
|
|
796
|
+
return r.uniform4f(this.uColor, o[0], o[1], o[2], o[3]), r.lineWidth(e.lineWidth ?? 1), r.drawArrays(r.LINES, 0, n.length / 2), a;
|
|
797
|
+
}
|
|
798
|
+
destroy() {
|
|
799
|
+
const e = this.gl;
|
|
800
|
+
e.deleteBuffer(this.buffer), e.deleteProgram(this.program);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
function er(t) {
|
|
804
|
+
const e = () => {
|
|
805
|
+
};
|
|
806
|
+
return {
|
|
807
|
+
canvas: t,
|
|
808
|
+
strokeStyle: "",
|
|
809
|
+
fillStyle: "",
|
|
810
|
+
lineWidth: 1,
|
|
811
|
+
font: "",
|
|
812
|
+
textAlign: "left",
|
|
813
|
+
textBaseline: "alphabetic",
|
|
814
|
+
beginPath: e,
|
|
815
|
+
moveTo: e,
|
|
816
|
+
lineTo: e,
|
|
817
|
+
stroke: e,
|
|
818
|
+
fill: e,
|
|
819
|
+
clearRect: e,
|
|
820
|
+
setTransform: e,
|
|
821
|
+
setLineDash: e,
|
|
822
|
+
save: e,
|
|
823
|
+
restore: e,
|
|
824
|
+
translate: e,
|
|
825
|
+
rotate: e,
|
|
826
|
+
fillText: e,
|
|
827
|
+
measureText: (r) => ({ width: r.length * 7 })
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
function tr(t, e) {
|
|
831
|
+
const r = document.createElement("canvas");
|
|
832
|
+
return r.width = t, r.height = e, r.getContext("2d") ?? er(r);
|
|
833
|
+
}
|
|
834
|
+
function Me(t, e) {
|
|
835
|
+
const r = { top: 40, right: 40, bottom: 50, left: 60 };
|
|
836
|
+
return {
|
|
837
|
+
x: r.left,
|
|
838
|
+
y: r.top,
|
|
839
|
+
width: t - r.left - r.right,
|
|
840
|
+
height: e - r.top - r.bottom
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
function Fe(t, e, r, n, a) {
|
|
844
|
+
const o = e.ticks(n).map((s) => de(e.transform(s))), i = r.ticks(a).map((s) => de(r.transform(s)));
|
|
845
|
+
return { xLines: o, yLines: i };
|
|
846
|
+
}
|
|
847
|
+
function De(t, e) {
|
|
848
|
+
const r = [];
|
|
849
|
+
for (let o = 0; o < e; o++) {
|
|
850
|
+
const i = performance.now();
|
|
851
|
+
t(), r.push((performance.now() - i) * 1e3);
|
|
852
|
+
}
|
|
853
|
+
r.sort((o, i) => o - i);
|
|
854
|
+
const n = r.reduce((o, i) => o + i, 0) / r.length, a = r[Math.floor(r.length * 0.95)] ?? n;
|
|
855
|
+
return { avg: n, p95: a };
|
|
856
|
+
}
|
|
857
|
+
function rr(t = {}) {
|
|
858
|
+
const e = Math.round((t.width ?? 1920) * (t.dpr ?? 1)), r = Math.round((t.height ?? 1080) * (t.dpr ?? 1)), n = t.xTickCount ?? 24, a = t.yTickCount ?? 16, o = t.frames ?? 120, i = tr(e, r), s = {
|
|
859
|
+
...ue,
|
|
860
|
+
grid: {
|
|
861
|
+
...ue.grid,
|
|
862
|
+
visible: !0,
|
|
863
|
+
showMinor: t.showMinor ?? !0
|
|
864
|
+
}
|
|
865
|
+
}, l = Me(e, r), c = new K(), u = new K();
|
|
866
|
+
c.setDomain(0, 1e6), u.setDomain(-1, 1), c.setRange(l.x, l.x + l.width), u.setRange(l.y + l.height, l.y);
|
|
867
|
+
const h = new ut(i, s), { avg: v, p95: d } = De(() => {
|
|
868
|
+
i.clearRect(0, 0, e, r), h.drawGrid(l, c, u, { tickCount: n }, { tickCount: a });
|
|
869
|
+
}, o), { xLines: p, yLines: x } = Fe(l, c, u, n, a);
|
|
870
|
+
return {
|
|
871
|
+
backend: "canvas2d",
|
|
872
|
+
dpr: t.dpr ?? 1,
|
|
873
|
+
width: e,
|
|
874
|
+
height: r,
|
|
875
|
+
xTicks: n,
|
|
876
|
+
yTicks: a,
|
|
877
|
+
lineSegments: p.length + x.length,
|
|
878
|
+
avgFrameUs: Math.round(v),
|
|
879
|
+
p95FrameUs: Math.round(d),
|
|
880
|
+
frames: o
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
function nr(t = {}) {
|
|
884
|
+
const e = Math.round((t.width ?? 1920) * (t.dpr ?? 1)), r = Math.round((t.height ?? 1080) * (t.dpr ?? 1)), n = t.xTickCount ?? 24, a = t.yTickCount ?? 16, o = t.frames ?? 120, i = document.createElement("canvas");
|
|
885
|
+
i.width = e, i.height = r;
|
|
886
|
+
let s;
|
|
887
|
+
try {
|
|
888
|
+
s = new Zt(i);
|
|
889
|
+
} catch {
|
|
890
|
+
return null;
|
|
891
|
+
}
|
|
892
|
+
const l = Me(e, r), c = new K(), u = new K();
|
|
893
|
+
c.setDomain(0, 1e6), u.setDomain(-1, 1), c.setRange(l.x, l.x + l.width), u.setRange(l.y + l.height, l.y);
|
|
894
|
+
const { xLines: h, yLines: v } = Fe(l, c, u, n, a), d = { plotArea: l, xLines: h, yLines: v, width: e, height: r };
|
|
895
|
+
let p = 0;
|
|
896
|
+
const { avg: x, p95: b } = De(() => {
|
|
897
|
+
p = s.draw(d);
|
|
898
|
+
}, o);
|
|
899
|
+
return s.destroy(), {
|
|
900
|
+
backend: "webgl",
|
|
901
|
+
dpr: t.dpr ?? 1,
|
|
902
|
+
width: e,
|
|
903
|
+
height: r,
|
|
904
|
+
xTicks: n,
|
|
905
|
+
yTicks: a,
|
|
906
|
+
lineSegments: p,
|
|
907
|
+
avgFrameUs: Math.round(x),
|
|
908
|
+
p95FrameUs: Math.round(b),
|
|
909
|
+
frames: o
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
function Rr(t) {
|
|
913
|
+
const e = (t == null ? void 0 : t.dpr) ?? 2, r = (t == null ? void 0 : t.frames) ?? 120, n = rr({ dpr: e, frames: r, showMinor: !0 }), a = nr({ dpr: e, frames: r });
|
|
914
|
+
if (!a)
|
|
915
|
+
return {
|
|
916
|
+
canvas2d: n,
|
|
917
|
+
webgl: null,
|
|
918
|
+
gainPercent: 0,
|
|
919
|
+
recommendation: "defer"
|
|
920
|
+
};
|
|
921
|
+
const o = (n.avgFrameUs - a.avgFrameUs) / n.avgFrameUs * 100;
|
|
922
|
+
return {
|
|
923
|
+
canvas2d: n,
|
|
924
|
+
webgl: a,
|
|
925
|
+
gainPercent: Math.round(o * 10) / 10,
|
|
926
|
+
recommendation: o >= 20 ? "implement" : "defer"
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
const ar = "1.17.0", or = "2026-07-05", ir = "Stage 1 baselines. Headless CI uses effective FPS (render throughput when rAF throttled) via scripts/benchmark-scenario-eval.mjs smoke floors.", sr = 0.1, lr = 0.95, cr = {
|
|
930
|
+
"line-1m-pan": {
|
|
931
|
+
minAvgFps: 50,
|
|
932
|
+
maxAvgFrameTimeMs: 20,
|
|
933
|
+
points: 1e6,
|
|
934
|
+
description: "1M line points, continuous pan/zoom simulation"
|
|
935
|
+
},
|
|
936
|
+
"candlestick-500k": {
|
|
937
|
+
minAvgFps: 45,
|
|
938
|
+
maxAvgFrameTimeMs: 22,
|
|
939
|
+
points: 5e5,
|
|
940
|
+
description: "500k OHLC bars with PluginVirtualization"
|
|
941
|
+
},
|
|
942
|
+
"stack-5pane-resize": {
|
|
943
|
+
minAvgFps: 48,
|
|
944
|
+
maxAvgFrameTimeMs: 21,
|
|
945
|
+
description: "5-pane stack divider drag (batched overlay redraw)"
|
|
946
|
+
},
|
|
947
|
+
"line-200k-webgl": {
|
|
948
|
+
minAvgFps: 45,
|
|
949
|
+
description: "200k line WebGL baseline for renderer compare"
|
|
950
|
+
},
|
|
951
|
+
"line-200k-webgpu": {
|
|
952
|
+
minAvgFps: 42,
|
|
953
|
+
description: "200k line WebGPU — target ≥95% of WebGL FPS"
|
|
954
|
+
},
|
|
955
|
+
"boxplot-5k-webgpu": {
|
|
956
|
+
minAvgFps: 50,
|
|
957
|
+
description: "5k boxplot series on WebGPU chart path"
|
|
958
|
+
},
|
|
959
|
+
"grid-canvas2d-dpr2": {
|
|
960
|
+
maxAvgFrameUs: 1200,
|
|
961
|
+
dpr: 2,
|
|
962
|
+
description: "Canvas 2D grid+minor at 1920×1080 @2x"
|
|
963
|
+
},
|
|
964
|
+
"grid-webgl-dpr2": {
|
|
965
|
+
maxAvgFrameUs: 400,
|
|
966
|
+
dpr: 2,
|
|
967
|
+
description: "WebGL grid spike lines only @2x"
|
|
968
|
+
}
|
|
969
|
+
}, ee = {
|
|
970
|
+
version: ar,
|
|
971
|
+
recordedAt: or,
|
|
972
|
+
notes: ir,
|
|
973
|
+
regressionThreshold: sr,
|
|
974
|
+
webgpuMinFpsRatio: lr,
|
|
975
|
+
scenarios: cr
|
|
976
|
+
};
|
|
977
|
+
function Ir() {
|
|
978
|
+
return ee;
|
|
979
|
+
}
|
|
980
|
+
function Lr(t, e) {
|
|
981
|
+
const r = ee.scenarios[t];
|
|
982
|
+
if (!r)
|
|
983
|
+
return { passed: !0, failures: [] };
|
|
984
|
+
const n = [], a = ee.regressionThreshold ?? 0.1;
|
|
985
|
+
if ("avgFps" in e && r.minAvgFps !== void 0) {
|
|
986
|
+
const o = r.minAvgFps * (1 - a);
|
|
987
|
+
e.avgFps < o && n.push(
|
|
988
|
+
`FPS ${e.avgFps} < baseline min ${r.minAvgFps} (allowed ${o.toFixed(1)} with ${a * 100}% slack)`
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
if ("avgFrameTime" in e && r.maxAvgFrameTimeMs !== void 0) {
|
|
992
|
+
const o = r.maxAvgFrameTimeMs * (1 + a);
|
|
993
|
+
e.avgFrameTime > o && n.push(
|
|
994
|
+
`Frame time ${e.avgFrameTime}ms > baseline max ${r.maxAvgFrameTimeMs}ms`
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
if ("avgFrameUs" in e && r.maxAvgFrameUs !== void 0) {
|
|
998
|
+
const o = r.maxAvgFrameUs * (1 + a);
|
|
999
|
+
e.avgFrameUs > o && n.push(
|
|
1000
|
+
`Grid frame ${e.avgFrameUs}µs > baseline max ${r.maxAvgFrameUs}µs`
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
return { passed: n.length === 0, failures: n };
|
|
1004
|
+
}
|
|
1005
|
+
function kr(t, e, r, n = 0.95) {
|
|
1006
|
+
if (!r || !e)
|
|
1007
|
+
return {
|
|
1008
|
+
webgl: t,
|
|
1009
|
+
webgpu: e,
|
|
1010
|
+
webgpuActive: !1,
|
|
1011
|
+
fpsRatio: 0,
|
|
1012
|
+
meetsTarget: !1,
|
|
1013
|
+
recommendation: "webgpu-unavailable"
|
|
1014
|
+
};
|
|
1015
|
+
const a = t.avgFps > 0 ? e.avgFps / t.avgFps : 0, o = a >= n;
|
|
1016
|
+
return {
|
|
1017
|
+
webgl: t,
|
|
1018
|
+
webgpu: e,
|
|
1019
|
+
webgpuActive: !0,
|
|
1020
|
+
fpsRatio: a,
|
|
1021
|
+
meetsTarget: o,
|
|
1022
|
+
recommendation: o ? "webgpu-ready" : "webgl-faster"
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
class ur {
|
|
1026
|
+
constructor(e) {
|
|
1027
|
+
B(this, "seed");
|
|
1028
|
+
this.seed = e;
|
|
1029
|
+
}
|
|
1030
|
+
next() {
|
|
1031
|
+
let e = this.seed += 1831565813;
|
|
1032
|
+
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
1033
|
+
}
|
|
1034
|
+
nextRange(e, r) {
|
|
1035
|
+
return e + this.next() * (r - e);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
function Br(t) {
|
|
1039
|
+
const e = {
|
|
1040
|
+
pointCount: 1e3,
|
|
1041
|
+
amplitude: 1,
|
|
1042
|
+
frequency: 1,
|
|
1043
|
+
phase: 0,
|
|
1044
|
+
noise: 0,
|
|
1045
|
+
xStart: 0,
|
|
1046
|
+
xEnd: 10,
|
|
1047
|
+
offset: 0,
|
|
1048
|
+
...t
|
|
1049
|
+
}, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1050
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1051
|
+
r[o] = e.xStart + o * a;
|
|
1052
|
+
const i = e.amplitude * Math.sin(2 * Math.PI * e.frequency * r[o] + e.phase), s = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1053
|
+
n[o] = i + s + e.offset;
|
|
1054
|
+
}
|
|
1055
|
+
return { x: r, y: n };
|
|
1056
|
+
}
|
|
1057
|
+
function _r(t) {
|
|
1058
|
+
const e = {
|
|
1059
|
+
pointCount: 1e3,
|
|
1060
|
+
amplitude: 1,
|
|
1061
|
+
frequency: 1,
|
|
1062
|
+
phase: 0,
|
|
1063
|
+
noise: 0,
|
|
1064
|
+
xStart: 0,
|
|
1065
|
+
xEnd: 10,
|
|
1066
|
+
offset: 0,
|
|
1067
|
+
...t
|
|
1068
|
+
}, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1069
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1070
|
+
r[o] = e.xStart + o * a;
|
|
1071
|
+
const i = r[o] * e.frequency + e.phase / (2 * Math.PI), s = Math.sign(Math.sin(2 * Math.PI * i)) * e.amplitude, l = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1072
|
+
n[o] = s + l + e.offset;
|
|
1073
|
+
}
|
|
1074
|
+
return { x: r, y: n };
|
|
1075
|
+
}
|
|
1076
|
+
function Yr(t) {
|
|
1077
|
+
const e = {
|
|
1078
|
+
pointCount: 1e3,
|
|
1079
|
+
amplitude: 1,
|
|
1080
|
+
frequency: 1,
|
|
1081
|
+
phase: 0,
|
|
1082
|
+
noise: 0,
|
|
1083
|
+
xStart: 0,
|
|
1084
|
+
xEnd: 10,
|
|
1085
|
+
offset: 0,
|
|
1086
|
+
...t
|
|
1087
|
+
}, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1088
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1089
|
+
r[o] = e.xStart + o * a;
|
|
1090
|
+
const i = r[o] * e.frequency + e.phase / (2 * Math.PI), s = e.amplitude * 2 * (i - Math.floor(i + 0.5)), l = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1091
|
+
n[o] = s + l + e.offset;
|
|
1092
|
+
}
|
|
1093
|
+
return { x: r, y: n };
|
|
1094
|
+
}
|
|
1095
|
+
function Xr(t) {
|
|
1096
|
+
const e = {
|
|
1097
|
+
pointCount: 1e3,
|
|
1098
|
+
amplitude: 1,
|
|
1099
|
+
frequency: 1,
|
|
1100
|
+
phase: 0,
|
|
1101
|
+
noise: 0,
|
|
1102
|
+
xStart: 0,
|
|
1103
|
+
xEnd: 10,
|
|
1104
|
+
offset: 0,
|
|
1105
|
+
...t
|
|
1106
|
+
}, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), a = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1107
|
+
for (let o = 0; o < e.pointCount; o++) {
|
|
1108
|
+
r[o] = e.xStart + o * a;
|
|
1109
|
+
const i = r[o] * e.frequency + e.phase / (2 * Math.PI), s = e.amplitude * 2 * Math.abs(2 * (i - Math.floor(i + 0.5))) - e.amplitude, l = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1110
|
+
n[o] = s + l + e.offset;
|
|
1111
|
+
}
|
|
1112
|
+
return { x: r, y: n };
|
|
1113
|
+
}
|
|
1114
|
+
function Wr(t) {
|
|
1115
|
+
const e = {
|
|
1116
|
+
pointCount: 1e3,
|
|
1117
|
+
xRange: [0, 100],
|
|
1118
|
+
yRange: [-1, 1],
|
|
1119
|
+
sorted: !0,
|
|
1120
|
+
seed: Date.now(),
|
|
1121
|
+
...t
|
|
1122
|
+
}, r = new ur(e.seed), n = new Float32Array(e.pointCount), a = new Float32Array(e.pointCount);
|
|
1123
|
+
for (let o = 0; o < e.pointCount; o++)
|
|
1124
|
+
n[o] = r.nextRange(e.xRange[0], e.xRange[1]), a[o] = r.nextRange(e.yRange[0], e.yRange[1]);
|
|
1125
|
+
if (e.sorted) {
|
|
1126
|
+
const o = Array.from({ length: e.pointCount }, (l, c) => c);
|
|
1127
|
+
o.sort((l, c) => n[l] - n[c]);
|
|
1128
|
+
const i = new Float32Array(e.pointCount), s = new Float32Array(e.pointCount);
|
|
1129
|
+
for (let l = 0; l < e.pointCount; l++)
|
|
1130
|
+
i[l] = n[o[l]], s[l] = a[o[l]];
|
|
1131
|
+
return { x: i, y: s };
|
|
1132
|
+
}
|
|
1133
|
+
return { x: n, y: a };
|
|
1134
|
+
}
|
|
1135
|
+
function Gr(t) {
|
|
1136
|
+
const e = {
|
|
1137
|
+
pointCount: 2e3,
|
|
1138
|
+
vMin: -0.5,
|
|
1139
|
+
vMax: 0.5,
|
|
1140
|
+
cycles: 1,
|
|
1141
|
+
peakCurrent: 1e-5,
|
|
1142
|
+
// 10 µA
|
|
1143
|
+
noise: 0.02,
|
|
1144
|
+
...t
|
|
1145
|
+
}, r = e.pointCount * e.cycles, n = new Float32Array(r), a = new Float32Array(r), o = e.pointCount, i = o / 2;
|
|
1146
|
+
for (let s = 0; s < e.cycles; s++)
|
|
1147
|
+
for (let l = 0; l < o; l++) {
|
|
1148
|
+
const c = s * o + l;
|
|
1149
|
+
l < i ? n[c] = e.vMin + (e.vMax - e.vMin) * (l / i) : n[c] = e.vMax - (e.vMax - e.vMin) * ((l - i) / i);
|
|
1150
|
+
const u = n[c], h = 0, v = l < i ? 1 : -1, d = 0.1, p = -Math.pow(u - h, 2) / (2 * d * d), x = e.peakCurrent * Math.exp(p), b = v * e.peakCurrent * 0.1, m = (Math.random() - 0.5) * 2 * e.noise * e.peakCurrent;
|
|
1151
|
+
a[c] = v * x + b + m;
|
|
1152
|
+
}
|
|
1153
|
+
return { x: n, y: a };
|
|
1154
|
+
}
|
|
1155
|
+
function Or(t) {
|
|
1156
|
+
const e = {
|
|
1157
|
+
pointCount: 50,
|
|
1158
|
+
rSolution: 100,
|
|
1159
|
+
// Ohms
|
|
1160
|
+
rCharge: 1e3,
|
|
1161
|
+
// Ohms
|
|
1162
|
+
frequency: [1e5, 0.01],
|
|
1163
|
+
...t
|
|
1164
|
+
}, r = new Float32Array(e.pointCount), n = new Float32Array(e.pointCount), a = Math.log10(e.frequency[1]), o = Math.log10(e.frequency[0]);
|
|
1165
|
+
for (let i = 0; i < e.pointCount; i++) {
|
|
1166
|
+
const s = o - (o - a) * (i / (e.pointCount - 1)), l = 2 * Math.PI * Math.pow(10, s), c = e.rCharge * 1e-5, u = e.rSolution + e.rCharge / (1 + Math.pow(l * c, 2)), h = l * c * e.rCharge / (1 + Math.pow(l * c, 2));
|
|
1167
|
+
r[i] = u, n[i] = -h;
|
|
1168
|
+
}
|
|
1169
|
+
return { x: r, y: n };
|
|
1170
|
+
}
|
|
1171
|
+
async function Vr(t, e) {
|
|
1172
|
+
const r = {
|
|
1173
|
+
duration: 5e3,
|
|
1174
|
+
warmup: 1e3,
|
|
1175
|
+
...e
|
|
1176
|
+
}, n = [], a = [];
|
|
1177
|
+
let o = 0;
|
|
1178
|
+
const i = t.getAllSeries().reduce((s, l) => s + l.getPointCount(), 0);
|
|
1179
|
+
return new Promise((s) => {
|
|
1180
|
+
const l = performance.now() + r.warmup + r.duration, c = performance.now() + r.warmup;
|
|
1181
|
+
let u = !1, h = 0;
|
|
1182
|
+
function v() {
|
|
1183
|
+
const d = performance.now();
|
|
1184
|
+
if (d >= l) {
|
|
1185
|
+
const b = a.length > 0 ? a.reduce((A, w) => A + w, 0) / a.length : 0, m = h > 0 ? d - h : r.duration, y = o > 0 && m > 0 ? o / m * 1e3 : 0, g = n.length > 0 ? n.reduce((A, w) => A + w, 0) / n.length : b > 0 ? 1e3 / b : 0, f = {
|
|
1186
|
+
avgFps: Math.round(y * 100) / 100,
|
|
1187
|
+
minFps: Math.round((n.length > 0 ? Math.min(...n) : y) * 100) / 100,
|
|
1188
|
+
maxFps: Math.round((n.length > 0 ? Math.max(...n) : y) * 100) / 100,
|
|
1189
|
+
avgFrameTime: Math.round(b * 1e3) / 1e3,
|
|
1190
|
+
frameCount: o,
|
|
1191
|
+
duration: r.duration,
|
|
1192
|
+
pointsRendered: i,
|
|
1193
|
+
throughput: Math.round(i * y / 1e3) * 1e3,
|
|
1194
|
+
/** @internal render-only FPS (not wall clock) */
|
|
1195
|
+
...g > 0 ? { renderFps: Math.round(g * 100) / 100 } : {}
|
|
1196
|
+
};
|
|
1197
|
+
s(f);
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
d >= c && !u && (u = !0, h = d, o = 0, a.length = 0, n.length = 0);
|
|
1201
|
+
const p = performance.now();
|
|
1202
|
+
t.render();
|
|
1203
|
+
const x = performance.now();
|
|
1204
|
+
if (u) {
|
|
1205
|
+
const b = x - p;
|
|
1206
|
+
a.push(b), o++;
|
|
1207
|
+
const m = a.slice(-30);
|
|
1208
|
+
if (m.length > 0) {
|
|
1209
|
+
const y = m.reduce((g, f) => g + f, 0) / m.length;
|
|
1210
|
+
y > 0 && n.push(1e3 / y);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
requestAnimationFrame(v);
|
|
1214
|
+
}
|
|
1215
|
+
requestAnimationFrame(v);
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
function $r(t, e) {
|
|
1219
|
+
const r = {
|
|
1220
|
+
format: "json",
|
|
1221
|
+
includeStyles: !0,
|
|
1222
|
+
...e
|
|
1223
|
+
}, n = t.getAllSeries().map((o) => ({
|
|
1224
|
+
id: o.getId(),
|
|
1225
|
+
type: o.getType(),
|
|
1226
|
+
pointCount: o.getPointCount(),
|
|
1227
|
+
...r.includeStyles ? { style: o.getStyle() } : {}
|
|
1228
|
+
})), a = {
|
|
1229
|
+
timestamp: Date.now(),
|
|
1230
|
+
config: {},
|
|
1231
|
+
series: n,
|
|
1232
|
+
bounds: t.getViewBounds()
|
|
1233
|
+
};
|
|
1234
|
+
return r.format === "png" && t.exportImage && (a.image = t.exportImage()), a;
|
|
1235
|
+
}
|
|
1236
|
+
function Hr(t, e, r = 1e-6) {
|
|
1237
|
+
const n = [];
|
|
1238
|
+
t.series.length !== e.series.length && n.push(`Series count: ${t.series.length} vs ${e.series.length}`);
|
|
1239
|
+
for (let o = 0; o < Math.min(t.series.length, e.series.length); o++) {
|
|
1240
|
+
const i = t.series[o], s = e.series[o];
|
|
1241
|
+
i.id !== s.id && n.push(`Series[${o}] id: "${i.id}" vs "${s.id}"`), i.type !== s.type && n.push(`Series[${o}] type: "${i.type}" vs "${s.type}"`), i.pointCount !== s.pointCount && n.push(`Series[${o}] pointCount: ${i.pointCount} vs ${s.pointCount}`);
|
|
1242
|
+
}
|
|
1243
|
+
const a = ["xMin", "xMax", "yMin", "yMax"];
|
|
1244
|
+
for (const o of a)
|
|
1245
|
+
Math.abs(t.bounds[o] - e.bounds[o]) > r && n.push(`Bounds.${o}: ${t.bounds[o]} vs ${e.bounds[o]}`);
|
|
1246
|
+
return {
|
|
1247
|
+
equal: n.length === 0,
|
|
1248
|
+
differences: n
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
function zr(t, e) {
|
|
1252
|
+
const r = [];
|
|
1253
|
+
return e.minFps && t.avgFps < e.minFps && r.push(`FPS ${t.avgFps} < required ${e.minFps}`), e.maxFrameTime && t.avgFrameTime > e.maxFrameTime && r.push(`Frame time ${t.avgFrameTime}ms > required ${e.maxFrameTime}ms`), e.minThroughput && t.throughput < e.minThroughput && r.push(`Throughput ${t.throughput} < required ${e.minThroughput}`), {
|
|
1254
|
+
passed: r.length === 0,
|
|
1255
|
+
failures: r
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
function Nr(t = 1) {
|
|
1259
|
+
return new Promise((e) => {
|
|
1260
|
+
let r = t;
|
|
1261
|
+
function n() {
|
|
1262
|
+
r--, r <= 0 ? e() : requestAnimationFrame(n);
|
|
1263
|
+
}
|
|
1264
|
+
requestAnimationFrame(n);
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
function Ur(t) {
|
|
1268
|
+
return new Promise((e) => setTimeout(e, t));
|
|
1269
|
+
}
|
|
1270
|
+
const dr = {
|
|
88
1271
|
name: "crosshair",
|
|
89
1272
|
version: "1.0.0",
|
|
90
1273
|
description: "Interactive crosshair that follows mouse cursor",
|
|
91
1274
|
provides: ["interaction", "visualization"],
|
|
92
1275
|
tags: ["cursor", "crosshair", "tooltip"]
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
(
|
|
1276
|
+
}, fr = G(
|
|
1277
|
+
dr,
|
|
1278
|
+
(t = {}) => {
|
|
96
1279
|
const {
|
|
97
1280
|
showVertical: e = !0,
|
|
98
|
-
showHorizontal:
|
|
99
|
-
color:
|
|
100
|
-
lineStyle:
|
|
101
|
-
lineWidth:
|
|
102
|
-
snapToData:
|
|
103
|
-
valueFormat:
|
|
104
|
-
} =
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
let u = -1,
|
|
1281
|
+
showHorizontal: r = !0,
|
|
1282
|
+
color: n,
|
|
1283
|
+
lineStyle: a = "dashed",
|
|
1284
|
+
lineWidth: o = 1,
|
|
1285
|
+
snapToData: i = !1,
|
|
1286
|
+
valueFormat: s = { xPrecision: 4, yPrecision: 4 }
|
|
1287
|
+
} = t;
|
|
1288
|
+
let l = t.valueDisplayMode ?? "disabled";
|
|
1289
|
+
t.showAxisLabels !== void 0 && t.valueDisplayMode === void 0 && (l = t.showAxisLabels ? "floating" : "disabled");
|
|
1290
|
+
const c = t.cornerPosition ?? "top-left";
|
|
1291
|
+
let u = -1, h = -1, v, d = null, p = null;
|
|
109
1292
|
return {
|
|
110
|
-
onInit(
|
|
111
|
-
|
|
112
|
-
const
|
|
1293
|
+
onInit(g) {
|
|
1294
|
+
v = "crosshair-overlay";
|
|
1295
|
+
const f = g.ui.createOverlay(v, {
|
|
113
1296
|
zIndex: 500,
|
|
114
1297
|
position: { top: "0", left: "0", right: "0", bottom: "0" }
|
|
115
1298
|
});
|
|
116
|
-
|
|
1299
|
+
d = document.createElement("canvas"), d.style.cssText = "width: 100%; height: 100%;", f.appendChild(d), p = d.getContext("2d"), x(g);
|
|
117
1300
|
},
|
|
118
|
-
onDestroy(
|
|
119
|
-
|
|
1301
|
+
onDestroy(g) {
|
|
1302
|
+
g.ui.removeOverlay(v), d = null, p = null;
|
|
120
1303
|
},
|
|
121
|
-
onResize(
|
|
122
|
-
|
|
1304
|
+
onResize(g) {
|
|
1305
|
+
x(g);
|
|
123
1306
|
},
|
|
124
|
-
onInteraction(
|
|
125
|
-
if (
|
|
126
|
-
if (u =
|
|
127
|
-
const
|
|
128
|
-
|
|
1307
|
+
onInteraction(g, f) {
|
|
1308
|
+
if (f.type === "mousemove") {
|
|
1309
|
+
if (u = f.pixelX, h = f.pixelY, i && f.inPlotArea) {
|
|
1310
|
+
const A = g.coords.pickPoint(u, h);
|
|
1311
|
+
A && (u = A.pixelX, h = A.pixelY);
|
|
129
1312
|
}
|
|
130
|
-
b(
|
|
1313
|
+
b(g);
|
|
131
1314
|
}
|
|
132
1315
|
},
|
|
133
1316
|
onViewChange() {
|
|
134
1317
|
}
|
|
135
1318
|
};
|
|
136
|
-
function
|
|
137
|
-
if (!
|
|
138
|
-
const
|
|
139
|
-
|
|
1319
|
+
function x(g) {
|
|
1320
|
+
if (!d || !p) return;
|
|
1321
|
+
const f = g.render.canvasSize, A = g.render.pixelRatio;
|
|
1322
|
+
d.width = f.width * A, d.height = f.height * A, p.setTransform(1, 0, 0, 1, 0, 0), p.scale(A, A);
|
|
140
1323
|
}
|
|
141
|
-
function b(
|
|
142
|
-
var
|
|
143
|
-
if (!
|
|
144
|
-
const { width:
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
if (u <
|
|
1324
|
+
function b(g) {
|
|
1325
|
+
var S;
|
|
1326
|
+
if (!p || !d) return;
|
|
1327
|
+
const { width: f, height: A } = g.render.canvasSize;
|
|
1328
|
+
if (p.clearRect(0, 0, f, A), u < 0 || h < 0) return;
|
|
1329
|
+
const w = g.render.plotArea;
|
|
1330
|
+
if (u < w.x || u > w.x + w.width || h < w.y || h > w.y + w.height)
|
|
148
1331
|
return;
|
|
149
|
-
const
|
|
150
|
-
|
|
1332
|
+
const F = n || ((S = g.ui.theme.cursor) == null ? void 0 : S.color) || "#888888";
|
|
1333
|
+
p.save(), p.strokeStyle = F, p.lineWidth = o, a === "dashed" ? p.setLineDash([6, 4]) : a === "dotted" && p.setLineDash([2, 2]), e && (p.beginPath(), p.moveTo(u, w.y), p.lineTo(u, w.y + w.height), p.stroke()), r && (p.beginPath(), p.moveTo(w.x, h), p.lineTo(w.x + w.width, h), p.stroke()), p.restore(), l === "floating" ? m(g, p, u, h, F) : l === "corner" && y(g, p, u, h, F);
|
|
151
1334
|
}
|
|
152
|
-
function g
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
1335
|
+
function m(g, f, A, w, F) {
|
|
1336
|
+
const S = g.coords.pixelToDataX(A), D = g.coords.pixelToDataY(w), T = g.render.plotArea;
|
|
1337
|
+
f.save(), f.font = "11px system-ui, sans-serif", f.textAlign = "center", f.textBaseline = "top";
|
|
1338
|
+
const I = S.toPrecision(s.xPrecision), C = f.measureText(I).width + 8, M = 18, L = A - C / 2, E = T.y + T.height + 2;
|
|
1339
|
+
f.fillStyle = F, f.fillRect(L, E, C, M), f.fillStyle = "#ffffff", f.fillText(I, A, E + 3), f.textAlign = "right", f.textBaseline = "middle";
|
|
1340
|
+
const _ = D.toPrecision(s.yPrecision), X = f.measureText(_).width + 8, k = 18, Y = T.x - X - 2, H = w - k / 2;
|
|
1341
|
+
f.fillStyle = F, f.fillRect(Y, H, X, k), f.fillStyle = "#ffffff", f.fillText(_, T.x - 6, w), f.restore();
|
|
159
1342
|
}
|
|
160
|
-
function y(
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
let k,
|
|
165
|
-
switch (
|
|
1343
|
+
function y(g, f, A, w, F) {
|
|
1344
|
+
const S = g.coords.pixelToDataX(A), D = g.coords.pixelToDataY(w), T = g.render.plotArea;
|
|
1345
|
+
f.save(), f.font = "11px system-ui, sans-serif";
|
|
1346
|
+
const I = `X: ${S.toPrecision(s.xPrecision)}`, P = `Y: ${D.toPrecision(s.yPrecision)}`, C = f.measureText(I), M = f.measureText(P), L = Math.max(C.width, M.width), E = 6, _ = 16, R = L + E * 2, X = _ * 2 + E * 2;
|
|
1347
|
+
let k, Y;
|
|
1348
|
+
switch (c) {
|
|
166
1349
|
case "top-left":
|
|
167
|
-
k =
|
|
1350
|
+
k = T.x + 8, Y = T.y + 8;
|
|
168
1351
|
break;
|
|
169
1352
|
case "top-right":
|
|
170
|
-
k =
|
|
1353
|
+
k = T.x + T.width - R - 8, Y = T.y + 8;
|
|
171
1354
|
break;
|
|
172
1355
|
case "bottom-left":
|
|
173
|
-
k =
|
|
1356
|
+
k = T.x + 8, Y = T.y + T.height - X - 8;
|
|
174
1357
|
break;
|
|
175
1358
|
case "bottom-right":
|
|
176
|
-
k =
|
|
1359
|
+
k = T.x + T.width - R - 8, Y = T.y + T.height - X - 8;
|
|
177
1360
|
break;
|
|
178
1361
|
default:
|
|
179
|
-
k =
|
|
1362
|
+
k = T.x + 8, Y = T.y + 8;
|
|
180
1363
|
}
|
|
181
|
-
|
|
1364
|
+
f.fillStyle = F, f.globalAlpha = 0.85, f.fillRect(k, Y, R, X), f.globalAlpha = 1, f.strokeStyle = "rgba(255,255,255,0.3)", f.lineWidth = 1, f.strokeRect(k, Y, R, X), f.fillStyle = "#ffffff", f.textAlign = "left", f.textBaseline = "top", f.fillText(I, k + E, Y + E), f.fillText(P, k + E, Y + E + _), f.restore();
|
|
182
1365
|
}
|
|
183
1366
|
}
|
|
184
|
-
),
|
|
1367
|
+
), hr = {
|
|
185
1368
|
name: "statistics-overlay",
|
|
186
1369
|
version: "1.0.0",
|
|
187
1370
|
description: "Displays real-time statistics for chart data",
|
|
188
1371
|
provides: ["visualization", "analysis"],
|
|
189
1372
|
tags: ["statistics", "overlay", "analytics"]
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
(
|
|
1373
|
+
}, gr = G(
|
|
1374
|
+
hr,
|
|
1375
|
+
(t = {}) => {
|
|
193
1376
|
const {
|
|
194
1377
|
position: e = "top-right",
|
|
195
|
-
show:
|
|
196
|
-
seriesId:
|
|
197
|
-
autoUpdate:
|
|
198
|
-
} =
|
|
199
|
-
let
|
|
1378
|
+
show: r = ["count", "mean", "min", "max"],
|
|
1379
|
+
seriesId: n,
|
|
1380
|
+
autoUpdate: a = !0
|
|
1381
|
+
} = t;
|
|
1382
|
+
let o, i = null;
|
|
200
1383
|
return {
|
|
201
|
-
onInit(
|
|
202
|
-
|
|
1384
|
+
onInit(c) {
|
|
1385
|
+
o = "stats-overlay";
|
|
203
1386
|
const u = {};
|
|
204
|
-
e.includes("top") && (u.top = "10px"), e.includes("bottom") && (u.bottom = "10px"), e.includes("left") && (u.left = "10px"), e.includes("right") && (u.right = "10px"),
|
|
1387
|
+
e.includes("top") && (u.top = "10px"), e.includes("bottom") && (u.bottom = "10px"), e.includes("left") && (u.left = "10px"), e.includes("right") && (u.right = "10px"), i = c.ui.createOverlay(o, {
|
|
205
1388
|
zIndex: 800,
|
|
206
1389
|
position: u,
|
|
207
1390
|
pointerEvents: !1
|
|
208
|
-
}),
|
|
1391
|
+
}), i.innerHTML = `
|
|
209
1392
|
<div style="
|
|
210
1393
|
background: rgba(0, 0, 0, 0.85);
|
|
211
1394
|
color: #fff;
|
|
@@ -219,324 +1402,342 @@ const we = {
|
|
|
219
1402
|
<div style="font-weight: bold; margin-bottom: 4px; color: #4ade80;">📊 Statistics</div>
|
|
220
1403
|
<div class="stats-content"></div>
|
|
221
1404
|
</div>
|
|
222
|
-
`, c
|
|
1405
|
+
`, s(c);
|
|
223
1406
|
},
|
|
224
|
-
onDestroy(
|
|
225
|
-
|
|
1407
|
+
onDestroy(c) {
|
|
1408
|
+
c.ui.removeOverlay(o), i = null;
|
|
226
1409
|
},
|
|
227
|
-
onDataUpdate(
|
|
228
|
-
|
|
1410
|
+
onDataUpdate(c) {
|
|
1411
|
+
a && s(c);
|
|
229
1412
|
},
|
|
230
|
-
onSeriesAdd(
|
|
231
|
-
c
|
|
1413
|
+
onSeriesAdd(c) {
|
|
1414
|
+
s(c);
|
|
232
1415
|
},
|
|
233
|
-
onSeriesRemove(
|
|
234
|
-
c
|
|
1416
|
+
onSeriesRemove(c) {
|
|
1417
|
+
s(c);
|
|
235
1418
|
},
|
|
236
1419
|
api: {
|
|
237
|
-
refresh(
|
|
238
|
-
c
|
|
1420
|
+
refresh(c) {
|
|
1421
|
+
s(c);
|
|
239
1422
|
}
|
|
240
1423
|
}
|
|
241
1424
|
};
|
|
242
|
-
function c
|
|
243
|
-
if (!
|
|
244
|
-
const u =
|
|
1425
|
+
function s(c) {
|
|
1426
|
+
if (!i) return;
|
|
1427
|
+
const u = i.querySelector(".stats-content");
|
|
245
1428
|
if (!u) return;
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
1429
|
+
const h = c.data.getAllSeries(), v = n ? h.filter((b) => b.getId() === n) : h;
|
|
1430
|
+
if (v.length === 0) {
|
|
248
1431
|
u.innerHTML = "<div style='color: #888'>No data</div>";
|
|
249
1432
|
return;
|
|
250
1433
|
}
|
|
251
|
-
let
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
}),
|
|
1434
|
+
let d = [];
|
|
1435
|
+
if (v.forEach((b) => {
|
|
1436
|
+
const m = b.getData();
|
|
1437
|
+
m != null && m.y && (d = d.concat(Array.from(m.y)));
|
|
1438
|
+
}), d.length === 0) {
|
|
256
1439
|
u.innerHTML = "<div style='color: #888'>No data</div>";
|
|
257
1440
|
return;
|
|
258
1441
|
}
|
|
259
|
-
const
|
|
260
|
-
|
|
1442
|
+
const p = l(d), x = [];
|
|
1443
|
+
r.includes("count") && x.push(`<div>N: <span style="color: #60a5fa">${p.count.toLocaleString()}</span></div>`), r.includes("mean") && x.push(`<div>μ: <span style="color: #60a5fa">${p.mean.toPrecision(4)}</span></div>`), r.includes("min") && x.push(`<div>Min: <span style="color: #60a5fa">${p.min.toPrecision(4)}</span></div>`), r.includes("max") && x.push(`<div>Max: <span style="color: #60a5fa">${p.max.toPrecision(4)}</span></div>`), r.includes("std") && x.push(`<div>σ: <span style="color: #60a5fa">${p.std.toPrecision(4)}</span></div>`), r.includes("range") && x.push(`<div>Range: <span style="color: #60a5fa">${p.range.toPrecision(4)}</span></div>`), u.innerHTML = x.join("");
|
|
261
1444
|
}
|
|
262
|
-
function
|
|
263
|
-
const u =
|
|
264
|
-
let
|
|
265
|
-
for (const
|
|
266
|
-
|
|
267
|
-
const
|
|
268
|
-
let
|
|
269
|
-
for (const
|
|
270
|
-
|
|
271
|
-
const b = Math.sqrt(
|
|
1445
|
+
function l(c) {
|
|
1446
|
+
const u = c.length;
|
|
1447
|
+
let h = 0, v = 1 / 0, d = -1 / 0;
|
|
1448
|
+
for (const m of c)
|
|
1449
|
+
h += m, m < v && (v = m), m > d && (d = m);
|
|
1450
|
+
const p = h / u;
|
|
1451
|
+
let x = 0;
|
|
1452
|
+
for (const m of c)
|
|
1453
|
+
x += (m - p) ** 2;
|
|
1454
|
+
const b = Math.sqrt(x / u);
|
|
272
1455
|
return {
|
|
273
1456
|
count: u,
|
|
274
|
-
mean:
|
|
275
|
-
min:
|
|
276
|
-
max:
|
|
1457
|
+
mean: p,
|
|
1458
|
+
min: v,
|
|
1459
|
+
max: d,
|
|
277
1460
|
std: b,
|
|
278
|
-
range:
|
|
1461
|
+
range: d - v
|
|
279
1462
|
};
|
|
280
1463
|
}
|
|
281
1464
|
}
|
|
282
|
-
),
|
|
1465
|
+
), pr = {
|
|
283
1466
|
name: "watermark",
|
|
284
1467
|
version: "1.0.0",
|
|
285
1468
|
description: "Adds a customizable watermark to the chart",
|
|
286
1469
|
provides: ["visualization"],
|
|
287
1470
|
tags: ["watermark", "branding", "overlay"]
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
(
|
|
291
|
-
if (!(
|
|
1471
|
+
}, mr = G(
|
|
1472
|
+
pr,
|
|
1473
|
+
(t) => {
|
|
1474
|
+
if (!(t != null && t.text))
|
|
292
1475
|
throw new Error("WatermarkPlugin requires 'text' configuration");
|
|
293
1476
|
const {
|
|
294
1477
|
text: e,
|
|
295
|
-
fontSize:
|
|
296
|
-
fontFamily:
|
|
297
|
-
color:
|
|
298
|
-
position:
|
|
299
|
-
rotation:
|
|
300
|
-
} =
|
|
1478
|
+
fontSize: r = 48,
|
|
1479
|
+
fontFamily: n = "system-ui, sans-serif",
|
|
1480
|
+
color: a = "rgba(128, 128, 128, 0.15)",
|
|
1481
|
+
position: o = "center",
|
|
1482
|
+
rotation: i = o === "center" ? -30 : 0
|
|
1483
|
+
} = t;
|
|
301
1484
|
return {
|
|
302
|
-
onRenderOverlay(
|
|
303
|
-
const
|
|
304
|
-
if (!
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
let u,
|
|
309
|
-
|
|
1485
|
+
onRenderOverlay(s) {
|
|
1486
|
+
const l = s.render.ctx2d;
|
|
1487
|
+
if (!l) return;
|
|
1488
|
+
s.render.canvasSize;
|
|
1489
|
+
const c = s.render.plotArea;
|
|
1490
|
+
l.save(), l.font = `${r}px ${n}`, l.fillStyle = a, l.textAlign = "center", l.textBaseline = "middle";
|
|
1491
|
+
let u, h;
|
|
1492
|
+
o === "center" ? (u = c.x + c.width / 2, h = c.y + c.height / 2) : o === "bottom-right" ? (u = c.x + c.width - r, h = c.y + c.height - r / 2) : (u = c.x + r, h = c.y + c.height - r / 2), l.translate(u, h), l.rotate(i * Math.PI / 180), l.fillText(e, 0, 0), l.restore();
|
|
1493
|
+
},
|
|
1494
|
+
onExportSVG(s) {
|
|
1495
|
+
var l;
|
|
1496
|
+
!s.builder || ((l = s.exportContext) == null ? void 0 : l.options.includeOverlays) === !1 || je(s, e, {
|
|
1497
|
+
opacity: 0.15,
|
|
1498
|
+
rotation: i,
|
|
1499
|
+
color: a
|
|
1500
|
+
});
|
|
310
1501
|
}
|
|
311
1502
|
};
|
|
312
1503
|
}
|
|
313
|
-
),
|
|
1504
|
+
), yr = {
|
|
314
1505
|
name: "grid-highlight",
|
|
315
1506
|
version: "1.0.0",
|
|
316
1507
|
description: "Highlights specific regions of the chart grid",
|
|
317
1508
|
provides: ["visualization"],
|
|
318
1509
|
tags: ["grid", "highlight", "regions"]
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
(
|
|
322
|
-
const { xIntervals: e = [], yIntervals:
|
|
1510
|
+
}, vr = G(
|
|
1511
|
+
yr,
|
|
1512
|
+
(t = {}) => {
|
|
1513
|
+
const { xIntervals: e = [], yIntervals: r = [], opacity: n = 0.1 } = t;
|
|
323
1514
|
return {
|
|
324
|
-
onRenderOverlay(
|
|
325
|
-
const
|
|
326
|
-
if (!
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
for (const
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
Math.min(
|
|
333
|
-
|
|
334
|
-
Math.abs(u -
|
|
335
|
-
|
|
1515
|
+
onRenderOverlay(a, o) {
|
|
1516
|
+
const i = a.render.ctx2d;
|
|
1517
|
+
if (!i) return;
|
|
1518
|
+
const s = a.render.plotArea;
|
|
1519
|
+
a.data.getViewBounds(), i.save(), i.beginPath(), i.rect(s.x, s.y, s.width, s.height), i.clip(), i.globalAlpha = n;
|
|
1520
|
+
for (const l of e) {
|
|
1521
|
+
const c = a.coords.dataToPixelX(l.start), u = a.coords.dataToPixelX(l.end);
|
|
1522
|
+
i.fillStyle = l.color, i.fillRect(
|
|
1523
|
+
Math.min(c, u),
|
|
1524
|
+
s.y,
|
|
1525
|
+
Math.abs(u - c),
|
|
1526
|
+
s.height
|
|
336
1527
|
);
|
|
337
1528
|
}
|
|
338
|
-
for (const
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
Math.min(
|
|
343
|
-
|
|
344
|
-
Math.abs(u -
|
|
1529
|
+
for (const l of r) {
|
|
1530
|
+
const c = a.coords.dataToPixelY(l.start), u = a.coords.dataToPixelY(l.end);
|
|
1531
|
+
i.fillStyle = l.color, i.fillRect(
|
|
1532
|
+
s.x,
|
|
1533
|
+
Math.min(c, u),
|
|
1534
|
+
s.width,
|
|
1535
|
+
Math.abs(u - c)
|
|
345
1536
|
);
|
|
346
1537
|
}
|
|
347
|
-
|
|
1538
|
+
i.restore();
|
|
1539
|
+
},
|
|
1540
|
+
onExportSVG(a) {
|
|
1541
|
+
var i;
|
|
1542
|
+
if (!a.builder || ((i = a.exportContext) == null ? void 0 : i.options.includeOverlays) === !1) return;
|
|
1543
|
+
const o = [];
|
|
1544
|
+
for (const s of e)
|
|
1545
|
+
o.push({ axis: "x", min: s.start, max: s.end, color: s.color });
|
|
1546
|
+
for (const s of r)
|
|
1547
|
+
o.push({ axis: "y", min: s.start, max: s.end, color: s.color });
|
|
1548
|
+
Je(a, o);
|
|
348
1549
|
}
|
|
349
1550
|
};
|
|
350
1551
|
}
|
|
351
|
-
),
|
|
1552
|
+
), br = {
|
|
352
1553
|
name: "data-logger",
|
|
353
1554
|
version: "1.0.0",
|
|
354
1555
|
description: "Logs chart events for debugging and analysis",
|
|
355
1556
|
provides: ["analysis"],
|
|
356
1557
|
tags: ["debug", "logging", "events"]
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
(
|
|
1558
|
+
}, xr = G(
|
|
1559
|
+
br,
|
|
1560
|
+
(t = {}) => {
|
|
360
1561
|
const {
|
|
361
1562
|
logDataUpdates: e = !0,
|
|
362
|
-
logViewChanges:
|
|
363
|
-
logInteractions:
|
|
364
|
-
maxEntries:
|
|
365
|
-
} =
|
|
366
|
-
function
|
|
367
|
-
|
|
1563
|
+
logViewChanges: r = !0,
|
|
1564
|
+
logInteractions: n = !1,
|
|
1565
|
+
maxEntries: a = 100
|
|
1566
|
+
} = t, o = [];
|
|
1567
|
+
function i(s, l) {
|
|
1568
|
+
o.push({
|
|
368
1569
|
timestamp: Date.now(),
|
|
369
|
-
type:
|
|
370
|
-
data:
|
|
371
|
-
}),
|
|
1570
|
+
type: s,
|
|
1571
|
+
data: l
|
|
1572
|
+
}), o.length > a && o.shift();
|
|
372
1573
|
}
|
|
373
1574
|
return {
|
|
374
|
-
onInit(
|
|
375
|
-
|
|
1575
|
+
onInit(s) {
|
|
1576
|
+
s.log.info("Data logger initialized");
|
|
376
1577
|
},
|
|
377
|
-
onDataUpdate(
|
|
378
|
-
e && (
|
|
379
|
-
seriesId:
|
|
380
|
-
mode:
|
|
381
|
-
pointCount:
|
|
382
|
-
}),
|
|
1578
|
+
onDataUpdate(s, l) {
|
|
1579
|
+
e && (i("dataUpdate", {
|
|
1580
|
+
seriesId: l.seriesId,
|
|
1581
|
+
mode: l.mode,
|
|
1582
|
+
pointCount: l.pointCount
|
|
1583
|
+
}), s.log.debug(`Data update: ${l.seriesId} (${l.mode}, ${l.pointCount} points)`));
|
|
383
1584
|
},
|
|
384
|
-
onViewChange(
|
|
385
|
-
|
|
386
|
-
trigger:
|
|
387
|
-
bounds:
|
|
388
|
-
}),
|
|
1585
|
+
onViewChange(s, l) {
|
|
1586
|
+
r && (i("viewChange", {
|
|
1587
|
+
trigger: l.trigger,
|
|
1588
|
+
bounds: l.current
|
|
1589
|
+
}), s.log.debug(`View change: ${l.trigger}`));
|
|
389
1590
|
},
|
|
390
|
-
onInteraction(
|
|
391
|
-
|
|
392
|
-
type:
|
|
393
|
-
pixelX:
|
|
394
|
-
pixelY:
|
|
395
|
-
inPlotArea:
|
|
1591
|
+
onInteraction(s, l) {
|
|
1592
|
+
n && i("interaction", {
|
|
1593
|
+
type: l.type,
|
|
1594
|
+
pixelX: l.pixelX,
|
|
1595
|
+
pixelY: l.pixelY,
|
|
1596
|
+
inPlotArea: l.inPlotArea
|
|
396
1597
|
});
|
|
397
1598
|
},
|
|
398
|
-
onSerialize(
|
|
399
|
-
return { entries:
|
|
1599
|
+
onSerialize(s) {
|
|
1600
|
+
return { entries: o };
|
|
400
1601
|
},
|
|
401
|
-
onDeserialize(
|
|
402
|
-
const
|
|
403
|
-
|
|
1602
|
+
onDeserialize(s, l) {
|
|
1603
|
+
const c = l;
|
|
1604
|
+
c != null && c.entries && (o.length = 0, o.push(...c.entries));
|
|
404
1605
|
},
|
|
405
1606
|
api: {
|
|
406
1607
|
getEntries() {
|
|
407
|
-
return [...
|
|
1608
|
+
return [...o];
|
|
408
1609
|
},
|
|
409
1610
|
clear() {
|
|
410
|
-
|
|
1611
|
+
o.length = 0;
|
|
411
1612
|
},
|
|
412
1613
|
export() {
|
|
413
|
-
return JSON.stringify(
|
|
1614
|
+
return JSON.stringify(o, null, 2);
|
|
414
1615
|
}
|
|
415
1616
|
}
|
|
416
1617
|
};
|
|
417
1618
|
}
|
|
418
|
-
),
|
|
1619
|
+
), Pr = {
|
|
419
1620
|
name: "direction-indicator",
|
|
420
1621
|
version: "1.0.0",
|
|
421
1622
|
description: "Shows an arrow indicating the direction and trend of streaming data",
|
|
422
1623
|
provides: ["visualization", "analysis"],
|
|
423
1624
|
tags: ["streaming", "direction", "trend", "arrow"]
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
(
|
|
1625
|
+
}, wr = G(
|
|
1626
|
+
Pr,
|
|
1627
|
+
(t = {}) => {
|
|
427
1628
|
const {
|
|
428
1629
|
seriesId: e,
|
|
429
|
-
sampleSize:
|
|
430
|
-
color:
|
|
431
|
-
size:
|
|
432
|
-
minVelocity:
|
|
433
|
-
historySize:
|
|
434
|
-
idleTimeout:
|
|
435
|
-
} =
|
|
436
|
-
let
|
|
437
|
-
const
|
|
438
|
-
let b =
|
|
1630
|
+
sampleSize: r = 20,
|
|
1631
|
+
color: n,
|
|
1632
|
+
size: a = 40,
|
|
1633
|
+
minVelocity: o = 0.01,
|
|
1634
|
+
historySize: i = 20,
|
|
1635
|
+
idleTimeout: s
|
|
1636
|
+
} = t;
|
|
1637
|
+
let l, c = null, u = null, h = null, v = null;
|
|
1638
|
+
const d = [], p = [], x = [];
|
|
1639
|
+
let b = i, m = null, y = Date.now(), g = -1 / 0, f = -1 / 0, A = s;
|
|
439
1640
|
return {
|
|
440
|
-
onInit(
|
|
441
|
-
|
|
442
|
-
const
|
|
1641
|
+
onInit(P) {
|
|
1642
|
+
l = "direction-indicator-overlay";
|
|
1643
|
+
const C = P.ui.createOverlay(l, {
|
|
443
1644
|
zIndex: 600,
|
|
444
1645
|
position: { top: "0", left: "0", right: "0", bottom: "0" },
|
|
445
1646
|
pointerEvents: !1
|
|
446
1647
|
});
|
|
447
|
-
if (
|
|
448
|
-
|
|
1648
|
+
if (c = document.createElement("canvas"), c.style.cssText = "width: 100%; height: 100%; pointer-events: none;", C.appendChild(c), u = c.getContext("2d"), w(P), e)
|
|
1649
|
+
v = e;
|
|
449
1650
|
else {
|
|
450
|
-
const
|
|
451
|
-
|
|
1651
|
+
const M = P.data.getAllSeries();
|
|
1652
|
+
M.length > 0 && (v = M[0].getId());
|
|
452
1653
|
}
|
|
453
1654
|
},
|
|
454
|
-
onDestroy(
|
|
455
|
-
|
|
1655
|
+
onDestroy(P) {
|
|
1656
|
+
P.ui.removeOverlay(l), m && clearTimeout(m), c = null, u = null, h = null;
|
|
456
1657
|
},
|
|
457
|
-
onResize(
|
|
458
|
-
|
|
1658
|
+
onResize(P) {
|
|
1659
|
+
w(P);
|
|
459
1660
|
},
|
|
460
|
-
onAfterRender(
|
|
461
|
-
if (
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
},
|
|
1661
|
+
onAfterRender(P) {
|
|
1662
|
+
if (F(P), T(P), A) {
|
|
1663
|
+
m && clearTimeout(m);
|
|
1664
|
+
const C = Date.now() - y;
|
|
1665
|
+
C < A && (m = setTimeout(() => {
|
|
1666
|
+
P.requestRender();
|
|
1667
|
+
}, A - C + 10));
|
|
467
1668
|
}
|
|
468
1669
|
},
|
|
469
|
-
onConfigChange(
|
|
470
|
-
if (
|
|
471
|
-
for (b =
|
|
472
|
-
for (;
|
|
473
|
-
for (;
|
|
1670
|
+
onConfigChange(P, C) {
|
|
1671
|
+
if (C.historySize !== void 0) {
|
|
1672
|
+
for (b = C.historySize; d.length > b; ) d.shift();
|
|
1673
|
+
for (; p.length > b; ) p.shift();
|
|
1674
|
+
for (; x.length > b; ) x.shift();
|
|
474
1675
|
}
|
|
475
|
-
|
|
1676
|
+
C.idleTimeout !== void 0 && (A = C.idleTimeout);
|
|
476
1677
|
}
|
|
477
1678
|
};
|
|
478
|
-
function
|
|
479
|
-
if (!
|
|
480
|
-
const
|
|
481
|
-
|
|
1679
|
+
function w(P) {
|
|
1680
|
+
if (!c || !u) return;
|
|
1681
|
+
const C = P.render.canvasSize, M = P.render.pixelRatio;
|
|
1682
|
+
c.width = C.width * M, c.height = C.height * M, u.setTransform(1, 0, 0, 1, 0, 0), u.scale(M, M);
|
|
482
1683
|
}
|
|
483
|
-
function
|
|
484
|
-
if (!
|
|
485
|
-
const
|
|
486
|
-
if (!
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
489
|
-
const
|
|
490
|
-
(
|
|
491
|
-
const
|
|
492
|
-
let k = 0,
|
|
493
|
-
for (let
|
|
494
|
-
const
|
|
495
|
-
k +=
|
|
1684
|
+
function F(P) {
|
|
1685
|
+
if (!v || !P.data.getSeries(v)) return;
|
|
1686
|
+
const M = P.data.getSeriesData(v);
|
|
1687
|
+
if (!M || !M.x || !M.y) return;
|
|
1688
|
+
const L = M.x.length;
|
|
1689
|
+
if (L < 2) return;
|
|
1690
|
+
const E = M.x[L - 1], _ = M.y[L - 1];
|
|
1691
|
+
(E !== g || _ !== f) && (g = E, f = _, y = Date.now());
|
|
1692
|
+
const R = Math.min(r, L), X = L - R;
|
|
1693
|
+
let k = 0, Y = 0, H = 0, re = 0, ne = 0, ae = 0;
|
|
1694
|
+
for (let O = X; O < L; O++) {
|
|
1695
|
+
const V = O - X, We = M.x[O], Ge = M.y[O], oe = P.coords.dataToPixelX(We), ie = P.coords.dataToPixelY(Ge);
|
|
1696
|
+
k += V, Y += oe, H += ie, re += V * oe, ne += V * ie, ae += V * V;
|
|
496
1697
|
}
|
|
497
|
-
const
|
|
498
|
-
if (Math.abs(
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
|
|
1698
|
+
const z = k / R, Ee = Y / R, Re = H / R, J = ae - R * z * z;
|
|
1699
|
+
if (Math.abs(J) < 1e-10) return;
|
|
1700
|
+
const Q = (re - R * z * Ee) / J, Z = (ne - R * z * Re) / J, Ie = Math.atan2(Z, Q), Le = P.coords.dataToPixelX(E), ke = P.coords.dataToPixelY(_);
|
|
1701
|
+
d.push(Le), p.push(ke), d.length > b && (d.shift(), p.shift()), x.push(Ie), x.length > b && x.shift();
|
|
1702
|
+
const Be = S(d), _e = S(p), Ye = D(x), Xe = Math.sqrt(Q * Q + Z * Z);
|
|
1703
|
+
h = { angle: Ye, magnitude: Xe, lastX: E, lastY: _, smoothX: Be, smoothY: _e };
|
|
503
1704
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
1705
|
+
function S(P) {
|
|
1706
|
+
return P.length === 0 ? 0 : P.reduce((C, M) => C + M, 0) / P.length;
|
|
506
1707
|
}
|
|
507
|
-
function
|
|
508
|
-
if (
|
|
509
|
-
let
|
|
510
|
-
for (const
|
|
511
|
-
|
|
512
|
-
return Math.atan2(
|
|
1708
|
+
function D(P) {
|
|
1709
|
+
if (P.length === 0) return 0;
|
|
1710
|
+
let C = 0, M = 0;
|
|
1711
|
+
for (const L of P)
|
|
1712
|
+
C += Math.cos(L), M += Math.sin(L);
|
|
1713
|
+
return Math.atan2(M / P.length, C / P.length);
|
|
513
1714
|
}
|
|
514
|
-
function
|
|
515
|
-
if (!u || !
|
|
516
|
-
const { width:
|
|
517
|
-
if (u.clearRect(0, 0,
|
|
518
|
-
const
|
|
519
|
-
u.save(),
|
|
1715
|
+
function T(P) {
|
|
1716
|
+
if (!u || !c || !h) return;
|
|
1717
|
+
const { width: C, height: M } = P.render.canvasSize;
|
|
1718
|
+
if (u.clearRect(0, 0, C, M), A !== void 0 && Date.now() - y > A || h.magnitude < o) return;
|
|
1719
|
+
const L = h.smoothX, E = h.smoothY, _ = n || "#FF9800";
|
|
1720
|
+
u.save(), I(u, L, E, h.angle, a, _), u.restore();
|
|
520
1721
|
}
|
|
521
|
-
function
|
|
522
|
-
const
|
|
523
|
-
|
|
1722
|
+
function I(P, C, M, L, E, _) {
|
|
1723
|
+
const R = E * 0.6, X = E * 0.4;
|
|
1724
|
+
P.save(), P.translate(C, M), P.rotate(L), P.fillStyle = _, P.beginPath(), P.moveTo(R / 2, 0), P.lineTo(-R / 2, -X / 2), P.lineTo(-R / 2, X / 2), P.closePath(), P.fill(), P.restore();
|
|
524
1725
|
}
|
|
525
1726
|
}
|
|
526
|
-
),
|
|
527
|
-
Crosshair:
|
|
528
|
-
Statistics:
|
|
529
|
-
Watermark:
|
|
530
|
-
GridHighlight:
|
|
531
|
-
DataLogger:
|
|
532
|
-
DirectionIndicator:
|
|
533
|
-
},
|
|
1727
|
+
), qr = {
|
|
1728
|
+
Crosshair: fr,
|
|
1729
|
+
Statistics: gr,
|
|
1730
|
+
Watermark: mr,
|
|
1731
|
+
GridHighlight: vr,
|
|
1732
|
+
DataLogger: xr,
|
|
1733
|
+
DirectionIndicator: wr
|
|
1734
|
+
}, Ar = {
|
|
534
1735
|
name: "velo-plot-drag-edit",
|
|
535
1736
|
version: "1.0.0",
|
|
536
1737
|
description: "Interactive drag & drop editing of data points",
|
|
537
1738
|
provides: ["drag-edit", "point-editing"],
|
|
538
1739
|
tags: ["interaction", "editing", "ux"]
|
|
539
|
-
},
|
|
1740
|
+
}, Sr = {
|
|
540
1741
|
enabled: !0,
|
|
541
1742
|
constraint: "both",
|
|
542
1743
|
snapToGrid: !1,
|
|
@@ -561,991 +1762,466 @@ const we = {
|
|
|
561
1762
|
opacity: 0.5
|
|
562
1763
|
}
|
|
563
1764
|
};
|
|
564
|
-
function
|
|
565
|
-
const e = { ...
|
|
566
|
-
let
|
|
567
|
-
function
|
|
568
|
-
if (!
|
|
569
|
-
const
|
|
570
|
-
return !
|
|
571
|
-
seriesId:
|
|
572
|
-
index:
|
|
573
|
-
originalX:
|
|
574
|
-
originalY:
|
|
575
|
-
currentX:
|
|
576
|
-
currentY:
|
|
1765
|
+
function Kr(t = {}) {
|
|
1766
|
+
const e = { ...Sr, ...t };
|
|
1767
|
+
let r = null, n = !1, a = null, o = 0, i = 0, s = !1;
|
|
1768
|
+
function l(m, y) {
|
|
1769
|
+
if (!r) return null;
|
|
1770
|
+
const g = r.coords.pickPoint(m, y, e.hitRadius);
|
|
1771
|
+
return !g || e.editableSeries.length > 0 && !e.editableSeries.includes(g.seriesId) ? null : {
|
|
1772
|
+
seriesId: g.seriesId,
|
|
1773
|
+
index: g.index,
|
|
1774
|
+
originalX: g.x,
|
|
1775
|
+
originalY: g.y,
|
|
1776
|
+
currentX: g.x,
|
|
1777
|
+
currentY: g.y
|
|
577
1778
|
};
|
|
578
1779
|
}
|
|
579
|
-
function
|
|
580
|
-
return
|
|
581
|
-
x:
|
|
582
|
-
y:
|
|
1780
|
+
function c(m, y) {
|
|
1781
|
+
return r ? {
|
|
1782
|
+
x: r.coords.pixelToDataX(m),
|
|
1783
|
+
y: r.coords.pixelToDataY(y)
|
|
583
1784
|
} : { x: 0, y: 0 };
|
|
584
1785
|
}
|
|
585
|
-
function u(
|
|
586
|
-
return Math.round(
|
|
1786
|
+
function u(m, y) {
|
|
1787
|
+
return Math.round(m / y) * y;
|
|
587
1788
|
}
|
|
588
|
-
function
|
|
589
|
-
if (!
|
|
590
|
-
switch (
|
|
1789
|
+
function h(m, y, g) {
|
|
1790
|
+
if (!a) return { x: m, y };
|
|
1791
|
+
switch (g) {
|
|
591
1792
|
case "x":
|
|
592
|
-
return { x:
|
|
1793
|
+
return { x: m, y: a.originalY };
|
|
593
1794
|
case "y":
|
|
594
|
-
return { x:
|
|
1795
|
+
return { x: a.originalX, y };
|
|
595
1796
|
case "none":
|
|
596
|
-
return { x:
|
|
1797
|
+
return { x: a.originalX, y: a.originalY };
|
|
597
1798
|
default:
|
|
598
|
-
return { x:
|
|
1799
|
+
return { x: m, y };
|
|
599
1800
|
}
|
|
600
1801
|
}
|
|
601
|
-
function
|
|
602
|
-
let
|
|
603
|
-
if (e.snapToGrid && (
|
|
604
|
-
const
|
|
605
|
-
if (typeof
|
|
606
|
-
return { x:
|
|
607
|
-
if (!
|
|
608
|
-
return { x:
|
|
609
|
-
|
|
1802
|
+
function v(m, y) {
|
|
1803
|
+
let g = m, f = y;
|
|
1804
|
+
if (e.snapToGrid && (g = u(m, e.snapIntervalX), f = u(y, e.snapIntervalY)), a && e.validator) {
|
|
1805
|
+
const A = { ...a, currentX: g, currentY: f }, w = e.validator(A);
|
|
1806
|
+
if (typeof w == "boolean")
|
|
1807
|
+
return { x: g, y: f, valid: w };
|
|
1808
|
+
if (!w.valid)
|
|
1809
|
+
return { x: g, y: f, valid: !1 };
|
|
1810
|
+
w.snapX !== void 0 && (g = w.snapX), w.snapY !== void 0 && (f = w.snapY);
|
|
610
1811
|
}
|
|
611
|
-
return { x:
|
|
1812
|
+
return { x: g, y: f, valid: !0 };
|
|
612
1813
|
}
|
|
613
|
-
function
|
|
614
|
-
var
|
|
615
|
-
if (!
|
|
616
|
-
const
|
|
617
|
-
if (!
|
|
618
|
-
const
|
|
619
|
-
!
|
|
1814
|
+
function d(m, y, g, f) {
|
|
1815
|
+
var F, S, D;
|
|
1816
|
+
if (!r) return;
|
|
1817
|
+
const A = (S = (F = r.chart).getSeries) == null ? void 0 : S.call(F, m);
|
|
1818
|
+
if (!A) return;
|
|
1819
|
+
const w = A.getData();
|
|
1820
|
+
!w || !w.x || !w.y || (w.x[y] = g, w.y[y] = f, (D = A.invalidateBuffers) == null || D.call(A), r.requestRender());
|
|
620
1821
|
}
|
|
621
|
-
function
|
|
622
|
-
return
|
|
623
|
-
seriesId:
|
|
624
|
-
index:
|
|
625
|
-
oldX:
|
|
626
|
-
oldY:
|
|
627
|
-
newX:
|
|
628
|
-
newY:
|
|
629
|
-
deltaX:
|
|
630
|
-
deltaY:
|
|
1822
|
+
function p() {
|
|
1823
|
+
return a ? {
|
|
1824
|
+
seriesId: a.seriesId,
|
|
1825
|
+
index: a.index,
|
|
1826
|
+
oldX: a.originalX,
|
|
1827
|
+
oldY: a.originalY,
|
|
1828
|
+
newX: a.currentX,
|
|
1829
|
+
newY: a.currentY,
|
|
1830
|
+
deltaX: a.currentX - a.originalX,
|
|
1831
|
+
deltaY: a.currentY - a.originalY
|
|
631
1832
|
} : null;
|
|
632
1833
|
}
|
|
633
|
-
function
|
|
634
|
-
if (!
|
|
635
|
-
const { render: y, coords:
|
|
636
|
-
if (!
|
|
637
|
-
|
|
638
|
-
const
|
|
639
|
-
|
|
1834
|
+
function x(m) {
|
|
1835
|
+
if (!n || !a || !e.showPreview) return;
|
|
1836
|
+
const { render: y, coords: g } = m, { ctx2d: f } = y;
|
|
1837
|
+
if (!f) return;
|
|
1838
|
+
f.save();
|
|
1839
|
+
const A = g.dataToPixelX(a.originalX), w = g.dataToPixelY(a.originalY), F = g.dataToPixelX(a.currentX), S = g.dataToPixelY(a.currentY);
|
|
1840
|
+
f.strokeStyle = e.previewStyle.color || "#ffffff", f.lineWidth = e.previewStyle.width || 2, f.globalAlpha = e.previewStyle.opacity || 0.5, f.setLineDash(e.previewStyle.dash || [5, 5]), f.beginPath(), f.moveTo(A, w), f.lineTo(F, S), f.stroke(), f.globalAlpha = 1, f.fillStyle = e.highlightColor, f.setLineDash([]), f.beginPath(), f.arc(F, S, 6, 0, Math.PI * 2), f.fill(), f.strokeStyle = "#000000", f.lineWidth = 1, f.stroke(), f.restore();
|
|
640
1841
|
}
|
|
641
1842
|
const b = {
|
|
642
1843
|
enable() {
|
|
643
1844
|
e.enabled = !0;
|
|
644
1845
|
},
|
|
645
1846
|
disable() {
|
|
646
|
-
e.enabled = !1,
|
|
1847
|
+
e.enabled = !1, n && (a = null, n = !1, s = !1, r == null || r.requestRender());
|
|
647
1848
|
},
|
|
648
1849
|
isEnabled() {
|
|
649
1850
|
return e.enabled;
|
|
650
1851
|
},
|
|
651
|
-
setEditableSeries(
|
|
652
|
-
e.editableSeries =
|
|
1852
|
+
setEditableSeries(m) {
|
|
1853
|
+
e.editableSeries = m;
|
|
653
1854
|
},
|
|
654
1855
|
getDraggedPoint() {
|
|
655
|
-
return
|
|
1856
|
+
return a;
|
|
656
1857
|
},
|
|
657
1858
|
cancelDrag() {
|
|
658
|
-
|
|
1859
|
+
n && a && (a = null, n = !1, s = !1, r == null || r.requestRender());
|
|
659
1860
|
},
|
|
660
|
-
updateConfig(
|
|
661
|
-
Object.assign(e,
|
|
1861
|
+
updateConfig(m) {
|
|
1862
|
+
Object.assign(e, m);
|
|
662
1863
|
}
|
|
663
1864
|
};
|
|
664
1865
|
return {
|
|
665
|
-
manifest:
|
|
666
|
-
onInit(
|
|
667
|
-
|
|
1866
|
+
manifest: Ar,
|
|
1867
|
+
onInit(m) {
|
|
1868
|
+
r = m, r.chart.dragEdit = b;
|
|
668
1869
|
},
|
|
669
|
-
onDestroy(
|
|
670
|
-
delete
|
|
1870
|
+
onDestroy(m) {
|
|
1871
|
+
delete m.chart.dragEdit, r = null;
|
|
671
1872
|
},
|
|
672
|
-
onInteraction(
|
|
1873
|
+
onInteraction(m, y) {
|
|
673
1874
|
if (e.enabled) {
|
|
674
1875
|
if (y.type === "mousedown") {
|
|
675
|
-
const
|
|
676
|
-
|
|
1876
|
+
const g = l(y.pixelX, y.pixelY);
|
|
1877
|
+
g && (a = g, o = y.pixelX, i = y.pixelY, s = !1, n = !1, y.preventDefault());
|
|
677
1878
|
} else if (y.type === "mousemove") {
|
|
678
|
-
if (!
|
|
679
|
-
if (!
|
|
680
|
-
const
|
|
681
|
-
if (Math.sqrt(
|
|
682
|
-
|
|
683
|
-
const
|
|
684
|
-
|
|
1879
|
+
if (!a) return;
|
|
1880
|
+
if (!n) {
|
|
1881
|
+
const S = y.pixelX - o, D = y.pixelY - i;
|
|
1882
|
+
if (Math.sqrt(S * S + D * D) > e.dragThreshold) {
|
|
1883
|
+
n = !0, s = !0;
|
|
1884
|
+
const I = p();
|
|
1885
|
+
I && e.onDragStart(I);
|
|
685
1886
|
} else
|
|
686
1887
|
return;
|
|
687
1888
|
}
|
|
688
|
-
|
|
689
|
-
let { x:
|
|
690
|
-
({ x:
|
|
691
|
-
const { x:
|
|
692
|
-
if (
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
|
|
1889
|
+
n && y.preventDefault();
|
|
1890
|
+
let { x: g, y: f } = c(y.pixelX, y.pixelY);
|
|
1891
|
+
({ x: g, y: f } = h(g, f, e.constraint));
|
|
1892
|
+
const { x: A, y: w, valid: F } = v(g, f);
|
|
1893
|
+
if (F) {
|
|
1894
|
+
a.currentX = A, a.currentY = w;
|
|
1895
|
+
const S = p();
|
|
1896
|
+
S && e.onDrag(S), r == null || r.requestRender();
|
|
696
1897
|
}
|
|
697
1898
|
} else if (y.type === "mouseup") {
|
|
698
|
-
if (!
|
|
699
|
-
if (
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
1899
|
+
if (!a) return;
|
|
1900
|
+
if (n && s) {
|
|
1901
|
+
d(
|
|
1902
|
+
a.seriesId,
|
|
1903
|
+
a.index,
|
|
1904
|
+
a.currentX,
|
|
1905
|
+
a.currentY
|
|
705
1906
|
);
|
|
706
|
-
const
|
|
707
|
-
|
|
1907
|
+
const g = p();
|
|
1908
|
+
g && e.onDragEnd(g), y.preventDefault();
|
|
708
1909
|
}
|
|
709
|
-
|
|
1910
|
+
a = null, n = !1, s = !1, r == null || r.requestRender();
|
|
710
1911
|
}
|
|
711
1912
|
}
|
|
712
1913
|
},
|
|
713
|
-
onRenderOverlay(
|
|
714
|
-
|
|
1914
|
+
onRenderOverlay(m) {
|
|
1915
|
+
x(m);
|
|
715
1916
|
},
|
|
716
1917
|
api: b
|
|
717
1918
|
};
|
|
718
1919
|
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
uniform vec2 uResolution;
|
|
722
|
-
void main() {
|
|
723
|
-
vec2 clip = (aPosition / uResolution) * 2.0 - 1.0;
|
|
724
|
-
gl_Position = vec4(clip.x, -clip.y, 0.0, 1.0);
|
|
725
|
-
}
|
|
726
|
-
`, Ye = `
|
|
727
|
-
precision mediump float;
|
|
728
|
-
uniform vec4 uColor;
|
|
729
|
-
void main() {
|
|
730
|
-
gl_FragColor = uColor;
|
|
731
|
-
}
|
|
732
|
-
`;
|
|
733
|
-
function ne(n, e, t) {
|
|
734
|
-
const o = n.createShader(e);
|
|
735
|
-
if (!o) throw new Error("createShader failed");
|
|
736
|
-
if (n.shaderSource(o, t), n.compileShader(o), !n.getShaderParameter(o, n.COMPILE_STATUS))
|
|
737
|
-
throw new Error(n.getShaderInfoLog(o) ?? "shader compile failed");
|
|
738
|
-
return o;
|
|
739
|
-
}
|
|
740
|
-
function Be(n) {
|
|
741
|
-
const e = ne(n, n.VERTEX_SHADER, Xe), t = ne(n, n.FRAGMENT_SHADER, Ye), o = n.createProgram();
|
|
742
|
-
if (!o) throw new Error("createProgram failed");
|
|
743
|
-
if (n.attachShader(o, e), n.attachShader(o, t), n.linkProgram(o), !n.getProgramParameter(o, n.LINK_STATUS))
|
|
744
|
-
throw new Error(n.getProgramInfoLog(o) ?? "program link failed");
|
|
745
|
-
return n.deleteShader(e), n.deleteShader(t), o;
|
|
746
|
-
}
|
|
747
|
-
function _e(n) {
|
|
748
|
-
const { plotArea: e, xLines: t, yLines: o } = n, r = e.y, a = e.y + e.height, d = e.x, c = e.x + e.width, i = (t.length + o.length) * 2, s = new Float32Array(i * 2);
|
|
749
|
-
let u = 0;
|
|
750
|
-
for (const p of t)
|
|
751
|
-
s[u++] = p, s[u++] = r, s[u++] = p, s[u++] = a;
|
|
752
|
-
for (const p of o)
|
|
753
|
-
s[u++] = d, s[u++] = p, s[u++] = c, s[u++] = p;
|
|
754
|
-
return s;
|
|
755
|
-
}
|
|
756
|
-
class Ge {
|
|
757
|
-
constructor(e) {
|
|
758
|
-
Y(this, "gl");
|
|
759
|
-
Y(this, "program");
|
|
760
|
-
Y(this, "buffer");
|
|
761
|
-
Y(this, "aPosition");
|
|
762
|
-
Y(this, "uResolution");
|
|
763
|
-
Y(this, "uColor");
|
|
764
|
-
const t = e.getContext("webgl", {
|
|
765
|
-
alpha: !0,
|
|
766
|
-
antialias: !1,
|
|
767
|
-
preserveDrawingBuffer: !0
|
|
768
|
-
});
|
|
769
|
-
if (!t) throw new Error("WebGL not available for grid spike");
|
|
770
|
-
this.gl = t, this.program = Be(t), this.aPosition = t.getAttribLocation(this.program, "aPosition"), this.uResolution = t.getUniformLocation(this.program, "uResolution"), this.uColor = t.getUniformLocation(this.program, "uColor");
|
|
771
|
-
const o = t.createBuffer();
|
|
772
|
-
if (!o) throw new Error("createBuffer failed");
|
|
773
|
-
this.buffer = o;
|
|
774
|
-
}
|
|
775
|
-
/** Upload vertices and draw grid lines */
|
|
776
|
-
draw(e) {
|
|
777
|
-
const t = this.gl, o = _e(e), r = o.length / 4;
|
|
778
|
-
t.viewport(0, 0, e.width, e.height), t.clearColor(0.04, 0.05, 0.08, 1), t.clear(t.COLOR_BUFFER_BIT), t.useProgram(this.program), t.bindBuffer(t.ARRAY_BUFFER, this.buffer), t.bufferData(t.ARRAY_BUFFER, o, t.DYNAMIC_DRAW), t.enableVertexAttribArray(this.aPosition), t.vertexAttribPointer(this.aPosition, 2, t.FLOAT, !1, 0, 0), t.uniform2f(this.uResolution, e.width, e.height);
|
|
779
|
-
const a = e.color ?? [0.2, 0.22, 0.3, 0.6];
|
|
780
|
-
return t.uniform4f(this.uColor, a[0], a[1], a[2], a[3]), t.lineWidth(e.lineWidth ?? 1), t.drawArrays(t.LINES, 0, o.length / 2), r;
|
|
781
|
-
}
|
|
782
|
-
destroy() {
|
|
783
|
-
const e = this.gl;
|
|
784
|
-
e.deleteBuffer(this.buffer), e.deleteProgram(this.program);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
function We(n) {
|
|
788
|
-
const e = () => {
|
|
789
|
-
};
|
|
790
|
-
return {
|
|
791
|
-
canvas: n,
|
|
792
|
-
strokeStyle: "",
|
|
793
|
-
fillStyle: "",
|
|
794
|
-
lineWidth: 1,
|
|
795
|
-
font: "",
|
|
796
|
-
textAlign: "left",
|
|
797
|
-
textBaseline: "alphabetic",
|
|
798
|
-
beginPath: e,
|
|
799
|
-
moveTo: e,
|
|
800
|
-
lineTo: e,
|
|
801
|
-
stroke: e,
|
|
802
|
-
fill: e,
|
|
803
|
-
clearRect: e,
|
|
804
|
-
setTransform: e,
|
|
805
|
-
setLineDash: e,
|
|
806
|
-
save: e,
|
|
807
|
-
restore: e,
|
|
808
|
-
translate: e,
|
|
809
|
-
rotate: e,
|
|
810
|
-
fillText: e,
|
|
811
|
-
measureText: (t) => ({ width: t.length * 7 })
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
function ze(n, e) {
|
|
815
|
-
const t = document.createElement("canvas");
|
|
816
|
-
return t.width = n, t.height = e, t.getContext("2d") ?? We(t);
|
|
817
|
-
}
|
|
818
|
-
function oe(n, e) {
|
|
819
|
-
const t = { top: 40, right: 40, bottom: 50, left: 60 };
|
|
820
|
-
return {
|
|
821
|
-
x: t.left,
|
|
822
|
-
y: t.top,
|
|
823
|
-
width: n - t.left - t.right,
|
|
824
|
-
height: e - t.top - t.bottom
|
|
825
|
-
};
|
|
826
|
-
}
|
|
827
|
-
function re(n, e, t, o, r) {
|
|
828
|
-
const a = e.ticks(o).map((c) => te(e.transform(c))), d = t.ticks(r).map((c) => te(t.transform(c)));
|
|
829
|
-
return { xLines: a, yLines: d };
|
|
830
|
-
}
|
|
831
|
-
function ie(n, e) {
|
|
832
|
-
const t = [];
|
|
833
|
-
for (let a = 0; a < e; a++) {
|
|
834
|
-
const d = performance.now();
|
|
835
|
-
n(), t.push((performance.now() - d) * 1e3);
|
|
836
|
-
}
|
|
837
|
-
t.sort((a, d) => a - d);
|
|
838
|
-
const o = t.reduce((a, d) => a + d, 0) / t.length, r = t[Math.floor(t.length * 0.95)] ?? o;
|
|
839
|
-
return { avg: o, p95: r };
|
|
840
|
-
}
|
|
841
|
-
function Ue(n = {}) {
|
|
842
|
-
const e = Math.round((n.width ?? 1920) * (n.dpr ?? 1)), t = Math.round((n.height ?? 1080) * (n.dpr ?? 1)), o = n.xTickCount ?? 24, r = n.yTickCount ?? 16, a = n.frames ?? 120, d = ze(e, t), c = {
|
|
843
|
-
...ee,
|
|
844
|
-
grid: {
|
|
845
|
-
...ee.grid,
|
|
846
|
-
visible: !0,
|
|
847
|
-
showMinor: n.showMinor ?? !0
|
|
848
|
-
}
|
|
849
|
-
}, i = oe(e, t), s = new O(), u = new O();
|
|
850
|
-
s.setDomain(0, 1e6), u.setDomain(-1, 1), s.setRange(i.x, i.x + i.width), u.setRange(i.y + i.height, i.y);
|
|
851
|
-
const p = new Pe(d, c), { avg: S, p95: v } = ie(() => {
|
|
852
|
-
d.clearRect(0, 0, e, t), p.drawGrid(i, s, u, { tickCount: o }, { tickCount: r });
|
|
853
|
-
}, a), { xLines: h, yLines: w } = re(i, s, u, o, r);
|
|
854
|
-
return {
|
|
855
|
-
backend: "canvas2d",
|
|
856
|
-
dpr: n.dpr ?? 1,
|
|
857
|
-
width: e,
|
|
858
|
-
height: t,
|
|
859
|
-
xTicks: o,
|
|
860
|
-
yTicks: r,
|
|
861
|
-
lineSegments: h.length + w.length,
|
|
862
|
-
avgFrameUs: Math.round(S),
|
|
863
|
-
p95FrameUs: Math.round(v),
|
|
864
|
-
frames: a
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
function $e(n = {}) {
|
|
868
|
-
const e = Math.round((n.width ?? 1920) * (n.dpr ?? 1)), t = Math.round((n.height ?? 1080) * (n.dpr ?? 1)), o = n.xTickCount ?? 24, r = n.yTickCount ?? 16, a = n.frames ?? 120, d = document.createElement("canvas");
|
|
869
|
-
d.width = e, d.height = t;
|
|
870
|
-
let c;
|
|
871
|
-
try {
|
|
872
|
-
c = new Ge(d);
|
|
873
|
-
} catch {
|
|
874
|
-
return null;
|
|
875
|
-
}
|
|
876
|
-
const i = oe(e, t), s = new O(), u = new O();
|
|
877
|
-
s.setDomain(0, 1e6), u.setDomain(-1, 1), s.setRange(i.x, i.x + i.width), u.setRange(i.y + i.height, i.y);
|
|
878
|
-
const { xLines: p, yLines: S } = re(i, s, u, o, r), v = { plotArea: i, xLines: p, yLines: S, width: e, height: t };
|
|
879
|
-
let h = 0;
|
|
880
|
-
const { avg: w, p95: b } = ie(() => {
|
|
881
|
-
h = c.draw(v);
|
|
882
|
-
}, a);
|
|
883
|
-
return c.destroy(), {
|
|
884
|
-
backend: "webgl",
|
|
885
|
-
dpr: n.dpr ?? 1,
|
|
886
|
-
width: e,
|
|
887
|
-
height: t,
|
|
888
|
-
xTicks: o,
|
|
889
|
-
yTicks: r,
|
|
890
|
-
lineSegments: h,
|
|
891
|
-
avgFrameUs: Math.round(w),
|
|
892
|
-
p95FrameUs: Math.round(b),
|
|
893
|
-
frames: a
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
function nt(n) {
|
|
897
|
-
const e = (n == null ? void 0 : n.dpr) ?? 2, t = (n == null ? void 0 : n.frames) ?? 120, o = Ue({ dpr: e, frames: t, showMinor: !0 }), r = $e({ dpr: e, frames: t });
|
|
898
|
-
if (!r)
|
|
899
|
-
return {
|
|
900
|
-
canvas2d: o,
|
|
901
|
-
webgl: null,
|
|
902
|
-
gainPercent: 0,
|
|
903
|
-
recommendation: "defer"
|
|
904
|
-
};
|
|
905
|
-
const a = (o.avgFrameUs - r.avgFrameUs) / o.avgFrameUs * 100;
|
|
906
|
-
return {
|
|
907
|
-
canvas2d: o,
|
|
908
|
-
webgl: r,
|
|
909
|
-
gainPercent: Math.round(a * 10) / 10,
|
|
910
|
-
recommendation: a >= 20 ? "implement" : "defer"
|
|
911
|
-
};
|
|
912
|
-
}
|
|
913
|
-
const Oe = "1.17.0", He = "2026-07-05", Ve = "Stage 1 baselines. Headless CI uses effective FPS (render throughput when rAF throttled) via scripts/benchmark-scenario-eval.mjs smoke floors.", qe = 0.1, Ne = 0.95, Ke = {
|
|
914
|
-
"line-1m-pan": {
|
|
915
|
-
minAvgFps: 50,
|
|
916
|
-
maxAvgFrameTimeMs: 20,
|
|
917
|
-
points: 1e6,
|
|
918
|
-
description: "1M line points, continuous pan/zoom simulation"
|
|
919
|
-
},
|
|
920
|
-
"candlestick-500k": {
|
|
921
|
-
minAvgFps: 45,
|
|
922
|
-
maxAvgFrameTimeMs: 22,
|
|
923
|
-
points: 5e5,
|
|
924
|
-
description: "500k OHLC bars with PluginVirtualization"
|
|
925
|
-
},
|
|
926
|
-
"stack-5pane-resize": {
|
|
927
|
-
minAvgFps: 48,
|
|
928
|
-
maxAvgFrameTimeMs: 21,
|
|
929
|
-
description: "5-pane stack divider drag (batched overlay redraw)"
|
|
930
|
-
},
|
|
931
|
-
"line-200k-webgl": {
|
|
932
|
-
minAvgFps: 45,
|
|
933
|
-
description: "200k line WebGL baseline for renderer compare"
|
|
934
|
-
},
|
|
935
|
-
"line-200k-webgpu": {
|
|
936
|
-
minAvgFps: 42,
|
|
937
|
-
description: "200k line WebGPU — target ≥95% of WebGL FPS"
|
|
938
|
-
},
|
|
939
|
-
"boxplot-5k-webgpu": {
|
|
940
|
-
minAvgFps: 50,
|
|
941
|
-
description: "5k boxplot series on WebGPU chart path"
|
|
942
|
-
},
|
|
943
|
-
"grid-canvas2d-dpr2": {
|
|
944
|
-
maxAvgFrameUs: 1200,
|
|
945
|
-
dpr: 2,
|
|
946
|
-
description: "Canvas 2D grid+minor at 1920×1080 @2x"
|
|
947
|
-
},
|
|
948
|
-
"grid-webgl-dpr2": {
|
|
949
|
-
maxAvgFrameUs: 400,
|
|
950
|
-
dpr: 2,
|
|
951
|
-
description: "WebGL grid spike lines only @2x"
|
|
952
|
-
}
|
|
953
|
-
}, N = {
|
|
954
|
-
version: Oe,
|
|
955
|
-
recordedAt: He,
|
|
956
|
-
notes: Ve,
|
|
957
|
-
regressionThreshold: qe,
|
|
958
|
-
webgpuMinFpsRatio: Ne,
|
|
959
|
-
scenarios: Ke
|
|
960
|
-
};
|
|
961
|
-
function at() {
|
|
962
|
-
return N;
|
|
963
|
-
}
|
|
964
|
-
function ot(n, e) {
|
|
965
|
-
const t = N.scenarios[n];
|
|
966
|
-
if (!t)
|
|
967
|
-
return { passed: !0, failures: [] };
|
|
968
|
-
const o = [], r = N.regressionThreshold ?? 0.1;
|
|
969
|
-
if ("avgFps" in e && t.minAvgFps !== void 0) {
|
|
970
|
-
const a = t.minAvgFps * (1 - r);
|
|
971
|
-
e.avgFps < a && o.push(
|
|
972
|
-
`FPS ${e.avgFps} < baseline min ${t.minAvgFps} (allowed ${a.toFixed(1)} with ${r * 100}% slack)`
|
|
973
|
-
);
|
|
974
|
-
}
|
|
975
|
-
if ("avgFrameTime" in e && t.maxAvgFrameTimeMs !== void 0) {
|
|
976
|
-
const a = t.maxAvgFrameTimeMs * (1 + r);
|
|
977
|
-
e.avgFrameTime > a && o.push(
|
|
978
|
-
`Frame time ${e.avgFrameTime}ms > baseline max ${t.maxAvgFrameTimeMs}ms`
|
|
979
|
-
);
|
|
980
|
-
}
|
|
981
|
-
if ("avgFrameUs" in e && t.maxAvgFrameUs !== void 0) {
|
|
982
|
-
const a = t.maxAvgFrameUs * (1 + r);
|
|
983
|
-
e.avgFrameUs > a && o.push(
|
|
984
|
-
`Grid frame ${e.avgFrameUs}µs > baseline max ${t.maxAvgFrameUs}µs`
|
|
985
|
-
);
|
|
986
|
-
}
|
|
987
|
-
return { passed: o.length === 0, failures: o };
|
|
988
|
-
}
|
|
989
|
-
function rt(n, e, t, o = 0.95) {
|
|
990
|
-
if (!t || !e)
|
|
991
|
-
return {
|
|
992
|
-
webgl: n,
|
|
993
|
-
webgpu: e,
|
|
994
|
-
webgpuActive: !1,
|
|
995
|
-
fpsRatio: 0,
|
|
996
|
-
meetsTarget: !1,
|
|
997
|
-
recommendation: "webgpu-unavailable"
|
|
998
|
-
};
|
|
999
|
-
const r = n.avgFps > 0 ? e.avgFps / n.avgFps : 0, a = r >= o;
|
|
1000
|
-
return {
|
|
1001
|
-
webgl: n,
|
|
1002
|
-
webgpu: e,
|
|
1003
|
-
webgpuActive: !0,
|
|
1004
|
-
fpsRatio: r,
|
|
1005
|
-
meetsTarget: a,
|
|
1006
|
-
recommendation: a ? "webgpu-ready" : "webgl-faster"
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
class je {
|
|
1010
|
-
constructor(e) {
|
|
1011
|
-
Y(this, "seed");
|
|
1012
|
-
this.seed = e;
|
|
1013
|
-
}
|
|
1014
|
-
next() {
|
|
1015
|
-
let e = this.seed += 1831565813;
|
|
1016
|
-
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
1017
|
-
}
|
|
1018
|
-
nextRange(e, t) {
|
|
1019
|
-
return e + this.next() * (t - e);
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
function it(n) {
|
|
1023
|
-
const e = {
|
|
1024
|
-
pointCount: 1e3,
|
|
1025
|
-
amplitude: 1,
|
|
1026
|
-
frequency: 1,
|
|
1027
|
-
phase: 0,
|
|
1028
|
-
noise: 0,
|
|
1029
|
-
xStart: 0,
|
|
1030
|
-
xEnd: 10,
|
|
1031
|
-
offset: 0,
|
|
1032
|
-
...n
|
|
1033
|
-
}, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1034
|
-
for (let a = 0; a < e.pointCount; a++) {
|
|
1035
|
-
t[a] = e.xStart + a * r;
|
|
1036
|
-
const d = e.amplitude * Math.sin(2 * Math.PI * e.frequency * t[a] + e.phase), c = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1037
|
-
o[a] = d + c + e.offset;
|
|
1038
|
-
}
|
|
1039
|
-
return { x: t, y: o };
|
|
1040
|
-
}
|
|
1041
|
-
function st(n) {
|
|
1042
|
-
const e = {
|
|
1043
|
-
pointCount: 1e3,
|
|
1044
|
-
amplitude: 1,
|
|
1045
|
-
frequency: 1,
|
|
1046
|
-
phase: 0,
|
|
1047
|
-
noise: 0,
|
|
1048
|
-
xStart: 0,
|
|
1049
|
-
xEnd: 10,
|
|
1050
|
-
offset: 0,
|
|
1051
|
-
...n
|
|
1052
|
-
}, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1053
|
-
for (let a = 0; a < e.pointCount; a++) {
|
|
1054
|
-
t[a] = e.xStart + a * r;
|
|
1055
|
-
const d = t[a] * e.frequency + e.phase / (2 * Math.PI), c = Math.sign(Math.sin(2 * Math.PI * d)) * e.amplitude, i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1056
|
-
o[a] = c + i + e.offset;
|
|
1057
|
-
}
|
|
1058
|
-
return { x: t, y: o };
|
|
1059
|
-
}
|
|
1060
|
-
function lt(n) {
|
|
1061
|
-
const e = {
|
|
1062
|
-
pointCount: 1e3,
|
|
1063
|
-
amplitude: 1,
|
|
1064
|
-
frequency: 1,
|
|
1065
|
-
phase: 0,
|
|
1066
|
-
noise: 0,
|
|
1067
|
-
xStart: 0,
|
|
1068
|
-
xEnd: 10,
|
|
1069
|
-
offset: 0,
|
|
1070
|
-
...n
|
|
1071
|
-
}, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1072
|
-
for (let a = 0; a < e.pointCount; a++) {
|
|
1073
|
-
t[a] = e.xStart + a * r;
|
|
1074
|
-
const d = t[a] * e.frequency + e.phase / (2 * Math.PI), c = e.amplitude * 2 * (d - Math.floor(d + 0.5)), i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1075
|
-
o[a] = c + i + e.offset;
|
|
1076
|
-
}
|
|
1077
|
-
return { x: t, y: o };
|
|
1078
|
-
}
|
|
1079
|
-
function ct(n) {
|
|
1080
|
-
const e = {
|
|
1081
|
-
pointCount: 1e3,
|
|
1082
|
-
amplitude: 1,
|
|
1083
|
-
frequency: 1,
|
|
1084
|
-
phase: 0,
|
|
1085
|
-
noise: 0,
|
|
1086
|
-
xStart: 0,
|
|
1087
|
-
xEnd: 10,
|
|
1088
|
-
offset: 0,
|
|
1089
|
-
...n
|
|
1090
|
-
}, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = (e.xEnd - e.xStart) / (e.pointCount - 1);
|
|
1091
|
-
for (let a = 0; a < e.pointCount; a++) {
|
|
1092
|
-
t[a] = e.xStart + a * r;
|
|
1093
|
-
const d = t[a] * e.frequency + e.phase / (2 * Math.PI), c = e.amplitude * 2 * Math.abs(2 * (d - Math.floor(d + 0.5))) - e.amplitude, i = e.noise > 0 ? (Math.random() - 0.5) * 2 * e.noise : 0;
|
|
1094
|
-
o[a] = c + i + e.offset;
|
|
1095
|
-
}
|
|
1096
|
-
return { x: t, y: o };
|
|
1097
|
-
}
|
|
1098
|
-
function dt(n) {
|
|
1099
|
-
const e = {
|
|
1100
|
-
pointCount: 1e3,
|
|
1101
|
-
xRange: [0, 100],
|
|
1102
|
-
yRange: [-1, 1],
|
|
1103
|
-
sorted: !0,
|
|
1104
|
-
seed: Date.now(),
|
|
1105
|
-
...n
|
|
1106
|
-
}, t = new je(e.seed), o = new Float32Array(e.pointCount), r = new Float32Array(e.pointCount);
|
|
1107
|
-
for (let a = 0; a < e.pointCount; a++)
|
|
1108
|
-
o[a] = t.nextRange(e.xRange[0], e.xRange[1]), r[a] = t.nextRange(e.yRange[0], e.yRange[1]);
|
|
1109
|
-
if (e.sorted) {
|
|
1110
|
-
const a = Array.from({ length: e.pointCount }, (i, s) => s);
|
|
1111
|
-
a.sort((i, s) => o[i] - o[s]);
|
|
1112
|
-
const d = new Float32Array(e.pointCount), c = new Float32Array(e.pointCount);
|
|
1113
|
-
for (let i = 0; i < e.pointCount; i++)
|
|
1114
|
-
d[i] = o[a[i]], c[i] = r[a[i]];
|
|
1115
|
-
return { x: d, y: c };
|
|
1116
|
-
}
|
|
1117
|
-
return { x: o, y: r };
|
|
1118
|
-
}
|
|
1119
|
-
function ut(n) {
|
|
1120
|
-
const e = {
|
|
1121
|
-
pointCount: 2e3,
|
|
1122
|
-
vMin: -0.5,
|
|
1123
|
-
vMax: 0.5,
|
|
1124
|
-
cycles: 1,
|
|
1125
|
-
peakCurrent: 1e-5,
|
|
1126
|
-
// 10 µA
|
|
1127
|
-
noise: 0.02,
|
|
1128
|
-
...n
|
|
1129
|
-
}, t = e.pointCount * e.cycles, o = new Float32Array(t), r = new Float32Array(t), a = e.pointCount, d = a / 2;
|
|
1130
|
-
for (let c = 0; c < e.cycles; c++)
|
|
1131
|
-
for (let i = 0; i < a; i++) {
|
|
1132
|
-
const s = c * a + i;
|
|
1133
|
-
i < d ? o[s] = e.vMin + (e.vMax - e.vMin) * (i / d) : o[s] = e.vMax - (e.vMax - e.vMin) * ((i - d) / d);
|
|
1134
|
-
const u = o[s], p = 0, S = i < d ? 1 : -1, v = 0.1, h = -Math.pow(u - p, 2) / (2 * v * v), w = e.peakCurrent * Math.exp(h), b = S * e.peakCurrent * 0.1, g = (Math.random() - 0.5) * 2 * e.noise * e.peakCurrent;
|
|
1135
|
-
r[s] = S * w + b + g;
|
|
1136
|
-
}
|
|
1137
|
-
return { x: o, y: r };
|
|
1138
|
-
}
|
|
1139
|
-
function ft(n) {
|
|
1140
|
-
const e = {
|
|
1141
|
-
pointCount: 50,
|
|
1142
|
-
rSolution: 100,
|
|
1143
|
-
// Ohms
|
|
1144
|
-
rCharge: 1e3,
|
|
1145
|
-
// Ohms
|
|
1146
|
-
frequency: [1e5, 0.01],
|
|
1147
|
-
...n
|
|
1148
|
-
}, t = new Float32Array(e.pointCount), o = new Float32Array(e.pointCount), r = Math.log10(e.frequency[1]), a = Math.log10(e.frequency[0]);
|
|
1149
|
-
for (let d = 0; d < e.pointCount; d++) {
|
|
1150
|
-
const c = a - (a - r) * (d / (e.pointCount - 1)), i = 2 * Math.PI * Math.pow(10, c), s = e.rCharge * 1e-5, u = e.rSolution + e.rCharge / (1 + Math.pow(i * s, 2)), p = i * s * e.rCharge / (1 + Math.pow(i * s, 2));
|
|
1151
|
-
t[d] = u, o[d] = -p;
|
|
1152
|
-
}
|
|
1153
|
-
return { x: t, y: o };
|
|
1154
|
-
}
|
|
1155
|
-
async function gt(n, e) {
|
|
1156
|
-
const t = {
|
|
1157
|
-
duration: 5e3,
|
|
1158
|
-
warmup: 1e3,
|
|
1159
|
-
...e
|
|
1160
|
-
}, o = [], r = [];
|
|
1161
|
-
let a = 0;
|
|
1162
|
-
const d = n.getAllSeries().reduce((c, i) => c + i.getPointCount(), 0);
|
|
1163
|
-
return new Promise((c) => {
|
|
1164
|
-
const i = performance.now() + t.warmup + t.duration, s = performance.now() + t.warmup;
|
|
1165
|
-
let u = !1, p = 0;
|
|
1166
|
-
function S() {
|
|
1167
|
-
const v = performance.now();
|
|
1168
|
-
if (v >= i) {
|
|
1169
|
-
const b = r.length > 0 ? r.reduce((P, x) => P + x, 0) / r.length : 0, g = p > 0 ? v - p : t.duration, y = a > 0 && g > 0 ? a / g * 1e3 : 0, f = o.length > 0 ? o.reduce((P, x) => P + x, 0) / o.length : b > 0 ? 1e3 / b : 0, l = {
|
|
1170
|
-
avgFps: Math.round(y * 100) / 100,
|
|
1171
|
-
minFps: Math.round((o.length > 0 ? Math.min(...o) : y) * 100) / 100,
|
|
1172
|
-
maxFps: Math.round((o.length > 0 ? Math.max(...o) : y) * 100) / 100,
|
|
1173
|
-
avgFrameTime: Math.round(b * 1e3) / 1e3,
|
|
1174
|
-
frameCount: a,
|
|
1175
|
-
duration: t.duration,
|
|
1176
|
-
pointsRendered: d,
|
|
1177
|
-
throughput: Math.round(d * y / 1e3) * 1e3,
|
|
1178
|
-
/** @internal render-only FPS (not wall clock) */
|
|
1179
|
-
...f > 0 ? { renderFps: Math.round(f * 100) / 100 } : {}
|
|
1180
|
-
};
|
|
1181
|
-
c(l);
|
|
1182
|
-
return;
|
|
1183
|
-
}
|
|
1184
|
-
v >= s && !u && (u = !0, p = v, a = 0, r.length = 0, o.length = 0);
|
|
1185
|
-
const h = performance.now();
|
|
1186
|
-
n.render();
|
|
1187
|
-
const w = performance.now();
|
|
1188
|
-
if (u) {
|
|
1189
|
-
const b = w - h;
|
|
1190
|
-
r.push(b), a++;
|
|
1191
|
-
const g = r.slice(-30);
|
|
1192
|
-
if (g.length > 0) {
|
|
1193
|
-
const y = g.reduce((f, l) => f + l, 0) / g.length;
|
|
1194
|
-
y > 0 && o.push(1e3 / y);
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
requestAnimationFrame(S);
|
|
1198
|
-
}
|
|
1199
|
-
requestAnimationFrame(S);
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
function ht(n, e) {
|
|
1203
|
-
const t = {
|
|
1204
|
-
format: "json",
|
|
1205
|
-
includeStyles: !0,
|
|
1206
|
-
...e
|
|
1207
|
-
}, o = n.getAllSeries().map((a) => ({
|
|
1208
|
-
id: a.getId(),
|
|
1209
|
-
type: a.getType(),
|
|
1210
|
-
pointCount: a.getPointCount(),
|
|
1211
|
-
...t.includeStyles ? { style: a.getStyle() } : {}
|
|
1212
|
-
})), r = {
|
|
1213
|
-
timestamp: Date.now(),
|
|
1214
|
-
config: {},
|
|
1215
|
-
series: o,
|
|
1216
|
-
bounds: n.getViewBounds()
|
|
1217
|
-
};
|
|
1218
|
-
return t.format === "png" && n.exportImage && (r.image = n.exportImage()), r;
|
|
1219
|
-
}
|
|
1220
|
-
function pt(n, e, t = 1e-6) {
|
|
1221
|
-
const o = [];
|
|
1222
|
-
n.series.length !== e.series.length && o.push(`Series count: ${n.series.length} vs ${e.series.length}`);
|
|
1223
|
-
for (let a = 0; a < Math.min(n.series.length, e.series.length); a++) {
|
|
1224
|
-
const d = n.series[a], c = e.series[a];
|
|
1225
|
-
d.id !== c.id && o.push(`Series[${a}] id: "${d.id}" vs "${c.id}"`), d.type !== c.type && o.push(`Series[${a}] type: "${d.type}" vs "${c.type}"`), d.pointCount !== c.pointCount && o.push(`Series[${a}] pointCount: ${d.pointCount} vs ${c.pointCount}`);
|
|
1226
|
-
}
|
|
1227
|
-
const r = ["xMin", "xMax", "yMin", "yMax"];
|
|
1228
|
-
for (const a of r)
|
|
1229
|
-
Math.abs(n.bounds[a] - e.bounds[a]) > t && o.push(`Bounds.${a}: ${n.bounds[a]} vs ${e.bounds[a]}`);
|
|
1230
|
-
return {
|
|
1231
|
-
equal: o.length === 0,
|
|
1232
|
-
differences: o
|
|
1233
|
-
};
|
|
1234
|
-
}
|
|
1235
|
-
function mt(n, e) {
|
|
1236
|
-
const t = [];
|
|
1237
|
-
return e.minFps && n.avgFps < e.minFps && t.push(`FPS ${n.avgFps} < required ${e.minFps}`), e.maxFrameTime && n.avgFrameTime > e.maxFrameTime && t.push(`Frame time ${n.avgFrameTime}ms > required ${e.maxFrameTime}ms`), e.minThroughput && n.throughput < e.minThroughput && t.push(`Throughput ${n.throughput} < required ${e.minThroughput}`), {
|
|
1238
|
-
passed: t.length === 0,
|
|
1239
|
-
failures: t
|
|
1240
|
-
};
|
|
1920
|
+
function jr(t) {
|
|
1921
|
+
return t;
|
|
1241
1922
|
}
|
|
1242
|
-
function
|
|
1243
|
-
return
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
t--, t <= 0 ? e() : requestAnimationFrame(o);
|
|
1247
|
-
}
|
|
1248
|
-
requestAnimationFrame(o);
|
|
1923
|
+
function Jr(t, e) {
|
|
1924
|
+
return (r) => ({
|
|
1925
|
+
...e(r),
|
|
1926
|
+
manifest: t
|
|
1249
1927
|
});
|
|
1250
1928
|
}
|
|
1251
|
-
|
|
1252
|
-
return new Promise((e) => setTimeout(e, n));
|
|
1253
|
-
}
|
|
1929
|
+
Te();
|
|
1254
1930
|
export {
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1931
|
+
Fn as AnimationEngine,
|
|
1932
|
+
Si as AnnotationManager,
|
|
1933
|
+
hi as BackpressureManager,
|
|
1934
|
+
is as BaseBufferStore,
|
|
1935
|
+
ss as BaseTextureStore,
|
|
1936
|
+
qr as BuiltinPlugins,
|
|
1937
|
+
ti as ChartGroup,
|
|
1938
|
+
Dn as ChartInitQueue,
|
|
1939
|
+
gi as CircularBuffer,
|
|
1940
|
+
Xo as ClipboardManager,
|
|
1941
|
+
fr as CrosshairPlugin,
|
|
1942
|
+
ue as DARK_THEME,
|
|
1943
|
+
En as DEFAULT_ANIMATION_CONFIG,
|
|
1944
|
+
Lo as DEFAULT_KEY_BINDINGS,
|
|
1945
|
+
Rn as DEFAULT_LAYOUT,
|
|
1946
|
+
In as DEFAULT_THEME,
|
|
1947
|
+
xr as DataLoggerPlugin,
|
|
1948
|
+
Ho as DebugOverlay,
|
|
1949
|
+
wr as DirectionIndicatorPlugin,
|
|
1950
|
+
Ln as ELECTROCHEM_THEME,
|
|
1951
|
+
on as EventEmitter,
|
|
1952
|
+
ls as GpuBenchmark,
|
|
1953
|
+
cs as GpuCompute,
|
|
1954
|
+
us as GpuRenderer,
|
|
1955
|
+
vr as GridHighlightPlugin,
|
|
1956
|
+
ko as KeyBindingManager,
|
|
1957
|
+
kn as LIGHT_THEME,
|
|
1958
|
+
bo as LOCALE_DE_DE,
|
|
1959
|
+
xo as LOCALE_EN_US,
|
|
1960
|
+
Po as LOCALE_ES_ES,
|
|
1961
|
+
wo as LOCALE_FR_FR,
|
|
1962
|
+
Ao as LOCALE_JA_JP,
|
|
1963
|
+
So as LOCALE_PT_BR,
|
|
1964
|
+
To as LOCALE_ZH_CN,
|
|
1965
|
+
K as LinearScale,
|
|
1966
|
+
Ko as LoadingIndicator,
|
|
1967
|
+
Bn as LogScale,
|
|
1968
|
+
_n as MIDNIGHT_THEME,
|
|
1969
|
+
Se as NativeWebGLRenderer,
|
|
1970
|
+
ut as OverlayRenderer,
|
|
1971
|
+
ds as PipelineCache,
|
|
1972
|
+
Gs as Plugin3D,
|
|
1973
|
+
Sa as PluginAnalysis,
|
|
1974
|
+
Ti as PluginAnnotations,
|
|
1975
|
+
js as PluginAnomalyDetection,
|
|
1976
|
+
ml as PluginBrokenAxis,
|
|
1977
|
+
fl as PluginCaching,
|
|
1978
|
+
Wo as PluginClipboard,
|
|
1979
|
+
qs as PluginContextMenu,
|
|
1980
|
+
Ns as PluginDataExport,
|
|
1981
|
+
ll as PluginDataTransform,
|
|
1982
|
+
zo as PluginDebug,
|
|
1983
|
+
Kr as PluginDragEdit,
|
|
1984
|
+
en as PluginDrawingTools,
|
|
1985
|
+
Sl as PluginForecasting,
|
|
1986
|
+
fs as PluginGpu,
|
|
1987
|
+
Co as PluginI18n,
|
|
1988
|
+
Vs as PluginKeyboard,
|
|
1989
|
+
ul as PluginLaTeX,
|
|
1990
|
+
gl as PluginLazyLoad,
|
|
1991
|
+
jo as PluginLoading,
|
|
1992
|
+
Qs as PluginMLIntegration,
|
|
1993
|
+
Yn as PluginManagerImpl,
|
|
1994
|
+
xl as PluginOffscreen,
|
|
1995
|
+
el as PluginPatternRecognition,
|
|
1996
|
+
wl as PluginROI,
|
|
1997
|
+
al as PluginRadar,
|
|
1998
|
+
rl as PluginRegression,
|
|
1999
|
+
tn as PluginReplay,
|
|
2000
|
+
il as PluginSnapshot,
|
|
2001
|
+
pi as PluginStreaming,
|
|
2002
|
+
Hs as PluginSync,
|
|
2003
|
+
ii as PluginThemeEditor,
|
|
2004
|
+
_i as PluginTools,
|
|
2005
|
+
vl as PluginVideoRecorder,
|
|
2006
|
+
la as PluginVirtualization,
|
|
2007
|
+
Xn as SERIALIZATION_VERSION,
|
|
2008
|
+
fn as STACKED_DEFAULT_MIN_PANE_RATIO,
|
|
2009
|
+
hn as STACKED_MAX_PANES,
|
|
2010
|
+
io as SciChart,
|
|
2011
|
+
so as SciPlot,
|
|
2012
|
+
Wn as Series,
|
|
2013
|
+
hs as SeriesAdapter,
|
|
2014
|
+
lo as StackedPlot,
|
|
2015
|
+
Gn as StateHistory,
|
|
2016
|
+
gr as StatsPlugin,
|
|
2017
|
+
si as THEME_PRESETS,
|
|
2018
|
+
Yi as TOOLTIP_THEMES,
|
|
2019
|
+
li as ThemeEditor,
|
|
2020
|
+
Xi as TooltipManager,
|
|
2021
|
+
co as VeloPlot,
|
|
2022
|
+
mr as WatermarkPlugin,
|
|
2023
|
+
gs as WebGLBackend,
|
|
2024
|
+
ps as WebGPUBackend,
|
|
2025
|
+
Ce as WebGPURenderer,
|
|
2026
|
+
Pa as WorkerPool,
|
|
2027
|
+
qe as addIndicatorToChart,
|
|
2028
|
+
bs as adx,
|
|
2029
|
+
Ta as analyzeComplexSpectrum,
|
|
2030
|
+
Ca as analyzeSpectrum,
|
|
2031
|
+
le as applyBusinessDayX,
|
|
2032
|
+
xs as aroon,
|
|
2033
|
+
Ma as arraysToComplex,
|
|
2034
|
+
zr as assertPerformance,
|
|
2035
|
+
Ps as atr,
|
|
2036
|
+
Fa as autoCorrelation,
|
|
2037
|
+
Da as bandPassFilter,
|
|
2038
|
+
Ea as bandStopFilter,
|
|
2039
|
+
rn as barsToOhlc,
|
|
2040
|
+
rr as benchmarkCanvasGrid,
|
|
2041
|
+
Vr as benchmarkRender,
|
|
2042
|
+
nr as benchmarkWebGLGrid,
|
|
2043
|
+
Ra as blackmanWindow,
|
|
2044
|
+
ws as bollingerBands,
|
|
2045
|
+
gn as bollingerBandsAsync,
|
|
2046
|
+
pn as buildIndicatorPane,
|
|
2047
|
+
mn as buildIndicatorPaneFromPreset,
|
|
2048
|
+
Ke as buildIndicatorSeries,
|
|
2049
|
+
Nt as buildPositionLineAnnotation,
|
|
2050
|
+
sn as businessDaySpanMs,
|
|
2051
|
+
Ia as butterworth,
|
|
2052
|
+
es as calculateR2,
|
|
2053
|
+
Oi as calculateStats,
|
|
2054
|
+
ca as calculateTargetPoints,
|
|
2055
|
+
Mi as checkPluginCompatibility,
|
|
2056
|
+
Rr as compareGridBackends,
|
|
2057
|
+
Lr as compareScenarioToBaseline,
|
|
2058
|
+
Hr as compareSnapshots,
|
|
2059
|
+
La as complexToArrays,
|
|
2060
|
+
On as compressString,
|
|
2061
|
+
$e as computeHeikinAshi,
|
|
2062
|
+
yn as computeIndicatorFromSeries,
|
|
2063
|
+
vn as computeIndicatorPreset,
|
|
2064
|
+
mi as connectStreamToChart,
|
|
2065
|
+
Go as copyToClipboard,
|
|
2066
|
+
yi as createBackpressureManager,
|
|
2067
|
+
Vn as createChart,
|
|
2068
|
+
ri as createChartGroup,
|
|
2069
|
+
Jr as createConfigurablePlugin,
|
|
2070
|
+
No as createDebugOverlay,
|
|
2071
|
+
ms as createGpuRenderer,
|
|
2072
|
+
bn as createIndicatorSeries,
|
|
2073
|
+
Bo as createKeyBinding,
|
|
2074
|
+
Jo as createLoadingIndicator,
|
|
2075
|
+
Mo as createLocaleFormatter,
|
|
2076
|
+
vi as createLosslessBackpressure,
|
|
2077
|
+
ni as createMasterSlave,
|
|
2078
|
+
bi as createMessageParser,
|
|
2079
|
+
nn as createMockDatafeed,
|
|
2080
|
+
xi as createMockStream,
|
|
2081
|
+
Se as createNativeRenderer,
|
|
2082
|
+
jr as createPlugin,
|
|
2083
|
+
$n as createPluginContext,
|
|
2084
|
+
Pi as createRealtimeBackpressure,
|
|
2085
|
+
Fi as createRenderer,
|
|
2086
|
+
Hn as createScale,
|
|
2087
|
+
$r as createSnapshot,
|
|
2088
|
+
xn as createStackedChart,
|
|
2089
|
+
zn as createTheme,
|
|
2090
|
+
ci as createThemeEditor,
|
|
2091
|
+
wi as createWebSocketStream,
|
|
2092
|
+
ka as crossCorrelation,
|
|
2093
|
+
As as cumsum,
|
|
2094
|
+
ts as cumulativeIntegral,
|
|
2095
|
+
Nn as decodeFloat32Array,
|
|
2096
|
+
Un as decompressString,
|
|
2097
|
+
Di as defineAndRegister,
|
|
1422
2098
|
G as definePlugin,
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
2099
|
+
Ss as dema,
|
|
2100
|
+
rs as derivative,
|
|
2101
|
+
ua as destroyDownsamplePool,
|
|
2102
|
+
Pn as destroyIndicatorPool,
|
|
2103
|
+
Ba as detectAnomalies,
|
|
2104
|
+
Vi as detectCycles,
|
|
2105
|
+
wn as detectIndicatorMarkers,
|
|
2106
|
+
$i as detectPeaks,
|
|
2107
|
+
_a as dominantFrequency,
|
|
2108
|
+
da as downsampleAsync,
|
|
2109
|
+
Hi as downsampleLTTB,
|
|
2110
|
+
qn as easings,
|
|
2111
|
+
Ts as ema,
|
|
2112
|
+
An as emaAsync,
|
|
2113
|
+
Uo as enableDebugMode,
|
|
2114
|
+
Kn as encodeFloat32Array,
|
|
2115
|
+
kr as evaluateRendererCompare,
|
|
2116
|
+
Ya as exponentialMovingAverage,
|
|
2117
|
+
Xa as fft,
|
|
2118
|
+
Wa as fftFromComplexInput,
|
|
2119
|
+
ln as formatBusinessDayTick,
|
|
2120
|
+
Oo as formatData,
|
|
2121
|
+
zi as formatScientific,
|
|
2122
|
+
Ni as formatValue,
|
|
2123
|
+
Ui as formatWithPrefix,
|
|
2124
|
+
Ga as gaussianSmooth,
|
|
2125
|
+
Gr as generateCVData,
|
|
2126
|
+
Oa as generateContours,
|
|
2127
|
+
qi as generateCycleColors,
|
|
2128
|
+
Or as generateNyquistData,
|
|
2129
|
+
Wr as generateRandomData,
|
|
2130
|
+
Yr as generateSawtoothWave,
|
|
2131
|
+
Br as generateSineWave,
|
|
2132
|
+
_r as generateSquareWave,
|
|
2133
|
+
Xr as generateTriangleWave,
|
|
2134
|
+
Ir as getBaseline,
|
|
2135
|
+
Ki as getBestPrefix,
|
|
2136
|
+
jn as getChartInitQueue,
|
|
2137
|
+
Vo as getClipboardManager,
|
|
2138
|
+
fa as getDownsamplePoolSize,
|
|
2139
|
+
Fo as getGlobalLocale,
|
|
2140
|
+
Do as getLocale,
|
|
2141
|
+
Ei as getPluginRegistry,
|
|
2142
|
+
Va as getPositiveFrequencies,
|
|
2143
|
+
ui as getPresetNames,
|
|
2144
|
+
di as getPresetTheme,
|
|
2145
|
+
Jn as getSharedAnimationEngine,
|
|
2146
|
+
Qn as getThemeByName,
|
|
2147
|
+
Wi as getTooltipThemeForChartTheme,
|
|
2148
|
+
$a as hammingWindow,
|
|
2149
|
+
Ha as hanningWindow,
|
|
2150
|
+
za as highPassFilter,
|
|
2151
|
+
Na as ifft,
|
|
2152
|
+
Ua as ifftComplex,
|
|
2153
|
+
qa as ifftFromArrays,
|
|
2154
|
+
ns as integrate,
|
|
2155
|
+
Ae as interleaveData,
|
|
2156
|
+
cn as isBusinessDay,
|
|
2157
|
+
se as isBusinessDayScaleActive,
|
|
2158
|
+
Ka as joinSegments,
|
|
2159
|
+
ai as linkCharts,
|
|
2160
|
+
Ri as listPluginsByCategory,
|
|
2161
|
+
Ii as loadPlugin,
|
|
2162
|
+
ja as lowPassFilter,
|
|
2163
|
+
ha as lowerBoundX,
|
|
2164
|
+
ga as lttbDownsample,
|
|
2165
|
+
Cs as macd,
|
|
2166
|
+
Sn as macdAsync,
|
|
2167
|
+
un as mapToBusinessDayScale,
|
|
2168
|
+
Ja as medianFilter,
|
|
2169
|
+
Zn as mergeAnimationConfig,
|
|
2170
|
+
ea as mergeLayoutOptions,
|
|
2171
|
+
pa as minMaxDownsample,
|
|
2172
|
+
Ms as momentum,
|
|
2173
|
+
ji as movingAverage,
|
|
2174
|
+
Qa as nextPowerOf2,
|
|
2175
|
+
wa as nextTaskId,
|
|
2176
|
+
Fs as normalize,
|
|
2177
|
+
Ds as obv,
|
|
2178
|
+
ma as ohlcDownsampleAsync,
|
|
2179
|
+
ya as ohlcMinMaxDownsample,
|
|
2180
|
+
U as parseColor,
|
|
2181
|
+
ys as parseColorToRGBA,
|
|
2182
|
+
_o as parseShortcut,
|
|
2183
|
+
Es as percentChange,
|
|
2184
|
+
Za as powerSpectrum,
|
|
2185
|
+
ta as queueChartInit,
|
|
2186
|
+
Eo as registerLocale,
|
|
2187
|
+
Li as registerPlugin,
|
|
2188
|
+
ra as resetChartQueue,
|
|
2189
|
+
Rs as roc,
|
|
2190
|
+
Is as rsi,
|
|
2191
|
+
Tn as rsiAsync,
|
|
2192
|
+
eo as savitzkyGolay,
|
|
2193
|
+
Ro as setGlobalLocale,
|
|
2194
|
+
Qo as showLoading,
|
|
2195
|
+
Zo as showProgress,
|
|
2196
|
+
to as simpsonsIntegration,
|
|
2197
|
+
ro as singleFrequencyFilter,
|
|
2198
|
+
va as sliceSeriesToViewport,
|
|
2199
|
+
Ls as sma,
|
|
2200
|
+
Cn as smaAsync,
|
|
2201
|
+
as as solveLinearSystem,
|
|
2202
|
+
ks as standardDeviation,
|
|
2203
|
+
na as stateToUrlHash,
|
|
2204
|
+
Bs as stochastic,
|
|
2205
|
+
Ji as subtractBaseline,
|
|
2206
|
+
no as tTest,
|
|
2207
|
+
_s as tema,
|
|
2208
|
+
ao as trapezoidalIntegration,
|
|
2209
|
+
ba as upperBoundX,
|
|
2210
|
+
aa as urlHashToState,
|
|
2211
|
+
uo as useChartGroup,
|
|
2212
|
+
fo as useChartSync,
|
|
2213
|
+
ho as useIndicator,
|
|
2214
|
+
go as useSciChart,
|
|
2215
|
+
po as useSciPlot,
|
|
2216
|
+
mo as useStackedPlot,
|
|
2217
|
+
yo as useVeloPlot,
|
|
2218
|
+
oa as validateChartState,
|
|
2219
|
+
Qi as validateData,
|
|
2220
|
+
ki as validateManifest,
|
|
2221
|
+
Ys as vwap,
|
|
2222
|
+
Ur as waitFor,
|
|
2223
|
+
ia as waitForAnimations,
|
|
2224
|
+
Nr as waitForFrames,
|
|
2225
|
+
Xs as wma
|
|
1550
2226
|
};
|
|
1551
2227
|
//# sourceMappingURL=velo-plot.full.js.map
|