vue-chrts 0.1.12-test.2 → 0.2.0-beta.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.
- package/dist/components/AreaChart/AreaChart.js +99 -99
- package/dist/components/AreaChart/AreaChart.vue.d.ts +10 -3
- package/dist/components/AreaChart/types.d.ts +43 -13
- package/dist/components/AreaStackedChart/AreaStackedChart.js +20 -23
- package/dist/components/AreaStackedChart/types.d.ts +18 -0
- package/dist/components/BarChart/BarChart.js +117 -62
- package/dist/components/BarChart/BarChart.vue.d.ts +10 -3
- package/dist/components/BarChart/types.d.ts +13 -5
- package/dist/components/DonutChart/DonutChart.js +56 -31
- package/dist/components/DonutChart/DonutChart.vue.d.ts +16 -12
- package/dist/components/DonutChart/types.d.ts +7 -3
- package/dist/components/LineChart/LineChart.js +79 -60
- package/dist/components/LineChart/LineChart.vue.d.ts +10 -3
- package/dist/components/LineChart/types.d.ts +46 -16
- package/dist/components/Tooltip.vue.d.ts +2 -2
- package/dist/types.d.ts +8 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +30 -5
- package/package.json +3 -5
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Position as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as U, useSlots as j, useTemplateRef as w, ref as R, computed as d, createElementBlock as c, openBlock as a, normalizeClass as T, createVNode as u, createCommentVNode as p, createElementVNode as X, unref as i, withCtx as x, createBlock as m, Fragment as L, renderList as S, mergeProps as C, renderSlot as b } from "vue";
|
|
2
|
+
import { Position as A, CurveType as B } from "@unovis/ts";
|
|
3
|
+
import { createMarkers as Y, getFirstPropertyValue as z } from "../../utils.js";
|
|
4
|
+
import I from "../Tooltip.js";
|
|
5
|
+
import { VisXYContainer as H, VisTooltip as K, VisArea as q, VisLine as J, VisAxis as D, VisCrosshair as Q, VisBulletLegend as Z } from "@unovis/vue";
|
|
6
|
+
import { LegendPosition as _ } from "../../types.js";
|
|
7
|
+
const ee = {
|
|
8
|
+
ref: "slotWrapper",
|
|
9
|
+
class: "hidden"
|
|
10
|
+
}, y = 24, V = 4, te = 0.5, F = "#3b82f6", se = /* @__PURE__ */ U({
|
|
8
11
|
__name: "AreaChart",
|
|
9
12
|
props: {
|
|
10
13
|
data: {},
|
|
11
14
|
height: {},
|
|
12
15
|
xLabel: {},
|
|
13
16
|
yLabel: {},
|
|
14
|
-
padding: { default: () => ({
|
|
15
|
-
top: 5,
|
|
16
|
-
right: 5,
|
|
17
|
-
bottom: 5,
|
|
18
|
-
left: 5
|
|
19
|
-
}) },
|
|
17
|
+
padding: { default: () => ({ top: 5, right: 5, bottom: 5, left: 5 }) },
|
|
20
18
|
categories: {},
|
|
19
|
+
markerConfig: {},
|
|
21
20
|
xFormatter: {},
|
|
22
21
|
yFormatter: {},
|
|
23
22
|
curveType: {},
|
|
24
|
-
|
|
23
|
+
lineWidth: { default: 2 },
|
|
24
|
+
lineDashArray: {},
|
|
25
|
+
xNumTicks: { default: (n) => n.data.length > y ? y / V : n.data.length - 1 },
|
|
25
26
|
xExplicitTicks: {},
|
|
26
27
|
minMaxTicksOnly: { type: Boolean },
|
|
27
|
-
yNumTicks: { default: (n) => n.data.length >
|
|
28
|
+
yNumTicks: { default: (n) => n.data.length > y ? y / V : n.data.length - 1 },
|
|
28
29
|
hideLegend: { type: Boolean },
|
|
29
30
|
hideTooltip: { type: Boolean },
|
|
30
31
|
legendPosition: {},
|
|
@@ -35,129 +36,128 @@ const m = 24, B = 4, z = 0.5, C = "#3b82f6", Z = /* @__PURE__ */ O({
|
|
|
35
36
|
xGridLine: { type: Boolean },
|
|
36
37
|
yGridLine: { type: Boolean },
|
|
37
38
|
hideXAxis: { type: Boolean },
|
|
38
|
-
hideYAxis: { type: Boolean }
|
|
39
|
+
hideYAxis: { type: Boolean },
|
|
40
|
+
crosshairConfig: { default: () => ({
|
|
41
|
+
color: "#666"
|
|
42
|
+
}) }
|
|
39
43
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
emits: ["click"],
|
|
45
|
+
setup(n, { emit: $ }) {
|
|
46
|
+
const G = $, r = n, O = j(), h = w("slotWrapper"), s = R(), f = d(
|
|
47
|
+
() => Object.values(r.categories).map((e) => e.color)
|
|
48
|
+
), N = d(() => r.markerConfig ? Y(r.markerConfig) : ""), g = d(() => r.legendPosition === _.Top), E = d(() => {
|
|
49
|
+
const e = (t, o) => `
|
|
50
|
+
<linearGradient id="gradient${t}-${o}" gradientTransform="rotate(90)">
|
|
51
|
+
<stop offset="0%" stop-color="${o}" stop-opacity="1" />
|
|
52
|
+
<stop offset="100%" stop-color="${o}" stop-opacity="0" />
|
|
53
|
+
</linearGradient>
|
|
54
|
+
`, l = (t, o) => `
|
|
55
|
+
<linearGradient id="gradient${t}-${o}" gradientTransform="rotate(90)">
|
|
56
|
+
<stop offset="0%" style="stop-color:var(--vis-color0);stop-opacity:1" />
|
|
57
|
+
<stop offset="100%" style="stop-color:var(--vis-color0);stop-opacity:0" />
|
|
58
|
+
</linearGradient>
|
|
59
|
+
`;
|
|
60
|
+
return f.value.map(
|
|
61
|
+
(t, o) => t != null && t.includes("#") ? e(o, t) : l(o, t ?? F)
|
|
62
|
+
).join("");
|
|
57
63
|
});
|
|
58
|
-
function
|
|
59
|
-
var
|
|
64
|
+
function P(e) {
|
|
65
|
+
var l;
|
|
60
66
|
return {
|
|
61
|
-
y: (
|
|
62
|
-
color: ((
|
|
67
|
+
y: (t) => Number(t[e]),
|
|
68
|
+
color: ((l = r.categories[e]) == null ? void 0 : l.color) ?? F
|
|
63
69
|
};
|
|
64
70
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
67
|
-
<linearGradient id="gradient${e}-${t}" gradientTransform="rotate(90)">
|
|
68
|
-
<stop offset="0%" style="stop-color:var(--vis-color0);stop-opacity:1" />
|
|
69
|
-
<stop offset="100%" style="stop-color:var(--vis-color0);stop-opacity:0" />
|
|
70
|
-
</linearGradient>
|
|
71
|
-
`;
|
|
71
|
+
function W(e) {
|
|
72
|
+
return typeof window > "u" ? "" : h.value ? h.value.innerHTML : "";
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
75
|
-
<linearGradient id="gradient${e}-${t}" gradientTransform="rotate(90)">
|
|
76
|
-
<stop offset="0%" stop-color="${t}" stop-opacity="1" />
|
|
77
|
-
<stop offset="100%" stop-color="${t}" stop-opacity="0" />
|
|
78
|
-
</linearGradient>
|
|
79
|
-
`;
|
|
74
|
+
function M(e) {
|
|
75
|
+
return s.value = e, W();
|
|
80
76
|
}
|
|
81
|
-
|
|
82
|
-
(
|
|
83
|
-
|
|
84
|
-
).join("")
|
|
85
|
-
), k = g(
|
|
86
|
-
() => a.legendPosition === Y.Top
|
|
87
|
-
);
|
|
88
|
-
return (e, t) => (o(), c("div", {
|
|
89
|
-
class: T(["flex flex-col space-y-4", { "flex-col-reverse": k.value }])
|
|
77
|
+
return (e, l) => (a(), c("div", {
|
|
78
|
+
class: T(["flex flex-col", { "flex-col-reverse": g.value, markers: !!r.markerConfig }]),
|
|
79
|
+
onClick: l[0] || (l[0] = (t) => G("click", t, s.value))
|
|
90
80
|
}, [
|
|
91
|
-
|
|
81
|
+
u(i(H), {
|
|
92
82
|
data: e.data,
|
|
93
83
|
height: e.height,
|
|
94
84
|
padding: e.padding,
|
|
95
|
-
"svg-defs":
|
|
85
|
+
"svg-defs": E.value + N.value
|
|
96
86
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
e.hideTooltip ?
|
|
87
|
+
default: x(() => [
|
|
88
|
+
e.hideTooltip ? p("", !0) : (a(), m(i(K), {
|
|
99
89
|
key: 0,
|
|
100
|
-
"horizontal-placement": i(
|
|
101
|
-
"vertical-placement": i(
|
|
90
|
+
"horizontal-placement": i(A).Right,
|
|
91
|
+
"vertical-placement": i(A).Top
|
|
102
92
|
}, null, 8, ["horizontal-placement", "vertical-placement"])),
|
|
103
|
-
(
|
|
104
|
-
|
|
105
|
-
x: (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"curve-type": e.curveType ?? i(L).MonotoneX
|
|
93
|
+
(a(!0), c(L, null, S(Object.keys(r.categories), (t, o) => (a(), c(L, { key: t }, [
|
|
94
|
+
u(i(q), C({
|
|
95
|
+
x: (k, v) => v
|
|
96
|
+
}, { ref_for: !0 }, P(t), {
|
|
97
|
+
color: `url(#gradient${o}-${f.value[o]})`,
|
|
98
|
+
opacity: te,
|
|
99
|
+
"curve-type": e.curveType ?? i(B).MonotoneX
|
|
111
100
|
}), null, 16, ["x", "color", "curve-type"]),
|
|
112
|
-
|
|
113
|
-
x: (
|
|
114
|
-
y: (
|
|
115
|
-
color:
|
|
116
|
-
"curve-type": e.curveType ?? i(
|
|
117
|
-
|
|
101
|
+
u(i(J), {
|
|
102
|
+
x: (k, v) => v,
|
|
103
|
+
y: (k) => k[t],
|
|
104
|
+
color: f.value[o],
|
|
105
|
+
"curve-type": e.curveType ?? i(B).MonotoneX,
|
|
106
|
+
"line-width": e.lineWidth,
|
|
107
|
+
lineDashArray: e.lineDashArray
|
|
108
|
+
}, null, 8, ["x", "y", "color", "curve-type", "line-width", "lineDashArray"])
|
|
118
109
|
], 64))), 128)),
|
|
119
|
-
e.hideXAxis ?
|
|
110
|
+
e.hideXAxis ? p("", !0) : (a(), m(i(D), {
|
|
120
111
|
key: 1,
|
|
121
112
|
type: "x",
|
|
122
|
-
"tick-format": e.xFormatter,
|
|
123
113
|
label: e.xLabel,
|
|
124
114
|
"label-margin": 8,
|
|
125
|
-
"domain-line": e.xDomainLine,
|
|
126
|
-
"grid-line": e.xGridLine,
|
|
127
115
|
"num-ticks": e.xNumTicks,
|
|
128
|
-
"tick-
|
|
116
|
+
"tick-format": e.xFormatter,
|
|
129
117
|
"tick-values": e.xExplicitTicks,
|
|
118
|
+
"grid-line": e.xGridLine,
|
|
119
|
+
"domain-line": e.xDomainLine,
|
|
120
|
+
"tick-line": e.xTickLine,
|
|
130
121
|
"min-max-ticks-only": e.minMaxTicksOnly
|
|
131
|
-
}, null, 8, ["
|
|
132
|
-
e.hideYAxis ?
|
|
122
|
+
}, null, 8, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "min-max-ticks-only"])),
|
|
123
|
+
e.hideYAxis ? p("", !0) : (a(), m(i(D), {
|
|
133
124
|
key: 2,
|
|
134
125
|
type: "y",
|
|
126
|
+
label: e.yLabel,
|
|
135
127
|
"num-ticks": e.yNumTicks,
|
|
136
128
|
"tick-format": e.yFormatter,
|
|
137
|
-
label: e.yLabel,
|
|
138
129
|
"grid-line": e.yGridLine,
|
|
139
130
|
"domain-line": e.yDomainLine,
|
|
140
131
|
"tick-line": e.yTickLine
|
|
141
|
-
}, null, 8, ["num-ticks", "tick-format", "
|
|
142
|
-
e.hideTooltip ?
|
|
143
|
-
key: 3,
|
|
144
|
-
color: "#666",
|
|
145
|
-
template: A.value
|
|
146
|
-
}, null, 8, ["template"]))
|
|
132
|
+
}, null, 8, ["label", "num-ticks", "tick-format", "grid-line", "domain-line", "tick-line"])),
|
|
133
|
+
e.hideTooltip ? p("", !0) : (a(), m(i(Q), C({ key: 3 }, e.crosshairConfig, { template: M }), null, 16))
|
|
147
134
|
]),
|
|
148
135
|
_: 1
|
|
149
136
|
}, 8, ["data", "height", "padding", "svg-defs"]),
|
|
150
|
-
e.hideLegend ?
|
|
137
|
+
e.hideLegend ? p("", !0) : (a(), c("div", {
|
|
151
138
|
key: 0,
|
|
152
|
-
class: T(["flex items-center justify-end", { "pb-4":
|
|
139
|
+
class: T(["flex items-center justify-end", { "pb-4": g.value, "pt-4": !g.value }])
|
|
153
140
|
}, [
|
|
154
|
-
|
|
141
|
+
u(i(Z), {
|
|
155
142
|
items: Object.values(e.categories)
|
|
156
143
|
}, null, 8, ["items"])
|
|
157
|
-
], 2))
|
|
144
|
+
], 2)),
|
|
145
|
+
X("div", ee, [
|
|
146
|
+
i(O).tooltip ? b(e.$slots, "tooltip", {
|
|
147
|
+
key: 0,
|
|
148
|
+
values: s.value
|
|
149
|
+
}) : s.value ? b(e.$slots, "fallback", { key: 1 }, () => [
|
|
150
|
+
u(I, {
|
|
151
|
+
data: s.value,
|
|
152
|
+
categories: e.categories,
|
|
153
|
+
toolTipTitle: i(z)(s.value) ?? "",
|
|
154
|
+
yFormatter: r.yFormatter
|
|
155
|
+
}, null, 8, ["data", "categories", "toolTipTitle", "yFormatter"])
|
|
156
|
+
]) : p("", !0)
|
|
157
|
+
], 512)
|
|
158
158
|
], 2));
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
export {
|
|
162
|
-
|
|
162
|
+
se as default
|
|
163
163
|
};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { AreaChartProps } from './types';
|
|
2
2
|
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onClick?: ((event: MouseEvent, values?: T | undefined) => any) | undefined;
|
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick"> & AreaChartProps<T> & Partial<{}>> & import('vue').PublicProps;
|
|
4
6
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
5
7
|
attrs: any;
|
|
6
|
-
slots: {
|
|
7
|
-
|
|
8
|
+
slots: {
|
|
9
|
+
tooltip?(_: {
|
|
10
|
+
values: T | undefined;
|
|
11
|
+
}): any;
|
|
12
|
+
fallback?(_: {}): any;
|
|
13
|
+
};
|
|
14
|
+
emit: (e: "click", event: MouseEvent, values?: T) => void;
|
|
8
15
|
}>) => import('vue').VNode & {
|
|
9
16
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
10
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LegendPosition } from '../../types';
|
|
1
|
+
import { axisFormatter, LegendPosition, MarkerConfig } from '../../types';
|
|
2
2
|
import { BulletLegendItemInterface, CurveType } from '@unovis/ts';
|
|
3
3
|
export interface AreaChartProps<T> {
|
|
4
4
|
/**
|
|
@@ -35,24 +35,36 @@ export interface AreaChartProps<T> {
|
|
|
35
35
|
*/
|
|
36
36
|
categories: Record<string, BulletLegendItemInterface>;
|
|
37
37
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* @returns {string} The formatted string representation of the tick.
|
|
42
|
-
*/
|
|
43
|
-
xFormatter?: ((tick: number, i: number, ticks: number[]) => string) | ((tick: Date, i: number, ticks: Date[]) => string);
|
|
38
|
+
* A record mapping marker keys to show custom patterns.
|
|
39
|
+
*/
|
|
40
|
+
markerConfig?: Record<string, MarkerConfig>;
|
|
44
41
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
* @param {number|Date} tick - The value of the tick. This can be a number or a Date object depending on the scale of the x-axis.
|
|
43
|
+
* @param {number} i - The index of the tick in the `ticks` array.
|
|
44
|
+
* @param {(number[]|Date[])} ticks - An array of all tick values for the x-axis.
|
|
45
|
+
* @returns {string} The formatted string representation of the tick.
|
|
46
|
+
*/
|
|
47
|
+
xFormatter?: axisFormatter;
|
|
48
|
+
/**
|
|
49
|
+
* @param {number|Date} tick - The value of the tick. This can be a number or a Date object depending on the scale of the y-axis.
|
|
50
|
+
* @param {number} i - The index of the tick in the `ticks` array.
|
|
51
|
+
* @param {(number[]|Date[])} ticks - An array of all tick values for the y-axis.
|
|
52
|
+
* @returns {string} The formatted string representation of the tick.
|
|
53
|
+
*/
|
|
54
|
+
yFormatter?: axisFormatter;
|
|
51
55
|
/**
|
|
52
56
|
* The type of curve to use for the area chart lines.
|
|
53
57
|
* See `CurveType` for available options.
|
|
54
58
|
*/
|
|
55
59
|
curveType?: CurveType;
|
|
60
|
+
/**
|
|
61
|
+
* The width of the line in pixels. Default is 2px.
|
|
62
|
+
*/
|
|
63
|
+
lineWidth?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Line dash array, see SVG's stroke-dasharray. Default: `undefined`
|
|
66
|
+
*/
|
|
67
|
+
lineDashArray?: number[];
|
|
56
68
|
/**
|
|
57
69
|
* The desired number of ticks on the x-axis.
|
|
58
70
|
*/
|
|
@@ -114,4 +126,22 @@ export interface AreaChartProps<T> {
|
|
|
114
126
|
* If `true`, hide the y-axis.
|
|
115
127
|
*/
|
|
116
128
|
hideYAxis?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Crosshair configuration object for customizing the appearance of the crosshair line.
|
|
131
|
+
*/
|
|
132
|
+
crosshairConfig?: {
|
|
133
|
+
/**
|
|
134
|
+
* The color of the crosshair line. Accepts any valid CSS color string.
|
|
135
|
+
* Example: '#f00', 'rgba(0,0,0,0.5)', 'blue'
|
|
136
|
+
*/
|
|
137
|
+
color?: string;
|
|
138
|
+
/**
|
|
139
|
+
* The stroke color of the crosshair line. Accepts any valid CSS color string.
|
|
140
|
+
*/
|
|
141
|
+
strokeColor?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The stroke width of the crosshair line in pixels.
|
|
144
|
+
*/
|
|
145
|
+
strokeWidth?: number;
|
|
146
|
+
};
|
|
117
147
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as y, computed as f, createApp as h, createElementBlock as g, openBlock as
|
|
2
|
-
import { VisXYContainer as
|
|
1
|
+
import { defineComponent as y, computed as f, createApp as h, createElementBlock as g, openBlock as a, createVNode as n, createElementVNode as B, unref as t, withCtx as L, createBlock as v, createCommentVNode as C, mergeProps as k } from "vue";
|
|
2
|
+
import { VisXYContainer as b, VisArea as x, VisAxis as s, VisCrosshair as T, VisBulletLegend as V } from "@unovis/vue";
|
|
3
3
|
import { CurveType as _ } from "@unovis/ts";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import N from "../Tooltip.js";
|
|
5
|
+
const A = { class: "flex flex-col space-y-4" }, j = { class: "flex items center justify-end" }, O = /* @__PURE__ */ y({
|
|
6
6
|
__name: "AreaStackedChart",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
@@ -18,56 +18,53 @@ const N = { class: "flex flex-col space-y-4" }, A = { class: "flex items center
|
|
|
18
18
|
yGridLine: { type: Boolean },
|
|
19
19
|
yDomainLine: { type: Boolean },
|
|
20
20
|
xTickLine: { type: Boolean },
|
|
21
|
-
yTickLine: { type: Boolean }
|
|
21
|
+
yTickLine: { type: Boolean },
|
|
22
|
+
crosshairConfig: {}
|
|
22
23
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const i =
|
|
24
|
+
setup(c) {
|
|
25
|
+
const i = c, l = f(() => (e, m) => {
|
|
25
26
|
if (typeof window > "u" || typeof document > "u")
|
|
26
27
|
return "";
|
|
27
28
|
try {
|
|
28
|
-
const o = h(
|
|
29
|
+
const o = h(N, {
|
|
29
30
|
data: e,
|
|
30
31
|
categories: i.categories
|
|
31
|
-
}),
|
|
32
|
-
o.mount(
|
|
33
|
-
const u =
|
|
32
|
+
}), r = document.createElement("div");
|
|
33
|
+
o.mount(r);
|
|
34
|
+
const u = r.innerHTML;
|
|
34
35
|
return o.unmount(), u;
|
|
35
36
|
} catch {
|
|
36
37
|
return "";
|
|
37
38
|
}
|
|
38
39
|
}), p = (e) => Number.parseInt(e.time), d = [(e) => e.firstTime, (e) => e.returning];
|
|
39
|
-
return (e, m) => (
|
|
40
|
-
n(t(
|
|
40
|
+
return (e, m) => (a(), g("div", A, [
|
|
41
|
+
n(t(b), {
|
|
41
42
|
data: e.data,
|
|
42
43
|
padding: e.padding,
|
|
43
44
|
height: e.height
|
|
44
45
|
}, {
|
|
45
46
|
default: L(() => [
|
|
46
|
-
n(t(
|
|
47
|
+
n(t(x), {
|
|
47
48
|
x: p,
|
|
48
49
|
y: d,
|
|
49
50
|
color: Object.values(i.categories).map((o) => o.color),
|
|
50
51
|
"curve-type": t(_).Linear
|
|
51
52
|
}, null, 8, ["color", "curve-type"]),
|
|
52
|
-
n(t(
|
|
53
|
+
n(t(s), {
|
|
53
54
|
type: "x",
|
|
54
55
|
label: "Time",
|
|
55
56
|
"num-ticks": 12
|
|
56
57
|
}),
|
|
57
|
-
n(t(
|
|
58
|
+
n(t(s), {
|
|
58
59
|
type: "y",
|
|
59
60
|
label: "Number of visitors",
|
|
60
61
|
"num-ticks": 3
|
|
61
62
|
}),
|
|
62
|
-
e.hideTooltip ?
|
|
63
|
-
key: 0,
|
|
64
|
-
color: "#666",
|
|
65
|
-
template: s.value
|
|
66
|
-
}, null, 8, ["template"]))
|
|
63
|
+
e.hideTooltip ? C("", !0) : (a(), v(t(T), k({ key: 0 }, e.crosshairConfig, { template: l.value }), null, 16, ["template"]))
|
|
67
64
|
]),
|
|
68
65
|
_: 1
|
|
69
66
|
}, 8, ["data", "padding", "height"]),
|
|
70
|
-
B("div",
|
|
67
|
+
B("div", j, [
|
|
71
68
|
n(t(V), {
|
|
72
69
|
items: Object.values(e.categories)
|
|
73
70
|
}, null, 8, ["items"])
|
|
@@ -76,5 +73,5 @@ const N = { class: "flex flex-col space-y-4" }, A = { class: "flex items center
|
|
|
76
73
|
}
|
|
77
74
|
});
|
|
78
75
|
export {
|
|
79
|
-
|
|
76
|
+
O as default
|
|
80
77
|
};
|
|
@@ -65,4 +65,22 @@ export interface AreaStackedChartProps<T> {
|
|
|
65
65
|
* If `true`, displays tick lines on the y-axis.
|
|
66
66
|
*/
|
|
67
67
|
yTickLine?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Crosshair configuration object for customizing the appearance of the crosshair line.
|
|
70
|
+
*/
|
|
71
|
+
crosshairConfig?: {
|
|
72
|
+
/**
|
|
73
|
+
* The color of the crosshair line. Accepts any valid CSS color string.
|
|
74
|
+
* Example: '#f00', 'rgba(0,0,0,0.5)', 'blue'
|
|
75
|
+
*/
|
|
76
|
+
color?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The stroke color of the crosshair line. Accepts any valid CSS color string.
|
|
79
|
+
*/
|
|
80
|
+
strokeColor?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The stroke width of the crosshair line in pixels.
|
|
83
|
+
*/
|
|
84
|
+
strokeWidth?: number;
|
|
85
|
+
};
|
|
68
86
|
}
|