@wick-charts/vue 0.6.2 → 0.6.4

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 (61) hide show
  1. package/README.md +2 -2
  2. package/dist/BandSeries.vue.js +50 -0
  3. package/dist/BandSeries.vue2.js +4 -0
  4. package/dist/ChartContainer.vue.js +45 -39
  5. package/dist/composables.js +39 -26
  6. package/dist/core/dist/animation/config.js +92 -75
  7. package/dist/core/dist/axis/dom-labels.js +56 -43
  8. package/dist/core/dist/chart/badge-animator.js +30 -22
  9. package/dist/core/dist/chart/edge-indicators.js +22 -21
  10. package/dist/core/dist/chart/last-value.js +33 -26
  11. package/dist/core/dist/chart/options.js +5 -5
  12. package/dist/core/dist/chart/scale-guards.js +26 -0
  13. package/dist/core/dist/chart/y-target.js +46 -19
  14. package/dist/core/dist/chart.js +670 -518
  15. package/dist/core/dist/components/crosshair.js +8 -8
  16. package/dist/core/dist/components/grid.js +26 -17
  17. package/dist/core/dist/components/marker.js +28 -28
  18. package/dist/core/dist/components/reference-line.js +16 -16
  19. package/dist/core/dist/data/decimation.js +58 -39
  20. package/dist/core/dist/interactions/handler.js +3 -2
  21. package/dist/core/dist/interactions/zoom.js +6 -5
  22. package/dist/core/dist/navigator/controller.js +47 -44
  23. package/dist/core/dist/perf/perf-hud.js +3 -3
  24. package/dist/core/dist/scales/log-scale.js +76 -0
  25. package/dist/core/dist/scales/y-scale.js +134 -35
  26. package/dist/core/dist/series/band.js +670 -0
  27. package/dist/core/dist/series/bar-intro.js +11 -11
  28. package/dist/core/dist/series/bar.js +301 -251
  29. package/dist/core/dist/series/base-multi-layer.js +100 -76
  30. package/dist/core/dist/series/candlestick.js +238 -235
  31. package/dist/core/dist/series/heatmap.js +5 -5
  32. package/dist/core/dist/series/line-intro.js +50 -40
  33. package/dist/core/dist/series/line.js +561 -483
  34. package/dist/core/dist/series/painters/builtins.js +4 -4
  35. package/dist/core/dist/series/painters/canvas-path.js +64 -52
  36. package/dist/core/dist/series/register-builtins.js +9 -8
  37. package/dist/core/dist/series/scale-stack.js +25 -0
  38. package/dist/core/dist/snapshots.js +36 -35
  39. package/dist/core/dist/tooltip-position.js +5 -5
  40. package/dist/core/dist/utils/point.js +10 -0
  41. package/dist/index.d.ts +501 -128
  42. package/dist/index.js +195 -189
  43. package/dist/ui/Crosshair.vue.js +14 -14
  44. package/dist/ui/HeatmapTooltip.vue.js +6 -6
  45. package/dist/ui/InfoBar.vue.js +100 -81
  46. package/dist/ui/PieTooltip.vue.js +4 -4
  47. package/dist/ui/TimeAxis.vue.js +23 -22
  48. package/dist/ui/Tooltip.vue.js +140 -111
  49. package/dist/ui/YAxis.vue.js +25 -24
  50. package/dist/ui/YLabel.vue.js +63 -70
  51. package/package.json +2 -2
  52. package/src/BandSeries.vue +87 -0
  53. package/src/ChartContainer.vue +20 -8
  54. package/src/composables.ts +35 -1
  55. package/src/index.ts +13 -0
  56. package/src/ui/Crosshair.vue +2 -2
  57. package/src/ui/InfoBar.vue +20 -1
  58. package/src/ui/TimeAxis.vue +7 -4
  59. package/src/ui/Tooltip.vue +40 -3
  60. package/src/ui/YAxis.vue +5 -3
  61. package/src/ui/YLabel.vue +5 -16
@@ -5,7 +5,7 @@ import { sampleRamp as Y, deriveHeatmapRamp as st, mixColors as et, isLightColor
5
5
  import { formatCompact as ot } from "../utils/format.js";
6
6
  import { clamp as v, smoothToward as z } from "../utils/math.js";
7
7
  import { fillRoundedRect as nt } from "./painters/canvas-path.js";
8
- const P = {
8
+ const E = {
9
9
  fontSize: 10
10
10
  };
11
11
  function ht(r, s) {
@@ -20,9 +20,9 @@ const lt = {
20
20
  updateMs: Q
21
21
  };
22
22
  function rt(r) {
23
- return r === void 0 || r === !1 ? !1 : r === !0 ? P : { ...P, ...r };
23
+ return r === void 0 || r === !1 ? !1 : r === !0 ? E : { ...E, ...r };
24
24
  }
25
- function E(r, s) {
25
+ function P(r, s) {
26
26
  const t = {
27
27
  ...r,
28
28
  ...s,
@@ -92,7 +92,7 @@ class ct {
92
92
  /** Data extent cached by {@link #rebuildGrid} — see {@link #domain}. */
93
93
  #M = { min: 0, max: 1 };
94
94
  constructor(s, t) {
95
- this.#t = E(lt, s ?? {}), this.#r = this.#t.entryMs === 0, this.#g = t ?? null;
95
+ this.#t = P(lt, s ?? {}), this.#r = this.#t.entryMs === 0, this.#g = t ?? null;
96
96
  }
97
97
  // --- Data ingest -----------------------------------------------------------
98
98
  setData(s) {
@@ -118,7 +118,7 @@ class ct {
118
118
  }
119
119
  updateOptions(s) {
120
120
  const t = this.#t.columns, e = this.#t.rows;
121
- this.#t = E(this.#t, s ?? {}), (this.#t.columns !== t || this.#t.rows !== e) && this.#b(), this.#t.entryMs === 0 && (this.#r = !0), this.#t.updateMs === 0 && (this.#u = !1), this.#o = null;
121
+ this.#t = P(this.#t, s ?? {}), (this.#t.columns !== t || this.#t.rows !== e) && this.#b(), this.#t.entryMs === 0 && (this.#r = !0), this.#t.updateMs === 0 && (this.#u = !1), this.#o = null;
122
122
  }
123
123
  // --- Layer model (single-layer no-ops, mirroring pie) ----------------------
124
124
  getLayerCount() {
@@ -3,59 +3,59 @@ function l(e) {
3
3
  return e <= 0 ? 0 : e >= 1 ? 1 : e;
4
4
  }
5
5
  function g(e) {
6
- const o = f(e.progress), t = e.range.from + o * (e.range.to - e.range.from);
6
+ const n = f(e.progress), t = e.range.from + n * (e.range.to - e.range.from);
7
7
  return { x: e.timeToX(t), time: t };
8
8
  }
9
- function X(e = {}) {
10
- const o = e.head ?? !0;
9
+ function I(e = {}) {
10
+ const n = e.head ?? !0;
11
11
  return (t) => {
12
12
  const r = g(t);
13
- return { clip: { toX: r.x }, heads: o ? [r] : void 0 };
13
+ return { clip: { toX: r.x }, heads: n ? [r] : void 0 };
14
14
  };
15
15
  }
16
- function y(e = {}) {
17
- const o = Math.min(l(e.stagger ?? 0.35), 0.9);
16
+ function v(e = {}) {
17
+ const n = Math.min(l(e.stagger ?? 0.35), 0.9);
18
18
  return (t) => ({
19
- value: ({ layerIndex: r, value: u, position: a }) => {
20
- const s = t.layerMean(r);
21
- if (s === null || !Number.isFinite(u)) return u;
22
- const n = l((t.progress - o * a) / (1 - o));
23
- return s + (u - s) * d(n);
19
+ value: ({ layerIndex: r, value: s, position: u }) => {
20
+ const i = t.layerMean(r);
21
+ if (i === null || !Number.isFinite(s)) return s;
22
+ const o = l((t.progress - n * u) / (1 - n));
23
+ return t.lerpValue(i, s, d(o));
24
24
  }
25
25
  });
26
26
  }
27
- function T() {
28
- const e = X();
29
- return (o) => {
30
- if (o.stacking !== "off") return e(o);
31
- const t = o.primaryPath();
32
- if (t === null || t.length < 2) return e(o);
27
+ function y() {
28
+ const e = I();
29
+ return (n) => {
30
+ if (n.stacking !== "off") return e(n);
31
+ const t = n.primaryPath();
32
+ if (t === null || t.length < 2) return e(n);
33
33
  let r = 0;
34
- const u = [];
35
- for (let n = 1; n < t.length; n++) {
36
- const i = Math.hypot(t[n].x - t[n - 1].x, t[n].y - t[n - 1].y);
37
- u.push(i), r += i;
34
+ const s = [];
35
+ for (let o = 1; o < t.length; o++) {
36
+ const a = Math.hypot(t[o].x - t[o - 1].x, t[o].y - t[o - 1].y);
37
+ s.push(a), r += a;
38
38
  }
39
- if (r <= 0) return e(o);
40
- let a = o.progress * r;
41
- for (let n = 1; n < t.length; n++) {
42
- const i = u[n - 1];
43
- if (a > i) {
44
- a -= i;
39
+ if (r <= 0) return e(n);
40
+ let u = n.progress * r;
41
+ for (let o = 1; o < t.length; o++) {
42
+ const a = s[o - 1];
43
+ if (u > a) {
44
+ u -= a;
45
45
  continue;
46
46
  }
47
- const h = i > 0 ? a / i : 1, c = t[n - 1], p = t[n], m = c.x + (p.x - c.x) * h, x = c.time + (p.time - c.time) * h;
47
+ const p = a > 0 ? u / a : 1, c = t[o - 1], h = t[o], m = c.x + (h.x - c.x) * p, x = c.time + (h.time - c.time) * p;
48
48
  return { clip: { toX: m }, heads: [{ x: m, time: x }] };
49
49
  }
50
- const s = t[t.length - 1];
51
- return { clip: { toX: s.x }, heads: [{ x: s.x, time: s.time }] };
50
+ const i = t[t.length - 1];
51
+ return { clip: { toX: i.x }, heads: [{ x: i.x, time: i.time }] };
52
52
  };
53
53
  }
54
- function w(e = {}) {
55
- const o = l(e.ghostAlpha ?? 0.18);
54
+ function T(e = {}) {
55
+ const n = l(e.ghostAlpha ?? 0.18);
56
56
  return (t) => {
57
57
  const r = g(t);
58
- return { clip: { toX: r.x }, heads: [r], ghostAlpha: o };
58
+ return { clip: { toX: r.x }, heads: [r], ghostAlpha: n };
59
59
  };
60
60
  }
61
61
  function b() {
@@ -63,9 +63,9 @@ function b() {
63
63
  clip: { toX: f(e.progress) * e.width }
64
64
  });
65
65
  }
66
- function k() {
66
+ function w() {
67
67
  return (e) => {
68
- const o = f(e.progress), t = e.width / 2, r = t * o;
68
+ const n = f(e.progress), t = e.width / 2, r = t * n;
69
69
  return {
70
70
  clip: { fromX: t - r, toX: t + r },
71
71
  heads: [
@@ -75,11 +75,21 @@ function k() {
75
75
  };
76
76
  };
77
77
  }
78
+ function M(e, n) {
79
+ const t = n.getTransform();
80
+ let r = 0, s = 0;
81
+ for (const i of e)
82
+ n.isPlottable(i.value) && (r += t === null ? i.value : t.forward(i.value), s++);
83
+ if (s === 0) return null;
84
+ const u = r / s;
85
+ return t === null ? u : t.inverse(u);
86
+ }
78
87
  export {
79
88
  b as backfillSweepIntro,
80
- k as centerOutIntro,
81
- T as plotterIntro,
82
- X as sweepIntro,
83
- w as traceIntro,
84
- y as unfoldIntro
89
+ w as centerOutIntro,
90
+ y as plotterIntro,
91
+ M as scaleMean,
92
+ I as sweepIntro,
93
+ T as traceIntro,
94
+ v as unfoldIntro
85
95
  };