vue-chrts 2.0.0-beta.3 → 2.0.0-beta.4
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 +6 -6
- package/dist/components/BarChart/BarChart.js +3 -3
- package/dist/components/BubbleChart/BubbleChart.js +13 -13
- package/dist/components/DonutChart/DonutChart.js +15 -15
- package/dist/components/GanttChart/GanttChart.js +6 -6
- package/dist/components/Tooltip.js +72 -5
- package/dist/components/Tooltip2.js +2 -40
- package/package.json +1 -1
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/index.js.css +0 -1
|
@@ -2,12 +2,12 @@ import { defineComponent as W, useSlots as E, useTemplateRef as M, ref as w, com
|
|
|
2
2
|
import { Position as C, CurveType as A } from "@unovis/ts";
|
|
3
3
|
import { createMarkers as z } from "../../utils.js";
|
|
4
4
|
import U from "../Tooltip.js";
|
|
5
|
-
import { VisXYContainer as H, VisTooltip as q, VisArea as J, VisLine as K, VisAxis as
|
|
5
|
+
import { VisXYContainer as H, VisTooltip as q, VisArea as J, VisLine as K, VisAxis as $, VisCrosshair as Q, VisBulletLegend as Z } from "@unovis/vue";
|
|
6
6
|
import { LegendPosition as I } from "../../types.js";
|
|
7
7
|
const _ = ["id"], ee = {
|
|
8
8
|
ref: "slotWrapper",
|
|
9
9
|
style: { display: "none" }
|
|
10
|
-
}, te = 0.5,
|
|
10
|
+
}, te = 0.5, D = "#3b82f6", se = /* @__PURE__ */ W({
|
|
11
11
|
__name: "AreaChart",
|
|
12
12
|
props: {
|
|
13
13
|
data: {},
|
|
@@ -89,14 +89,14 @@ const _ = ["id"], ee = {
|
|
|
89
89
|
`;
|
|
90
90
|
};
|
|
91
91
|
return v.value.map(
|
|
92
|
-
(i, t) => i != null && i.includes("#") ? a(t, i) : l(t, i ??
|
|
92
|
+
(i, t) => i != null && i.includes("#") ? a(t, i) : l(t, i ?? D)
|
|
93
93
|
).join("");
|
|
94
94
|
});
|
|
95
95
|
function j(a) {
|
|
96
96
|
var l;
|
|
97
97
|
return {
|
|
98
98
|
y: (i) => Number(i[a]),
|
|
99
|
-
color: ((l = n.categories[a]) == null ? void 0 : l.color) ??
|
|
99
|
+
color: ((l = n.categories[a]) == null ? void 0 : l.color) ?? D
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function N(a) {
|
|
@@ -147,7 +147,7 @@ const _ = ["id"], ee = {
|
|
|
147
147
|
lineDashArray: e.lineDashArray ? e.lineDashArray[r] : void 0
|
|
148
148
|
}, null, 8, ["x", "y", "color", "curve-type", "line-width", "lineDashArray"])
|
|
149
149
|
], 64))), 128)),
|
|
150
|
-
e.hideXAxis ? d("", !0) : (c(), g(o(
|
|
150
|
+
e.hideXAxis ? d("", !0) : (c(), g(o($), k({
|
|
151
151
|
key: 1,
|
|
152
152
|
type: "x",
|
|
153
153
|
label: e.xLabel,
|
|
@@ -160,7 +160,7 @@ const _ = ["id"], ee = {
|
|
|
160
160
|
"tick-line": e.xTickLine,
|
|
161
161
|
"min-max-ticks-only": e.minMaxTicksOnly
|
|
162
162
|
}, e.xAxisConfig), null, 16, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "min-max-ticks-only"])),
|
|
163
|
-
e.hideYAxis ? d("", !0) : (c(), g(o(
|
|
163
|
+
e.hideYAxis ? d("", !0) : (c(), g(o($), k({
|
|
164
164
|
key: 2,
|
|
165
165
|
type: "y",
|
|
166
166
|
label: e.yLabel,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as k, createElementBlock as p, openBlock as d, normalizeStyle as L, createVNode as b, createCommentVNode as x, createElementVNode as j, unref as a, withCtx as
|
|
1
|
+
import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as k, createElementBlock as p, openBlock as d, normalizeStyle as L, createVNode as b, createCommentVNode as x, createElementVNode as j, unref as a, withCtx as $, createBlock as c, Fragment as q, renderList as I, mergeProps as C, renderSlot as F } from "vue";
|
|
2
2
|
import { Orientation as u, StackedBar as U, GroupedBar as J } from "@unovis/ts";
|
|
3
3
|
import { useStackedGrouped as K } from "./stackedGroupedUtils.js";
|
|
4
4
|
import { VisXYContainer as Q, VisXYLabels as Z, VisTooltip as _, VisStackedBar as G, VisGroupedBar as ee, VisAxis as V, VisBulletLegend as te } from "@unovis/vue";
|
|
@@ -102,7 +102,7 @@ const ne = {
|
|
|
102
102
|
padding: e.padding,
|
|
103
103
|
height: e.height
|
|
104
104
|
}, {
|
|
105
|
-
default:
|
|
105
|
+
default: $(() => {
|
|
106
106
|
var o, s, m, f;
|
|
107
107
|
return [
|
|
108
108
|
e.valueLabel ? (d(), c(a(Z), {
|
|
@@ -130,7 +130,7 @@ const ne = {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}, null, 8, ["triggers"]),
|
|
133
|
-
e.stackAndGrouped ? (d(!0), p(
|
|
133
|
+
e.stackAndGrouped ? (d(!0), p(q, { key: 1 }, I(y.value.states, (n) => (d(), c(a(G), {
|
|
134
134
|
key: n,
|
|
135
135
|
data: y.value.chartData,
|
|
136
136
|
x: (r, v) => v + y.value.positions[n],
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as O, useSlots as S, useTemplateRef as D, ref as R, computed as
|
|
1
|
+
import { defineComponent as O, useSlots as S, useTemplateRef as D, ref as R, computed as g, createElementBlock as p, openBlock as l, normalizeStyle as d, createVNode as s, createCommentVNode as r, createElementVNode as w, unref as t, withCtx as K, createBlock as u, mergeProps as x, renderSlot as k } from "vue";
|
|
2
2
|
import { Scatter as M, Position as E } from "@unovis/ts";
|
|
3
|
-
import { VisXYContainer as G, VisTooltip as W, VisScatter as
|
|
4
|
-
import { LegendPosition as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
3
|
+
import { VisXYContainer as G, VisTooltip as W, VisScatter as $, VisAxis as L, VisBulletLegend as j } from "@unovis/vue";
|
|
4
|
+
import { LegendPosition as X } from "../../types.js";
|
|
5
|
+
import Y from "../Tooltip.js";
|
|
6
|
+
const _ = {
|
|
7
7
|
ref: "slotWrapper",
|
|
8
8
|
class: "hidden"
|
|
9
9
|
}, Q = /* @__PURE__ */ O({
|
|
@@ -28,7 +28,7 @@ const q = {
|
|
|
28
28
|
xFormatter: {},
|
|
29
29
|
yFormatter: {},
|
|
30
30
|
tooltipTitleFormatter: {},
|
|
31
|
-
legendPosition: { default:
|
|
31
|
+
legendPosition: { default: X.BottomCenter },
|
|
32
32
|
legendStyle: { default: void 0 },
|
|
33
33
|
sizeOptions: {},
|
|
34
34
|
xDomainLine: { type: Boolean, default: !0 },
|
|
@@ -70,8 +70,8 @@ const q = {
|
|
|
70
70
|
}
|
|
71
71
|
const z = {
|
|
72
72
|
[M.selectors.point]: F
|
|
73
|
-
}, P =
|
|
74
|
-
return (i, a) => (l(),
|
|
73
|
+
}, P = g(() => e.legendPosition.startsWith("top")), N = g(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center");
|
|
74
|
+
return (i, a) => (l(), p("div", {
|
|
75
75
|
style: d({
|
|
76
76
|
display: "flex",
|
|
77
77
|
flexDirection: P.value ? "column-reverse" : "column",
|
|
@@ -90,7 +90,7 @@ const q = {
|
|
|
90
90
|
key: 0,
|
|
91
91
|
triggers: z
|
|
92
92
|
})),
|
|
93
|
-
s(t(
|
|
93
|
+
s(t($), {
|
|
94
94
|
x: t(v),
|
|
95
95
|
y: t(b),
|
|
96
96
|
color: A,
|
|
@@ -125,14 +125,14 @@ const q = {
|
|
|
125
125
|
]),
|
|
126
126
|
_: 1
|
|
127
127
|
}, 8, ["data", "height", "padding"]),
|
|
128
|
-
e.hideLegend ? r("", !0) : (l(),
|
|
128
|
+
e.hideLegend ? r("", !0) : (l(), p("div", {
|
|
129
129
|
key: 0,
|
|
130
130
|
style: d({
|
|
131
131
|
display: "flex",
|
|
132
132
|
justifyContent: N.value
|
|
133
133
|
})
|
|
134
134
|
}, [
|
|
135
|
-
s(t(
|
|
135
|
+
s(t(j), {
|
|
136
136
|
class: "bulletLegendOverrides",
|
|
137
137
|
style: d([
|
|
138
138
|
e.legendStyle,
|
|
@@ -144,12 +144,12 @@ const q = {
|
|
|
144
144
|
}))
|
|
145
145
|
}, null, 8, ["style", "items"])
|
|
146
146
|
], 4)),
|
|
147
|
-
w("div",
|
|
147
|
+
w("div", _, [
|
|
148
148
|
t(T).tooltip ? k(i.$slots, "tooltip", {
|
|
149
149
|
key: 0,
|
|
150
150
|
values: n.value
|
|
151
151
|
}) : n.value ? k(i.$slots, "fallback", { key: 1 }, () => [
|
|
152
|
-
s(
|
|
152
|
+
s(Y, {
|
|
153
153
|
data: n.value,
|
|
154
154
|
categories: e.categories || {},
|
|
155
155
|
"title-formatter": e.tooltipTitleFormatter,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as D, useTemplateRef as P, ref as W, computed as s, createElementBlock as
|
|
1
|
+
import { defineComponent as B, useSlots as D, useTemplateRef as P, ref as W, computed as s, createElementBlock as p, openBlock as m, normalizeStyle as d, createVNode as a, createCommentVNode as v, createElementVNode as y, unref as r, withCtx as b, renderSlot as u } from "vue";
|
|
2
2
|
import { Donut as N } from "@unovis/ts";
|
|
3
|
-
import { DonutType as
|
|
4
|
-
import
|
|
5
|
-
import { VisSingleContainer as
|
|
3
|
+
import { DonutType as $ } from "./types.js";
|
|
4
|
+
import j from "../Tooltip.js";
|
|
5
|
+
import { VisSingleContainer as z, VisTooltip as H, VisDonut as E, VisBulletLegend as F } from "@unovis/vue";
|
|
6
6
|
import { LegendPosition as O } from "../../types.js";
|
|
7
7
|
const R = { style: {
|
|
8
8
|
position: "absolute",
|
|
@@ -12,7 +12,7 @@ const R = { style: {
|
|
|
12
12
|
} }, M = {
|
|
13
13
|
ref: "slotWrapper",
|
|
14
14
|
style: { display: "none" }
|
|
15
|
-
},
|
|
15
|
+
}, K = /* @__PURE__ */ B({
|
|
16
16
|
__name: "DonutChart",
|
|
17
17
|
props: {
|
|
18
18
|
type: {},
|
|
@@ -29,7 +29,7 @@ const R = { style: {
|
|
|
29
29
|
},
|
|
30
30
|
emits: ["click"],
|
|
31
31
|
setup(l, { emit: h }) {
|
|
32
|
-
const C = h, t = l, k = D(), c = P("slotWrapper"), i = W(), T = (e) => e, V = t.type ===
|
|
32
|
+
const C = h, t = l, k = D(), c = P("slotWrapper"), i = W(), T = (e) => e, V = t.type === $.Half;
|
|
33
33
|
function x(e) {
|
|
34
34
|
const o = Object.values(t.categories)[e.index].name;
|
|
35
35
|
return i.value = {
|
|
@@ -40,12 +40,12 @@ const R = { style: {
|
|
|
40
40
|
function A() {
|
|
41
41
|
return typeof window > "u" ? "" : c.value ? c.value.innerHTML : "";
|
|
42
42
|
}
|
|
43
|
-
const L = s(() => t.legendPosition.includes("top")), S = s(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center"), g = (e, o = "#ccc") => e ? Array.isArray(e) ? e[0] || o : e : o,
|
|
44
|
-
const n =
|
|
43
|
+
const L = s(() => t.legendPosition.includes("top")), S = s(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center"), g = (e, o = "#ccc") => e ? Array.isArray(e) ? e[0] || o : e : o, f = s(() => Object.values(t.categories)), w = (e, o) => {
|
|
44
|
+
const n = f.value[o];
|
|
45
45
|
if (n)
|
|
46
46
|
return g(n.color);
|
|
47
47
|
};
|
|
48
|
-
return (e, o) => (m(),
|
|
48
|
+
return (e, o) => (m(), p("div", {
|
|
49
49
|
style: d({
|
|
50
50
|
display: "flex",
|
|
51
51
|
flexDirection: L.value ? "column-reverse" : "column",
|
|
@@ -53,13 +53,13 @@ const R = { style: {
|
|
|
53
53
|
}),
|
|
54
54
|
onClick: o[0] || (o[0] = (n) => C("click", n, i.value))
|
|
55
55
|
}, [
|
|
56
|
-
a(r(
|
|
56
|
+
a(r(z), {
|
|
57
57
|
data: l.data,
|
|
58
58
|
height: l.height,
|
|
59
59
|
margin: {}
|
|
60
60
|
}, {
|
|
61
61
|
default: b(() => [
|
|
62
|
-
a(r(
|
|
62
|
+
a(r(H), {
|
|
63
63
|
"horizontal-shift": 20,
|
|
64
64
|
"vertical-shift": 20,
|
|
65
65
|
triggers: {
|
|
@@ -80,7 +80,7 @@ const R = { style: {
|
|
|
80
80
|
]),
|
|
81
81
|
_: 3
|
|
82
82
|
}, 8, ["data", "height"]),
|
|
83
|
-
t.hideLegend ? v("", !0) : (m(),
|
|
83
|
+
t.hideLegend ? v("", !0) : (m(), p("div", {
|
|
84
84
|
key: 0,
|
|
85
85
|
style: d({
|
|
86
86
|
display: "flex",
|
|
@@ -92,7 +92,7 @@ const R = { style: {
|
|
|
92
92
|
t.legendStyle,
|
|
93
93
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
94
94
|
]),
|
|
95
|
-
items:
|
|
95
|
+
items: f.value.map((n) => ({
|
|
96
96
|
...n,
|
|
97
97
|
color: g(n.color)
|
|
98
98
|
}))
|
|
@@ -103,7 +103,7 @@ const R = { style: {
|
|
|
103
103
|
key: 0,
|
|
104
104
|
values: i.value
|
|
105
105
|
}) : i.value ? u(e.$slots, "fallback", { key: 1 }, () => [
|
|
106
|
-
a(
|
|
106
|
+
a(j, {
|
|
107
107
|
data: i.value,
|
|
108
108
|
categories: t.categories,
|
|
109
109
|
"title-formatter": t.tooltipTitleFormatter
|
|
@@ -114,5 +114,5 @@ const R = { style: {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
export {
|
|
117
|
-
|
|
117
|
+
K as default
|
|
118
118
|
};
|
|
@@ -2,8 +2,8 @@ import { defineComponent as B, useSlots as V, useTemplateRef as w, ref as A, com
|
|
|
2
2
|
import { Timeline as x } from "@unovis/ts";
|
|
3
3
|
import { dateFormatter as S } from "../../utils.js";
|
|
4
4
|
import N from "../Tooltip.js";
|
|
5
|
-
import { VisXYContainer as j, VisTimeline as O, VisTooltip as
|
|
6
|
-
import { LegendPosition as
|
|
5
|
+
import { VisXYContainer as j, VisTimeline as O, VisTooltip as $, VisAxis as D, VisBulletLegend as G } from "@unovis/vue";
|
|
6
|
+
import { LegendPosition as M } from "../../types.js";
|
|
7
7
|
const I = /* @__PURE__ */ B({
|
|
8
8
|
__name: "GanttChart",
|
|
9
9
|
props: {
|
|
@@ -23,7 +23,7 @@ const I = /* @__PURE__ */ B({
|
|
|
23
23
|
crosshairConfig: {},
|
|
24
24
|
lineWidth: { default: 12 },
|
|
25
25
|
rowHeight: { default: 24 },
|
|
26
|
-
legendPosition: { default:
|
|
26
|
+
legendPosition: { default: M.TopRight },
|
|
27
27
|
legendStyle: {},
|
|
28
28
|
hideLegend: { type: Boolean },
|
|
29
29
|
xTickLine: { type: Boolean },
|
|
@@ -80,7 +80,7 @@ const I = /* @__PURE__ */ B({
|
|
|
80
80
|
showLabels: e.showLabels,
|
|
81
81
|
onClick: L
|
|
82
82
|
}, null, 8, ["x", "length", "lineWidth", "rowHeight", "type", "color", "labelWidth", "showLabels"]),
|
|
83
|
-
n(o(
|
|
83
|
+
n(o($), {
|
|
84
84
|
triggers: {
|
|
85
85
|
[o(x).selectors.label]: (t) => {
|
|
86
86
|
var m;
|
|
@@ -88,7 +88,7 @@ const I = /* @__PURE__ */ B({
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}, null, 8, ["triggers"]),
|
|
91
|
-
n(o(
|
|
91
|
+
n(o(D), P({
|
|
92
92
|
type: "x",
|
|
93
93
|
tickFormat: i.xTickFormat || o(S),
|
|
94
94
|
numTicks: i.xNumTicks,
|
|
@@ -106,7 +106,7 @@ const I = /* @__PURE__ */ B({
|
|
|
106
106
|
justifyContent: b.value
|
|
107
107
|
})
|
|
108
108
|
}, [
|
|
109
|
-
n(o(
|
|
109
|
+
n(o(G), {
|
|
110
110
|
style: d([
|
|
111
111
|
e.legendStyle,
|
|
112
112
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
@@ -1,7 +1,74 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { defineComponent as F, computed as m, createElementBlock as n, openBlock as s, createElementVNode as r, toDisplayString as c, Fragment as p, renderList as z, normalizeStyle as w } from "vue";
|
|
2
|
+
import { getFirstPropertyValue as B } from "../utils.js";
|
|
3
|
+
const C = /* @__PURE__ */ F({
|
|
4
|
+
__name: "Tooltip",
|
|
5
|
+
props: {
|
|
6
|
+
data: {},
|
|
7
|
+
categories: {},
|
|
8
|
+
titleFormatter: { type: Function },
|
|
9
|
+
yFormatter: { type: Function }
|
|
10
|
+
},
|
|
11
|
+
setup(l) {
|
|
12
|
+
const t = l, v = m(
|
|
13
|
+
() => t.titleFormatter ? t.titleFormatter(t.data) : B(t.data)
|
|
14
|
+
), d = ["_index", "_stacked", "_ending"], g = m(() => Object.entries(t.data ?? []).filter(
|
|
15
|
+
([e, a]) => !d.includes(e) && Object.keys(t.categories).includes(e)
|
|
16
|
+
)), u = {
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column"
|
|
19
|
+
}, f = {
|
|
20
|
+
color: "var(--vis-tooltip-title-color, #000)",
|
|
21
|
+
textTransform: "var(--vis-tooltip-title-text-transform, capitalize)",
|
|
22
|
+
borderBottom: "var(--vis-tooltip-title-border-bottom, 1px solid #e5e7eb)",
|
|
23
|
+
padding: "var(--vis-tooltip-title-padding, 0.75rem 0.75rem 0.5rem 0.75rem)",
|
|
24
|
+
margin: "var(--vis-tooltip-title-margin, 0 0 0.25rem 0)",
|
|
25
|
+
fontSize: "var(--vis-tooltip-title-font-size, 0.875rem)",
|
|
26
|
+
lineHeight: "var(--vis-tooltip-title-line-height, 100%)",
|
|
27
|
+
fontWeight: "var(--vis-tooltip-title-font-weight, 600)"
|
|
28
|
+
}, y = {
|
|
29
|
+
display: "grid",
|
|
30
|
+
gridTemplateColumns: "auto 1fr auto",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
gap: "var(--vis-tooltip-content-gap, 0.25rem 0.5rem)",
|
|
33
|
+
padding: "var(--vis-tooltip-content-padding, 0 0.75rem 0.5rem 0.75rem)"
|
|
34
|
+
}, h = {
|
|
35
|
+
fontWeight: "var(--vis-tooltip-label-font-weight, 400)",
|
|
36
|
+
fontSize: "var(--vis-tooltip-label-font-size, 0.875rem)",
|
|
37
|
+
color: "var(--vis-tooltip-label-color, inherit)",
|
|
38
|
+
margin: "var(--vis-tooltip-label-margin, 0 1rem 0 0)",
|
|
39
|
+
whiteSpace: "nowrap"
|
|
40
|
+
}, b = {
|
|
41
|
+
fontSize: "var(--vis-tooltip-value-font-size, 0.875rem)",
|
|
42
|
+
fontWeight: "var(--vis-tooltip-value-font-weight, 600)",
|
|
43
|
+
color: "var(--vis-tooltip-value-color, inherit)",
|
|
44
|
+
textAlign: "right",
|
|
45
|
+
fontVariantNumeric: "tabular-nums"
|
|
46
|
+
}, x = (e, a) => {
|
|
47
|
+
var o, i;
|
|
48
|
+
return {
|
|
49
|
+
width: "8px",
|
|
50
|
+
height: "8px",
|
|
51
|
+
aspectRatio: "1",
|
|
52
|
+
borderRadius: "var(--vis-tooltip-dot-border-radius, 4px)",
|
|
53
|
+
margin: "var(--vis-tooltip-dot-margin, 0)",
|
|
54
|
+
flexShrink: "0",
|
|
55
|
+
backgroundColor: typeof ((o = t.categories[e]) == null ? void 0 : o.color) == "string" && ((i = t.categories[e]) != null && i.color) ? t.categories[e].color : `var(--vis-color${a})`
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
return (e, a) => (s(), n("div", { style: u }, [
|
|
59
|
+
r("div", { style: f }, c(v.value), 1),
|
|
60
|
+
r("div", { style: y }, [
|
|
61
|
+
(s(!0), n(p, null, z(g.value, ([o, i], S) => (s(), n(p, { key: o }, [
|
|
62
|
+
r("span", {
|
|
63
|
+
style: w(x(o, S))
|
|
64
|
+
}, null, 4),
|
|
65
|
+
r("span", { style: h }, c(l.categories[o].name), 1),
|
|
66
|
+
r("span", { style: b }, c(l.yFormatter ? l.yFormatter(i) : i), 1)
|
|
67
|
+
], 64))), 128))
|
|
68
|
+
])
|
|
69
|
+
]));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
5
72
|
export {
|
|
6
|
-
|
|
73
|
+
C as default
|
|
7
74
|
};
|
|
@@ -1,42 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getFirstPropertyValue as b } from "../utils.js";
|
|
3
|
-
const x = { class: "vis-tooltip" }, B = { class: "vis-tooltip-title" }, E = { class: "vis-tooltip-content" }, j = { class: "vis-tooltip-label" }, k = { class: "vis-tooltip-value" }, O = /* @__PURE__ */ y({
|
|
4
|
-
__name: "Tooltip",
|
|
5
|
-
props: {
|
|
6
|
-
data: {},
|
|
7
|
-
categories: {},
|
|
8
|
-
titleFormatter: { type: Function },
|
|
9
|
-
yFormatter: { type: Function }
|
|
10
|
-
},
|
|
11
|
-
setup(t) {
|
|
12
|
-
const e = t, u = m(
|
|
13
|
-
() => e.titleFormatter ? e.titleFormatter(e.data) : b(e.data)
|
|
14
|
-
), v = ["_index", "_stacked", "_ending"], p = m(() => Object.entries(e.data ?? []).filter(
|
|
15
|
-
([s, g]) => !v.includes(s) && Object.keys(e.categories).includes(s)
|
|
16
|
-
));
|
|
17
|
-
return (s, g) => (a(), r("div", x, [
|
|
18
|
-
i("div", B, l(u.value), 1),
|
|
19
|
-
i("div", E, [
|
|
20
|
-
(a(!0), r(_, null, f(p.value, ([o, n], F) => {
|
|
21
|
-
var c, d;
|
|
22
|
-
return a(), r("div", {
|
|
23
|
-
key: o,
|
|
24
|
-
class: "vis-tooltip-entry"
|
|
25
|
-
}, [
|
|
26
|
-
i("span", {
|
|
27
|
-
class: "vis-tooltip-dot",
|
|
28
|
-
style: h({
|
|
29
|
-
backgroundColor: typeof ((c = t.categories[o]) == null ? void 0 : c.color) == "string" && ((d = t.categories[o]) != null && d.color) ? t.categories[o].color : `var(--vis-color${F})`
|
|
30
|
-
})
|
|
31
|
-
}, null, 4),
|
|
32
|
-
i("span", j, l(t.categories[o].name), 1),
|
|
33
|
-
i("span", k, l(t.yFormatter ? t.yFormatter(n) : n), 1)
|
|
34
|
-
]);
|
|
35
|
-
}), 128))
|
|
36
|
-
])
|
|
37
|
-
]));
|
|
38
|
-
}
|
|
39
|
-
});
|
|
1
|
+
import f from "./Tooltip.js";
|
|
40
2
|
export {
|
|
41
|
-
|
|
3
|
+
f as default
|
|
42
4
|
};
|
package/package.json
CHANGED
package/dist/index.js.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.vis-tooltip[data-v-2385aa2d]{display:flex;flex-direction:column}.vis-tooltip-title[data-v-2385aa2d]{color:var(--vis-tooltip-title-color, #000);text-transform:var(--vis-tooltip-title-text-transform, capitalize);border-bottom:var(--vis-tooltip-title-border-bottom, 1px solid #e5e7eb);padding:var(--vis-tooltip-title-padding, .75rem .75rem .5rem .75rem);margin:var(--vis-tooltip-title-margin, 0 0 .25rem 0);font-size:var(--vis-tooltip-title-font-size, .875rem);line-height:var(--vis-tooltip-title-line-height, 100%);font-weight:var(--vis-tooltip-title-font-weight, 600)}.vis-tooltip-content[data-v-2385aa2d]{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--vis-tooltip-content-gap, .25rem .5rem);padding:var(--vis-tooltip-content-padding, 0 .75rem)}.vis-tooltip-entry[data-v-2385aa2d]{display:contents}.vis-tooltip-dot[data-v-2385aa2d]{width:8px;height:8px;aspect-ratio:1;border-radius:var(--vis-tooltip-dot-border-radius, 4px);margin:var(--vis-tooltip-dot-margin, 0);flex-shrink:0}.vis-tooltip-label[data-v-2385aa2d]{font-weight:var(--vis-tooltip-label-font-weight, 400);font-size:var(--vis-tooltip-label-font-size, .875rem);color:var(--vis-tooltip-label-color, inherit);margin:var(--vis-tooltip-label-margin, 0 1rem 0 0);white-space:nowrap}.vis-tooltip-value[data-v-2385aa2d]{font-size:var(--vis-tooltip-value-font-size, .875rem);font-weight:var(--vis-tooltip-value-font-weight, 600);color:var(--vis-tooltip-value-color, inherit);text-align:right;font-variant-numeric:tabular-nums}
|