iryx-ui 0.15.0 → 0.16.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.
- package/README.md +3 -1
- package/dist/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/BarChart.vue.d.ts +8 -0
- package/dist/components/BarChart.vue_vue_type_script_setup_true_lang.js +169 -151
- package/dist/components/DonutChart.js +5 -0
- package/dist/components/DonutChart.vue.d.ts +96 -0
- package/dist/components/DonutChart.vue_vue_type_script_setup_true_lang.js +234 -0
- package/dist/components/LineChart.vue.d.ts +8 -0
- package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +160 -141
- package/dist/components/Sparkline.vue.d.ts +9 -0
- package/dist/components/Sparkline.vue_vue_type_script_setup_true_lang.js +90 -53
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +90 -88
- package/dist/composables/cartesian.d.ts +10 -2
- package/dist/composables/chart-reveal.d.ts +45 -0
- package/dist/composables/chart-reveal.js +93 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +134 -131
- package/dist/theme/donut-chart.d.ts +104 -0
- package/dist/theme/donut-chart.js +17 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/sparkline.js +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import { useElementSize as t } from "../composables/element-size.js";
|
|
3
3
|
import { cartesianLayout as n, clampTooltip as r, seriesColor as i, slotOf as a, warnOnSlotOverflow as o } from "../composables/cartesian.js";
|
|
4
|
-
import s from "
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { useChartAnimation as s, useChartReveal as c } from "../composables/chart-reveal.js";
|
|
5
|
+
import l from "./ChartLegend.js";
|
|
6
|
+
import { lineChartTheme as u } from "../theme/line-chart.js";
|
|
7
|
+
import { Fragment as d, computed as f, createBlock as ee, createCommentVNode as p, createElementBlock as m, createElementVNode as h, defineComponent as g, guardReactiveProps as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useId as D } from "vue";
|
|
7
8
|
//#region src/components/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
var te = ["role", "aria-label"], ne = [
|
|
9
10
|
"width",
|
|
10
11
|
"height",
|
|
11
12
|
"viewBox"
|
|
12
|
-
],
|
|
13
|
+
], O = [
|
|
13
14
|
"x1",
|
|
14
15
|
"y1",
|
|
15
16
|
"x2",
|
|
16
17
|
"y2"
|
|
17
|
-
],
|
|
18
|
+
], re = ["x", "y"], ie = { key: 1 }, ae = [
|
|
19
|
+
"x",
|
|
20
|
+
"y",
|
|
21
|
+
"width",
|
|
22
|
+
"height"
|
|
23
|
+
], oe = [
|
|
18
24
|
"x1",
|
|
19
25
|
"y1",
|
|
20
26
|
"x2",
|
|
21
27
|
"y2"
|
|
22
|
-
], ce = ["d"], le = ["cx", "cy"],
|
|
28
|
+
], se = ["clip-path"], ce = ["d", "fill"], le = ["d"], ue = ["cx", "cy"], de = ["cx", "cy"], fe = ["x", "y"], pe = [
|
|
23
29
|
"x",
|
|
24
30
|
"y",
|
|
25
31
|
"width",
|
|
26
32
|
"height",
|
|
27
33
|
"onPointerenter"
|
|
28
|
-
],
|
|
34
|
+
], me = { scope: "row" }, k = /*@__PURE__*/ g({
|
|
29
35
|
__name: "LineChart",
|
|
30
36
|
props: {
|
|
31
37
|
data: { default: () => [] },
|
|
@@ -42,6 +48,10 @@ var te = ["role", "aria-label"], ne = [
|
|
|
42
48
|
type: Boolean,
|
|
43
49
|
default: !0
|
|
44
50
|
},
|
|
51
|
+
animate: {
|
|
52
|
+
type: [Boolean, Object],
|
|
53
|
+
default: !0
|
|
54
|
+
},
|
|
45
55
|
legend: {
|
|
46
56
|
type: Boolean,
|
|
47
57
|
default: !0
|
|
@@ -60,44 +70,44 @@ var te = ["role", "aria-label"], ne = [
|
|
|
60
70
|
class: {},
|
|
61
71
|
ui: {}
|
|
62
72
|
},
|
|
63
|
-
setup(
|
|
64
|
-
let k =
|
|
65
|
-
function
|
|
66
|
-
return
|
|
73
|
+
setup(g) {
|
|
74
|
+
let k = g, he = e(), A = f(() => k.unstyled ?? he.unstyled), j = S(), { width: M } = t(j), ge = f(() => new Intl.NumberFormat(k.locale, k.format));
|
|
75
|
+
function N(e) {
|
|
76
|
+
return ge.value.format(e);
|
|
67
77
|
}
|
|
68
|
-
let
|
|
78
|
+
let P = f(() => {
|
|
69
79
|
let e = k.series?.length ? [...k.series] : [{ key: "value" }];
|
|
70
80
|
return o(e.length), e;
|
|
71
|
-
}),
|
|
72
|
-
function
|
|
81
|
+
}), F = f(() => P.value.length > 1), _e = f(() => F.value || k.legend && P.value[0].name != null);
|
|
82
|
+
function I(e, t) {
|
|
73
83
|
let n = e[t];
|
|
74
84
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
75
85
|
}
|
|
76
|
-
let
|
|
77
|
-
values: k.data.flatMap((e) =>
|
|
86
|
+
let L = f(() => n({
|
|
87
|
+
values: k.data.flatMap((e) => P.value.map((t) => I(e, t.key))),
|
|
78
88
|
categories: k.data.length,
|
|
79
89
|
longestLabel: Math.max(...k.data.map((e) => e.label.length), 1),
|
|
80
|
-
width:
|
|
90
|
+
width: M.value,
|
|
81
91
|
height: k.height,
|
|
82
92
|
tickCount: k.ticks,
|
|
83
93
|
showAxis: k.axis,
|
|
84
|
-
formatTick:
|
|
94
|
+
formatTick: N,
|
|
85
95
|
includeZero: k.zero
|
|
86
96
|
}));
|
|
87
|
-
function
|
|
97
|
+
function R(e) {
|
|
88
98
|
return Math.round(e * 100) / 100;
|
|
89
99
|
}
|
|
90
|
-
let
|
|
100
|
+
let z = f(() => M.value ? P.value.map((e, t) => {
|
|
91
101
|
let n = [], r = [];
|
|
92
102
|
return k.data.forEach((t, i) => {
|
|
93
|
-
let a =
|
|
103
|
+
let a = I(t, e.key);
|
|
94
104
|
if (a == null) {
|
|
95
105
|
r.length && n.push(r), r = [];
|
|
96
106
|
return;
|
|
97
107
|
}
|
|
98
108
|
r.push({
|
|
99
|
-
x:
|
|
100
|
-
y:
|
|
109
|
+
x: R(L.value.pointAt(i)),
|
|
110
|
+
y: R(L.value.y(a)),
|
|
101
111
|
index: i
|
|
102
112
|
});
|
|
103
113
|
}), r.length && n.push(r), {
|
|
@@ -105,205 +115,214 @@ var te = ["role", "aria-label"], ne = [
|
|
|
105
115
|
color: i(a(e, t)),
|
|
106
116
|
seriesIndex: t
|
|
107
117
|
};
|
|
108
|
-
}) : []),
|
|
118
|
+
}) : []), B = f(() => k.variant === "area" && !F.value && z.value.length > 0), V = f(() => {
|
|
109
119
|
let e = k.data?.length ?? 0;
|
|
110
120
|
return {
|
|
111
|
-
first: e ?
|
|
112
|
-
last: e ?
|
|
113
|
-
left:
|
|
114
|
-
right:
|
|
121
|
+
first: e ? R(L.value.pointAt(0)) : 0,
|
|
122
|
+
last: e ? R(L.value.pointAt(e - 1)) : 0,
|
|
123
|
+
left: R(L.value.plot.left),
|
|
124
|
+
right: R(L.value.plot.left + L.value.plot.width)
|
|
115
125
|
};
|
|
116
126
|
});
|
|
117
|
-
function
|
|
118
|
-
return k.flush && e.x ===
|
|
127
|
+
function H(e) {
|
|
128
|
+
return k.flush && e.x === V.value.last ? `L${V.value.right} ${e.y}` : "";
|
|
119
129
|
}
|
|
120
|
-
let
|
|
121
|
-
function
|
|
122
|
-
let t = e[0], n = e[e.length - 1], r = k.flush && t.x ===
|
|
123
|
-
if (
|
|
130
|
+
let U = f(() => Math.min(Math.max(k.tension, 0), 1) / 6);
|
|
131
|
+
function W(e) {
|
|
132
|
+
let t = e[0], n = e[e.length - 1], r = k.flush && t.x === V.value.first ? `M${V.value.left} ${t.y} L${t.x} ${t.y}` : `M${t.x} ${t.y}`;
|
|
133
|
+
if (U.value === 0 || e.length < 2) return [
|
|
124
134
|
r,
|
|
125
135
|
...e.slice(1).map((e) => `L${e.x} ${e.y}`),
|
|
126
|
-
|
|
136
|
+
H(n)
|
|
127
137
|
].filter(Boolean).join(" ");
|
|
128
138
|
let i = (e, t, n) => Math.min(Math.max(e, Math.min(t, n)), Math.max(t, n));
|
|
129
139
|
return [
|
|
130
140
|
r,
|
|
131
141
|
...e.slice(1).map((t, n) => {
|
|
132
|
-
let r = e[n], a = e[n - 1] ?? r, o = t, s = e[n + 2] ?? o, c = r.x + (o.x - a.x) *
|
|
133
|
-
return `C${
|
|
142
|
+
let r = e[n], a = e[n - 1] ?? r, o = t, s = e[n + 2] ?? o, c = r.x + (o.x - a.x) * U.value, l = i(r.y + (o.y - a.y) * U.value, r.y, o.y), u = o.x - (s.x - r.x) * U.value, d = i(o.y - (s.y - r.y) * U.value, r.y, o.y);
|
|
143
|
+
return `C${R(c)} ${R(l)}, ${R(u)} ${R(d)}, ${o.x} ${o.y}`;
|
|
134
144
|
}),
|
|
135
|
-
|
|
145
|
+
H(n)
|
|
136
146
|
].filter(Boolean).join(" ");
|
|
137
147
|
}
|
|
138
|
-
function
|
|
139
|
-
let t =
|
|
140
|
-
return `${
|
|
148
|
+
function ve(e) {
|
|
149
|
+
let t = L.value.plot.top + L.value.plot.height, n = e[0], r = e[e.length - 1], i = k.flush && n.x === V.value.first ? V.value.left : n.x, a = k.flush && r.x === V.value.last ? V.value.right : r.x;
|
|
150
|
+
return `${W(e)} L${a} ${t} L${i} ${t} Z`;
|
|
141
151
|
}
|
|
142
|
-
let
|
|
152
|
+
let G = `iryx-area-${D()}`, K = `iryx-plot-clip-${D()}`, q = S(), J = f(() => q.value == null ? [] : z.value.flatMap((e) => {
|
|
143
153
|
for (let t of e.runs) {
|
|
144
|
-
let n = t.find((e) => e.index ===
|
|
154
|
+
let n = t.find((e) => e.index === q.value);
|
|
145
155
|
if (n) return [{
|
|
146
156
|
...n,
|
|
147
157
|
color: e.color
|
|
148
158
|
}];
|
|
149
159
|
}
|
|
150
160
|
return [];
|
|
151
|
-
})),
|
|
152
|
-
if (
|
|
153
|
-
let e = k.data[
|
|
161
|
+
})), Y = f(() => q.value == null ? void 0 : R(L.value.pointAt(q.value))), X = f(() => {
|
|
162
|
+
if (q.value == null) return;
|
|
163
|
+
let e = k.data[q.value];
|
|
154
164
|
if (!e) return;
|
|
155
|
-
let t =
|
|
165
|
+
let t = P.value.map((t, n) => ({
|
|
156
166
|
name: t.name ?? t.key,
|
|
157
167
|
color: i(a(t, n)),
|
|
158
|
-
value:
|
|
168
|
+
value: I(e, t.key)
|
|
159
169
|
})).filter((e) => e.value != null).map((e) => ({
|
|
160
170
|
...e,
|
|
161
|
-
value:
|
|
171
|
+
value: N(e.value)
|
|
162
172
|
}));
|
|
163
173
|
if (!t.length) return;
|
|
164
|
-
let n =
|
|
174
|
+
let n = F.value ? Math.max(e.label.length, ...t.map((e) => e.name.length + e.value.length + 3)) : e.label.length + t[0].value.length + 2;
|
|
165
175
|
return {
|
|
166
176
|
label: e.label,
|
|
167
177
|
rows: t,
|
|
168
|
-
multi:
|
|
169
|
-
x: r(
|
|
170
|
-
y: Math.min(...
|
|
178
|
+
multi: F.value,
|
|
179
|
+
x: r(L.value.pointAt(q.value), "x".repeat(n), M.value),
|
|
180
|
+
y: Math.min(...J.value.map((e) => e.y), L.value.plot.top + L.value.plot.height)
|
|
171
181
|
};
|
|
172
|
-
}),
|
|
182
|
+
}), Z = s(f(() => k.animate)), { revealed: ye } = c(f(() => !!(M.value && z.value.length)), Z), be = f(() => ({
|
|
183
|
+
transform: `scaleX(${+!!ye.value})`,
|
|
184
|
+
transformOrigin: `${L.value.plot.left}px 0px`,
|
|
185
|
+
transition: `transform ${Z.value.duration}ms ${Z.value.css}`
|
|
186
|
+
})), Q = f(() => u());
|
|
173
187
|
function $(e, t) {
|
|
174
188
|
let n = k.ui?.[e];
|
|
175
|
-
return
|
|
189
|
+
return A.value ? [n, t] : Q.value[e]({ class: [n, t] });
|
|
176
190
|
}
|
|
177
|
-
return (e, t) => (
|
|
191
|
+
return (e, t) => (x(), m("div", {
|
|
178
192
|
ref_key: "root",
|
|
179
|
-
ref:
|
|
193
|
+
ref: j,
|
|
180
194
|
role: k.label ? "figure" : void 0,
|
|
181
195
|
"aria-label": k.label,
|
|
182
|
-
class:
|
|
196
|
+
class: v($("root", k.class))
|
|
183
197
|
}, [
|
|
184
|
-
|
|
198
|
+
_e.value ? (x(), ee(l, {
|
|
185
199
|
key: 0,
|
|
186
|
-
series:
|
|
200
|
+
series: P.value,
|
|
187
201
|
unstyled: k.unstyled
|
|
188
|
-
}, null, 8, ["series", "unstyled"])) :
|
|
189
|
-
|
|
190
|
-
width:
|
|
202
|
+
}, null, 8, ["series", "unstyled"])) : p("", !0),
|
|
203
|
+
h("div", { class: v(A.value ? void 0 : Q.value.plot()) }, [(x(), m("svg", {
|
|
204
|
+
width: E(M),
|
|
191
205
|
height: k.height,
|
|
192
|
-
viewBox: `0 0 ${
|
|
206
|
+
viewBox: `0 0 ${E(M)} ${k.height}`,
|
|
193
207
|
"aria-hidden": "true",
|
|
194
|
-
class:
|
|
208
|
+
class: v($("svg"))
|
|
195
209
|
}, [
|
|
196
|
-
k.axis ? (
|
|
197
|
-
x1:
|
|
198
|
-
y1:
|
|
199
|
-
x2:
|
|
200
|
-
y2:
|
|
210
|
+
k.axis ? (x(!0), m(d, { key: 0 }, C(L.value.ticks, (e) => (x(), m("g", { key: `tick-${e}` }, [h("line", {
|
|
211
|
+
x1: L.value.plot.left,
|
|
212
|
+
y1: L.value.y(e),
|
|
213
|
+
x2: L.value.plot.left + L.value.plot.width,
|
|
214
|
+
y2: L.value.y(e),
|
|
201
215
|
"stroke-width": "1",
|
|
202
|
-
class:
|
|
203
|
-
}, null, 10,
|
|
204
|
-
x:
|
|
205
|
-
y:
|
|
216
|
+
class: v($("grid"))
|
|
217
|
+
}, null, 10, O), h("text", {
|
|
218
|
+
x: L.value.plot.left - E(8),
|
|
219
|
+
y: L.value.y(e),
|
|
206
220
|
"text-anchor": "end",
|
|
207
221
|
"dominant-baseline": "middle",
|
|
208
|
-
class:
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
id:
|
|
222
|
+
class: v($("tick"))
|
|
223
|
+
}, T(N(e)), 11, re)]))), 128)) : p("", !0),
|
|
224
|
+
w(e.$slots, "underlay", y(_(L.value))),
|
|
225
|
+
B.value ? (x(), m("defs", ie, [h("linearGradient", {
|
|
226
|
+
id: G,
|
|
213
227
|
x1: "0",
|
|
214
228
|
y1: "0",
|
|
215
229
|
x2: "0",
|
|
216
230
|
y2: "1"
|
|
217
|
-
}, [...t[1] ||= [
|
|
231
|
+
}, [...t[1] ||= [h("stop", {
|
|
218
232
|
offset: "0%",
|
|
219
233
|
"stop-color": "currentColor",
|
|
220
234
|
"stop-opacity": "0.35"
|
|
221
|
-
}, null, -1),
|
|
235
|
+
}, null, -1), h("stop", {
|
|
222
236
|
offset: "100%",
|
|
223
237
|
"stop-color": "currentColor",
|
|
224
238
|
"stop-opacity": "0"
|
|
225
|
-
}, null, -1)]])
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
style:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
y2: z.value.plot.top + z.value.plot.height,
|
|
239
|
+
}, null, -1)]]), h("clipPath", { id: K }, [h("rect", {
|
|
240
|
+
x: L.value.plot.left,
|
|
241
|
+
y: L.value.plot.top,
|
|
242
|
+
width: L.value.plot.width,
|
|
243
|
+
height: L.value.plot.height,
|
|
244
|
+
style: b(be.value)
|
|
245
|
+
}, null, 12, ae)])])) : p("", !0),
|
|
246
|
+
Y.value == null ? p("", !0) : (x(), m("line", {
|
|
247
|
+
key: 2,
|
|
248
|
+
x1: Y.value,
|
|
249
|
+
y1: L.value.plot.top,
|
|
250
|
+
x2: Y.value,
|
|
251
|
+
y2: L.value.plot.top + L.value.plot.height,
|
|
239
252
|
"stroke-width": "1",
|
|
240
|
-
class:
|
|
241
|
-
}, null, 10,
|
|
242
|
-
(
|
|
253
|
+
class: v($("crosshair"))
|
|
254
|
+
}, null, 10, oe)),
|
|
255
|
+
h("g", { "clip-path": `url(#${K})` }, [(x(!0), m(d, null, C(B.value ? z.value[0].runs : [], (e, t) => (x(), m("path", {
|
|
256
|
+
key: `area-${t}`,
|
|
257
|
+
d: ve(e),
|
|
258
|
+
fill: `url(#${G})`,
|
|
259
|
+
style: b({ color: z.value[0].color }),
|
|
260
|
+
class: v($("area"))
|
|
261
|
+
}, null, 14, ce))), 128)), (x(!0), m(d, null, C(z.value, (e) => (x(), m(d, { key: `series-${e.seriesIndex}` }, [(x(!0), m(d, null, C(e.runs, (t, n) => (x(), m("path", {
|
|
243
262
|
key: `line-${e.seriesIndex}-${n}`,
|
|
244
|
-
d:
|
|
245
|
-
style:
|
|
246
|
-
class:
|
|
247
|
-
}, null, 14,
|
|
248
|
-
(
|
|
263
|
+
d: W(t),
|
|
264
|
+
style: b({ stroke: e.color }),
|
|
265
|
+
class: v($("line"))
|
|
266
|
+
}, null, 14, le))), 128))], 64))), 128))], 8, se),
|
|
267
|
+
(x(!0), m(d, null, C(J.value, (e, t) => (x(), m(d, { key: `marker-${t}` }, [h("circle", {
|
|
249
268
|
cx: e.x,
|
|
250
269
|
cy: e.y,
|
|
251
270
|
r: "6",
|
|
252
|
-
class:
|
|
253
|
-
}, null, 10,
|
|
271
|
+
class: v($("markerRing"))
|
|
272
|
+
}, null, 10, ue), h("circle", {
|
|
254
273
|
cx: e.x,
|
|
255
274
|
cy: e.y,
|
|
256
275
|
r: "4",
|
|
257
|
-
style:
|
|
258
|
-
class:
|
|
259
|
-
}, null, 14,
|
|
260
|
-
(
|
|
276
|
+
style: b({ fill: e.color }),
|
|
277
|
+
class: v($("marker"))
|
|
278
|
+
}, null, 14, de)], 64))), 128)),
|
|
279
|
+
(x(!0), m(d, null, C(k.data, (e, t) => (x(), m(d, { key: `label-${e.label}-${t}` }, [t % L.value.labelStep === 0 ? (x(), m("text", {
|
|
261
280
|
key: 0,
|
|
262
|
-
x:
|
|
263
|
-
y:
|
|
281
|
+
x: L.value.pointAt(t),
|
|
282
|
+
y: L.value.plot.top + L.value.plot.height + 14,
|
|
264
283
|
"text-anchor": "middle",
|
|
265
|
-
class:
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
(
|
|
284
|
+
class: v($("category"))
|
|
285
|
+
}, T(e.label), 11, fe)) : p("", !0)], 64))), 128)),
|
|
286
|
+
w(e.$slots, "overlay", y(_(L.value))),
|
|
287
|
+
(x(!0), m(d, null, C(k.data, (e, n) => (x(), m("rect", {
|
|
269
288
|
key: `hit-${e.label}-${n}`,
|
|
270
|
-
x:
|
|
271
|
-
y:
|
|
272
|
-
width:
|
|
273
|
-
height:
|
|
274
|
-
class:
|
|
275
|
-
onPointerenter: (e) =>
|
|
276
|
-
onPointerleave: t[0] ||= (e) =>
|
|
277
|
-
}, null, 42,
|
|
278
|
-
], 10, ne)),
|
|
289
|
+
x: L.value.plot.left + L.value.bandWidth * n,
|
|
290
|
+
y: L.value.plot.top,
|
|
291
|
+
width: L.value.bandWidth,
|
|
292
|
+
height: L.value.plot.height,
|
|
293
|
+
class: v(A.value ? void 0 : Q.value.hit()),
|
|
294
|
+
onPointerenter: (e) => q.value = n,
|
|
295
|
+
onPointerleave: t[0] ||= (e) => q.value = void 0
|
|
296
|
+
}, null, 42, pe))), 128))
|
|
297
|
+
], 10, ne)), X.value ? (x(), m("div", {
|
|
279
298
|
key: 0,
|
|
280
|
-
class:
|
|
281
|
-
style:
|
|
282
|
-
left: `${
|
|
283
|
-
top: `${
|
|
299
|
+
class: v($("tooltip", X.value.multi ? "flex-col items-start gap-1" : void 0)),
|
|
300
|
+
style: b({
|
|
301
|
+
left: `${X.value.x}px`,
|
|
302
|
+
top: `${X.value.y}px`,
|
|
284
303
|
transform: "translate(-50%, -100%) translateY(-12px)"
|
|
285
304
|
})
|
|
286
|
-
}, [
|
|
305
|
+
}, [h("span", { class: v($("tooltipLabel")) }, T(X.value.label), 3), X.value.multi ? (x(!0), m(d, { key: 0 }, C(X.value.rows, (e) => (x(), m("span", {
|
|
287
306
|
key: e.name,
|
|
288
307
|
class: "flex items-center gap-1.5"
|
|
289
308
|
}, [
|
|
290
|
-
|
|
309
|
+
h("span", {
|
|
291
310
|
class: "size-2 shrink-0 rounded-full",
|
|
292
|
-
style:
|
|
311
|
+
style: b({ background: e.color })
|
|
293
312
|
}, null, 4),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
]))), 128)) : (
|
|
313
|
+
h("span", { class: v($("tooltipLabel")) }, T(e.name), 3),
|
|
314
|
+
h("span", { class: v($("tooltipValue")) }, T(e.value), 3)
|
|
315
|
+
]))), 128)) : (x(), m("span", {
|
|
297
316
|
key: 1,
|
|
298
|
-
class:
|
|
299
|
-
},
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
317
|
+
class: v($("tooltipValue"))
|
|
318
|
+
}, T(X.value.rows[0].value), 3))], 6)) : p("", !0)], 2),
|
|
319
|
+
h("div", { class: v($("table")) }, [h("table", null, [
|
|
320
|
+
h("caption", null, T(k.label), 1),
|
|
321
|
+
h("thead", null, [h("tr", null, [t[2] ||= h("th", { scope: "col" }, " Category ", -1), (x(!0), m(d, null, C(P.value, (e) => (x(), m("th", {
|
|
303
322
|
key: e.key,
|
|
304
323
|
scope: "col"
|
|
305
|
-
},
|
|
306
|
-
|
|
324
|
+
}, T(e.name ?? "Value"), 1))), 128))])]),
|
|
325
|
+
h("tbody", null, [(x(!0), m(d, null, C(k.data, (e, t) => (x(), m("tr", { key: `row-${e.label}-${t}` }, [h("th", me, T(e.label), 1), (x(!0), m(d, null, C(P.value, (t) => (x(), m("td", { key: t.key }, T(I(e, t.key) == null ? "—" : N(I(e, t.key))), 1))), 128))]))), 128))])
|
|
307
326
|
])], 2)
|
|
308
327
|
], 10, te));
|
|
309
328
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChartAnimate } from '../composables/chart-reveal';
|
|
1
2
|
import type { SparseValue } from '../composables/scale';
|
|
2
3
|
export interface SparklineProps {
|
|
3
4
|
/** Values, oldest first. `null` is a gap in the series, not a zero. */
|
|
@@ -21,6 +22,13 @@ export interface SparklineProps {
|
|
|
21
22
|
label?: string;
|
|
22
23
|
/** Rendered height in px. Width always fills the container. */
|
|
23
24
|
height?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Draw the line on across the box on the first paint. Off by default here,
|
|
27
|
+
* unlike the full-size charts: a sparkline usually sits inside a stat tile
|
|
28
|
+
* or a table row, and a page of them animating at once is a distraction
|
|
29
|
+
* rather than an arrival.
|
|
30
|
+
*/
|
|
31
|
+
animate?: ChartAnimate;
|
|
24
32
|
/** Skip built-in classes; you take over styling entirely. */
|
|
25
33
|
unstyled?: boolean;
|
|
26
34
|
class?: string;
|
|
@@ -31,6 +39,7 @@ declare const __VLS_export: import("vue").DefineComponent<SparklineProps, {}, {}
|
|
|
31
39
|
variant: "line" | "area";
|
|
32
40
|
unstyled: boolean;
|
|
33
41
|
data: readonly SparseValue[];
|
|
42
|
+
animate: ChartAnimate;
|
|
34
43
|
height: number;
|
|
35
44
|
baseline: "min" | "zero";
|
|
36
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|