chartgpu 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +734 -734
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const cr = Symbol("GPUContext.ownsDevice"),
|
|
2
|
-
function
|
|
1
|
+
const cr = Symbol("GPUContext.ownsDevice"), Ws = (e) => e[cr] ?? !0;
|
|
2
|
+
function ya(e) {
|
|
3
3
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function ga(e) {
|
|
6
6
|
const t = e.clientWidth || e.width || 0, n = e.clientHeight || e.height || 0;
|
|
7
7
|
if (!Number.isFinite(t) || !Number.isFinite(n))
|
|
8
8
|
throw new Error(
|
|
@@ -10,7 +10,7 @@ function ha(e) {
|
|
|
10
10
|
);
|
|
11
11
|
return { width: t, height: n };
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Os(e, t) {
|
|
14
14
|
const n = (t == null ? void 0 : t.devicePixelRatio) ?? (typeof window < "u" ? window.devicePixelRatio : 1), i = Number.isFinite(n) && n > 0 ? n : 1, r = (t == null ? void 0 : t.alphaMode) ?? "opaque", o = (t == null ? void 0 : t.powerPreference) ?? "high-performance", s = !!(t != null && t.device && (t != null && t.adapter)), a = s ? t.adapter : null, u = s ? t.device : null, f = !s;
|
|
15
15
|
return {
|
|
16
16
|
adapter: a,
|
|
@@ -25,7 +25,7 @@ function Vs(e, t) {
|
|
|
25
25
|
[cr]: f
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
async function
|
|
28
|
+
async function Xs(e) {
|
|
29
29
|
var o, s, a;
|
|
30
30
|
if (e.initialized)
|
|
31
31
|
throw new Error("GPUContext: already initialized. Call destroyGPUContext() before reinitializing.");
|
|
@@ -34,7 +34,7 @@ async function Ws(e) {
|
|
|
34
34
|
throw new Error(
|
|
35
35
|
"WebGPU is not available in this browser. Please use a browser that supports WebGPU (Chrome 113+, Edge 113+, or Safari 18+). Ensure WebGPU is enabled in browser flags if needed."
|
|
36
36
|
);
|
|
37
|
-
let n = null, i = null, r =
|
|
37
|
+
let n = null, i = null, r = Ws(e);
|
|
38
38
|
try {
|
|
39
39
|
if (e.adapter && e.device) {
|
|
40
40
|
if (i = e.adapter, n = e.device, r = !1, typeof ((o = navigator.gpu) == null ? void 0 : o.getPreferredCanvasFormat) != "function")
|
|
@@ -83,7 +83,7 @@ async function Ws(e) {
|
|
|
83
83
|
}
|
|
84
84
|
throw new Error("GPUContext: Failed to get WebGPU context from canvas.");
|
|
85
85
|
}
|
|
86
|
-
const { width: c, height: h } =
|
|
86
|
+
const { width: c, height: h } = ga(e.canvas), d = t, w = Math.floor(c * d), P = Math.floor(h * d), R = n.limits.maxTextureDimension2D;
|
|
87
87
|
if (!r && (w > R || P > R)) {
|
|
88
88
|
const v = Math.max(w, P);
|
|
89
89
|
throw new Error(
|
|
@@ -119,21 +119,21 @@ async function Ws(e) {
|
|
|
119
119
|
throw u instanceof Error ? u : new Error(`Failed to initialize GPUContext: ${String(u)}`);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function $s(e) {
|
|
123
123
|
if (!e.canvas)
|
|
124
124
|
throw new Error("GPUContext: Canvas is not configured. Provide a canvas element when creating the context.");
|
|
125
125
|
if (!e.initialized || !e.canvasContext)
|
|
126
126
|
throw new Error("GPUContext: not initialized. Call initializeGPUContext() first.");
|
|
127
127
|
return e.canvasContext.getCurrentTexture();
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function xa(e, t, n, i, r) {
|
|
130
130
|
if (t < 0 || t > 1 || n < 0 || n > 1 || i < 0 || i > 1 || r < 0 || r > 1)
|
|
131
131
|
throw new Error("GPUContext: Color components must be in the range [0.0, 1.0]");
|
|
132
132
|
if (!e.canvas)
|
|
133
133
|
throw new Error("GPUContext: Canvas is not configured. Provide a canvas element when creating the context.");
|
|
134
134
|
if (!e.initialized || !e.device || !e.canvasContext)
|
|
135
135
|
throw new Error("GPUContext: not initialized. Call initializeGPUContext() first.");
|
|
136
|
-
const o =
|
|
136
|
+
const o = $s(e), s = e.device.createCommandEncoder();
|
|
137
137
|
s.beginRenderPass({
|
|
138
138
|
colorAttachments: [
|
|
139
139
|
{
|
|
@@ -145,14 +145,14 @@ function ya(e, t, n, i, r) {
|
|
|
145
145
|
]
|
|
146
146
|
}).end(), e.device.queue.submit([s.finish()]);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function ba(e) {
|
|
149
149
|
if (e.canvasContext)
|
|
150
150
|
try {
|
|
151
151
|
e.canvasContext.unconfigure();
|
|
152
152
|
} catch (t) {
|
|
153
153
|
console.warn("Error unconfiguring GPU canvas context:", t);
|
|
154
154
|
}
|
|
155
|
-
if (
|
|
155
|
+
if (Ws(e) !== !1 && e.device)
|
|
156
156
|
try {
|
|
157
157
|
e.device.destroy();
|
|
158
158
|
} catch (t) {
|
|
@@ -171,9 +171,9 @@ function ga(e) {
|
|
|
171
171
|
[cr]: !1
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
async function
|
|
175
|
-
const n =
|
|
176
|
-
return
|
|
174
|
+
async function Zd(e, t) {
|
|
175
|
+
const n = Os(e, t);
|
|
176
|
+
return Xs(n);
|
|
177
177
|
}
|
|
178
178
|
class to {
|
|
179
179
|
/**
|
|
@@ -237,7 +237,7 @@ class to {
|
|
|
237
237
|
* @param options - Optional configuration for device pixel ratio, alpha mode, and power preference
|
|
238
238
|
*/
|
|
239
239
|
constructor(t, n) {
|
|
240
|
-
this._state =
|
|
240
|
+
this._state = Os(t, n);
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
243
|
* Initializes the WebGPU context by requesting an adapter and device.
|
|
@@ -248,7 +248,7 @@ class to {
|
|
|
248
248
|
* @throws {Error} If already initialized
|
|
249
249
|
*/
|
|
250
250
|
async initialize() {
|
|
251
|
-
this._state = await
|
|
251
|
+
this._state = await Xs(this._state);
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
254
254
|
* Static factory method to create and initialize a GPUContext instance.
|
|
@@ -288,7 +288,7 @@ class to {
|
|
|
288
288
|
* ```
|
|
289
289
|
*/
|
|
290
290
|
getCanvasTexture() {
|
|
291
|
-
return
|
|
291
|
+
return $s(this._state);
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
294
|
* Clears the canvas to a solid color.
|
|
@@ -309,14 +309,14 @@ class to {
|
|
|
309
309
|
* ```
|
|
310
310
|
*/
|
|
311
311
|
clearScreen(t, n, i, r) {
|
|
312
|
-
|
|
312
|
+
xa(this._state, t, n, i, r);
|
|
313
313
|
}
|
|
314
314
|
/**
|
|
315
315
|
* Destroys the WebGPU device and cleans up resources.
|
|
316
316
|
* After calling destroy(), the context must be reinitialized before use.
|
|
317
317
|
*/
|
|
318
318
|
destroy() {
|
|
319
|
-
this._state =
|
|
319
|
+
this._state = ba(this._state);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
function Yn(e) {
|
|
@@ -434,26 +434,26 @@ const tr = 4;
|
|
|
434
434
|
function Xr(e) {
|
|
435
435
|
return e + 3 & -4;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function va(e) {
|
|
438
438
|
if (!Number.isFinite(e) || e <= 0) return 1;
|
|
439
439
|
const t = Math.ceil(e);
|
|
440
440
|
return 2 ** Math.ceil(Math.log2(t));
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
const n = Math.max(tr, Xr(t)), i = Math.max(tr,
|
|
442
|
+
function xo(e, t) {
|
|
443
|
+
const n = Math.max(tr, Xr(t)), i = Math.max(tr, va(n));
|
|
444
444
|
return Math.max(e, i);
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function Ys(e, t) {
|
|
447
447
|
let n = e >>> 0;
|
|
448
448
|
for (let i = 0; i < t.length; i++)
|
|
449
449
|
n ^= t[i], n = Math.imul(n, 16777619) >>> 0;
|
|
450
450
|
return n >>> 0;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function bo(e) {
|
|
453
453
|
const t = new Uint32Array(e.buffer, e.byteOffset, e.byteLength / 4);
|
|
454
|
-
return
|
|
454
|
+
return Ys(2166136261, t);
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function wa(e) {
|
|
457
457
|
const t = /* @__PURE__ */ new Map();
|
|
458
458
|
let n = !1;
|
|
459
459
|
const i = (c, h) => {
|
|
@@ -474,7 +474,7 @@ function ba(e) {
|
|
|
474
474
|
return {
|
|
475
475
|
setSeries: (c, h, d) => {
|
|
476
476
|
r();
|
|
477
|
-
const w = (d == null ? void 0 : d.xOffset) ?? 0, P = Ie(h), R = i(h, w), T =
|
|
477
|
+
const w = (d == null ? void 0 : d.xOffset) ?? 0, P = Ie(h), R = i(h, w), T = bo(R), C = Xr(R.byteLength), v = Math.max(tr, C), m = t.get(c);
|
|
478
478
|
if (m && m.pointCount === P && m.hash32 === T) return;
|
|
479
479
|
let b = (m == null ? void 0 : m.buffer) ?? null, M = (m == null ? void 0 : m.capacityBytes) ?? 0;
|
|
480
480
|
if (!b || v > M) {
|
|
@@ -488,7 +488,7 @@ function ba(e) {
|
|
|
488
488
|
b.destroy();
|
|
489
489
|
} catch {
|
|
490
490
|
}
|
|
491
|
-
const S =
|
|
491
|
+
const S = xo(M, v);
|
|
492
492
|
S > A ? M = v : M = S, b = e.createBuffer({
|
|
493
493
|
size: M,
|
|
494
494
|
usage: GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
|
|
@@ -521,7 +521,7 @@ function ba(e) {
|
|
|
521
521
|
v.destroy();
|
|
522
522
|
} catch {
|
|
523
523
|
}
|
|
524
|
-
const S =
|
|
524
|
+
const S = xo(m, C);
|
|
525
525
|
m = S > b ? C : S, v = e.createBuffer({
|
|
526
526
|
size: m,
|
|
527
527
|
usage: GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
|
|
@@ -533,7 +533,7 @@ function ba(e) {
|
|
|
533
533
|
buffer: v,
|
|
534
534
|
capacityBytes: m,
|
|
535
535
|
pointCount: R,
|
|
536
|
-
hash32:
|
|
536
|
+
hash32: bo(y),
|
|
537
537
|
xOffset: w.xOffset,
|
|
538
538
|
stagingBuffer: p
|
|
539
539
|
});
|
|
@@ -545,7 +545,7 @@ function ba(e) {
|
|
|
545
545
|
const S = P * 2 * 4;
|
|
546
546
|
e.queue.writeBuffer(v, S, M.buffer, M.byteOffset, M.byteLength);
|
|
547
547
|
}
|
|
548
|
-
const I = new Uint32Array(M.buffer, M.byteOffset, M.byteLength / 4), A =
|
|
548
|
+
const I = new Uint32Array(M.buffer, M.byteOffset, M.byteLength / 4), A = Ys(w.hash32, I);
|
|
549
549
|
t.set(c, {
|
|
550
550
|
buffer: v,
|
|
551
551
|
capacityBytes: m,
|
|
@@ -584,7 +584,7 @@ function ba(e) {
|
|
|
584
584
|
function un(e) {
|
|
585
585
|
return Array.isArray(e);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Ca(e, t) {
|
|
588
588
|
const n = e.length >>> 1, i = n - 1;
|
|
589
589
|
if (t <= 0 || n === 0) return new Int32Array(0);
|
|
590
590
|
if (t === 1) return new Int32Array([0]);
|
|
@@ -620,7 +620,7 @@ function va(e, t) {
|
|
|
620
620
|
}
|
|
621
621
|
return r;
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Ma(e, t) {
|
|
624
624
|
const n = e.length, i = n - 1;
|
|
625
625
|
if (t <= 0 || n === 0) return new Int32Array(0);
|
|
626
626
|
if (t === 1) return new Int32Array([0]);
|
|
@@ -664,7 +664,7 @@ function Ni(e, t) {
|
|
|
664
664
|
const s = e.length >>> 1;
|
|
665
665
|
if (n <= 0 || s === 0) return new Float32Array(0);
|
|
666
666
|
if (s <= n) return e;
|
|
667
|
-
const a =
|
|
667
|
+
const a = Ca(e, n), u = new Float32Array(a.length * 2);
|
|
668
668
|
for (let f = 0; f < a.length; f++) {
|
|
669
669
|
const l = a[f];
|
|
670
670
|
u[f * 2 + 0] = e[l * 2 + 0], u[f * 2 + 1] = e[l * 2 + 1];
|
|
@@ -674,29 +674,29 @@ function Ni(e, t) {
|
|
|
674
674
|
const i = e.length;
|
|
675
675
|
if (n <= 0 || i === 0) return [];
|
|
676
676
|
if (i <= n) return e;
|
|
677
|
-
const r =
|
|
677
|
+
const r = Ma(e, n), o = new Array(r.length);
|
|
678
678
|
for (let s = 0; s < r.length; s++)
|
|
679
679
|
o[s] = e[r[s]];
|
|
680
680
|
return o;
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Hs(e) {
|
|
683
683
|
const t = Math.floor(e);
|
|
684
684
|
return Number.isFinite(t) ? t : 0;
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function Sa(e) {
|
|
687
687
|
return typeof e == "object" && e !== null && !Array.isArray(e) && "x" in e && "y" in e && typeof e.x == "object" && typeof e.y == "object" && "length" in e.x && "length" in e.y;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function Fa(e) {
|
|
690
690
|
return typeof e == "object" && e !== null && !Array.isArray(e) && ArrayBuffer.isView(e);
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function vo(e) {
|
|
693
693
|
const t = Ie(e), n = new Float32Array(t * 2);
|
|
694
694
|
for (let i = 0; i < t; i++)
|
|
695
695
|
n[i * 2] = Ae(e, i), n[i * 2 + 1] = Ue(e, i);
|
|
696
696
|
return n;
|
|
697
697
|
}
|
|
698
698
|
function yr(e, t, n) {
|
|
699
|
-
const i = Ie(e), r =
|
|
699
|
+
const i = Ie(e), r = Hs(t);
|
|
700
700
|
if (r <= 0 || i === 0) return [];
|
|
701
701
|
if (r === 1) {
|
|
702
702
|
const u = Ae(e, 0), f = Ue(e, 0), l = at(e, 0);
|
|
@@ -756,18 +756,18 @@ function yr(e, t, n) {
|
|
|
756
756
|
return s;
|
|
757
757
|
}
|
|
758
758
|
function Gn(e, t, n) {
|
|
759
|
-
const i =
|
|
759
|
+
const i = Hs(n), r = Ie(e);
|
|
760
760
|
if (t === "none" || !(i > 0) || r <= i) return e;
|
|
761
761
|
switch (t) {
|
|
762
762
|
case "lttb": {
|
|
763
763
|
if (e instanceof Float32Array)
|
|
764
764
|
return Ni(e, i);
|
|
765
|
-
if (
|
|
766
|
-
const o =
|
|
765
|
+
if (Fa(e)) {
|
|
766
|
+
const o = vo(e);
|
|
767
767
|
return Ni(o, i);
|
|
768
768
|
}
|
|
769
|
-
if (
|
|
770
|
-
const o =
|
|
769
|
+
if (Sa(e)) {
|
|
770
|
+
const o = vo(e);
|
|
771
771
|
return Ni(o, i);
|
|
772
772
|
}
|
|
773
773
|
return Ni(e, i);
|
|
@@ -782,7 +782,7 @@ function Gn(e, t, n) {
|
|
|
782
782
|
return e;
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function Na(e) {
|
|
786
786
|
return Array.isArray(e);
|
|
787
787
|
}
|
|
788
788
|
function $r(e, t) {
|
|
@@ -790,7 +790,7 @@ function $r(e, t) {
|
|
|
790
790
|
if (n < 2 || i <= n) return e;
|
|
791
791
|
const r = new Array(n);
|
|
792
792
|
if (r[0] = e[0], r[n - 1] = e[i - 1], n === 2) return r;
|
|
793
|
-
const o =
|
|
793
|
+
const o = Na(e[0]), s = (i - 2) / (n - 2);
|
|
794
794
|
if (o) {
|
|
795
795
|
const a = e;
|
|
796
796
|
for (let u = 0; u < n - 2; u++) {
|
|
@@ -820,10 +820,10 @@ function $r(e, t) {
|
|
|
820
820
|
}
|
|
821
821
|
return r;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Ta(e) {
|
|
824
824
|
return e ? e.clientWidth : 0;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Aa(e) {
|
|
827
827
|
return e ? e.clientHeight : 0;
|
|
828
828
|
}
|
|
829
829
|
function mn(e, t, n) {
|
|
@@ -849,7 +849,7 @@ function no(e) {
|
|
|
849
849
|
}
|
|
850
850
|
return t && Ti.set(t, !0), !0;
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function Ia(e) {
|
|
853
853
|
const t = Ai.get(e);
|
|
854
854
|
if (t !== void 0) return t;
|
|
855
855
|
let n = Number.NEGATIVE_INFINITY;
|
|
@@ -861,7 +861,7 @@ function Ta(e) {
|
|
|
861
861
|
}
|
|
862
862
|
return Ai.set(e, !0), !0;
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function qs(e, t) {
|
|
865
865
|
let n = 0, i = Ie(e);
|
|
866
866
|
for (; n < i; ) {
|
|
867
867
|
const r = n + i >>> 1;
|
|
@@ -869,7 +869,7 @@ function Ys(e, t) {
|
|
|
869
869
|
}
|
|
870
870
|
return n;
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function Zs(e, t) {
|
|
873
873
|
let n = 0, i = Ie(e);
|
|
874
874
|
for (; n < i; ) {
|
|
875
875
|
const r = n + i >>> 1;
|
|
@@ -877,7 +877,7 @@ function Hs(e, t) {
|
|
|
877
877
|
}
|
|
878
878
|
return n;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function Pa(e, t) {
|
|
881
881
|
let n = 0, i = e.length;
|
|
882
882
|
for (; n < i; ) {
|
|
883
883
|
const r = n + i >>> 1;
|
|
@@ -885,7 +885,7 @@ function Aa(e, t) {
|
|
|
885
885
|
}
|
|
886
886
|
return n;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Ra(e, t) {
|
|
889
889
|
let n = 0, i = e.length;
|
|
890
890
|
for (; n < i; ) {
|
|
891
891
|
const r = n + i >>> 1;
|
|
@@ -893,7 +893,7 @@ function Ia(e, t) {
|
|
|
893
893
|
}
|
|
894
894
|
return n;
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function Da(e, t) {
|
|
897
897
|
let n = 0, i = e.length;
|
|
898
898
|
for (; n < i; ) {
|
|
899
899
|
const r = n + i >>> 1;
|
|
@@ -901,7 +901,7 @@ function Pa(e, t) {
|
|
|
901
901
|
}
|
|
902
902
|
return n;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function Ea(e, t) {
|
|
905
905
|
let n = 0, i = e.length;
|
|
906
906
|
for (; n < i; ) {
|
|
907
907
|
const r = n + i >>> 1;
|
|
@@ -909,19 +909,19 @@ function Ra(e, t) {
|
|
|
909
909
|
}
|
|
910
910
|
return n;
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function wo(e) {
|
|
913
913
|
return typeof e == "object" && e !== null && !Array.isArray(e) && "x" in e && "y" in e && typeof e.x == "object" && typeof e.y == "object" && "length" in e.x && "length" in e.y;
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function Co(e) {
|
|
916
916
|
return typeof e == "object" && e !== null && !Array.isArray(e) && ArrayBuffer.isView(e);
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function Ba(e, t, n) {
|
|
919
919
|
const i = Ie(e), r = Math.max(0, Math.min(t, i)), o = Math.max(r, Math.min(n, i));
|
|
920
920
|
if (r === 0 && o === i) return e;
|
|
921
921
|
if (o <= r) {
|
|
922
|
-
if (
|
|
922
|
+
if (wo(e))
|
|
923
923
|
return { x: [], y: [], ...e.size ? { size: [] } : {} };
|
|
924
|
-
if (
|
|
924
|
+
if (Co(e)) {
|
|
925
925
|
if (e instanceof DataView)
|
|
926
926
|
throw new Error("DataView is not supported for InterleavedXYData");
|
|
927
927
|
const s = e.constructor;
|
|
@@ -929,7 +929,7 @@ function Da(e, t, n) {
|
|
|
929
929
|
}
|
|
930
930
|
return [];
|
|
931
931
|
}
|
|
932
|
-
if (
|
|
932
|
+
if (wo(e)) {
|
|
933
933
|
const s = Array.isArray(e.x) ? e.x.slice(r, o) : "subarray" in e.x ? e.x.subarray(r, o) : Array.from(e.x).slice(r, o), a = Array.isArray(e.y) ? e.y.slice(r, o) : "subarray" in e.y ? e.y.subarray(r, o) : Array.from(e.y).slice(r, o), u = { x: s, y: a };
|
|
934
934
|
if (e.size) {
|
|
935
935
|
const f = Array.isArray(e.size) ? e.size.slice(r, o) : "subarray" in e.size ? e.size.subarray(r, o) : Array.from(e.size).slice(r, o);
|
|
@@ -937,7 +937,7 @@ function Da(e, t, n) {
|
|
|
937
937
|
}
|
|
938
938
|
return u;
|
|
939
939
|
}
|
|
940
|
-
if (
|
|
940
|
+
if (Co(e)) {
|
|
941
941
|
if (e instanceof DataView)
|
|
942
942
|
throw new Error("DataView is not supported for InterleavedXYData");
|
|
943
943
|
return e.subarray(r * 2, o * 2);
|
|
@@ -948,8 +948,8 @@ function Ii(e, t, n) {
|
|
|
948
948
|
const i = Ie(e);
|
|
949
949
|
if (i === 0 || !Number.isFinite(t) || !Number.isFinite(n)) return e;
|
|
950
950
|
if (no(e)) {
|
|
951
|
-
const s =
|
|
952
|
-
return s <= 0 && a >= i ? e :
|
|
951
|
+
const s = qs(e, t), a = Zs(e, n);
|
|
952
|
+
return s <= 0 && a >= i ? e : Ba(e, s, a);
|
|
953
953
|
}
|
|
954
954
|
const o = [];
|
|
955
955
|
for (let s = 0; s < i; s++) {
|
|
@@ -961,21 +961,21 @@ function Ii(e, t, n) {
|
|
|
961
961
|
}
|
|
962
962
|
return o;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function La(e, t, n) {
|
|
965
965
|
const i = Ie(e);
|
|
966
966
|
if (i === 0) return { start: 0, end: 0 };
|
|
967
967
|
if (!Number.isFinite(t) || !Number.isFinite(n)) return { start: 0, end: i };
|
|
968
968
|
if (!no(e))
|
|
969
969
|
return { start: 0, end: i };
|
|
970
|
-
const o =
|
|
970
|
+
const o = qs(e, t), s = Zs(e, n), a = mn(o, 0, i), u = mn(s, 0, i);
|
|
971
971
|
return u <= a ? { start: a, end: a } : { start: a, end: u };
|
|
972
972
|
}
|
|
973
973
|
function Pi(e, t, n) {
|
|
974
974
|
const i = e.length;
|
|
975
975
|
if (i === 0 || !Number.isFinite(t) || !Number.isFinite(n)) return e;
|
|
976
|
-
const r =
|
|
976
|
+
const r = Ia(e), o = i > 0 && nr(e[0]);
|
|
977
977
|
if (r) {
|
|
978
|
-
const a = o ?
|
|
978
|
+
const a = o ? Pa(e, t) : Da(e, t), u = o ? Ra(e, n) : Ea(e, n);
|
|
979
979
|
return a <= 0 && u >= i ? e : u <= a ? [] : e.slice(a, u);
|
|
980
980
|
}
|
|
981
981
|
const s = [];
|
|
@@ -985,13 +985,13 @@ function Pi(e, t, n) {
|
|
|
985
985
|
}
|
|
986
986
|
return s;
|
|
987
987
|
}
|
|
988
|
-
const
|
|
988
|
+
const Mo = (e) => Math.min(1, Math.max(0, e)), So = (e) => Math.min(255, Math.max(0, e)), wn = (e) => {
|
|
989
989
|
const t = Number.parseInt(e, 16);
|
|
990
990
|
return Number.isFinite(t) ? t : 0;
|
|
991
991
|
}, Cn = (e) => {
|
|
992
992
|
const t = Number.parseInt(e, 16);
|
|
993
993
|
return Number.isFinite(t) ? t : 0;
|
|
994
|
-
},
|
|
994
|
+
}, _a = (e) => {
|
|
995
995
|
const t = e.trim();
|
|
996
996
|
if (!t.startsWith("#")) return null;
|
|
997
997
|
const n = t.slice(1);
|
|
@@ -1017,20 +1017,20 @@ const wo = (e) => Math.min(1, Math.max(0, e)), Co = (e) => Math.min(255, Math.ma
|
|
|
1017
1017
|
if (t.length === 0) return null;
|
|
1018
1018
|
if (t.endsWith("%")) {
|
|
1019
1019
|
const i = Number.parseFloat(t.slice(0, -1));
|
|
1020
|
-
return Number.isFinite(i) ?
|
|
1020
|
+
return Number.isFinite(i) ? So(i / 100 * 255) : null;
|
|
1021
1021
|
}
|
|
1022
1022
|
const n = Number.parseFloat(t);
|
|
1023
|
-
return Number.isFinite(n) ?
|
|
1024
|
-
},
|
|
1023
|
+
return Number.isFinite(n) ? So(n) : null;
|
|
1024
|
+
}, Ua = (e) => {
|
|
1025
1025
|
const t = e.trim();
|
|
1026
1026
|
if (t.length === 0) return null;
|
|
1027
1027
|
if (t.endsWith("%")) {
|
|
1028
1028
|
const i = Number.parseFloat(t.slice(0, -1));
|
|
1029
|
-
return Number.isFinite(i) ?
|
|
1029
|
+
return Number.isFinite(i) ? Mo(i / 100) : null;
|
|
1030
1030
|
}
|
|
1031
1031
|
const n = Number.parseFloat(t);
|
|
1032
|
-
return Number.isFinite(n) ?
|
|
1033
|
-
},
|
|
1032
|
+
return Number.isFinite(n) ? Mo(n) : null;
|
|
1033
|
+
}, ka = (e) => {
|
|
1034
1034
|
const t = e.trim(), n = /^(rgba?|RGBA?)\(\s*([^\)]*)\s*\)$/.exec(t);
|
|
1035
1035
|
if (!n) return null;
|
|
1036
1036
|
const i = n[1].toLowerCase(), o = n[2].split(",").map((s) => s.trim());
|
|
@@ -1041,7 +1041,7 @@ const wo = (e) => Math.min(1, Math.max(0, e)), Co = (e) => Math.min(255, Math.ma
|
|
|
1041
1041
|
}
|
|
1042
1042
|
if (i === "rgba") {
|
|
1043
1043
|
if (o.length !== 4) return null;
|
|
1044
|
-
const s = Dn(o[0]), a = Dn(o[1]), u = Dn(o[2]), f =
|
|
1044
|
+
const s = Dn(o[0]), a = Dn(o[1]), u = Dn(o[2]), f = Ua(o[3]);
|
|
1045
1045
|
return s == null || a == null || u == null || f == null ? null : [s / 255, a / 255, u / 255, f];
|
|
1046
1046
|
}
|
|
1047
1047
|
return null;
|
|
@@ -1049,21 +1049,21 @@ const wo = (e) => Math.min(1, Math.max(0, e)), Co = (e) => Math.min(255, Math.ma
|
|
|
1049
1049
|
if (typeof e != "string") return null;
|
|
1050
1050
|
const t = e.trim();
|
|
1051
1051
|
if (t.length === 0) return null;
|
|
1052
|
-
const n =
|
|
1052
|
+
const n = _a(t);
|
|
1053
1053
|
if (n) return n;
|
|
1054
|
-
const i =
|
|
1054
|
+
const i = ka(t);
|
|
1055
1055
|
return i || null;
|
|
1056
|
-
},
|
|
1056
|
+
}, Ga = (e, t = { r: 0, g: 0, b: 0, a: 1 }) => {
|
|
1057
1057
|
const n = ht(e);
|
|
1058
1058
|
if (!n) return t;
|
|
1059
1059
|
const [i, r, o, s] = n;
|
|
1060
1060
|
return { r: i, g: r, b: o, a: s };
|
|
1061
1061
|
}, Ri = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, Yr = (e) => {
|
|
1062
1062
|
throw new Error(`RenderCoordinator: unreachable value: ${String(e)}`);
|
|
1063
|
-
},
|
|
1063
|
+
}, za = (e) => Array.isArray(e), Va = (e) => za(e) ? { x: e[0], y: e[1] } : { x: e.x, y: e.y }, Lt = (e) => Math.min(1, Math.max(0, e)), Wa = (e) => {
|
|
1064
1064
|
const { canvasWidth: t, canvasHeight: n, devicePixelRatio: i } = e, r = e.left * i, o = t - e.right * i, s = e.top * i, a = n - e.bottom * i, u = mn(Math.floor(r), 0, Math.max(0, t)), f = mn(Math.floor(s), 0, Math.max(0, n)), l = mn(Math.ceil(o), 0, Math.max(0, t)), g = mn(Math.ceil(a), 0, Math.max(0, n)), c = Math.max(0, l - u), h = Math.max(0, g - f);
|
|
1065
1065
|
return { x: u, y: f, w: c, h };
|
|
1066
|
-
}, ri = (e, t) => (e + 1) / 2 * t, oi = (e, t) => (1 - e) / 2 * t, ir = 24 * 60 * 60 * 1e3,
|
|
1066
|
+
}, ri = (e, t) => (e + 1) / 2 * t, oi = (e, t) => (1 - e) / 2 * t, ir = 24 * 60 * 60 * 1e3, Oa = 30 * ir, Xa = 365 * ir, $a = [
|
|
1067
1067
|
"Jan",
|
|
1068
1068
|
"Feb",
|
|
1069
1069
|
"Mar",
|
|
@@ -1087,23 +1087,23 @@ const wo = (e) => Math.min(1, Math.max(0, e)), Co = (e) => Math.min(255, Math.ma
|
|
|
1087
1087
|
}
|
|
1088
1088
|
const i = Number.parseFloat(n);
|
|
1089
1089
|
return Number.isFinite(i) ? i : null;
|
|
1090
|
-
},
|
|
1090
|
+
}, Ya = (e) => Array.isArray(e), Ha = (e, t) => {
|
|
1091
1091
|
if (e == null) return { inner: 0, outer: t * 0.7 };
|
|
1092
|
-
if (
|
|
1092
|
+
if (Ya(e)) {
|
|
1093
1093
|
const r = gr(e[0], t), o = gr(e[1], t), s = Math.max(0, Number.isFinite(r) ? r : 0), a = Math.max(s, Number.isFinite(o) ? o : t * 0.7);
|
|
1094
1094
|
return { inner: s, outer: Math.min(t, a) };
|
|
1095
1095
|
}
|
|
1096
1096
|
const n = gr(e, t), i = Math.max(0, Number.isFinite(n) ? n : t * 0.7);
|
|
1097
1097
|
return { inner: 0, outer: Math.min(t, i) };
|
|
1098
|
-
}, qt = (e) => String(Math.trunc(e)).padStart(2, "0"),
|
|
1098
|
+
}, qt = (e) => String(Math.trunc(e)).padStart(2, "0"), qa = (e, t) => {
|
|
1099
1099
|
if (!Number.isFinite(e)) return null;
|
|
1100
1100
|
(!Number.isFinite(t) || t < 0) && (t = 0);
|
|
1101
1101
|
const n = new Date(e);
|
|
1102
1102
|
if (!Number.isFinite(n.getTime())) return null;
|
|
1103
1103
|
const i = n.getFullYear(), r = n.getMonth() + 1, o = n.getDate(), s = n.getHours(), a = n.getMinutes();
|
|
1104
|
-
return t < ir ? `${qt(s)}:${qt(a)}` : t <= 7 * ir ? `${qt(r)}/${qt(o)} ${qt(s)}:${qt(a)}` : t < 3 *
|
|
1105
|
-
},
|
|
1106
|
-
function
|
|
1104
|
+
return t < ir ? `${qt(s)}:${qt(a)}` : t <= 7 * ir ? `${qt(r)}/${qt(o)} ${qt(s)}:${qt(a)}` : t < 3 * Oa ? `${qt(r)}/${qt(o)}` : t <= Xa ? `${$a[n.getMonth()] ?? qt(r)} ${qt(o)}` : `${i}/${qt(r)}`;
|
|
1105
|
+
}, Za = 8;
|
|
1106
|
+
function ja(e, t = Za) {
|
|
1107
1107
|
const n = Math.abs(e);
|
|
1108
1108
|
if (!Number.isFinite(n) || n === 0) return 0;
|
|
1109
1109
|
for (let i = 0; i <= t; i++) {
|
|
@@ -1112,22 +1112,22 @@ function qa(e, t = Ha) {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
return Math.max(0, Math.min(t, 1 - Math.floor(Math.log10(n)) + 1));
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1116
|
-
const t =
|
|
1115
|
+
function Fo(e) {
|
|
1116
|
+
const t = ja(e);
|
|
1117
1117
|
return new Intl.NumberFormat(void 0, { maximumFractionDigits: t });
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function No(e, t) {
|
|
1120
1120
|
if (!Number.isFinite(t)) return null;
|
|
1121
1121
|
const n = Math.abs(t) < 1e-12 ? 0 : t, i = e.format(n);
|
|
1122
1122
|
return i === "NaN" ? null : i;
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function Ka(e) {
|
|
1125
1125
|
return Math.max(
|
|
1126
1126
|
e + 1,
|
|
1127
1127
|
Math.round(e * 1.15)
|
|
1128
1128
|
);
|
|
1129
1129
|
}
|
|
1130
|
-
const
|
|
1130
|
+
const To = 6, xr = 4, Ja = 5;
|
|
1131
1131
|
function br(e, t) {
|
|
1132
1132
|
return (e + 1) / 2 * t;
|
|
1133
1133
|
}
|
|
@@ -1137,24 +1137,24 @@ function vr(e, t) {
|
|
|
1137
1137
|
function Di(e, t, n) {
|
|
1138
1138
|
e.style.fontFamily = n.fontFamily, e.style.fontWeight = t ? "500" : "400", e.style.userSelect = "none", e.style.pointerEvents = "none";
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function Qa(e, t, n) {
|
|
1141
1141
|
var z, G, Y;
|
|
1142
1142
|
const { gpuContext: i, currentOptions: r, xScale: o, yScale: s, xTickValues: a, plotClipRect: u, visibleXRangeMs: f } = n;
|
|
1143
1143
|
if (!r.series.some((V) => V.type !== "pie") || !e || !t)
|
|
1144
1144
|
return;
|
|
1145
1145
|
const g = i.canvas;
|
|
1146
1146
|
if (!g) return;
|
|
1147
|
-
const c =
|
|
1147
|
+
const c = Ta(g), h = Aa(g);
|
|
1148
1148
|
if (c <= 0 || h <= 0) return;
|
|
1149
1149
|
const d = g.offsetLeft || 0, w = g.offsetTop || 0, P = br(u.left, c), R = br(u.right, c), T = vr(u.top, h), C = vr(u.bottom, h);
|
|
1150
1150
|
e.clear();
|
|
1151
|
-
const v = r.xAxis.tickLength ??
|
|
1151
|
+
const v = r.xAxis.tickLength ?? To, m = C + v + xr + r.theme.fontSize * 0.5, x = r.xAxis.type === "time", b = (() => {
|
|
1152
1152
|
if (x) return null;
|
|
1153
1153
|
const V = Ri(r.xAxis.min) ?? o.invert(u.left), j = Ri(r.xAxis.max) ?? o.invert(u.right), K = a.length, J = K === 1 ? 0 : (j - V) / (K - 1);
|
|
1154
|
-
return
|
|
1154
|
+
return Fo(J);
|
|
1155
1155
|
})();
|
|
1156
1156
|
for (let V = 0; V < a.length; V++) {
|
|
1157
|
-
const j = a[V], K = o.scale(j), J = br(K, c), oe = a.length === 1 ? "middle" : V === 0 ? "start" : V === a.length - 1 ? "end" : "middle", W = x ?
|
|
1157
|
+
const j = a[V], K = o.scale(j), J = br(K, c), oe = a.length === 1 ? "middle" : V === 0 ? "start" : V === a.length - 1 ? "end" : "middle", W = x ? qa(j, f) : No(b, j);
|
|
1158
1158
|
if (W == null) continue;
|
|
1159
1159
|
const fe = e.addLabel(W, d + J, w + m, {
|
|
1160
1160
|
fontSize: r.theme.fontSize,
|
|
@@ -1163,9 +1163,9 @@ function Ka(e, t, n) {
|
|
|
1163
1163
|
});
|
|
1164
1164
|
Di(fe, !1, r.theme);
|
|
1165
1165
|
}
|
|
1166
|
-
const M =
|
|
1166
|
+
const M = Ja, I = r.yAxis.tickLength ?? To, A = Ri(r.yAxis.min) ?? s.invert(u.bottom), S = Ri(r.yAxis.max) ?? s.invert(u.top), p = (S - A) / (M - 1), y = Fo(p), F = P - I - xr, N = [];
|
|
1167
1167
|
for (let V = 0; V < M; V++) {
|
|
1168
|
-
const j = V / (M - 1), K = A + j * (S - A), J = s.scale(K), oe = vr(J, h), W =
|
|
1168
|
+
const j = V / (M - 1), K = A + j * (S - A), J = s.scale(K), oe = vr(J, h), W = No(y, K);
|
|
1169
1169
|
if (W == null) continue;
|
|
1170
1170
|
const fe = e.addLabel(W, d + F, w + oe, {
|
|
1171
1171
|
fontSize: r.theme.fontSize,
|
|
@@ -1174,7 +1174,7 @@ function Ka(e, t, n) {
|
|
|
1174
1174
|
});
|
|
1175
1175
|
Di(fe, !1, r.theme), N.push(fe);
|
|
1176
1176
|
}
|
|
1177
|
-
const D =
|
|
1177
|
+
const D = Ka(r.theme.fontSize), B = ((z = r.xAxis.name) == null ? void 0 : z.trim()) ?? "";
|
|
1178
1178
|
if (B.length > 0) {
|
|
1179
1179
|
const V = (P + R) / 2, j = m + r.theme.fontSize * 0.5, oe = ((G = r.dataZoom) == null ? void 0 : G.some((_) => (_ == null ? void 0 : _.type) === "slider")) ?? !1 ? h - 32 : h, W = (j + oe) / 2, fe = e.addLabel(B, d + V, w + W, {
|
|
1180
1180
|
fontSize: D,
|
|
@@ -1194,7 +1194,7 @@ function Ka(e, t, n) {
|
|
|
1194
1194
|
Di(oe, !0, r.theme);
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function Ao(e) {
|
|
1198
1198
|
return "offsetLeft" in e;
|
|
1199
1199
|
}
|
|
1200
1200
|
function wr(e, t) {
|
|
@@ -1203,25 +1203,25 @@ function wr(e, t) {
|
|
|
1203
1203
|
function Cr(e, t) {
|
|
1204
1204
|
return (1 - e) / 2 * t;
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1206
|
+
function ec(e, t) {
|
|
1207
1207
|
const n = ht(e) ?? [0, 0, 0, 1], i = Lt(n[3] * Lt(t)), r = Math.round(Lt(n[0]) * 255), o = Math.round(Lt(n[1]) * 255), s = Math.round(Lt(n[2]) * 255);
|
|
1208
1208
|
return `rgba(${r}, ${o}, ${s}, ${i})`;
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1210
|
+
function tc(e, t) {
|
|
1211
1211
|
if (!Number.isFinite(e)) return "";
|
|
1212
1212
|
if (t == null) return String(e);
|
|
1213
1213
|
const n = Math.min(20, Math.max(0, Math.floor(t)));
|
|
1214
1214
|
return e.toFixed(n);
|
|
1215
1215
|
}
|
|
1216
|
-
const
|
|
1217
|
-
function
|
|
1218
|
-
return
|
|
1216
|
+
const Io = /\{(x|y|value|name)\}/g;
|
|
1217
|
+
function Po(e, t, n) {
|
|
1218
|
+
return Io.lastIndex = 0, e.replace(Io, (i, r) => {
|
|
1219
1219
|
if (r === "name") return t.name ?? "";
|
|
1220
1220
|
const o = t[r];
|
|
1221
|
-
return o == null ? "" :
|
|
1221
|
+
return o == null ? "" : tc(o, n);
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function nc(e) {
|
|
1225
1225
|
switch (e) {
|
|
1226
1226
|
case "center":
|
|
1227
1227
|
return "middle";
|
|
@@ -1232,7 +1232,7 @@ function ec(e) {
|
|
|
1232
1232
|
return "start";
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function ic(e, t, n) {
|
|
1236
1236
|
var R, T, C;
|
|
1237
1237
|
const {
|
|
1238
1238
|
currentOptions: i,
|
|
@@ -1252,7 +1252,7 @@ function tc(e, t, n) {
|
|
|
1252
1252
|
e.clear();
|
|
1253
1253
|
return;
|
|
1254
1254
|
}
|
|
1255
|
-
const d =
|
|
1255
|
+
const d = Ao(c) ? c.offsetLeft : 0, w = Ao(c) ? c.offsetTop : 0;
|
|
1256
1256
|
e.clear();
|
|
1257
1257
|
const P = i.annotations ?? [];
|
|
1258
1258
|
if (P.length !== 0)
|
|
@@ -1294,12 +1294,12 @@ function tc(e, t, n) {
|
|
|
1294
1294
|
const S = 200;
|
|
1295
1295
|
if (M < u - S || M > u + l + S || I < f - S || I > f + g + S)
|
|
1296
1296
|
continue;
|
|
1297
|
-
const p = ((R = x == null ? void 0 : x.offset) == null ? void 0 : R[0]) ?? 0, y = ((T = x == null ? void 0 : x.offset) == null ? void 0 : T[1]) ?? 0, F = M + p, N = I + y, D = (x == null ? void 0 : x.text) ?? (x != null && x.template ?
|
|
1297
|
+
const p = ((R = x == null ? void 0 : x.offset) == null ? void 0 : R[0]) ?? 0, y = ((T = x == null ? void 0 : x.offset) == null ? void 0 : T[1]) ?? 0, F = M + p, N = I + y, D = (x == null ? void 0 : x.text) ?? (x != null && x.template ? Po(x.template, A, x.decimals) : x ? (() => {
|
|
1298
1298
|
const W = m.type === "lineX" ? "x={x}" : m.type === "lineY" ? "y={y}" : m.type === "point" ? "({x}, {y})" : m.type === "text" ? m.text : "";
|
|
1299
|
-
return W.includes("{") ?
|
|
1299
|
+
return W.includes("{") ? Po(W, A, x.decimals) : W;
|
|
1300
1300
|
})() : m.type === "text" ? m.text : ""), B = typeof D == "string" ? D.trim() : "";
|
|
1301
1301
|
if (B.length === 0) continue;
|
|
1302
|
-
const E =
|
|
1302
|
+
const E = nc(x == null ? void 0 : x.anchor), z = ((C = m.style) == null ? void 0 : C.color) ?? i.theme.textColor, G = i.theme.fontSize, Y = x == null ? void 0 : x.background, V = (Y == null ? void 0 : Y.color) != null ? ec(Y.color, Y.opacity ?? 1) : void 0, j = (() => {
|
|
1303
1303
|
const W = Y == null ? void 0 : Y.padding;
|
|
1304
1304
|
return typeof W == "number" && Number.isFinite(W) ? [W, W, W, W] : Array.isArray(W) && W.length === 4 && W.every((fe) => typeof fe == "number" && Number.isFinite(fe)) ? [W[0], W[1], W[2], W[3]] : Y ? [2, 4, 2, 4] : void 0;
|
|
1305
1305
|
})(), K = typeof (Y == null ? void 0 : Y.borderRadius) == "number" && Number.isFinite(Y.borderRadius) ? Y.borderRadius : void 0, J = {
|
|
@@ -1326,8 +1326,8 @@ function tc(e, t, n) {
|
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
|
-
const
|
|
1330
|
-
function
|
|
1329
|
+
const Ro = 20, rc = 0.01, oc = 0.2, Mr = 4;
|
|
1330
|
+
function sc(e, t) {
|
|
1331
1331
|
let n = 0, i = Ie(e);
|
|
1332
1332
|
for (; n < i; ) {
|
|
1333
1333
|
const r = n + i >>> 1;
|
|
@@ -1335,26 +1335,26 @@ function rc(e, t) {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
return n;
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function ac(e, t, n) {
|
|
1339
1339
|
return e >= n.left && e <= n.right && t >= n.top && t <= n.bottom;
|
|
1340
1340
|
}
|
|
1341
|
-
const Sr = (e) => Math.min(1, Math.max(0, e)),
|
|
1341
|
+
const Sr = (e) => Math.min(1, Math.max(0, e)), cc = (e) => {
|
|
1342
1342
|
const t = e.trim().match(/^(\d+(?:\.\d+)?)%$/);
|
|
1343
1343
|
if (!t) return null;
|
|
1344
1344
|
const n = Number(t[1]) / 100;
|
|
1345
1345
|
return Number.isFinite(n) ? n : null;
|
|
1346
|
-
},
|
|
1346
|
+
}, lc = (e) => {
|
|
1347
1347
|
if (typeof e != "string") return "";
|
|
1348
1348
|
const t = e.trim();
|
|
1349
1349
|
return t.length > 0 ? t : "";
|
|
1350
|
-
},
|
|
1351
|
-
if (
|
|
1350
|
+
}, js = (e) => Array.isArray(e), uc = (e) => {
|
|
1351
|
+
if (js(e)) {
|
|
1352
1352
|
const n = e[2];
|
|
1353
1353
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
1354
1354
|
}
|
|
1355
1355
|
const t = e.size;
|
|
1356
1356
|
return typeof t == "number" && Number.isFinite(t) ? t : null;
|
|
1357
|
-
},
|
|
1357
|
+
}, fc = (e) => js(e) ? e : [e.x, e.y, e.size], dc = (e, t) => {
|
|
1358
1358
|
try {
|
|
1359
1359
|
const n = e(t);
|
|
1360
1360
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
@@ -1362,22 +1362,22 @@ const Sr = (e) => Math.min(1, Math.max(0, e)), sc = (e) => {
|
|
|
1362
1362
|
return null;
|
|
1363
1363
|
}
|
|
1364
1364
|
}, Fr = (e, t) => {
|
|
1365
|
-
const n =
|
|
1365
|
+
const n = uc(t);
|
|
1366
1366
|
if (n != null) return Math.max(0, n);
|
|
1367
1367
|
const i = e.symbolSize;
|
|
1368
1368
|
if (typeof i == "number")
|
|
1369
1369
|
return Number.isFinite(i) ? Math.max(0, i) : Mr;
|
|
1370
1370
|
if (typeof i == "function") {
|
|
1371
|
-
const r =
|
|
1371
|
+
const r = dc(i, fc(t));
|
|
1372
1372
|
return r == null ? Mr : Math.max(0, r);
|
|
1373
1373
|
}
|
|
1374
1374
|
return Mr;
|
|
1375
1375
|
};
|
|
1376
|
-
function
|
|
1376
|
+
function mc(e) {
|
|
1377
1377
|
const t = /* @__PURE__ */ new Map(), n = new Array(e.length), i = new Array(e.length);
|
|
1378
1378
|
let r = 0;
|
|
1379
1379
|
for (let o = 0; o < e.length; o++) {
|
|
1380
|
-
const s =
|
|
1380
|
+
const s = lc(e[o].stack);
|
|
1381
1381
|
if (i[o] = s, s !== "") {
|
|
1382
1382
|
const a = t.get(s);
|
|
1383
1383
|
if (a !== void 0)
|
|
@@ -1395,7 +1395,7 @@ function fc(e) {
|
|
|
1395
1395
|
stackIdBySeries: i
|
|
1396
1396
|
};
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
1398
|
+
function pc(e) {
|
|
1399
1399
|
const t = [];
|
|
1400
1400
|
for (let i = 0; i < e.length; i++) {
|
|
1401
1401
|
const r = e[i].data, o = Ie(r);
|
|
@@ -1413,7 +1413,7 @@ function dc(e) {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
return Number.isFinite(n) && n > 0 ? n : 1;
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1416
|
+
function hc(e, t, n) {
|
|
1417
1417
|
if (Number.isFinite(n) && n > 0) {
|
|
1418
1418
|
const s = t.scale(0), a = t.scale(0 + n), u = Math.abs(a - s);
|
|
1419
1419
|
if (Number.isFinite(u) && u > 0) return u;
|
|
@@ -1437,7 +1437,7 @@ function mc(e, t, n) {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
return Number.isFinite(r) && r > 0 ? r : 0;
|
|
1439
1439
|
}
|
|
1440
|
-
const
|
|
1440
|
+
const yc = (e) => {
|
|
1441
1441
|
let t, n, i;
|
|
1442
1442
|
for (let r = 0; r < e.length; r++) {
|
|
1443
1443
|
const o = e[r];
|
|
@@ -1445,14 +1445,14 @@ const pc = (e) => {
|
|
|
1445
1445
|
}
|
|
1446
1446
|
return { barWidth: t, barGap: n, barCategoryGap: i };
|
|
1447
1447
|
};
|
|
1448
|
-
function
|
|
1449
|
-
const n =
|
|
1448
|
+
function Ks(e, t) {
|
|
1449
|
+
const n = mc(e), i = n.clusterCount, r = pc(e), o = hc(e, t, r), s = yc(e), a = Sr(s.barGap ?? rc), u = Sr(s.barCategoryGap ?? oc), f = Math.max(0, o * (1 - u)), l = i + Math.max(0, i - 1) * a, g = l > 0 ? f / l : 0;
|
|
1450
1450
|
let c = 0;
|
|
1451
1451
|
const h = s.barWidth;
|
|
1452
1452
|
if (typeof h == "number")
|
|
1453
1453
|
c = Math.max(0, h), c = Math.min(c, g);
|
|
1454
1454
|
else if (typeof h == "string") {
|
|
1455
|
-
const P =
|
|
1455
|
+
const P = cc(h);
|
|
1456
1456
|
c = P == null ? 0 : g * Sr(P);
|
|
1457
1457
|
}
|
|
1458
1458
|
c > 0 || (c = g);
|
|
@@ -1477,7 +1477,7 @@ const Nr = (e) => {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
return !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 && 0 <= n ? 0 : Math.abs(t) < Math.abs(n) ? t : n;
|
|
1479
1479
|
};
|
|
1480
|
-
function
|
|
1480
|
+
function gc(e, t) {
|
|
1481
1481
|
let n = 0;
|
|
1482
1482
|
for (let i = 0; i < e.length; i++) {
|
|
1483
1483
|
const r = e[i].data, o = Ie(r);
|
|
@@ -1490,20 +1490,20 @@ function hc(e, t) {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
return Math.max(0, n);
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function xc(e, t, n) {
|
|
1494
1494
|
const i = t.invert(n), r = t.invert(0), o = Math.min(i, r), s = Math.max(i, r);
|
|
1495
1495
|
let a;
|
|
1496
1496
|
!Number.isFinite(o) || !Number.isFinite(s) ? a = Nr(e) : o <= 0 && 0 <= s ? a = 0 : o > 0 ? a = o : s < 0 ? a = s : a = Nr(e);
|
|
1497
1497
|
let u = t.scale(a);
|
|
1498
1498
|
return Number.isFinite(u) || (a = Nr(e), u = t.scale(a)), Number.isFinite(u) || (a = 0, u = t.scale(0)), { baselineDomain: a, baselinePx: u };
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function bc(e, t, n, i) {
|
|
1501
1501
|
return Number.isFinite(t) && t > 0 && Number.isFinite(e) ? Math.round(e / t) : Number.isFinite(i) && i > 0 && Number.isFinite(n) ? Math.round(n / i) : Math.round(n * 1e6);
|
|
1502
1502
|
}
|
|
1503
|
-
function rr(e, t, n, i, r, o =
|
|
1503
|
+
function rr(e, t, n, i, r, o = Ro) {
|
|
1504
1504
|
var R;
|
|
1505
1505
|
if (!Number.isFinite(t) || !Number.isFinite(n)) return null;
|
|
1506
|
-
const s = Number.isFinite(o) ? Math.max(0, o) :
|
|
1506
|
+
const s = Number.isFinite(o) ? Math.max(0, o) : Ro, a = s * s, u = i.invert(t);
|
|
1507
1507
|
if (!Number.isFinite(u)) return null;
|
|
1508
1508
|
let f = -1, l = -1, g = null, c = Number.POSITIVE_INFINITY;
|
|
1509
1509
|
const h = [], d = [];
|
|
@@ -1512,9 +1512,9 @@ function rr(e, t, n, i, r, o = Io) {
|
|
|
1512
1512
|
(C == null ? void 0 : C.type) === "bar" && C.visible !== !1 && (h.push(C), d.push(T));
|
|
1513
1513
|
}
|
|
1514
1514
|
if (h.length > 0) {
|
|
1515
|
-
const T =
|
|
1515
|
+
const T = Ks(h, i);
|
|
1516
1516
|
if (T.barWidthPx > 0 && T.clusterWidthPx >= 0) {
|
|
1517
|
-
const C =
|
|
1517
|
+
const C = gc(h, r), { baselineDomain: v, baselinePx: m } = xc(h, r, C), { clusterSlots: x, barWidthPx: b, gapPx: M, clusterWidthPx: I, categoryWidthPx: A, categoryStep: S } = T, p = /* @__PURE__ */ new Map();
|
|
1518
1518
|
let y = null;
|
|
1519
1519
|
for (let F = 0; F < h.length; F++) {
|
|
1520
1520
|
const N = h[F], D = d[F] ?? -1;
|
|
@@ -1530,7 +1530,7 @@ function rr(e, t, n, i, r, o = Io) {
|
|
|
1530
1530
|
if (G !== "") {
|
|
1531
1531
|
let ce = p.get(G);
|
|
1532
1532
|
ce || (ce = /* @__PURE__ */ new Map(), p.set(G, ce));
|
|
1533
|
-
const me =
|
|
1533
|
+
const me = bc(K, A, V, S);
|
|
1534
1534
|
let q = ce.get(me);
|
|
1535
1535
|
q || (q = { posSum: v, negSum: v }, ce.set(me, q)), j >= 0 ? (W = q.posSum, fe = W + j, q.posSum = fe) : (W = q.negSum, fe = W + j, q.negSum = fe);
|
|
1536
1536
|
} else
|
|
@@ -1543,7 +1543,7 @@ function rr(e, t, n, i, r, o = Io) {
|
|
|
1543
1543
|
top: Math.min(_, H),
|
|
1544
1544
|
bottom: Math.max(_, H)
|
|
1545
1545
|
};
|
|
1546
|
-
if (!
|
|
1546
|
+
if (!ac(t, n, X)) continue;
|
|
1547
1547
|
(y === null || X.top < y.top || X.top === y.top && D > y.seriesIndex) && (y = { seriesIndex: D, dataIndex: Y, top: X.top });
|
|
1548
1548
|
}
|
|
1549
1549
|
}
|
|
@@ -1573,7 +1573,7 @@ function rr(e, t, n, i, r, o = Io) {
|
|
|
1573
1573
|
if (x === 0) continue;
|
|
1574
1574
|
const M = C.type === "scatter" ? C : null;
|
|
1575
1575
|
if (no(m)) {
|
|
1576
|
-
const A =
|
|
1576
|
+
const A = sc(m, u);
|
|
1577
1577
|
for (let S = A; S < x; S++) {
|
|
1578
1578
|
const p = Ae(m, S), y = Ue(m, S);
|
|
1579
1579
|
if (!Number.isFinite(p) || !Number.isFinite(y)) continue;
|
|
@@ -1639,8 +1639,8 @@ function rr(e, t, n, i, r, o = Io) {
|
|
|
1639
1639
|
distance: Math.sqrt(c)
|
|
1640
1640
|
};
|
|
1641
1641
|
}
|
|
1642
|
-
const
|
|
1643
|
-
function
|
|
1642
|
+
const vc = 5, wc = 1, Cc = 4;
|
|
1643
|
+
function Mc(e, t) {
|
|
1644
1644
|
var w;
|
|
1645
1645
|
const {
|
|
1646
1646
|
currentOptions: n,
|
|
@@ -1687,14 +1687,14 @@ function wc(e, t) {
|
|
|
1687
1687
|
o,
|
|
1688
1688
|
n.theme.axisLineColor,
|
|
1689
1689
|
n.theme.axisTickColor,
|
|
1690
|
-
|
|
1690
|
+
vc
|
|
1691
1691
|
)), u.hasPointer && u.isInGrid) {
|
|
1692
1692
|
const P = {
|
|
1693
1693
|
showX: !0,
|
|
1694
1694
|
// Sync has no meaningful y, so avoid horizontal line.
|
|
1695
1695
|
showY: u.source !== "sync",
|
|
1696
1696
|
color: g(n.theme.axisLineColor, 0.6),
|
|
1697
|
-
lineWidth:
|
|
1697
|
+
lineWidth: wc
|
|
1698
1698
|
};
|
|
1699
1699
|
e.crosshairRenderer.prepare(u.x, u.y, o, P), e.crosshairRenderer.setVisible(!0);
|
|
1700
1700
|
} else
|
|
@@ -1709,9 +1709,9 @@ function wc(e, t) {
|
|
|
1709
1709
|
f.yScale
|
|
1710
1710
|
);
|
|
1711
1711
|
if (P) {
|
|
1712
|
-
const { x: R, y: T } =
|
|
1712
|
+
const { x: R, y: T } = Va(P.point), C = f.xScale.scale(R), v = f.yScale.scale(T);
|
|
1713
1713
|
if (Number.isFinite(C) && Number.isFinite(v)) {
|
|
1714
|
-
const m = o.left + C, x = o.top + v, b =
|
|
1714
|
+
const m = o.left + C, x = o.top + v, b = Wa(o), M = {
|
|
1715
1715
|
centerDeviceX: m * o.devicePixelRatio,
|
|
1716
1716
|
centerDeviceY: x * o.devicePixelRatio,
|
|
1717
1717
|
devicePixelRatio: o.devicePixelRatio,
|
|
@@ -1719,7 +1719,7 @@ function wc(e, t) {
|
|
|
1719
1719
|
canvasHeight: o.canvasHeight,
|
|
1720
1720
|
scissor: b
|
|
1721
1721
|
}, I = ((w = n.series[P.seriesIndex]) == null ? void 0 : w.color) ?? "#888";
|
|
1722
|
-
e.highlightRenderer.prepare(M, I,
|
|
1722
|
+
e.highlightRenderer.prepare(M, I, Cc), e.highlightRenderer.setVisible(!0);
|
|
1723
1723
|
} else
|
|
1724
1724
|
e.highlightRenderer.setVisible(!1);
|
|
1725
1725
|
} else
|
|
@@ -1729,29 +1729,29 @@ function wc(e, t) {
|
|
|
1729
1729
|
else
|
|
1730
1730
|
e.highlightRenderer.setVisible(!1);
|
|
1731
1731
|
}
|
|
1732
|
-
function
|
|
1732
|
+
function Do(e, t, n) {
|
|
1733
1733
|
const i = ht(e ?? n) ?? ht(n) ?? [1, 1, 1, 1], r = t == null ? 1 : Lt(t);
|
|
1734
1734
|
return [Lt(i[0]), Lt(i[1]), Lt(i[2]), Lt(i[3] * r)];
|
|
1735
1735
|
}
|
|
1736
|
-
function
|
|
1736
|
+
function Sc(e, t) {
|
|
1737
1737
|
const n = ht(e) ?? [0, 0, 0, 1], i = Lt(n[3] * Lt(t)), r = Math.round(Lt(n[0]) * 255), o = Math.round(Lt(n[1]) * 255), s = Math.round(Lt(n[2]) * 255);
|
|
1738
1738
|
return `rgba(${r}, ${o}, ${s}, ${i})`;
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1740
|
+
function Fc(e, t) {
|
|
1741
1741
|
if (!Number.isFinite(e)) return "";
|
|
1742
1742
|
if (t == null) return String(e);
|
|
1743
1743
|
const n = Math.min(20, Math.max(0, Math.floor(t)));
|
|
1744
1744
|
return e.toFixed(n);
|
|
1745
1745
|
}
|
|
1746
|
-
function
|
|
1746
|
+
function Eo(e, t, n) {
|
|
1747
1747
|
const i = /\{(x|y|value|name)\}/g;
|
|
1748
1748
|
return e.replace(i, (r, o) => {
|
|
1749
1749
|
if (o === "name") return t.name ?? "";
|
|
1750
1750
|
const s = t[o];
|
|
1751
|
-
return s == null ? "" :
|
|
1751
|
+
return s == null ? "" : Fc(s, n);
|
|
1752
1752
|
});
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1754
|
+
function Nc(e) {
|
|
1755
1755
|
switch (e) {
|
|
1756
1756
|
case "center":
|
|
1757
1757
|
return "middle";
|
|
@@ -1762,7 +1762,7 @@ function Sc(e) {
|
|
|
1762
1762
|
return "start";
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
1765
|
-
function
|
|
1765
|
+
function Tc(e) {
|
|
1766
1766
|
var C, v, m, x, b, M, I, A, S, p, y, F, N, D;
|
|
1767
1767
|
const {
|
|
1768
1768
|
annotations: t,
|
|
@@ -1778,7 +1778,7 @@ function Fc(e) {
|
|
|
1778
1778
|
if (t.length === 0 || o <= 0 || s <= 0 || c <= 0 || h <= 0)
|
|
1779
1779
|
return { linesBelow: d, linesAbove: w, markersBelow: P, markersAbove: R, labels: T };
|
|
1780
1780
|
for (let B = 0; B < t.length; B++) {
|
|
1781
|
-
const E = t[B], z = E.layer ?? "aboveSeries", G = z === "belowSeries" ? d : w, Y = z === "belowSeries" ? P : R, V = (C = E.style) == null ? void 0 : C.color, j = (v = E.style) == null ? void 0 : v.opacity, K = typeof ((m = E.style) == null ? void 0 : m.lineWidth) == "number" && Number.isFinite(E.style.lineWidth) ? Math.max(0, E.style.lineWidth) : 1, J = (x = E.style) == null ? void 0 : x.lineDash, oe =
|
|
1781
|
+
const E = t[B], z = E.layer ?? "aboveSeries", G = z === "belowSeries" ? d : w, Y = z === "belowSeries" ? P : R, V = (C = E.style) == null ? void 0 : C.color, j = (v = E.style) == null ? void 0 : v.opacity, K = typeof ((m = E.style) == null ? void 0 : m.lineWidth) == "number" && Number.isFinite(E.style.lineWidth) ? Math.max(0, E.style.lineWidth) : 1, J = (x = E.style) == null ? void 0 : x.lineDash, oe = Do(V, j, a.textColor);
|
|
1782
1782
|
switch (E.type) {
|
|
1783
1783
|
case "lineX": {
|
|
1784
1784
|
const ve = n.scale(E.x), Te = ri(ve, o);
|
|
@@ -1807,7 +1807,7 @@ function Fc(e) {
|
|
|
1807
1807
|
case "point": {
|
|
1808
1808
|
const ve = n.scale(E.x), Te = i.scale(E.y), Xe = ri(ve, o), He = oi(Te, s);
|
|
1809
1809
|
if (!Number.isFinite(Xe) || !Number.isFinite(He)) break;
|
|
1810
|
-
const ke = typeof ((b = E.marker) == null ? void 0 : b.size) == "number" && Number.isFinite(E.marker.size) ? Math.max(1, E.marker.size) : 6, bt = ((I = (M = E.marker) == null ? void 0 : M.style) == null ? void 0 : I.color) ?? ((A = E.style) == null ? void 0 : A.color), vt = ((p = (S = E.marker) == null ? void 0 : S.style) == null ? void 0 : p.opacity) ?? ((y = E.style) == null ? void 0 : y.opacity), We =
|
|
1810
|
+
const ke = typeof ((b = E.marker) == null ? void 0 : b.size) == "number" && Number.isFinite(E.marker.size) ? Math.max(1, E.marker.size) : 6, bt = ((I = (M = E.marker) == null ? void 0 : M.style) == null ? void 0 : I.color) ?? ((A = E.style) == null ? void 0 : A.color), vt = ((p = (S = E.marker) == null ? void 0 : S.style) == null ? void 0 : p.opacity) ?? ((y = E.style) == null ? void 0 : y.opacity), We = Do(bt, vt, a.textColor);
|
|
1811
1811
|
Y.push({
|
|
1812
1812
|
xCssPx: Xe,
|
|
1813
1813
|
yCssPx: He,
|
|
@@ -1858,12 +1858,12 @@ function Fc(e) {
|
|
|
1858
1858
|
const pe = 200;
|
|
1859
1859
|
if (_ < r.leftCss - pe || _ > r.leftCss + r.widthCss + pe || H < r.topCss - pe || H > r.topCss + r.heightCss + pe)
|
|
1860
1860
|
continue;
|
|
1861
|
-
const ce = ((F = W == null ? void 0 : W.offset) == null ? void 0 : F[0]) ?? 0, me = ((N = W == null ? void 0 : W.offset) == null ? void 0 : N[1]) ?? 0, q = _ + ce, se = H + me, te = (W == null ? void 0 : W.text) ?? (W != null && W.template ?
|
|
1861
|
+
const ce = ((F = W == null ? void 0 : W.offset) == null ? void 0 : F[0]) ?? 0, me = ((N = W == null ? void 0 : W.offset) == null ? void 0 : N[1]) ?? 0, q = _ + ce, se = H + me, te = (W == null ? void 0 : W.text) ?? (W != null && W.template ? Eo(W.template, X, W.decimals) : W ? (() => {
|
|
1862
1862
|
const ve = E.type === "lineX" ? "x={x}" : E.type === "lineY" ? "y={y}" : E.type === "point" ? "({x}, {y})" : E.type === "text" ? E.text : "";
|
|
1863
|
-
return ve.includes("{") ?
|
|
1863
|
+
return ve.includes("{") ? Eo(ve, X, W.decimals) : ve;
|
|
1864
1864
|
})() : E.type === "text" ? E.text : ""), ee = typeof te == "string" ? te.trim() : "";
|
|
1865
1865
|
if (ee.length === 0) continue;
|
|
1866
|
-
const be =
|
|
1866
|
+
const be = Nc(W == null ? void 0 : W.anchor), le = ((D = E.style) == null ? void 0 : D.color) ?? a.textColor, ge = a.fontSize, ye = W == null ? void 0 : W.background, Be = (ye == null ? void 0 : ye.color) != null ? Sc(ye.color, ye.opacity ?? 1) : void 0, Le = (() => {
|
|
1867
1867
|
const ve = ye == null ? void 0 : ye.padding;
|
|
1868
1868
|
return typeof ve == "number" && Number.isFinite(ve) ? [ve, ve, ve, ve] : Array.isArray(ve) && ve.length === 4 && ve.every((Te) => typeof Te == "number" && Number.isFinite(Te)) ? [ve[0], ve[1], ve[2], ve[3]] : ye ? [2, 4, 2, 4] : void 0;
|
|
1869
1869
|
})(), st = typeof (ye == null ? void 0 : ye.borderRadius) == "number" && Number.isFinite(ye.borderRadius) ? ye.borderRadius : void 0, rt = {
|
|
@@ -1891,13 +1891,13 @@ function Fc(e) {
|
|
|
1891
1891
|
labels: T
|
|
1892
1892
|
};
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function Js(e) {
|
|
1895
1895
|
return Math.max(0, Math.min(1, e));
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1897
|
+
function Ac(e) {
|
|
1898
1898
|
return e.type === "area" || e.type === "line" && !!e.areaStyle;
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1900
|
+
function Ic(e, t) {
|
|
1901
1901
|
const {
|
|
1902
1902
|
currentOptions: n,
|
|
1903
1903
|
seriesForRender: i,
|
|
@@ -1913,7 +1913,7 @@ function Tc(e, t) {
|
|
|
1913
1913
|
introProgress01: h,
|
|
1914
1914
|
withAlpha: d,
|
|
1915
1915
|
maxRadiusCss: w
|
|
1916
|
-
} = t, P = n.yAxis.min ?? n.yAxis.min ?? 0, R = [], T = c === "running" ?
|
|
1916
|
+
} = t, P = n.yAxis.min ?? n.yAxis.min ?? 0, R = [], T = c === "running" ? Js(h) : 1;
|
|
1917
1917
|
for (let m = 0; m < i.length; m++) {
|
|
1918
1918
|
const x = i[m];
|
|
1919
1919
|
switch (x.type) {
|
|
@@ -1966,7 +1966,7 @@ function Tc(e, t) {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
case "scatter": {
|
|
1968
1968
|
if (x.mode === "density") {
|
|
1969
|
-
const b = x.rawData ?? x.data, M =
|
|
1969
|
+
const b = x.rawData ?? x.data, M = La(b, g.min, g.max);
|
|
1970
1970
|
u.has(m) || a.setSeries(m, b);
|
|
1971
1971
|
const I = a.getSeriesBuffer(m), A = a.getSeriesPointCount(m);
|
|
1972
1972
|
e.scatterDensityRenderers[m].prepare(
|
|
@@ -1988,7 +1988,7 @@ function Tc(e, t) {
|
|
|
1988
1988
|
}
|
|
1989
1989
|
case "pie": {
|
|
1990
1990
|
if (T < 1 && w > 0) {
|
|
1991
|
-
const b =
|
|
1991
|
+
const b = Ha(x.radius, w), M = Math.max(0, b.inner) * T, I = Math.max(M, b.outer) * T, A = { ...x, radius: [M, I] };
|
|
1992
1992
|
e.pieRenderers[m].prepare(A, s);
|
|
1993
1993
|
break;
|
|
1994
1994
|
}
|
|
@@ -2012,13 +2012,13 @@ function Tc(e, t) {
|
|
|
2012
2012
|
visibleBarSeriesConfigs: v
|
|
2013
2013
|
};
|
|
2014
2014
|
}
|
|
2015
|
-
function
|
|
2015
|
+
function Pc(e, t, n) {
|
|
2016
2016
|
for (let i = 0; i < t.length; i++) {
|
|
2017
2017
|
const r = t[i];
|
|
2018
2018
|
r.visible !== !1 && r.type === "scatter" && r.mode === "density" && e.scatterDensityRenderers[i].encodeCompute(n);
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
|
2021
|
-
function
|
|
2021
|
+
function Rc(e, t, n, i) {
|
|
2022
2022
|
const {
|
|
2023
2023
|
hasCartesianSeries: r,
|
|
2024
2024
|
gridArea: o,
|
|
@@ -2028,7 +2028,7 @@ function Ic(e, t, n, i) {
|
|
|
2028
2028
|
introProgress01: f,
|
|
2029
2029
|
referenceLineBelowCount: l,
|
|
2030
2030
|
markerBelowCount: g
|
|
2031
|
-
} = n, { visibleSeriesForRender: c } = i, h = u === "running" ?
|
|
2031
|
+
} = n, { visibleSeriesForRender: c } = i, h = u === "running" ? Js(f) : 1;
|
|
2032
2032
|
for (let d = 0; d < c.length; d++) {
|
|
2033
2033
|
const { series: w, originalIndex: P } = c[d];
|
|
2034
2034
|
w.type === "pie" && e.pieRenderers[P].render(s);
|
|
@@ -2036,7 +2036,7 @@ function Ic(e, t, n, i) {
|
|
|
2036
2036
|
r && a.w > 0 && a.h > 0 && (l > 0 || g > 0) && (s.setScissorRect(a.x, a.y, a.w, a.h), l > 0 && t.referenceLineRenderer.render(s, 0, l), g > 0 && t.annotationMarkerRenderer.render(s, 0, g), s.setScissorRect(0, 0, o.canvasWidth, o.canvasHeight));
|
|
2037
2037
|
for (let d = 0; d < c.length; d++) {
|
|
2038
2038
|
const { series: w, originalIndex: P } = c[d];
|
|
2039
|
-
if (
|
|
2039
|
+
if (Ac(w))
|
|
2040
2040
|
if (h < 1) {
|
|
2041
2041
|
const R = mn(Math.floor(a.w * h), 0, a.w);
|
|
2042
2042
|
R > 0 && a.h > 0 && (s.setScissorRect(a.x, a.y, R, a.h), e.areaRenderers[P].render(s), s.setScissorRect(0, 0, o.canvasWidth, o.canvasHeight));
|
|
@@ -2062,7 +2062,7 @@ function Ic(e, t, n, i) {
|
|
|
2062
2062
|
s.setScissorRect(a.x, a.y, a.w, a.h), e.lineRenderers[P].render(s), s.setScissorRect(0, 0, o.canvasWidth, o.canvasHeight);
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
function
|
|
2065
|
+
function Dc(e, t) {
|
|
2066
2066
|
const {
|
|
2067
2067
|
hasCartesianSeries: n,
|
|
2068
2068
|
gridArea: i,
|
|
@@ -2114,13 +2114,13 @@ fn vsMain(in: VSIn) -> VSOut {
|
|
|
2114
2114
|
fn fsMain() -> @location(0) vec4<f32> {
|
|
2115
2115
|
return fsUniforms.color;
|
|
2116
2116
|
}
|
|
2117
|
-
`,
|
|
2117
|
+
`, Ec = "vsMain", Bc = "fsMain", Lc = (e) => Number.isInteger(e) && e > 0 && (e & e - 1) === 0, _c = (e, t) => {
|
|
2118
2118
|
if (!Number.isFinite(e) || e < 0)
|
|
2119
2119
|
throw new Error(`alignTo(value): value must be a finite non-negative number. Received: ${String(e)}`);
|
|
2120
|
-
if (!
|
|
2120
|
+
if (!Lc(t))
|
|
2121
2121
|
throw new Error(`alignTo(alignment): alignment must be a positive power of two. Received: ${String(t)}`);
|
|
2122
2122
|
return Math.floor(e) + t - 1 & ~(t - 1);
|
|
2123
|
-
},
|
|
2123
|
+
}, Bo = (e, t, n) => {
|
|
2124
2124
|
if (n && n.device !== e)
|
|
2125
2125
|
throw new Error("getStageModule(pipelineCache): cache.device must match the provided GPUDevice.");
|
|
2126
2126
|
return "module" in t ? {
|
|
@@ -2128,12 +2128,12 @@ fn fsMain() -> @location(0) vec4<f32> {
|
|
|
2128
2128
|
entryPoint: t.entryPoint || "",
|
|
2129
2129
|
constants: t.constants
|
|
2130
2130
|
} : {
|
|
2131
|
-
module:
|
|
2131
|
+
module: Qs(e, t.code, t.label, n),
|
|
2132
2132
|
entryPoint: t.entryPoint || "",
|
|
2133
2133
|
constants: t.constants
|
|
2134
2134
|
};
|
|
2135
2135
|
};
|
|
2136
|
-
function
|
|
2136
|
+
function Qs(e, t, n, i) {
|
|
2137
2137
|
if (typeof t != "string" || t.length === 0)
|
|
2138
2138
|
throw new Error("createShaderModule(code): WGSL code must be a non-empty string.");
|
|
2139
2139
|
if (i) {
|
|
@@ -2146,10 +2146,10 @@ function Ks(e, t, n, i) {
|
|
|
2146
2146
|
function _t(e, t, n) {
|
|
2147
2147
|
if (n && n.device !== e)
|
|
2148
2148
|
throw new Error("createRenderPipeline(pipelineCache): cache.device must match the provided GPUDevice.");
|
|
2149
|
-
const i =
|
|
2149
|
+
const i = Bo(e, t.vertex, n), r = i.entryPoint || Ec;
|
|
2150
2150
|
let o;
|
|
2151
2151
|
if (t.fragment) {
|
|
2152
|
-
const l =
|
|
2152
|
+
const l = Bo(e, t.fragment, n), g = l.entryPoint || Bc;
|
|
2153
2153
|
let c;
|
|
2154
2154
|
if (t.fragment.targets)
|
|
2155
2155
|
c = [...t.fragment.targets];
|
|
@@ -2203,7 +2203,7 @@ function _t(e, t, n) {
|
|
|
2203
2203
|
};
|
|
2204
2204
|
return n ? n.getOrCreateRenderPipeline(f) : e.createRenderPipeline(f);
|
|
2205
2205
|
}
|
|
2206
|
-
function
|
|
2206
|
+
function Lo(e, t, n) {
|
|
2207
2207
|
if (n && n.device !== e)
|
|
2208
2208
|
throw new Error("createComputePipeline(pipelineCache): cache.device must match the provided GPUDevice.");
|
|
2209
2209
|
return n ? n.getOrCreateComputePipeline(t) : e.createComputePipeline(t);
|
|
@@ -2211,7 +2211,7 @@ function Eo(e, t, n) {
|
|
|
2211
2211
|
function mt(e, t, n) {
|
|
2212
2212
|
if (!Number.isFinite(t) || t <= 0)
|
|
2213
2213
|
throw new Error(`createUniformBuffer(size): size must be a positive number. Received: ${String(t)}`);
|
|
2214
|
-
const i = (n == null ? void 0 : n.alignment) ?? 16, r =
|
|
2214
|
+
const i = (n == null ? void 0 : n.alignment) ?? 16, r = _c(t, Math.max(4, i)), o = e.limits.maxUniformBufferBindingSize;
|
|
2215
2215
|
if (r > o)
|
|
2216
2216
|
throw new Error(
|
|
2217
2217
|
`createUniformBuffer(size): requested size ${r} exceeds device.limits.maxUniformBufferBindingSize (${o}).`
|
|
@@ -2234,7 +2234,7 @@ function ft(e, t, n) {
|
|
|
2234
2234
|
e.queue.writeBuffer(t, 0, i.arrayBuffer, i.offset, i.size);
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
|
-
const
|
|
2237
|
+
const Uc = "bgra8unorm", kc = 5, Gc = 6, zc = [1, 1, 1, 0.8], Vc = () => {
|
|
2238
2238
|
const e = new ArrayBuffer(64);
|
|
2239
2239
|
return new Float32Array(e).set([
|
|
2240
2240
|
1,
|
|
@@ -2258,7 +2258,7 @@ const Lc = "bgra8unorm", _c = 5, Uc = 6, kc = [1, 1, 1, 0.8], Gc = () => {
|
|
|
2258
2258
|
1
|
|
2259
2259
|
// col3
|
|
2260
2260
|
]), e;
|
|
2261
|
-
},
|
|
2261
|
+
}, Wc = (e) => Number.isFinite(e.left) && Number.isFinite(e.right) && Number.isFinite(e.top) && Number.isFinite(e.bottom) && Number.isFinite(e.canvasWidth) && Number.isFinite(e.canvasHeight), _o = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, Oc = (e, t) => {
|
|
2262
2262
|
let n = e, i = t;
|
|
2263
2263
|
if ((!Number.isFinite(n) || !Number.isFinite(i)) && (n = 0, i = 1), n === i)
|
|
2264
2264
|
i = n + 1;
|
|
@@ -2267,21 +2267,21 @@ const Lc = "bgra8unorm", _c = 5, Uc = 6, kc = [1, 1, 1, 0.8], Gc = () => {
|
|
|
2267
2267
|
n = i, i = r;
|
|
2268
2268
|
}
|
|
2269
2269
|
return { min: n, max: i };
|
|
2270
|
-
},
|
|
2270
|
+
}, Xc = (e, t, n, i, r) => {
|
|
2271
2271
|
const { left: o, right: s, top: a, bottom: u, canvasWidth: f, canvasHeight: l } = i, g = Number.isFinite(i.devicePixelRatio) && i.devicePixelRatio > 0 ? i.devicePixelRatio : 1;
|
|
2272
|
-
if (!
|
|
2272
|
+
if (!Wc(i))
|
|
2273
2273
|
throw new Error("AxisRenderer.prepare: gridArea dimensions must be finite numbers.");
|
|
2274
2274
|
if (f <= 0 || l <= 0)
|
|
2275
2275
|
throw new Error("AxisRenderer.prepare: canvas dimensions must be positive.");
|
|
2276
2276
|
if (o < 0 || s < 0 || a < 0 || u < 0)
|
|
2277
2277
|
throw new Error("AxisRenderer.prepare: gridArea margins must be non-negative.");
|
|
2278
|
-
const c = o * g, h = f - s * g, d = a * g, w = l - u * g, P = c / f * 2 - 1, R = h / f * 2 - 1, T = 1 - d / l * 2, C = 1 - w / l * 2, v = e.tickLength ??
|
|
2278
|
+
const c = o * g, h = f - s * g, d = a * g, w = l - u * g, P = c / f * 2 - 1, R = h / f * 2 - 1, T = 1 - d / l * 2, C = 1 - w / l * 2, v = e.tickLength ?? Gc;
|
|
2279
2279
|
if (!Number.isFinite(v) || v < 0)
|
|
2280
2280
|
throw new Error("AxisRenderer.prepare: tickLength must be a finite non-negative number.");
|
|
2281
|
-
const m = r ??
|
|
2281
|
+
const m = r ?? kc, x = Math.max(1, Math.floor(m));
|
|
2282
2282
|
if (!Number.isFinite(m) || x < 1)
|
|
2283
2283
|
throw new Error("AxisRenderer.prepare: tickCount must be a finite number >= 1.");
|
|
2284
|
-
const b = v * g, M = b / f * 2, I = b / l * 2, A =
|
|
2284
|
+
const b = v * g, M = b / f * 2, I = b / l * 2, A = _o(e.min) ?? (n === "x" ? t.invert(P) : t.invert(C)), S = _o(e.max) ?? (n === "x" ? t.invert(R) : t.invert(T)), p = Oc(A, S), y = p.min, F = p.max, N = 1 + x, D = new Float32Array(N * 2 * 2);
|
|
2285
2285
|
let B = 0;
|
|
2286
2286
|
if (n === "x") {
|
|
2287
2287
|
D[B++] = P, D[B++] = C, D[B++] = R, D[B++] = C;
|
|
@@ -2300,9 +2300,9 @@ const Lc = "bgra8unorm", _c = 5, Uc = 6, kc = [1, 1, 1, 0.8], Gc = () => {
|
|
|
2300
2300
|
}
|
|
2301
2301
|
return D;
|
|
2302
2302
|
};
|
|
2303
|
-
function
|
|
2303
|
+
function Uo(e, t) {
|
|
2304
2304
|
let n = !1;
|
|
2305
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
2305
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? Uc, r = (t == null ? void 0 : t.sampleCount) ?? 1, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
2306
2306
|
entries: [
|
|
2307
2307
|
{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } },
|
|
2308
2308
|
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } }
|
|
@@ -2356,7 +2356,7 @@ function Lo(e, t) {
|
|
|
2356
2356
|
return { prepare: (v, m, x, b, M, I, A) => {
|
|
2357
2357
|
if (P(), x !== "x" && x !== "y")
|
|
2358
2358
|
throw new Error("AxisRenderer.prepare: orientation must be 'x' or 'y'.");
|
|
2359
|
-
const S =
|
|
2359
|
+
const S = Xc(v, m, x, b, A), p = S.byteLength, y = Math.max(4, p);
|
|
2360
2360
|
if (!d || d.size < y) {
|
|
2361
2361
|
if (d)
|
|
2362
2362
|
try {
|
|
@@ -2369,8 +2369,8 @@ function Lo(e, t) {
|
|
|
2369
2369
|
usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
|
-
e.queue.writeBuffer(d, 0, S.buffer, 0, S.byteLength), w = S.length / 2, ft(e, u,
|
|
2373
|
-
const F = M ?? "rgba(255,255,255,0.8)", N = I ?? F, D = ht(F) ??
|
|
2372
|
+
e.queue.writeBuffer(d, 0, S.buffer, 0, S.byteLength), w = S.length / 2, ft(e, u, Vc());
|
|
2373
|
+
const F = M ?? "rgba(255,255,255,0.8)", N = I ?? F, D = ht(F) ?? zc, B = ht(N) ?? D, E = new ArrayBuffer(4 * 4);
|
|
2374
2374
|
new Float32Array(E).set([
|
|
2375
2375
|
D[0],
|
|
2376
2376
|
D[1],
|
|
@@ -2410,7 +2410,7 @@ function Lo(e, t) {
|
|
|
2410
2410
|
}
|
|
2411
2411
|
} };
|
|
2412
2412
|
}
|
|
2413
|
-
const
|
|
2413
|
+
const $c = "bgra8unorm", Yc = 5, Hc = 6, qc = "rgba(255,255,255,0.15)", Zc = [1, 1, 1, 0.15], jc = () => {
|
|
2414
2414
|
const e = new ArrayBuffer(64);
|
|
2415
2415
|
return new Float32Array(e).set([
|
|
2416
2416
|
1,
|
|
@@ -2434,7 +2434,7 @@ const Oc = "bgra8unorm", Xc = 5, $c = 6, Yc = "rgba(255,255,255,0.15)", Hc = [1,
|
|
|
2434
2434
|
1
|
|
2435
2435
|
// col3
|
|
2436
2436
|
]), e;
|
|
2437
|
-
},
|
|
2437
|
+
}, Kc = (e, t, n) => {
|
|
2438
2438
|
const { left: i, right: r, top: o, bottom: s, canvasWidth: a, canvasHeight: u } = e, f = Number.isFinite(e.devicePixelRatio) && e.devicePixelRatio > 0 ? e.devicePixelRatio : 1, l = i * f, g = a - r * f, c = o * f, h = u - s * f, d = g - l, w = h - c, P = t + n, R = new Float32Array(P * 2 * 2);
|
|
2439
2439
|
let T = 0;
|
|
2440
2440
|
for (let C = 0; C < t; C++) {
|
|
@@ -2447,9 +2447,9 @@ const Oc = "bgra8unorm", Xc = 5, $c = 6, Yc = "rgba(255,255,255,0.15)", Hc = [1,
|
|
|
2447
2447
|
}
|
|
2448
2448
|
return R;
|
|
2449
2449
|
};
|
|
2450
|
-
function
|
|
2450
|
+
function Jc(e, t) {
|
|
2451
2451
|
let n = !1;
|
|
2452
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
2452
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? $c, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
2453
2453
|
entries: [
|
|
2454
2454
|
{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } },
|
|
2455
2455
|
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } }
|
|
@@ -2499,7 +2499,7 @@ function jc(e, t) {
|
|
|
2499
2499
|
};
|
|
2500
2500
|
return { prepare: (C, v) => {
|
|
2501
2501
|
w();
|
|
2502
|
-
const m = v != null && typeof v == "object" && ("lineCount" in v || "color" in v || "append" in v), x = m ? v : void 0, b = m ? x == null ? void 0 : x.lineCount : v, M = (b == null ? void 0 : b.horizontal) ??
|
|
2502
|
+
const m = v != null && typeof v == "object" && ("lineCount" in v || "color" in v || "append" in v), x = m ? v : void 0, b = m ? x == null ? void 0 : x.lineCount : v, M = (b == null ? void 0 : b.horizontal) ?? Yc, I = (b == null ? void 0 : b.vertical) ?? Hc, A = (x == null ? void 0 : x.color) ?? qc, S = (x == null ? void 0 : x.append) === !0;
|
|
2503
2503
|
if (M < 0 || I < 0)
|
|
2504
2504
|
throw new Error("GridRenderer.prepare: line counts must be non-negative.");
|
|
2505
2505
|
if (!Number.isFinite(C.left) || !Number.isFinite(C.right) || !Number.isFinite(C.top) || !Number.isFinite(C.bottom) || !Number.isFinite(C.canvasWidth) || !Number.isFinite(C.canvasHeight))
|
|
@@ -2510,7 +2510,7 @@ function jc(e, t) {
|
|
|
2510
2510
|
S || (h = null, d = []);
|
|
2511
2511
|
return;
|
|
2512
2512
|
}
|
|
2513
|
-
const p =
|
|
2513
|
+
const p = Kc(C, M, I), y = (M + I) * 2, F = ht(A) ?? Zc;
|
|
2514
2514
|
let N = 0;
|
|
2515
2515
|
if (S && h && h.byteLength > 0 && d.length > 0) {
|
|
2516
2516
|
N = h.byteLength;
|
|
@@ -2532,7 +2532,7 @@ function jc(e, t) {
|
|
|
2532
2532
|
});
|
|
2533
2533
|
}
|
|
2534
2534
|
e.queue.writeBuffer(c, 0, h.buffer, 0, h.byteLength);
|
|
2535
|
-
const E =
|
|
2535
|
+
const E = jc();
|
|
2536
2536
|
ft(e, u, E);
|
|
2537
2537
|
}, render: (C) => {
|
|
2538
2538
|
if (w(), !(d.length === 0 || !c)) {
|
|
@@ -2562,7 +2562,7 @@ function jc(e, t) {
|
|
|
2562
2562
|
}
|
|
2563
2563
|
} };
|
|
2564
2564
|
}
|
|
2565
|
-
const
|
|
2565
|
+
const ko = `// area.wgsl
|
|
2566
2566
|
// Minimal area-fill shader (triangle-strip):
|
|
2567
2567
|
// - Vertex input: vec2<f32> position in data coords
|
|
2568
2568
|
// - Uniforms: clip-space transform + baseline value + solid RGBA color
|
|
@@ -2609,15 +2609,15 @@ fn fsMain() -> @location(0) vec4<f32> {
|
|
|
2609
2609
|
return fsUniforms.color;
|
|
2610
2610
|
}
|
|
2611
2611
|
|
|
2612
|
-
`,
|
|
2612
|
+
`, Qc = "bgra8unorm", Go = (e) => Math.min(1, Math.max(0, e)), el = (e) => ht(e) ?? [0, 0, 0, 1], zo = (e, t, n) => {
|
|
2613
2613
|
const i = e.scale(t), r = e.scale(n);
|
|
2614
2614
|
if (!Number.isFinite(t) || !Number.isFinite(n) || t === n || !Number.isFinite(i) || !Number.isFinite(r))
|
|
2615
2615
|
return { a: 0, b: Number.isFinite(i) ? i : 0 };
|
|
2616
2616
|
const o = (r - i) / (n - t), s = i - o * t;
|
|
2617
2617
|
return { a: Number.isFinite(o) ? o : 0, b: Number.isFinite(s) ? s : 0 };
|
|
2618
|
-
},
|
|
2618
|
+
}, tl = (e, t, n, i, r) => {
|
|
2619
2619
|
e[0] = t, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = n, e[13] = r, e[14] = 0, e[15] = 1;
|
|
2620
|
-
},
|
|
2620
|
+
}, nl = (e) => {
|
|
2621
2621
|
const t = Ie(e), n = new Float32Array(t * 2 * 2);
|
|
2622
2622
|
let i = 0;
|
|
2623
2623
|
for (let r = 0; r < t; r++) {
|
|
@@ -2626,9 +2626,9 @@ fn fsMain() -> @location(0) vec4<f32> {
|
|
|
2626
2626
|
}
|
|
2627
2627
|
return n;
|
|
2628
2628
|
};
|
|
2629
|
-
function
|
|
2629
|
+
function il(e, t) {
|
|
2630
2630
|
let n = !1;
|
|
2631
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
2631
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? Qc, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
2632
2632
|
entries: [
|
|
2633
2633
|
{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } },
|
|
2634
2634
|
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } }
|
|
@@ -2645,7 +2645,7 @@ function tl(e, t) {
|
|
|
2645
2645
|
label: "areaRenderer/pipeline",
|
|
2646
2646
|
bindGroupLayouts: [a],
|
|
2647
2647
|
vertex: {
|
|
2648
|
-
code:
|
|
2648
|
+
code: ko,
|
|
2649
2649
|
label: "area.wgsl",
|
|
2650
2650
|
buffers: [
|
|
2651
2651
|
{
|
|
@@ -2656,7 +2656,7 @@ function tl(e, t) {
|
|
|
2656
2656
|
]
|
|
2657
2657
|
},
|
|
2658
2658
|
fragment: {
|
|
2659
|
-
code:
|
|
2659
|
+
code: ko,
|
|
2660
2660
|
label: "area.wgsl",
|
|
2661
2661
|
formats: i,
|
|
2662
2662
|
// Enable standard alpha blending so `areaStyle.opacity` behaves correctly.
|
|
@@ -2674,11 +2674,11 @@ function tl(e, t) {
|
|
|
2674
2674
|
const R = () => {
|
|
2675
2675
|
if (n) throw new Error("AreaRenderer is disposed.");
|
|
2676
2676
|
}, T = (x, b, M, I, A) => {
|
|
2677
|
-
|
|
2677
|
+
tl(g, x, b, M, I), g[16] = A, g[17] = 0, g[18] = 0, g[19] = 0, g[20] = 0, g[21] = 0, g[22] = 0, g[23] = 0, ft(e, u, l);
|
|
2678
2678
|
};
|
|
2679
2679
|
return { prepare: (x, b, M, I, A) => {
|
|
2680
2680
|
R();
|
|
2681
|
-
const S =
|
|
2681
|
+
const S = nl(b), p = S.byteLength, y = Math.max(4, p);
|
|
2682
2682
|
if (!w || w.size < y) {
|
|
2683
2683
|
if (w)
|
|
2684
2684
|
try {
|
|
@@ -2692,10 +2692,10 @@ function tl(e, t) {
|
|
|
2692
2692
|
});
|
|
2693
2693
|
}
|
|
2694
2694
|
S.byteLength > 0 && e.queue.writeBuffer(w, 0, S.buffer, 0, S.byteLength), P = S.length / 2;
|
|
2695
|
-
const F = Vt(b), { xMin: N, xMax: D, yMin: B, yMax: E } = F ?? { xMin: 0, xMax: 1, yMin: 0, yMax: 1 }, { a: z, b: G } =
|
|
2695
|
+
const F = Vt(b), { xMin: N, xMax: D, yMin: B, yMax: E } = F ?? { xMin: 0, xMax: 1, yMin: 0, yMax: 1 }, { a: z, b: G } = zo(M, N, D), { a: Y, b: V } = zo(I, B, E), j = Number.isFinite(A ?? Number.NaN) ? A : Number.isFinite(B) ? B : 0;
|
|
2696
2696
|
T(z, G, Y, V, j);
|
|
2697
|
-
const [K, J, oe, W] =
|
|
2698
|
-
c[0] = K, c[1] = J, c[2] = oe, c[3] =
|
|
2697
|
+
const [K, J, oe, W] = el(x.areaStyle.color), fe = Go(x.areaStyle.opacity);
|
|
2698
|
+
c[0] = K, c[1] = J, c[2] = oe, c[3] = Go(W * fe), ft(e, f, c);
|
|
2699
2699
|
}, render: (x) => {
|
|
2700
2700
|
R(), !(!w || P < 4) && (x.setPipeline(d), x.setBindGroup(0, h), x.setVertexBuffer(0, w), x.draw(P));
|
|
2701
2701
|
}, dispose: () => {
|
|
@@ -2717,7 +2717,7 @@ function tl(e, t) {
|
|
|
2717
2717
|
}
|
|
2718
2718
|
} };
|
|
2719
2719
|
}
|
|
2720
|
-
const
|
|
2720
|
+
const Vo = `// line.wgsl — Screen-space quad expansion with SDF-based anti-aliasing.
|
|
2721
2721
|
//
|
|
2722
2722
|
// Each "instance" draws one line segment (point[i] → point[i+1]).
|
|
2723
2723
|
// 6 vertices per instance (2 triangles = 1 quad per segment).
|
|
@@ -2876,18 +2876,18 @@ fn fsMain(in : VSOut) -> @location(0) vec4<f32> {
|
|
|
2876
2876
|
color = vec4<f32>(color.rgb, color.a * coverage);
|
|
2877
2877
|
return color;
|
|
2878
2878
|
}
|
|
2879
|
-
`,
|
|
2879
|
+
`, rl = "bgra8unorm", ol = 2, Wo = (e) => Math.min(1, Math.max(0, e)), sl = (e) => ht(e) ?? [0, 0, 0, 1], Oo = (e, t, n) => {
|
|
2880
2880
|
const i = e.scale(t), r = e.scale(n);
|
|
2881
2881
|
if (!Number.isFinite(t) || !Number.isFinite(n) || t === n || !Number.isFinite(i) || !Number.isFinite(r))
|
|
2882
2882
|
return { a: 0, b: Number.isFinite(i) ? i : 0 };
|
|
2883
2883
|
const o = (r - i) / (n - t), s = i - o * t;
|
|
2884
2884
|
return { a: Number.isFinite(o) ? o : 0, b: Number.isFinite(s) ? s : 0 };
|
|
2885
|
-
},
|
|
2885
|
+
}, al = (e, t, n, i, r) => {
|
|
2886
2886
|
e[0] = t, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = n, e[13] = r, e[14] = 0, e[15] = 1;
|
|
2887
2887
|
};
|
|
2888
|
-
function
|
|
2888
|
+
function cl(e, t) {
|
|
2889
2889
|
let n = !1;
|
|
2890
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
2890
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? rl, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
2891
2891
|
entries: [
|
|
2892
2892
|
{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } },
|
|
2893
2893
|
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } },
|
|
@@ -2901,13 +2901,13 @@ function sl(e, t) {
|
|
|
2901
2901
|
label: "lineRenderer/pipeline",
|
|
2902
2902
|
bindGroupLayouts: [a],
|
|
2903
2903
|
vertex: {
|
|
2904
|
-
code:
|
|
2904
|
+
code: Vo,
|
|
2905
2905
|
label: "line.wgsl",
|
|
2906
2906
|
buffers: []
|
|
2907
2907
|
// No vertex buffers — points are read from storage buffer.
|
|
2908
2908
|
},
|
|
2909
2909
|
fragment: {
|
|
2910
|
-
code:
|
|
2910
|
+
code: Vo,
|
|
2911
2911
|
label: "line.wgsl",
|
|
2912
2912
|
formats: i,
|
|
2913
2913
|
// Enable standard alpha blending so per-series `lineStyle.opacity` and AA transparency work.
|
|
@@ -2927,12 +2927,12 @@ function sl(e, t) {
|
|
|
2927
2927
|
};
|
|
2928
2928
|
return { prepare: (v, m, x, b, M = 0, I = 1, A = 1, S = 1) => {
|
|
2929
2929
|
P(), w = Ie(v.data);
|
|
2930
|
-
const p = Vt(v.data), { xMin: y, xMax: F, yMin: N, yMax: D } = p ?? { xMin: 0, xMax: 1, yMin: 0, yMax: 1 }, { a: B, b: E } =
|
|
2931
|
-
|
|
2932
|
-
const V = Number.isFinite(I) && I > 0 ? I : 1, j = Number.isFinite(A) && A > 0 ? A : 1, K = Number.isFinite(S) && S > 0 ? S : 1, J = Number.isFinite(v.lineStyle.width) && v.lineStyle.width > 0 ? v.lineStyle.width :
|
|
2930
|
+
const p = Vt(v.data), { xMin: y, xMax: F, yMin: N, yMax: D } = p ?? { xMin: 0, xMax: 1, yMin: 0, yMax: 1 }, { a: B, b: E } = Oo(x, y, F), { a: z, b: G } = Oo(b, N, D), Y = E + B * M;
|
|
2931
|
+
al(g, B, Y, z, G);
|
|
2932
|
+
const V = Number.isFinite(I) && I > 0 ? I : 1, j = Number.isFinite(A) && A > 0 ? A : 1, K = Number.isFinite(S) && S > 0 ? S : 1, J = Number.isFinite(v.lineStyle.width) && v.lineStyle.width > 0 ? v.lineStyle.width : ol;
|
|
2933
2933
|
g[16] = j, g[17] = K, g[18] = V, g[19] = J, ft(e, u, l);
|
|
2934
|
-
const [oe, W, fe, _] =
|
|
2935
|
-
c[0] = oe, c[1] = W, c[2] = fe, c[3] =
|
|
2934
|
+
const [oe, W, fe, _] = sl(v.color), H = Wo(v.lineStyle.opacity);
|
|
2935
|
+
c[0] = oe, c[1] = W, c[2] = fe, c[3] = Wo(_ * H), ft(e, f, c), h = e.createBindGroup({
|
|
2936
2936
|
layout: a,
|
|
2937
2937
|
entries: [
|
|
2938
2938
|
{ binding: 0, resource: { buffer: u } },
|
|
@@ -2956,7 +2956,7 @@ function sl(e, t) {
|
|
|
2956
2956
|
}
|
|
2957
2957
|
} };
|
|
2958
2958
|
}
|
|
2959
|
-
const
|
|
2959
|
+
const Xo = `// scatter.wgsl
|
|
2960
2960
|
// Instanced anti-aliased circle shader (SDF):
|
|
2961
2961
|
// - Per-instance vertex input:
|
|
2962
2962
|
// - center = vec2<f32> point center (transformed by VSUniforms.transform)
|
|
@@ -3042,25 +3042,25 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
3042
3042
|
return vec4<f32>(fsUniforms.color.rgb, fsUniforms.color.a * a);
|
|
3043
3043
|
}
|
|
3044
3044
|
|
|
3045
|
-
`,
|
|
3045
|
+
`, ll = "bgra8unorm", Tr = 4, qi = 16, Ar = qi / 4, ul = (e) => Math.min(1, Math.max(0, e)), Ei = (e, t, n) => Math.min(n, Math.max(t, e | 0)), fl = (e) => ht(e) ?? [0, 0, 0, 1], $o = (e) => {
|
|
3046
3046
|
if (!Number.isFinite(e) || e <= 0) return 1;
|
|
3047
3047
|
const t = Math.ceil(e);
|
|
3048
3048
|
return 2 ** Math.ceil(Math.log2(t));
|
|
3049
|
-
},
|
|
3049
|
+
}, Yo = (e, t, n) => {
|
|
3050
3050
|
const i = e.scale(t), r = e.scale(n);
|
|
3051
3051
|
if (!Number.isFinite(t) || !Number.isFinite(n) || t === n || !Number.isFinite(i) || !Number.isFinite(r))
|
|
3052
3052
|
return { a: 0, b: Number.isFinite(i) ? i : 0 };
|
|
3053
3053
|
const o = (r - i) / (n - t), s = i - o * t;
|
|
3054
3054
|
return { a: Number.isFinite(o) ? o : 0, b: Number.isFinite(s) ? s : 0 };
|
|
3055
|
-
},
|
|
3055
|
+
}, dl = (e, t, n, i, r) => {
|
|
3056
3056
|
e[0] = t, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = n, e[13] = r, e[14] = 0, e[15] = 1;
|
|
3057
|
-
},
|
|
3057
|
+
}, ml = (e) => {
|
|
3058
3058
|
const { canvasWidth: t, canvasHeight: n, devicePixelRatio: i } = e, r = e.left * i, o = t - e.right * i, s = e.top * i, a = n - e.bottom * i, u = Ei(Math.floor(r), 0, Math.max(0, t)), f = Ei(Math.floor(s), 0, Math.max(0, n)), l = Ei(Math.ceil(o), 0, Math.max(0, t)), g = Ei(Math.ceil(a), 0, Math.max(0, n)), c = Math.max(0, l - u), h = Math.max(0, g - f);
|
|
3059
3059
|
return { x: u, y: f, w: c, h };
|
|
3060
3060
|
};
|
|
3061
|
-
function
|
|
3061
|
+
function pl(e, t) {
|
|
3062
3062
|
let n = !1;
|
|
3063
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
3063
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? ll, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
3064
3064
|
entries: [
|
|
3065
3065
|
{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } },
|
|
3066
3066
|
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } }
|
|
@@ -3077,7 +3077,7 @@ function dl(e, t) {
|
|
|
3077
3077
|
label: "scatterRenderer/pipeline",
|
|
3078
3078
|
bindGroupLayouts: [a],
|
|
3079
3079
|
vertex: {
|
|
3080
|
-
code:
|
|
3080
|
+
code: Xo,
|
|
3081
3081
|
label: "scatter.wgsl",
|
|
3082
3082
|
buffers: [
|
|
3083
3083
|
{
|
|
@@ -3091,7 +3091,7 @@ function dl(e, t) {
|
|
|
3091
3091
|
]
|
|
3092
3092
|
},
|
|
3093
3093
|
fragment: {
|
|
3094
|
-
code:
|
|
3094
|
+
code: Xo,
|
|
3095
3095
|
label: "scatter.wgsl",
|
|
3096
3096
|
formats: i,
|
|
3097
3097
|
// Standard alpha blending (circle AA uses alpha, and series color may be translucent).
|
|
@@ -3110,18 +3110,18 @@ function dl(e, t) {
|
|
|
3110
3110
|
if (n) throw new Error("ScatterRenderer is disposed.");
|
|
3111
3111
|
}, M = (y) => {
|
|
3112
3112
|
if (y <= T.length) return;
|
|
3113
|
-
const F = Math.max(8,
|
|
3113
|
+
const F = Math.max(8, $o(y));
|
|
3114
3114
|
R = new ArrayBuffer(F * 4), T = new Float32Array(R);
|
|
3115
3115
|
}, I = (y, F, N, D, B, E) => {
|
|
3116
3116
|
const z = Number.isFinite(B) && B > 0 ? B : 1, G = Number.isFinite(E) && E > 0 ? E : 1;
|
|
3117
|
-
|
|
3117
|
+
dl(g, y, F, N, D), g[16] = z, g[17] = G, g[18] = 0, g[19] = 0, ft(e, u, l), m = [z, G];
|
|
3118
3118
|
};
|
|
3119
3119
|
return { prepare: (y, F, N, D, B) => {
|
|
3120
3120
|
b();
|
|
3121
|
-
const E = Vt(F), { xMin: z, xMax: G, yMin: Y, yMax: V } = E ?? { xMin: 0, xMax: 1, yMin: 0, yMax: 1 }, { a: j, b: K } =
|
|
3122
|
-
B ? (C = B.canvasWidth, v = B.canvasHeight, I(j, K, J, oe, B.canvasWidth, B.canvasHeight), x =
|
|
3123
|
-
const [W, fe, _, H] =
|
|
3124
|
-
c[0] = W, c[1] = fe, c[2] = _, c[3] =
|
|
3121
|
+
const E = Vt(F), { xMin: z, xMax: G, yMin: Y, yMax: V } = E ?? { xMin: 0, xMax: 1, yMin: 0, yMax: 1 }, { a: j, b: K } = Yo(N, z, G), { a: J, b: oe } = Yo(D, Y, V);
|
|
3122
|
+
B ? (C = B.canvasWidth, v = B.canvasHeight, I(j, K, J, oe, B.canvasWidth, B.canvasHeight), x = ml(B)) : (I(j, K, J, oe, m[0], m[1]), x = null);
|
|
3123
|
+
const [W, fe, _, H] = fl(y.color);
|
|
3124
|
+
c[0] = W, c[1] = fe, c[2] = _, c[3] = ul(H), ft(e, f, c);
|
|
3125
3125
|
const X = (B == null ? void 0 : B.devicePixelRatio) ?? 1, pe = X > 0 && Number.isFinite(X), ce = y.symbolSize, me = [0, 0, void 0], q = typeof ce == "function" ? (le, ge, ye) => {
|
|
3126
3126
|
me[0] = le, me[1] = ge, me[2] = ye;
|
|
3127
3127
|
const Be = ce(me);
|
|
@@ -3139,7 +3139,7 @@ function dl(e, t) {
|
|
|
3139
3139
|
P = ee / Ar;
|
|
3140
3140
|
const be = Math.max(4, P * qi);
|
|
3141
3141
|
if (!w || w.size < be) {
|
|
3142
|
-
const le = Math.max(Math.max(4,
|
|
3142
|
+
const le = Math.max(Math.max(4, $o(be)), w ? w.size : 0);
|
|
3143
3143
|
if (w)
|
|
3144
3144
|
try {
|
|
3145
3145
|
w.destroy();
|
|
@@ -3174,7 +3174,7 @@ function dl(e, t) {
|
|
|
3174
3174
|
}
|
|
3175
3175
|
} };
|
|
3176
3176
|
}
|
|
3177
|
-
const
|
|
3177
|
+
const hl = `struct ComputeUniforms {
|
|
3178
3178
|
transform: mat4x4<f32>,
|
|
3179
3179
|
viewportPx: vec2f,
|
|
3180
3180
|
_pad0: vec2f,
|
|
@@ -3250,7 +3250,7 @@ fn reduceMax(@builtin(global_invocation_id) gid: vec3<u32>) {
|
|
|
3250
3250
|
atomicMax(&maxBuf.value, v);
|
|
3251
3251
|
}
|
|
3252
3252
|
|
|
3253
|
-
`,
|
|
3253
|
+
`, Ho = `struct RenderUniforms {
|
|
3254
3254
|
plotOriginPx: vec2<u32>,
|
|
3255
3255
|
plotSizePx: vec2<u32>,
|
|
3256
3256
|
binSizePx: u32,
|
|
@@ -3327,39 +3327,39 @@ fn fsMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {
|
|
|
3327
3327
|
return vec4f(lut.rgb, 1.0);
|
|
3328
3328
|
}
|
|
3329
3329
|
|
|
3330
|
-
`,
|
|
3330
|
+
`, yl = "bgra8unorm", Bi = (e) => Math.min(1, Math.max(0, e)), pn = (e, t, n) => Math.min(n, Math.max(t, e | 0)), gl = (e) => {
|
|
3331
3331
|
if (!Number.isFinite(e) || e <= 0) return 1;
|
|
3332
3332
|
const t = Math.ceil(e);
|
|
3333
3333
|
return 2 ** Math.ceil(Math.log2(t));
|
|
3334
|
-
},
|
|
3334
|
+
}, qo = (e, t, n) => {
|
|
3335
3335
|
const i = e.scale(t), r = e.scale(n);
|
|
3336
3336
|
if (!Number.isFinite(t) || !Number.isFinite(n) || t === n || !Number.isFinite(i) || !Number.isFinite(r))
|
|
3337
3337
|
return { a: 0, b: Number.isFinite(i) ? i : 0 };
|
|
3338
3338
|
const o = (r - i) / (n - t), s = i - o * t;
|
|
3339
3339
|
return { a: Number.isFinite(o) ? o : 0, b: Number.isFinite(s) ? s : 0 };
|
|
3340
|
-
},
|
|
3340
|
+
}, xl = (e, t, n, i, r) => {
|
|
3341
3341
|
e[0] = t, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = n, e[13] = r, e[14] = 0, e[15] = 1;
|
|
3342
|
-
},
|
|
3342
|
+
}, bl = (e) => {
|
|
3343
3343
|
const { canvasWidth: t, canvasHeight: n, devicePixelRatio: i } = e, r = e.left * i, o = t - e.right * i, s = e.top * i, a = n - e.bottom * i, u = pn(Math.floor(r), 0, Math.max(0, t)), f = pn(Math.floor(s), 0, Math.max(0, n)), l = pn(Math.ceil(o), 0, Math.max(0, t)), g = pn(Math.ceil(a), 0, Math.max(0, n)), c = Math.max(0, l - u), h = Math.max(0, g - f);
|
|
3344
3344
|
return { x: u, y: f, w: c, h };
|
|
3345
|
-
}, Li = (e, t, n) => e + (t - e) * n,
|
|
3346
|
-
const n = (typeof e == "string" ?
|
|
3345
|
+
}, Li = (e, t, n) => e + (t - e) * n, vl = (e, t, n) => [Li(e[0], t[0], n), Li(e[1], t[1], n), Li(e[2], t[2], n), Li(e[3], t[3], n)], wl = (e) => ht(e) ?? [0, 0, 0, 1], Zo = (e) => e === "plasma" ? ["#0d0887", "#6a00a8", "#b12a90", "#e16462", "#fca636", "#f0f921"] : e === "inferno" ? ["#000004", "#420a68", "#932667", "#dd513a", "#fca50a", "#fcffa4"] : ["#440154", "#3b528b", "#21918c", "#5ec962", "#fde725"], Cl = (e) => {
|
|
3346
|
+
const n = (typeof e == "string" ? Zo(e) : Array.isArray(e) && e.length > 0 ? e : Zo("viridis")).map(wl), i = Math.max(2, n.length), r = new Uint8Array(new ArrayBuffer(256 * 4));
|
|
3347
3347
|
for (let o = 0; o < 256; o++) {
|
|
3348
|
-
const a = o / 255 * (i - 1), u = Math.min(i - 2, Math.max(0, Math.floor(a))), f = a - u, l =
|
|
3348
|
+
const a = o / 255 * (i - 1), u = Math.min(i - 2, Math.max(0, Math.floor(a))), f = a - u, l = vl(n[u], n[u + 1], f);
|
|
3349
3349
|
r[o * 4 + 0] = pn(Math.round(Bi(l[0]) * 255), 0, 255), r[o * 4 + 1] = pn(Math.round(Bi(l[1]) * 255), 0, 255), r[o * 4 + 2] = pn(Math.round(Bi(l[2]) * 255), 0, 255), r[o * 4 + 3] = pn(Math.round(Bi(l[3]) * 255), 0, 255);
|
|
3350
3350
|
}
|
|
3351
3351
|
return r;
|
|
3352
|
-
},
|
|
3352
|
+
}, Ml = (e) => {
|
|
3353
3353
|
if (typeof e == "string") return e;
|
|
3354
3354
|
try {
|
|
3355
3355
|
return JSON.stringify(e);
|
|
3356
3356
|
} catch {
|
|
3357
3357
|
return "custom";
|
|
3358
3358
|
}
|
|
3359
|
-
},
|
|
3360
|
-
function
|
|
3359
|
+
}, Sl = (e) => e === "sqrt" ? 1 : e === "log" ? 2 : 0, Fl = new Uint32Array([0]).buffer;
|
|
3360
|
+
function Nl(e, t) {
|
|
3361
3361
|
let n = !1;
|
|
3362
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
3362
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? yl, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
3363
3363
|
entries: [
|
|
3364
3364
|
{ binding: 0, visibility: GPUShaderStage.COMPUTE, buffer: { type: "uniform" } },
|
|
3365
3365
|
{ binding: 1, visibility: GPUShaderStage.COMPUTE, buffer: { type: "read-only-storage" } },
|
|
@@ -3374,16 +3374,16 @@ function Sl(e, t) {
|
|
|
3374
3374
|
{ binding: 2, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "read-only-storage" } },
|
|
3375
3375
|
{ binding: 3, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "unfilterable-float" } }
|
|
3376
3376
|
]
|
|
3377
|
-
}), f = mt(e, 128, { label: "scatterDensity/computeUniforms" }), l = new ArrayBuffer(128), g = new Float32Array(l, 0, 20), c = new Uint32Array(l), h = mt(e, 48, { label: "scatterDensity/renderUniforms" }), d = new ArrayBuffer(48), w = new Uint32Array(d), P =
|
|
3377
|
+
}), f = mt(e, 128, { label: "scatterDensity/computeUniforms" }), l = new ArrayBuffer(128), g = new Float32Array(l, 0, 20), c = new Uint32Array(l), h = mt(e, 48, { label: "scatterDensity/renderUniforms" }), d = new ArrayBuffer(48), w = new Uint32Array(d), P = Qs(
|
|
3378
3378
|
e,
|
|
3379
|
-
|
|
3379
|
+
hl,
|
|
3380
3380
|
"scatterDensityBinning.wgsl",
|
|
3381
3381
|
s
|
|
3382
|
-
), R = e.createPipelineLayout({ bindGroupLayouts: [a] }), T =
|
|
3382
|
+
), R = e.createPipelineLayout({ bindGroupLayouts: [a] }), T = Lo(e, {
|
|
3383
3383
|
label: "scatterDensity/binPointsPipeline",
|
|
3384
3384
|
layout: R,
|
|
3385
3385
|
compute: { module: P, entryPoint: "binPoints" }
|
|
3386
|
-
}, s), C =
|
|
3386
|
+
}, s), C = Lo(e, {
|
|
3387
3387
|
label: "scatterDensity/reduceMaxPipeline",
|
|
3388
3388
|
layout: R,
|
|
3389
3389
|
compute: { module: P, entryPoint: "reduceMax" }
|
|
@@ -3392,9 +3392,9 @@ function Sl(e, t) {
|
|
|
3392
3392
|
{
|
|
3393
3393
|
label: "scatterDensity/renderPipeline",
|
|
3394
3394
|
bindGroupLayouts: [u],
|
|
3395
|
-
vertex: { code:
|
|
3395
|
+
vertex: { code: Ho, label: "scatterDensityColormap.wgsl" },
|
|
3396
3396
|
fragment: {
|
|
3397
|
-
code:
|
|
3397
|
+
code: Ho,
|
|
3398
3398
|
label: "scatterDensityColormap.wgsl",
|
|
3399
3399
|
formats: i,
|
|
3400
3400
|
blend: void 0
|
|
@@ -3408,14 +3408,14 @@ function Sl(e, t) {
|
|
|
3408
3408
|
const W = () => {
|
|
3409
3409
|
if (n) throw new Error("ScatterDensityRenderer is disposed.");
|
|
3410
3410
|
}, fe = (q) => {
|
|
3411
|
-
const se =
|
|
3411
|
+
const se = Ml(q.densityColormap);
|
|
3412
3412
|
if (M || (M = e.createTexture({
|
|
3413
3413
|
label: "scatterDensity/lutTexture",
|
|
3414
3414
|
size: { width: 256, height: 1, depthOrArrayLayers: 1 },
|
|
3415
3415
|
format: "rgba8unorm",
|
|
3416
3416
|
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST
|
|
3417
3417
|
}), I = M.createView(), A = ""), se === A) return;
|
|
3418
|
-
const te =
|
|
3418
|
+
const te = Cl(q.densityColormap);
|
|
3419
3419
|
e.queue.writeTexture(
|
|
3420
3420
|
{ texture: M },
|
|
3421
3421
|
te,
|
|
@@ -3426,7 +3426,7 @@ function Sl(e, t) {
|
|
|
3426
3426
|
const te = Math.max(1, q | 0) * Math.max(1, se | 0);
|
|
3427
3427
|
if (m && x && te <= b) return;
|
|
3428
3428
|
const ee = Math.max(1, te);
|
|
3429
|
-
if (b = Math.max(256,
|
|
3429
|
+
if (b = Math.max(256, gl(ee)), m) {
|
|
3430
3430
|
try {
|
|
3431
3431
|
m.destroy();
|
|
3432
3432
|
} catch {
|
|
@@ -3472,12 +3472,12 @@ function Sl(e, t) {
|
|
|
3472
3472
|
};
|
|
3473
3473
|
return { prepare: (q, se, te, ee, be, le, ge, ye, Be) => {
|
|
3474
3474
|
W(), J = !0;
|
|
3475
|
-
const Le =
|
|
3475
|
+
const Le = bl(ye), st = ye.devicePixelRatio, rt = Number.isFinite(q.binSize) ? Math.max(1e-6, q.binSize) : 2, ve = Math.max(1, Math.round(rt * (Number.isFinite(st) && st > 0 ? st : 1))), Te = Math.max(1, Math.ceil(Le.w / ve)), Xe = Math.max(1, Math.ceil(Le.h / ve));
|
|
3476
3476
|
_(Te, Xe), fe(q);
|
|
3477
|
-
const He =
|
|
3477
|
+
const He = Sl(q.densityNormalization);
|
|
3478
3478
|
y !== se && (y = se, S = null, p = null, K = !0), F !== te && (F = te, K = !0), (N !== ee || D !== be) && (N = ee, D = be, K = !0), (B !== ve || E !== Te || z !== Xe) && (B = ve, E = Te, z = Xe, K = !0), (!G || G.x !== Le.x || G.y !== Le.y || G.w !== Le.w || G.h !== Le.h) && (G = Le, K = !0), (Y !== ye.canvasWidth || V !== ye.canvasHeight) && (Y = ye.canvasWidth, V = ye.canvasHeight, K = !0), j !== He && (j = He, K = !0);
|
|
3479
|
-
const ke = Be, bt = (ke == null ? void 0 : ke.xMin) ?? 0, vt = (ke == null ? void 0 : ke.xMax) ?? 1, We = (ke == null ? void 0 : ke.yMin) ?? 0, nt = (ke == null ? void 0 : ke.yMax) ?? 1, { a: Rt, b: Wt } =
|
|
3480
|
-
|
|
3479
|
+
const ke = Be, bt = (ke == null ? void 0 : ke.xMin) ?? 0, vt = (ke == null ? void 0 : ke.xMax) ?? 1, We = (ke == null ? void 0 : ke.yMin) ?? 0, nt = (ke == null ? void 0 : ke.yMax) ?? 1, { a: Rt, b: Wt } = qo(le, bt, vt), { a: Ft, b: Ut } = qo(ge, We, nt);
|
|
3480
|
+
xl(g, Rt, Wt, Ft, Ut), g[16] = ye.canvasWidth > 0 ? ye.canvasWidth : 1, g[17] = ye.canvasHeight > 0 ? ye.canvasHeight : 1, g[18] = 0, g[19] = 0, c[20] = Le.x >>> 0, c[21] = Le.y >>> 0, c[22] = Le.w >>> 0, c[23] = Le.h >>> 0, c[24] = ve >>> 0, c[25] = Te >>> 0, c[26] = Xe >>> 0, c[27] = (Math.max(0, ee) | 0) >>> 0, c[28] = (Math.max(0, be) | 0) >>> 0, c[29] = He >>> 0, ft(e, f, l), w[0] = Le.x >>> 0, w[1] = Le.y >>> 0, w[2] = Le.w >>> 0, w[3] = Le.h >>> 0, w[4] = ve >>> 0, w[5] = Te >>> 0, w[6] = Xe >>> 0, w[7] = He >>> 0, ft(e, h, d), H();
|
|
3481
3481
|
}, encodeCompute: (q) => {
|
|
3482
3482
|
if (W(), !J || !K) return;
|
|
3483
3483
|
if (!m || !x || !S || F <= 0) {
|
|
@@ -3488,7 +3488,7 @@ function Sl(e, t) {
|
|
|
3488
3488
|
K = !1;
|
|
3489
3489
|
return;
|
|
3490
3490
|
}
|
|
3491
|
-
e.queue.writeBuffer(m, 0, oe.buffer, 0, b * 4), e.queue.writeBuffer(x, 0,
|
|
3491
|
+
e.queue.writeBuffer(m, 0, oe.buffer, 0, b * 4), e.queue.writeBuffer(x, 0, Fl);
|
|
3492
3492
|
const se = E * z | 0, te = Math.max(0, D - N | 0), ee = q.beginComputePass({ label: "scatterDensity/computePass" });
|
|
3493
3493
|
ee.setBindGroup(0, S), ee.setPipeline(T);
|
|
3494
3494
|
const be = 256, le = Math.ceil(te / be);
|
|
@@ -3527,7 +3527,7 @@ function Sl(e, t) {
|
|
|
3527
3527
|
}
|
|
3528
3528
|
} };
|
|
3529
3529
|
}
|
|
3530
|
-
const
|
|
3530
|
+
const jo = `// pie.wgsl
|
|
3531
3531
|
// Instanced anti-aliased pie-slice shader (instanced quad + SDF mask).
|
|
3532
3532
|
//
|
|
3533
3533
|
// - Per-instance vertex input:
|
|
@@ -3677,7 +3677,7 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
3677
3677
|
return vec4<f32>(in.color.rgb, in.color.a * aOut);
|
|
3678
3678
|
}
|
|
3679
3679
|
|
|
3680
|
-
`,
|
|
3680
|
+
`, Tl = "bgra8unorm", Zi = 40, Ir = Zi / 4, zn = Math.PI * 2, Ko = (e) => Math.min(1, Math.max(0, e)), _i = (e, t, n) => Math.min(n, Math.max(t, e | 0)), Jo = (e) => {
|
|
3681
3681
|
if (!Number.isFinite(e) || e <= 0) return 1;
|
|
3682
3682
|
const t = Math.ceil(e);
|
|
3683
3683
|
return 2 ** Math.ceil(Math.log2(t));
|
|
@@ -3685,11 +3685,11 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
3685
3685
|
if (!Number.isFinite(e)) return 0;
|
|
3686
3686
|
const t = e % zn;
|
|
3687
3687
|
return t < 0 ? t + zn : t;
|
|
3688
|
-
},
|
|
3688
|
+
}, Al = (e, t) => {
|
|
3689
3689
|
const n = ht(e);
|
|
3690
|
-
if (n) return [n[0], n[1], n[2],
|
|
3690
|
+
if (n) return [n[0], n[1], n[2], Ko(n[3])];
|
|
3691
3691
|
const i = ht(t);
|
|
3692
|
-
return i ? [i[0], i[1], i[2],
|
|
3692
|
+
return i ? [i[0], i[1], i[2], Ko(i[3])] : [0, 0, 0, 1];
|
|
3693
3693
|
}, li = (e, t) => {
|
|
3694
3694
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
3695
3695
|
if (typeof e != "string") return null;
|
|
@@ -3701,24 +3701,24 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
3701
3701
|
}
|
|
3702
3702
|
const i = Number.parseFloat(n);
|
|
3703
3703
|
return Number.isFinite(i) ? i : null;
|
|
3704
|
-
},
|
|
3704
|
+
}, Il = (e, t, n) => {
|
|
3705
3705
|
const i = (e == null ? void 0 : e[0]) ?? "50%", r = (e == null ? void 0 : e[1]) ?? "50%", o = li(i, t), s = li(r, n);
|
|
3706
3706
|
return {
|
|
3707
3707
|
x: Number.isFinite(o) ? o : t * 0.5,
|
|
3708
3708
|
y: Number.isFinite(s) ? s : n * 0.5
|
|
3709
3709
|
};
|
|
3710
|
-
},
|
|
3710
|
+
}, Pl = (e) => Array.isArray(e), Rl = (e, t) => {
|
|
3711
3711
|
if (e == null) return { inner: 0, outer: t * 0.7 };
|
|
3712
|
-
if (
|
|
3712
|
+
if (Pl(e)) {
|
|
3713
3713
|
const r = li(e[0], t), o = li(e[1], t), s = Math.max(0, Number.isFinite(r) ? r : 0), a = Math.max(s, Number.isFinite(o) ? o : t * 0.7);
|
|
3714
3714
|
return { inner: s, outer: Math.min(t, a) };
|
|
3715
3715
|
}
|
|
3716
3716
|
const n = li(e, t), i = Math.max(0, Number.isFinite(n) ? n : t * 0.7);
|
|
3717
3717
|
return { inner: 0, outer: Math.min(t, i) };
|
|
3718
|
-
},
|
|
3718
|
+
}, Dl = (e) => {
|
|
3719
3719
|
const { canvasWidth: t, canvasHeight: n, devicePixelRatio: i } = e, r = e.left * i, o = t - e.right * i, s = e.top * i, a = n - e.bottom * i, u = _i(Math.floor(r), 0, Math.max(0, t)), f = _i(Math.floor(s), 0, Math.max(0, n)), l = _i(Math.ceil(o), 0, Math.max(0, t)), g = _i(Math.ceil(a), 0, Math.max(0, n)), c = Math.max(0, l - u), h = Math.max(0, g - f);
|
|
3720
3720
|
return { x: u, y: f, w: c, h };
|
|
3721
|
-
},
|
|
3721
|
+
}, El = new Float32Array([
|
|
3722
3722
|
1,
|
|
3723
3723
|
0,
|
|
3724
3724
|
0,
|
|
@@ -3740,9 +3740,9 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
3740
3740
|
1
|
|
3741
3741
|
// col3
|
|
3742
3742
|
]);
|
|
3743
|
-
function
|
|
3743
|
+
function Bl(e, t) {
|
|
3744
3744
|
let n = !1;
|
|
3745
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
3745
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? Tl, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
3746
3746
|
entries: [{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } }]
|
|
3747
3747
|
}), u = mt(e, 80, { label: "pieRenderer/vsUniforms" }), f = new ArrayBuffer(80), l = new Float32Array(f), g = e.createBindGroup({
|
|
3748
3748
|
layout: a,
|
|
@@ -3753,7 +3753,7 @@ function Dl(e, t) {
|
|
|
3753
3753
|
label: "pieRenderer/pipeline",
|
|
3754
3754
|
bindGroupLayouts: [a],
|
|
3755
3755
|
vertex: {
|
|
3756
|
-
code:
|
|
3756
|
+
code: jo,
|
|
3757
3757
|
label: "pie.wgsl",
|
|
3758
3758
|
buffers: [
|
|
3759
3759
|
{
|
|
@@ -3775,7 +3775,7 @@ function Dl(e, t) {
|
|
|
3775
3775
|
]
|
|
3776
3776
|
},
|
|
3777
3777
|
fragment: {
|
|
3778
|
-
code:
|
|
3778
|
+
code: jo,
|
|
3779
3779
|
label: "pie.wgsl",
|
|
3780
3780
|
formats: i,
|
|
3781
3781
|
// Standard alpha blending for AA edges and translucent slice colors.
|
|
@@ -3794,16 +3794,16 @@ function Dl(e, t) {
|
|
|
3794
3794
|
if (n) throw new Error("PieRenderer is disposed.");
|
|
3795
3795
|
}, m = (A) => {
|
|
3796
3796
|
if (A <= P.length) return;
|
|
3797
|
-
const S = Math.max(8,
|
|
3797
|
+
const S = Math.max(8, Jo(A));
|
|
3798
3798
|
w = new ArrayBuffer(S * 4), P = new Float32Array(w);
|
|
3799
3799
|
}, x = (A, S) => {
|
|
3800
3800
|
const p = Number.isFinite(A) && A > 0 ? A : 1, y = Number.isFinite(S) && S > 0 ? S : 1;
|
|
3801
|
-
l.set(
|
|
3801
|
+
l.set(El, 0), l[16] = p, l[17] = y, l[18] = 0, l[19] = 0, ft(e, u, f);
|
|
3802
3802
|
};
|
|
3803
3803
|
return { prepare: (A, S) => {
|
|
3804
3804
|
v();
|
|
3805
3805
|
const p = S.devicePixelRatio, y = p > 0 && Number.isFinite(p) ? p : 1;
|
|
3806
|
-
R = S.canvasWidth, T = S.canvasHeight, x(S.canvasWidth, S.canvasHeight), C =
|
|
3806
|
+
R = S.canvasWidth, T = S.canvasHeight, x(S.canvasWidth, S.canvasHeight), C = Dl(S);
|
|
3807
3807
|
const F = S.canvasWidth / y, N = S.canvasHeight / y;
|
|
3808
3808
|
if (!(F > 0) || !(N > 0)) {
|
|
3809
3809
|
d = 0;
|
|
@@ -3819,12 +3819,12 @@ function Dl(e, t) {
|
|
|
3819
3819
|
d = 0;
|
|
3820
3820
|
return;
|
|
3821
3821
|
}
|
|
3822
|
-
const z =
|
|
3822
|
+
const z = Il(A.center, D, B), G = S.left + z.x, Y = S.top + z.y, V = G / F * 2 - 1, j = 1 - Y / N * 2;
|
|
3823
3823
|
if (!Number.isFinite(V) || !Number.isFinite(j)) {
|
|
3824
3824
|
d = 0;
|
|
3825
3825
|
return;
|
|
3826
3826
|
}
|
|
3827
|
-
const K =
|
|
3827
|
+
const K = Rl(A.radius, E), J = Math.max(0, Math.min(K.inner, K.outer)), oe = Math.max(J, K.outer), W = J * y, fe = oe * y;
|
|
3828
3828
|
if (!(fe > 0)) {
|
|
3829
3829
|
d = 0;
|
|
3830
3830
|
return;
|
|
@@ -3850,13 +3850,13 @@ function Dl(e, t) {
|
|
|
3850
3850
|
if (ge ? Be = Math.max(0, zn - me) : Be = Math.max(0, Math.min(zn, Be)), me += Be, !(Be > 0)) continue;
|
|
3851
3851
|
const Le = ce, st = H === 1 ? ce + zn : Pr(ce + Be);
|
|
3852
3852
|
ce = Pr(ce + Be);
|
|
3853
|
-
const [rt, ve, Te, Xe] =
|
|
3853
|
+
const [rt, ve, Te, Xe] = Al(be.color, A.color);
|
|
3854
3854
|
X[q + 0] = V, X[q + 1] = j, X[q + 2] = Le, X[q + 3] = st, X[q + 4] = W, X[q + 5] = fe, X[q + 6] = rt, X[q + 7] = ve, X[q + 8] = Te, X[q + 9] = Xe, q += Ir;
|
|
3855
3855
|
}
|
|
3856
3856
|
d = q / Ir;
|
|
3857
3857
|
const te = Math.max(4, d * Zi);
|
|
3858
3858
|
if (!h || h.size < te) {
|
|
3859
|
-
const ee = Math.max(Math.max(4,
|
|
3859
|
+
const ee = Math.max(Math.max(4, Jo(te)), h ? h.size : 0);
|
|
3860
3860
|
if (h)
|
|
3861
3861
|
try {
|
|
3862
3862
|
h.destroy();
|
|
@@ -3887,7 +3887,7 @@ function Dl(e, t) {
|
|
|
3887
3887
|
}
|
|
3888
3888
|
} };
|
|
3889
3889
|
}
|
|
3890
|
-
const
|
|
3890
|
+
const Qo = `// candlestick.wgsl
|
|
3891
3891
|
// Instanced candlestick shader (bodies + wicks):
|
|
3892
3892
|
// - Per-instance vertex input:
|
|
3893
3893
|
// - xClip, openClip, closeClip, lowClip, highClip, bodyWidthClip (6 floats)
|
|
@@ -3994,21 +3994,21 @@ fn vsMain(in: VSIn, @builtin(vertex_index) vertexIndex: u32) -> VSOut {
|
|
|
3994
3994
|
fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
3995
3995
|
return in.color;
|
|
3996
3996
|
}
|
|
3997
|
-
`,
|
|
3997
|
+
`, Ll = "bgra8unorm", _l = 1, Un = 40, Mn = Un / 4, Ul = (e) => Math.min(1, Math.max(0, e)), Ui = (e, t, n) => Math.min(n, Math.max(t, e | 0)), si = (e) => ht(e) ?? [0, 0, 0, 1], ki = (e) => {
|
|
3998
3998
|
if (!Number.isFinite(e) || e <= 0) return 1;
|
|
3999
3999
|
const t = Math.ceil(e);
|
|
4000
4000
|
return 2 ** Math.ceil(Math.log2(t));
|
|
4001
|
-
},
|
|
4001
|
+
}, kl = (e) => {
|
|
4002
4002
|
const t = e.trim().match(/^(\d+(?:\.\d+)?)%$/);
|
|
4003
4003
|
if (!t) return null;
|
|
4004
4004
|
const n = Number(t[1]) / 100;
|
|
4005
4005
|
return Number.isFinite(n) ? n : null;
|
|
4006
|
-
},
|
|
4006
|
+
}, Gl = (e) => Array.isArray(e), ea = (e) => Gl(e) ? { timestamp: e[0], open: e[1], close: e[2], low: e[3], high: e[4] } : { timestamp: e.timestamp, open: e.open, close: e.close, low: e.low, high: e.high }, zl = (e) => {
|
|
4007
4007
|
const t = e.devicePixelRatio;
|
|
4008
4008
|
if (!(t > 0)) return null;
|
|
4009
4009
|
const n = e.canvasWidth / t, i = e.canvasHeight / t, r = n - e.left - e.right, o = i - e.top - e.bottom;
|
|
4010
4010
|
return !(r > 0) || !(o > 0) ? null : { plotWidthCss: r, plotHeightCss: o };
|
|
4011
|
-
},
|
|
4011
|
+
}, Vl = (e) => {
|
|
4012
4012
|
const { left: t, right: n, top: i, bottom: r, canvasWidth: o, canvasHeight: s, devicePixelRatio: a } = e, u = t * a, f = o - n * a, l = i * a, g = s - r * a, c = u / o * 2 - 1, h = f / o * 2 - 1, d = 1 - l / s * 2, w = 1 - g / s * 2;
|
|
4013
4013
|
return {
|
|
4014
4014
|
left: c,
|
|
@@ -4018,13 +4018,13 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
4018
4018
|
width: h - c,
|
|
4019
4019
|
height: d - w
|
|
4020
4020
|
};
|
|
4021
|
-
},
|
|
4021
|
+
}, Wl = (e) => {
|
|
4022
4022
|
const { canvasWidth: t, canvasHeight: n, devicePixelRatio: i } = e, r = e.left * i, o = t - e.right * i, s = e.top * i, a = n - e.bottom * i, u = Ui(Math.floor(r), 0, Math.max(0, t)), f = Ui(Math.floor(s), 0, Math.max(0, n)), l = Ui(Math.ceil(o), 0, Math.max(0, t)), g = Ui(Math.ceil(a), 0, Math.max(0, n)), c = Math.max(0, l - u), h = Math.max(0, g - f);
|
|
4023
4023
|
return { x: u, y: f, w: c, h };
|
|
4024
|
-
},
|
|
4024
|
+
}, Ol = (e) => {
|
|
4025
4025
|
const t = [];
|
|
4026
4026
|
for (let i = 0; i < e.length; i++) {
|
|
4027
|
-
const { timestamp: r } =
|
|
4027
|
+
const { timestamp: r } = ea(e[i]);
|
|
4028
4028
|
Number.isFinite(r) && t.push(r);
|
|
4029
4029
|
}
|
|
4030
4030
|
if (t.length < 2) return 1;
|
|
@@ -4035,7 +4035,7 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
4035
4035
|
r > 0 && r < n && (n = r);
|
|
4036
4036
|
}
|
|
4037
4037
|
return Number.isFinite(n) && n > 0 ? n : 1;
|
|
4038
|
-
},
|
|
4038
|
+
}, Xl = (e, t, n, i) => {
|
|
4039
4039
|
if (Number.isFinite(t) && t > 0) {
|
|
4040
4040
|
const a = e.scale(0), u = e.scale(0 + t), f = Math.abs(u - a);
|
|
4041
4041
|
if (Number.isFinite(f) && f > 0) return f;
|
|
@@ -4044,7 +4044,7 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
4044
4044
|
if (!(r > 0)) return 0;
|
|
4045
4045
|
const o = Math.max(1, Math.floor(i));
|
|
4046
4046
|
return r / o;
|
|
4047
|
-
},
|
|
4047
|
+
}, $l = () => {
|
|
4048
4048
|
const e = new ArrayBuffer(64);
|
|
4049
4049
|
return new Float32Array(e).set([
|
|
4050
4050
|
1,
|
|
@@ -4069,12 +4069,12 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
4069
4069
|
// col3
|
|
4070
4070
|
]), e;
|
|
4071
4071
|
};
|
|
4072
|
-
function
|
|
4072
|
+
function Yl(e, t) {
|
|
4073
4073
|
let n = !1;
|
|
4074
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
4074
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? Ll, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
4075
4075
|
entries: [{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } }]
|
|
4076
4076
|
}), u = mt(e, 80, { label: "candlestickRenderer/vsUniforms" });
|
|
4077
|
-
ft(e, u,
|
|
4077
|
+
ft(e, u, $l());
|
|
4078
4078
|
const f = new ArrayBuffer(80), l = new Float32Array(f), g = e.createBindGroup({
|
|
4079
4079
|
layout: a,
|
|
4080
4080
|
entries: [{ binding: 0, resource: { buffer: u } }]
|
|
@@ -4084,7 +4084,7 @@ function Xl(e, t) {
|
|
|
4084
4084
|
label: "candlestickRenderer/pipeline",
|
|
4085
4085
|
bindGroupLayouts: [a],
|
|
4086
4086
|
vertex: {
|
|
4087
|
-
code:
|
|
4087
|
+
code: Qo,
|
|
4088
4088
|
label: "candlestick.wgsl",
|
|
4089
4089
|
buffers: [
|
|
4090
4090
|
{
|
|
@@ -4103,7 +4103,7 @@ function Xl(e, t) {
|
|
|
4103
4103
|
]
|
|
4104
4104
|
},
|
|
4105
4105
|
fragment: {
|
|
4106
|
-
code:
|
|
4106
|
+
code: Qo,
|
|
4107
4107
|
label: "candlestick.wgsl",
|
|
4108
4108
|
formats: i,
|
|
4109
4109
|
blend: {
|
|
@@ -4133,25 +4133,25 @@ function Xl(e, t) {
|
|
|
4133
4133
|
d = 0, x = 0;
|
|
4134
4134
|
return;
|
|
4135
4135
|
}
|
|
4136
|
-
const Y =
|
|
4136
|
+
const Y = zl(z);
|
|
4137
4137
|
if (!Y) {
|
|
4138
4138
|
d = 0, x = 0;
|
|
4139
4139
|
return;
|
|
4140
4140
|
}
|
|
4141
|
-
const V =
|
|
4142
|
-
R = z.canvasWidth, T = z.canvasHeight, C =
|
|
4143
|
-
const K =
|
|
4141
|
+
const V = Vl(z), j = Y.plotWidthCss > 0 ? V.width / Y.plotWidthCss : 0;
|
|
4142
|
+
R = z.canvasWidth, T = z.canvasHeight, C = Wl(z);
|
|
4143
|
+
const K = Ol(D), J = Xl(B, K, V, D.length);
|
|
4144
4144
|
let oe = 0;
|
|
4145
4145
|
const W = N.barWidth;
|
|
4146
4146
|
if (typeof W == "number")
|
|
4147
4147
|
oe = Math.max(0, W) * j;
|
|
4148
4148
|
else if (typeof W == "string") {
|
|
4149
|
-
const ye =
|
|
4150
|
-
oe = ye == null ? 0 : J *
|
|
4149
|
+
const ye = kl(W);
|
|
4150
|
+
oe = ye == null ? 0 : J * Ul(ye);
|
|
4151
4151
|
}
|
|
4152
4152
|
const fe = N.barMinWidth * j, _ = N.barMaxWidth * j;
|
|
4153
4153
|
oe = Math.min(Math.max(oe, fe), _);
|
|
4154
|
-
const H = N.itemStyle.borderWidth ??
|
|
4154
|
+
const H = N.itemStyle.borderWidth ?? _l, X = Math.max(0, H) * j;
|
|
4155
4155
|
l.set([
|
|
4156
4156
|
1,
|
|
4157
4157
|
0,
|
|
@@ -4186,7 +4186,7 @@ function Xl(e, t) {
|
|
|
4186
4186
|
const be = M;
|
|
4187
4187
|
let le = 0;
|
|
4188
4188
|
for (let ye = 0; ye < D.length; ye++) {
|
|
4189
|
-
const { timestamp: Be, open: Le, close: st, low: rt, high: ve } =
|
|
4189
|
+
const { timestamp: Be, open: Le, close: st, low: rt, high: ve } = ea(D[ye]);
|
|
4190
4190
|
if (!Number.isFinite(Be) || !Number.isFinite(Le) || !Number.isFinite(st) || !Number.isFinite(rt) || !Number.isFinite(ve))
|
|
4191
4191
|
continue;
|
|
4192
4192
|
const Te = B.scale(Be), Xe = E.scale(Le), He = E.scale(st), ke = E.scale(rt), bt = E.scale(ve);
|
|
@@ -4259,7 +4259,7 @@ function Xl(e, t) {
|
|
|
4259
4259
|
}
|
|
4260
4260
|
} };
|
|
4261
4261
|
}
|
|
4262
|
-
const
|
|
4262
|
+
const es = `// bar.wgsl
|
|
4263
4263
|
// Instanced bar/rect shader:
|
|
4264
4264
|
// - Per-instance vertex input:
|
|
4265
4265
|
// - rect = vec4<f32>(x, y, width, height) in CLIP space
|
|
@@ -4318,11 +4318,11 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
4318
4318
|
return in.color;
|
|
4319
4319
|
}
|
|
4320
4320
|
|
|
4321
|
-
`,
|
|
4321
|
+
`, Hl = "bgra8unorm", ql = 0.01, Zl = 0.2, ji = 32, Rr = ji / 4, Dr = (e) => Math.min(1, Math.max(0, e)), jl = (e) => ht(e) ?? [0, 0, 0, 1], ts = (e) => {
|
|
4322
4322
|
if (!Number.isFinite(e) || e <= 0) return 1;
|
|
4323
4323
|
const t = Math.ceil(e);
|
|
4324
4324
|
return 2 ** Math.ceil(Math.log2(t));
|
|
4325
|
-
},
|
|
4325
|
+
}, Kl = () => {
|
|
4326
4326
|
const e = new ArrayBuffer(64);
|
|
4327
4327
|
return new Float32Array(e).set([
|
|
4328
4328
|
1,
|
|
@@ -4346,24 +4346,24 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
4346
4346
|
1
|
|
4347
4347
|
// col3
|
|
4348
4348
|
]), e;
|
|
4349
|
-
},
|
|
4349
|
+
}, Jl = (e) => {
|
|
4350
4350
|
const t = e.trim().match(/^(\d+(?:\.\d+)?)%$/);
|
|
4351
4351
|
if (!t) return null;
|
|
4352
4352
|
const n = Number(t[1]) / 100;
|
|
4353
4353
|
return Number.isFinite(n) ? n : null;
|
|
4354
|
-
},
|
|
4354
|
+
}, ns = (e) => {
|
|
4355
4355
|
if (typeof e != "string") return "";
|
|
4356
4356
|
const t = e.trim();
|
|
4357
4357
|
return t.length > 0 ? t : "";
|
|
4358
|
-
},
|
|
4358
|
+
}, Ql = (e) => {
|
|
4359
4359
|
const t = e.devicePixelRatio;
|
|
4360
4360
|
if (!(t > 0)) return null;
|
|
4361
4361
|
const n = e.canvasWidth / t, i = e.canvasHeight / t, r = n - e.left - e.right, o = i - e.top - e.bottom;
|
|
4362
4362
|
return !(r > 0) || !(o > 0) ? null : { plotWidthCss: r, plotHeightCss: o };
|
|
4363
|
-
},
|
|
4363
|
+
}, eu = (e) => {
|
|
4364
4364
|
const { left: t, right: n, top: i, bottom: r, canvasWidth: o, canvasHeight: s, devicePixelRatio: a } = e, u = t * a, f = o - n * a, l = i * a, g = s - r * a, c = u / o * 2 - 1, h = f / o * 2 - 1, d = 1 - l / s * 2, w = 1 - g / s * 2;
|
|
4365
4365
|
return { left: c, right: h, top: d, bottom: w };
|
|
4366
|
-
},
|
|
4366
|
+
}, tu = (e, t, n, i) => {
|
|
4367
4367
|
if (Number.isFinite(t) && t > 0) {
|
|
4368
4368
|
const a = e.scale(0), u = e.scale(0 + t), f = Math.abs(u - a);
|
|
4369
4369
|
if (Number.isFinite(f) && f > 0) return f;
|
|
@@ -4373,14 +4373,14 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
4373
4373
|
const o = Math.max(1, Math.floor(i));
|
|
4374
4374
|
return r / o;
|
|
4375
4375
|
};
|
|
4376
|
-
function
|
|
4376
|
+
function nu(e, t) {
|
|
4377
4377
|
let n = !1;
|
|
4378
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
4378
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? Hl, r = t == null ? void 0 : t.sampleCount, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
4379
4379
|
entries: [
|
|
4380
4380
|
{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } }
|
|
4381
4381
|
]
|
|
4382
4382
|
}), u = mt(e, 64, { label: "barRenderer/vsUniforms" });
|
|
4383
|
-
ft(e, u,
|
|
4383
|
+
ft(e, u, Kl());
|
|
4384
4384
|
const f = e.createBindGroup({
|
|
4385
4385
|
layout: a,
|
|
4386
4386
|
entries: [
|
|
@@ -4392,7 +4392,7 @@ function eu(e, t) {
|
|
|
4392
4392
|
label: "barRenderer/pipeline",
|
|
4393
4393
|
bindGroupLayouts: [a],
|
|
4394
4394
|
vertex: {
|
|
4395
|
-
code:
|
|
4395
|
+
code: es,
|
|
4396
4396
|
label: "bar.wgsl",
|
|
4397
4397
|
buffers: [
|
|
4398
4398
|
{
|
|
@@ -4407,7 +4407,7 @@ function eu(e, t) {
|
|
|
4407
4407
|
]
|
|
4408
4408
|
},
|
|
4409
4409
|
fragment: {
|
|
4410
|
-
code:
|
|
4410
|
+
code: es,
|
|
4411
4411
|
label: "bar.wgsl",
|
|
4412
4412
|
formats: i,
|
|
4413
4413
|
blend: {
|
|
@@ -4425,7 +4425,7 @@ function eu(e, t) {
|
|
|
4425
4425
|
if (n) throw new Error("BarRenderer is disposed.");
|
|
4426
4426
|
}, R = (I) => {
|
|
4427
4427
|
if (I <= d.length) return;
|
|
4428
|
-
const A = Math.max(8,
|
|
4428
|
+
const A = Math.max(8, ts(I));
|
|
4429
4429
|
h = new ArrayBuffer(A * 4), d = new Float32Array(h);
|
|
4430
4430
|
}, T = (I) => {
|
|
4431
4431
|
w.length = 0;
|
|
@@ -4470,15 +4470,15 @@ function eu(e, t) {
|
|
|
4470
4470
|
c = 0;
|
|
4471
4471
|
return;
|
|
4472
4472
|
}
|
|
4473
|
-
const F =
|
|
4473
|
+
const F = Ql(y);
|
|
4474
4474
|
if (!F) {
|
|
4475
4475
|
c = 0;
|
|
4476
4476
|
return;
|
|
4477
4477
|
}
|
|
4478
|
-
const N =
|
|
4478
|
+
const N = eu(y), D = N.right - N.left, B = F.plotWidthCss > 0 ? D / F.plotWidthCss : 0, E = /* @__PURE__ */ new Map(), z = new Array(I.length);
|
|
4479
4479
|
let G = 0;
|
|
4480
4480
|
for (let ge = 0; ge < I.length; ge++) {
|
|
4481
|
-
const ye =
|
|
4481
|
+
const ye = ns(I[ge].stack);
|
|
4482
4482
|
if (ye !== "") {
|
|
4483
4483
|
const Be = E.get(ye);
|
|
4484
4484
|
if (Be !== void 0)
|
|
@@ -4491,19 +4491,19 @@ function eu(e, t) {
|
|
|
4491
4491
|
z[ge] = G++;
|
|
4492
4492
|
}
|
|
4493
4493
|
G = Math.max(1, G);
|
|
4494
|
-
const Y = T(I), V = C(I), j = Dr(V.barGap ??
|
|
4494
|
+
const Y = T(I), V = C(I), j = Dr(V.barGap ?? ql), K = Dr(V.barCategoryGap ?? Zl);
|
|
4495
4495
|
let J = 1;
|
|
4496
4496
|
for (let ge = 0; ge < I.length; ge++) {
|
|
4497
4497
|
const ye = Ie(I[ge].data);
|
|
4498
4498
|
J = Math.max(J, Math.floor(ye));
|
|
4499
4499
|
}
|
|
4500
|
-
const oe =
|
|
4500
|
+
const oe = tu(S, Y, N, J), W = Math.max(0, oe * (1 - K)), fe = G + Math.max(0, G - 1) * j, _ = fe > 0 ? W / fe : 0;
|
|
4501
4501
|
let H = 0;
|
|
4502
4502
|
const X = V.barWidth;
|
|
4503
4503
|
if (typeof X == "number")
|
|
4504
4504
|
H = Math.max(0, X) * B, H = Math.min(H, _);
|
|
4505
4505
|
else if (typeof X == "string") {
|
|
4506
|
-
const ge =
|
|
4506
|
+
const ge = Jl(X);
|
|
4507
4507
|
H = ge == null ? 0 : _ * Dr(ge);
|
|
4508
4508
|
}
|
|
4509
4509
|
H > 0 || (H = _);
|
|
@@ -4524,7 +4524,7 @@ function eu(e, t) {
|
|
|
4524
4524
|
let ee = 0;
|
|
4525
4525
|
const be = /* @__PURE__ */ new Map();
|
|
4526
4526
|
for (let ge = 0; ge < I.length; ge++) {
|
|
4527
|
-
const ye = I[ge], Be = ye.data, [Le, st, rt, ve] =
|
|
4527
|
+
const ye = I[ge], Be = ye.data, [Le, st, rt, ve] = jl(ye.color), Te = ns(ye.stack), Xe = z[ge] ?? 0, He = Ie(Be);
|
|
4528
4528
|
for (let ke = 0; ke < He; ke++) {
|
|
4529
4529
|
const bt = Ae(Be, ke), vt = Ue(Be, ke), We = S.scale(bt);
|
|
4530
4530
|
if (!Number.isFinite(We) || !Number.isFinite(vt)) continue;
|
|
@@ -4553,7 +4553,7 @@ function eu(e, t) {
|
|
|
4553
4553
|
c = ee / Rr;
|
|
4554
4554
|
const le = Math.max(4, c * ji);
|
|
4555
4555
|
if (!g || g.size < le) {
|
|
4556
|
-
const ge = Math.max(Math.max(4,
|
|
4556
|
+
const ge = Math.max(Math.max(4, ts(le)), g ? g.size : 0);
|
|
4557
4557
|
if (g)
|
|
4558
4558
|
try {
|
|
4559
4559
|
g.destroy();
|
|
@@ -4583,15 +4583,15 @@ function eu(e, t) {
|
|
|
4583
4583
|
}
|
|
4584
4584
|
} };
|
|
4585
4585
|
}
|
|
4586
|
-
function
|
|
4587
|
-
const { device: t, targetFormat: n, pipelineCache: i, sampleCount: r } = e, o = [], s = [], a = [], u = [], f = [], l = [], g =
|
|
4586
|
+
function iu(e) {
|
|
4587
|
+
const { device: t, targetFormat: n, pipelineCache: i, sampleCount: r } = e, o = [], s = [], a = [], u = [], f = [], l = [], g = nu(t, { targetFormat: n, pipelineCache: i, sampleCount: r });
|
|
4588
4588
|
function c(m) {
|
|
4589
4589
|
for (; o.length > m; ) {
|
|
4590
4590
|
const x = o.pop();
|
|
4591
4591
|
x == null || x.dispose();
|
|
4592
4592
|
}
|
|
4593
4593
|
for (; o.length < m; )
|
|
4594
|
-
o.push(
|
|
4594
|
+
o.push(il(t, { targetFormat: n, pipelineCache: i, sampleCount: r }));
|
|
4595
4595
|
}
|
|
4596
4596
|
function h(m) {
|
|
4597
4597
|
for (; s.length > m; ) {
|
|
@@ -4599,7 +4599,7 @@ function tu(e) {
|
|
|
4599
4599
|
x == null || x.dispose();
|
|
4600
4600
|
}
|
|
4601
4601
|
for (; s.length < m; )
|
|
4602
|
-
s.push(
|
|
4602
|
+
s.push(cl(t, { targetFormat: n, pipelineCache: i, sampleCount: r }));
|
|
4603
4603
|
}
|
|
4604
4604
|
function d(m) {
|
|
4605
4605
|
for (; a.length > m; ) {
|
|
@@ -4607,7 +4607,7 @@ function tu(e) {
|
|
|
4607
4607
|
x == null || x.dispose();
|
|
4608
4608
|
}
|
|
4609
4609
|
for (; a.length < m; )
|
|
4610
|
-
a.push(
|
|
4610
|
+
a.push(pl(t, { targetFormat: n, pipelineCache: i, sampleCount: r }));
|
|
4611
4611
|
}
|
|
4612
4612
|
function w(m) {
|
|
4613
4613
|
for (; u.length > m; ) {
|
|
@@ -4615,7 +4615,7 @@ function tu(e) {
|
|
|
4615
4615
|
x == null || x.dispose();
|
|
4616
4616
|
}
|
|
4617
4617
|
for (; u.length < m; )
|
|
4618
|
-
u.push(
|
|
4618
|
+
u.push(Nl(t, { targetFormat: n, pipelineCache: i, sampleCount: r }));
|
|
4619
4619
|
}
|
|
4620
4620
|
function P(m) {
|
|
4621
4621
|
for (; f.length > m; ) {
|
|
@@ -4623,7 +4623,7 @@ function tu(e) {
|
|
|
4623
4623
|
x == null || x.dispose();
|
|
4624
4624
|
}
|
|
4625
4625
|
for (; f.length < m; )
|
|
4626
|
-
f.push(
|
|
4626
|
+
f.push(Bl(t, { targetFormat: n, pipelineCache: i, sampleCount: r }));
|
|
4627
4627
|
}
|
|
4628
4628
|
function R(m) {
|
|
4629
4629
|
for (; l.length > m; ) {
|
|
@@ -4631,7 +4631,7 @@ function tu(e) {
|
|
|
4631
4631
|
x == null || x.dispose();
|
|
4632
4632
|
}
|
|
4633
4633
|
for (; l.length < m; )
|
|
4634
|
-
l.push(
|
|
4634
|
+
l.push(Yl(t, { targetFormat: n, pipelineCache: i, sampleCount: r }));
|
|
4635
4635
|
}
|
|
4636
4636
|
let T = null;
|
|
4637
4637
|
function C() {
|
|
@@ -4676,7 +4676,7 @@ function tu(e) {
|
|
|
4676
4676
|
dispose: v
|
|
4677
4677
|
};
|
|
4678
4678
|
}
|
|
4679
|
-
const Vn = 4, ui = 4,
|
|
4679
|
+
const Vn = 4, ui = 4, is = `
|
|
4680
4680
|
struct VSOut { @builtin(position) pos: vec4f };
|
|
4681
4681
|
|
|
4682
4682
|
@vertex
|
|
@@ -4707,7 +4707,7 @@ function En(e) {
|
|
|
4707
4707
|
} catch {
|
|
4708
4708
|
}
|
|
4709
4709
|
}
|
|
4710
|
-
function
|
|
4710
|
+
function ru(e) {
|
|
4711
4711
|
const { device: t, targetFormat: n } = e, i = {
|
|
4712
4712
|
mainColorTexture: null,
|
|
4713
4713
|
mainColorView: null,
|
|
@@ -4728,8 +4728,8 @@ function nu(e) {
|
|
|
4728
4728
|
}), o = _t(t, {
|
|
4729
4729
|
label: "textureManager/overlayBlitPipeline",
|
|
4730
4730
|
bindGroupLayouts: [r],
|
|
4731
|
-
vertex: { code:
|
|
4732
|
-
fragment: { code:
|
|
4731
|
+
vertex: { code: is, label: "textureManager/overlayBlit.wgsl" },
|
|
4732
|
+
fragment: { code: is, label: "textureManager/overlayBlit.wgsl", formats: n },
|
|
4733
4733
|
primitive: { topology: "triangle-list", cullMode: "none" },
|
|
4734
4734
|
multisample: { count: ui }
|
|
4735
4735
|
}, e.pipelineCache);
|
|
@@ -4779,7 +4779,7 @@ function nu(e) {
|
|
|
4779
4779
|
dispose: f
|
|
4780
4780
|
};
|
|
4781
4781
|
}
|
|
4782
|
-
const
|
|
4782
|
+
const rs = `// crosshair.wgsl
|
|
4783
4783
|
// Minimal crosshair line shader:
|
|
4784
4784
|
// - Vertex input: vec2<f32> position in clip-space coordinates
|
|
4785
4785
|
// - VS uniform: transform mat4 (identity)
|
|
@@ -4817,15 +4817,15 @@ fn fsMain() -> @location(0) vec4<f32> {
|
|
|
4817
4817
|
return fsUniforms.color;
|
|
4818
4818
|
}
|
|
4819
4819
|
|
|
4820
|
-
`,
|
|
4820
|
+
`, ou = (e) => e + 3 & -4, su = 1024, au = 128, cu = 16384, lu = (e) => {
|
|
4821
4821
|
if (e.byteOffset & 3)
|
|
4822
4822
|
throw new Error("createStreamBuffer.write: data.byteOffset must be 4-byte aligned.");
|
|
4823
4823
|
return new Uint32Array(e.buffer, e.byteOffset, e.byteLength >>> 2);
|
|
4824
4824
|
};
|
|
4825
|
-
function
|
|
4825
|
+
function uu(e, t) {
|
|
4826
4826
|
if (!Number.isFinite(t) || t <= 0)
|
|
4827
4827
|
throw new Error(`createStreamBuffer(maxSize): maxSize (bytes) must be a positive number. Received: ${String(t)}`);
|
|
4828
|
-
const n = Math.max(4, Math.floor(t)), i =
|
|
4828
|
+
const n = Math.max(4, Math.floor(t)), i = ou(n), r = e.limits.maxBufferSize;
|
|
4829
4829
|
if (i > r)
|
|
4830
4830
|
throw new Error(
|
|
4831
4831
|
`createStreamBuffer(maxSize): requested size ${i} bytes exceeds device.limits.maxBufferSize (${r}).`
|
|
@@ -4853,7 +4853,7 @@ function cu(e, t) {
|
|
|
4853
4853
|
if (v < 0 || v > C.length)
|
|
4854
4854
|
throw new Error("createStreamBuffer.write: internal error (invalid usedWords).");
|
|
4855
4855
|
const b = v << 2;
|
|
4856
|
-
if (b > 0 && b <=
|
|
4856
|
+
if (b > 0 && b <= su) {
|
|
4857
4857
|
c(T, C, v);
|
|
4858
4858
|
return;
|
|
4859
4859
|
}
|
|
@@ -4865,7 +4865,7 @@ function cu(e, t) {
|
|
|
4865
4865
|
const p = S;
|
|
4866
4866
|
for (S++; S < v && x[S] !== C[S]; ) S++;
|
|
4867
4867
|
const y = S;
|
|
4868
|
-
if (M.push([p, y]), I++, A += y - p, I >
|
|
4868
|
+
if (M.push([p, y]), I++, A += y - p, I > au || A > cu) {
|
|
4869
4869
|
c(T, C, v);
|
|
4870
4870
|
return;
|
|
4871
4871
|
}
|
|
@@ -4888,7 +4888,7 @@ function cu(e, t) {
|
|
|
4888
4888
|
l = v;
|
|
4889
4889
|
return;
|
|
4890
4890
|
}
|
|
4891
|
-
const m =
|
|
4891
|
+
const m = lu(T), x = 1 - f;
|
|
4892
4892
|
h(x, m, m.length), f = x, l = v;
|
|
4893
4893
|
}, getBuffer: () => (g(), a[f].buffer), getVertexCount: () => (g(), l), dispose: () => {
|
|
4894
4894
|
if (!u) {
|
|
@@ -4901,7 +4901,7 @@ function cu(e, t) {
|
|
|
4901
4901
|
}
|
|
4902
4902
|
} };
|
|
4903
4903
|
}
|
|
4904
|
-
const
|
|
4904
|
+
const fu = "bgra8unorm", du = [1, 1, 1, 0.8], mu = 8, pu = 6, hu = 4, ta = 8192, yu = () => {
|
|
4905
4905
|
const e = new ArrayBuffer(64);
|
|
4906
4906
|
return new Float32Array(e).set([
|
|
4907
4907
|
1,
|
|
@@ -4925,20 +4925,20 @@ const lu = "bgra8unorm", uu = [1, 1, 1, 0.8], fu = 8, du = 6, mu = 4, Qs = 8192,
|
|
|
4925
4925
|
1
|
|
4926
4926
|
// col3
|
|
4927
4927
|
]), e;
|
|
4928
|
-
},
|
|
4928
|
+
}, gu = (e) => Number.isFinite(e.left) && Number.isFinite(e.right) && Number.isFinite(e.top) && Number.isFinite(e.bottom) && Number.isFinite(e.canvasWidth) && Number.isFinite(e.canvasHeight), Gi = (e, t, n) => Math.min(n, Math.max(t, e | 0)), xu = (e, t) => {
|
|
4929
4929
|
if (!Number.isFinite(e) || e < 0)
|
|
4930
4930
|
throw new Error("CrosshairRenderer.prepare: lineWidth must be a finite non-negative number.");
|
|
4931
4931
|
if (e === 0) return [];
|
|
4932
|
-
const n = e * t, i = Math.max(1, Math.min(
|
|
4932
|
+
const n = e * t, i = Math.max(1, Math.min(mu, Math.round(n))), r = (i - 1) / 2, o = [];
|
|
4933
4933
|
for (let s = 0; s < i; s++) o.push(s - r);
|
|
4934
4934
|
return o;
|
|
4935
4935
|
}, Bn = (e, t) => e / t * 2 - 1, Ln = (e, t) => 1 - e / t * 2, zi = (e, t) => {
|
|
4936
4936
|
e.push(t[0], t[1], t[2], t[3]);
|
|
4937
|
-
},
|
|
4937
|
+
}, os = (e, t) => {
|
|
4938
4938
|
if (!Number.isFinite(e) || !Number.isFinite(t)) return [];
|
|
4939
4939
|
const n = Math.min(e, t), i = Math.max(e, t);
|
|
4940
4940
|
if (i <= n) return [];
|
|
4941
|
-
const r =
|
|
4941
|
+
const r = pu, s = r + hu;
|
|
4942
4942
|
if (!Number.isFinite(s)) return [];
|
|
4943
4943
|
const a = Math.ceil((i - n) / s);
|
|
4944
4944
|
if (!Number.isFinite(a) || a <= 0) return [];
|
|
@@ -4949,22 +4949,22 @@ const lu = "bgra8unorm", uu = [1, 1, 1, 0.8], fu = 8, du = 6, mu = 4, Qs = 8192,
|
|
|
4949
4949
|
g > l && u.push([l, g]), f += s;
|
|
4950
4950
|
}
|
|
4951
4951
|
return u;
|
|
4952
|
-
},
|
|
4952
|
+
}, bu = (e, t, n, i) => {
|
|
4953
4953
|
if (!Number.isFinite(e) || !Number.isFinite(t))
|
|
4954
4954
|
throw new Error("CrosshairRenderer.prepare: x and y must be finite numbers.");
|
|
4955
|
-
if (!
|
|
4955
|
+
if (!gu(n))
|
|
4956
4956
|
throw new Error("CrosshairRenderer.prepare: gridArea dimensions must be finite numbers.");
|
|
4957
4957
|
if (n.canvasWidth <= 0 || n.canvasHeight <= 0)
|
|
4958
4958
|
throw new Error("CrosshairRenderer.prepare: canvas dimensions must be positive.");
|
|
4959
4959
|
if (n.left < 0 || n.right < 0 || n.top < 0 || n.bottom < 0)
|
|
4960
4960
|
throw new Error("CrosshairRenderer.prepare: gridArea margins must be non-negative.");
|
|
4961
|
-
const { canvasWidth: r, canvasHeight: o } = n, s = Number.isFinite(n.devicePixelRatio) && n.devicePixelRatio > 0 ? n.devicePixelRatio : 1, a = n.left * s, u = r - n.right * s, f = n.top * s, l = o - n.bottom * s, g = Gi(Math.floor(a), 0, Math.max(0, r)), c = Gi(Math.floor(f), 0, Math.max(0, o)), h = Gi(Math.ceil(u), 0, Math.max(0, r)), d = Gi(Math.ceil(l), 0, Math.max(0, o)), w = Math.max(0, h - g), P = Math.max(0, d - c), R = e * s, T = t * s, C =
|
|
4961
|
+
const { canvasWidth: r, canvasHeight: o } = n, s = Number.isFinite(n.devicePixelRatio) && n.devicePixelRatio > 0 ? n.devicePixelRatio : 1, a = n.left * s, u = r - n.right * s, f = n.top * s, l = o - n.bottom * s, g = Gi(Math.floor(a), 0, Math.max(0, r)), c = Gi(Math.floor(f), 0, Math.max(0, o)), h = Gi(Math.ceil(u), 0, Math.max(0, r)), d = Gi(Math.ceil(l), 0, Math.max(0, o)), w = Math.max(0, h - g), P = Math.max(0, d - c), R = e * s, T = t * s, C = xu(i.lineWidth, s);
|
|
4962
4962
|
if (C.length === 0 || !i.showX && !i.showY)
|
|
4963
4963
|
return {
|
|
4964
4964
|
vertices: new Float32Array(0),
|
|
4965
4965
|
scissor: { x: g, y: c, w, h: P }
|
|
4966
4966
|
};
|
|
4967
|
-
const v = [], m = i.showX ?
|
|
4967
|
+
const v = [], m = i.showX ? os(f, l) : [], x = i.showY ? os(a, u) : [], M = ((i.showX ? m.length : 0) + (i.showY ? x.length : 0)) * C.length * 2, I = M > 0 && M <= ta, A = (y) => {
|
|
4968
4968
|
const F = Bn(y, r), N = Ln(f, o), D = Ln(l, o);
|
|
4969
4969
|
zi(v, [F, N, F, D]);
|
|
4970
4970
|
}, S = (y) => {
|
|
@@ -4999,9 +4999,9 @@ const lu = "bgra8unorm", uu = [1, 1, 1, 0.8], fu = 8, du = 6, mu = 4, Qs = 8192,
|
|
|
4999
4999
|
}
|
|
5000
5000
|
return { vertices: new Float32Array(v), scissor: { x: g, y: c, w, h: P } };
|
|
5001
5001
|
};
|
|
5002
|
-
function
|
|
5002
|
+
function vu(e, t) {
|
|
5003
5003
|
let n = !1, i = !0;
|
|
5004
|
-
const r = (t == null ? void 0 : t.targetFormat) ??
|
|
5004
|
+
const r = (t == null ? void 0 : t.targetFormat) ?? fu, o = (t == null ? void 0 : t.sampleCount) ?? 1, s = Number.isFinite(o) ? Math.max(1, Math.floor(o)) : 1, a = t == null ? void 0 : t.pipelineCache, u = e.createBindGroupLayout({
|
|
5005
5005
|
entries: [
|
|
5006
5006
|
{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } },
|
|
5007
5007
|
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } }
|
|
@@ -5018,7 +5018,7 @@ function xu(e, t) {
|
|
|
5018
5018
|
label: "crosshairRenderer/pipeline",
|
|
5019
5019
|
bindGroupLayouts: [u],
|
|
5020
5020
|
vertex: {
|
|
5021
|
-
code:
|
|
5021
|
+
code: rs,
|
|
5022
5022
|
label: "crosshair.wgsl",
|
|
5023
5023
|
buffers: [
|
|
5024
5024
|
{
|
|
@@ -5029,7 +5029,7 @@ function xu(e, t) {
|
|
|
5029
5029
|
]
|
|
5030
5030
|
},
|
|
5031
5031
|
fragment: {
|
|
5032
|
-
code:
|
|
5032
|
+
code: rs,
|
|
5033
5033
|
label: "crosshair.wgsl",
|
|
5034
5034
|
formats: r,
|
|
5035
5035
|
blend: {
|
|
@@ -5041,7 +5041,7 @@ function xu(e, t) {
|
|
|
5041
5041
|
multisample: { count: s }
|
|
5042
5042
|
},
|
|
5043
5043
|
a
|
|
5044
|
-
), h =
|
|
5044
|
+
), h = uu(e, ta * 8);
|
|
5045
5045
|
let d = 0, w = 0, P = 0, R = { x: 0, y: 0, w: 0, h: 0 };
|
|
5046
5046
|
const T = () => {
|
|
5047
5047
|
if (n) throw new Error("CrosshairRenderer is disposed.");
|
|
@@ -5053,9 +5053,9 @@ function xu(e, t) {
|
|
|
5053
5053
|
throw new Error("CrosshairRenderer.prepare: color must be a string.");
|
|
5054
5054
|
if (!Number.isFinite(A.lineWidth) || A.lineWidth < 0)
|
|
5055
5055
|
throw new Error("CrosshairRenderer.prepare: lineWidth must be a finite non-negative number.");
|
|
5056
|
-
const { vertices: S, scissor: p } =
|
|
5057
|
-
S.byteLength === 0 ? d = 0 : (h.write(S), d = h.getVertexCount()), ft(e, f,
|
|
5058
|
-
const y = ht(A.color) ??
|
|
5056
|
+
const { vertices: S, scissor: p } = bu(b, M, I, A);
|
|
5057
|
+
S.byteLength === 0 ? d = 0 : (h.write(S), d = h.getVertexCount()), ft(e, f, yu());
|
|
5058
|
+
const y = ht(A.color) ?? du, F = new ArrayBuffer(4 * 4);
|
|
5059
5059
|
new Float32Array(F).set([y[0], y[1], y[2], y[3]]), ft(e, l, F), w = I.canvasWidth, P = I.canvasHeight, R = p;
|
|
5060
5060
|
}, render: (b) => {
|
|
5061
5061
|
T(), i && d !== 0 && (w <= 0 || P <= 0 || (b.setScissorRect(R.x, R.y, R.w, R.h), b.setPipeline(c), b.setBindGroup(0, g), b.setVertexBuffer(0, h.getBuffer()), b.draw(d), b.setScissorRect(0, 0, w, P)));
|
|
@@ -5076,7 +5076,7 @@ function xu(e, t) {
|
|
|
5076
5076
|
}
|
|
5077
5077
|
} };
|
|
5078
5078
|
}
|
|
5079
|
-
const
|
|
5079
|
+
const ss = `// highlight.wgsl
|
|
5080
5080
|
// Draws an anti-aliased ring highlight around a point.
|
|
5081
5081
|
//
|
|
5082
5082
|
// Contract:
|
|
@@ -5140,13 +5140,13 @@ fn fsMain(@builtin(position) fragPos: vec4<f32>) -> @location(0) vec4<f32> {
|
|
|
5140
5140
|
return vec4<f32>(rgb, a);
|
|
5141
5141
|
}
|
|
5142
5142
|
|
|
5143
|
-
`,
|
|
5143
|
+
`, wu = "bgra8unorm", Cu = [1, 1, 1, 1], Vi = (e) => Math.min(1, Math.max(0, e)), Wi = (e, t, n) => Math.min(n, Math.max(t, e | 0)), Mu = (e) => Number.isFinite(e.x) && Number.isFinite(e.y) && Number.isFinite(e.w) && Number.isFinite(e.h), Su = (e, t) => {
|
|
5144
5144
|
const n = Number.isFinite(t) ? t : 1;
|
|
5145
5145
|
return [Vi(e[0] * n), Vi(e[1] * n), Vi(e[2] * n), Vi(e[3])];
|
|
5146
|
-
},
|
|
5147
|
-
function
|
|
5146
|
+
}, Fu = (e) => 0.2126 * e[0] + 0.7152 * e[1] + 0.0722 * e[2];
|
|
5147
|
+
function Nu(e, t) {
|
|
5148
5148
|
let n = !1, i = !0;
|
|
5149
|
-
const r = (t == null ? void 0 : t.targetFormat) ??
|
|
5149
|
+
const r = (t == null ? void 0 : t.targetFormat) ?? wu, o = (t == null ? void 0 : t.sampleCount) ?? 1, s = Number.isFinite(o) ? Math.max(1, Math.floor(o)) : 1, a = t == null ? void 0 : t.pipelineCache, u = e.createBindGroupLayout({
|
|
5150
5150
|
entries: [{ binding: 0, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } }]
|
|
5151
5151
|
}), f = mt(e, 48, { label: "highlightRenderer/uniforms" }), l = e.createBindGroup({
|
|
5152
5152
|
layout: u,
|
|
@@ -5156,9 +5156,9 @@ function Su(e, t) {
|
|
|
5156
5156
|
{
|
|
5157
5157
|
label: "highlightRenderer/pipeline",
|
|
5158
5158
|
bindGroupLayouts: [u],
|
|
5159
|
-
vertex: { code:
|
|
5159
|
+
vertex: { code: ss, label: "highlight.wgsl" },
|
|
5160
5160
|
fragment: {
|
|
5161
|
-
code:
|
|
5161
|
+
code: ss,
|
|
5162
5162
|
label: "highlight.wgsl",
|
|
5163
5163
|
formats: r,
|
|
5164
5164
|
blend: {
|
|
@@ -5180,11 +5180,11 @@ function Su(e, t) {
|
|
|
5180
5180
|
throw new Error("HighlightRenderer.prepare: point center must be finite.");
|
|
5181
5181
|
if (!Number.isFinite(m.canvasWidth) || !Number.isFinite(m.canvasHeight) || m.canvasWidth <= 0 || m.canvasHeight <= 0)
|
|
5182
5182
|
throw new Error("HighlightRenderer.prepare: canvasWidth/canvasHeight must be positive finite numbers.");
|
|
5183
|
-
if (!
|
|
5183
|
+
if (!Mu(m.scissor))
|
|
5184
5184
|
throw new Error("HighlightRenderer.prepare: scissor must be finite.");
|
|
5185
5185
|
if (!Number.isFinite(b) || b < 0)
|
|
5186
5186
|
throw new Error("HighlightRenderer.prepare: size must be a finite non-negative number.");
|
|
5187
|
-
const M = m.devicePixelRatio, I = Number.isFinite(M) && M > 0 ? M : 1, A = b * I, S = Math.max(1, A * 1.5), p = Math.max(1, Math.round(Math.max(2, S * 0.25))), y = ht(x) ??
|
|
5187
|
+
const M = m.devicePixelRatio, I = Number.isFinite(M) && M > 0 ? M : 1, A = b * I, S = Math.max(1, A * 1.5), p = Math.max(1, Math.round(Math.max(2, S * 0.25))), y = ht(x) ?? Cu, F = Su(y, 1.25), D = Fu(y) > 0.7 ? [0, 0, 0, 0.9] : [1, 1, 1, 0.9], B = new ArrayBuffer(12 * 4);
|
|
5188
5188
|
new Float32Array(B).set([
|
|
5189
5189
|
m.centerDeviceX,
|
|
5190
5190
|
m.centerDeviceY,
|
|
@@ -5216,7 +5216,7 @@ function Su(e, t) {
|
|
|
5216
5216
|
}
|
|
5217
5217
|
} };
|
|
5218
5218
|
}
|
|
5219
|
-
const
|
|
5219
|
+
const as = `// Reference line renderer (axis-aligned, instanced quads).
|
|
5220
5220
|
//
|
|
5221
5221
|
// Coordinate conventions:
|
|
5222
5222
|
// - Instance position is provided in CANVAS-LOCAL CSS pixels (same coordinate space as pointer events).
|
|
@@ -5427,7 +5427,7 @@ fn fsMain(in : VSOut) -> @location(0) vec4<f32> {
|
|
|
5427
5427
|
color.a = 0.0;
|
|
5428
5428
|
return color;
|
|
5429
5429
|
}
|
|
5430
|
-
`, kn = 8,
|
|
5430
|
+
`, kn = 8, Tu = "bgra8unorm", Au = (e) => Number.isFinite(e.left) && Number.isFinite(e.right) && Number.isFinite(e.top) && Number.isFinite(e.bottom) && Number.isFinite(e.canvasWidth) && Number.isFinite(e.canvasHeight), Iu = (e) => {
|
|
5431
5431
|
if (!e || e.length === 0)
|
|
5432
5432
|
return { dashCount: 0, dashTotal: 0, values: new Array(kn).fill(0) };
|
|
5433
5433
|
const t = [];
|
|
@@ -5443,9 +5443,9 @@ fn fsMain(in : VSOut) -> @location(0) vec4<f32> {
|
|
|
5443
5443
|
r[s] = n[s], o += n[s];
|
|
5444
5444
|
return !Number.isFinite(o) || o <= 0 ? { dashCount: 0, dashTotal: 0, values: new Array(kn).fill(0) } : { dashCount: i, dashTotal: o, values: r };
|
|
5445
5445
|
};
|
|
5446
|
-
function
|
|
5446
|
+
function cs(e, t) {
|
|
5447
5447
|
let n = !1;
|
|
5448
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
5448
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? Tu, r = (t == null ? void 0 : t.sampleCount) ?? 1, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
5449
5449
|
entries: [{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } }]
|
|
5450
5450
|
}), u = mt(e, 32, { label: "referenceLineRenderer/vsUniforms" }), f = e.createBindGroup({
|
|
5451
5451
|
layout: a,
|
|
@@ -5456,7 +5456,7 @@ function ss(e, t) {
|
|
|
5456
5456
|
label: "referenceLineRenderer/pipeline",
|
|
5457
5457
|
bindGroupLayouts: [a],
|
|
5458
5458
|
vertex: {
|
|
5459
|
-
code:
|
|
5459
|
+
code: as,
|
|
5460
5460
|
label: "referenceLine.wgsl",
|
|
5461
5461
|
buffers: [
|
|
5462
5462
|
{
|
|
@@ -5480,7 +5480,7 @@ function ss(e, t) {
|
|
|
5480
5480
|
]
|
|
5481
5481
|
},
|
|
5482
5482
|
fragment: {
|
|
5483
|
-
code:
|
|
5483
|
+
code: as,
|
|
5484
5484
|
label: "referenceLine.wgsl",
|
|
5485
5485
|
formats: i,
|
|
5486
5486
|
blend: {
|
|
@@ -5500,7 +5500,7 @@ function ss(e, t) {
|
|
|
5500
5500
|
return { prepare: (v, m) => {
|
|
5501
5501
|
if (P(), !Array.isArray(m))
|
|
5502
5502
|
throw new Error("ReferenceLineRenderer.prepare: lines must be an array.");
|
|
5503
|
-
if (!
|
|
5503
|
+
if (!Au(v))
|
|
5504
5504
|
throw new Error("ReferenceLineRenderer.prepare: gridArea dimensions must be finite numbers.");
|
|
5505
5505
|
if (v.canvasWidth <= 0 || v.canvasHeight <= 0)
|
|
5506
5506
|
throw new Error("ReferenceLineRenderer.prepare: canvas dimensions must be positive.");
|
|
@@ -5541,7 +5541,7 @@ function ss(e, t) {
|
|
|
5541
5541
|
const E = D.rgba;
|
|
5542
5542
|
if (!Array.isArray(E) || E.length !== 4)
|
|
5543
5543
|
throw new Error("ReferenceLineRenderer.prepare: line.rgba must be a tuple [r,g,b,a].");
|
|
5544
|
-
const z =
|
|
5544
|
+
const z = Iu(D.lineDash);
|
|
5545
5545
|
F[B + 0] = D.axis === "vertical" ? 0 : 1, F[B + 1] = D.positionCssPx, F[B + 2] = D.lineWidth, F[B + 3] = z.dashCount, F[B + 4] = z.dashTotal, F[B + 5] = 0;
|
|
5546
5546
|
for (let G = 0; G < kn; G++)
|
|
5547
5547
|
F[B + 6 + G] = z.values[G];
|
|
@@ -5568,7 +5568,7 @@ function ss(e, t) {
|
|
|
5568
5568
|
}
|
|
5569
5569
|
} };
|
|
5570
5570
|
}
|
|
5571
|
-
const
|
|
5571
|
+
const ls = `// annotationMarker.wgsl
|
|
5572
5572
|
// Instanced annotation marker shader (circle SDF with optional stroke).
|
|
5573
5573
|
//
|
|
5574
5574
|
// Coordinate contract:
|
|
@@ -5681,14 +5681,14 @@ fn fsMain(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
5681
5681
|
return vec4<f32>(rgb, outA);
|
|
5682
5682
|
}
|
|
5683
5683
|
|
|
5684
|
-
`,
|
|
5684
|
+
`, Pu = "bgra8unorm", Ki = 12, Er = Ki * 4, fn = (e) => Math.min(1, Math.max(0, e)), us = (e) => {
|
|
5685
5685
|
if (!Number.isFinite(e) || e <= 0) return 1;
|
|
5686
5686
|
const t = Math.ceil(e);
|
|
5687
5687
|
return 2 ** Math.ceil(Math.log2(t));
|
|
5688
5688
|
};
|
|
5689
|
-
function
|
|
5689
|
+
function fs(e, t) {
|
|
5690
5690
|
let n = !1;
|
|
5691
|
-
const i = (t == null ? void 0 : t.targetFormat) ??
|
|
5691
|
+
const i = (t == null ? void 0 : t.targetFormat) ?? Pu, r = (t == null ? void 0 : t.sampleCount) ?? 1, o = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, s = t == null ? void 0 : t.pipelineCache, a = e.createBindGroupLayout({
|
|
5692
5692
|
entries: [{ binding: 0, visibility: GPUShaderStage.VERTEX, buffer: { type: "uniform" } }]
|
|
5693
5693
|
}), u = mt(e, 16, { label: "annotationMarkerRenderer/vsUniforms" }), f = new Float32Array(4), l = e.createBindGroup({
|
|
5694
5694
|
layout: a,
|
|
@@ -5699,7 +5699,7 @@ function ls(e, t) {
|
|
|
5699
5699
|
label: "annotationMarkerRenderer/pipeline",
|
|
5700
5700
|
bindGroupLayouts: [a],
|
|
5701
5701
|
vertex: {
|
|
5702
|
-
code:
|
|
5702
|
+
code: ls,
|
|
5703
5703
|
label: "annotationMarker.wgsl",
|
|
5704
5704
|
buffers: [
|
|
5705
5705
|
{
|
|
@@ -5721,7 +5721,7 @@ function ls(e, t) {
|
|
|
5721
5721
|
]
|
|
5722
5722
|
},
|
|
5723
5723
|
fragment: {
|
|
5724
|
-
code:
|
|
5724
|
+
code: ls,
|
|
5725
5725
|
label: "annotationMarker.wgsl",
|
|
5726
5726
|
formats: i,
|
|
5727
5727
|
blend: {
|
|
@@ -5739,7 +5739,7 @@ function ls(e, t) {
|
|
|
5739
5739
|
if (n) throw new Error("AnnotationMarkerRenderer is disposed.");
|
|
5740
5740
|
}, R = (x) => {
|
|
5741
5741
|
if (x <= w.length) return;
|
|
5742
|
-
const b = Math.max(32,
|
|
5742
|
+
const b = Math.max(32, us(x));
|
|
5743
5743
|
d = new ArrayBuffer(b * 4), w = new Float32Array(d);
|
|
5744
5744
|
}, T = (x, b, M) => {
|
|
5745
5745
|
const I = Number.isFinite(x) && x > 0 ? x : 1, A = Number.isFinite(b) && b > 0 ? b : 1, S = Number.isFinite(M) && M > 0 ? M : 1;
|
|
@@ -5763,7 +5763,7 @@ function ls(e, t) {
|
|
|
5763
5763
|
return;
|
|
5764
5764
|
const p = Math.max(4, h * Er);
|
|
5765
5765
|
if (!c || c.size < p) {
|
|
5766
|
-
const y = Math.max(Math.max(4,
|
|
5766
|
+
const y = Math.max(Math.max(4, us(p)), c ? c.size : 0);
|
|
5767
5767
|
if (c)
|
|
5768
5768
|
try {
|
|
5769
5769
|
c.destroy();
|
|
@@ -5795,8 +5795,8 @@ function ls(e, t) {
|
|
|
5795
5795
|
}
|
|
5796
5796
|
} };
|
|
5797
5797
|
}
|
|
5798
|
-
const
|
|
5799
|
-
function
|
|
5798
|
+
const Ru = 6, Du = 500;
|
|
5799
|
+
function Eu(e, t) {
|
|
5800
5800
|
let n = !1, i = t;
|
|
5801
5801
|
const r = {
|
|
5802
5802
|
mousemove: /* @__PURE__ */ new Set(),
|
|
@@ -5852,8 +5852,8 @@ function Ru(e, t) {
|
|
|
5852
5852
|
e.hasPointerCapture(v.pointerId) && (s = v.pointerId, e.releasePointerCapture(v.pointerId));
|
|
5853
5853
|
} catch {
|
|
5854
5854
|
}
|
|
5855
|
-
const I =
|
|
5856
|
-
m <=
|
|
5855
|
+
const I = Ru;
|
|
5856
|
+
m <= Du && M <= I * I && u("click", v);
|
|
5857
5857
|
};
|
|
5858
5858
|
return e.addEventListener("pointermove", l, { passive: !0 }), e.addEventListener("pointerleave", g, { passive: !0 }), e.addEventListener("pointercancel", c, { passive: !0 }), e.addEventListener("lostpointercapture", h, { passive: !0 }), e.addEventListener("pointerdown", d, { passive: !0 }), e.addEventListener("pointerup", w, { passive: !0 }), { canvas: e, on: (v, m) => {
|
|
5859
5859
|
n || r[v].add(m);
|
|
@@ -5865,7 +5865,7 @@ function Ru(e, t) {
|
|
|
5865
5865
|
n || (n = !0, o = null, s = null, e.removeEventListener("pointermove", l), e.removeEventListener("pointerleave", g), e.removeEventListener("pointercancel", c), e.removeEventListener("lostpointercapture", h), e.removeEventListener("pointerdown", d), e.removeEventListener("pointerup", w), r.mousemove.clear(), r.click.clear(), r.mouseleave.clear());
|
|
5866
5866
|
} };
|
|
5867
5867
|
}
|
|
5868
|
-
const
|
|
5868
|
+
const ds = (e, t, n) => Math.min(n, Math.max(t, e)), Bu = (e, t) => {
|
|
5869
5869
|
const n = e.deltaY;
|
|
5870
5870
|
if (!Number.isFinite(n) || n === 0) return 0;
|
|
5871
5871
|
switch (e.deltaMode) {
|
|
@@ -5878,7 +5878,7 @@ const us = (e, t, n) => Math.min(n, Math.max(t, e)), Du = (e, t) => {
|
|
|
5878
5878
|
default:
|
|
5879
5879
|
return n;
|
|
5880
5880
|
}
|
|
5881
|
-
},
|
|
5881
|
+
}, Lu = (e, t) => {
|
|
5882
5882
|
const n = e.deltaX;
|
|
5883
5883
|
if (!Number.isFinite(n) || n === 0) return 0;
|
|
5884
5884
|
switch (e.deltaMode) {
|
|
@@ -5891,20 +5891,20 @@ const us = (e, t, n) => Math.min(n, Math.max(t, e)), Du = (e, t) => {
|
|
|
5891
5891
|
default:
|
|
5892
5892
|
return n;
|
|
5893
5893
|
}
|
|
5894
|
-
},
|
|
5894
|
+
}, _u = (e) => {
|
|
5895
5895
|
const t = Math.abs(e);
|
|
5896
5896
|
if (!Number.isFinite(t) || t === 0) return 1;
|
|
5897
5897
|
const n = Math.min(t, 200);
|
|
5898
5898
|
return Math.exp(n * 2e-3);
|
|
5899
|
-
},
|
|
5900
|
-
function
|
|
5899
|
+
}, Uu = (e) => e.pointerType === "mouse" && (e.buttons & 4) !== 0, ku = (e) => e.pointerType === "mouse" && e.shiftKey && (e.buttons & 1) !== 0;
|
|
5900
|
+
function Gu(e, t) {
|
|
5901
5901
|
let n = !1, i = !1, r = null, o = !1, s = 0;
|
|
5902
5902
|
const a = () => {
|
|
5903
5903
|
o = !1, s = 0;
|
|
5904
5904
|
}, u = (d) => {
|
|
5905
5905
|
if (r = d, !i) return;
|
|
5906
5906
|
const w = d.originalEvent;
|
|
5907
|
-
if (!(d.isInGrid && (
|
|
5907
|
+
if (!(d.isInGrid && (ku(w) || Uu(w)))) {
|
|
5908
5908
|
a();
|
|
5909
5909
|
return;
|
|
5910
5910
|
}
|
|
@@ -5931,7 +5931,7 @@ function Uu(e, t) {
|
|
|
5931
5931
|
if (!w || !w.isInGrid) return;
|
|
5932
5932
|
const P = w.plotWidthCss, R = w.plotHeightCss;
|
|
5933
5933
|
if (!(P > 0) || !(R > 0)) return;
|
|
5934
|
-
const T =
|
|
5934
|
+
const T = Bu(d, R), C = Lu(d, P);
|
|
5935
5935
|
if (Math.abs(C) > Math.abs(T) && C !== 0) {
|
|
5936
5936
|
const { start: A, end: S } = t.getRange(), p = S - A;
|
|
5937
5937
|
if (!Number.isFinite(p) || p === 0) return;
|
|
@@ -5941,11 +5941,11 @@ function Uu(e, t) {
|
|
|
5941
5941
|
return;
|
|
5942
5942
|
}
|
|
5943
5943
|
if (T === 0) return;
|
|
5944
|
-
const v =
|
|
5944
|
+
const v = _u(T);
|
|
5945
5945
|
if (!(v > 1)) return;
|
|
5946
5946
|
const { start: m, end: x } = t.getRange(), b = x - m;
|
|
5947
5947
|
if (!Number.isFinite(b) || b === 0) return;
|
|
5948
|
-
const M =
|
|
5948
|
+
const M = ds(w.gridX / P, 0, 1), I = ds(m + M * b, 0, 100);
|
|
5949
5949
|
d.preventDefault(), T < 0 ? t.zoomIn(I, v) : t.zoomOut(I, v);
|
|
5950
5950
|
}, g = () => {
|
|
5951
5951
|
n || i || (i = !0, e.on("mousemove", u), e.on("mouseleave", f), e.canvas.addEventListener("wheel", l, { passive: !1 }));
|
|
@@ -5956,22 +5956,22 @@ function Uu(e, t) {
|
|
|
5956
5956
|
n || (c(), n = !0);
|
|
5957
5957
|
} };
|
|
5958
5958
|
}
|
|
5959
|
-
const
|
|
5960
|
-
function
|
|
5959
|
+
const zu = 0.5, Vu = 100, Qt = (e, t, n) => Math.min(n, Math.max(t, e)), Br = (e) => Qt(e, 0, 1), ms = (e) => Object.is(e, -0) ? 0 : e, Wu = (e) => ({ start: e.start, end: e.end });
|
|
5960
|
+
function Ou(e, t, n) {
|
|
5961
5961
|
let i = 0, r = 100, o = null;
|
|
5962
5962
|
const s = /* @__PURE__ */ new Set();
|
|
5963
5963
|
let a = (() => {
|
|
5964
|
-
const x = Number.isFinite(n == null ? void 0 : n.minSpan) ? n.minSpan :
|
|
5964
|
+
const x = Number.isFinite(n == null ? void 0 : n.minSpan) ? n.minSpan : zu;
|
|
5965
5965
|
return Qt(Number.isFinite(x) ? x : 0, 0, 100);
|
|
5966
5966
|
})(), u = (() => {
|
|
5967
|
-
const x = Number.isFinite(n == null ? void 0 : n.maxSpan) ? n.maxSpan :
|
|
5967
|
+
const x = Number.isFinite(n == null ? void 0 : n.maxSpan) ? n.maxSpan : Vu;
|
|
5968
5968
|
return Qt(Number.isFinite(x) ? x : 100, 0, 100);
|
|
5969
5969
|
})(), f = Math.min(a, u), l = Math.max(a, u);
|
|
5970
5970
|
const g = () => {
|
|
5971
5971
|
const x = { start: i, end: r };
|
|
5972
5972
|
if (o !== null && o.start === x.start && o.end === x.end)
|
|
5973
5973
|
return;
|
|
5974
|
-
o =
|
|
5974
|
+
o = Wu(x);
|
|
5975
5975
|
const b = Array.from(s);
|
|
5976
5976
|
for (const M of b) M({ start: i, end: r });
|
|
5977
5977
|
}, c = (x, b, M) => {
|
|
@@ -6010,7 +6010,7 @@ function Vu(e, t, n) {
|
|
|
6010
6010
|
const y = A - 100;
|
|
6011
6011
|
I -= y, A -= y;
|
|
6012
6012
|
}
|
|
6013
|
-
I = Qt(I, 0, 100), A = Qt(A, 0, 100), I =
|
|
6013
|
+
I = Qt(I, 0, 100), A = Qt(A, 0, 100), I = ms(I), A = ms(A), !(I === i && A === r) && (i = I, r = A, (M == null ? void 0 : M.emit) !== !1 && g());
|
|
6014
6014
|
};
|
|
6015
6015
|
return h(e, t, { emit: !1 }), { getRange: () => ({ start: i, end: r }), setRange: (x, b) => {
|
|
6016
6016
|
h(x, b);
|
|
@@ -6036,7 +6036,7 @@ function Vu(e, t, n) {
|
|
|
6036
6036
|
s.delete(x);
|
|
6037
6037
|
}) };
|
|
6038
6038
|
}
|
|
6039
|
-
const Lr = /* @__PURE__ */ new WeakMap(),
|
|
6039
|
+
const Lr = /* @__PURE__ */ new WeakMap(), ps = (e) => {
|
|
6040
6040
|
const t = typeof e == "object" && e !== null ? e : null;
|
|
6041
6041
|
if (t && Lr.has(t))
|
|
6042
6042
|
return Lr.get(t);
|
|
@@ -6050,14 +6050,14 @@ const Lr = /* @__PURE__ */ new WeakMap(), ds = (e) => {
|
|
|
6050
6050
|
}
|
|
6051
6051
|
}
|
|
6052
6052
|
return t && Lr.set(t, n), n;
|
|
6053
|
-
},
|
|
6053
|
+
}, Xu = (e, t) => {
|
|
6054
6054
|
const n = [];
|
|
6055
6055
|
for (let u = 0; u < e.length; u++) {
|
|
6056
6056
|
const f = e[u];
|
|
6057
6057
|
(f == null ? void 0 : f.type) === "bar" && n.push({ globalSeriesIndex: u, s: f });
|
|
6058
6058
|
}
|
|
6059
6059
|
if (n.length === 0) return null;
|
|
6060
|
-
const i =
|
|
6060
|
+
const i = Ks(
|
|
6061
6061
|
n.map((u) => u.s),
|
|
6062
6062
|
t
|
|
6063
6063
|
), r = i.barWidthPx, o = i.gapPx, s = i.clusterWidthPx;
|
|
@@ -6073,7 +6073,7 @@ const Lr = /* @__PURE__ */ new WeakMap(), ds = (e) => {
|
|
|
6073
6073
|
clusterWidth: s,
|
|
6074
6074
|
clusterIndexByGlobalSeriesIndex: a
|
|
6075
6075
|
};
|
|
6076
|
-
},
|
|
6076
|
+
}, hs = (e, t) => {
|
|
6077
6077
|
let n = 0, i = Ie(e);
|
|
6078
6078
|
for (; n < i; ) {
|
|
6079
6079
|
const r = n + i >>> 1;
|
|
@@ -6081,11 +6081,11 @@ const Lr = /* @__PURE__ */ new WeakMap(), ds = (e) => {
|
|
|
6081
6081
|
}
|
|
6082
6082
|
return n;
|
|
6083
6083
|
};
|
|
6084
|
-
function
|
|
6084
|
+
function ys(e, t, n, i) {
|
|
6085
6085
|
if (!Number.isFinite(t)) return [];
|
|
6086
6086
|
const r = Number.POSITIVE_INFINITY, o = r * r, s = n.invert(t);
|
|
6087
6087
|
if (!Number.isFinite(s)) return [];
|
|
6088
|
-
const a = [], u =
|
|
6088
|
+
const a = [], u = Xu(e, n);
|
|
6089
6089
|
for (let f = 0; f < e.length; f++) {
|
|
6090
6090
|
const l = e[f];
|
|
6091
6091
|
if (l.type === "pie" || l.type === "candlestick" || l.visible === !1) continue;
|
|
@@ -6102,7 +6102,7 @@ function ps(e, t, n, i) {
|
|
|
6102
6102
|
const A = I + m, S = A + T;
|
|
6103
6103
|
return t >= A - x && t < S + x;
|
|
6104
6104
|
};
|
|
6105
|
-
if (
|
|
6105
|
+
if (ps(g))
|
|
6106
6106
|
for (let I = 0; I < c; I++) {
|
|
6107
6107
|
const A = Ae(g, I);
|
|
6108
6108
|
if (!Number.isFinite(A)) continue;
|
|
@@ -6112,7 +6112,7 @@ function ps(e, t, n, i) {
|
|
|
6112
6112
|
else {
|
|
6113
6113
|
const I = n.invert(t - m);
|
|
6114
6114
|
if (Number.isFinite(I)) {
|
|
6115
|
-
const A =
|
|
6115
|
+
const A = hs(g, I), S = (p) => {
|
|
6116
6116
|
if (p < 0 || p >= c) return null;
|
|
6117
6117
|
const y = Ae(g, p);
|
|
6118
6118
|
if (!Number.isFinite(y)) return null;
|
|
@@ -6151,7 +6151,7 @@ function ps(e, t, n, i) {
|
|
|
6151
6151
|
const v = Ae(g, R), m = Ue(g, R), x = at(g, R);
|
|
6152
6152
|
d = x !== void 0 ? [v, m, x] : [v, m];
|
|
6153
6153
|
};
|
|
6154
|
-
if (
|
|
6154
|
+
if (ps(g))
|
|
6155
6155
|
for (let R = 0; R < c; R++) {
|
|
6156
6156
|
const T = Ae(g, R);
|
|
6157
6157
|
if (!Number.isFinite(T)) continue;
|
|
@@ -6161,7 +6161,7 @@ function ps(e, t, n, i) {
|
|
|
6161
6161
|
P(R, v * v);
|
|
6162
6162
|
}
|
|
6163
6163
|
else {
|
|
6164
|
-
const R =
|
|
6164
|
+
const R = hs(g, s);
|
|
6165
6165
|
let T = R - 1, C = R;
|
|
6166
6166
|
const v = (m) => {
|
|
6167
6167
|
const x = Ae(g, m);
|
|
@@ -6184,13 +6184,13 @@ function ps(e, t, n, i) {
|
|
|
6184
6184
|
}
|
|
6185
6185
|
return a;
|
|
6186
6186
|
}
|
|
6187
|
-
const
|
|
6187
|
+
const $u = (e) => Math.min(1, Math.max(0, e)), Yu = (e) => {
|
|
6188
6188
|
const t = e.trim().match(/^(\d+(?:\.\d+)?)%$/);
|
|
6189
6189
|
if (!t) return null;
|
|
6190
6190
|
const n = Number(t[1]) / 100;
|
|
6191
6191
|
return Number.isFinite(n) ? n : null;
|
|
6192
|
-
}, io = (e) => Array.isArray(e), Tn = (e) => io(e) ? e[0] : e.timestamp,
|
|
6193
|
-
const t =
|
|
6192
|
+
}, io = (e) => Array.isArray(e), Tn = (e) => io(e) ? e[0] : e.timestamp, Hu = (e) => io(e) ? e[1] : e.open, qu = (e) => io(e) ? e[2] : e.close, gs = /* @__PURE__ */ new WeakMap(), Zu = (e) => {
|
|
6193
|
+
const t = gs.get(e);
|
|
6194
6194
|
if (t !== void 0) return t;
|
|
6195
6195
|
const n = [];
|
|
6196
6196
|
for (let o = 0; o < e.length; o++) {
|
|
@@ -6205,11 +6205,11 @@ const Ou = (e) => Math.min(1, Math.max(0, e)), Xu = (e) => {
|
|
|
6205
6205
|
s > 0 && s < i && (i = s);
|
|
6206
6206
|
}
|
|
6207
6207
|
const r = Number.isFinite(i) && i > 0 ? i : 1;
|
|
6208
|
-
return
|
|
6208
|
+
return gs.set(e, r), r;
|
|
6209
6209
|
};
|
|
6210
6210
|
function Hr(e, t, n, i) {
|
|
6211
6211
|
if (t.length === 0) return 0;
|
|
6212
|
-
const r =
|
|
6212
|
+
const r = Zu(t);
|
|
6213
6213
|
let o = 0;
|
|
6214
6214
|
if (Number.isFinite(r) && r > 0) {
|
|
6215
6215
|
let g = null;
|
|
@@ -6231,13 +6231,13 @@ function Hr(e, t, n, i) {
|
|
|
6231
6231
|
if (typeof a == "number")
|
|
6232
6232
|
s = Number.isFinite(a) ? Math.max(0, a) : 0;
|
|
6233
6233
|
else if (typeof a == "string") {
|
|
6234
|
-
const g =
|
|
6235
|
-
s = g == null ? 0 : o *
|
|
6234
|
+
const g = Yu(a);
|
|
6235
|
+
s = g == null ? 0 : o * $u(g);
|
|
6236
6236
|
}
|
|
6237
6237
|
const u = Number.isFinite(e.barMinWidth) ? Math.max(0, e.barMinWidth) : 0, f = Number.isFinite(e.barMaxWidth) ? Math.max(0, e.barMaxWidth) : Number.POSITIVE_INFINITY, l = Math.max(u, f);
|
|
6238
6238
|
return s = Math.min(Math.max(s, u), l), Number.isFinite(s) ? s : 0;
|
|
6239
6239
|
}
|
|
6240
|
-
const Oi = /* @__PURE__ */ new WeakMap(),
|
|
6240
|
+
const Oi = /* @__PURE__ */ new WeakMap(), ju = (e) => {
|
|
6241
6241
|
const t = Oi.get(e);
|
|
6242
6242
|
if (t !== void 0) return t;
|
|
6243
6243
|
let n = Number.NEGATIVE_INFINITY;
|
|
@@ -6248,7 +6248,7 @@ const Oi = /* @__PURE__ */ new WeakMap(), qu = (e) => {
|
|
|
6248
6248
|
n = r;
|
|
6249
6249
|
}
|
|
6250
6250
|
return Oi.set(e, !0), !0;
|
|
6251
|
-
},
|
|
6251
|
+
}, Ku = (e, t) => {
|
|
6252
6252
|
let n = 0, i = e.length;
|
|
6253
6253
|
for (; n < i; ) {
|
|
6254
6254
|
const r = n + i >>> 1;
|
|
@@ -6271,7 +6271,7 @@ function qr(e, t, n, i, r, o) {
|
|
|
6271
6271
|
w === f && u && (h < u.dataIndex ? u = { seriesIndex: c, dataIndex: h, point: d } : h === u.dataIndex && c < u.seriesIndex && (u = { seriesIndex: c, dataIndex: h, point: d }));
|
|
6272
6272
|
}
|
|
6273
6273
|
}, g = (c) => {
|
|
6274
|
-
const h =
|
|
6274
|
+
const h = Hu(c), d = qu(c);
|
|
6275
6275
|
if (!Number.isFinite(h) || !Number.isFinite(d)) return !1;
|
|
6276
6276
|
const w = r.scale(h), P = r.scale(d);
|
|
6277
6277
|
if (!Number.isFinite(w) || !Number.isFinite(P)) return !1;
|
|
@@ -6281,7 +6281,7 @@ function qr(e, t, n, i, r, o) {
|
|
|
6281
6281
|
for (let c = 0; c < e.length; c++) {
|
|
6282
6282
|
const d = e[c].data, w = d.length;
|
|
6283
6283
|
if (w === 0) continue;
|
|
6284
|
-
if (!
|
|
6284
|
+
if (!ju(d)) {
|
|
6285
6285
|
for (let T = 0; T < w; T++) {
|
|
6286
6286
|
const C = d[T], v = Tn(C);
|
|
6287
6287
|
if (!Number.isFinite(v)) continue;
|
|
@@ -6292,7 +6292,7 @@ function qr(e, t, n, i, r, o) {
|
|
|
6292
6292
|
}
|
|
6293
6293
|
continue;
|
|
6294
6294
|
}
|
|
6295
|
-
const R =
|
|
6295
|
+
const R = Ku(d, s);
|
|
6296
6296
|
for (let T = R - 1; T >= 0; T--) {
|
|
6297
6297
|
const C = d[T], v = Tn(C), m = i.scale(v);
|
|
6298
6298
|
if (!Number.isFinite(m)) continue;
|
|
@@ -6379,7 +6379,7 @@ function hn() {
|
|
|
6379
6379
|
};
|
|
6380
6380
|
return r;
|
|
6381
6381
|
}
|
|
6382
|
-
function
|
|
6382
|
+
function jd() {
|
|
6383
6383
|
let e = [], t = /* @__PURE__ */ new Map(), n = 0, i = 1;
|
|
6384
6384
|
const r = (s) => {
|
|
6385
6385
|
const a = /* @__PURE__ */ new Map();
|
|
@@ -6417,7 +6417,7 @@ function qd() {
|
|
|
6417
6417
|
};
|
|
6418
6418
|
return o;
|
|
6419
6419
|
}
|
|
6420
|
-
const
|
|
6420
|
+
const Ju = (e) => {
|
|
6421
6421
|
switch (e) {
|
|
6422
6422
|
case "start":
|
|
6423
6423
|
return { translateX: "0%", originX: "0%" };
|
|
@@ -6427,7 +6427,7 @@ const ju = (e) => {
|
|
|
6427
6427
|
return { translateX: "-100%", originX: "100%" };
|
|
6428
6428
|
}
|
|
6429
6429
|
};
|
|
6430
|
-
function
|
|
6430
|
+
function xs(e, t) {
|
|
6431
6431
|
const n = getComputedStyle(e), i = n.position, r = n.overflow, o = (t == null ? void 0 : t.clip) ?? !1, s = i === "static", a = !o && (r === "hidden" || r === "scroll" || r === "auto"), u = s ? e.style.position : null, f = a ? e.style.overflow : null;
|
|
6432
6432
|
s && (e.style.position = "relative"), a && (e.style.overflow = "visible");
|
|
6433
6433
|
const l = document.createElement("div");
|
|
@@ -6440,7 +6440,7 @@ function ys(e, t) {
|
|
|
6440
6440
|
return document.createElement("span");
|
|
6441
6441
|
const C = document.createElement("span");
|
|
6442
6442
|
C.textContent = w, C.style.position = "absolute", C.style.left = `${P}px`, C.style.top = `${R}px`, C.style.pointerEvents = "none", C.style.userSelect = "none", C.style.whiteSpace = "nowrap", C.style.lineHeight = "1", (T == null ? void 0 : T.fontSize) != null && (C.style.fontSize = `${T.fontSize}px`), (T == null ? void 0 : T.color) != null && (C.style.color = T.color);
|
|
6443
|
-
const v = (T == null ? void 0 : T.rotation) ?? 0, m = (T == null ? void 0 : T.anchor) ?? "start", { translateX: x, originX: b } =
|
|
6443
|
+
const v = (T == null ? void 0 : T.rotation) ?? 0, m = (T == null ? void 0 : T.anchor) ?? "start", { translateX: x, originX: b } = Ju(m);
|
|
6444
6444
|
return C.style.transformOrigin = `${b} 50%`, C.style.transform = `translateX(${x}) translateY(-50%) rotate(${v}deg)`, l.appendChild(C), C;
|
|
6445
6445
|
}, dispose: () => {
|
|
6446
6446
|
if (!g) {
|
|
@@ -6453,26 +6453,26 @@ function ys(e, t) {
|
|
|
6453
6453
|
}
|
|
6454
6454
|
} };
|
|
6455
6455
|
}
|
|
6456
|
-
const
|
|
6456
|
+
const bs = (e, t) => {
|
|
6457
6457
|
var i;
|
|
6458
6458
|
const n = (i = e.name) == null ? void 0 : i.trim();
|
|
6459
6459
|
return n || `Series ${t + 1}`;
|
|
6460
|
-
},
|
|
6460
|
+
}, Qu = (e, t, n) => {
|
|
6461
6461
|
var o;
|
|
6462
6462
|
const i = (o = e.color) == null ? void 0 : o.trim();
|
|
6463
6463
|
if (i) return i;
|
|
6464
6464
|
const r = n.colorPalette;
|
|
6465
6465
|
return r.length > 0 ? r[t % r.length] ?? "#000000" : "#000000";
|
|
6466
|
-
},
|
|
6466
|
+
}, vs = (e, t) => {
|
|
6467
6467
|
const n = e == null ? void 0 : e.trim();
|
|
6468
6468
|
return n || `Slice ${t + 1}`;
|
|
6469
|
-
},
|
|
6469
|
+
}, ef = (e, t, n, i) => {
|
|
6470
6470
|
const r = e == null ? void 0 : e.trim();
|
|
6471
6471
|
if (r) return r;
|
|
6472
6472
|
const o = i.colorPalette, s = o.length;
|
|
6473
6473
|
return s > 0 ? o[(t + n) % s] ?? "#000000" : "#000000";
|
|
6474
6474
|
};
|
|
6475
|
-
function
|
|
6475
|
+
function tf(e, t = "right", n) {
|
|
6476
6476
|
const r = getComputedStyle(e).position === "static", o = r ? e.style.position : null;
|
|
6477
6477
|
r && (e.style.position = "relative");
|
|
6478
6478
|
const s = document.createElement("div");
|
|
@@ -6543,19 +6543,19 @@ function Qu(e, t = "right", n) {
|
|
|
6543
6543
|
if (P.type === "pie")
|
|
6544
6544
|
for (let R = 0; R < P.data.length; R++) {
|
|
6545
6545
|
const T = P.data[R], C = (T == null ? void 0 : T.visible) !== !1, v = document.createElement("div");
|
|
6546
|
-
v.style.display = "flex", v.style.alignItems = "center", v.style.gap = "6px", v.style.lineHeight = "1.1", v.style.whiteSpace = "nowrap", v.style.cursor = n ? "pointer" : "default", v.style.opacity = C ? "1" : "0.5", v.style.transition = "opacity 0.2s", n && (v.setAttribute("role", "button"), v.setAttribute("aria-pressed", String(C)), v.setAttribute("aria-label", `Toggle ${
|
|
6546
|
+
v.style.display = "flex", v.style.alignItems = "center", v.style.gap = "6px", v.style.lineHeight = "1.1", v.style.whiteSpace = "nowrap", v.style.cursor = n ? "pointer" : "default", v.style.opacity = C ? "1" : "0.5", v.style.transition = "opacity 0.2s", n && (v.setAttribute("role", "button"), v.setAttribute("aria-pressed", String(C)), v.setAttribute("aria-label", `Toggle ${vs(T == null ? void 0 : T.name, R)} visibility`), v.tabIndex = 0, v.dataset.seriesIndex = String(w), v.dataset.sliceIndex = String(R));
|
|
6547
6547
|
const m = document.createElement("div");
|
|
6548
|
-
m.style.width = "10px", m.style.height = "10px", m.style.borderRadius = "2px", m.style.flex = "0 0 auto", m.style.background =
|
|
6548
|
+
m.style.width = "10px", m.style.height = "10px", m.style.borderRadius = "2px", m.style.flex = "0 0 auto", m.style.background = ef(T == null ? void 0 : T.color, w, R, h), m.style.border = `1px solid ${h.axisLineColor}`;
|
|
6549
6549
|
const x = document.createElement("span");
|
|
6550
|
-
x.textContent =
|
|
6550
|
+
x.textContent = vs(T == null ? void 0 : T.name, R), x.style.textDecoration = C ? "none" : "line-through", v.appendChild(m), v.appendChild(x), d.push(v);
|
|
6551
6551
|
}
|
|
6552
6552
|
else {
|
|
6553
6553
|
const R = P.visible !== !1, T = document.createElement("div");
|
|
6554
|
-
T.style.display = "flex", T.style.alignItems = "center", T.style.gap = "6px", T.style.lineHeight = "1.1", T.style.whiteSpace = "nowrap", T.style.cursor = n ? "pointer" : "default", T.style.opacity = R ? "1" : "0.5", T.style.transition = "opacity 0.2s", n && (T.setAttribute("role", "button"), T.setAttribute("aria-pressed", String(R)), T.setAttribute("aria-label", `Toggle ${
|
|
6554
|
+
T.style.display = "flex", T.style.alignItems = "center", T.style.gap = "6px", T.style.lineHeight = "1.1", T.style.whiteSpace = "nowrap", T.style.cursor = n ? "pointer" : "default", T.style.opacity = R ? "1" : "0.5", T.style.transition = "opacity 0.2s", n && (T.setAttribute("role", "button"), T.setAttribute("aria-pressed", String(R)), T.setAttribute("aria-label", `Toggle ${bs(P, w)} visibility`), T.tabIndex = 0, T.dataset.seriesIndex = String(w));
|
|
6555
6555
|
const C = document.createElement("div");
|
|
6556
|
-
C.style.width = "10px", C.style.height = "10px", C.style.borderRadius = "2px", C.style.flex = "0 0 auto", C.style.background =
|
|
6556
|
+
C.style.width = "10px", C.style.height = "10px", C.style.borderRadius = "2px", C.style.flex = "0 0 auto", C.style.background = Qu(P, w, h), C.style.border = `1px solid ${h.axisLineColor}`;
|
|
6557
6557
|
const v = document.createElement("span");
|
|
6558
|
-
v.textContent =
|
|
6558
|
+
v.textContent = bs(P, w), v.style.textDecoration = R ? "none" : "line-through", T.appendChild(C), T.appendChild(v), d.push(T);
|
|
6559
6559
|
}
|
|
6560
6560
|
}
|
|
6561
6561
|
a.replaceChildren(...d);
|
|
@@ -6570,8 +6570,8 @@ function Qu(e, t = "right", n) {
|
|
|
6570
6570
|
}
|
|
6571
6571
|
} };
|
|
6572
6572
|
}
|
|
6573
|
-
const
|
|
6574
|
-
function
|
|
6573
|
+
const ws = (e, t, n) => n < t || e < t ? t : e > n ? n : e;
|
|
6574
|
+
function Cs(e) {
|
|
6575
6575
|
const n = getComputedStyle(e).position === "static", i = n ? e.style.position : null;
|
|
6576
6576
|
n && (e.style.position = "relative");
|
|
6577
6577
|
const r = document.createElement("div");
|
|
@@ -6596,7 +6596,7 @@ function vs(e) {
|
|
|
6596
6596
|
r.style.display = "block", r.style.visibility = "hidden";
|
|
6597
6597
|
const { width: b, height: M } = c(), I = e.clientWidth, A = e.clientHeight;
|
|
6598
6598
|
let S = P + v, p = R + m;
|
|
6599
|
-
if (S + b > I - x && (S = P - v - b), p + M > A - x && (p = R - m - M), S =
|
|
6599
|
+
if (S + b > I - x && (S = P - v - b), p + M > A - x && (p = R - m - M), S = ws(S, x, I - x - b), p = ws(p, x, A - x - M), r.style.left = `${S}px`, r.style.top = `${p}px`, r.style.visibility = "visible", C) {
|
|
6600
6600
|
r.style.opacity = "0";
|
|
6601
6601
|
const y = a;
|
|
6602
6602
|
f = window.requestAnimationFrame(() => {
|
|
@@ -6635,38 +6635,38 @@ function Nn(e) {
|
|
|
6635
6635
|
const i = (Object.is(e, -0) ? 0 : e).toFixed(2).replace(/\.?0+$/, "");
|
|
6636
6636
|
return i === "-0" ? "0" : i;
|
|
6637
6637
|
}
|
|
6638
|
-
function
|
|
6638
|
+
function na(e) {
|
|
6639
6639
|
const t = e.seriesName.trim();
|
|
6640
6640
|
return t.length > 0 ? t : `Series ${e.seriesIndex + 1}`;
|
|
6641
6641
|
}
|
|
6642
|
-
function
|
|
6642
|
+
function ia(e) {
|
|
6643
6643
|
const t = e.trim();
|
|
6644
6644
|
return t.length === 0 ? "#888" : /^#[0-9a-fA-F]{3}$/.test(t) || /^#[0-9a-fA-F]{6}$/.test(t) || /^#[0-9a-fA-F]{8}$/.test(t) || /^rgba?\(\s*\d{1,3}\s*(?:,\s*|\s+)\d{1,3}\s*(?:,\s*|\s+)\d{1,3}(?:\s*(?:,\s*|\/\s*)(?:0|1|0?\.\d+))?\s*\)$/.test(
|
|
6645
6645
|
t
|
|
6646
6646
|
) || /^[a-zA-Z]+$/.test(t) ? t : "#888";
|
|
6647
6647
|
}
|
|
6648
|
-
function
|
|
6648
|
+
function ra(e) {
|
|
6649
6649
|
return e.length === 5;
|
|
6650
6650
|
}
|
|
6651
|
-
function
|
|
6651
|
+
function nf(e, t) {
|
|
6652
6652
|
if (!Number.isFinite(e) || !Number.isFinite(t) || e === 0) return Ji;
|
|
6653
6653
|
const n = (t - e) / e * 100;
|
|
6654
6654
|
return Number.isFinite(n) ? `${n > 0 ? "+" : ""}${n.toFixed(2)}%` : Ji;
|
|
6655
6655
|
}
|
|
6656
|
-
function
|
|
6657
|
-
const n = sn(
|
|
6656
|
+
function oa(e, t) {
|
|
6657
|
+
const n = sn(na(e)), i = sn(t);
|
|
6658
6658
|
return [
|
|
6659
6659
|
'<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;">',
|
|
6660
6660
|
'<span style="display:flex;align-items:center;gap:8px;min-width:0;">',
|
|
6661
|
-
`<span style="width:8px;height:8px;border-radius:999px;flex:0 0 auto;background-color:${sn(
|
|
6661
|
+
`<span style="width:8px;height:8px;border-radius:999px;flex:0 0 auto;background-color:${sn(ia(e.color))};"></span>`,
|
|
6662
6662
|
`<span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${n}</span>`,
|
|
6663
6663
|
"</span>",
|
|
6664
6664
|
`<span style="font-variant-numeric:tabular-nums;white-space:nowrap;">${i}</span>`,
|
|
6665
6665
|
"</div>"
|
|
6666
6666
|
].join("");
|
|
6667
6667
|
}
|
|
6668
|
-
function
|
|
6669
|
-
const [, t, n, i, r] = e.value, o = sn(
|
|
6668
|
+
function sa(e) {
|
|
6669
|
+
const [, t, n, i, r] = e.value, o = sn(na(e)), s = sn(ia(e.color)), a = Nn(t), u = Nn(r), f = Nn(i), l = Nn(n), g = n > t, c = g ? "▲" : "▼", h = g ? "#22c55e" : "#ef4444", d = nf(t, n), w = `O: ${a} H: ${u} L: ${f} C: ${l}`, P = sn(w), R = sn(c), T = sn(d), C = sn(h);
|
|
6670
6670
|
return [
|
|
6671
6671
|
'<div style="display:flex;flex-direction:column;gap:4px;">',
|
|
6672
6672
|
// Series name row
|
|
@@ -6684,21 +6684,21 @@ function ra(e) {
|
|
|
6684
6684
|
"</div>"
|
|
6685
6685
|
].join("");
|
|
6686
6686
|
}
|
|
6687
|
-
function
|
|
6688
|
-
return
|
|
6687
|
+
function rf(e) {
|
|
6688
|
+
return sa(e);
|
|
6689
6689
|
}
|
|
6690
6690
|
function ai(e) {
|
|
6691
|
-
return
|
|
6691
|
+
return ra(e.value) ? rf(e) : oa(e, Nn(e.value[1]));
|
|
6692
6692
|
}
|
|
6693
6693
|
function _r(e) {
|
|
6694
6694
|
if (e.length === 0) return "";
|
|
6695
6695
|
const t = `x: ${Nn(e[0].value[0])}`, n = `<div style="margin:0 0 6px 0;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;">${sn(
|
|
6696
6696
|
t
|
|
6697
|
-
)}</div>`, i = e.map((r) =>
|
|
6697
|
+
)}</div>`, i = e.map((r) => ra(r.value) ? sa(r) : oa(r, Nn(r.value[1]))).join('<div style="height:4px;"></div>');
|
|
6698
6698
|
return `${n}${i}`;
|
|
6699
6699
|
}
|
|
6700
|
-
const
|
|
6701
|
-
function
|
|
6700
|
+
const of = (e) => Number.isFinite(e) ? e : 0, sf = (e) => Number.isFinite(e) ? e : null;
|
|
6701
|
+
function Ms() {
|
|
6702
6702
|
const e = /* @__PURE__ */ new Map();
|
|
6703
6703
|
function t(o, s, a, u, f, l) {
|
|
6704
6704
|
const g = Symbol("Animation");
|
|
@@ -6741,7 +6741,7 @@ function ws() {
|
|
|
6741
6741
|
}
|
|
6742
6742
|
function r(o) {
|
|
6743
6743
|
var u;
|
|
6744
|
-
const s =
|
|
6744
|
+
const s = sf(o);
|
|
6745
6745
|
if (s === null) return;
|
|
6746
6746
|
const a = Array.from(e.keys());
|
|
6747
6747
|
for (const f of a) {
|
|
@@ -6749,7 +6749,7 @@ function ws() {
|
|
|
6749
6749
|
if (!l) continue;
|
|
6750
6750
|
const g = l.startTime ?? s;
|
|
6751
6751
|
l.startTime === null && e.set(f, { ...l, startTime: g });
|
|
6752
|
-
const c =
|
|
6752
|
+
const c = of(l.duration), h = Math.max(0, s - g), d = c <= 0 || h >= c, w = c <= 0 ? 1 : h / c, P = d ? 1 : l.easing(w);
|
|
6753
6753
|
if (l.kind === "scalar") {
|
|
6754
6754
|
const R = l.from + (l.to - l.from) * P;
|
|
6755
6755
|
if (l.onUpdate(R), !e.has(f)) continue;
|
|
@@ -6772,20 +6772,20 @@ function ws() {
|
|
|
6772
6772
|
};
|
|
6773
6773
|
}
|
|
6774
6774
|
const lr = (e) => Number.isNaN(e) || e <= 0 ? 0 : e >= 1 ? 1 : e;
|
|
6775
|
-
function
|
|
6775
|
+
function Ss(e) {
|
|
6776
6776
|
return lr(e);
|
|
6777
6777
|
}
|
|
6778
|
-
function
|
|
6778
|
+
function af(e) {
|
|
6779
6779
|
const n = 1 - lr(e);
|
|
6780
6780
|
return 1 - n * n * n;
|
|
6781
6781
|
}
|
|
6782
|
-
function
|
|
6782
|
+
function cf(e) {
|
|
6783
6783
|
const t = lr(e);
|
|
6784
6784
|
if (t < 0.5) return 4 * t * t * t;
|
|
6785
6785
|
const n = -2 * t + 2;
|
|
6786
6786
|
return 1 - n * n * n / 2;
|
|
6787
6787
|
}
|
|
6788
|
-
function
|
|
6788
|
+
function lf(e) {
|
|
6789
6789
|
const t = lr(e), n = 7.5625, i = 2.75;
|
|
6790
6790
|
if (t < 1 / i)
|
|
6791
6791
|
return n * t * t;
|
|
@@ -6800,32 +6800,32 @@ function af(e) {
|
|
|
6800
6800
|
const r = t - 2.625 / i;
|
|
6801
6801
|
return n * r * r + 0.984375;
|
|
6802
6802
|
}
|
|
6803
|
-
function
|
|
6803
|
+
function uf(e) {
|
|
6804
6804
|
switch (e) {
|
|
6805
6805
|
case "linear":
|
|
6806
|
-
return
|
|
6806
|
+
return Ss;
|
|
6807
6807
|
case "cubicOut":
|
|
6808
|
-
return
|
|
6808
|
+
return af;
|
|
6809
6809
|
case "cubicInOut":
|
|
6810
|
-
return
|
|
6810
|
+
return cf;
|
|
6811
6811
|
case "bounceOut":
|
|
6812
|
-
return
|
|
6812
|
+
return lf;
|
|
6813
6813
|
default:
|
|
6814
|
-
return
|
|
6814
|
+
return Ss;
|
|
6815
6815
|
}
|
|
6816
6816
|
}
|
|
6817
|
-
const On =
|
|
6818
|
-
function
|
|
6817
|
+
const On = ya;
|
|
6818
|
+
function ff(e) {
|
|
6819
6819
|
return e ? e.clientWidth : 0;
|
|
6820
6820
|
}
|
|
6821
|
-
function
|
|
6821
|
+
function df(e) {
|
|
6822
6822
|
if (!e) return { width: 0, height: 0 };
|
|
6823
6823
|
const t = Number.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;
|
|
6824
6824
|
return { width: e.width / t, height: e.height / t };
|
|
6825
6825
|
}
|
|
6826
|
-
const
|
|
6826
|
+
const mf = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, pf = 30 * sr, hf = 365 * sr, yf = 9, Ur = 1, gf = 6, ar = (e) => typeof e == "number" && Number.isFinite(e) ? e : null, yn = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, xf = 2e4, bf = (e) => {
|
|
6827
6827
|
throw new Error(`RenderCoordinator: unreachable value: ${String(e)}`);
|
|
6828
|
-
},
|
|
6828
|
+
}, aa = (e) => Array.isArray(e), vf = (e) => aa(e) ? { x: e[0], y: e[1] } : { x: e.x, y: e.y }, Fs = (e) => {
|
|
6829
6829
|
const t = Ie(e);
|
|
6830
6830
|
if (t === 0) return { x: [], y: [] };
|
|
6831
6831
|
const n = new Array(t), i = new Array(t);
|
|
@@ -6836,13 +6836,13 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6836
6836
|
a !== void 0 ? (r = !0, o || (o = new Array(s)), o[s] = a) : o && (o[s] = void 0);
|
|
6837
6837
|
}
|
|
6838
6838
|
return r && o ? { x: n, y: i, size: o } : { x: n, y: i };
|
|
6839
|
-
},
|
|
6839
|
+
}, wf = (e, t) => {
|
|
6840
6840
|
const n = Vt(t);
|
|
6841
6841
|
if (!n) return e;
|
|
6842
6842
|
if (!e) return n;
|
|
6843
6843
|
let i = Math.min(e.xMin, n.xMin), r = Math.max(e.xMax, n.xMax), o = Math.min(e.yMin, n.yMin), s = Math.max(e.yMax, n.yMax);
|
|
6844
6844
|
return i === r && (r = i + 1), o === s && (s = o + 1), { xMin: i, xMax: r, yMin: o, yMax: s };
|
|
6845
|
-
},
|
|
6845
|
+
}, Cf = (e, t) => {
|
|
6846
6846
|
if (t.length === 0) return e;
|
|
6847
6847
|
let n = (e == null ? void 0 : e.xMin) ?? Number.POSITIVE_INFINITY, i = (e == null ? void 0 : e.xMax) ?? Number.NEGATIVE_INFINITY, r = (e == null ? void 0 : e.yMin) ?? Number.POSITIVE_INFINITY, o = (e == null ? void 0 : e.yMax) ?? Number.NEGATIVE_INFINITY;
|
|
6848
6848
|
for (let s = 0; s < t.length; s++) {
|
|
@@ -6850,7 +6850,7 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6850
6850
|
!Number.isFinite(u) || !Number.isFinite(f) || !Number.isFinite(l) || (u < n && (n = u), u > i && (i = u), f < r && (r = f), l > o && (o = l));
|
|
6851
6851
|
}
|
|
6852
6852
|
return !Number.isFinite(n) || !Number.isFinite(i) || !Number.isFinite(r) || !Number.isFinite(o) ? e : (n === i && (i = n + 1), r === o && (o = r + 1), { xMin: n, xMax: i, yMin: r, yMax: o });
|
|
6853
|
-
},
|
|
6853
|
+
}, ca = (e, t) => {
|
|
6854
6854
|
let n = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY, r = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY;
|
|
6855
6855
|
for (let s = 0; s < e.length; s++) {
|
|
6856
6856
|
const a = e[s];
|
|
@@ -6905,7 +6905,7 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6905
6905
|
n = i, i = r;
|
|
6906
6906
|
}
|
|
6907
6907
|
return { min: n, max: i };
|
|
6908
|
-
},
|
|
6908
|
+
}, Ns = (e, t) => {
|
|
6909
6909
|
const n = e.canvas;
|
|
6910
6910
|
if (!n) throw new Error("RenderCoordinator: gpuContext.canvas is required.");
|
|
6911
6911
|
const i = e.devicePixelRatio ?? 1, r = Number.isFinite(i) && i > 0 ? i : 1, o = n.width, s = n.height;
|
|
@@ -6926,15 +6926,15 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6926
6926
|
devicePixelRatio: r
|
|
6927
6927
|
// Explicit DPR (validated above)
|
|
6928
6928
|
};
|
|
6929
|
-
},
|
|
6929
|
+
}, Mf = (e) => {
|
|
6930
6930
|
const t = Math.max(0, Math.min(255, Math.round(e[0] * 255))), n = Math.max(0, Math.min(255, Math.round(e[1] * 255))), i = Math.max(0, Math.min(255, Math.round(e[2] * 255))), r = Math.max(0, Math.min(1, e[3]));
|
|
6931
6931
|
return `rgba(${t},${n},${i},${r})`;
|
|
6932
|
-
},
|
|
6932
|
+
}, Ts = (e, t) => {
|
|
6933
6933
|
const n = ht(e);
|
|
6934
6934
|
if (!n) return e;
|
|
6935
6935
|
const i = Math.max(0, Math.min(1, n[3] * t));
|
|
6936
|
-
return
|
|
6937
|
-
},
|
|
6936
|
+
return Mf([n[0], n[1], n[2], i]);
|
|
6937
|
+
}, Sf = (e) => {
|
|
6938
6938
|
const { left: t, right: n, top: i, bottom: r, canvasWidth: o, canvasHeight: s, devicePixelRatio: a } = e, u = t * a, f = o - n * a, l = i * a, g = s - r * a, c = u / o * 2 - 1, h = f / o * 2 - 1, d = 1 - l / s * 2, w = 1 - g / s * 2;
|
|
6939
6939
|
return {
|
|
6940
6940
|
left: c,
|
|
@@ -6942,10 +6942,10 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6942
6942
|
top: d,
|
|
6943
6943
|
bottom: w
|
|
6944
6944
|
};
|
|
6945
|
-
}, on = (e) => Math.min(1, Math.max(0, e)), Xn = (e, t, n) => Math.min(n, Math.max(t, e | 0)), fi = (e, t, n) => e + (t - e) * on(n), $i = (e, t, n) => yi(fi(e.min, t.min, n), fi(e.max, t.max, n)),
|
|
6945
|
+
}, on = (e) => Math.min(1, Math.max(0, e)), Xn = (e, t, n) => Math.min(n, Math.max(t, e | 0)), fi = (e, t, n) => e + (t - e) * on(n), $i = (e, t, n) => yi(fi(e.min, t.min, n), fi(e.max, t.max, n)), Ff = (e) => {
|
|
6946
6946
|
const { canvasWidth: t, canvasHeight: n, devicePixelRatio: i } = e, r = e.left * i, o = t - e.right * i, s = e.top * i, a = n - e.bottom * i, u = Xn(Math.floor(r), 0, Math.max(0, t)), f = Xn(Math.floor(s), 0, Math.max(0, n)), l = Xn(Math.ceil(o), 0, Math.max(0, t)), g = Xn(Math.ceil(a), 0, Math.max(0, n)), c = Math.max(0, l - u), h = Math.max(0, g - f);
|
|
6947
6947
|
return { x: u, y: f, w: c, h };
|
|
6948
|
-
}, Kr = (e, t) => (e + 1) / 2 * t,
|
|
6948
|
+
}, Kr = (e, t) => (e + 1) / 2 * t, As = (e, t) => (1 - e) / 2 * t, an = nr, di = (e, t) => {
|
|
6949
6949
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
6950
6950
|
if (typeof e != "string") return null;
|
|
6951
6951
|
const n = e.trim();
|
|
@@ -6956,21 +6956,21 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6956
6956
|
}
|
|
6957
6957
|
const i = Number.parseFloat(n);
|
|
6958
6958
|
return Number.isFinite(i) ? i : null;
|
|
6959
|
-
},
|
|
6959
|
+
}, Nf = (e, t, n) => {
|
|
6960
6960
|
const i = (e == null ? void 0 : e[0]) ?? "50%", r = (e == null ? void 0 : e[1]) ?? "50%", o = di(i, t), s = di(r, n);
|
|
6961
6961
|
return {
|
|
6962
6962
|
x: Number.isFinite(o) ? o : t * 0.5,
|
|
6963
6963
|
y: Number.isFinite(s) ? s : n * 0.5
|
|
6964
6964
|
};
|
|
6965
|
-
},
|
|
6965
|
+
}, Tf = (e) => Array.isArray(e), Af = (e, t) => {
|
|
6966
6966
|
if (e == null) return { inner: 0, outer: t * 0.7 };
|
|
6967
|
-
if (
|
|
6967
|
+
if (Tf(e)) {
|
|
6968
6968
|
const r = di(e[0], t), o = di(e[1], t), s = Math.max(0, Number.isFinite(r) ? r : 0), a = Math.max(s, Number.isFinite(o) ? o : t * 0.7);
|
|
6969
6969
|
return { inner: s, outer: Math.min(t, a) };
|
|
6970
6970
|
}
|
|
6971
6971
|
const n = di(e, t), i = Math.max(0, Number.isFinite(n) ? n : t * 0.7);
|
|
6972
6972
|
return { inner: 0, outer: Math.min(t, i) };
|
|
6973
|
-
}, Zt = (e) => String(Math.trunc(e)).padStart(2, "0"),
|
|
6973
|
+
}, Zt = (e) => String(Math.trunc(e)).padStart(2, "0"), If = [
|
|
6974
6974
|
"Jan",
|
|
6975
6975
|
"Feb",
|
|
6976
6976
|
"Mar",
|
|
@@ -6983,13 +6983,13 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6983
6983
|
"Oct",
|
|
6984
6984
|
"Nov",
|
|
6985
6985
|
"Dec"
|
|
6986
|
-
],
|
|
6986
|
+
], Pf = (e, t) => {
|
|
6987
6987
|
if (!Number.isFinite(e)) return null;
|
|
6988
6988
|
(!Number.isFinite(t) || t < 0) && (t = 0);
|
|
6989
6989
|
const n = new Date(e);
|
|
6990
6990
|
if (!Number.isFinite(n.getTime())) return null;
|
|
6991
6991
|
const i = n.getFullYear(), r = n.getMonth() + 1, o = n.getDate(), s = n.getHours(), a = n.getMinutes();
|
|
6992
|
-
return t < sr ? `${Zt(s)}:${Zt(a)}` : t <= 7 * sr ? `${Zt(r)}/${Zt(o)} ${Zt(s)}:${Zt(a)}` : t < 3 *
|
|
6992
|
+
return t < sr ? `${Zt(s)}:${Zt(a)}` : t <= 7 * sr ? `${Zt(r)}/${Zt(o)} ${Zt(s)}:${Zt(a)}` : t < 3 * pf ? `${Zt(r)}/${Zt(o)}` : t <= hf ? `${If[n.getMonth()] ?? Zt(r)} ${Zt(o)}` : `${i}/${Zt(r)}`;
|
|
6993
6993
|
}, Qi = (e, t, n) => {
|
|
6994
6994
|
const i = Math.max(1, Math.floor(n)), r = new Array(i);
|
|
6995
6995
|
for (let o = 0; o < i; o++) {
|
|
@@ -6997,7 +6997,7 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
6997
6997
|
r[o] = e + s * (t - e);
|
|
6998
6998
|
}
|
|
6999
6999
|
return r;
|
|
7000
|
-
},
|
|
7000
|
+
}, Rf = (e) => {
|
|
7001
7001
|
const {
|
|
7002
7002
|
axisMin: t,
|
|
7003
7003
|
axisMax: n,
|
|
@@ -7015,11 +7015,11 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7015
7015
|
return { tickCount: jr, tickValues: Qi(c, h, jr) };
|
|
7016
7016
|
u.font = `${l}px ${g}`, f && f.size > 2e3 && f.clear();
|
|
7017
7017
|
const d = f ? `${l}px ${g}@@` : null;
|
|
7018
|
-
for (let w =
|
|
7018
|
+
for (let w = yf; w >= Ur; w--) {
|
|
7019
7019
|
const P = Qi(c, h, w);
|
|
7020
7020
|
let R = Number.NEGATIVE_INFINITY, T = !0;
|
|
7021
7021
|
for (let C = 0; C < P.length; C++) {
|
|
7022
|
-
const v = P[C], m =
|
|
7022
|
+
const v = P[C], m = Pf(v, a);
|
|
7023
7023
|
if (m == null) continue;
|
|
7024
7024
|
const x = (() => {
|
|
7025
7025
|
if (!d) return u.measureText(m).width;
|
|
@@ -7028,7 +7028,7 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7028
7028
|
const F = u.measureText(m).width;
|
|
7029
7029
|
return f.set(p, F), F;
|
|
7030
7030
|
})(), b = i.scale(v), M = Kr(b, s), I = w === 1 ? "middle" : C === 0 ? "start" : C === P.length - 1 ? "end" : "middle", A = I === "start" ? M : I === "end" ? M - x : M - x * 0.5, S = I === "start" ? M + x : I === "end" ? M : M + x * 0.5;
|
|
7031
|
-
if (A < R +
|
|
7031
|
+
if (A < R + gf) {
|
|
7032
7032
|
T = !1;
|
|
7033
7033
|
break;
|
|
7034
7034
|
}
|
|
@@ -7039,9 +7039,9 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7039
7039
|
}
|
|
7040
7040
|
return { tickCount: Ur, tickValues: Qi(c, h, Ur) };
|
|
7041
7041
|
}, Sn = (e, t) => {
|
|
7042
|
-
const n =
|
|
7042
|
+
const n = ca(e.series, t), i = yn(e.xAxis.min) ?? n.xMin, r = yn(e.xAxis.max) ?? n.xMax;
|
|
7043
7043
|
return yi(i, r);
|
|
7044
|
-
},
|
|
7044
|
+
}, Df = (e) => {
|
|
7045
7045
|
let t = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY;
|
|
7046
7046
|
for (let i = 0; i < e.length; i++) {
|
|
7047
7047
|
const r = e[i];
|
|
@@ -7069,7 +7069,7 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7069
7069
|
return yi(i, r);
|
|
7070
7070
|
const o = e.yAxis.autoBounds ?? "visible";
|
|
7071
7071
|
let s;
|
|
7072
|
-
o === "visible" && n ? s = n : s =
|
|
7072
|
+
o === "visible" && n ? s = n : s = ca(e.series, t);
|
|
7073
7073
|
const a = i ?? s.yMin, u = r ?? s.yMax;
|
|
7074
7074
|
return yi(a, u);
|
|
7075
7075
|
}, Fn = (e, t) => {
|
|
@@ -7078,7 +7078,7 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7078
7078
|
if (!Number.isFinite(n) || n === 0) return { ...e, spanFraction: 1 };
|
|
7079
7079
|
const i = t.start, r = t.end, o = e.min + i / 100 * n, s = e.min + r / 100 * n, a = yi(o, s), u = (r - i) / 100, f = Number.isFinite(u) ? Math.max(0, Math.min(1, u)) : 1;
|
|
7080
7080
|
return { min: a.min, max: a.max, spanFraction: f };
|
|
7081
|
-
},
|
|
7081
|
+
}, la = (e) => {
|
|
7082
7082
|
if (e === !1 || e == null) return null;
|
|
7083
7083
|
const t = e === !0 ? {} : e;
|
|
7084
7084
|
if (!t) return null;
|
|
@@ -7086,9 +7086,9 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7086
7086
|
return {
|
|
7087
7087
|
durationMs: r,
|
|
7088
7088
|
delayMs: o,
|
|
7089
|
-
easing:
|
|
7089
|
+
easing: uf(t.easing)
|
|
7090
7090
|
};
|
|
7091
|
-
},
|
|
7091
|
+
}, Ef = (e) => la(e), Bf = (e) => la(e), Gr = (e, t, n, i, r) => {
|
|
7092
7092
|
const o = e.point, s = an(o) ? o[0] : o.timestamp, a = an(o) ? o[1] : o.open, u = an(o) ? o[2] : o.close;
|
|
7093
7093
|
if (!Number.isFinite(s) || !Number.isFinite(a) || !Number.isFinite(u))
|
|
7094
7094
|
return null;
|
|
@@ -7097,7 +7097,7 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7097
7097
|
return null;
|
|
7098
7098
|
const c = i.left + l, h = i.top + g, d = On(r) ? r.offsetLeft + c : c, w = On(r) ? r.offsetTop + h : h;
|
|
7099
7099
|
return !Number.isFinite(d) || !Number.isFinite(w) ? null : { x: d, y: w };
|
|
7100
|
-
},
|
|
7100
|
+
}, Is = (e) => {
|
|
7101
7101
|
let t = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY;
|
|
7102
7102
|
for (let i = 0; i < e.length; i++) {
|
|
7103
7103
|
const r = e[i].data, o = Ie(r);
|
|
@@ -7107,13 +7107,13 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7107
7107
|
}
|
|
7108
7108
|
}
|
|
7109
7109
|
return !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 && 0 <= n ? 0 : Math.abs(t) < Math.abs(n) ? t : n;
|
|
7110
|
-
},
|
|
7110
|
+
}, Lf = (e, t, n) => {
|
|
7111
7111
|
const i = t.invert(n.bottom), r = t.invert(n.top), o = Math.min(i, r), s = Math.max(i, r);
|
|
7112
|
-
return !Number.isFinite(o) || !Number.isFinite(s) ?
|
|
7113
|
-
},
|
|
7112
|
+
return !Number.isFinite(o) || !Number.isFinite(s) ? Is(e) : o <= 0 && 0 <= s ? 0 : o > 0 ? o : s < 0 ? s : Is(e);
|
|
7113
|
+
}, _f = (e, t, n, i) => {
|
|
7114
7114
|
const r = on(i);
|
|
7115
7115
|
if (r >= 1) return e;
|
|
7116
|
-
const o =
|
|
7116
|
+
const o = Lf(n, e, t), s = e.scale(o), a = {
|
|
7117
7117
|
domain(u, f) {
|
|
7118
7118
|
return e.domain(u, f), a;
|
|
7119
7119
|
},
|
|
@@ -7130,8 +7130,8 @@ const ff = "bgra8unorm", jr = 5, sr = 24 * 60 * 60 * 1e3, df = 30 * sr, mf = 365
|
|
|
7130
7130
|
};
|
|
7131
7131
|
return a;
|
|
7132
7132
|
};
|
|
7133
|
-
function
|
|
7134
|
-
var so;
|
|
7133
|
+
function Uf(e, t, n) {
|
|
7134
|
+
var so, ao, co;
|
|
7135
7135
|
if (!e.initialized)
|
|
7136
7136
|
throw new Error("RenderCoordinator: gpuContext must be initialized.");
|
|
7137
7137
|
const i = e.device;
|
|
@@ -7141,7 +7141,7 @@ function Lf(e, t, n) {
|
|
|
7141
7141
|
throw new Error("RenderCoordinator: gpuContext.canvas is required.");
|
|
7142
7142
|
if (!e.canvasContext)
|
|
7143
7143
|
throw new Error("RenderCoordinator: gpuContext.canvasContext is required.");
|
|
7144
|
-
const r = e.preferredFormat ??
|
|
7144
|
+
const r = e.preferredFormat ?? mf, o = n == null ? void 0 : n.pipelineCache, s = On(e.canvas) ? e.canvas.parentElement : null, a = s ? xs(s) : null, u = s ? xs(s, { clip: !0 }) : null, f = (U, O) => {
|
|
7145
7145
|
if (h) return;
|
|
7146
7146
|
const k = d.series;
|
|
7147
7147
|
if (U < 0 || U >= k.length) return;
|
|
@@ -7162,7 +7162,7 @@ function Lf(e, t, n) {
|
|
|
7162
7162
|
(re, ae) => ae === U ? { ...re, visible: re.visible === !1 } : re
|
|
7163
7163
|
);
|
|
7164
7164
|
yt({ ...d, series: Q });
|
|
7165
|
-
}) : null, g = (() => {
|
|
7165
|
+
}, l = s && ((so = t.legend) == null ? void 0 : so.show) !== !1 ? tf(s, (ao = t.legend) == null ? void 0 : ao.position, f) : null, g = (() => {
|
|
7166
7166
|
if (typeof document > "u")
|
|
7167
7167
|
return null;
|
|
7168
7168
|
try {
|
|
@@ -7172,9 +7172,9 @@ function Lf(e, t, n) {
|
|
|
7172
7172
|
}
|
|
7173
7173
|
})(), c = g ? /* @__PURE__ */ new Map() : null;
|
|
7174
7174
|
let h = !1, d = t, w = t.series.length, P = "pending", R = 0;
|
|
7175
|
-
const T =
|
|
7175
|
+
const T = Ms();
|
|
7176
7176
|
let C = null, v = !1;
|
|
7177
|
-
const m =
|
|
7177
|
+
const m = Ms();
|
|
7178
7178
|
let x = null, b = 1, M = null;
|
|
7179
7179
|
const I = {
|
|
7180
7180
|
cartesianDataBySeriesIndex: [],
|
|
@@ -7193,7 +7193,7 @@ function Lf(e, t, n) {
|
|
|
7193
7193
|
})(), ae = on($);
|
|
7194
7194
|
for (let xe = 0; xe < k; xe++) {
|
|
7195
7195
|
const ie = Ae(U, xe), Re = Ae(O, xe), Fe = Ue(U, xe), Se = Ue(O, xe), Pe = Number.isFinite(ie) && Number.isFinite(Re) ? fi(ie, Re, ae) : Re, De = Number.isFinite(Fe) && Number.isFinite(Se) ? fi(Fe, Se, ae) : Se, Ee = re[xe];
|
|
7196
|
-
|
|
7196
|
+
aa(Ee) ? (Ee[0] = Pe, Ee[1] = De) : (Ee.x = Pe, Ee.y = De);
|
|
7197
7197
|
}
|
|
7198
7198
|
return re;
|
|
7199
7199
|
}, p = (U, O, k, $) => {
|
|
@@ -7230,7 +7230,7 @@ function Lf(e, t, n) {
|
|
|
7230
7230
|
Q[re] = xe;
|
|
7231
7231
|
continue;
|
|
7232
7232
|
}
|
|
7233
|
-
if (Se >
|
|
7233
|
+
if (Se > xf) {
|
|
7234
7234
|
Q[re] = xe;
|
|
7235
7235
|
continue;
|
|
7236
7236
|
}
|
|
@@ -7257,13 +7257,13 @@ function Lf(e, t, n) {
|
|
|
7257
7257
|
const k = yn(U.yAxis.min), $ = yn(U.yAxis.max);
|
|
7258
7258
|
return !(k !== void 0 && $ !== void 0);
|
|
7259
7259
|
}, j = () => {
|
|
7260
|
-
V(d) ? Y =
|
|
7260
|
+
V(d) ? Y = Df(G) : Y = null;
|
|
7261
7261
|
};
|
|
7262
7262
|
let K = [], J = !1, oe = null, W = null, fe = null, _ = !1, H = !1;
|
|
7263
7263
|
const X = /* @__PURE__ */ new Map();
|
|
7264
7264
|
let pe = new Array(d.series.length).fill("unknown");
|
|
7265
7265
|
const ce = /* @__PURE__ */ new Set();
|
|
7266
|
-
let me = s && ((
|
|
7266
|
+
let me = s && ((co = d.tooltip) == null ? void 0 : co.show) !== !1 ? Cs(s) : null, q = null, se = null, te = null;
|
|
7267
7267
|
const ee = (U, O, k, $) => {
|
|
7268
7268
|
me == null || me.show(U, O, k);
|
|
7269
7269
|
}, be = () => {
|
|
@@ -7274,20 +7274,20 @@ function Lf(e, t, n) {
|
|
|
7274
7274
|
((U, O) => {
|
|
7275
7275
|
l == null || l.update(U, O);
|
|
7276
7276
|
})(d.series, d.theme);
|
|
7277
|
-
let ye =
|
|
7278
|
-
const Be =
|
|
7277
|
+
let ye = wa(i);
|
|
7278
|
+
const Be = Jc(i, { targetFormat: r, sampleCount: Vn, pipelineCache: o }), Le = Uo(i, { targetFormat: r, pipelineCache: o }), st = Uo(i, { targetFormat: r, pipelineCache: o }), rt = vu(i, { targetFormat: r, pipelineCache: o });
|
|
7279
7279
|
rt.setVisible(!1);
|
|
7280
|
-
const ve =
|
|
7280
|
+
const ve = Nu(i, { targetFormat: r, pipelineCache: o });
|
|
7281
7281
|
ve.setVisible(!1);
|
|
7282
|
-
const Te =
|
|
7282
|
+
const Te = cs(i, { targetFormat: r, sampleCount: Vn, pipelineCache: o }), Xe = fs(i, { targetFormat: r, sampleCount: Vn, pipelineCache: o }), He = cs(i, {
|
|
7283
7283
|
targetFormat: r,
|
|
7284
7284
|
sampleCount: ui,
|
|
7285
7285
|
pipelineCache: o
|
|
7286
|
-
}), ke =
|
|
7286
|
+
}), ke = fs(i, {
|
|
7287
7287
|
targetFormat: r,
|
|
7288
7288
|
sampleCount: ui,
|
|
7289
7289
|
pipelineCache: o
|
|
7290
|
-
}), bt =
|
|
7290
|
+
}), bt = ru({ device: i, targetFormat: r, pipelineCache: o }), vt = Ns(e, d), We = On(e.canvas) ? Eu(e.canvas, vt) : null;
|
|
7291
7291
|
let nt = {
|
|
7292
7292
|
source: "mouse",
|
|
7293
7293
|
x: 0,
|
|
@@ -7330,7 +7330,7 @@ function Lf(e, t, n) {
|
|
|
7330
7330
|
}
|
|
7331
7331
|
for (const Pe of Re) {
|
|
7332
7332
|
const De = Pe;
|
|
7333
|
-
Se.push(...De), E[ie] =
|
|
7333
|
+
Se.push(...De), E[ie] = Cf(
|
|
7334
7334
|
E[ie],
|
|
7335
7335
|
De
|
|
7336
7336
|
);
|
|
@@ -7339,7 +7339,7 @@ function Lf(e, t, n) {
|
|
|
7339
7339
|
let Se = B[ie];
|
|
7340
7340
|
if (!Se) {
|
|
7341
7341
|
const De = Fe.rawData ?? Fe.data;
|
|
7342
|
-
Se =
|
|
7342
|
+
Se = Fs(De), B[ie] = Se, E[ie] = Fe.rawBounds ?? Vt(De);
|
|
7343
7343
|
}
|
|
7344
7344
|
const Pe = Fe.type === "line" && Fe.sampling === "none" && O && pe[ie] === "fullRawLine";
|
|
7345
7345
|
for (const De of Re) {
|
|
@@ -7358,7 +7358,7 @@ function Lf(e, t, n) {
|
|
|
7358
7358
|
const Gt = at(Ee, it);
|
|
7359
7359
|
Gt !== void 0 ? (Se.size || (Se.size = new Array(tn + it)), Se.size.push(Gt)) : Se.size && Se.size.push(void 0);
|
|
7360
7360
|
}
|
|
7361
|
-
E[ie] =
|
|
7361
|
+
E[ie] = wf(
|
|
7362
7362
|
E[ie],
|
|
7363
7363
|
Ee
|
|
7364
7364
|
);
|
|
@@ -7427,7 +7427,7 @@ function Lf(e, t, n) {
|
|
|
7427
7427
|
const Q = hn().domain(O.xDomain.min, O.xDomain.max).range(0, $.plotWidthCss), re = hn().domain(O.yDomain.min, O.yDomain.max).range($.plotHeightCss, 0);
|
|
7428
7428
|
return { xScale: Q, yScale: re, plotWidthCss: $.plotWidthCss, plotHeightCss: $.plotHeightCss };
|
|
7429
7429
|
}, xn = (U, O, k) => {
|
|
7430
|
-
const $ = d.series[U], { x: Q, y: re } =
|
|
7430
|
+
const $ = d.series[U], { x: Q, y: re } = vf(k);
|
|
7431
7431
|
return {
|
|
7432
7432
|
seriesName: ($ == null ? void 0 : $.name) ?? "",
|
|
7433
7433
|
seriesIndex: U,
|
|
@@ -7456,7 +7456,7 @@ function Lf(e, t, n) {
|
|
|
7456
7456
|
for (let ae = U.length - 1; ae >= 0; ae--) {
|
|
7457
7457
|
const xe = U[ae];
|
|
7458
7458
|
if (xe.type !== "pie" || xe.visible === !1) continue;
|
|
7459
|
-
const ie = xe, Re =
|
|
7459
|
+
const ie = xe, Re = Nf(ie.center, $, Q), Fe = Af(ie.radius, re), Se = Zr(O, k, { seriesIndex: ae, series: ie }, Re, Fe);
|
|
7460
7460
|
if (Se) return Se;
|
|
7461
7461
|
}
|
|
7462
7462
|
return null;
|
|
@@ -7556,13 +7556,13 @@ function Lf(e, t, n) {
|
|
|
7556
7556
|
(O = $.setSpanConstraints) == null || O.call($, k.minSpan, k.maxSpan), (he == null || he.start !== U.start || he.end !== U.end) && (ne.setRange(U.start, U.end), he = { start: U.start, end: U.end });
|
|
7557
7557
|
} else {
|
|
7558
7558
|
const k = Ct();
|
|
7559
|
-
ne =
|
|
7559
|
+
ne = Ou(U.start, U.end, k), he = { start: U.start, end: U.end }, de = ne.onChange(($) => {
|
|
7560
7560
|
H = !0, Qe(), xi();
|
|
7561
7561
|
const Q = Ne;
|
|
7562
7562
|
et({ start: $.start, end: $.end }, Q), Ne = void 0;
|
|
7563
7563
|
});
|
|
7564
7564
|
}
|
|
7565
|
-
U.hasInside && We ? Ce || (Ce =
|
|
7565
|
+
U.hasInside && We ? Ce || (Ce = Gu(We, ne), Ce.enable()) : (Ce == null || Ce.dispose(), Ce = null);
|
|
7566
7566
|
}, Tt = () => {
|
|
7567
7567
|
const U = d.series.length;
|
|
7568
7568
|
B = new Array(U).fill(null), E = new Array(U).fill(null), X.clear();
|
|
@@ -7574,7 +7574,7 @@ function Lf(e, t, n) {
|
|
|
7574
7574
|
B[O] = ae, E[O] = k.rawBounds ?? null;
|
|
7575
7575
|
continue;
|
|
7576
7576
|
}
|
|
7577
|
-
const $ = k.rawData ?? k.data, Q =
|
|
7577
|
+
const $ = k.rawData ?? k.data, Q = Fs($);
|
|
7578
7578
|
B[O] = Q, E[O] = k.rawBounds ?? Vt($);
|
|
7579
7579
|
}
|
|
7580
7580
|
}, Mt = () => {
|
|
@@ -7664,7 +7664,7 @@ function Lf(e, t, n) {
|
|
|
7664
7664
|
G = Pe, j();
|
|
7665
7665
|
}
|
|
7666
7666
|
Tt(), Mt(), en(), At(), K = new Array(d.series.length).fill(null);
|
|
7667
|
-
const lt =
|
|
7667
|
+
const lt = iu({ device: i, targetFormat: r, pipelineCache: o, sampleCount: Vn });
|
|
7668
7668
|
lt.ensureAreaRendererCount(d.series.length), lt.ensureLineRendererCount(d.series.length), lt.ensureScatterRendererCount(d.series.length), lt.ensureScatterDensityRendererCount(d.series.length), lt.ensurePieRendererCount(d.series.length), lt.ensureCandlestickRendererCount(d.series.length);
|
|
7669
7669
|
const Dt = () => {
|
|
7670
7670
|
if (h) throw new Error("RenderCoordinator is disposed.");
|
|
@@ -7712,7 +7712,7 @@ function Lf(e, t, n) {
|
|
|
7712
7712
|
const $ = dt(d.series, U.series);
|
|
7713
7713
|
if (d = U, $ && (z = U.series, G = U.series, pe = new Array(U.series.length).fill("unknown"), K = new Array(U.series.length).fill(null), cn(), _ = !1, Xt(), Tt()), Y = null, l == null || l.update(U.series, U.theme), Mt(), en(), At(), s) {
|
|
7714
7714
|
const it = ((tn = d.tooltip) == null ? void 0 : tn.show) !== !1;
|
|
7715
|
-
it && !me && (me =
|
|
7715
|
+
it && !me && (me = Cs(s), q = null, se = null, te = null), !it && me && le();
|
|
7716
7716
|
} else
|
|
7717
7717
|
le();
|
|
7718
7718
|
const Q = U.series.length;
|
|
@@ -7728,7 +7728,7 @@ function Lf(e, t, n) {
|
|
|
7728
7728
|
Qe();
|
|
7729
7729
|
return;
|
|
7730
7730
|
}
|
|
7731
|
-
const Pe =
|
|
7731
|
+
const Pe = Bf(d.animation);
|
|
7732
7732
|
if (!Pe) return;
|
|
7733
7733
|
M = {
|
|
7734
7734
|
from: {
|
|
@@ -7800,12 +7800,12 @@ function Lf(e, t, n) {
|
|
|
7800
7800
|
Me.delete(U);
|
|
7801
7801
|
}),
|
|
7802
7802
|
render: () => {
|
|
7803
|
-
var
|
|
7803
|
+
var ho, yo, go;
|
|
7804
7804
|
if (Dt(), !e.canvasContext || !e.canvas) return;
|
|
7805
7805
|
(X.size > 0 || _) && (Xt(), An({ requestRenderAfter: !1 })), H && (H = !1, ur());
|
|
7806
7806
|
const U = d.series.some((Ve) => Ve.type !== "pie"), O = G;
|
|
7807
7807
|
if (P !== "done") {
|
|
7808
|
-
const Ve =
|
|
7808
|
+
const Ve = Ef(d.animation), Ze = (() => {
|
|
7809
7809
|
for (let zt = 0; zt < O.length; zt++) {
|
|
7810
7810
|
const tt = O[zt];
|
|
7811
7811
|
switch (tt.type) {
|
|
@@ -7826,7 +7826,7 @@ function Lf(e, t, n) {
|
|
|
7826
7826
|
break;
|
|
7827
7827
|
}
|
|
7828
7828
|
default:
|
|
7829
|
-
|
|
7829
|
+
bf(tt);
|
|
7830
7830
|
}
|
|
7831
7831
|
}
|
|
7832
7832
|
return !1;
|
|
@@ -7857,9 +7857,9 @@ function Lf(e, t, n) {
|
|
|
7857
7857
|
T.update(performance.now());
|
|
7858
7858
|
}
|
|
7859
7859
|
M !== null && x && m.update(performance.now());
|
|
7860
|
-
const k =
|
|
7860
|
+
const k = Ns(e, d);
|
|
7861
7861
|
We == null || We.updateGridArea(k);
|
|
7862
|
-
const $ = (ne == null ? void 0 : ne.getRange()) ?? null, Q = M ? on(b) : 1, re = M ? $i(M.from.xBaseDomain, M.to.xBaseDomain, Q) : Sn(d, E), ae = M ? $i(M.from.yBaseDomain, M.to.yBaseDomain, Q) : kr(d, E, Y), xe = Fn(re, $), ie =
|
|
7862
|
+
const $ = (ne == null ? void 0 : ne.getRange()) ?? null, Q = M ? on(b) : 1, re = M ? $i(M.from.xBaseDomain, M.to.xBaseDomain, Q) : Sn(d, E), ae = M ? $i(M.from.yBaseDomain, M.to.yBaseDomain, Q) : kr(d, E, Y), xe = Fn(re, $), ie = Sf(k), Re = Ff(k), Fe = hn().domain(xe.min, xe.max).range(ie.left, ie.right), Se = hn().domain(ae.min, ae.max).range(ie.bottom, ie.top), Pe = e.canvas, De = df(Pe), Ee = De.width, It = De.height, tn = Ee > 0 ? Kr(ie.left, Ee) : 0, it = Ee > 0 ? Kr(ie.right, Ee) : 0, Gt = It > 0 ? As(ie.top, It) : 0, nn = It > 0 ? As(ie.bottom, It) : 0, bn = Math.max(0, it - tn), wi = Math.max(0, nn - Gt), fr = U ? d.annotations ?? [] : [], Et = Tc({
|
|
7863
7863
|
annotations: fr,
|
|
7864
7864
|
xScale: Fe,
|
|
7865
7865
|
yScale: Se,
|
|
@@ -7874,10 +7874,10 @@ function Lf(e, t, n) {
|
|
|
7874
7874
|
canvasCssWidth: Ee,
|
|
7875
7875
|
canvasCssHeight: It,
|
|
7876
7876
|
theme: d.theme
|
|
7877
|
-
}), Ci = Et.linesBelow.length + Et.linesAbove.length > 0 ? [...Et.linesBelow, ...Et.linesAbove] : [], Mi = Et.markersBelow.length + Et.markersAbove.length > 0 ? [...Et.markersBelow, ...Et.markersAbove] : [], Pn = Et.linesBelow.length, dr = Et.linesAbove.length, jn = Et.markersBelow.length, Si = Et.markersAbove.length, mr =
|
|
7877
|
+
}), Ci = Et.linesBelow.length + Et.linesAbove.length > 0 ? [...Et.linesBelow, ...Et.linesAbove] : [], Mi = Et.markersBelow.length + Et.markersAbove.length > 0 ? [...Et.markersBelow, ...Et.markersAbove] : [], Pn = Et.linesBelow.length, dr = Et.linesAbove.length, jn = Et.markersBelow.length, Si = Et.markersAbove.length, mr = ff(e.canvas), Kn = Math.abs(xe.max - xe.min);
|
|
7878
7878
|
let Rn = jr, Jn = [];
|
|
7879
7879
|
if (d.xAxis.type === "time") {
|
|
7880
|
-
const Ve =
|
|
7880
|
+
const Ve = Rf({
|
|
7881
7881
|
axisMin: ar(d.xAxis.min),
|
|
7882
7882
|
axisMax: ar(d.xAxis.max),
|
|
7883
7883
|
xScale: Fe,
|
|
@@ -7922,7 +7922,7 @@ function Lf(e, t, n) {
|
|
|
7922
7922
|
hasPointer: zt
|
|
7923
7923
|
};
|
|
7924
7924
|
}
|
|
7925
|
-
if (
|
|
7925
|
+
if (Mc(
|
|
7926
7926
|
{ gridRenderer: Be, xAxisRenderer: Le, yAxisRenderer: st, crosshairRenderer: rt, highlightRenderer: ve },
|
|
7927
7927
|
{
|
|
7928
7928
|
currentOptions: d,
|
|
@@ -7934,14 +7934,14 @@ function Lf(e, t, n) {
|
|
|
7934
7934
|
effectivePointer: pt,
|
|
7935
7935
|
interactionScales: Ke,
|
|
7936
7936
|
seriesForRender: rn,
|
|
7937
|
-
withAlpha:
|
|
7937
|
+
withAlpha: Ts
|
|
7938
7938
|
}
|
|
7939
|
-
), pt.hasPointer && pt.isInGrid && ((
|
|
7939
|
+
), pt.hasPointer && pt.isInGrid && ((ho = d.tooltip) == null ? void 0 : ho.show) !== !1) {
|
|
7940
7940
|
const Ve = e.canvas;
|
|
7941
7941
|
if (Ke && Ve && On(Ve)) {
|
|
7942
|
-
const Ze = (
|
|
7942
|
+
const Ze = (yo = d.tooltip) == null ? void 0 : yo.formatter, zt = ((go = d.tooltip) == null ? void 0 : go.trigger) ?? "item", tt = Ve.offsetLeft + pt.x, $e = Ve.offsetTop + pt.y;
|
|
7943
7943
|
if (pt.source === "sync") {
|
|
7944
|
-
const gt =
|
|
7944
|
+
const gt = ys(rn, pt.gridX, Ke.xScale);
|
|
7945
7945
|
if (gt.length === 0)
|
|
7946
7946
|
le();
|
|
7947
7947
|
else if (zt === "axis") {
|
|
@@ -7974,7 +7974,7 @@ function Lf(e, t, n) {
|
|
|
7974
7974
|
pt.gridX,
|
|
7975
7975
|
pt.gridY,
|
|
7976
7976
|
Ke
|
|
7977
|
-
), Ye =
|
|
7977
|
+
), Ye = ys(rn, pt.gridX, Ke.xScale);
|
|
7978
7978
|
if (Ye.length === 0)
|
|
7979
7979
|
if (qe) {
|
|
7980
7980
|
const ot = [qe.params], ut = Ze ? Ze(ot) : _r(ot);
|
|
@@ -8070,7 +8070,7 @@ function Lf(e, t, n) {
|
|
|
8070
8070
|
le();
|
|
8071
8071
|
} else
|
|
8072
8072
|
le();
|
|
8073
|
-
const Qn = Ke ?? (Pe && On(Pe) ? Zn(Pe, k) : null),
|
|
8073
|
+
const Qn = Ke ?? (Pe && On(Pe) ? Zn(Pe, k) : null), pa = Qn && typeof Qn.plotWidthCss == "number" && typeof Qn.plotHeightCss == "number" ? 0.5 * Math.min(Qn.plotWidthCss, Qn.plotHeightCss) : 0, Fi = lt.getState(), lo = Ic(
|
|
8074
8074
|
Fi,
|
|
8075
8075
|
{
|
|
8076
8076
|
currentOptions: d,
|
|
@@ -8085,11 +8085,11 @@ function Lf(e, t, n) {
|
|
|
8085
8085
|
visibleXDomain: xe,
|
|
8086
8086
|
introPhase: P,
|
|
8087
8087
|
introProgress01: R,
|
|
8088
|
-
withAlpha:
|
|
8089
|
-
maxRadiusCss:
|
|
8088
|
+
withAlpha: Ts,
|
|
8089
|
+
maxRadiusCss: pa
|
|
8090
8090
|
}
|
|
8091
|
-
), { visibleBarSeriesConfigs:
|
|
8092
|
-
Fi.barRenderer.prepare(
|
|
8091
|
+
), { visibleBarSeriesConfigs: uo } = lo, fo = P === "running" ? on(R) : 1, ha = fo < 1 ? _f(Se, ie, uo, fo) : Se;
|
|
8092
|
+
Fi.barRenderer.prepare(uo, ye, Fe, ha, k), U ? (Te.prepare(k, Ci), He.prepare(k, Ci), Xe.prepare({
|
|
8093
8093
|
canvasWidth: k.canvasWidth,
|
|
8094
8094
|
canvasHeight: k.canvasHeight,
|
|
8095
8095
|
devicePixelRatio: k.devicePixelRatio,
|
|
@@ -8110,8 +8110,8 @@ function Lf(e, t, n) {
|
|
|
8110
8110
|
devicePixelRatio: k.devicePixelRatio,
|
|
8111
8111
|
instances: []
|
|
8112
8112
|
})), bt.ensureTextures(k.canvasWidth, k.canvasHeight);
|
|
8113
|
-
const ei = bt.getState(),
|
|
8114
|
-
|
|
8113
|
+
const ei = bt.getState(), mo = e.canvasContext.getCurrentTexture().createView(), ti = i.createCommandEncoder({ label: "renderCoordinator/commandEncoder" }), po = Ga(d.theme.backgroundColor, { r: 0, g: 0, b: 0, a: 1 });
|
|
8114
|
+
Pc(
|
|
8115
8115
|
Fi,
|
|
8116
8116
|
rn,
|
|
8117
8117
|
ti
|
|
@@ -8124,14 +8124,14 @@ function Lf(e, t, n) {
|
|
|
8124
8124
|
// MSAA texture (4x)
|
|
8125
8125
|
resolveTarget: ei.mainResolveView,
|
|
8126
8126
|
// single-sample resolve target
|
|
8127
|
-
clearValue:
|
|
8127
|
+
clearValue: po,
|
|
8128
8128
|
loadOp: "clear",
|
|
8129
8129
|
storeOp: "discard"
|
|
8130
8130
|
// MSAA content discarded after resolve
|
|
8131
8131
|
}
|
|
8132
8132
|
]
|
|
8133
8133
|
});
|
|
8134
|
-
Be && Be.render(pr),
|
|
8134
|
+
Be && Be.render(pr), Rc(
|
|
8135
8135
|
Fi,
|
|
8136
8136
|
{ referenceLineRenderer: Te, annotationMarkerRenderer: Xe },
|
|
8137
8137
|
{
|
|
@@ -8144,21 +8144,21 @@ function Lf(e, t, n) {
|
|
|
8144
8144
|
referenceLineBelowCount: Pn,
|
|
8145
8145
|
markerBelowCount: jn
|
|
8146
8146
|
},
|
|
8147
|
-
|
|
8147
|
+
lo
|
|
8148
8148
|
), pr.end();
|
|
8149
8149
|
const ni = ti.beginRenderPass({
|
|
8150
8150
|
label: "renderCoordinator/annotationOverlayMsaaPass",
|
|
8151
8151
|
colorAttachments: [
|
|
8152
8152
|
{
|
|
8153
8153
|
view: ei.overlayMsaaView,
|
|
8154
|
-
resolveTarget:
|
|
8155
|
-
clearValue:
|
|
8154
|
+
resolveTarget: mo,
|
|
8155
|
+
clearValue: po,
|
|
8156
8156
|
loadOp: "clear",
|
|
8157
8157
|
storeOp: "discard"
|
|
8158
8158
|
}
|
|
8159
8159
|
]
|
|
8160
8160
|
});
|
|
8161
|
-
ni.setPipeline(ei.overlayBlitPipeline), ni.setBindGroup(0, ei.overlayBlitBindGroup), ni.draw(3),
|
|
8161
|
+
ni.setPipeline(ei.overlayBlitPipeline), ni.setBindGroup(0, ei.overlayBlitBindGroup), ni.draw(3), Dc(
|
|
8162
8162
|
{ referenceLineRendererMsaa: He, annotationMarkerRendererMsaa: ke },
|
|
8163
8163
|
{
|
|
8164
8164
|
hasCartesianSeries: U,
|
|
@@ -8175,13 +8175,13 @@ function Lf(e, t, n) {
|
|
|
8175
8175
|
label: "renderCoordinator/topOverlayPass",
|
|
8176
8176
|
colorAttachments: [
|
|
8177
8177
|
{
|
|
8178
|
-
view:
|
|
8178
|
+
view: mo,
|
|
8179
8179
|
loadOp: "load",
|
|
8180
8180
|
storeOp: "store"
|
|
8181
8181
|
}
|
|
8182
8182
|
]
|
|
8183
8183
|
});
|
|
8184
|
-
ve.render(ii), U && (Le.render(ii), st.render(ii)), rt.render(ii), ii.end(), i.queue.submit([ti.finish()]), v = !0,
|
|
8184
|
+
ve.render(ii), U && (Le.render(ii), st.render(ii)), rt.render(ii), ii.end(), i.queue.submit([ti.finish()]), v = !0, Qa(a, s, {
|
|
8185
8185
|
gpuContext: e,
|
|
8186
8186
|
currentOptions: d,
|
|
8187
8187
|
xScale: Fe,
|
|
@@ -8189,7 +8189,7 @@ function Lf(e, t, n) {
|
|
|
8189
8189
|
xTickValues: Jn,
|
|
8190
8190
|
plotClipRect: ie,
|
|
8191
8191
|
visibleXRangeMs: Kn
|
|
8192
|
-
}),
|
|
8192
|
+
}), ic(u, s, {
|
|
8193
8193
|
currentOptions: d,
|
|
8194
8194
|
xScale: Fe,
|
|
8195
8195
|
yScale: Se,
|
|
@@ -8234,10 +8234,10 @@ const Ht = {
|
|
|
8234
8234
|
"#FC8452",
|
|
8235
8235
|
"#9A60B4",
|
|
8236
8236
|
"#EA7CCC"
|
|
8237
|
-
],
|
|
8237
|
+
], Ps = {
|
|
8238
8238
|
width: 2,
|
|
8239
8239
|
opacity: 1
|
|
8240
|
-
},
|
|
8240
|
+
}, Rs = {
|
|
8241
8241
|
opacity: 0.25
|
|
8242
8242
|
}, jt = {
|
|
8243
8243
|
style: "classic",
|
|
@@ -8259,7 +8259,7 @@ const Ht = {
|
|
|
8259
8259
|
binSize: 2,
|
|
8260
8260
|
densityColormap: "viridis",
|
|
8261
8261
|
densityNormalization: "log"
|
|
8262
|
-
},
|
|
8262
|
+
}, Ds = {
|
|
8263
8263
|
horizontal: {
|
|
8264
8264
|
count: 5
|
|
8265
8265
|
},
|
|
@@ -8274,7 +8274,7 @@ const Ht = {
|
|
|
8274
8274
|
theme: "dark",
|
|
8275
8275
|
palette: er,
|
|
8276
8276
|
series: []
|
|
8277
|
-
},
|
|
8277
|
+
}, kf = [
|
|
8278
8278
|
"#00E5FF",
|
|
8279
8279
|
"#FF2D95",
|
|
8280
8280
|
"#B026FF",
|
|
@@ -8283,16 +8283,16 @@ const Ht = {
|
|
|
8283
8283
|
"#FF6B00",
|
|
8284
8284
|
"#4D5BFF",
|
|
8285
8285
|
"#FF3D3D"
|
|
8286
|
-
],
|
|
8286
|
+
], Gf = {
|
|
8287
8287
|
backgroundColor: "#1a1a2e",
|
|
8288
8288
|
textColor: "#e0e0e0",
|
|
8289
8289
|
axisLineColor: "rgba(224,224,224,0.35)",
|
|
8290
8290
|
axisTickColor: "rgba(224,224,224,0.55)",
|
|
8291
8291
|
gridLineColor: "rgba(255,255,255,0.1)",
|
|
8292
|
-
colorPalette: [...
|
|
8292
|
+
colorPalette: [...kf],
|
|
8293
8293
|
fontFamily: 'system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"',
|
|
8294
8294
|
fontSize: 12
|
|
8295
|
-
},
|
|
8295
|
+
}, zf = [
|
|
8296
8296
|
"#1F77B4",
|
|
8297
8297
|
"#FF7F0E",
|
|
8298
8298
|
"#2CA02C",
|
|
@@ -8301,20 +8301,20 @@ const Ht = {
|
|
|
8301
8301
|
"#8C564B",
|
|
8302
8302
|
"#E377C2",
|
|
8303
8303
|
"#17BECF"
|
|
8304
|
-
],
|
|
8304
|
+
], Vf = {
|
|
8305
8305
|
backgroundColor: "#ffffff",
|
|
8306
8306
|
textColor: "#333333",
|
|
8307
8307
|
axisLineColor: "rgba(0,0,0,0.35)",
|
|
8308
8308
|
axisTickColor: "rgba(0,0,0,0.55)",
|
|
8309
8309
|
gridLineColor: "rgba(0,0,0,0.1)",
|
|
8310
|
-
colorPalette: [...
|
|
8310
|
+
colorPalette: [...zf],
|
|
8311
8311
|
fontFamily: 'system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"',
|
|
8312
8312
|
fontSize: 12
|
|
8313
8313
|
};
|
|
8314
8314
|
function zr(e) {
|
|
8315
|
-
return e === "dark" ?
|
|
8315
|
+
return e === "dark" ? Gf : Vf;
|
|
8316
8316
|
}
|
|
8317
|
-
const
|
|
8317
|
+
const Wf = (e) => {
|
|
8318
8318
|
if (!Array.isArray(e)) return;
|
|
8319
8319
|
const t = [];
|
|
8320
8320
|
for (const n of e) {
|
|
@@ -8325,7 +8325,7 @@ const zf = (e) => {
|
|
|
8325
8325
|
t.push({ type: r, xAxisIndex: l, start: g, end: c, minSpan: h, maxSpan: d });
|
|
8326
8326
|
}
|
|
8327
8327
|
return t;
|
|
8328
|
-
},
|
|
8328
|
+
}, Of = (e) => {
|
|
8329
8329
|
if (!Array.isArray(e)) return;
|
|
8330
8330
|
const t = [], n = (f) => f === "start" || f === "center" || f === "end", i = (f) => f === "circle" || f === "rect" || f === "triangle", r = (f) => {
|
|
8331
8331
|
if (typeof f != "string") return;
|
|
@@ -8445,7 +8445,7 @@ const zf = (e) => {
|
|
|
8445
8445
|
}
|
|
8446
8446
|
if (t.length !== 0)
|
|
8447
8447
|
return Object.freeze(t), t;
|
|
8448
|
-
}, ci = (e) => Array.isArray(e) ? e.filter((t) => typeof t == "string").map((t) => t.trim()).filter((t) => t.length > 0) : [],
|
|
8448
|
+
}, ci = (e) => Array.isArray(e) ? e.filter((t) => typeof t == "string").map((t) => t.trim()).filter((t) => t.length > 0) : [], Xf = (e) => {
|
|
8449
8449
|
const t = zr("dark");
|
|
8450
8450
|
if (typeof e == "string") {
|
|
8451
8451
|
const a = e.trim().toLowerCase();
|
|
@@ -8473,23 +8473,23 @@ const zf = (e) => {
|
|
|
8473
8473
|
if (typeof e != "string") return;
|
|
8474
8474
|
const t = e.trim();
|
|
8475
8475
|
return t.length > 0 ? t : void 0;
|
|
8476
|
-
},
|
|
8476
|
+
}, $f = (e) => {
|
|
8477
8477
|
if (typeof e != "string") return;
|
|
8478
8478
|
const t = e.trim().toLowerCase();
|
|
8479
8479
|
return t === "none" || t === "lttb" || t === "average" || t === "max" || t === "min" || t === "ohlc" ? t : void 0;
|
|
8480
|
-
},
|
|
8480
|
+
}, Yf = (e) => {
|
|
8481
8481
|
if (typeof e != "string") return;
|
|
8482
8482
|
const t = e.trim().toLowerCase();
|
|
8483
8483
|
return t === "points" || t === "density" ? t : void 0;
|
|
8484
|
-
},
|
|
8484
|
+
}, Hf = (e) => {
|
|
8485
8485
|
if (typeof e != "string") return;
|
|
8486
8486
|
const t = e.trim().toLowerCase();
|
|
8487
8487
|
return t === "linear" || t === "sqrt" || t === "log" ? t : void 0;
|
|
8488
|
-
},
|
|
8488
|
+
}, qf = (e) => {
|
|
8489
8489
|
if (typeof e != "number" || !Number.isFinite(e)) return;
|
|
8490
8490
|
const t = Math.floor(e);
|
|
8491
8491
|
return t > 0 ? Math.max(1, t) : void 0;
|
|
8492
|
-
},
|
|
8492
|
+
}, Zf = (e) => {
|
|
8493
8493
|
if (typeof e == "string") {
|
|
8494
8494
|
const i = e.trim().toLowerCase();
|
|
8495
8495
|
return i === "viridis" || i === "plasma" || i === "inferno" ? i : void 0;
|
|
@@ -8502,22 +8502,22 @@ const zf = (e) => {
|
|
|
8502
8502
|
const n = e.filter((i) => typeof i == "string").map((i) => i.trim()).filter((i) => i.length > 0);
|
|
8503
8503
|
if (n.length !== 0)
|
|
8504
8504
|
return Object.freeze(n), n;
|
|
8505
|
-
},
|
|
8505
|
+
}, jf = (e) => {
|
|
8506
8506
|
if (typeof e != "string") return;
|
|
8507
8507
|
const t = e.trim().toLowerCase();
|
|
8508
8508
|
return t === "none" || t === "ohlc" ? t : void 0;
|
|
8509
|
-
},
|
|
8509
|
+
}, Es = (e) => {
|
|
8510
8510
|
if (typeof e != "number" || !Number.isFinite(e)) return;
|
|
8511
8511
|
const t = Math.floor(e);
|
|
8512
8512
|
return t > 0 ? t : void 0;
|
|
8513
|
-
},
|
|
8513
|
+
}, Bs = (e) => {
|
|
8514
8514
|
if (typeof e != "string") return;
|
|
8515
8515
|
const t = e.trim().toLowerCase();
|
|
8516
8516
|
return t === "global" || t === "visible" ? t : void 0;
|
|
8517
|
-
},
|
|
8517
|
+
}, Kf = (e) => Array.isArray(e), Jf = (e) => {
|
|
8518
8518
|
if (e.length === 0) return;
|
|
8519
8519
|
let t = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY, r = Number.NEGATIVE_INFINITY;
|
|
8520
|
-
if (
|
|
8520
|
+
if (Kf(e[0])) {
|
|
8521
8521
|
const s = e;
|
|
8522
8522
|
for (let a = 0; a < s.length; a++) {
|
|
8523
8523
|
const u = s[a], f = u[0], l = u[3], g = u[4];
|
|
@@ -8536,20 +8536,20 @@ const zf = (e) => {
|
|
|
8536
8536
|
}
|
|
8537
8537
|
if (!(!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(i) || !Number.isFinite(r)))
|
|
8538
8538
|
return t === n && (n = t + 1), i === r && (r = i + 1), { xMin: t, xMax: n, yMin: i, yMax: r };
|
|
8539
|
-
},
|
|
8539
|
+
}, Qf = (e) => {
|
|
8540
8540
|
throw new Error(
|
|
8541
8541
|
`Unhandled series type: ${(e == null ? void 0 : e.type) ?? "unknown"}`
|
|
8542
8542
|
);
|
|
8543
8543
|
};
|
|
8544
|
-
let
|
|
8545
|
-
const
|
|
8546
|
-
|
|
8544
|
+
let Ls = !1;
|
|
8545
|
+
const ed = () => {
|
|
8546
|
+
Ls || (console.warn(
|
|
8547
8547
|
"ChartGPU: Candlestick series rendering is not yet implemented. Series will be skipped."
|
|
8548
|
-
),
|
|
8548
|
+
), Ls = !0);
|
|
8549
8549
|
};
|
|
8550
|
-
function
|
|
8550
|
+
function ua(e = {}) {
|
|
8551
8551
|
var C, v, m, x;
|
|
8552
|
-
const t =
|
|
8552
|
+
const t = Xf(e.theme), n = e.autoScroll, i = typeof n == "boolean" ? n : Bt.autoScroll, r = e.animation, s = (typeof r == "boolean" || r !== null && typeof r == "object" && !Array.isArray(r) ? r : void 0) ?? !0, a = ci(e.palette), u = a.length > 0 ? { ...t, colorPalette: a } : t, f = ci(u.colorPalette), l = f.length > 0 ? f : ci(Bt.palette ?? er).length > 0 ? ci(Bt.palette ?? er) : Array.from(er), g = l.length > 0 ? l : ["#000000"], c = { ...u, colorPalette: g.slice() }, h = {
|
|
8553
8553
|
left: ((C = e.grid) == null ? void 0 : C.left) ?? Bt.grid.left,
|
|
8554
8554
|
right: ((v = e.grid) == null ? void 0 : v.right) ?? Bt.grid.right,
|
|
8555
8555
|
top: ((m = e.grid) == null ? void 0 : m.top) ?? Bt.grid.top,
|
|
@@ -8571,28 +8571,28 @@ function ca(e = {}) {
|
|
|
8571
8571
|
show: I,
|
|
8572
8572
|
color: y,
|
|
8573
8573
|
opacity: S,
|
|
8574
|
-
horizontal: F(b == null ? void 0 : b.horizontal,
|
|
8575
|
-
vertical: F(b == null ? void 0 : b.vertical,
|
|
8574
|
+
horizontal: F(b == null ? void 0 : b.horizontal, Ds.horizontal.count),
|
|
8575
|
+
vertical: F(b == null ? void 0 : b.vertical, Ds.vertical.count)
|
|
8576
8576
|
};
|
|
8577
8577
|
})(e.gridLines, c), P = e.xAxis ? {
|
|
8578
8578
|
...Bt.xAxis,
|
|
8579
8579
|
...e.xAxis,
|
|
8580
8580
|
// runtime safety for JS callers
|
|
8581
8581
|
type: e.xAxis.type ?? Bt.xAxis.type,
|
|
8582
|
-
autoBounds:
|
|
8582
|
+
autoBounds: Bs(e.xAxis.autoBounds) ?? Bt.xAxis.autoBounds
|
|
8583
8583
|
} : { ...Bt.xAxis }, R = e.yAxis ? {
|
|
8584
8584
|
...Bt.yAxis,
|
|
8585
8585
|
...e.yAxis,
|
|
8586
8586
|
// runtime safety for JS callers
|
|
8587
8587
|
type: e.yAxis.type ?? Bt.yAxis.type,
|
|
8588
|
-
autoBounds:
|
|
8588
|
+
autoBounds: Bs(e.yAxis.autoBounds) ?? Bt.yAxis.autoBounds
|
|
8589
8589
|
} : { ...Bt.yAxis }, T = (e.series ?? []).map((b, M) => {
|
|
8590
8590
|
var N, D, B, E, z, G, Y, V, j, K;
|
|
8591
|
-
const I = Kt(b.color), A = c.colorPalette[M % c.colorPalette.length], S = I ?? A, p = b.visible !== !1, y =
|
|
8591
|
+
const I = Kt(b.color), A = c.colorPalette[M % c.colorPalette.length], S = I ?? A, p = b.visible !== !1, y = $f(b.sampling) ?? "lttb", F = Es(b.samplingThreshold) ?? 5e3;
|
|
8592
8592
|
switch (b.type) {
|
|
8593
8593
|
case "area": {
|
|
8594
8594
|
const oe = Kt((N = b.areaStyle) == null ? void 0 : N.color) ?? I ?? A, W = {
|
|
8595
|
-
opacity: ((D = b.areaStyle) == null ? void 0 : D.opacity) ??
|
|
8595
|
+
opacity: ((D = b.areaStyle) == null ? void 0 : D.opacity) ?? Rs.opacity,
|
|
8596
8596
|
color: oe
|
|
8597
8597
|
}, fe = Vt(b.data) ?? void 0;
|
|
8598
8598
|
return {
|
|
@@ -8609,8 +8609,8 @@ function ca(e = {}) {
|
|
|
8609
8609
|
}
|
|
8610
8610
|
case "line": {
|
|
8611
8611
|
const oe = Kt((B = b.lineStyle) == null ? void 0 : B.color) ?? I ?? A, W = {
|
|
8612
|
-
width: ((E = b.lineStyle) == null ? void 0 : E.width) ??
|
|
8613
|
-
opacity: ((z = b.lineStyle) == null ? void 0 : z.opacity) ??
|
|
8612
|
+
width: ((E = b.lineStyle) == null ? void 0 : E.width) ?? Ps.width,
|
|
8613
|
+
opacity: ((z = b.lineStyle) == null ? void 0 : z.opacity) ?? Ps.opacity,
|
|
8614
8614
|
color: oe
|
|
8615
8615
|
}, { areaStyle: fe, ..._ } = b, H = Vt(b.data) ?? void 0, X = Gn(b.data, y, F);
|
|
8616
8616
|
return {
|
|
@@ -8622,7 +8622,7 @@ function ca(e = {}) {
|
|
|
8622
8622
|
lineStyle: W,
|
|
8623
8623
|
...b.areaStyle ? {
|
|
8624
8624
|
areaStyle: {
|
|
8625
|
-
opacity: b.areaStyle.opacity ??
|
|
8625
|
+
opacity: b.areaStyle.opacity ?? Rs.opacity,
|
|
8626
8626
|
// Fill color precedence: areaStyle.color → resolved stroke color
|
|
8627
8627
|
color: Kt(b.areaStyle.color) ?? oe
|
|
8628
8628
|
}
|
|
@@ -8646,7 +8646,7 @@ function ca(e = {}) {
|
|
|
8646
8646
|
};
|
|
8647
8647
|
}
|
|
8648
8648
|
case "scatter": {
|
|
8649
|
-
const J = Vt(b.data) ?? void 0, oe =
|
|
8649
|
+
const J = Vt(b.data) ?? void 0, oe = Yf(b.mode) ?? Yi.mode, W = qf(b.binSize) ?? Yi.binSize, fe = Zf(b.densityColormap) ?? Yi.densityColormap, _ = Hf(
|
|
8650
8650
|
b.densityNormalization
|
|
8651
8651
|
) ?? Yi.densityNormalization;
|
|
8652
8652
|
return {
|
|
@@ -8676,14 +8676,14 @@ function ca(e = {}) {
|
|
|
8676
8676
|
return { ...W, visible: p, color: S, data: fe };
|
|
8677
8677
|
}
|
|
8678
8678
|
case "candlestick": {
|
|
8679
|
-
|
|
8680
|
-
const J =
|
|
8679
|
+
ed();
|
|
8680
|
+
const J = jf(b.sampling) ?? jt.sampling, oe = Es(b.samplingThreshold) ?? jt.samplingThreshold, W = {
|
|
8681
8681
|
upColor: Kt((G = b.itemStyle) == null ? void 0 : G.upColor) ?? jt.itemStyle.upColor,
|
|
8682
8682
|
downColor: Kt((Y = b.itemStyle) == null ? void 0 : Y.downColor) ?? jt.itemStyle.downColor,
|
|
8683
8683
|
upBorderColor: Kt((V = b.itemStyle) == null ? void 0 : V.upBorderColor) ?? jt.itemStyle.upBorderColor,
|
|
8684
8684
|
downBorderColor: Kt((j = b.itemStyle) == null ? void 0 : j.downBorderColor) ?? jt.itemStyle.downBorderColor,
|
|
8685
8685
|
borderWidth: typeof ((K = b.itemStyle) == null ? void 0 : K.borderWidth) == "number" && Number.isFinite(b.itemStyle.borderWidth) ? b.itemStyle.borderWidth : jt.itemStyle.borderWidth
|
|
8686
|
-
}, fe =
|
|
8686
|
+
}, fe = Jf(b.data), _ = J === "ohlc" && b.data.length > oe ? $r(b.data, oe) : b.data;
|
|
8687
8687
|
return {
|
|
8688
8688
|
...b,
|
|
8689
8689
|
visible: p,
|
|
@@ -8701,7 +8701,7 @@ function ca(e = {}) {
|
|
|
8701
8701
|
};
|
|
8702
8702
|
}
|
|
8703
8703
|
default:
|
|
8704
|
-
return
|
|
8704
|
+
return Qf(b);
|
|
8705
8705
|
}
|
|
8706
8706
|
});
|
|
8707
8707
|
return {
|
|
@@ -8710,8 +8710,8 @@ function ca(e = {}) {
|
|
|
8710
8710
|
xAxis: P,
|
|
8711
8711
|
yAxis: R,
|
|
8712
8712
|
autoScroll: i,
|
|
8713
|
-
dataZoom:
|
|
8714
|
-
annotations:
|
|
8713
|
+
dataZoom: Wf(e.dataZoom),
|
|
8714
|
+
annotations: Of(e.annotations),
|
|
8715
8715
|
animation: s,
|
|
8716
8716
|
theme: c,
|
|
8717
8717
|
palette: c.colorPalette,
|
|
@@ -8719,21 +8719,21 @@ function ca(e = {}) {
|
|
|
8719
8719
|
legend: e.legend
|
|
8720
8720
|
};
|
|
8721
8721
|
}
|
|
8722
|
-
const
|
|
8722
|
+
const td = 32, nd = 8, id = td + nd, rd = (e) => {
|
|
8723
8723
|
var t;
|
|
8724
8724
|
return ((t = e.dataZoom) == null ? void 0 : t.some((n) => (n == null ? void 0 : n.type) === "slider")) ?? !1;
|
|
8725
8725
|
};
|
|
8726
|
-
function
|
|
8727
|
-
const t = { ...
|
|
8728
|
-
return
|
|
8726
|
+
function _s(e = {}) {
|
|
8727
|
+
const t = { ...ua(e), tooltip: e.tooltip };
|
|
8728
|
+
return rd(e) ? {
|
|
8729
8729
|
...t,
|
|
8730
8730
|
grid: {
|
|
8731
8731
|
...t.grid,
|
|
8732
|
-
bottom: t.grid.bottom +
|
|
8732
|
+
bottom: t.grid.bottom + id
|
|
8733
8733
|
}
|
|
8734
8734
|
} : t;
|
|
8735
8735
|
}
|
|
8736
|
-
const
|
|
8736
|
+
const Kd = { resolve: ua }, Jr = (e, t, n) => Math.min(n, Math.max(t, e)), od = (e) => {
|
|
8737
8737
|
let { start: t, end: n } = e;
|
|
8738
8738
|
if (t > n) {
|
|
8739
8739
|
const i = t;
|
|
@@ -8741,7 +8741,7 @@ const Zd = { resolve: ca }, Jr = (e, t, n) => Math.min(n, Math.max(t, e)), id =
|
|
|
8741
8741
|
}
|
|
8742
8742
|
return { start: Jr(t, 0, 100), end: Jr(n, 0, 100) };
|
|
8743
8743
|
};
|
|
8744
|
-
function
|
|
8744
|
+
function sd(e, t, n) {
|
|
8745
8745
|
const i = n == null ? void 0 : n.height, r = n == null ? void 0 : n.marginTop, o = (n == null ? void 0 : n.zIndex) ?? 4, s = (n == null ? void 0 : n.showPreview) ?? !1, a = document.createElement("div");
|
|
8746
8746
|
a.style.display = "block", a.style.width = "100%", a.style.height = `${i}px`, a.style.marginTop = `${r}px`, a.style.boxSizing = "border-box", a.style.position = "relative", a.style.zIndex = `${o}`, a.style.userSelect = "none", a.style.touchAction = "none";
|
|
8747
8747
|
const u = document.createElement("div");
|
|
@@ -8758,7 +8758,7 @@ function rd(e, t, n) {
|
|
|
8758
8758
|
h.style.position = "absolute", h.style.left = "10px", h.style.right = "10px", h.style.top = "0", h.style.bottom = "0", h.style.cursor = "grab", l.appendChild(h), e.appendChild(a);
|
|
8759
8759
|
let d = !1, w = null;
|
|
8760
8760
|
const P = (p) => {
|
|
8761
|
-
const y =
|
|
8761
|
+
const y = od(p), F = Jr(y.end - y.start, 0, 100);
|
|
8762
8762
|
l.style.left = `${y.start}%`, l.style.width = `${F}%`;
|
|
8763
8763
|
}, R = () => {
|
|
8764
8764
|
const p = u.getBoundingClientRect().width;
|
|
@@ -8834,7 +8834,7 @@ function rd(e, t, n) {
|
|
|
8834
8834
|
} };
|
|
8835
8835
|
}
|
|
8836
8836
|
let Hi = null;
|
|
8837
|
-
async function
|
|
8837
|
+
async function ad() {
|
|
8838
8838
|
return Hi || (Hi = (async () => {
|
|
8839
8839
|
if (typeof window > "u")
|
|
8840
8840
|
return {
|
|
@@ -8865,7 +8865,7 @@ async function od() {
|
|
|
8865
8865
|
}
|
|
8866
8866
|
})(), Hi);
|
|
8867
8867
|
}
|
|
8868
|
-
const Jt = 120,
|
|
8868
|
+
const Jt = 120, cd = 1e3 / 60, ld = 1.5, ud = 6, fd = 500, dd = (e) => Array.isArray(e), $n = (e) => Array.isArray(e), Us = (e) => dd(e) ? { x: e[0], y: e[1] } : { x: e.x, y: e.y }, md = (e) => {
|
|
8869
8869
|
const t = Ie(e);
|
|
8870
8870
|
if (t === 0) return { x: [], y: [] };
|
|
8871
8871
|
const n = new Array(t), i = new Array(t), r = [];
|
|
@@ -8876,10 +8876,10 @@ const Jt = 120, sd = 1e3 / 60, ad = 1.5, cd = 6, ld = 500, ud = (e) => Array.isA
|
|
|
8876
8876
|
r[s] = a, a !== void 0 && (o = !0);
|
|
8877
8877
|
}
|
|
8878
8878
|
return o ? { x: n, y: i, size: r } : { x: n, y: i };
|
|
8879
|
-
}, mi = (e) => $n(e) ? e[0] : e.timestamp,
|
|
8879
|
+
}, mi = (e) => $n(e) ? e[0] : e.timestamp, ks = (e) => $n(e) ? e[2] : e.close, pd = (e) => {
|
|
8880
8880
|
var t;
|
|
8881
8881
|
return ((t = e.dataZoom) == null ? void 0 : t.some((n) => (n == null ? void 0 : n.type) === "slider")) ?? !1;
|
|
8882
|
-
}, Vr = (e, t, n) => Math.min(n, Math.max(t, e)),
|
|
8882
|
+
}, Vr = (e, t, n) => Math.min(n, Math.max(t, e)), hd = (e, t) => {
|
|
8883
8883
|
const n = Ie(t);
|
|
8884
8884
|
if (n === 0) return e;
|
|
8885
8885
|
let i = e;
|
|
@@ -8905,7 +8905,7 @@ const Jt = 120, sd = 1e3 / 60, ad = 1.5, cd = 6, ld = 500, ud = (e) => Array.isA
|
|
|
8905
8905
|
!Number.isFinite(g) || !Number.isFinite(c) || (g < r && (r = g), g > o && (o = g), c < s && (s = c), c > a && (a = c));
|
|
8906
8906
|
}
|
|
8907
8907
|
return r === o && (o = r + 1), s === a && (a = s + 1), { xMin: r, xMax: o, yMin: s, yMax: a };
|
|
8908
|
-
},
|
|
8908
|
+
}, yd = (e, t) => {
|
|
8909
8909
|
if (t.length === 0) return e;
|
|
8910
8910
|
let n = (e == null ? void 0 : e.xMin) ?? Number.POSITIVE_INFINITY, i = (e == null ? void 0 : e.xMax) ?? Number.NEGATIVE_INFINITY, r = (e == null ? void 0 : e.yMin) ?? Number.POSITIVE_INFINITY, o = (e == null ? void 0 : e.yMax) ?? Number.NEGATIVE_INFINITY;
|
|
8911
8911
|
for (let s = 0; s < t.length; s++) {
|
|
@@ -8966,28 +8966,28 @@ const Jt = 120, sd = 1e3 / 60, ad = 1.5, cd = 6, ld = 500, ud = (e) => Array.isA
|
|
|
8966
8966
|
}
|
|
8967
8967
|
const i = Number.parseFloat(n);
|
|
8968
8968
|
return Number.isFinite(i) ? i : null;
|
|
8969
|
-
},
|
|
8969
|
+
}, Gs = (e, t, n) => {
|
|
8970
8970
|
const i = (e == null ? void 0 : e[0]) ?? "50%", r = (e == null ? void 0 : e[1]) ?? "50%", o = pi(i, t), s = pi(r, n);
|
|
8971
8971
|
return {
|
|
8972
8972
|
x: Number.isFinite(o) ? o : t * 0.5,
|
|
8973
8973
|
y: Number.isFinite(s) ? s : n * 0.5
|
|
8974
8974
|
};
|
|
8975
|
-
},
|
|
8975
|
+
}, gd = (e) => Array.isArray(e), zs = (e, t) => {
|
|
8976
8976
|
if (e == null) return { inner: 0, outer: t * 0.7 };
|
|
8977
|
-
if (
|
|
8977
|
+
if (gd(e)) {
|
|
8978
8978
|
const r = pi(e[0], t), o = pi(e[1], t), s = Math.max(0, Number.isFinite(r) ? r : 0), a = Math.max(s, Number.isFinite(o) ? o : t * 0.7);
|
|
8979
8979
|
return { inner: s, outer: Math.min(t, a) };
|
|
8980
8980
|
}
|
|
8981
8981
|
const n = pi(e, t), i = Math.max(0, Number.isFinite(n) ? n : t * 0.7);
|
|
8982
8982
|
return { inner: 0, outer: Math.min(t, i) };
|
|
8983
8983
|
};
|
|
8984
|
-
async function
|
|
8984
|
+
async function xd(e, t, n) {
|
|
8985
8985
|
var vi;
|
|
8986
8986
|
if (n) {
|
|
8987
8987
|
if (typeof navigator > "u" || !navigator.gpu)
|
|
8988
8988
|
throw new Error("ChartGPU: Shared device mode requires WebGPU globals (navigator.gpu) to be available.");
|
|
8989
8989
|
} else {
|
|
8990
|
-
const L = await
|
|
8990
|
+
const L = await ad();
|
|
8991
8991
|
if (!L.supported) {
|
|
8992
8992
|
const Z = L.reason || "Unknown reason";
|
|
8993
8993
|
throw new Error(
|
|
@@ -9009,7 +9009,7 @@ Resources:
|
|
|
9009
9009
|
const i = document.createElement("canvas");
|
|
9010
9010
|
i.style.display = "block", i.style.width = "100%", i.style.height = "100%", e.appendChild(i);
|
|
9011
9011
|
const r = !!n;
|
|
9012
|
-
let o = !1, s = t.renderMode ?? "auto", a = !1, u = !1, f = null, l = null, g = null, c = null, h = null, d, w = !1, P = null, R = null, T = t, C =
|
|
9012
|
+
let o = !1, s = t.renderMode ?? "auto", a = !1, u = !1, f = null, l = null, g = null, c = null, h = null, d, w = !1, P = null, R = null, T = t, C = _s(T), v = new Array(C.series.length).fill(null).map(() => ({ x: [], y: [] })), m = new Array(C.series.length).fill(null), x = null;
|
|
9013
9013
|
const b = () => {
|
|
9014
9014
|
v = new Array(C.series.length).fill(null).map(() => ({ x: [], y: [] })), m = new Array(C.series.length).fill(null), x = null;
|
|
9015
9015
|
for (let L = 0; L < C.series.length; L++) {
|
|
@@ -9023,7 +9023,7 @@ Resources:
|
|
|
9023
9023
|
v[L] = ue.length === 0 ? [] : ue.slice(), m[L] = Z.rawBounds ?? null;
|
|
9024
9024
|
} else {
|
|
9025
9025
|
const ue = Z.rawData ?? Z.data;
|
|
9026
|
-
v[L] =
|
|
9026
|
+
v[L] = md(ue), m[L] = Z.rawBounds ?? null ?? Vt(ue);
|
|
9027
9027
|
}
|
|
9028
9028
|
}
|
|
9029
9029
|
}, M = () => x || (x = C.series.map((L, Z) => {
|
|
@@ -9060,7 +9060,7 @@ Resources:
|
|
|
9060
9060
|
a = !0;
|
|
9061
9061
|
const Z = performance.now();
|
|
9062
9062
|
try {
|
|
9063
|
-
if (G[Y] = Z, Y = (Y + 1) % Jt, V < Jt && V++, j++, L && (fe > 0 && (Z - fe >
|
|
9063
|
+
if (G[Y] = Z, Y = (Y + 1) % Jt, V < Jt && V++, j++, L && (fe > 0 && (Z - fe > cd * ld ? (K++, J++, oe = Z) : J = 0), fe = Z), nt(!1), !l || !(f != null && f.device)) return;
|
|
9064
9064
|
if (z) {
|
|
9065
9065
|
z = !1;
|
|
9066
9066
|
try {
|
|
@@ -9135,13 +9135,13 @@ Resources:
|
|
|
9135
9135
|
he && (l == null || l.setZoomRange(he.start + de, he.end + de));
|
|
9136
9136
|
}, onChange: (de) => (l == null ? void 0 : l.onZoomRangeChange(de)) ?? (() => {
|
|
9137
9137
|
}) }), Te = () => {
|
|
9138
|
-
if (!
|
|
9138
|
+
if (!pd(T)) {
|
|
9139
9139
|
ge();
|
|
9140
9140
|
return;
|
|
9141
9141
|
}
|
|
9142
9142
|
if (!l || !l.getZoomRange()) return;
|
|
9143
9143
|
const Z = st();
|
|
9144
|
-
R || (R =
|
|
9144
|
+
R || (R = sd(Z, ve(), {
|
|
9145
9145
|
height: ye,
|
|
9146
9146
|
marginTop: 0
|
|
9147
9147
|
// host provides vertical spacing
|
|
@@ -9165,7 +9165,7 @@ Resources:
|
|
|
9165
9165
|
onRequestRender: se,
|
|
9166
9166
|
pipelineCache: n == null ? void 0 : n.pipelineCache
|
|
9167
9167
|
};
|
|
9168
|
-
l =
|
|
9168
|
+
l = Uf(f, C, Z), g = f.preferredFormat, bt(), vt(), L && l.setZoomRange(L.start, L.end), Te();
|
|
9169
9169
|
}, nt = (L) => {
|
|
9170
9170
|
var Nt;
|
|
9171
9171
|
if (o) return;
|
|
@@ -9213,7 +9213,7 @@ Resources:
|
|
|
9213
9213
|
for (let ze = C.series.length - 1; ze >= 0; ze--) {
|
|
9214
9214
|
const dt = C.series[ze];
|
|
9215
9215
|
if (dt.type !== "pie" || dt.visible === !1) continue;
|
|
9216
|
-
const yt = dt, St =
|
|
9216
|
+
const yt = dt, St = Gs(yt.center, de, he), In = zs(yt.radius, Ge), $t = Zr(Ne, Me, { seriesIndex: ze, series: yt }, St, In);
|
|
9217
9217
|
if (!$t) continue;
|
|
9218
9218
|
const ln = $t.slice.value;
|
|
9219
9219
|
return {
|
|
@@ -9322,7 +9322,7 @@ Resources:
|
|
|
9322
9322
|
event: Z
|
|
9323
9323
|
};
|
|
9324
9324
|
if (L.kind === "candlestick") {
|
|
9325
|
-
const Me = mi(L.point), et =
|
|
9325
|
+
const Me = mi(L.point), et = ks(L.point);
|
|
9326
9326
|
return {
|
|
9327
9327
|
seriesIndex: ue,
|
|
9328
9328
|
dataIndex: we,
|
|
@@ -9331,7 +9331,7 @@ Resources:
|
|
|
9331
9331
|
event: Z
|
|
9332
9332
|
};
|
|
9333
9333
|
}
|
|
9334
|
-
const { x: he, y: Ne } =
|
|
9334
|
+
const { x: he, y: Ne } = Us(L.match.point);
|
|
9335
9335
|
return {
|
|
9336
9336
|
seriesIndex: ue,
|
|
9337
9337
|
dataIndex: we,
|
|
@@ -9399,8 +9399,8 @@ Resources:
|
|
|
9399
9399
|
i.hasPointerCapture(L.pointerId) && (F = L.pointerId, i.releasePointerCapture(L.pointerId));
|
|
9400
9400
|
} catch {
|
|
9401
9401
|
}
|
|
9402
|
-
const Ce =
|
|
9403
|
-
if (!(Z <=
|
|
9402
|
+
const Ce = ud;
|
|
9403
|
+
if (!(Z <= fd && ne <= Ce * Ce)) return;
|
|
9404
9404
|
const { match: he } = Wt(L);
|
|
9405
9405
|
Qe("click", wt(he, L));
|
|
9406
9406
|
};
|
|
@@ -9422,7 +9422,7 @@ Resources:
|
|
|
9422
9422
|
return o;
|
|
9423
9423
|
},
|
|
9424
9424
|
setOption(L) {
|
|
9425
|
-
o || (T = L, C =
|
|
9425
|
+
o || (T = L, C = _s(L), l == null || l.setOptions(C), b(), I = Wr(C.series, m), A = null, Te(), se());
|
|
9426
9426
|
},
|
|
9427
9427
|
appendData(L, Z) {
|
|
9428
9428
|
if (o || !Number.isFinite(L) || L < 0 || L >= C.series.length) return;
|
|
@@ -9449,7 +9449,7 @@ Resources:
|
|
|
9449
9449
|
const et = mi(Ne[Me]);
|
|
9450
9450
|
Number.isFinite(et) && (et < ne && (ne = et), et > Ce && (Ce = et));
|
|
9451
9451
|
}
|
|
9452
|
-
he.push(...Ne), v[L] = he, m[L] =
|
|
9452
|
+
he.push(...Ne), v[L] = he, m[L] = yd(
|
|
9453
9453
|
m[L],
|
|
9454
9454
|
Ne
|
|
9455
9455
|
);
|
|
@@ -9481,7 +9481,7 @@ Resources:
|
|
|
9481
9481
|
const ct = at(he, _e);
|
|
9482
9482
|
Nt[_e] = ct, ct !== void 0 && (et = !0), p && Number.isFinite(Oe) && (Oe < ne && (ne = Oe), Oe > Ce && (Ce = Oe));
|
|
9483
9483
|
}
|
|
9484
|
-
(de.size || et) && (de.size || (de.size = new Array(de.x.length - we)), de.size.push(...Nt)), m[L] =
|
|
9484
|
+
(de.size || et) && (de.size || (de.size = new Array(de.x.length - we)), de.size.push(...Nt)), m[L] = hd(
|
|
9485
9485
|
m[L],
|
|
9486
9486
|
he
|
|
9487
9487
|
);
|
|
@@ -9618,7 +9618,7 @@ Resources:
|
|
|
9618
9618
|
for (let ze = C.series.length - 1; ze >= 0; ze--) {
|
|
9619
9619
|
const dt = C.series[ze];
|
|
9620
9620
|
if (dt.type !== "pie" || dt.visible === !1) continue;
|
|
9621
|
-
const yt = dt, St =
|
|
9621
|
+
const yt = dt, St = Gs(yt.center, de, he), In = zs(yt.radius, Ge), $t = Zr(Ne, Me, { seriesIndex: ze, series: yt }, St, In);
|
|
9622
9622
|
if (!$t) continue;
|
|
9623
9623
|
const ln = $t.slice.value;
|
|
9624
9624
|
return {
|
|
@@ -9649,7 +9649,7 @@ Resources:
|
|
|
9649
9649
|
if ((ze == null ? void 0 : ze.type) !== "candlestick" || ze.visible === !1) continue;
|
|
9650
9650
|
const dt = ze, yt = Hr(dt, dt.data, At.xScale, de), St = qr([dt], Ne, Me, At.xScale, At.yScale, yt);
|
|
9651
9651
|
if (!St) continue;
|
|
9652
|
-
const In = mi(St.point), $t =
|
|
9652
|
+
const In = mi(St.point), $t = ks(St.point);
|
|
9653
9653
|
return {
|
|
9654
9654
|
isInGrid: !0,
|
|
9655
9655
|
canvasX: ue,
|
|
@@ -9672,7 +9672,7 @@ Resources:
|
|
|
9672
9672
|
At.yScale
|
|
9673
9673
|
);
|
|
9674
9674
|
if (Dt) {
|
|
9675
|
-
const { x: Ge, y: ze } =
|
|
9675
|
+
const { x: Ge, y: ze } = Us(Dt.point);
|
|
9676
9676
|
return {
|
|
9677
9677
|
isInGrid: !0,
|
|
9678
9678
|
canvasX: ue,
|
|
@@ -9722,10 +9722,10 @@ Resources:
|
|
|
9722
9722
|
throw xn.dispose(), L;
|
|
9723
9723
|
}
|
|
9724
9724
|
}
|
|
9725
|
-
const
|
|
9726
|
-
create:
|
|
9725
|
+
const bd = {
|
|
9726
|
+
create: xd
|
|
9727
9727
|
};
|
|
9728
|
-
function
|
|
9728
|
+
function Jd(e, t) {
|
|
9729
9729
|
const n = (t == null ? void 0 : t.syncCrosshair) ?? !0, i = (t == null ? void 0 : t.syncZoom) ?? !1, r = Symbol("ChartGPU.connectCharts");
|
|
9730
9730
|
let o = !1;
|
|
9731
9731
|
const s = [];
|
|
@@ -9772,7 +9772,7 @@ function jd(e, t) {
|
|
|
9772
9772
|
}
|
|
9773
9773
|
};
|
|
9774
9774
|
}
|
|
9775
|
-
function
|
|
9775
|
+
function vd(e, t, n = {}) {
|
|
9776
9776
|
const i = n.lineTolerance ?? 20, r = n.textTolerance ?? 8, o = n.pointTolerance ?? 16;
|
|
9777
9777
|
let s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = !1;
|
|
9778
9778
|
const f = (p) => Array.isArray(p), l = (p) => Array.isArray(p), g = (p) => f(p) ? p[0] : p.x, c = (p) => f(p) ? p[1] : p.y, h = (p) => l(p) ? p[0] : p.timestamp, d = (p) => l(p) ? p[2] : p.high, w = (p) => l(p) ? p[3] : p.low;
|
|
@@ -9965,7 +9965,7 @@ function xd(e, t, n = {}) {
|
|
|
9965
9965
|
dispose: S
|
|
9966
9966
|
};
|
|
9967
9967
|
}
|
|
9968
|
-
function
|
|
9968
|
+
function wd(e, t, n) {
|
|
9969
9969
|
let i = null;
|
|
9970
9970
|
const r = (b) => Array.isArray(b), o = (b) => Array.isArray(b), s = (b) => r(b) ? b[0] : b.x, a = (b) => r(b) ? b[1] : b.y, u = (b) => o(b) ? b[0] : b.timestamp, f = (b) => o(b) ? b[2] : b.high, l = (b) => o(b) ? b[3] : b.low;
|
|
9971
9971
|
function g() {
|
|
@@ -10140,7 +10140,7 @@ function bd(e, t, n) {
|
|
|
10140
10140
|
dispose: x
|
|
10141
10141
|
};
|
|
10142
10142
|
}
|
|
10143
|
-
const
|
|
10143
|
+
const Cd = [
|
|
10144
10144
|
"#ef4444",
|
|
10145
10145
|
// Red (critical)
|
|
10146
10146
|
"#f97316",
|
|
@@ -10166,8 +10166,8 @@ const vd = [
|
|
|
10166
10166
|
"#1e293b"
|
|
10167
10167
|
// Near-black (background)
|
|
10168
10168
|
];
|
|
10169
|
-
function
|
|
10170
|
-
const n = t.palette ??
|
|
10169
|
+
function Md(e, t = {}) {
|
|
10170
|
+
const n = t.palette ?? Cd, i = t.zIndex ?? 1e3;
|
|
10171
10171
|
let r = null, o = null, s = null, a = null, u = "create";
|
|
10172
10172
|
function f() {
|
|
10173
10173
|
const p = document.createElement("div");
|
|
@@ -10529,8 +10529,8 @@ function wd(e, t = {}) {
|
|
|
10529
10529
|
dispose: S
|
|
10530
10530
|
};
|
|
10531
10531
|
}
|
|
10532
|
-
const
|
|
10533
|
-
function
|
|
10532
|
+
const fa = (e) => Array.isArray(e), Qr = (e) => Array.isArray(e), Sd = (e) => fa(e) ? e[0] : e.x, Fd = (e) => fa(e) ? e[1] : e.y, Nd = (e) => Qr(e) ? e[0] : e.timestamp;
|
|
10533
|
+
function Qd(e, t, n = {}) {
|
|
10534
10534
|
const {
|
|
10535
10535
|
menuZIndex: i = 1e3,
|
|
10536
10536
|
enableContextMenu: r = !0
|
|
@@ -10538,13 +10538,13 @@ function Kd(e, t, n = {}) {
|
|
|
10538
10538
|
if (!o)
|
|
10539
10539
|
throw new Error("createAnnotationAuthoring: canvas element not found in container");
|
|
10540
10540
|
let s = [{ annotations: t.options.annotations ?? [] }], a = 0, u = !1;
|
|
10541
|
-
const f =
|
|
10541
|
+
const f = vd(t, o, {
|
|
10542
10542
|
lineTolerance: 20,
|
|
10543
10543
|
textTolerance: 8,
|
|
10544
10544
|
pointTolerance: 16
|
|
10545
|
-
}), l =
|
|
10545
|
+
}), l = Md(e, {
|
|
10546
10546
|
zIndex: i
|
|
10547
|
-
}), g =
|
|
10547
|
+
}), g = wd(t, o, {
|
|
10548
10548
|
onDragMove: (_, H) => {
|
|
10549
10549
|
const pe = c().map((ce, me) => me === _ ? { ...ce, ...H } : ce);
|
|
10550
10550
|
d(pe);
|
|
@@ -10611,13 +10611,13 @@ function Kd(e, t, n = {}) {
|
|
|
10611
10611
|
if (ee.type === "candlestick") {
|
|
10612
10612
|
const be = ee.data;
|
|
10613
10613
|
for (const le of be) {
|
|
10614
|
-
const ge =
|
|
10614
|
+
const ge = Nd(le);
|
|
10615
10615
|
ge < se && (se = ge), ge > te && (te = ge);
|
|
10616
10616
|
}
|
|
10617
10617
|
} else {
|
|
10618
10618
|
const be = ee.data;
|
|
10619
10619
|
for (const le of be) {
|
|
10620
|
-
const ge =
|
|
10620
|
+
const ge = Sd(le);
|
|
10621
10621
|
ge < se && (se = ge), ge > te && (te = ge);
|
|
10622
10622
|
}
|
|
10623
10623
|
}
|
|
@@ -10647,7 +10647,7 @@ function Kd(e, t, n = {}) {
|
|
|
10647
10647
|
} else {
|
|
10648
10648
|
const ee = te.data;
|
|
10649
10649
|
for (const be of ee) {
|
|
10650
|
-
const le =
|
|
10650
|
+
const le = Fd(be);
|
|
10651
10651
|
le < q && (q = le), le > se && (se = le);
|
|
10652
10652
|
}
|
|
10653
10653
|
}
|
|
@@ -10826,7 +10826,7 @@ function Kd(e, t, n = {}) {
|
|
|
10826
10826
|
dispose: fe
|
|
10827
10827
|
};
|
|
10828
10828
|
}
|
|
10829
|
-
const eo = 120,
|
|
10829
|
+
const eo = 120, Td = 1e3 / 60, Ad = 1.5, gn = /* @__PURE__ */ new Map();
|
|
10830
10830
|
function ro() {
|
|
10831
10831
|
const e = Symbol("RenderScheduler"), t = {
|
|
10832
10832
|
id: e,
|
|
@@ -10849,7 +10849,7 @@ function ro() {
|
|
|
10849
10849
|
startTime: performance.now()
|
|
10850
10850
|
}), t;
|
|
10851
10851
|
}
|
|
10852
|
-
function
|
|
10852
|
+
function da(e, t) {
|
|
10853
10853
|
if (!t)
|
|
10854
10854
|
throw new Error("Render callback is required");
|
|
10855
10855
|
const n = gn.get(e.id);
|
|
@@ -10867,7 +10867,7 @@ function ua(e, t) {
|
|
|
10867
10867
|
s.frameTimestamps[s.frameTimestampIndex] = a, s.frameTimestampIndex = (s.frameTimestampIndex + 1) % eo, s.frameTimestampCount < eo && s.frameTimestampCount++, s.totalFrames++;
|
|
10868
10868
|
let u = o - s.lastFrameTime;
|
|
10869
10869
|
const f = 100;
|
|
10870
|
-
if (u > f && (u = f), s.lastFrameTime > 0 && u >
|
|
10870
|
+
if (u > f && (u = f), s.lastFrameTime > 0 && u > Td * Ad ? (s.totalDroppedFrames++, s.consecutiveDroppedFrames++, s.lastDropTimestamp = a) : s.lastFrameTime > 0 && (s.consecutiveDroppedFrames = 0), s.lastFrameTime = o, s.dirty) {
|
|
10871
10871
|
s.dirty = !1, s.callback(u);
|
|
10872
10872
|
const l = gn.get(i);
|
|
10873
10873
|
l && l.callback && l.dirty && (l.rafId = requestAnimationFrame(r));
|
|
@@ -10878,7 +10878,7 @@ function ua(e, t) {
|
|
|
10878
10878
|
running: !0
|
|
10879
10879
|
};
|
|
10880
10880
|
}
|
|
10881
|
-
function
|
|
10881
|
+
function Id(e) {
|
|
10882
10882
|
const t = gn.get(e.id);
|
|
10883
10883
|
if (!t)
|
|
10884
10884
|
throw new Error("Invalid scheduler state. Use createRenderScheduler() to create a new state.");
|
|
@@ -10887,21 +10887,21 @@ function Td(e) {
|
|
|
10887
10887
|
running: !1
|
|
10888
10888
|
};
|
|
10889
10889
|
}
|
|
10890
|
-
function
|
|
10890
|
+
function Pd(e) {
|
|
10891
10891
|
const t = gn.get(e.id);
|
|
10892
10892
|
if (!t)
|
|
10893
10893
|
throw new Error("Invalid scheduler state. Use createRenderScheduler() to create a new state.");
|
|
10894
10894
|
t.dirty = !0, t.callback !== null && t.rafId === null && (t.lastFrameTime = performance.now(), t.frameHandler && (t.rafId = requestAnimationFrame(t.frameHandler)));
|
|
10895
10895
|
}
|
|
10896
|
-
function
|
|
10896
|
+
function Rd(e) {
|
|
10897
10897
|
const t = gn.get(e.id);
|
|
10898
10898
|
return t && (t.rafId !== null && (cancelAnimationFrame(t.rafId), t.rafId = null), t.callback = null, t.frameHandler = null, gn.delete(e.id)), ro();
|
|
10899
10899
|
}
|
|
10900
|
-
function
|
|
10900
|
+
function em(e) {
|
|
10901
10901
|
const t = ro();
|
|
10902
|
-
return
|
|
10902
|
+
return da(t, e);
|
|
10903
10903
|
}
|
|
10904
|
-
class
|
|
10904
|
+
class tm {
|
|
10905
10905
|
/**
|
|
10906
10906
|
* Checks if the scheduler is currently running.
|
|
10907
10907
|
*/
|
|
@@ -10921,34 +10921,34 @@ class Qd {
|
|
|
10921
10921
|
* @throws {Error} If callback is not provided or scheduler already running
|
|
10922
10922
|
*/
|
|
10923
10923
|
start(t) {
|
|
10924
|
-
this._state =
|
|
10924
|
+
this._state = da(this._state, t);
|
|
10925
10925
|
}
|
|
10926
10926
|
/**
|
|
10927
10927
|
* Stops the render loop.
|
|
10928
10928
|
*/
|
|
10929
10929
|
stop() {
|
|
10930
|
-
this._state =
|
|
10930
|
+
this._state = Id(this._state);
|
|
10931
10931
|
}
|
|
10932
10932
|
/**
|
|
10933
10933
|
* Marks the current frame as dirty, indicating it needs to be rendered.
|
|
10934
10934
|
*/
|
|
10935
10935
|
requestRender() {
|
|
10936
|
-
|
|
10936
|
+
Pd(this._state);
|
|
10937
10937
|
}
|
|
10938
10938
|
/**
|
|
10939
10939
|
* Destroys the render scheduler and cleans up resources.
|
|
10940
10940
|
* After calling destroy(), the scheduler must be recreated before use.
|
|
10941
10941
|
*/
|
|
10942
10942
|
destroy() {
|
|
10943
|
-
this._state =
|
|
10943
|
+
this._state = Rd(this._state);
|
|
10944
10944
|
}
|
|
10945
10945
|
}
|
|
10946
|
-
const
|
|
10947
|
-
let t =
|
|
10946
|
+
const Dd = 0xcbf29ce484222325n, Ed = 0x100000001b3n, Bd = 0xffffffffffffffffn, Ld = (e) => {
|
|
10947
|
+
let t = Dd;
|
|
10948
10948
|
for (let n = 0; n < e.length; n++)
|
|
10949
|
-
t ^= BigInt(e.charCodeAt(n)), t = BigInt(t *
|
|
10949
|
+
t ^= BigInt(e.charCodeAt(n)), t = BigInt(t * Ed) & Bd;
|
|
10950
10950
|
return t.toString(16).padStart(16, "0");
|
|
10951
|
-
},
|
|
10951
|
+
}, _d = 15, Je = (e, t) => {
|
|
10952
10952
|
e.push(t, "|");
|
|
10953
10953
|
}, je = (e, t) => {
|
|
10954
10954
|
e.push("s", String(t.length), ":", t, "|");
|
|
@@ -10956,7 +10956,7 @@ const Pd = 0xcbf29ce484222325n, Rd = 0x100000001b3n, Dd = 0xffffffffffffffffn, E
|
|
|
10956
10956
|
e.push("n", String(t), "|");
|
|
10957
10957
|
}, oo = (e, t) => {
|
|
10958
10958
|
e.push(t ? "t|" : "f|");
|
|
10959
|
-
},
|
|
10959
|
+
}, ma = (e) => {
|
|
10960
10960
|
e.push("0|");
|
|
10961
10961
|
}, Or = (e, t) => {
|
|
10962
10962
|
if (!t) {
|
|
@@ -10975,7 +10975,7 @@ const Pd = 0xcbf29ce484222325n, Rd = 0x100000001b3n, Dd = 0xffffffffffffffffn, E
|
|
|
10975
10975
|
const o = t[r];
|
|
10976
10976
|
Pt(e, o);
|
|
10977
10977
|
}
|
|
10978
|
-
},
|
|
10978
|
+
}, Ud = (e, t) => e < t ? -1 : e > t ? 1 : 0, kd = (e, t) => {
|
|
10979
10979
|
if (!t || t.length === 0) {
|
|
10980
10980
|
Je(e, "B0");
|
|
10981
10981
|
return;
|
|
@@ -10997,19 +10997,19 @@ const Pd = 0xcbf29ce484222325n, Rd = 0x100000001b3n, Dd = 0xffffffffffffffffn, E
|
|
|
10997
10997
|
Je(e, "A0");
|
|
10998
10998
|
continue;
|
|
10999
10999
|
}
|
|
11000
|
-
o.sort((s, a) => s.shaderLocation !== a.shaderLocation ? s.shaderLocation - a.shaderLocation : s.offset !== a.offset ? s.offset - a.offset :
|
|
11000
|
+
o.sort((s, a) => s.shaderLocation !== a.shaderLocation ? s.shaderLocation - a.shaderLocation : s.offset !== a.offset ? s.offset - a.offset : Ud(s.format, a.format)), Je(e, "A1"), Pt(e, o.length);
|
|
11001
11001
|
for (let s = 0; s < o.length; s++) {
|
|
11002
11002
|
const a = o[s];
|
|
11003
11003
|
Pt(e, a.shaderLocation), Pt(e, a.offset), je(e, a.format);
|
|
11004
11004
|
}
|
|
11005
11005
|
}
|
|
11006
|
-
},
|
|
11006
|
+
}, Gd = (e, t) => {
|
|
11007
11007
|
if (!t) {
|
|
11008
11008
|
Je(e, "BL0");
|
|
11009
11009
|
return;
|
|
11010
11010
|
}
|
|
11011
11011
|
Je(e, "BL1"), je(e, t.color.operation), je(e, t.color.srcFactor), je(e, t.color.dstFactor), je(e, t.alpha.operation), je(e, t.alpha.srcFactor), je(e, t.alpha.dstFactor);
|
|
11012
|
-
},
|
|
11012
|
+
}, zd = (e, t) => {
|
|
11013
11013
|
if (!t || t.length === 0) {
|
|
11014
11014
|
Je(e, "T0");
|
|
11015
11015
|
return;
|
|
@@ -11018,33 +11018,33 @@ const Pd = 0xcbf29ce484222325n, Rd = 0x100000001b3n, Dd = 0xffffffffffffffffn, E
|
|
|
11018
11018
|
for (let n = 0; n < t.length; n++) {
|
|
11019
11019
|
const i = t[n];
|
|
11020
11020
|
if (!i) {
|
|
11021
|
-
|
|
11021
|
+
ma(e);
|
|
11022
11022
|
continue;
|
|
11023
11023
|
}
|
|
11024
|
-
je(e, i.format),
|
|
11025
|
-
const r = i.writeMask ??
|
|
11024
|
+
je(e, i.format), Gd(e, i.blend);
|
|
11025
|
+
const r = i.writeMask ?? _d;
|
|
11026
11026
|
Pt(e, r);
|
|
11027
11027
|
}
|
|
11028
|
-
},
|
|
11028
|
+
}, Vd = (e, t) => {
|
|
11029
11029
|
const n = (t == null ? void 0 : t.topology) ?? "triangle-list", i = (t == null ? void 0 : t.stripIndexFormat) ?? null, r = (t == null ? void 0 : t.frontFace) ?? "ccw", o = (t == null ? void 0 : t.cullMode) ?? "none", s = (t == null ? void 0 : t.unclippedDepth) ?? !1;
|
|
11030
|
-
je(e, n), i == null ?
|
|
11031
|
-
},
|
|
11030
|
+
je(e, n), i == null ? ma(e) : je(e, i), je(e, r), je(e, o), oo(e, s);
|
|
11031
|
+
}, Wd = (e, t) => {
|
|
11032
11032
|
const n = (t == null ? void 0 : t.count) ?? 1, i = (t == null ? void 0 : t.mask) ?? 4294967295, r = (t == null ? void 0 : t.alphaToCoverageEnabled) ?? !1;
|
|
11033
11033
|
Pt(e, n), Pt(e, i), oo(e, r);
|
|
11034
|
-
},
|
|
11034
|
+
}, Vs = (e, t) => {
|
|
11035
11035
|
if (!t) {
|
|
11036
11036
|
Je(e, "SF0");
|
|
11037
11037
|
return;
|
|
11038
11038
|
}
|
|
11039
11039
|
Je(e, "SF1"), je(e, t.compare), je(e, t.failOp), je(e, t.depthFailOp), je(e, t.passOp);
|
|
11040
|
-
},
|
|
11040
|
+
}, Od = (e, t) => {
|
|
11041
11041
|
if (!t) {
|
|
11042
11042
|
Je(e, "DS0");
|
|
11043
11043
|
return;
|
|
11044
11044
|
}
|
|
11045
|
-
Je(e, "DS1"), je(e, t.format), oo(e, t.depthWriteEnabled ?? !1), je(e, t.depthCompare ?? "always"),
|
|
11045
|
+
Je(e, "DS1"), je(e, t.format), oo(e, t.depthWriteEnabled ?? !1), je(e, t.depthCompare ?? "always"), Vs(e, t.stencilFront), Vs(e, t.stencilBack), Pt(e, t.stencilReadMask ?? 4294967295), Pt(e, t.stencilWriteMask ?? 4294967295), Pt(e, t.depthBias ?? 0), Pt(e, t.depthBiasSlopeScale ?? 0), Pt(e, t.depthBiasClamp ?? 0);
|
|
11046
11046
|
};
|
|
11047
|
-
function
|
|
11047
|
+
function nm(e) {
|
|
11048
11048
|
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
11049
11049
|
let r = 0, o = 0, s = 0, a = 0, u = 0, f = 0, l = 0, g = 0, c = 0, h = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), w = 0, P = 0;
|
|
11050
11050
|
const R = (M) => {
|
|
@@ -11099,13 +11099,13 @@ function em(e) {
|
|
|
11099
11099
|
s++;
|
|
11100
11100
|
const S = e.createShaderModule({ code: M, label: I });
|
|
11101
11101
|
t.set(M, S);
|
|
11102
|
-
const p = `wgsl:${
|
|
11102
|
+
const p = `wgsl:${Ld(M)}:${M.length}`;
|
|
11103
11103
|
return h.set(S, p), S;
|
|
11104
11104
|
},
|
|
11105
11105
|
getOrCreateRenderPipeline: (M) => {
|
|
11106
11106
|
a++;
|
|
11107
11107
|
const I = M.layout ?? "auto", A = I === "auto" ? "auto" : T(I), S = M.vertex, p = M.fragment, y = [];
|
|
11108
|
-
Je(y, "rp1"), Je(y, "L"), je(y, A), Je(y, "V"), je(y, R(S.module)), je(y, S.entryPoint ?? ""), Or(y, S.constants),
|
|
11108
|
+
Je(y, "rp1"), Je(y, "L"), je(y, A), Je(y, "V"), je(y, R(S.module)), je(y, S.entryPoint ?? ""), Or(y, S.constants), kd(y, S.buffers), Je(y, "F"), p ? (Je(y, "F1"), je(y, R(p.module)), je(y, p.entryPoint ?? ""), Or(y, p.constants), zd(y, p.targets)) : Je(y, "F0"), Je(y, "P"), Vd(y, M.primitive), Od(y, M.depthStencil), Je(y, "M"), Wd(y, M.multisample);
|
|
11109
11109
|
const F = y.join(""), N = n.get(F);
|
|
11110
11110
|
if (N)
|
|
11111
11111
|
return u++, N;
|
|
@@ -11126,44 +11126,44 @@ function em(e) {
|
|
|
11126
11126
|
}
|
|
11127
11127
|
};
|
|
11128
11128
|
}
|
|
11129
|
-
function
|
|
11129
|
+
function im(e) {
|
|
11130
11130
|
return e.getStats();
|
|
11131
11131
|
}
|
|
11132
|
-
function
|
|
11132
|
+
function rm(e) {
|
|
11133
11133
|
e.clear();
|
|
11134
11134
|
}
|
|
11135
|
-
const
|
|
11135
|
+
const om = "1.0.0", sm = bd;
|
|
11136
11136
|
export {
|
|
11137
|
-
|
|
11137
|
+
sm as ChartGPU,
|
|
11138
11138
|
to as GPUContext,
|
|
11139
|
-
|
|
11140
|
-
|
|
11139
|
+
Kd as OptionResolver,
|
|
11140
|
+
tm as RenderScheduler,
|
|
11141
11141
|
jt as candlestickDefaults,
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11142
|
+
xa as clearScreen,
|
|
11143
|
+
Jd as connectCharts,
|
|
11144
|
+
Qd as createAnnotationAuthoring,
|
|
11145
|
+
jd as createCategoryScale,
|
|
11146
|
+
xd as createChart,
|
|
11147
|
+
Os as createGPUContext,
|
|
11148
|
+
Zd as createGPUContextAsync,
|
|
11149
11149
|
hn as createLinearScale,
|
|
11150
|
-
|
|
11150
|
+
nm as createPipelineCache,
|
|
11151
11151
|
ro as createRenderScheduler,
|
|
11152
|
-
|
|
11153
|
-
|
|
11152
|
+
em as createRenderSchedulerAsync,
|
|
11153
|
+
Gf as darkTheme,
|
|
11154
11154
|
Bt as defaultOptions,
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11155
|
+
ba as destroyGPUContext,
|
|
11156
|
+
rm as destroyPipelineCache,
|
|
11157
|
+
Rd as destroyRenderScheduler,
|
|
11158
|
+
$s as getCanvasTexture,
|
|
11159
|
+
im as getPipelineCacheStats,
|
|
11160
11160
|
zr as getTheme,
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11161
|
+
Xs as initializeGPUContext,
|
|
11162
|
+
Vf as lightTheme,
|
|
11163
|
+
Pd as requestRender,
|
|
11164
|
+
ua as resolveOptions,
|
|
11165
|
+
da as startRenderScheduler,
|
|
11166
|
+
Id as stopRenderScheduler,
|
|
11167
|
+
om as version
|
|
11168
11168
|
};
|
|
11169
11169
|
//# sourceMappingURL=index.js.map
|