@tradecanvas/core 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{WebGLSeriesRenderer-CLVnGxIS.js → WebGLSeriesRenderer-BNrnoMHq.js} +182 -179
- package/dist/{WebGLSeriesRenderer-CLVnGxIS.js.map → WebGLSeriesRenderer-BNrnoMHq.js.map} +1 -1
- package/dist/WebGLSeriesRenderer-Bclv4lzZ.cjs +429 -0
- package/dist/{WebGLSeriesRenderer-rB3-CqXS.cjs.map → WebGLSeriesRenderer-Bclv4lzZ.cjs.map} +1 -1
- package/dist/axis/GridRenderer.d.ts +11 -1
- package/dist/axis/GridRenderer.d.ts.map +1 -1
- package/dist/charts/BaselineRenderer.d.ts.map +1 -1
- package/dist/engine/RenderEngine.d.ts +3 -1
- package/dist/engine/RenderEngine.d.ts.map +1 -1
- package/dist/features/ChartState.d.ts +10 -3
- package/dist/features/ChartState.d.ts.map +1 -1
- package/dist/features/ReplayManager.d.ts +56 -1
- package/dist/features/ReplayManager.d.ts.map +1 -1
- package/dist/features/SignalMarkerManager.d.ts +8 -0
- package/dist/features/SignalMarkerManager.d.ts.map +1 -1
- package/dist/features/TradeZoneManager.d.ts +8 -0
- package/dist/features/TradeZoneManager.d.ts.map +1 -1
- package/dist/features/replayReveal.d.ts +14 -0
- package/dist/features/replayReveal.d.ts.map +1 -0
- package/dist/{gridLines-ovHZBvAe.js → gpuContexts-Bn58hj7u.js} +149 -88
- package/dist/gpuContexts-Bn58hj7u.js.map +1 -0
- package/dist/gpuContexts-DYrOp3uo.cjs +2 -0
- package/dist/gpuContexts-DYrOp3uo.cjs.map +1 -0
- package/dist/index.cjs +5 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2730 -2518
- package/dist/index.js.map +1 -1
- package/dist/indicators/IndicatorBase.d.ts +6 -1
- package/dist/indicators/IndicatorBase.d.ts.map +1 -1
- package/dist/indicators/IndicatorEngine.d.ts +14 -2
- package/dist/indicators/IndicatorEngine.d.ts.map +1 -1
- package/dist/indicators/index.d.ts +1 -1
- package/dist/indicators/index.d.ts.map +1 -1
- package/dist/indicators/linePen.d.ts +5 -1
- package/dist/indicators/linePen.d.ts.map +1 -1
- package/dist/indicators/overlay/Alligator.d.ts.map +1 -1
- package/dist/indicators/overlay/AnchoredVWAP.d.ts.map +1 -1
- package/dist/indicators/overlay/BollingerBands.d.ts.map +1 -1
- package/dist/indicators/overlay/ChandelierExit.d.ts.map +1 -1
- package/dist/indicators/overlay/DonchianChannel.d.ts.map +1 -1
- package/dist/indicators/overlay/EMA.d.ts.map +1 -1
- package/dist/indicators/overlay/Envelope.d.ts.map +1 -1
- package/dist/indicators/overlay/HullMA.d.ts.map +1 -1
- package/dist/indicators/overlay/Ichimoku.d.ts.map +1 -1
- package/dist/indicators/overlay/KeltnerChannel.d.ts.map +1 -1
- package/dist/indicators/overlay/LinearRegressionChannel.d.ts.map +1 -1
- package/dist/indicators/overlay/MAChannel.d.ts.map +1 -1
- package/dist/indicators/overlay/MTFMovingAverage.d.ts.map +1 -1
- package/dist/indicators/overlay/ParabolicSAR.d.ts.map +1 -1
- package/dist/indicators/overlay/PivotPoints.d.ts.map +1 -1
- package/dist/indicators/overlay/SMA.d.ts.map +1 -1
- package/dist/indicators/overlay/SessionVWAP.d.ts.map +1 -1
- package/dist/indicators/overlay/Supertrend.d.ts.map +1 -1
- package/dist/indicators/overlay/TEMA.d.ts.map +1 -1
- package/dist/indicators/overlay/VWAP.d.ts.map +1 -1
- package/dist/indicators/overlay/VWMA.d.ts.map +1 -1
- package/dist/indicators/overlay/WMA.d.ts.map +1 -1
- package/dist/indicators/overlay/ZigZag.d.ts.map +1 -1
- package/dist/indicators/panel/ChopZone.d.ts +1 -1
- package/dist/indicators/panel/ChopZone.d.ts.map +1 -1
- package/dist/indicators/panel/ElderRay.d.ts.map +1 -1
- package/dist/indicators/plots.d.ts +10 -0
- package/dist/indicators/plots.d.ts.map +1 -1
- package/dist/interaction/CrosshairHandler.d.ts.map +1 -1
- package/dist/interaction/PinnedTooltip.d.ts.map +1 -1
- package/dist/interaction/crosshairLooks.d.ts +7 -0
- package/dist/interaction/crosshairLooks.d.ts.map +1 -0
- package/dist/realtime/CurrentPriceLine.d.ts.map +1 -1
- package/dist/ui/ChartLegend.d.ts.map +1 -1
- package/dist/ui/SessionBreaks.d.ts +2 -0
- package/dist/ui/SessionBreaks.d.ts.map +1 -1
- package/dist/webgl/WebGLSeriesRenderer.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/WebGLSeriesRenderer-rB3-CqXS.cjs +0 -429
- package/dist/gridLines-CVQJ3gzb.cjs +0 -2
- package/dist/gridLines-CVQJ3gzb.cjs.map +0 -1
- package/dist/gridLines-ovHZBvAe.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as e, d as t, f as n,
|
|
2
|
-
import { resolveVolumeColors as
|
|
3
|
-
var
|
|
1
|
+
import { c as e, d as t, f as n, h as r, l as i, m as a, n as o } from "./gpuContexts-Bn58hj7u.js";
|
|
2
|
+
import { resolveVolumeColors as s } from "@tradecanvas/commons";
|
|
3
|
+
var c = (e, t) => e.time === t.time && e.open === t.open && e.high === t.high && e.low === t.low && e.close === t.close && e.volume === t.volume, l = class {
|
|
4
4
|
buffer = new Float32Array();
|
|
5
5
|
count = 0;
|
|
6
6
|
basePrice = 0;
|
|
@@ -24,12 +24,12 @@ var s = (e, t) => e.time === t.time && e.open === t.open && e.high === t.high &&
|
|
|
24
24
|
to: 0
|
|
25
25
|
};
|
|
26
26
|
let n = this.count;
|
|
27
|
-
if (!(e === this.source && n > 0 && t >= n && this.samples.every(({ index: t, bar: n }) =>
|
|
27
|
+
if (!(e === this.source && n > 0 && t >= n && this.samples.every(({ index: t, bar: n }) => c(e[t], n)))) return this.basePrice = e[t - 1].close, this.ensure(t), this.write(e, 0, t), this.remember(e), {
|
|
28
28
|
full: !0,
|
|
29
29
|
from: 0,
|
|
30
30
|
to: t
|
|
31
31
|
};
|
|
32
|
-
let r = this.last !== null &&
|
|
32
|
+
let r = this.last !== null && c(e[n - 1], this.last) ? n : n - 1;
|
|
33
33
|
return t > this.buffer.length / 6 ? (this.ensure(t), this.write(e, 0, t), this.remember(e), {
|
|
34
34
|
full: !0,
|
|
35
35
|
from: 0,
|
|
@@ -62,11 +62,11 @@ var s = (e, t) => e.time === t.time && e.open === t.open && e.high === t.high &&
|
|
|
62
62
|
bar: { ...e[t] }
|
|
63
63
|
})), this.last = { ...e[t - 1] }, this.source = e;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
function
|
|
65
|
+
}, u = /* @__PURE__ */ new Map(), d;
|
|
66
|
+
function f(e, t) {
|
|
67
67
|
return e.endsWith("%") ? parseFloat(e) / 100 : parseFloat(e) / t;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function p(e) {
|
|
70
70
|
let t = e.trim();
|
|
71
71
|
if (t.toLowerCase() === "transparent") return [
|
|
72
72
|
0,
|
|
@@ -88,28 +88,28 @@ function f(e) {
|
|
|
88
88
|
}
|
|
89
89
|
let r = /^rgba?\(\s*([\d.]+%?)[\s,]+([\d.]+%?)[\s,]+([\d.]+%?)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/i.exec(t);
|
|
90
90
|
return r ? [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
r[4] === void 0 ? 1 :
|
|
91
|
+
f(r[1], 255),
|
|
92
|
+
f(r[2], 255),
|
|
93
|
+
f(r[3], 255),
|
|
94
|
+
r[4] === void 0 ? 1 : f(r[4], 1)
|
|
95
95
|
] : null;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
97
|
+
function m() {
|
|
98
|
+
if (d !== void 0) return d;
|
|
99
99
|
try {
|
|
100
|
-
|
|
100
|
+
d = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1).getContext("2d") : typeof document < "u" ? document.createElement("canvas").getContext("2d") : null;
|
|
101
101
|
} catch {
|
|
102
|
-
|
|
102
|
+
d = null;
|
|
103
103
|
}
|
|
104
|
-
return
|
|
104
|
+
return d;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
let t =
|
|
106
|
+
function h(e) {
|
|
107
|
+
let t = m();
|
|
108
108
|
if (!t) return null;
|
|
109
109
|
t.fillStyle = "#000", t.fillStyle = e;
|
|
110
110
|
let n = String(t.fillStyle);
|
|
111
111
|
if (t.fillStyle = "#fff", t.fillStyle = e, String(t.fillStyle) !== n) return null;
|
|
112
|
-
let r =
|
|
112
|
+
let r = p(n);
|
|
113
113
|
if (r) return r;
|
|
114
114
|
t.clearRect(0, 0, 1, 1), t.fillRect(0, 0, 1, 1);
|
|
115
115
|
let i = t.getImageData(0, 0, 1, 1).data;
|
|
@@ -120,23 +120,23 @@ function m(e) {
|
|
|
120
120
|
i[3] / 255
|
|
121
121
|
];
|
|
122
122
|
}
|
|
123
|
-
var
|
|
124
|
-
function
|
|
125
|
-
let t =
|
|
123
|
+
var g = /* @__PURE__ */ new Set();
|
|
124
|
+
function _(e) {
|
|
125
|
+
let t = u.get(e);
|
|
126
126
|
if (t) return t;
|
|
127
|
-
if (
|
|
128
|
-
let n =
|
|
129
|
-
return
|
|
127
|
+
if (g.has(e)) return null;
|
|
128
|
+
let n = p(e) ?? h(e);
|
|
129
|
+
return u.size > 256 && u.clear(), g.size > 256 && g.clear(), n ? u.set(e, n) : g.add(e), n;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
return
|
|
131
|
+
function v(e) {
|
|
132
|
+
return _(e) ?? [
|
|
133
133
|
0,
|
|
134
134
|
0,
|
|
135
135
|
0,
|
|
136
136
|
0
|
|
137
137
|
];
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function y([e, t, n, r]) {
|
|
140
140
|
return [
|
|
141
141
|
e * r,
|
|
142
142
|
t * r,
|
|
@@ -146,7 +146,7 @@ function v([e, t, n, r]) {
|
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
//#region src/webgl/yMapping.ts
|
|
149
|
-
function
|
|
149
|
+
function b(e, t) {
|
|
150
150
|
let { min: n, max: r } = e.priceRange, { y: i, height: a } = e.chartRect, o = +(e.invertScale === !0), s = {
|
|
151
151
|
log: 0,
|
|
152
152
|
invert: o,
|
|
@@ -185,7 +185,7 @@ function ee(e, t) {
|
|
|
185
185
|
}
|
|
186
186
|
//#endregion
|
|
187
187
|
//#region src/webgl/glKit.ts
|
|
188
|
-
var
|
|
188
|
+
var x = class {
|
|
189
189
|
constructor(e) {
|
|
190
190
|
this.gl = e;
|
|
191
191
|
}
|
|
@@ -253,16 +253,16 @@ var te = class {
|
|
|
253
253
|
};
|
|
254
254
|
//#endregion
|
|
255
255
|
//#region src/webgl/polygonSpans.ts
|
|
256
|
-
function
|
|
256
|
+
function ee(e) {
|
|
257
257
|
let t = e.length / 2;
|
|
258
258
|
if (t < 3) return [];
|
|
259
259
|
let n = 0, r = 0;
|
|
260
260
|
for (let i = 1; i < t; i++) e[2 * i] < e[2 * n] && (n = i), e[2 * i] > e[2 * r] && (r = i);
|
|
261
261
|
if (e[2 * n] === e[2 * r]) return [];
|
|
262
|
-
let i =
|
|
263
|
-
return !i || !a ? null :
|
|
262
|
+
let i = C(e, n, r, 1, t), a = C(e, n, r, -1, t);
|
|
263
|
+
return !i || !a ? null : ne(i, a);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function S(e) {
|
|
266
266
|
let t = 0, n = e.length / 2;
|
|
267
267
|
for (let r = 0; r < n; r++) {
|
|
268
268
|
let i = (r + 1) % n;
|
|
@@ -270,7 +270,7 @@ function y(e) {
|
|
|
270
270
|
}
|
|
271
271
|
return t / 2;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function C(e, t, n, r, i) {
|
|
274
274
|
let a = [e[2 * t], e[2 * t + 1]];
|
|
275
275
|
for (let o = t; o !== n;) {
|
|
276
276
|
if (o = (o + r + i) % i, e[2 * o] < a[a.length - 2]) return null;
|
|
@@ -278,7 +278,7 @@ function b(e, t, n, r, i) {
|
|
|
278
278
|
}
|
|
279
279
|
return a;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var te = class {
|
|
282
282
|
i = 0;
|
|
283
283
|
constructor(e) {
|
|
284
284
|
this.c = e;
|
|
@@ -290,11 +290,11 @@ var x = class {
|
|
|
290
290
|
return [s(e), s(t)];
|
|
291
291
|
}
|
|
292
292
|
};
|
|
293
|
-
function
|
|
293
|
+
function ne(e, t) {
|
|
294
294
|
let n = /* @__PURE__ */ new Set();
|
|
295
295
|
for (let t = 0; t < e.length; t += 2) n.add(e[t]);
|
|
296
296
|
for (let e = 0; e < t.length; e += 2) n.add(t[e]);
|
|
297
|
-
let r = [...n].sort((e, t) => e - t), i = new
|
|
297
|
+
let r = [...n].sort((e, t) => e - t), i = new te(e), a = new te(t), o = [], s = r.length - 2;
|
|
298
298
|
for (let e = 0; e <= s; e++) {
|
|
299
299
|
let t = r[e], n = r[e + 1], [c, l] = i.at(t, n), [u, d] = a.at(t, n);
|
|
300
300
|
c === u && l === d || o.push(t, n, c, l, u, d, +(e === 0), +(e === s));
|
|
@@ -303,7 +303,7 @@ function re(e, t) {
|
|
|
303
303
|
}
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region src/webgl/recordedShaders.ts
|
|
306
|
-
var
|
|
306
|
+
var w = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform vec4 u_clip;\n\nvec4 toClip(vec2 dev) {\n return vec4(dev.x / u_canvas.x * 2.0 - 1.0, 1.0 - dev.y / u_canvas.y * 2.0, 0.0, 1.0);\n}\n", T = "\nvec2 corner(int k) {\n if (k == 0) return vec2(0.0, 0.0);\n if (k == 1 || k == 4) return vec2(1.0, 0.0);\n if (k == 2 || k == 3) return vec2(0.0, 1.0);\n return vec2(1.0, 1.0);\n}\nconst vec4 NOWHERE = vec4(-2.0, -2.0, 0.0, 1.0);\n", E = "\n// This fragment's pixel centre in device pixels, y down.\nvec2 pixelCentre() { return vec2(gl_FragCoord.x, u_canvas.y - gl_FragCoord.y); }\n\n// The share of the pixel centred at p inside the clip.\nfloat clipCoverage(vec2 p) {\n vec2 lo = p - 0.5;\n vec2 c = clamp(min(lo + 1.0, u_clip.zw) - max(lo, u_clip.xy), 0.0, 1.0);\n return c.x * c.y;\n}\n", re = `${w}${T}
|
|
307
307
|
uniform float u_hw;
|
|
308
308
|
in vec4 a_p0;
|
|
309
309
|
in vec4 a_p1;
|
|
@@ -332,7 +332,7 @@ void main() {
|
|
|
332
332
|
vec2 pos = mix(a - dir * m, b + dir * m, cr.x) + n * mix(-m, m, cr.y);
|
|
333
333
|
gl_Position = toClip(pos);
|
|
334
334
|
}
|
|
335
|
-
`,
|
|
335
|
+
`, ie = `${w}${E}
|
|
336
336
|
uniform vec4 u_color;
|
|
337
337
|
uniform float u_hw;
|
|
338
338
|
uniform int u_cap;
|
|
@@ -411,7 +411,7 @@ void main() {
|
|
|
411
411
|
if (cov <= 0.0) discard;
|
|
412
412
|
outColor = u_color * (cov * clipCov);
|
|
413
413
|
}
|
|
414
|
-
`,
|
|
414
|
+
`, ae = `${w}${T}
|
|
415
415
|
in vec2 a_x;
|
|
416
416
|
in vec4 a_ab;
|
|
417
417
|
in vec2 a_ends;
|
|
@@ -428,7 +428,7 @@ void main() {
|
|
|
428
428
|
vec2 cr = corner(gl_VertexID % 6);
|
|
429
429
|
gl_Position = toClip(mix(vec2(floor(a_x.x), floor(lo) - 1.0), vec2(ceil(a_x.y), ceil(hi) + 1.0), cr));
|
|
430
430
|
}
|
|
431
|
-
`,
|
|
431
|
+
`, oe = `${w}${E}
|
|
432
432
|
uniform int u_kind;
|
|
433
433
|
uniform vec4 u_color;
|
|
434
434
|
uniform vec4 u_line;
|
|
@@ -486,7 +486,7 @@ void main() {
|
|
|
486
486
|
vec4 color = u_kind == 1 ? gradient(p) : u_color;
|
|
487
487
|
outColor = color * cov;
|
|
488
488
|
}
|
|
489
|
-
`,
|
|
489
|
+
`, se = `${w}${T}
|
|
490
490
|
in vec3 a_disc;
|
|
491
491
|
in vec4 a_color;
|
|
492
492
|
flat out vec3 v_disc;
|
|
@@ -497,7 +497,7 @@ void main() {
|
|
|
497
497
|
float m = a_disc.z + 1.0;
|
|
498
498
|
gl_Position = toClip(mix(a_disc.xy - m, a_disc.xy + m, corner(gl_VertexID % 6)));
|
|
499
499
|
}
|
|
500
|
-
`,
|
|
500
|
+
`, ce = `${w}${E}
|
|
501
501
|
flat in vec3 v_disc;
|
|
502
502
|
flat in vec4 v_color;
|
|
503
503
|
out vec4 outColor;
|
|
@@ -507,24 +507,24 @@ void main() {
|
|
|
507
507
|
if (cov <= 0.0) discard;
|
|
508
508
|
outColor = v_color * cov;
|
|
509
509
|
}
|
|
510
|
-
`,
|
|
510
|
+
`, D = 4, O = D * 4, k = 32, A = 7, j = A * 4, le = class {
|
|
511
511
|
stroke;
|
|
512
512
|
span;
|
|
513
513
|
disc;
|
|
514
514
|
buffer;
|
|
515
515
|
constructor(e) {
|
|
516
|
-
this.kit = e, this.stroke = e.program(
|
|
516
|
+
this.kit = e, this.stroke = e.program(re, ie, [
|
|
517
517
|
"a_p0",
|
|
518
518
|
"a_p1",
|
|
519
519
|
"a_p2",
|
|
520
520
|
"a_p3",
|
|
521
521
|
"a_p4",
|
|
522
522
|
"a_p5"
|
|
523
|
-
]), this.span = e.program(
|
|
523
|
+
]), this.span = e.program(ae, oe, [
|
|
524
524
|
"a_x",
|
|
525
525
|
"a_ab",
|
|
526
526
|
"a_ends"
|
|
527
|
-
]), this.disc = e.program(
|
|
527
|
+
]), this.disc = e.program(se, ce, ["a_disc", "a_color"]), this.buffer = e.buffer();
|
|
528
528
|
}
|
|
529
529
|
draw(e, t, n, r) {
|
|
530
530
|
let i = this.kit.gl;
|
|
@@ -577,8 +577,8 @@ void main() {
|
|
|
577
577
|
0,
|
|
578
578
|
0
|
|
579
579
|
]), this.upload(new Float32Array(e.points));
|
|
580
|
-
for (let e = 0; e < 6; e++) i.attrib(r, `a_p${e}`, 4,
|
|
581
|
-
let a = e.points.length /
|
|
580
|
+
for (let e = 0; e < 6; e++) i.attrib(r, `a_p${e}`, 4, O, e * O);
|
|
581
|
+
let a = e.points.length / D - 5;
|
|
582
582
|
a > 0 && i.gl.drawArraysInstanced(i.gl.TRIANGLES, 0, 6, a);
|
|
583
583
|
}
|
|
584
584
|
drawFill(e, t, n) {
|
|
@@ -590,7 +590,7 @@ void main() {
|
|
|
590
590
|
e.clip.y0,
|
|
591
591
|
Math.min(e.clip.x1, t),
|
|
592
592
|
Math.min(e.clip.y1, n)
|
|
593
|
-
]), this.upload(new Float32Array(e.spans)), r.attrib(a, "a_x", 2,
|
|
593
|
+
]), this.upload(new Float32Array(e.spans)), r.attrib(a, "a_x", 2, k, 0), r.attrib(a, "a_ab", 4, k, 8), r.attrib(a, "a_ends", 2, k, 24), this.paint(a, e.paint), r.gl.drawArraysInstanced(r.gl.TRIANGLES, 0, 6, e.spans.length / 8);
|
|
594
594
|
}
|
|
595
595
|
paint(e, t) {
|
|
596
596
|
let n = this.kit;
|
|
@@ -617,15 +617,15 @@ void main() {
|
|
|
617
617
|
}
|
|
618
618
|
drawDiscs(e, t, n, r) {
|
|
619
619
|
let i = this.disc;
|
|
620
|
-
this.common(i, t, n, r) && (this.upload(new Float32Array(e)), this.kit.attrib(i, "a_disc", 3,
|
|
620
|
+
this.common(i, t, n, r) && (this.upload(new Float32Array(e)), this.kit.attrib(i, "a_disc", 3, j, 0), this.kit.attrib(i, "a_color", 4, j, 12), this.kit.gl.drawArraysInstanced(this.kit.gl.TRIANGLES, 0, 6, e.length / A));
|
|
621
621
|
}
|
|
622
|
-
},
|
|
622
|
+
}, M = (e, t) => ({
|
|
623
623
|
x0: Math.max(e.x0, t.x0),
|
|
624
624
|
y0: Math.max(e.y0, t.y0),
|
|
625
625
|
x1: Math.min(e.x1, t.x1),
|
|
626
626
|
y1: Math.min(e.y1, t.y1)
|
|
627
|
-
}),
|
|
628
|
-
function
|
|
627
|
+
}), N = (e) => !(e.x1 > e.x0 && e.y1 > e.y0);
|
|
628
|
+
function P(e, t = 0) {
|
|
629
629
|
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
630
630
|
for (let t = 0; t < e.length; t += 2) {
|
|
631
631
|
let o = e[t], s = e[t + 1];
|
|
@@ -638,7 +638,7 @@ function M(e, t = 0) {
|
|
|
638
638
|
y1: a + t
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function F(e) {
|
|
642
642
|
let t = [...e].sort((e, t) => e.x0 - t.x0), n = [];
|
|
643
643
|
for (let e of t) {
|
|
644
644
|
for (let t = n.length - 1; t >= 0; t--) n[t].x1 <= e.x0 && n.splice(t, 1);
|
|
@@ -649,7 +649,7 @@ function N(e) {
|
|
|
649
649
|
}
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region src/webgl/recordedPath.ts
|
|
652
|
-
var
|
|
652
|
+
var I = class {
|
|
653
653
|
stops = [];
|
|
654
654
|
constructor(e, t, n, r) {
|
|
655
655
|
this.x0 = e, this.y0 = t, this.x1 = n, this.y1 = r;
|
|
@@ -661,14 +661,14 @@ var P = class {
|
|
|
661
661
|
color: t
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
|
-
},
|
|
664
|
+
}, L = typeof Path2D == "function" ? Path2D : class {}, R = class e extends L {
|
|
665
665
|
calls = [];
|
|
666
666
|
unsupported = !1;
|
|
667
667
|
constructor(t) {
|
|
668
668
|
super(t), t instanceof e ? (this.calls.push(...t.calls), this.unsupported = t.unsupported) : t !== void 0 && (this.unsupported = !0);
|
|
669
669
|
}
|
|
670
670
|
note(e, t, n = t) {
|
|
671
|
-
this.calls.push([e, t]),
|
|
671
|
+
this.calls.push([e, t]), L.prototype[e]?.apply(this, n);
|
|
672
672
|
}
|
|
673
673
|
unfollowed(e, t) {
|
|
674
674
|
this.unsupported = !0, this.note(e, [], t);
|
|
@@ -728,12 +728,12 @@ var P = class {
|
|
|
728
728
|
this.unfollowed("roundRect", e);
|
|
729
729
|
}
|
|
730
730
|
addPath(t, n) {
|
|
731
|
-
!(t instanceof e) || n !== void 0 ? this.unsupported = !0 : (this.calls.push(...t.calls), this.unsupported ||= t.unsupported),
|
|
731
|
+
!(t instanceof e) || n !== void 0 ? this.unsupported = !0 : (this.calls.push(...t.calls), this.unsupported ||= t.unsupported), L.prototype.addPath?.call(this, t, n);
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
function
|
|
734
|
+
function ue(e) {
|
|
735
735
|
let t = globalThis, n = Object.prototype.hasOwnProperty.call(t, "Path2D"), r = t.Path2D;
|
|
736
|
-
t.Path2D =
|
|
736
|
+
t.Path2D = R;
|
|
737
737
|
try {
|
|
738
738
|
e();
|
|
739
739
|
} finally {
|
|
@@ -742,24 +742,24 @@ function de(e) {
|
|
|
742
742
|
}
|
|
743
743
|
//#endregion
|
|
744
744
|
//#region src/webgl/strokeGeometry.ts
|
|
745
|
-
var
|
|
746
|
-
function
|
|
745
|
+
var de = .25;
|
|
746
|
+
function fe(e, t, n, r) {
|
|
747
747
|
if (n === "round") return !1;
|
|
748
748
|
let i = e.points, a = i.length / 2, o = +!e.closed, s = e.closed ? a : a - 1;
|
|
749
749
|
for (let e = o; e < s; e++) {
|
|
750
750
|
let o = (e - 1 + a) % a, s = (e + 1) % a, c = i[2 * e] - i[2 * o], l = i[2 * e + 1] - i[2 * o + 1], u = i[2 * s] - i[2 * e], d = i[2 * s + 1] - i[2 * e + 1], f = Math.hypot(c, l), p = Math.hypot(u, d);
|
|
751
751
|
if (f === 0 || p === 0) continue;
|
|
752
752
|
let m = Math.max(-1, Math.min(1, (c * u + l * d) / (f * p))), h = Math.sqrt((1 + m) / 2);
|
|
753
|
-
if ((n === "miter" && h > 0 && 1 / h <= r ? t * (1 / h - 1) : t * (1 - h)) >
|
|
753
|
+
if ((n === "miter" && h > 0 && 1 / h <= r ? t * (1 / h - 1) : t * (1 - h)) > de) return !0;
|
|
754
754
|
}
|
|
755
755
|
return !1;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function pe(e, t) {
|
|
758
758
|
let n = e.points;
|
|
759
759
|
for (let e = 2; e < n.length; e += 2) if (Math.hypot(n[e] - n[e - 2], n[e + 1] - n[e - 1]) < t) return !0;
|
|
760
760
|
return !1;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function me(e) {
|
|
763
763
|
let t = [], n = () => t.push(0, 0, -1, 0);
|
|
764
764
|
n(), n();
|
|
765
765
|
for (let { points: r, closed: i } of e) {
|
|
@@ -773,12 +773,12 @@ function he(e) {
|
|
|
773
773
|
}
|
|
774
774
|
//#endregion
|
|
775
775
|
//#region src/webgl/recorder.ts
|
|
776
|
-
var
|
|
777
|
-
function
|
|
776
|
+
var z = Math.PI * 2;
|
|
777
|
+
function he(e, t) {
|
|
778
778
|
let n = 2 * Math.sqrt(Math.max(.2 / Math.max(e, .1), 1e-6));
|
|
779
779
|
return Math.min(512, Math.max(4, Math.ceil(Math.abs(t) / Math.min(n, Math.PI / 4))));
|
|
780
780
|
}
|
|
781
|
-
var
|
|
781
|
+
var B = new Set([
|
|
782
782
|
"fillStyle",
|
|
783
783
|
"strokeStyle",
|
|
784
784
|
"lineWidth",
|
|
@@ -797,14 +797,14 @@ var R = new Set([
|
|
|
797
797
|
"shadowOffsetX",
|
|
798
798
|
"shadowOffsetY",
|
|
799
799
|
"filter"
|
|
800
|
-
]),
|
|
800
|
+
]), V = new Set([
|
|
801
801
|
"fontKerning",
|
|
802
802
|
"fontStretch",
|
|
803
803
|
"fontVariantCaps",
|
|
804
804
|
"letterSpacing",
|
|
805
805
|
"wordSpacing",
|
|
806
806
|
"textRendering"
|
|
807
|
-
]),
|
|
807
|
+
]), H = new Set(["imageSmoothingEnabled", "imageSmoothingQuality"]), U = (e) => !!(e.rect || e.circle) || e.points.length >= 6, ge = class {
|
|
808
808
|
commands = [];
|
|
809
809
|
ctx;
|
|
810
810
|
texts = [];
|
|
@@ -839,13 +839,13 @@ var R = new Set([
|
|
|
839
839
|
};
|
|
840
840
|
this.stepStart = t.commands, this.ok = !0;
|
|
841
841
|
try {
|
|
842
|
-
|
|
842
|
+
ue(() => e(this.ctx));
|
|
843
843
|
} catch {
|
|
844
844
|
this.ok = !1;
|
|
845
845
|
}
|
|
846
846
|
return this.ok ? !0 : (this.commands.length = t.commands, i.length = t.texts, !1);
|
|
847
847
|
},
|
|
848
|
-
drawText: (e) =>
|
|
848
|
+
drawText: (e) => _e(e, i)
|
|
849
849
|
};
|
|
850
850
|
}
|
|
851
851
|
reset(e) {
|
|
@@ -979,14 +979,14 @@ var R = new Set([
|
|
|
979
979
|
].every(Number.isFinite)) return;
|
|
980
980
|
if (n < 0) throw new DOMException("negative radius", "IndexSizeError");
|
|
981
981
|
let o = i - r;
|
|
982
|
-
o = !a && o >=
|
|
983
|
-
let s = this.current(), c = this.state.transform, l = e + n * Math.cos(r), u = t + n * Math.sin(r), d = !s || s.closed || s.points.length === 2 && Math.abs(s.points[0] - (c[0] * l + c[2] * u + c[4])) < 1e-6 && Math.abs(s.points[1] - (c[1] * l + c[3] * u + c[5])) < 1e-6, f =
|
|
982
|
+
o = !a && o >= z ? z : a && -o >= z ? -z : a ? -(((r - i) % z + z) % z) : (o % z + z) % z;
|
|
983
|
+
let s = this.current(), c = this.state.transform, l = e + n * Math.cos(r), u = t + n * Math.sin(r), d = !s || s.closed || s.points.length === 2 && Math.abs(s.points[0] - (c[0] * l + c[2] * u + c[4])) < 1e-6 && Math.abs(s.points[1] - (c[1] * l + c[3] * u + c[5])) < 1e-6, f = he(n * Math.abs(c[0]), o);
|
|
984
984
|
for (let i = 0; i <= f; i++) {
|
|
985
985
|
let a = r + o * i / f;
|
|
986
986
|
this.lineTo(e + n * Math.cos(a), t + n * Math.sin(a));
|
|
987
987
|
}
|
|
988
988
|
let p = this.current();
|
|
989
|
-
Math.abs(o) >=
|
|
989
|
+
Math.abs(o) >= z - 1e-9 && d && this.uniform() && p && (p.circle = {
|
|
990
990
|
x: c[0] * e + c[4],
|
|
991
991
|
y: c[3] * t + c[5],
|
|
992
992
|
r: n * Math.abs(c[0])
|
|
@@ -1025,7 +1025,7 @@ var R = new Set([
|
|
|
1025
1025
|
this.path = [], e(), t(), this.path = n;
|
|
1026
1026
|
}
|
|
1027
1027
|
onPath(e, t) {
|
|
1028
|
-
if (!(e instanceof
|
|
1028
|
+
if (!(e instanceof R) || e.unsupported) return this.unsupported();
|
|
1029
1029
|
this.withPath(() => {
|
|
1030
1030
|
for (let [t, n] of e.calls) t === "moveTo" ? this.moveTo(n[0], n[1]) : t === "lineTo" ? this.lineTo(n[0], n[1]) : t === "closePath" ? this.closePath() : t === "rect" ? this.rect(n[0], n[1], n[2], n[3]) : t === "arc" ? this.arc(n[0], n[1], n[2], n[3], n[4], !!n[5]) : t === "quadraticCurveTo" ? this.curve([n[0], n[1]], [n[2], n[3]]) : t === "bezierCurveTo" && this.curve([
|
|
1031
1031
|
n[0],
|
|
@@ -1038,7 +1038,7 @@ var R = new Set([
|
|
|
1038
1038
|
baseColor(e) {
|
|
1039
1039
|
let t = this.solid;
|
|
1040
1040
|
if (t && t.style === e) return t.color;
|
|
1041
|
-
let n = v(
|
|
1041
|
+
let n = y(v(e));
|
|
1042
1042
|
return this.solid = {
|
|
1043
1043
|
style: e,
|
|
1044
1044
|
color: n
|
|
@@ -1062,7 +1062,7 @@ var R = new Set([
|
|
|
1062
1062
|
kind: "solid",
|
|
1063
1063
|
color: this.solidColor(e)
|
|
1064
1064
|
};
|
|
1065
|
-
if (!(e instanceof
|
|
1065
|
+
if (!(e instanceof I)) return null;
|
|
1066
1066
|
if (e.stops.length === 0) return {
|
|
1067
1067
|
kind: "solid",
|
|
1068
1068
|
color: [
|
|
@@ -1076,7 +1076,7 @@ var R = new Set([
|
|
|
1076
1076
|
let n = this.state.transform, r = e.x0 === e.x1 || e.y0 === e.y1;
|
|
1077
1077
|
if (!this.axisAligned() || !this.uniform() && !r) return null;
|
|
1078
1078
|
let i = [...e.stops].sort((e, t) => e.offset - t.offset).map((e) => {
|
|
1079
|
-
let n =
|
|
1079
|
+
let n = v(e.color);
|
|
1080
1080
|
return {
|
|
1081
1081
|
offset: e.offset,
|
|
1082
1082
|
color: [
|
|
@@ -1098,17 +1098,17 @@ var R = new Set([
|
|
|
1098
1098
|
}
|
|
1099
1099
|
plain() {
|
|
1100
1100
|
let e = this.state;
|
|
1101
|
-
return e.globalCompositeOperation !== "source-over" || e.filter !== "none" ? !1 : e.shadowBlur === 0 && e.shadowOffsetX === 0 && e.shadowOffsetY === 0 ? !0 : !(
|
|
1101
|
+
return e.globalCompositeOperation !== "source-over" || e.filter !== "none" ? !1 : e.shadowBlur === 0 && e.shadowOffsetX === 0 && e.shadowOffsetY === 0 ? !0 : !(v(e.shadowColor)[3] > 0);
|
|
1102
1102
|
}
|
|
1103
1103
|
fill(e = "nonzero") {
|
|
1104
1104
|
if (!this.plain()) return this.unsupported();
|
|
1105
1105
|
let t = this.paint(this.state.fillStyle);
|
|
1106
1106
|
if (!t) return this.unsupported();
|
|
1107
|
-
let n = this.path.filter(
|
|
1107
|
+
let n = this.path.filter(U);
|
|
1108
1108
|
if (n.length === 0 || t.kind === "solid" && t.color[3] === 0) return;
|
|
1109
|
-
if (n.length > 1 &&
|
|
1110
|
-
let r = t.kind === "solid" && t.color[3] >= 1, i = Math.sign(
|
|
1111
|
-
if (!r || e !== "nonzero" || n.some((e) => Math.sign(
|
|
1109
|
+
if (n.length > 1 && F(n.map((e) => P(e.points)))) {
|
|
1110
|
+
let r = t.kind === "solid" && t.color[3] >= 1, i = Math.sign(S(n[0].points));
|
|
1111
|
+
if (!r || e !== "nonzero" || n.some((e) => Math.sign(S(e.points)) !== i)) return this.unsupported();
|
|
1112
1112
|
}
|
|
1113
1113
|
if (t.kind === "solid" && n.every((e) => e.rect)) return this.fillRects(n, t.color);
|
|
1114
1114
|
if (t.kind === "solid" && n.every((e) => e.circle)) {
|
|
@@ -1123,17 +1123,17 @@ var R = new Set([
|
|
|
1123
1123
|
}
|
|
1124
1124
|
let r = [];
|
|
1125
1125
|
for (let e of n) {
|
|
1126
|
-
let t =
|
|
1126
|
+
let t = ee(e.points);
|
|
1127
1127
|
if (!t) return this.unsupported();
|
|
1128
1128
|
for (let e of t) r.push(e);
|
|
1129
1129
|
}
|
|
1130
|
-
let i =
|
|
1130
|
+
let i = P(n.flatMap((e) => e.points)), a = M({
|
|
1131
1131
|
x0: Math.floor(i.x0),
|
|
1132
1132
|
y0: Math.floor(i.y0),
|
|
1133
1133
|
x1: Math.ceil(i.x1),
|
|
1134
1134
|
y1: Math.ceil(i.y1)
|
|
1135
1135
|
}, this.state.clip);
|
|
1136
|
-
r.length > 0 && !
|
|
1136
|
+
r.length > 0 && !N(a) && this.commands.push({
|
|
1137
1137
|
type: "fill",
|
|
1138
1138
|
spans: r,
|
|
1139
1139
|
bounds: a,
|
|
@@ -1188,7 +1188,7 @@ var R = new Set([
|
|
|
1188
1188
|
let o = t.lineCap === "round" ? 1 : t.lineCap === "square" ? 2 : 0;
|
|
1189
1189
|
this.commands.push({
|
|
1190
1190
|
type: "stroke",
|
|
1191
|
-
points:
|
|
1191
|
+
points: me(i),
|
|
1192
1192
|
color: e.color,
|
|
1193
1193
|
width: r,
|
|
1194
1194
|
cap: o,
|
|
@@ -1206,14 +1206,14 @@ var R = new Set([
|
|
|
1206
1206
|
}
|
|
1207
1207
|
drawsAlike(e, t, n) {
|
|
1208
1208
|
let r = this.state, i = t / 2;
|
|
1209
|
-
if (t > 1 && e.some((e) =>
|
|
1209
|
+
if (t > 1 && e.some((e) => fe(e, i, r.lineJoin, r.miterLimit))) return !1;
|
|
1210
1210
|
let a = i + (r.lineCap === "butt" ? 0 : i);
|
|
1211
|
-
return !(e.length > 1 &&
|
|
1211
|
+
return !(e.length > 1 && F(e.map((e) => P(e.points, a))) || n < 1 && e.some((e) => pe(e, t)));
|
|
1212
1212
|
}
|
|
1213
1213
|
clip() {
|
|
1214
|
-
let e = this.path.filter(
|
|
1214
|
+
let e = this.path.filter(U);
|
|
1215
1215
|
if (e.length !== 1 || !e[0].rect) return this.unsupported();
|
|
1216
|
-
this.state.clip =
|
|
1216
|
+
this.state.clip = M(this.state.clip, e[0].rect);
|
|
1217
1217
|
}
|
|
1218
1218
|
text(e, t, n, r, i) {
|
|
1219
1219
|
let a = e ? this.state.strokeStyle : this.state.fillStyle;
|
|
@@ -1311,7 +1311,7 @@ var R = new Set([
|
|
|
1311
1311
|
isIdentity: t === 1 && n === 0 && r === 0 && i === 1 && a === 0 && o === 0
|
|
1312
1312
|
};
|
|
1313
1313
|
},
|
|
1314
|
-
createLinearGradient: (e, t, n, r) => new
|
|
1314
|
+
createLinearGradient: (e, t, n, r) => new I(e, t, n, r)
|
|
1315
1315
|
}), t;
|
|
1316
1316
|
}
|
|
1317
1317
|
proxy() {
|
|
@@ -1320,10 +1320,10 @@ var R = new Set([
|
|
|
1320
1320
|
get: (t, n) => {
|
|
1321
1321
|
if (typeof n == "string") {
|
|
1322
1322
|
if (n in e) return e[n];
|
|
1323
|
-
if (
|
|
1324
|
-
if (
|
|
1323
|
+
if (B.has(n)) return this.state[n];
|
|
1324
|
+
if (V.has(n)) return this.state.textExtras[n];
|
|
1325
1325
|
if (n === "canvas") return this.measure?.canvas;
|
|
1326
|
-
if (!
|
|
1326
|
+
if (!H.has(n)) return this.unsupported(), () => void 0;
|
|
1327
1327
|
}
|
|
1328
1328
|
},
|
|
1329
1329
|
set: (e, t, n) => (typeof t == "string" && this.setProp(t, n), !0)
|
|
@@ -1331,24 +1331,24 @@ var R = new Set([
|
|
|
1331
1331
|
}
|
|
1332
1332
|
setProp(e, t) {
|
|
1333
1333
|
let n = this.state;
|
|
1334
|
-
e === "lineWidth" || e === "miterLimit" ? typeof t == "number" && Number.isFinite(t) && t > 0 && (n[e] = t) : e === "globalAlpha" ? typeof t == "number" && Number.isFinite(t) && t >= 0 && t <= 1 && (n.globalAlpha = t) : e === "fillStyle" || e === "strokeStyle" ? t instanceof
|
|
1334
|
+
e === "lineWidth" || e === "miterLimit" ? typeof t == "number" && Number.isFinite(t) && t > 0 && (n[e] = t) : e === "globalAlpha" ? typeof t == "number" && Number.isFinite(t) && t >= 0 && t <= 1 && (n.globalAlpha = t) : e === "fillStyle" || e === "strokeStyle" ? t instanceof I ? n[e] = t : typeof t == "string" ? _(t) && (n[e] = t) : this.unsupported() : B.has(e) ? n[e] = t : V.has(e) ? this.state.textExtras[e] = t : H.has(e) || this.unsupported();
|
|
1335
1335
|
}
|
|
1336
1336
|
};
|
|
1337
|
-
function
|
|
1337
|
+
function _e(e, t) {
|
|
1338
1338
|
for (let n of t) {
|
|
1339
1339
|
let t = n.state;
|
|
1340
|
-
if (
|
|
1340
|
+
if (N(t.clip)) continue;
|
|
1341
1341
|
e.save(), e.setTransform(1, 0, 0, 1, 0, 0), Number.isFinite(t.clip.x1) && Number.isFinite(t.clip.y1) && (e.beginPath(), e.rect(t.clip.x0, t.clip.y0, t.clip.x1 - t.clip.x0, t.clip.y1 - t.clip.y0), e.clip());
|
|
1342
1342
|
let [r, i, a, o, s, c] = t.transform;
|
|
1343
1343
|
e.setTransform(r, i, a, o, s, c), e.font = t.font, e.textAlign = t.textAlign, e.textBaseline = t.textBaseline, e.direction = t.direction, e.globalAlpha = t.globalAlpha, Object.assign(e, t.textExtras), n.stroke ? (e.strokeStyle = t.strokeStyle, e.lineWidth = t.lineWidth, e.strokeText(n.text, n.x, n.y, n.maxWidth)) : (e.fillStyle = t.fillStyle, e.fillText(n.text, n.x, n.y, n.maxWidth)), e.restore();
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1347
|
-
return new
|
|
1346
|
+
function ve(e, t) {
|
|
1347
|
+
return new ge(e, t);
|
|
1348
1348
|
}
|
|
1349
1349
|
//#endregion
|
|
1350
1350
|
//#region src/webgl/shaders.ts
|
|
1351
|
-
var
|
|
1351
|
+
var W = `#version 300 es
|
|
1352
1352
|
precision highp float;
|
|
1353
1353
|
uniform vec2 u_canvas;
|
|
1354
1354
|
uniform float u_dpr;
|
|
@@ -1374,7 +1374,7 @@ float cssY(float rel) {
|
|
|
1374
1374
|
return u_yA + rel * u_yB;
|
|
1375
1375
|
}
|
|
1376
1376
|
|
|
1377
|
-
float snap(float v) { return floor(v + ${
|
|
1377
|
+
float snap(float v) { return floor(v + ${a.toFixed(4)}); }
|
|
1378
1378
|
|
|
1379
1379
|
vec4 toClip(vec2 dev) {
|
|
1380
1380
|
return vec4(dev.x / u_canvas.x * 2.0 - 1.0, 1.0 - dev.y / u_canvas.y * 2.0, 0.0, 1.0);
|
|
@@ -1390,7 +1390,7 @@ vec2 corner(int k) {
|
|
|
1390
1390
|
|
|
1391
1391
|
// Nothing to draw: every vertex at one point off the canvas.
|
|
1392
1392
|
const vec4 NOWHERE = vec4(-2.0, -2.0, 0.0, 1.0);
|
|
1393
|
-
`,
|
|
1393
|
+
`, ye = `${W}
|
|
1394
1394
|
in vec4 a_ohlc;
|
|
1395
1395
|
in vec2 a_vd;
|
|
1396
1396
|
uniform float u_x0;
|
|
@@ -1431,7 +1431,7 @@ void main() {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
gl_Position = toClip(vec2(left + cr.x * width, top + cr.y * height));
|
|
1433
1433
|
}
|
|
1434
|
-
`,
|
|
1434
|
+
`, be = `${W}
|
|
1435
1435
|
in vec4 a_ohlc;
|
|
1436
1436
|
in vec2 a_vd;
|
|
1437
1437
|
uniform float u_x0;
|
|
@@ -1453,7 +1453,7 @@ void main() {
|
|
|
1453
1453
|
v_color = a_vd.y > 0.5 ? u_volUp : u_volDown;
|
|
1454
1454
|
gl_Position = toClip(vec2(left + cr.x * u_body, top + cr.y * (bottom - top)));
|
|
1455
1455
|
}
|
|
1456
|
-
`,
|
|
1456
|
+
`, xe = `${W}
|
|
1457
1457
|
in vec4 a_col;
|
|
1458
1458
|
in float a_up;
|
|
1459
1459
|
uniform vec4 u_upBody;
|
|
@@ -1468,7 +1468,7 @@ void main() {
|
|
|
1468
1468
|
v_color = a_up > 0.5 ? u_upBody : u_downBody;
|
|
1469
1469
|
gl_Position = toClip(vec2(left + cr.x * width, min(t, b) + cr.y * max(abs(b - t), 1.0)));
|
|
1470
1470
|
}
|
|
1471
|
-
`,
|
|
1471
|
+
`, Se = `${W}
|
|
1472
1472
|
in vec4 a_col;
|
|
1473
1473
|
in float a_up;
|
|
1474
1474
|
uniform float u_volBottom;
|
|
@@ -1486,7 +1486,7 @@ void main() {
|
|
|
1486
1486
|
v_color = a_up > 0.5 ? u_volUp : u_volDown;
|
|
1487
1487
|
gl_Position = toClip(vec2(left + cr.x * width, top + cr.y * (bottom - top)));
|
|
1488
1488
|
}
|
|
1489
|
-
`,
|
|
1489
|
+
`, Ce = `${W}
|
|
1490
1490
|
in vec4 a_rect;
|
|
1491
1491
|
in vec4 a_color;
|
|
1492
1492
|
in vec2 a_dash;
|
|
@@ -1500,7 +1500,7 @@ void main() {
|
|
|
1500
1500
|
v_color = a_color;
|
|
1501
1501
|
gl_Position = toClip(mix(floor(v_rect.xy), ceil(v_rect.zw), cr));
|
|
1502
1502
|
}
|
|
1503
|
-
`,
|
|
1503
|
+
`, we = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform int u_union;\nin vec4 v_color;\nflat in vec4 v_rect;\nflat in vec2 v_dash;\nout vec4 outColor;\n\n// The share of rows [y, y + 1] inside the rectangle and, dashed, on a dash.\nfloat rows(float y) {\n float lo = max(y, v_rect.y);\n float hi = min(y + 1.0, v_rect.w);\n if (hi <= lo) return 0.0;\n if (v_dash.x <= 0.0) return hi - lo;\n // A dash period is longer than a device pixel, so the row meets the dash\n // of the period it starts in and the next (a third to spare).\n float period = v_dash.x + v_dash.y;\n float first = v_rect.y + floor((lo - v_rect.y) / period) * period;\n float on = 0.0;\n for (int i = 0; i < 3; i++) {\n float start = first + float(i) * period;\n on += max(0.0, min(hi, start + v_dash.x) - max(lo, start));\n }\n return on;\n}\n\nvoid main() {\n // This pixel's top-left corner in device pixels, y down.\n vec2 p = vec2(floor(gl_FragCoord.x), u_canvas.y - floor(gl_FragCoord.y) - 1.0);\n float coverage = clamp(min(p.x + 1.0, v_rect.z) - max(p.x, v_rect.x), 0.0, 1.0) * rows(p.y);\n outColor = u_union == 1 ? vec4(v_color.rgb * coverage, coverage) : v_color * coverage;\n}\n", G = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform vec4 u_clip;\nin vec4 v_color;\nout vec4 outColor;\n\nvoid main() {\n vec2 p = vec2(floor(gl_FragCoord.x), u_canvas.y - floor(gl_FragCoord.y) - 1.0);\n vec2 c = clamp(min(p + 1.0, u_clip.zw) - max(p, u_clip.xy), 0.0, 1.0);\n outColor = v_color * (c.x * c.y);\n}\n", K = 24, q = 5, Te = q * 4, J = 10, Y = J * 4, X = () => {}, Z = [
|
|
1504
1504
|
"a_ohlc",
|
|
1505
1505
|
"a_vd",
|
|
1506
1506
|
"a_col",
|
|
@@ -1508,7 +1508,7 @@ void main() {
|
|
|
1508
1508
|
"a_rect",
|
|
1509
1509
|
"a_color",
|
|
1510
1510
|
"a_dash"
|
|
1511
|
-
], Ee = class
|
|
1511
|
+
], Ee = class a {
|
|
1512
1512
|
label;
|
|
1513
1513
|
gl;
|
|
1514
1514
|
kit;
|
|
@@ -1521,10 +1521,10 @@ void main() {
|
|
|
1521
1521
|
seriesBuffer;
|
|
1522
1522
|
columnBuffer;
|
|
1523
1523
|
rectBuffer;
|
|
1524
|
-
uploads = new
|
|
1524
|
+
uploads = new l();
|
|
1525
1525
|
gpuFloats = 0;
|
|
1526
|
-
columns = new Float32Array(4096 *
|
|
1527
|
-
rectValues = new Float32Array(64 *
|
|
1526
|
+
columns = new Float32Array(4096 * q);
|
|
1527
|
+
rectValues = new Float32Array(64 * J);
|
|
1528
1528
|
clip = [
|
|
1529
1529
|
0,
|
|
1530
1530
|
0,
|
|
@@ -1534,12 +1534,12 @@ void main() {
|
|
|
1534
1534
|
lost = !1;
|
|
1535
1535
|
lostCallback = null;
|
|
1536
1536
|
restoredCallback = null;
|
|
1537
|
-
release =
|
|
1537
|
+
release = X;
|
|
1538
1538
|
static create(e = {}) {
|
|
1539
1539
|
if (typeof document > "u") return null;
|
|
1540
|
-
let
|
|
1540
|
+
let t = document.createElement("canvas"), n = null;
|
|
1541
1541
|
try {
|
|
1542
|
-
|
|
1542
|
+
n = t.getContext("webgl2", {
|
|
1543
1543
|
alpha: !0,
|
|
1544
1544
|
premultipliedAlpha: !0,
|
|
1545
1545
|
antialias: !1,
|
|
@@ -1551,30 +1551,30 @@ void main() {
|
|
|
1551
1551
|
} catch (e) {
|
|
1552
1552
|
return $(e), null;
|
|
1553
1553
|
}
|
|
1554
|
-
if (!
|
|
1554
|
+
if (!n) return null;
|
|
1555
1555
|
try {
|
|
1556
|
-
let
|
|
1557
|
-
return
|
|
1556
|
+
let r = new a(t, n);
|
|
1557
|
+
return r.release = e.release ?? X, r;
|
|
1558
1558
|
} catch (e) {
|
|
1559
|
-
return $(e), Q(
|
|
1559
|
+
return $(e), Q(n), null;
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
1562
|
constructor(e, t) {
|
|
1563
|
-
this.canvas = e, this.gl = t, this.kit = new
|
|
1563
|
+
this.canvas = e, this.gl = t, this.kit = new x(t), this.label = Oe(t), this.build(), e.addEventListener("webglcontextlost", this.handleLost), e.addEventListener("webglcontextrestored", this.handleRestored);
|
|
1564
1564
|
}
|
|
1565
1565
|
build() {
|
|
1566
1566
|
let e = this.kit;
|
|
1567
1567
|
Object.assign(this, {
|
|
1568
|
-
candleBars: e.program(
|
|
1569
|
-
volumeBars: e.program(
|
|
1570
|
-
candleColumns: e.program(
|
|
1571
|
-
volumeColumns: e.program(
|
|
1572
|
-
rects: e.program(
|
|
1568
|
+
candleBars: e.program(ye, G, Z),
|
|
1569
|
+
volumeBars: e.program(be, G, Z),
|
|
1570
|
+
candleColumns: e.program(xe, G, Z),
|
|
1571
|
+
volumeColumns: e.program(Se, G, Z),
|
|
1572
|
+
rects: e.program(Ce, we, Z),
|
|
1573
1573
|
seriesBuffer: e.buffer(),
|
|
1574
1574
|
columnBuffer: e.buffer(),
|
|
1575
1575
|
rectBuffer: e.buffer(),
|
|
1576
|
-
drawer: new
|
|
1577
|
-
uploads: new
|
|
1576
|
+
drawer: new le(e),
|
|
1577
|
+
uploads: new l(),
|
|
1578
1578
|
gpuFloats: 0
|
|
1579
1579
|
});
|
|
1580
1580
|
}
|
|
@@ -1587,7 +1587,7 @@ void main() {
|
|
|
1587
1587
|
}));
|
|
1588
1588
|
}
|
|
1589
1589
|
recorder(e, t) {
|
|
1590
|
-
return
|
|
1590
|
+
return ve(e, t);
|
|
1591
1591
|
}
|
|
1592
1592
|
render(e) {
|
|
1593
1593
|
let t = this.gl;
|
|
@@ -1598,7 +1598,7 @@ void main() {
|
|
|
1598
1598
|
recorded: !1,
|
|
1599
1599
|
under: !1
|
|
1600
1600
|
};
|
|
1601
|
-
let n =
|
|
1601
|
+
let n = De(e.recorded) ? e.recorded : null, r = De(e.under) ? e.under : null, i = {
|
|
1602
1602
|
series: e.candles,
|
|
1603
1603
|
volume: e.volume !== null,
|
|
1604
1604
|
background: e.background !== null,
|
|
@@ -1608,10 +1608,10 @@ void main() {
|
|
|
1608
1608
|
return t.viewport(0, 0, this.canvas.width, this.canvas.height), t.disable(t.SCISSOR_TEST), t.clearColor(0, 0, 0, 0), t.clear(t.COLOR_BUFFER_BIT), t.enable(t.BLEND), e.background && this.drawBackground(e, e.background), r && this.drawRecorded(e, r), this.drawSeries(e), n && this.drawRecorded(e, n), i;
|
|
1609
1609
|
}
|
|
1610
1610
|
drawSeries(e) {
|
|
1611
|
-
let t = this.gl, { data:
|
|
1612
|
-
if (
|
|
1611
|
+
let t = this.gl, { data: r, viewport: i, dpr: a } = e;
|
|
1612
|
+
if (r.length === 0 || !e.candles && !e.volume) return;
|
|
1613
1613
|
this.syncSeries(e);
|
|
1614
|
-
let o = Math.max(0, i.visibleRange.from), s = Math.min(i.visibleRange.to,
|
|
1614
|
+
let o = Math.max(0, i.visibleRange.from), s = Math.min(i.visibleRange.to, r.length - 1);
|
|
1615
1615
|
if (s < o) return;
|
|
1616
1616
|
let { chartRect: c } = i;
|
|
1617
1617
|
this.clip = [
|
|
@@ -1622,7 +1622,7 @@ void main() {
|
|
|
1622
1622
|
];
|
|
1623
1623
|
let l = Math.floor(this.clip[0]), u = Math.floor(this.clip[1]), d = Math.ceil(this.clip[2]) - l, f = Math.ceil(this.clip[3]) - u;
|
|
1624
1624
|
t.enable(t.SCISSOR_TEST), t.scissor(l, this.canvas.height - u - f, Math.max(0, d), Math.max(0, f)), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA);
|
|
1625
|
-
let p =
|
|
1625
|
+
let p = n(i), m = p ? this.buildColumns(e, o, s) : 0;
|
|
1626
1626
|
e.volume && this.drawVolume(e, o, s, p, m);
|
|
1627
1627
|
let { min: h, max: g } = i.priceRange;
|
|
1628
1628
|
e.candles && g - h !== 0 && this.drawCandles(e, o, s, p, m), t.disable(t.SCISSOR_TEST);
|
|
@@ -1635,7 +1635,7 @@ void main() {
|
|
|
1635
1635
|
this.kit.float(i, "u_dpr", 1), this.kit.int(i, "u_union", 0), r.bindBuffer(r.ARRAY_BUFFER, this.rectBuffer), r.bufferData(r.ARRAY_BUFFER, t, r.STREAM_DRAW), this.bindRects(i, 0), r.drawArraysInstanced(r.TRIANGLES, 0, 6, n);
|
|
1636
1636
|
}
|
|
1637
1637
|
destroy() {
|
|
1638
|
-
this.canvas.removeEventListener("webglcontextlost", this.handleLost), this.canvas.removeEventListener("webglcontextrestored", this.handleRestored), this.lostCallback = null, this.restoredCallback = null, this.release(), this.release =
|
|
1638
|
+
this.canvas.removeEventListener("webglcontextlost", this.handleLost), this.canvas.removeEventListener("webglcontextrestored", this.handleRestored), this.lostCallback = null, this.restoredCallback = null, this.release(), this.release = X;
|
|
1639
1639
|
let e = this.gl;
|
|
1640
1640
|
if (e.isContextLost()) this.canvas.addEventListener("webglcontextrestored", () => Q(e), { once: !0 });
|
|
1641
1641
|
else {
|
|
@@ -1651,11 +1651,11 @@ void main() {
|
|
|
1651
1651
|
this.canvas.remove();
|
|
1652
1652
|
}
|
|
1653
1653
|
handleLost = (e) => {
|
|
1654
|
-
e.preventDefault(), !this.lost && (this.lost = !0, this.release(), this.release =
|
|
1654
|
+
e.preventDefault(), !this.lost && (this.lost = !0, this.release(), this.release = X, this.lostCallback?.());
|
|
1655
1655
|
};
|
|
1656
1656
|
handleRestored = () => {
|
|
1657
1657
|
if (!this.lost || this.gl.isContextLost()) return;
|
|
1658
|
-
let e =
|
|
1658
|
+
let e = o();
|
|
1659
1659
|
if (!e) {
|
|
1660
1660
|
Q(this.gl);
|
|
1661
1661
|
return;
|
|
@@ -1670,81 +1670,84 @@ void main() {
|
|
|
1670
1670
|
};
|
|
1671
1671
|
syncSeries(e) {
|
|
1672
1672
|
let t = this.gl, n = this.uploads.sync(e.data), r = this.uploads.values;
|
|
1673
|
-
t.bindBuffer(t.ARRAY_BUFFER, this.seriesBuffer), n.full || r.length !== this.gpuFloats ? (t.bufferData(t.ARRAY_BUFFER, r, t.DYNAMIC_DRAW), this.gpuFloats = r.length) : n.to > n.from && t.bufferSubData(t.ARRAY_BUFFER, n.from *
|
|
1673
|
+
t.bindBuffer(t.ARRAY_BUFFER, this.seriesBuffer), n.full || r.length !== this.gpuFloats ? (t.bufferData(t.ARRAY_BUFFER, r, t.DYNAMIC_DRAW), this.gpuFloats = r.length) : n.to > n.from && t.bufferSubData(t.ARRAY_BUFFER, n.from * K, r, n.from * 6, (n.to - n.from) * 6);
|
|
1674
1674
|
}
|
|
1675
|
-
buildColumns(
|
|
1676
|
-
let { viewport: i, data: a } =
|
|
1677
|
-
|
|
1678
|
-
if ((l + 1) *
|
|
1675
|
+
buildColumns(e, n, r) {
|
|
1676
|
+
let { viewport: i, data: a } = e, o = i.barWidth + i.barSpacing, s = -i.offset + i.chartRect.x + i.barWidth / 2, c = this.uploads.base, l = 0;
|
|
1677
|
+
t(a, n, r, (e) => e * o + s, (e) => {
|
|
1678
|
+
if ((l + 1) * q > this.columns.length) {
|
|
1679
1679
|
let e = new Float32Array(this.columns.length * 2);
|
|
1680
1680
|
e.set(this.columns), this.columns = e;
|
|
1681
1681
|
}
|
|
1682
|
-
let t = l *
|
|
1682
|
+
let t = l * q;
|
|
1683
1683
|
this.columns[t] = e.x, this.columns[t + 1] = e.high - c, this.columns[t + 2] = e.low - c, this.columns[t + 3] = e.volume, this.columns[t + 4] = +(e.close >= e.open), l++;
|
|
1684
1684
|
});
|
|
1685
1685
|
let u = this.gl;
|
|
1686
|
-
return u.bindBuffer(u.ARRAY_BUFFER, this.columnBuffer), u.bufferData(u.ARRAY_BUFFER, this.columns.subarray(0, l *
|
|
1686
|
+
return u.bindBuffer(u.ARRAY_BUFFER, this.columnBuffer), u.bufferData(u.ARRAY_BUFFER, this.columns.subarray(0, l * q), u.STREAM_DRAW), l;
|
|
1687
1687
|
}
|
|
1688
|
-
drawBackground(
|
|
1689
|
-
let { viewport:
|
|
1688
|
+
drawBackground(t, n) {
|
|
1689
|
+
let { viewport: r, theme: a } = t, o = e(a), s = n.grid ? i(r) : {
|
|
1690
1690
|
horizontal: [],
|
|
1691
1691
|
vertical: []
|
|
1692
|
-
},
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
for (let e of
|
|
1704
|
-
let h
|
|
1705
|
-
|
|
1692
|
+
}, c = {
|
|
1693
|
+
horizontal: o.horizontal.visible ? s.horizontal : [],
|
|
1694
|
+
vertical: o.vertical.visible ? s.vertical : []
|
|
1695
|
+
}, l = c.horizontal.length + c.vertical.length, u = l + n.rects.length;
|
|
1696
|
+
if (u === 0) return;
|
|
1697
|
+
this.rectValues.length < u * J && (this.rectValues = new Float32Array(u * J * 2));
|
|
1698
|
+
let d = this.rectValues, f = 0, p = (e, t, n, r, i, a, o) => {
|
|
1699
|
+
d[f++] = e, d[f++] = t, d[f++] = n, d[f++] = r;
|
|
1700
|
+
for (let e = 0; e < 4; e++) d[f++] = i[e] * a;
|
|
1701
|
+
d[f++] = o ? o[0] : 0, d[f++] = o ? o[1] : 0;
|
|
1702
|
+
}, m = y(v(o.horizontal.visible ? o.horizontal.color : o.vertical.color)), { chartRect: h } = r;
|
|
1703
|
+
for (let e of c.horizontal) p(h.x, e - .5, h.x + h.width, e + .5, m, 1);
|
|
1704
|
+
for (let e of c.vertical) p(e - .5, h.y, e + .5, h.y + h.height, m, 1);
|
|
1705
|
+
let g = "", _ = m;
|
|
1706
|
+
for (let e of n.rects) e.color !== g && (g = e.color, _ = y(v(e.color))), p(e.x, e.y, e.x + e.width, e.y + e.height, _, e.alpha, e.dash);
|
|
1707
|
+
let b = this.gl, x = this.use(this.rects, t);
|
|
1708
|
+
b.bindBuffer(b.ARRAY_BUFFER, this.rectBuffer), b.bufferData(b.ARRAY_BUFFER, d.subarray(0, f), b.STREAM_DRAW), l > 0 && (b.uniform1i(this.loc(x, "u_union"), 1), b.blendColor(0, 0, 0, m[3]), b.blendFuncSeparate(b.ONE, b.ONE_MINUS_SRC_ALPHA, b.CONSTANT_ALPHA, b.ONE_MINUS_SRC_ALPHA), this.bindRects(x, 0), b.drawArraysInstanced(b.TRIANGLES, 0, 6, l)), n.rects.length > 0 && (b.uniform1i(this.loc(x, "u_union"), 0), b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA), this.bindRects(x, l), b.drawArraysInstanced(b.TRIANGLES, 0, 6, n.rects.length));
|
|
1706
1709
|
}
|
|
1707
1710
|
drawCandles(e, t, n, r, i) {
|
|
1708
|
-
let { theme: a, viewport: o, dpr: s } = e, c = v(
|
|
1711
|
+
let { theme: a, viewport: o, dpr: s } = e, c = y(v(a.candleUp)), l = y(v(a.candleDown));
|
|
1709
1712
|
if (r) {
|
|
1710
1713
|
let t = this.use(this.candleColumns, e);
|
|
1711
1714
|
this.vec4(t, "u_upBody", c), this.vec4(t, "u_downBody", l), this.bindColumns(t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 6, i);
|
|
1712
1715
|
return;
|
|
1713
1716
|
}
|
|
1714
1717
|
let u = this.use(this.candleBars, e);
|
|
1715
|
-
this.barUniforms(u, o, t, s), this.vec4(u, "u_upBody", c), this.vec4(u, "u_downBody", l), this.vec4(u, "u_upWick", v(
|
|
1718
|
+
this.barUniforms(u, o, t, s), this.vec4(u, "u_upBody", c), this.vec4(u, "u_downBody", l), this.vec4(u, "u_upWick", y(v(a.candleUpWick))), this.vec4(u, "u_downWick", y(v(a.candleDownWick))), this.bindBars(u, t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 12, n - t + 1);
|
|
1716
1719
|
}
|
|
1717
1720
|
drawVolume(e, t, n, r, i) {
|
|
1718
|
-
let { data: a, viewport:
|
|
1721
|
+
let { data: a, viewport: o, theme: c, dpr: l } = e, u = 0;
|
|
1719
1722
|
for (let e = t; e <= n; e++) a[e].volume > u && (u = a[e].volume);
|
|
1720
1723
|
if (u === 0) return;
|
|
1721
|
-
let { chartRect: d } =
|
|
1722
|
-
if (this.float(p, "u_volBottom", d.y + d.height), this.float(p, "u_volScale", d.height * (e.volume?.heightRatio ?? .15) / u), this.vec4(p, "u_volUp", v(
|
|
1724
|
+
let { chartRect: d } = o, f = s(c), p = this.use(r ? this.volumeColumns : this.volumeBars, e);
|
|
1725
|
+
if (this.float(p, "u_volBottom", d.y + d.height), this.float(p, "u_volScale", d.height * (e.volume?.heightRatio ?? .15) / u), this.vec4(p, "u_volUp", y(v(f.up))), this.vec4(p, "u_volDown", y(v(f.down))), r) {
|
|
1723
1726
|
this.bindColumns(p), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 6, i);
|
|
1724
1727
|
return;
|
|
1725
1728
|
}
|
|
1726
|
-
this.barUniforms(p,
|
|
1729
|
+
this.barUniforms(p, o, t, l), this.bindBars(p, t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 6, n - t + 1);
|
|
1727
1730
|
}
|
|
1728
|
-
barUniforms(e, t,
|
|
1729
|
-
let a = t.barWidth + t.barSpacing, o = -t.offset + t.chartRect.x + t.barWidth / 2, { body: s, wick: c } =
|
|
1730
|
-
this.float(e, "u_x0",
|
|
1731
|
+
barUniforms(e, t, n, i) {
|
|
1732
|
+
let a = t.barWidth + t.barSpacing, o = -t.offset + t.chartRect.x + t.barWidth / 2, { body: s, wick: c } = r(t.barWidth, i);
|
|
1733
|
+
this.float(e, "u_x0", n * a + o), this.float(e, "u_unit", a), this.float(e, "u_wick", c), this.float(e, "u_body", s);
|
|
1731
1734
|
}
|
|
1732
1735
|
use(e, t) {
|
|
1733
1736
|
let n = this.gl;
|
|
1734
1737
|
this.kit.use(e), n.uniform2f(this.loc(e, "u_canvas"), this.canvas.width, this.canvas.height), this.vec4(e, "u_clip", this.clip), this.float(e, "u_dpr", t.dpr);
|
|
1735
|
-
let r =
|
|
1738
|
+
let r = b(t.viewport, this.uploads.base);
|
|
1736
1739
|
return n.uniform1i(this.loc(e, "u_log"), r.log), n.uniform1i(this.loc(e, "u_invert"), r.invert), this.float(e, "u_yA", r.yA), this.float(e, "u_yB", r.yB), this.float(e, "u_logOffset", r.logOffset), this.float(e, "u_min", r.min), this.float(e, "u_logFloor", r.logFloor), this.float(e, "u_logK", r.logK), this.float(e, "u_top", r.top), this.float(e, "u_bottom", r.bottom), e;
|
|
1737
1740
|
}
|
|
1738
1741
|
bindBars(e, t) {
|
|
1739
1742
|
let n = this.gl;
|
|
1740
|
-
n.bindBuffer(n.ARRAY_BUFFER, this.seriesBuffer), this.attrib(e, "a_ohlc", 4,
|
|
1743
|
+
n.bindBuffer(n.ARRAY_BUFFER, this.seriesBuffer), this.attrib(e, "a_ohlc", 4, K, t * K), this.attrib(e, "a_vd", 2, K, t * K + 16);
|
|
1741
1744
|
}
|
|
1742
1745
|
bindRects(e, t) {
|
|
1743
|
-
this.attrib(e, "a_rect", 4,
|
|
1746
|
+
this.attrib(e, "a_rect", 4, Y, t * Y), this.attrib(e, "a_color", 4, Y, t * Y + 16), this.attrib(e, "a_dash", 2, Y, t * Y + 32);
|
|
1744
1747
|
}
|
|
1745
1748
|
bindColumns(e) {
|
|
1746
1749
|
let t = this.gl;
|
|
1747
|
-
t.bindBuffer(t.ARRAY_BUFFER, this.columnBuffer), this.attrib(e, "a_col", 4,
|
|
1750
|
+
t.bindBuffer(t.ARRAY_BUFFER, this.columnBuffer), this.attrib(e, "a_col", 4, Te, 0), this.attrib(e, "a_up", 1, Te, 16);
|
|
1748
1751
|
}
|
|
1749
1752
|
attrib(e, t, n, r, i) {
|
|
1750
1753
|
this.kit.attrib(e, t, n, r, i);
|
|
@@ -1759,10 +1762,10 @@ void main() {
|
|
|
1759
1762
|
return this.kit.loc(e, t);
|
|
1760
1763
|
}
|
|
1761
1764
|
};
|
|
1762
|
-
function
|
|
1765
|
+
function De(e) {
|
|
1763
1766
|
return typeof e == "object" && !!e && Array.isArray(e.commands);
|
|
1764
1767
|
}
|
|
1765
|
-
function
|
|
1768
|
+
function Oe(e) {
|
|
1766
1769
|
let t = String(e.getParameter(e.RENDERER));
|
|
1767
1770
|
if (t && t !== "WebKit WebGL") return t;
|
|
1768
1771
|
let n = e.getExtension("WEBGL_debug_renderer_info");
|
|
@@ -1777,4 +1780,4 @@ function $(e) {
|
|
|
1777
1780
|
//#endregion
|
|
1778
1781
|
export { Ee as WebGLSeriesRenderer };
|
|
1779
1782
|
|
|
1780
|
-
//# sourceMappingURL=WebGLSeriesRenderer-
|
|
1783
|
+
//# sourceMappingURL=WebGLSeriesRenderer-BNrnoMHq.js.map
|