@wick-charts/vue 0.4.2 → 0.5.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 (144) hide show
  1. package/README.md +5 -3
  2. package/dist/BarSeries.vue.js +44 -0
  3. package/dist/BarSeries.vue2.js +4 -0
  4. package/dist/CandlestickSeries.vue.js +45 -0
  5. package/dist/CandlestickSeries.vue2.js +4 -0
  6. package/dist/ChartContainer.vue.js +168 -0
  7. package/dist/ChartContainer.vue2.js +4 -0
  8. package/dist/LineSeries.vue.js +44 -0
  9. package/dist/LineSeries.vue2.js +4 -0
  10. package/dist/PieSeries.vue.js +34 -0
  11. package/dist/PieSeries.vue2.js +4 -0
  12. package/dist/composables.js +44 -0
  13. package/dist/context.js +25 -0
  14. package/dist/core/dist/animation/animator.js +72 -0
  15. package/dist/core/dist/animation/config.js +145 -0
  16. package/dist/core/dist/animation/easing.js +4 -0
  17. package/dist/core/dist/animation/scalar-spring.js +57 -0
  18. package/dist/core/dist/animation/spring.js +11 -0
  19. package/dist/core/dist/animation/time.js +19 -0
  20. package/dist/core/dist/animation/viewport-engine.js +174 -0
  21. package/dist/core/dist/animation/visible-range-spring.js +64 -0
  22. package/dist/core/dist/animation/y-range-hermite.js +72 -0
  23. package/dist/core/dist/animation/y-range-snap.js +31 -0
  24. package/dist/core/dist/animation/y-range-spring.js +59 -0
  25. package/dist/core/dist/axis/dom-labels.js +60 -0
  26. package/dist/core/dist/canvas-manager.js +109 -0
  27. package/dist/core/dist/chart/edge-indicators.js +26 -0
  28. package/dist/core/dist/chart/fit-to-data.js +9 -0
  29. package/dist/core/dist/chart/last-value.js +31 -0
  30. package/dist/core/dist/chart/options.js +35 -0
  31. package/dist/core/dist/chart/pan-zoom-math.js +66 -0
  32. package/dist/core/dist/chart/streaming-cadence.js +70 -0
  33. package/dist/core/dist/chart/streaming-target.js +22 -0
  34. package/dist/core/dist/chart/viewport-padding.js +6 -0
  35. package/dist/core/dist/chart/y-target.js +24 -0
  36. package/dist/core/dist/chart.js +1495 -0
  37. package/dist/core/dist/components/crosshair.js +9 -0
  38. package/dist/core/dist/components/edge-indicator.js +36 -0
  39. package/dist/core/dist/components/grid.js +22 -0
  40. package/dist/core/dist/components/marker.js +41 -0
  41. package/dist/core/dist/components/reference-line.js +48 -0
  42. package/dist/core/dist/components/time-region.js +35 -0
  43. package/dist/core/dist/data/decimation.js +54 -0
  44. package/dist/core/dist/data/store.js +76 -0
  45. package/dist/core/dist/data/sync.js +47 -0
  46. package/dist/core/dist/events.js +19 -0
  47. package/dist/core/dist/interactions/handler.js +84 -0
  48. package/dist/core/dist/interactions/pan.js +26 -0
  49. package/dist/core/dist/interactions/zoom.js +21 -0
  50. package/dist/core/dist/navigator/controller.js +374 -0
  51. package/dist/core/dist/navigator/decimate.js +44 -0
  52. package/dist/core/dist/navigator/interactions.js +28 -0
  53. package/dist/core/dist/navigator/render.js +68 -0
  54. package/dist/core/dist/perf/counting-context.js +19 -0
  55. package/dist/core/dist/perf/perf-hud.js +453 -0
  56. package/dist/core/dist/perf/perf-monitor.js +132 -0
  57. package/dist/core/dist/render-scheduler.js +31 -0
  58. package/dist/core/dist/scales/tick-tracker.js +110 -0
  59. package/dist/core/dist/scales/x-scale.js +145 -0
  60. package/dist/core/dist/scales/y-scale.js +156 -0
  61. package/dist/core/dist/series/bar.js +341 -0
  62. package/dist/core/dist/series/base-multi-layer.js +438 -0
  63. package/dist/core/dist/series/candlestick.js +481 -0
  64. package/dist/core/dist/series/definition.js +11 -0
  65. package/dist/core/dist/series/line.js +446 -0
  66. package/dist/core/dist/series/painters/builtins.js +36 -0
  67. package/dist/core/dist/series/painters/canvas-path.js +79 -0
  68. package/dist/core/dist/series/painters/resolve.js +32 -0
  69. package/dist/core/dist/series/pie.js +545 -0
  70. package/dist/core/dist/series/register-builtins.js +11 -0
  71. package/dist/core/dist/series/stack-math.js +17 -0
  72. package/dist/core/dist/snapshots.js +107 -0
  73. package/dist/core/dist/theme/create.js +176 -0
  74. package/dist/core/dist/theme/resolve.js +14 -0
  75. package/dist/core/dist/theme/themes/andromeda.js +33 -0
  76. package/dist/core/dist/theme/themes/ayu-mirage.js +33 -0
  77. package/dist/core/dist/theme/themes/catppuccin.js +33 -0
  78. package/dist/core/dist/theme/themes/dracula.js +35 -0
  79. package/dist/core/dist/theme/themes/github-light.js +34 -0
  80. package/dist/core/dist/theme/themes/gruvbox.js +33 -0
  81. package/dist/core/dist/theme/themes/handwritten.js +101 -0
  82. package/dist/core/dist/theme/themes/high-contrast.js +33 -0
  83. package/dist/core/dist/theme/themes/lavender-mist.js +33 -0
  84. package/dist/core/dist/theme/themes/light-pink.js +34 -0
  85. package/dist/core/dist/theme/themes/material-palenight.js +33 -0
  86. package/dist/core/dist/theme/themes/minimal-light.js +34 -0
  87. package/dist/core/dist/theme/themes/mint-breeze.js +33 -0
  88. package/dist/core/dist/theme/themes/monokai-pro.js +33 -0
  89. package/dist/core/dist/theme/themes/night-owl.js +35 -0
  90. package/dist/core/dist/theme/themes/one-dark-pro.js +33 -0
  91. package/dist/core/dist/theme/themes/panda.js +33 -0
  92. package/dist/core/dist/theme/themes/peach-cream.js +33 -0
  93. package/dist/core/dist/theme/themes/quiet-light.js +37 -0
  94. package/dist/core/dist/theme/themes/rose-pine-dawn.js +33 -0
  95. package/dist/core/dist/theme/themes/sand-dune.js +33 -0
  96. package/dist/core/dist/theme/themes/solarized-light.js +34 -0
  97. package/dist/core/dist/tooltip-position.js +10 -0
  98. package/dist/core/dist/utils/color.js +37 -0
  99. package/dist/core/dist/utils/format.js +29 -0
  100. package/dist/core/dist/utils/math.js +26 -0
  101. package/dist/core/dist/utils/poisoned-data-reporter.js +15 -0
  102. package/dist/core/dist/utils/time.js +41 -0
  103. package/dist/index.d.ts +827 -63
  104. package/dist/index.js +142 -8025
  105. package/dist/ui/Crosshair.vue.js +53 -0
  106. package/dist/ui/Crosshair.vue2.js +4 -0
  107. package/dist/ui/InfoBar.vue.js +143 -0
  108. package/dist/ui/InfoBar.vue2.js +4 -0
  109. package/dist/ui/Legend.vue.js +212 -0
  110. package/dist/ui/Legend.vue2.js +4 -0
  111. package/dist/ui/Marker.vue.js +47 -0
  112. package/dist/ui/Marker.vue2.js +4 -0
  113. package/dist/ui/Navigator.vue.js +58 -0
  114. package/dist/ui/Navigator.vue2.js +4 -0
  115. package/dist/ui/NumberFlow.vue.js +69 -0
  116. package/dist/ui/NumberFlow.vue2.js +4 -0
  117. package/dist/ui/PieLegend.vue.js +132 -0
  118. package/dist/ui/PieLegend.vue2.js +4 -0
  119. package/dist/ui/PieTooltip.vue.js +135 -0
  120. package/dist/ui/PieTooltip.vue2.js +4 -0
  121. package/dist/ui/ReferenceLine.vue.js +44 -0
  122. package/dist/ui/ReferenceLine.vue2.js +4 -0
  123. package/dist/ui/TimeAxis.vue.js +43 -0
  124. package/dist/ui/TimeAxis.vue2.js +4 -0
  125. package/dist/ui/TimeRegion.vue.js +41 -0
  126. package/dist/ui/TimeRegion.vue2.js +4 -0
  127. package/dist/ui/Title.vue.js +54 -0
  128. package/dist/ui/Title.vue2.js +4 -0
  129. package/dist/ui/Tooltip.vue.js +195 -0
  130. package/dist/ui/Tooltip.vue2.js +4 -0
  131. package/dist/ui/YAxis.vue.js +42 -0
  132. package/dist/ui/YAxis.vue2.js +4 -0
  133. package/dist/ui/YLabel.vue.js +105 -0
  134. package/dist/ui/YLabel.vue2.js +4 -0
  135. package/package.json +2 -2
  136. package/src/BarSeries.vue +12 -13
  137. package/src/CandlestickSeries.vue +17 -6
  138. package/src/LineSeries.vue +12 -13
  139. package/src/PieSeries.vue +2 -1
  140. package/src/index.ts +23 -0
  141. package/src/ui/Legend.vue +1 -2
  142. package/src/ui/Marker.vue +62 -0
  143. package/src/ui/ReferenceLine.vue +58 -0
  144. package/src/ui/TimeRegion.vue +54 -0
@@ -0,0 +1,53 @@
1
+ import { defineComponent as v, ref as d, onMounted as f, onUnmounted as h, computed as n, unref as t, openBlock as y, createElementBlock as g, Fragment as x, createElementVNode as m, normalizeStyle as c, toDisplayString as u, createCommentVNode as b } from "vue";
2
+ import { formatTime as C } from "../core/dist/utils/time.js";
3
+ import { useCrosshairPosition as k } from "../composables.js";
4
+ import { useChartInstance as S } from "../context.js";
5
+ const F = /* @__PURE__ */ v({
6
+ __name: "Crosshair",
7
+ setup(_) {
8
+ const e = S(), o = k(e), r = d(0), l = () => {
9
+ r.value++;
10
+ };
11
+ f(() => e.on("overlayChange", l)), h(() => e.off("overlayChange", l));
12
+ const a = n(() => (r.value, e.getTheme())), i = n(() => e.getDataInterval()), p = n(() => (o.value, e.timeScale.niceTickValues(i.value).tickInterval || i.value)), s = n(() => ({
13
+ // Blend the theme's labelBackground at 80% opacity so the axis grid
14
+ // shows through — keeps the badge from looking like an opaque block
15
+ // while still masking whatever tick sits underneath.
16
+ background: `color-mix(in srgb, ${a.value.crosshair.labelBackground} 80%, transparent)`,
17
+ color: a.value.crosshair.labelTextColor,
18
+ fontSize: a.value.axis.fontSize + "px",
19
+ fontFamily: a.value.typography.fontFamily,
20
+ fontVariantNumeric: "tabular-nums",
21
+ padding: "2px 6px",
22
+ borderRadius: "2px",
23
+ whiteSpace: "nowrap",
24
+ pointerEvents: "none",
25
+ // Sit above axis ticks (z:0) but below the YLabel badge (z:3) so the
26
+ // live last-value stays visible when the crosshair crosses its row.
27
+ zIndex: 2
28
+ }));
29
+ return (I, z) => t(o) ? (y(), g(x, { key: 0 }, [
30
+ m("div", {
31
+ style: c({
32
+ position: "absolute",
33
+ right: "0",
34
+ top: t(o).mediaY + "px",
35
+ transform: "translateY(-50%)",
36
+ ...s.value
37
+ })
38
+ }, u(t(e).yScale.formatY(t(o).y)), 5),
39
+ m("div", {
40
+ style: c({
41
+ position: "absolute",
42
+ bottom: "0",
43
+ left: t(o).mediaX + "px",
44
+ transform: "translateX(-50%)",
45
+ ...s.value
46
+ })
47
+ }, u(t(C)(t(o).time, p.value)), 5)
48
+ ], 64)) : b("", !0);
49
+ }
50
+ });
51
+ export {
52
+ F as default
53
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Crosshair.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,143 @@
1
+ import { defineComponent as T, computed as n, inject as B, ref as V, onMounted as N, onUnmounted as W, useSlots as A, unref as e, openBlock as l, createBlock as O, Teleport as D, createElementVNode as r, normalizeStyle as i, renderSlot as M, createElementBlock as s, Fragment as p, toDisplayString as f, renderList as _, createCommentVNode as F } from "vue";
2
+ import { buildHoverSnapshots as P, buildLastSnapshots as R } from "../core/dist/snapshots.js";
3
+ import { resolveCandlestickBodyColor as $ } from "../core/dist/theme/resolve.js";
4
+ import { formatCompact as j, formatPriceAdaptive as U } from "../core/dist/utils/format.js";
5
+ import { formatTime as q } from "../core/dist/utils/time.js";
6
+ import { useCrosshairPosition as G } from "../composables.js";
7
+ import { useChartInstance as J, ThemeKey as Q, InfoBarAnchorKey as X } from "../context.js";
8
+ const Y = {
9
+ key: 0,
10
+ style: { display: "inline-flex", alignItems: "center", gap: "4px" }
11
+ }, Z = {
12
+ key: 1,
13
+ style: { display: "inline-flex", alignItems: "center", gap: "3px" }
14
+ }, ie = /* @__PURE__ */ T({
15
+ __name: "InfoBar",
16
+ props: {
17
+ sort: {},
18
+ format: { type: Function }
19
+ },
20
+ setup(L) {
21
+ const C = L, b = n(() => C.sort ?? "none"), y = n(
22
+ () => C.format ?? ((o, w) => w === "volume" ? j(o) : U(o))
23
+ ), u = J(), h = G(u), a = B(Q), g = B(X);
24
+ if (!a)
25
+ throw new Error("<InfoBar> must be used within <ChartContainer>: missing ThemeKey.");
26
+ if (!g)
27
+ throw new Error("<InfoBar> must be used within <ChartContainer>: missing InfoBarAnchorKey.");
28
+ const v = V(0), k = () => {
29
+ v.value++;
30
+ };
31
+ N(() => {
32
+ u.on("overlayChange", k), u.getSeriesIds().length > 0 && v.value++;
33
+ }), W(() => {
34
+ u.off("overlayChange", k);
35
+ });
36
+ const x = n(() => {
37
+ v.value;
38
+ const o = h.value;
39
+ return o === null ? null : P(u, { time: o.time, sort: b.value, cacheKey: "infobar-hover" });
40
+ }), E = n(() => (v.value, R(u, { sort: b.value, cacheKey: "infobar-last" }))), c = n(() => x.value !== null && x.value.length > 0), m = n(
41
+ () => c.value ? x.value : E.value
42
+ ), K = n(() => u.getDataInterval()), S = n(() => m.value.length === 0 ? 0 : c.value && h.value ? h.value.time : Math.max(...m.value.map((o) => o.data.time))), z = A(), I = n(() => typeof z.default == "function");
43
+ function H(o) {
44
+ return "open" in o;
45
+ }
46
+ return (o, w) => e(g) && e(a) && m.value.length > 0 ? (l(), O(D, {
47
+ key: 0,
48
+ to: e(g)
49
+ }, [
50
+ r("div", {
51
+ "data-tooltip-legend": "",
52
+ style: i(
53
+ I.value ? {
54
+ display: "flex",
55
+ alignItems: "center",
56
+ flexShrink: 0,
57
+ fontSize: e(a).typography.fontSize + "px",
58
+ fontFamily: e(a).typography.fontFamily,
59
+ fontVariantNumeric: "tabular-nums",
60
+ opacity: c.value ? 1 : 0.6,
61
+ transition: "opacity 0.2s ease",
62
+ pointerEvents: "none"
63
+ } : {
64
+ display: "flex",
65
+ alignItems: "center",
66
+ gap: "4px",
67
+ flexWrap: "wrap",
68
+ padding: "4px 8px",
69
+ flexShrink: 0,
70
+ fontSize: e(a).typography.fontSize + "px",
71
+ fontFamily: e(a).typography.fontFamily,
72
+ fontVariantNumeric: "tabular-nums",
73
+ opacity: c.value ? 1 : 0.6,
74
+ transition: "opacity 0.2s ease",
75
+ pointerEvents: "none"
76
+ }
77
+ )
78
+ }, [
79
+ I.value ? M(o.$slots, "default", {
80
+ key: 0,
81
+ snapshots: m.value,
82
+ time: S.value,
83
+ isHover: c.value
84
+ }) : (l(), s(p, { key: 1 }, [
85
+ r("span", {
86
+ style: i({ color: e(a).axis.textColor, marginRight: "2px" })
87
+ }, f(e(q)(S.value, K.value)), 5),
88
+ (l(!0), s(p, null, _(m.value, (t) => (l(), s(p, {
89
+ key: t.id
90
+ }, [
91
+ H(t.data) ? (l(), s("span", Y, [
92
+ (l(!0), s(p, null, _([
93
+ { label: "O", field: "open", val: t.data.open },
94
+ { label: "H", field: "high", val: t.data.high },
95
+ { label: "L", field: "low", val: t.data.low },
96
+ { label: "C", field: "close", val: t.data.close }
97
+ ], (d) => (l(), s(p, {
98
+ key: d.label
99
+ }, [
100
+ r("span", {
101
+ style: i({ color: e(a).axis.textColor, opacity: 0.5, marginLeft: "5px" })
102
+ }, f(d.label), 5),
103
+ r("span", {
104
+ style: i({
105
+ color: e($)(
106
+ t.data.close >= t.data.open ? e(a).candlestick.up.body : e(a).candlestick.down.body
107
+ ),
108
+ fontWeight: 500,
109
+ marginLeft: "2px"
110
+ })
111
+ }, f(y.value(d.val, d.field)), 5)
112
+ ], 64))), 128)),
113
+ t.data.volume != null ? (l(), s(p, { key: 0 }, [
114
+ r("span", {
115
+ style: i({ color: e(a).axis.textColor, opacity: 0.5, marginLeft: "5px" })
116
+ }, "V", 4),
117
+ r("span", {
118
+ style: i({ color: e(a).axis.textColor, fontWeight: 500, marginLeft: "2px" })
119
+ }, f(y.value(t.data.volume, "volume")), 5)
120
+ ], 64)) : F("", !0)
121
+ ])) : (l(), s("span", Z, [
122
+ r("span", {
123
+ style: i({
124
+ width: "6px",
125
+ height: "6px",
126
+ borderRadius: "50%",
127
+ background: t.color,
128
+ flexShrink: 0
129
+ })
130
+ }, null, 4),
131
+ r("span", {
132
+ style: i({ color: t.color, fontWeight: 500 })
133
+ }, f(y.value(t.data.value, "value")), 5)
134
+ ]))
135
+ ], 64))), 128))
136
+ ], 64))
137
+ ], 4)
138
+ ], 8, ["to"])) : F("", !0);
139
+ }
140
+ });
141
+ export {
142
+ ie as default
143
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./InfoBar.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,212 @@
1
+ import { defineComponent as W, inject as C, computed as k, ref as E, onMounted as H, onUnmounted as N, useSlots as M, unref as a, openBlock as g, createBlock as U, Teleport as q, createElementBlock as u, normalizeStyle as f, renderSlot as G, Fragment as F, renderList as A, createElementVNode as b, toDisplayString as $, createCommentVNode as j } from "vue";
2
+ import { useChartInstance as J, ThemeKey as O, LegendAnchorKey as P, LegendRightAnchorKey as Q } from "../context.js";
3
+ const X = ["data-legend"], Y = ["data-legend"], Z = { style: { "white-space": "nowrap" } }, _ = ["data-legend"], ee = ["onClick"], te = { style: { "white-space": "nowrap" } }, le = /* @__PURE__ */ W({
4
+ __name: "Legend",
5
+ props: {
6
+ items: {},
7
+ position: { default: "bottom" },
8
+ mode: { default: "toggle" }
9
+ },
10
+ setup(t) {
11
+ const S = t, i = J(), l = C(O), I = C(P), w = C(Q);
12
+ if (!l)
13
+ throw new Error("<Legend> must be used within <ChartContainer>: missing ThemeKey.");
14
+ if (!I || !w)
15
+ throw new Error("<Legend> must be used within <ChartContainer>: missing legend anchors.");
16
+ const L = k(() => S.position === "right" ? w.value : I.value), h = E(null), v = E(0), V = () => {
17
+ v.value++;
18
+ }, D = () => {
19
+ h.value = null;
20
+ };
21
+ H(() => {
22
+ i.on("overlayChange", V), i.on("seriesChange", D), i.getSeriesIds().length > 0 && v.value++;
23
+ }), N(() => {
24
+ i.off("overlayChange", V), i.off("seriesChange", D);
25
+ });
26
+ function z(n) {
27
+ const { id: d, seriesId: e, layerIndex: s, label: o, color: p, isDisabled: x } = n;
28
+ return { id: d, seriesId: e, layerIndex: s, label: o, color: p, isDisabled: x, toggle: () => {
29
+ s !== void 0 ? i.setLayerVisible(e, s, !i.isLayerVisible(e, s)) : i.setSeriesVisible(e, !i.isSeriesVisible(e));
30
+ }, isolate: () => {
31
+ if (h.value === d) {
32
+ i.batch(() => {
33
+ for (const r of i.getSeriesIds()) {
34
+ i.setSeriesVisible(r, !0);
35
+ const y = i.getSeriesLayers(r);
36
+ if (y)
37
+ for (let c = 0; c < y.length; c++) i.setLayerVisible(r, c, !0);
38
+ }
39
+ }), h.value = null;
40
+ return;
41
+ }
42
+ i.batch(() => {
43
+ for (const r of i.getSeriesIds()) {
44
+ const y = i.getSeriesLayers(r);
45
+ if (y) {
46
+ i.setSeriesVisible(r, r === e);
47
+ for (let c = 0; c < y.length; c++)
48
+ i.setLayerVisible(r, c, r === e && c === s);
49
+ } else
50
+ i.setSeriesVisible(r, r === d);
51
+ }
52
+ }), h.value = d;
53
+ } };
54
+ }
55
+ function K(n) {
56
+ const d = [];
57
+ for (const e of n.getSeriesIds()) {
58
+ const s = n.getSeriesLayers(e);
59
+ if (s)
60
+ for (let o = 0; o < s.length; o++) {
61
+ const p = `${e}_layer${o}`, x = n.isSeriesVisible(e) && n.isLayerVisible(e, o);
62
+ d.push(
63
+ z({
64
+ id: p,
65
+ seriesId: e,
66
+ layerIndex: o,
67
+ label: n.getLayerLabel(e, o) ?? `Series ${o + 1}`,
68
+ color: s[o].color,
69
+ isDisabled: !x
70
+ })
71
+ );
72
+ }
73
+ else {
74
+ const o = n.getSeriesColor(e);
75
+ if (!o) continue;
76
+ const p = n.getSeriesLabel(e), x = n.isSeriesVisible(e);
77
+ d.push(
78
+ z({
79
+ id: e,
80
+ seriesId: e,
81
+ layerIndex: void 0,
82
+ label: p ?? "Series",
83
+ color: o,
84
+ isDisabled: !x
85
+ })
86
+ );
87
+ }
88
+ }
89
+ return d;
90
+ }
91
+ const m = k(() => (v.value, h.value, K(i))), B = M(), R = k(() => typeof B.default == "function");
92
+ function T(n) {
93
+ S.mode === "isolate" || S.mode === "solo" ? n.isolate() : n.toggle();
94
+ }
95
+ return (n, d) => L.value && a(l) ? (g(), U(q, {
96
+ key: 0,
97
+ to: L.value
98
+ }, [
99
+ R.value && m.value.length > 0 ? (g(), u("div", {
100
+ key: 0,
101
+ "data-legend": t.position,
102
+ style: f({
103
+ display: "flex",
104
+ flexDirection: t.position === "right" ? "column" : "row",
105
+ flexWrap: "wrap",
106
+ gap: t.position === "right" ? "6px" : "14px",
107
+ padding: t.position === "right" ? "8px 6px" : "6px 8px",
108
+ alignItems: t.position === "right" ? "flex-start" : "center",
109
+ justifyContent: t.position === "right" ? "flex-start" : "center",
110
+ fontFamily: a(l).typography.fontFamily,
111
+ fontSize: a(l).axis.fontSize + "px",
112
+ color: a(l).axis.textColor,
113
+ pointerEvents: "auto",
114
+ flexShrink: 0
115
+ })
116
+ }, [
117
+ G(n.$slots, "default", { items: m.value })
118
+ ], 12, X)) : t.items && t.items.length > 0 ? (g(), u("div", {
119
+ key: 1,
120
+ "data-legend": t.position,
121
+ style: f({
122
+ display: "flex",
123
+ flexDirection: t.position === "right" ? "column" : "row",
124
+ flexWrap: "wrap",
125
+ gap: t.position === "right" ? "6px" : "14px",
126
+ padding: t.position === "right" ? "8px 6px" : "6px 8px",
127
+ alignItems: t.position === "right" ? "flex-start" : "center",
128
+ justifyContent: t.position === "right" ? "flex-start" : "center",
129
+ fontFamily: a(l).typography.fontFamily,
130
+ fontSize: a(l).axis.fontSize + "px",
131
+ color: a(l).axis.textColor,
132
+ pointerEvents: "auto",
133
+ flexShrink: 0
134
+ })
135
+ }, [
136
+ (g(!0), u(F, null, A(t.items, (e, s) => (g(), u("div", {
137
+ key: s,
138
+ style: {
139
+ display: "flex",
140
+ alignItems: "center",
141
+ gap: "4px",
142
+ userSelect: "none"
143
+ }
144
+ }, [
145
+ b("span", {
146
+ style: f({
147
+ width: "8px",
148
+ height: "8px",
149
+ borderRadius: "2px",
150
+ background: e.color,
151
+ flexShrink: 0
152
+ })
153
+ }, null, 4),
154
+ b("span", Z, $(e.label), 1)
155
+ ]))), 128))
156
+ ], 12, Y)) : m.value.length > 0 ? (g(), u("div", {
157
+ key: 2,
158
+ "data-legend": t.position,
159
+ style: f({
160
+ display: "flex",
161
+ flexDirection: t.position === "right" ? "column" : "row",
162
+ flexWrap: "wrap",
163
+ gap: t.position === "right" ? "6px" : "14px",
164
+ padding: t.position === "right" ? "8px 6px" : "6px 8px",
165
+ alignItems: t.position === "right" ? "flex-start" : "center",
166
+ justifyContent: t.position === "right" ? "flex-start" : "center",
167
+ fontFamily: a(l).typography.fontFamily,
168
+ fontSize: a(l).axis.fontSize + "px",
169
+ color: a(l).axis.textColor,
170
+ pointerEvents: "auto",
171
+ flexShrink: 0
172
+ })
173
+ }, [
174
+ (g(!0), u(F, null, A(m.value, (e) => (g(), u("button", {
175
+ key: e.id,
176
+ type: "button",
177
+ onClick: (s) => T(e),
178
+ style: f({
179
+ display: "flex",
180
+ alignItems: "center",
181
+ gap: "4px",
182
+ cursor: "pointer",
183
+ opacity: e.isDisabled ? 0.35 : 1,
184
+ transition: "opacity 0.15s ease",
185
+ userSelect: "none",
186
+ border: "none",
187
+ background: "transparent",
188
+ padding: 0,
189
+ margin: 0,
190
+ font: "inherit",
191
+ color: "inherit",
192
+ textAlign: "left"
193
+ })
194
+ }, [
195
+ b("span", {
196
+ style: f({
197
+ width: "8px",
198
+ height: "8px",
199
+ borderRadius: "2px",
200
+ background: e.color,
201
+ flexShrink: 0
202
+ })
203
+ }, null, 4),
204
+ b("span", te, $(e.label), 1)
205
+ ], 12, ee))), 128))
206
+ ], 12, _)) : j("", !0)
207
+ ], 8, ["to"])) : j("", !0);
208
+ }
209
+ });
210
+ export {
211
+ le as default
212
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Legend.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,47 @@
1
+ import { defineComponent as s, onMounted as o, onUnmounted as t, watch as u, createCommentVNode as n } from "vue";
2
+ import { useChartInstance as p } from "../context.js";
3
+ const h = /* @__PURE__ */ s({
4
+ __name: "Marker",
5
+ props: {
6
+ time: {},
7
+ value: {},
8
+ seriesId: {},
9
+ shape: {},
10
+ pulse: { type: Boolean },
11
+ label: {},
12
+ color: {}
13
+ },
14
+ setup(a) {
15
+ const e = a, r = p();
16
+ let l = null;
17
+ return o(() => {
18
+ l = r.addMarker({
19
+ time: e.time,
20
+ value: e.value,
21
+ seriesId: e.seriesId,
22
+ shape: e.shape,
23
+ pulse: e.pulse,
24
+ label: e.label,
25
+ color: e.color
26
+ });
27
+ }), t(() => {
28
+ l !== null && r.removeMarker(l), l = null;
29
+ }), u(
30
+ () => [e.time, e.value, e.seriesId, e.shape, e.pulse, e.label, e.color],
31
+ () => {
32
+ l !== null && r.updateMarker(l, {
33
+ time: e.time,
34
+ value: e.value,
35
+ seriesId: e.seriesId,
36
+ shape: e.shape,
37
+ pulse: e.pulse,
38
+ label: e.label,
39
+ color: e.color
40
+ });
41
+ }
42
+ ), (i, m) => n("", !0);
43
+ }
44
+ });
45
+ export {
46
+ h as default
47
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Marker.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,58 @@
1
+ import { defineComponent as f, inject as n, ref as m, shallowRef as d, computed as p, watch as i, onBeforeUnmount as g, unref as u, openBlock as y, createBlock as _, Teleport as w, createElementVNode as C, normalizeStyle as N, createCommentVNode as k } from "vue";
2
+ import { NavigatorController as R } from "../core/dist/navigator/controller.js";
3
+ import { NavigatorAnchorKey as x, ChartKey as B, ThemeKey as K } from "../context.js";
4
+ const V = /* @__PURE__ */ f({
5
+ __name: "Navigator",
6
+ props: {
7
+ data: {},
8
+ height: {}
9
+ },
10
+ setup(c) {
11
+ const t = c, a = n(x), l = n(B), h = n(K);
12
+ if (!a || !l || !h)
13
+ throw new Error("<Navigator> must be used within <ChartContainer>.");
14
+ const s = m(null), o = d(null), v = p(() => t.height ?? h.value.navigator.height);
15
+ return i(
16
+ [s, () => l.value],
17
+ ([e, r]) => {
18
+ !e || !r || o.value || (o.value = new R({
19
+ container: e,
20
+ chart: r,
21
+ data: t.data,
22
+ options: t.height !== void 0 ? { height: t.height } : void 0
23
+ }));
24
+ },
25
+ { flush: "post", immediate: !0 }
26
+ ), i(
27
+ () => t.data,
28
+ (e) => {
29
+ o.value?.setData(e);
30
+ }
31
+ ), i(
32
+ () => t.height,
33
+ (e) => {
34
+ o.value?.setOptions(e !== void 0 ? { height: e } : {});
35
+ }
36
+ ), g(() => {
37
+ o.value?.destroy(), o.value = null;
38
+ }), (e, r) => u(a) ? (y(), _(w, {
39
+ key: 0,
40
+ to: u(a)
41
+ }, [
42
+ C("div", {
43
+ ref_key: "stripRef",
44
+ ref: s,
45
+ "data-chart-navigator": "",
46
+ style: N({
47
+ position: "relative",
48
+ width: "100%",
49
+ height: v.value + "px",
50
+ flexShrink: 0
51
+ })
52
+ }, null, 4)
53
+ ], 8, ["to"])) : k("", !0);
54
+ }
55
+ });
56
+ export {
57
+ V as default
58
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Navigator.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as _, ref as b, onMounted as g, computed as c, openBlock as o, createElementBlock as l, Fragment as r, renderList as f, createElementVNode as m, normalizeStyle as k, toDisplayString as p } from "vue";
2
+ const x = { style: {
3
+ display: "inline-flex",
4
+ fontVariantNumeric: "tabular-nums",
5
+ lineHeight: 1.2
6
+ } }, D = {
7
+ key: 0,
8
+ style: {
9
+ display: "inline-block",
10
+ height: "1.2em",
11
+ overflow: "hidden",
12
+ position: "relative"
13
+ }
14
+ }, F = {
15
+ key: 1,
16
+ style: { display: "inline-block" }
17
+ }, w = /* @__PURE__ */ _({
18
+ __name: "NumberFlow",
19
+ props: {
20
+ value: {},
21
+ format: {},
22
+ locale: { default: "en-US" },
23
+ spinDuration: { default: 350 }
24
+ },
25
+ setup(a) {
26
+ const s = a, i = b(!1);
27
+ g(() => {
28
+ i.value = !0;
29
+ });
30
+ const d = c(() => {
31
+ const t = s.format;
32
+ if (typeof t == "function") return t;
33
+ const n = new Intl.NumberFormat(s.locale, typeof t == "object" ? t : void 0);
34
+ return (e) => n.format(e);
35
+ }), y = c(() => {
36
+ const t = d.value(s.value), n = [];
37
+ for (const e of t)
38
+ e >= "0" && e <= "9" ? n.push({ type: "digit", value: e }) : n.push({ type: "symbol", value: e });
39
+ return n;
40
+ }), v = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
41
+ return (t, n) => (o(), l("span", x, [
42
+ (o(!0), l(r, null, f(y.value, (e, h) => (o(), l(r, { key: h }, [
43
+ e.type === "digit" ? (o(), l("span", D, [
44
+ m("span", {
45
+ style: k({
46
+ display: "flex",
47
+ flexDirection: "column",
48
+ transform: "translateY(" + -parseInt(e.value) * 1.2 + "em)",
49
+ transition: i.value ? "transform " + a.spinDuration + "ms cubic-bezier(0.16, 1, 0.3, 1)" : "none"
50
+ })
51
+ }, [
52
+ (o(), l(r, null, f(v, (u) => m("span", {
53
+ key: u,
54
+ style: {
55
+ display: "flex",
56
+ alignItems: "center",
57
+ justifyContent: "center",
58
+ height: "1.2em"
59
+ }
60
+ }, p(u), 1)), 64))
61
+ ], 4)
62
+ ])) : (o(), l("span", F, p(e.value), 1))
63
+ ], 64))), 128))
64
+ ]));
65
+ }
66
+ });
67
+ export {
68
+ w as default
69
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./NumberFlow.vue.js";
2
+ export {
3
+ f as default
4
+ };