@wick-charts/vue 0.6.4 → 0.8.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.
Files changed (55) hide show
  1. package/README.md +21 -7
  2. package/dist/BandSeries.vue.js +20 -18
  3. package/dist/BarSeries.vue.js +15 -13
  4. package/dist/CandlestickSeries.vue.js +31 -29
  5. package/dist/ChartContainer.vue.js +77 -70
  6. package/dist/LineSeries.vue.js +19 -17
  7. package/dist/composables.js +46 -36
  8. package/dist/core/dist/animation/viewport-engine.js +155 -96
  9. package/dist/core/dist/axis/dom-labels.js +56 -51
  10. package/dist/core/dist/chart/scale-guards.js +23 -5
  11. package/dist/core/dist/chart/x-guards.js +37 -0
  12. package/dist/core/dist/chart.js +1286 -843
  13. package/dist/core/dist/data/sync.js +37 -31
  14. package/dist/core/dist/navigator/controller.js +37 -37
  15. package/dist/core/dist/perf/perf-hud.js +3 -3
  16. package/dist/core/dist/scales/tick-tracker.js +2 -2
  17. package/dist/core/dist/scales/x-scale.js +167 -53
  18. package/dist/core/dist/scales/y-scale.js +36 -34
  19. package/dist/core/dist/series/band.js +266 -213
  20. package/dist/core/dist/series/bar.js +297 -291
  21. package/dist/core/dist/series/base-multi-layer.js +283 -237
  22. package/dist/core/dist/series/candlestick.js +1 -0
  23. package/dist/core/dist/series/line.js +21 -20
  24. package/dist/core/dist/snapshots.js +55 -43
  25. package/dist/index.d.ts +323 -58
  26. package/dist/index.js +9 -9
  27. package/dist/ui/Crosshair.vue.js +51 -27
  28. package/dist/ui/InfoBar.vue.js +37 -37
  29. package/dist/ui/Marker.vue.js +14 -11
  30. package/dist/ui/Navigator.vue.js +23 -23
  31. package/dist/ui/ReferenceLine.vue.js +19 -16
  32. package/dist/ui/Tooltip.vue.js +91 -86
  33. package/dist/ui/XAxis.vue.js +48 -0
  34. package/dist/ui/XAxis.vue2.js +4 -0
  35. package/dist/ui/YAxis.vue.js +44 -28
  36. package/dist/ui/YLabel.vue.js +78 -74
  37. package/package.json +9 -3
  38. package/src/BandSeries.vue +11 -6
  39. package/src/BarSeries.vue +13 -6
  40. package/src/CandlestickSeries.vue +9 -5
  41. package/src/ChartContainer.vue +20 -0
  42. package/src/LineSeries.vue +13 -6
  43. package/src/composables.ts +23 -4
  44. package/src/index.ts +8 -1
  45. package/src/ui/Crosshair.vue +41 -1
  46. package/src/ui/InfoBar.vue +2 -1
  47. package/src/ui/Marker.vue +5 -1
  48. package/src/ui/Navigator.vue +2 -1
  49. package/src/ui/ReferenceLine.vue +5 -1
  50. package/src/ui/Tooltip.vue +7 -4
  51. package/src/ui/{TimeAxis.vue → XAxis.vue} +18 -5
  52. package/src/ui/YAxis.vue +66 -12
  53. package/src/ui/YLabel.vue +35 -5
  54. package/dist/ui/TimeAxis.vue.js +0 -44
  55. package/dist/ui/TimeAxis.vue2.js +0 -4
@@ -1,69 +1,75 @@
1
- import { normalizeTime as s } from "../utils/time.js";
2
- const g = { len: 0, firstTime: null, lastTime: null, data: null }, d = 20;
3
- function c(t, a) {
4
- if (s(t.time) !== s(a.time)) return !1;
1
+ import { normalizeTime as y } from "../utils/time.js";
2
+ function i(t) {
3
+ return "x" in t ? t.x : y(t.time);
4
+ }
5
+ const m = { len: 0, firstTime: null, lastTime: null, data: null }, p = 20;
6
+ function g(t, a) {
7
+ if (i(t) !== i(a)) return !1;
5
8
  const r = Object.keys(t), e = Object.keys(a);
6
9
  return r.length !== e.length ? !1 : r.every((n) => n === "time" || t[n] === a[n]);
7
10
  }
8
- function y(t, a) {
11
+ function c(t, a) {
9
12
  if (!t || t.length !== a.length || t === a) return !1;
10
13
  for (let r = 0; r < a.length - 1; r++)
11
- if (t[r] !== a[r] && !c(t[r], a[r]))
14
+ if (t[r] !== a[r] && !g(t[r], a[r]))
12
15
  return !1;
13
16
  return !0;
14
17
  }
15
- function p(t, a, r) {
18
+ function T(t, a, r) {
16
19
  if (!t || t.length === 0 || r <= 0 || t.length !== a.length - r) return !1;
17
20
  for (let e = 1; e < r; e++)
18
- if (s(a[e - 1].time) >= s(a[e].time)) return !1;
19
- if (s(a[r - 1].time) >= s(t[0].time)) return !1;
21
+ if (i(a[e - 1]) >= i(a[e])) return !1;
22
+ if (i(a[r - 1]) >= i(t[0])) return !1;
20
23
  for (let e = 0; e < t.length; e++)
21
- if (!c(t[e], a[r + e])) return !1;
24
+ if (!g(t[e], a[r + e])) return !1;
22
25
  return !0;
23
26
  }
24
- function T(t) {
27
+ function A(t) {
25
28
  return typeof t == "object" && t !== null && !Array.isArray(t) && Array.isArray(t.data);
26
29
  }
27
- function A(t) {
30
+ function b(t) {
28
31
  if (!Array.isArray(t)) return [t];
29
32
  if (t.length === 0) return [{ data: [] }];
30
33
  const a = t[0];
31
- return Array.isArray(a) || T(a) ? t.map((r) => Array.isArray(r) ? { data: r } : r) : [{ data: t }];
34
+ return Array.isArray(a) || A(a) ? t.map((r) => Array.isArray(r) ? { data: r } : r) : [{ data: t }];
32
35
  }
33
- function D(t) {
34
- const { chart: a, id: r } = t, e = A(t.data), n = e.length > 1 ? e.map((l, f) => l.label ?? `Series ${f + 1}`) : [e[0].label];
36
+ function L(t) {
37
+ const { chart: a, id: r } = t, e = b(t.data), n = e.length > 1 ? e.map((l, f) => l.label ?? `Series ${f + 1}`) : [e[0].label];
35
38
  a.setSeriesLabels(r, n), a.setLayerColors(
36
39
  r,
37
40
  e.map((l) => l.color)
38
41
  );
39
- const i = [];
42
+ const s = [];
40
43
  return a.batch(() => {
41
44
  for (let l = 0; l < e.length; l++)
42
- i[l] = b({
45
+ s[l] = S({
43
46
  chart: a,
44
47
  id: r,
45
48
  data: e[l].data,
46
- prev: t.prev[l] ?? g,
49
+ prev: t.prev[l] ?? m,
47
50
  layerIndex: l
48
51
  });
49
- }), i;
52
+ }), s;
50
53
  }
51
- function b(t) {
52
- const { chart: a, id: r, data: e, prev: n, layerIndex: i } = t;
54
+ function S(t) {
55
+ const { chart: a, id: r, data: e, prev: n, layerIndex: s } = t;
53
56
  if (e.length === 0)
54
- return a.setSeriesData(r, [], i), { len: 0, firstTime: null, lastTime: null, data: [] };
57
+ return a.setSeriesData(r, [], s), { len: 0, firstTime: null, lastTime: null, data: [] };
55
58
  if (n.data === e && n.len === e.length) return n;
56
- const l = s(e[0].time), f = s(e[e.length - 1].time), h = n.firstTime !== null && n.firstTime !== l, u = e.length - n.len, m = n.lastTime !== null && n.lastTime !== f;
57
- return h && u === 0 && m ? a.batch(() => {
58
- a.appendData(r, e[e.length - 1], i), a.keepLast(r, e.length, i);
59
- }) : p(n.data, e, u) ? a.prependData(r, e.slice(0, u), i) : n.len === 0 || e.length < n.len || u > d || h ? a.setSeriesData(r, e, i) : e.length === n.len ? y(n.data, e) ? a.updateData(r, e[e.length - 1], i) : a.setSeriesData(r, e, i) : a.batch(() => {
59
+ const l = i(e[0]), f = i(e[e.length - 1]);
60
+ if (typeof l == "string")
61
+ return e.length === n.len && c(n.data, e) ? a.updateData(r, e[e.length - 1], s) : a.setSeriesData(r, e, s), { len: e.length, firstTime: l, lastTime: f, data: e };
62
+ const h = n.firstTime !== null && n.firstTime !== l, u = e.length - n.len, d = n.lastTime !== null && n.lastTime !== f;
63
+ return h && u === 0 && d ? a.batch(() => {
64
+ a.appendData(r, e[e.length - 1], s), a.keepLast(r, e.length, s);
65
+ }) : T(n.data, e, u) ? a.prependData(r, e.slice(0, u), s) : n.len === 0 || e.length < n.len || u > p || h ? a.setSeriesData(r, e, s) : e.length === n.len ? c(n.data, e) ? a.updateData(r, e[e.length - 1], s) : a.setSeriesData(r, e, s) : a.batch(() => {
60
66
  for (let o = n.len; o < e.length; o++)
61
- a.appendData(r, e[o], i);
67
+ a.appendData(r, e[o], s);
62
68
  }), { len: e.length, firstTime: l, lastTime: f, data: e };
63
69
  }
64
70
  export {
65
- g as EMPTY_SYNC_STATE,
66
- D as syncLayers,
67
- b as syncSeriesLayer,
68
- A as toLayers
71
+ m as EMPTY_SYNC_STATE,
72
+ L as syncLayers,
73
+ S as syncSeriesLayer,
74
+ b as toLayers
69
75
  };
@@ -1,9 +1,9 @@
1
1
  import { DEFAULT_LINE_ENTRY as w } from "../animation/config.js";
2
2
  import { XScale as T } from "../scales/x-scale.js";
3
3
  import { YScale as k } from "../scales/y-scale.js";
4
- import { decimateCandles as R, decimateLinear as C } from "./decimate.js";
4
+ import { decimateCandles as C, decimateLinear as R } from "./decimate.js";
5
5
  import { hitTest as b, computeSnapCenter as E, computePan as I, computeResize as $ } from "./interactions.js";
6
- import { computeWindowGeometry as M, renderBackground as L, renderMiniCandlestick as V, renderMiniBar as N, renderMiniLine as P } from "./render.js";
6
+ import { computeWindowGeometry as M, renderBackground as L, renderMiniCandlestick as N, renderMiniBar as V, renderMiniLine as P } from "./render.js";
7
7
  import { Animator as S } from "../animation/animator.js";
8
8
  import { easeOutCubic as z } from "../animation/easing.js";
9
9
  class G {
@@ -12,7 +12,7 @@ class G {
12
12
  #z;
13
13
  #e;
14
14
  #n;
15
- #d;
15
+ #u;
16
16
  #r;
17
17
  #l;
18
18
  #a;
@@ -21,9 +21,9 @@ class G {
21
21
  #v;
22
22
  // Own scales — both cover the full data span. The main chart's scales move
23
23
  // with the viewport; these don't.
24
- #u = new T();
25
- #F = new k();
26
- #A = 0;
24
+ #d = new T();
25
+ #A = new k();
26
+ #F = 0;
27
27
  #m = 0;
28
28
  #h = 1;
29
29
  #p = null;
@@ -48,11 +48,11 @@ class G {
48
48
  #o = null;
49
49
  /** `time` of the last point we've ever seen — initialises after the first
50
50
  * `setData`/render so the first paint doesn't trigger a fade-in. */
51
- #R = null;
51
+ #C = null;
52
52
  /** Series index in `lineSeriesList(data)` that owns the newest last-time,
53
53
  * so the tail fade applies to the series that actually grew — not always
54
54
  * the last entry in the stack. -1 for candlestick (single-series). */
55
- #C = -1;
55
+ #R = -1;
56
56
  #E;
57
57
  // Active-drag state — null when idle.
58
58
  #g = null;
@@ -61,22 +61,22 @@ class G {
61
61
  #$;
62
62
  #M;
63
63
  #L;
64
- #V;
65
- #y;
66
64
  #N;
65
+ #y;
66
+ #V;
67
67
  constructor(t) {
68
68
  this.#s = t.container, this.#e = t.chart, this.#x = t.data, this.#v = t.options ?? {}, window.getComputedStyle(this.#s).position === "static" && (this.#s.style.position = "relative"), this.#t = document.createElement("canvas"), this.#t.style.position = "absolute", this.#t.style.left = "0", this.#t.style.top = "0", this.#t.style.height = "100%", this.#t.style.touchAction = "none", this.#s.appendChild(this.#t);
69
69
  const e = this.#t.getContext("2d", { alpha: !0 });
70
70
  if (!e) throw new Error("NavigatorController: failed to acquire 2D context");
71
- this.#z = e, this.#n = document.createElement("div"), this.#n.dataset.chartNavigatorOverlay = "", this.#n.style.cssText = "position:absolute;left:0;top:0;height:100%;pointer-events:none;", this.#d = document.createElement("div"), this.#d.style.cssText = "position:absolute;left:0;top:0;bottom:0;", this.#r = document.createElement("div"), this.#r.style.cssText = "position:absolute;top:0;bottom:0;", this.#l = document.createElement("div"), this.#l.style.cssText = "position:absolute;top:0;bottom:0;box-sizing:border-box;", this.#a = y(), this.#c = y(), this.#n.append(this.#d, this.#r, this.#l, this.#a, this.#c), this.#s.appendChild(this.#n), this.#I = () => this.#B(), this.#$ = () => this.#f(), this.#M = () => this.#B(), this.#e.on("viewportChange", this.#I), this.#e.on("overlayChange", this.#$), this.#e.on("tickFrame", this.#M), this.#L = (s) => this.#U(s), this.#V = (s) => this.#J(s), this.#y = (s) => this.#K(s), this.#N = () => {
71
+ this.#z = e, this.#n = document.createElement("div"), this.#n.dataset.chartNavigatorOverlay = "", this.#n.style.cssText = "position:absolute;left:0;top:0;height:100%;pointer-events:none;", this.#u = document.createElement("div"), this.#u.style.cssText = "position:absolute;left:0;top:0;bottom:0;", this.#r = document.createElement("div"), this.#r.style.cssText = "position:absolute;top:0;bottom:0;", this.#l = document.createElement("div"), this.#l.style.cssText = "position:absolute;top:0;bottom:0;box-sizing:border-box;", this.#a = y(), this.#c = y(), this.#n.append(this.#u, this.#r, this.#l, this.#a, this.#c), this.#s.appendChild(this.#n), this.#I = () => this.#B(), this.#$ = () => this.#f(), this.#M = () => this.#B(), this.#e.on("viewportChange", this.#I), this.#e.on("overlayChange", this.#$), this.#e.on("tickFrame", this.#M), this.#L = (s) => this.#U(s), this.#N = (s) => this.#J(s), this.#y = (s) => this.#K(s), this.#V = () => {
72
72
  this.#g === null && (this.#t.style.cursor = "default");
73
- }, this.#t.addEventListener("pointerdown", this.#L), this.#t.addEventListener("pointermove", this.#V), this.#t.addEventListener("pointerup", this.#y), this.#t.addEventListener("pointercancel", this.#y), this.#t.addEventListener("pointerleave", this.#N), this.#E = new ResizeObserver((s) => this.#j(s[0])), this.#E.observe(this.#s), this.#D();
73
+ }, this.#t.addEventListener("pointerdown", this.#L), this.#t.addEventListener("pointermove", this.#N), this.#t.addEventListener("pointerup", this.#y), this.#t.addEventListener("pointercancel", this.#y), this.#t.addEventListener("pointerleave", this.#V), this.#E = new ResizeObserver((s) => this.#j(s[0])), this.#E.observe(this.#s), this.#D();
74
74
  const i = this.#s.getBoundingClientRect();
75
75
  i.width > 0 && i.height > 0 && this.#W(i.width, i.height), this.#f();
76
76
  }
77
77
  setData(t) {
78
- const e = F(t), i = e?.time ?? null;
79
- if (i !== null && this.#R !== null && i !== this.#R) {
78
+ const e = A(t), i = e?.time ?? null;
79
+ if (i !== null && this.#C !== null && i !== this.#C) {
80
80
  const s = this.#o?.current ?? 0;
81
81
  this.#o = new S({
82
82
  initial: s,
@@ -85,7 +85,7 @@ class G {
85
85
  lerp: (n, h, l) => n + (h - n) * l
86
86
  }), this.#o.setTarget(1);
87
87
  }
88
- this.#R = i, this.#C = e?.seriesIndex ?? -1, this.#x = t, this.#k.clear(), this.#f();
88
+ this.#C = i, this.#R = e?.seriesIndex ?? -1, this.#x = t, this.#k.clear(), this.#f();
89
89
  }
90
90
  setOptions(t) {
91
91
  this.#v = t, this.#D(), this.#f();
@@ -100,7 +100,7 @@ class G {
100
100
  t !== void 0 && (this.#s.style.height = `${t}px`);
101
101
  }
102
102
  destroy() {
103
- this.#e.off("viewportChange", this.#I), this.#e.off("overlayChange", this.#$), this.#e.off("tickFrame", this.#M), this.#t.removeEventListener("pointerdown", this.#L), this.#t.removeEventListener("pointermove", this.#V), this.#t.removeEventListener("pointerup", this.#y), this.#t.removeEventListener("pointercancel", this.#y), this.#t.removeEventListener("pointerleave", this.#N), this.#E.disconnect(), this.#p !== null && (cancelAnimationFrame(this.#p), this.#p = null), this.#t.remove(), this.#n.remove();
103
+ this.#e.off("viewportChange", this.#I), this.#e.off("overlayChange", this.#$), this.#e.off("tickFrame", this.#M), this.#t.removeEventListener("pointerdown", this.#L), this.#t.removeEventListener("pointermove", this.#N), this.#t.removeEventListener("pointerup", this.#y), this.#t.removeEventListener("pointercancel", this.#y), this.#t.removeEventListener("pointerleave", this.#V), this.#E.disconnect(), this.#p !== null && (cancelAnimationFrame(this.#p), this.#p = null), this.#t.remove(), this.#n.remove();
104
104
  }
105
105
  /** CSS pixel height of the strip — theme default unless overridden. */
106
106
  get height() {
@@ -108,10 +108,10 @@ class G {
108
108
  }
109
109
  // --- internals ---------------------------------------------------------
110
110
  /** Effective drawing width — the navigator reserves the main chart's
111
- * `yAxisWidth` on the Y-axis side so its active zone lines up with the
112
- * plot area. */
111
+ * Y-axis columns so its active zone lines up with the plot area. */
113
112
  get #i() {
114
- return Math.max(0, this.#A - this.#e.yAxisWidth);
113
+ const t = this.#e.getAxisColumnWidth("left") + this.#e.getAxisColumnWidth("right");
114
+ return Math.max(0, this.#F - t);
115
115
  }
116
116
  #j(t) {
117
117
  if (!t) return;
@@ -119,7 +119,7 @@ class G {
119
119
  i <= 0 || s <= 0 || (this.#W(i, s), this.#f());
120
120
  }
121
121
  #W(t, e) {
122
- this.#A = t, this.#m = e, this.#h = window.devicePixelRatio || 1, this.#X();
122
+ this.#F = t, this.#m = e, this.#h = window.devicePixelRatio || 1, this.#X();
123
123
  }
124
124
  /**
125
125
  * Write canvas backing-store / CSS sizes only when they actually changed —
@@ -160,7 +160,7 @@ class G {
160
160
  * compute against primed scales even on the opening gesture. */
161
161
  #P() {
162
162
  const t = this.#b(), e = this.#Z();
163
- return this.#u.update(t, this.#i, this.#h), this.#F.update(e, this.#m, this.#h), { xRange: t, yRange: e };
163
+ return this.#d.update(t, this.#i, this.#h), this.#A.update(e, this.#m, this.#h), { xRange: t, yRange: e };
164
164
  }
165
165
  /**
166
166
  * X range for the brush window. While the user drags the brush we track the
@@ -172,7 +172,7 @@ class G {
172
172
  return this.#g !== null ? this.#e.getVisibleRange() : this.#e.getAnimationState().xRange;
173
173
  }
174
174
  #S() {
175
- return this.#P(), M(this.#u, this.#Y(), this.#b());
175
+ return this.#P(), M(this.#d, this.#Y(), this.#b());
176
176
  }
177
177
  #H() {
178
178
  const t = this.#b(), e = t.to - t.from;
@@ -186,7 +186,7 @@ class G {
186
186
  if (h === 0) return;
187
187
  let l = this.#e.getVisibleRange();
188
188
  if (n.snapToCenter) {
189
- const r = this.#u.xToTime(e), a = E({ time: r, startVisible: l, xRange: i });
189
+ const r = this.#d.xToTime(e), a = E({ time: r, startVisible: l, xRange: i });
190
190
  this.#e.setVisibleRange(a), l = a;
191
191
  }
192
192
  this.#g = {
@@ -243,8 +243,8 @@ class G {
243
243
  i.save(), i.clearRect(0, 0, s, n), i.scale(this.#h, this.#h);
244
244
  const h = {
245
245
  ctx: i,
246
- timeScale: this.#u,
247
- yScale: this.#F,
246
+ timeScale: this.#d,
247
+ yScale: this.#A,
248
248
  mediaWidth: this.#i,
249
249
  mediaHeight: this.#m,
250
250
  theme: t
@@ -254,12 +254,12 @@ class G {
254
254
  this.#o !== null && (this.#o.tick(performance.now()), l = this.#o.current, this.#o.animating ? this.#f() : this.#o = null);
255
255
  const r = Math.max(1, Math.round(this.#i)), a = this.#x;
256
256
  if (a.type === "candlestick")
257
- V(h, this.#q(a.points, r, R), l);
257
+ N(h, this.#q(a.points, r, C), l);
258
258
  else {
259
- const c = f(a), g = c.length === 1, d = this.#C >= 0 ? this.#C : c.length - 1;
260
- for (let u = 0; u < c.length; u++) {
261
- const p = this.#q(c[u], r, C), m = u === d ? l : 1;
262
- a.type === "bar" ? N(h, p, m) : P(h, p, g, m);
259
+ const c = f(a), g = c.length === 1, u = this.#R >= 0 ? this.#R : c.length - 1;
260
+ for (let d = 0; d < c.length; d++) {
261
+ const p = this.#q(c[d], r, R), m = d === u ? l : 1;
262
+ a.type === "bar" ? V(h, p, m) : P(h, p, g, m);
263
263
  }
264
264
  }
265
265
  i.restore(), this.#G(t, e);
@@ -291,12 +291,12 @@ class G {
291
291
  }
292
292
  #G(t, e) {
293
293
  if (e.to <= e.from) return;
294
- const i = this.#Y(), s = Math.max(e.from, Math.min(e.to, i.from)), n = Math.max(e.from, Math.min(e.to, i.to)), h = this.#u.timeToX(s), l = this.#u.timeToX(n), r = Math.min(h, l), a = Math.max(h, l), c = Math.max(1, a - r);
295
- this.#d.style.width = `${r}px`, this.#d.style.background = t.mask.fill, this.#d.style.display = r > 0 ? "block" : "none";
294
+ const i = this.#Y(), s = Math.max(e.from, Math.min(e.to, i.from)), n = Math.max(e.from, Math.min(e.to, i.to)), h = this.#d.timeToX(s), l = this.#d.timeToX(n), r = Math.min(h, l), a = Math.max(h, l), c = Math.max(1, a - r);
295
+ this.#u.style.width = `${r}px`, this.#u.style.background = t.mask.fill, this.#u.style.display = r > 0 ? "block" : "none";
296
296
  const g = Math.max(0, this.#i - (r + c));
297
297
  this.#r.style.left = `${r + c}px`, this.#r.style.width = `${g}px`, this.#r.style.background = t.mask.fill, this.#r.style.display = g > 0 ? "block" : "none", this.#l.style.left = `${r}px`, this.#l.style.width = `${c}px`, this.#l.style.background = t.window.fill, this.#l.style.border = t.window.borderWidth > 0 ? `${t.window.borderWidth}px solid ${t.window.border}` : "none";
298
- const d = t.handle.width, u = Math.max(1, d / 2), p = this.#e.getTheme().background;
299
- this.#a.style.left = `${r - d / 2}px`, this.#a.style.width = `${d}px`, this.#a.style.background = t.handle.color, this.#a.style.borderRadius = `${u}px`, this.#c.style.left = `${r + c - d / 2}px`, this.#c.style.width = `${d}px`, this.#c.style.background = t.handle.color, this.#c.style.borderRadius = `${u}px`;
298
+ const u = t.handle.width, d = Math.max(1, u / 2), p = this.#e.getTheme().background;
299
+ this.#a.style.left = `${r - u / 2}px`, this.#a.style.width = `${u}px`, this.#a.style.background = t.handle.color, this.#a.style.borderRadius = `${d}px`, this.#c.style.left = `${r + c - u / 2}px`, this.#c.style.width = `${u}px`, this.#c.style.background = t.handle.color, this.#c.style.borderRadius = `${d}px`;
300
300
  for (const m of this.#a.children)
301
301
  m.style.background = p;
302
302
  for (const m of this.#c.children)
@@ -339,7 +339,7 @@ class G {
339
339
  function f(o) {
340
340
  return "series" in o ? o.series : [o.points];
341
341
  }
342
- function F(o) {
342
+ function A(o) {
343
343
  if (o.type === "candlestick") {
344
344
  const s = o.points.length;
345
345
  return s === 0 ? null : { time: o.points[s - 1].time, seriesIndex: -1 };
@@ -358,9 +358,9 @@ function v(o, t) {
358
358
  return o === "resize-left" || o === "resize-right" ? "ew-resize" : t ? "grabbing" : "grab";
359
359
  }
360
360
  function x(o, t) {
361
- return v(A(o, t), !1);
361
+ return v(F(o, t), !1);
362
362
  }
363
- function A(o, t) {
363
+ function F(o, t) {
364
364
  return b(o, t).gesture;
365
365
  }
366
366
  function y() {
@@ -10,7 +10,7 @@ function N(i) {
10
10
  ownsMonitor: !e
11
11
  };
12
12
  }
13
- const P = 100, z = 600, f = 250, F = 1e3 / 60, H = 1e3 / 120, m = 60, b = 4, L = 34, S = 64, j = 24;
13
+ const P = 100, z = 600, f = 250, F = 1e3 / 60, H = 1e3 / 120, m = 60, b = 4, j = 34, S = 64, L = 24;
14
14
  function I(i) {
15
15
  let e = 0;
16
16
  for (const t of i)
@@ -233,7 +233,7 @@ class D {
233
233
  }), this.element.insertBefore(this.sparkHost, this.element.firstChild)) : (Object.assign(this.sparkHost.style, {
234
234
  position: "relative",
235
235
  inset: "auto",
236
- height: `${L}px`,
236
+ height: `${j}px`,
237
237
  marginTop: "7px",
238
238
  borderRadius: "4px",
239
239
  opacity: "1",
@@ -308,7 +308,7 @@ class D {
308
308
  }
309
309
  /** Keeps the plateau below the FPS number (mini) or the Y tick (strip). */
310
310
  sparkPaddingTop() {
311
- return this.mode === "mini" ? j : 12;
311
+ return this.mode === "mini" ? L : 12;
312
312
  }
313
313
  /** Append one FPS sample to the sparkline chart and roll its window. */
314
314
  appendSpark(e) {
@@ -8,7 +8,7 @@ function f(s, t) {
8
8
  if (s[e] !== t[e]) return !1;
9
9
  return !0;
10
10
  }
11
- let m = class {
11
+ class m {
12
12
  #e = [];
13
13
  #r = [];
14
14
  #t = /* @__PURE__ */ new Map();
@@ -104,7 +104,7 @@ let m = class {
104
104
  reset() {
105
105
  this.#e = [], this.#r = [], this.#t.clear(), this.#s = !1;
106
106
  }
107
- };
107
+ }
108
108
  export {
109
109
  m as AxisTickTracker
110
110
  };