@wick-charts/vue 0.3.4 → 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/README.md +3 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +1907 -1850
- package/package.json +2 -2
- package/src/ChartContainer.vue +14 -5
- package/src/ui/Title.vue +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wick-charts/vue",
|
|
3
|
-
"version": "0.3.
|
|
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.
|
|
48
|
+
"@wick-charts/core": "^0.3.6"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "vite build"
|
package/src/ChartContainer.vue
CHANGED
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
ChartInstance,
|
|
6
6
|
type ChartOptions,
|
|
7
7
|
type ChartTheme,
|
|
8
|
-
|
|
8
|
+
type EdgeReachedInfo,
|
|
9
|
+
catppuccin,
|
|
9
10
|
} from '@wick-charts/core';
|
|
10
11
|
import { computed, nextTick, onMounted, onUnmounted, provide, ref, shallowRef, watch } from 'vue';
|
|
11
12
|
|
|
@@ -67,9 +68,16 @@ 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
|
-
theme: () =>
|
|
80
|
+
theme: () => catppuccin.theme,
|
|
73
81
|
gradient: true,
|
|
74
82
|
headerLayout: 'overlay',
|
|
75
83
|
},
|
|
@@ -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