@wick-charts/vue 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +45 -6
  2. package/dist/BarSeries.vue.js +26 -20
  3. package/dist/CandlestickSeries.vue.js +30 -24
  4. package/dist/ChartContainer.vue.js +125 -72
  5. package/dist/HeatmapSeries.vue.js +40 -0
  6. package/dist/HeatmapSeries.vue2.js +4 -0
  7. package/dist/LineSeries.vue.js +26 -20
  8. package/dist/PieSeries.vue.js +24 -18
  9. package/dist/core/dist/animation/animator.js +21 -21
  10. package/dist/core/dist/animation/config.js +114 -87
  11. package/dist/core/dist/animation/easing.js +3 -1
  12. package/dist/core/dist/animation/intro-wave.js +68 -0
  13. package/dist/core/dist/axis/dom-labels.js +13 -14
  14. package/dist/core/dist/chart/badge-animator.js +56 -0
  15. package/dist/core/dist/chart/edge-indicators.js +28 -13
  16. package/dist/core/dist/chart/last-value.js +18 -17
  17. package/dist/core/dist/chart/options.js +27 -16
  18. package/dist/core/dist/chart/y-target.js +13 -12
  19. package/dist/core/dist/chart.js +868 -441
  20. package/dist/core/dist/components/annotation-chip.js +28 -0
  21. package/dist/core/dist/components/crosshair.js +8 -6
  22. package/dist/core/dist/components/edge-indicator.js +58 -26
  23. package/dist/core/dist/components/loading-indicator.js +46 -0
  24. package/dist/core/dist/components/marker.js +49 -31
  25. package/dist/core/dist/components/reference-line.js +27 -36
  26. package/dist/core/dist/components/time-region.js +30 -28
  27. package/dist/core/dist/data/store.js +38 -19
  28. package/dist/core/dist/data/sync.js +60 -38
  29. package/dist/core/dist/heatmap-tooltip.js +16 -0
  30. package/dist/core/dist/interactions/handler.js +86 -46
  31. package/dist/core/dist/perf/perf-hud.js +5 -5
  32. package/dist/core/dist/scales/x-scale.js +85 -37
  33. package/dist/core/dist/scales/y-scale.js +38 -27
  34. package/dist/core/dist/series/bar-intro.js +18 -0
  35. package/dist/core/dist/series/bar.js +337 -205
  36. package/dist/core/dist/series/base-multi-layer.js +224 -96
  37. package/dist/core/dist/series/candlestick-intro.js +57 -0
  38. package/dist/core/dist/series/candlestick.js +454 -276
  39. package/dist/core/dist/series/heatmap.js +387 -0
  40. package/dist/core/dist/series/line-intro.js +85 -0
  41. package/dist/core/dist/series/line.js +590 -282
  42. package/dist/core/dist/series/painters/builtins.js +2 -2
  43. package/dist/core/dist/series/pie.js +396 -259
  44. package/dist/core/dist/series/register-builtins.js +8 -7
  45. package/dist/core/dist/series/types.js +6 -0
  46. package/dist/core/dist/series/wave-intro.js +26 -0
  47. package/dist/core/dist/theme/create.js +69 -63
  48. package/dist/core/dist/theme/themes/mint-breeze.js +2 -2
  49. package/dist/core/dist/theme/themes/sand-dune.js +2 -2
  50. package/dist/core/dist/utils/color.js +109 -34
  51. package/dist/core/dist/utils/deep-equal.js +18 -0
  52. package/dist/core/dist/utils/time.js +25 -19
  53. package/dist/index.d.ts +1494 -122
  54. package/dist/index.js +177 -130
  55. package/dist/ui/Crosshair.vue.js +20 -21
  56. package/dist/ui/HeatmapTooltip.vue.js +96 -0
  57. package/dist/ui/HeatmapTooltip.vue2.js +4 -0
  58. package/dist/ui/InfoBar.vue.js +46 -47
  59. package/dist/ui/Legend.vue.js +80 -79
  60. package/dist/ui/PieLegend.vue.js +5 -5
  61. package/dist/ui/PieTooltip.vue.js +77 -67
  62. package/dist/ui/Tooltip.vue.js +60 -60
  63. package/dist/ui/YAxis.vue.js +2 -2
  64. package/dist/ui/YLabel.vue.js +94 -61
  65. package/package.json +2 -2
  66. package/src/BarSeries.vue +23 -7
  67. package/src/CandlestickSeries.vue +23 -7
  68. package/src/ChartContainer.vue +250 -13
  69. package/src/HeatmapSeries.vue +69 -0
  70. package/src/LineSeries.vue +23 -7
  71. package/src/PieSeries.vue +22 -6
  72. package/src/index.ts +84 -3
  73. package/src/ui/Crosshair.vue +1 -2
  74. package/src/ui/HeatmapTooltip.vue +144 -0
  75. package/src/ui/InfoBar.vue +1 -2
  76. package/src/ui/Legend.vue +13 -0
  77. package/src/ui/Marker.vue +1 -1
  78. package/src/ui/PieTooltip.vue +10 -0
  79. package/src/ui/ReferenceLine.vue +2 -2
  80. package/src/ui/TimeRegion.vue +2 -2
  81. package/src/ui/Tooltip.vue +2 -2
  82. package/src/ui/YLabel.vue +123 -8
@@ -1,31 +1,32 @@
1
+ import { isTimeSeriesRenderer as c } from "../series/types.js";
1
2
  const a = (e) => "close" in e ? e.close : e.value;
2
- function f(e, i, l) {
3
- const t = i.find((c) => c.id === e);
3
+ function d(e, s, i) {
4
+ const t = s.find((f) => f.id === e);
4
5
  if (!t) return null;
5
6
  const n = t.renderer;
6
- if (n.kind === "pie") return null;
7
+ if (!c(n)) return null;
7
8
  const r = n.getLastDataPoint();
8
9
  if (!r) return null;
9
- const { from: u, to: o } = l;
10
+ const { from: u, to: o } = i;
10
11
  if (r.time >= u && r.time <= o)
11
12
  return { value: a(r), isLive: !0 };
12
- const s = n.getVisibleDataPoints(u, o);
13
- return s.length === 0 ? null : { value: a(s[s.length - 1]), isLive: !1 };
13
+ const l = n.getVisibleDataPoints(u, o);
14
+ return l.length === 0 ? null : { value: a(l[l.length - 1]), isLive: !1 };
14
15
  }
15
- function d(e, i, l) {
16
- const t = i.find((r) => r.id === e);
17
- return t ? t.renderer.getStackedLastValue?.() || f(e, i, l) : null;
16
+ function v(e, s, i) {
17
+ const t = s.find((r) => r.id === e);
18
+ return t ? t.renderer.getStackedLastValue?.() || d(e, s, i) : null;
18
19
  }
19
- function g(e, i) {
20
- const l = i.find((r) => r.id === e);
21
- if (!l) return null;
22
- const t = l.renderer;
23
- if (t.kind === "pie") return null;
20
+ function L(e, s) {
21
+ const i = s.find((r) => r.id === e);
22
+ if (!i) return null;
23
+ const t = i.renderer;
24
+ if (!c(t)) return null;
24
25
  const n = t.getSecondLastDataPoint();
25
26
  return n ? "close" in n ? n.close : n.value : null;
26
27
  }
27
28
  export {
28
- f as getLastValue,
29
- g as getPreviousClose,
30
- d as getStackedLastValue
29
+ d as getLastValue,
30
+ L as getPreviousClose,
31
+ v as getStackedLastValue
31
32
  };
@@ -1,5 +1,15 @@
1
- import { DEFAULT_MAX_VISIBLE_BARS as o, MIN_VISIBLE_BARS as n } from "./pan-zoom-math.js";
2
- function s(t) {
1
+ import { DEFAULT_MAX_VISIBLE_BARS as i, MIN_VISIBLE_BARS as r } from "./pan-zoom-math.js";
2
+ function n(t) {
3
+ return t === void 0 || !Number.isFinite(t) || t <= 0 ? 0 : t;
4
+ }
5
+ function a(t) {
6
+ return {
7
+ top: n(t?.top),
8
+ right: t?.right === void 0 ? null : n(t.right),
9
+ left: n(t?.left)
10
+ };
11
+ }
12
+ function l(t) {
3
13
  if (!t) return { monitor: null, ownsMonitor: !1, hud: null };
4
14
  if (typeof t != "object" || !("monitor" in t || "recordFrame" in t))
5
15
  throw new Error(
@@ -7,29 +17,30 @@ function s(t) {
7
17
  );
8
18
  return "recordFrame" in t ? { monitor: t, ownsMonitor: !1, hud: null } : { monitor: t.monitor, ownsMonitor: t.ownsMonitor ?? !1, hud: t.hud ?? null };
9
19
  }
10
- const r = {
20
+ const e = {
11
21
  top: 20,
12
22
  bottom: 20,
13
23
  right: { intervals: 3 },
14
24
  left: { intervals: 0 }
15
25
  };
16
- function a(t) {
26
+ function f(t) {
17
27
  return {
18
- top: t?.top ?? r.top,
19
- bottom: t?.bottom ?? r.bottom,
20
- right: t?.right ?? r.right,
21
- left: t?.left ?? r.left
28
+ top: t?.top ?? e.top,
29
+ bottom: t?.bottom ?? e.bottom,
30
+ right: t?.right ?? e.right,
31
+ left: t?.left ?? e.left
22
32
  };
23
33
  }
24
- function f(t, e) {
25
- return typeof t == "number" && typeof e == "number" ? t === e : typeof t == "object" && typeof e == "object" ? t.intervals === e.intervals : !1;
34
+ function u(t, o) {
35
+ return typeof t == "number" && typeof o == "number" ? t === o : typeof t == "object" && typeof o == "object" ? t.intervals === o.intervals : !1;
26
36
  }
27
- function l(t) {
28
- return t === void 0 ? o : Number.isFinite(t) ? Math.max(n, Math.floor(t)) : o;
37
+ function m(t) {
38
+ return t === void 0 ? i : Number.isFinite(t) ? Math.max(r, Math.floor(t)) : i;
29
39
  }
30
40
  export {
31
- f as isSameHorizontalPadding,
32
- l as resolveMaxVisibleBars,
33
- a as resolvePadding,
34
- s as resolvePerfOptions
41
+ u as isSameHorizontalPadding,
42
+ a as resolveFade,
43
+ m as resolveMaxVisibleBars,
44
+ f as resolvePadding,
45
+ l as resolvePerfOptions
35
46
  };
@@ -1,24 +1,25 @@
1
- function f(e, r, u) {
1
+ import { isTimeSeriesRenderer as m } from "../series/types.js";
2
+ function c(e, t, i) {
2
3
  let o = 1 / 0, a = -1 / 0;
3
- for (const n of r) {
4
- if (!n.visible || n.renderer.kind === "pie") continue;
5
- const t = n.renderer.getValueRange(e.from, e.to);
6
- t && (t.max > a && (a = t.max), t.min < o && (o = t.min), u?.push(t.min, t.max));
4
+ for (const n of t) {
5
+ if (!n.visible || !m(n.renderer)) continue;
6
+ const r = n.renderer.getValueRange(e.from, e.to);
7
+ r && (r.max > a && (a = r.max), r.min < o && (o = r.min), i?.push(r.min, r.max));
7
8
  }
8
9
  return o === 1 / 0 || a === -1 / 0 ? null : { min: o, max: a };
9
10
  }
10
- function m(e, r, u, o, a) {
11
- if (e === void 0 || e === "auto") return r;
11
+ function p(e, t, i, o, a) {
12
+ if (e === void 0 || e === "auto") return t;
12
13
  if (typeof e == "number") return e;
13
14
  if (typeof e == "function") return e(o);
14
15
  const n = String(e).match(/^([+-]?)\s*(\d+(?:\.\d+)?)\s*%$/);
15
16
  if (n) {
16
- const t = n[1] === "-" ? -1 : 1, i = parseFloat(n[2]) / 100, s = Math.abs(u - r) || Math.abs(r) || 1;
17
- return r + t * i * s * (a === "max" ? 1 : -1);
17
+ const r = n[1] === "-" ? -1 : 1, s = parseFloat(n[2]) / 100, u = Math.abs(i - t) || Math.abs(t) || 1;
18
+ return t + r * s * u * (a === "max" ? 1 : -1);
18
19
  }
19
- return r;
20
+ return t;
20
21
  }
21
22
  export {
22
- f as computeTargetYRange,
23
- m as resolveBound
23
+ c as computeTargetYRange,
24
+ p as resolveBound
24
25
  };