@wick-charts/vue 0.3.5 → 0.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wick-charts/vue",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "High-performance canvas timeseries charts for Vue — candlestick, line, bar, pie. Tree-shakeable, zero runtime deps.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "vue": ">=3.3.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@wick-charts/core": "^0.3.5"
48
+ "@wick-charts/core": "^0.3.6"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "vite build"
@@ -5,6 +5,7 @@ import {
5
5
  ChartInstance,
6
6
  type ChartOptions,
7
7
  type ChartTheme,
8
+ type EdgeReachedInfo,
8
9
  catppuccin,
9
10
  } from '@wick-charts/core';
10
11
  import { computed, nextTick, onMounted, onUnmounted, provide, ref, shallowRef, watch } from 'vue';
@@ -67,6 +68,13 @@ const props = withDefaults(
67
68
  * later changes are ignored.
68
69
  */
69
70
  perf?: PerfOption;
71
+ /**
72
+ * Fired after the user releases a pan/zoom gesture that pulled the viewport
73
+ * past a data edge by more than ~10% of the visible range. Hosts typically
74
+ * respond by prefetching more history. Captured at mount only; changing
75
+ * the prop identity later is ignored.
76
+ */
77
+ onEdgeReached?: (info: EdgeReachedInfo) => void;
70
78
  }>(),
71
79
  {
72
80
  theme: () => catppuccin.theme,
@@ -82,6 +90,8 @@ const themeRef = shallowRef<ChartTheme>(props.theme);
82
90
  // Capture perf at mount only — mirrors React's perfRef so a new object
83
91
  // identity later doesn't recreate the chart.
84
92
  const perfAtMount = props.perf;
93
+ // Same mount-only capture for the edge callback — the chart binds it once.
94
+ const onEdgeReachedAtMount = props.onEdgeReached;
85
95
 
86
96
  const topOverlayRef = ref<HTMLElement | null>(null);
87
97
  const titleAnchor = ref<HTMLElement | null>(null);
@@ -152,6 +162,7 @@ onMounted(async () => {
152
162
  if (props.interactive !== undefined) options.interactive = props.interactive;
153
163
  if (props.grid !== undefined) options.grid = props.grid;
154
164
  if (perfAtMount !== undefined) options.perf = perfAtMount;
165
+ if (onEdgeReachedAtMount) options.onEdgeReached = onEdgeReachedAtMount;
155
166
  if (props.animations !== undefined) options.animations = props.animations;
156
167
  chart.value = new ChartInstance(containerRef.value, options);
157
168
 
@@ -231,9 +242,7 @@ const rootStyle = computed(() => {
231
242
  const t = themeRef.value;
232
243
  const [gtop, gbot] = t?.chartGradient ?? ['transparent', 'transparent'];
233
244
  const bg = t?.background ?? 'transparent';
234
- const background = props.gradient
235
- ? `linear-gradient(to bottom, ${gtop} 0%, ${bg} 70%, ${gbot} 100%)`
236
- : bg;
245
+ const background = props.gradient ? `linear-gradient(to bottom, ${gtop} 0%, ${bg} 70%, ${gbot} 100%)` : bg;
237
246
 
238
247
  return (
239
248
  'position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; ' +
package/src/ui/Title.vue CHANGED
@@ -59,7 +59,7 @@ if (!theme) {
59
59
  display: 'flex',
60
60
  alignItems: 'baseline',
61
61
  gap: '6px',
62
- padding: '6px 8px 4px',
62
+ padding: '6px 8px 0',
63
63
  flexShrink: 0,
64
64
  fontFamily: theme.typography.fontFamily,
65
65
  fontSize: theme.typography.fontSize + 'px',