vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
1,424 lines • 56.8 kB
JavaScript
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
import { $ as t, Bt as n, D as r, G as i, Jt as a, Kt as o, Pt as s, Q as c, Rt as ee, S as te, Ut as ne, X as re, _ as ie, f as ae, h as oe, i as se, jt as ce, kt as le, p as ue, pt as de, q as fe, t as pe, tt as me, w as he, wt as ge, y as _e } from "./lib-Bttd6u5E.js";
import { n as ve, t as ye } from "./useHints-Dq_w2E8B.js";
import { t as be } from "./useTimeLabels-d2f-W1L4.js";
import { t as xe } from "./useConfig-D3scuR88.js";
import { t as Se } from "./usePrinter-DN5bYhTG.js";
import { n as Ce, t as we } from "./BaseScanner-DZvpgOjM.js";
import { t as Te } from "./useSvgExport-DH-FfcqQ.js";
import { t as Ee } from "./useNestedProp-vPNvh7rV.js";
import { t as De } from "./useThemeCheck-C43Tcqmk.js";
import { t as Oe } from "./useTransitions-g_zBREk2.js";
import { t as ke } from "./useStableElementSize-C7KADDKj.js";
import { t as Ae } from "./useTimeLabelCollider-AEcY4Ioe.js";
import { t as je } from "./img-Bnokohej.js";
import { n as Me } from "./Title-BE3qg9xl.js";
import { t as Ne } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { l as Pe, t as Fe } from "./useResponsive-ZtArZtUf.js";
import { t as Ie } from "./DefGrad-DVBqDjhO.js";
import { t as Le } from "./BaseLegendToggle-DZVucLnv.js";
import { t as Re } from "./A11yDataTable-DdRsVULz.js";
import { t as ze } from "./useUserOptionState-DK-_1ddE.js";
import { t as Be } from "./useChartAccessibility-DYqac8yF.js";
import { t as Ve } from "./Legend-CQxUgOd-.js";
import { t as He } from "./vue_ui_donut_evolution-D1yAAIHr.js";
import { t as Ue } from "./Slicer-CIk57nL4.js";
import { Fragment as l, Teleport as We, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as Ge, createTextVNode as Ke, createVNode as qe, defineAsyncComponent as h, guardReactiveProps as g, mergeProps as Je, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as Ye, onMounted as Xe, openBlock as x, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as Ze, shallowRef as Qe, toDisplayString as T, toRefs as $e, unref as E, watch as et, watchEffect as tt, withCtx as D } from "vue";
//#region src/components/vue-ui-donut-evolution.vue
var nt = /* @__PURE__ */ e({ default: () => Wt }), rt = ["id"], it = ["id"], at = ["id"], ot = { style: { position: "relative" } }, st = [
"xmlns",
"aria-describedby",
"viewBox"
], ct = [
"x",
"y",
"width",
"height"
], lt = { key: 1 }, ut = [
"x1",
"x2",
"y1",
"y2",
"stroke",
"stroke-width"
], dt = [
"x1",
"x2",
"y1",
"y2",
"stroke",
"stroke-width"
], ft = { key: 0 }, pt = [
"x1",
"x2",
"y1",
"y2",
"stroke",
"stroke-width"
], mt = [
"font-size",
"fill",
"transform"
], ht = [
"x",
"y",
"font-size",
"fill"
], gt = [
"d",
"stroke",
"stroke-width"
], _t = [
"transform",
"font-size",
"text-anchor",
"fill",
"font-weight"
], vt = { key: 0 }, yt = [
"text-anchor",
"font-size",
"fill",
"transform"
], bt = [
"text-anchor",
"font-size",
"fill",
"transform",
"innerHTML"
], xt = [
"x1",
"y1",
"x2",
"y2",
"stroke",
"stroke-width"
], St = { key: 1 }, Ct = [
"cx",
"cy",
"r",
"fill"
], wt = { key: 0 }, Tt = { key: 0 }, Et = ["d", "stroke"], Dt = [
"text-anchor",
"x",
"y",
"fill"
], Ot = [
"cx",
"cy",
"r",
"fill"
], kt = { key: 0 }, At = [
"cx",
"cy",
"fill"
], jt = { key: 1 }, Mt = [
"d",
"fill",
"stroke"
], Nt = { key: 2 }, Pt = [
"d",
"fill",
"stroke"
], Ft = [
"x",
"y",
"font-size",
"fill"
], It = [
"x",
"y",
"width",
"height",
"fill"
], Lt = [
"x",
"y",
"width",
"height",
"onMouseenter",
"onMouseleave",
"onClick"
], Rt = {
key: 0,
style: {
position: "absolute",
top: "100%",
left: "0",
width: "100%"
},
"data-dom-to-png-ignore": "",
"aria-hidden": "true"
}, zt = {
key: 5,
class: "vue-data-ui-watermark"
}, Bt = ["id"], Vt = ["onClick"], Ht = { key: 0 }, Ut = { key: 1 }, Wt = /*#__PURE__*/ Ne({
__name: "vue-ui-donut-evolution",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectLegend", "copyAlt"],
setup(e, { expose: Ne, emit: nt }) {
let Wt = h(() => import("./vue-ui-accordion-BxGriZik.js").then((e) => e.n)), Gt = h(() => import("./BaseIcon-BfndwIWE.js").then((e) => e.n)), Kt = h(() => import("./DataTable-BbKgJ5UI.js")), qt = h(() => import("./PackageVersion-D6d8SCp9.js").then((e) => e.t)), Jt = h(() => import("./PenAndPaper-DAE-tnEQ.js").then((e) => e.t)), Yt = h(() => import("./UserOptions-Dt98of5H.js").then((e) => e.n)), Xt = h(() => import("./vue-ui-donut-C0cWRLbU.js").then((e) => e.n)), Zt = h(() => import("./BaseDraggableDialog-LoqqwRtV.js").then((e) => e.n)), { vue_ui_donut_evolution: Qt } = xe(), { isThemeValid: $t, warnInvalidTheme: en } = De(), O = e, k = S(fe()), A = S([]), j = S(null), M = S(null), tn = S(!1), N = S(null), P = S(null), nn = S(null), rn = S(0), an = S(0), on = S(0), sn = S(0), cn = S(0), ln = S(null), un = S(null), dn = S(null), fn = S(null), pn = S(!1), mn = S(null), hn = S(null), gn = S(!1), _n = S(!1), vn = Qe(null), yn = S(0), bn = S(0), xn = S(!1);
function Sn() {
vn.value = P.value?.parentNode ?? null;
}
function Cn() {
return new Promise((e) => {
requestAnimationFrame(() => {
requestAnimationFrame(e);
});
});
}
async function wn() {
let e = ++bn.value;
await _(), await Cn(), await Cn(), e === bn.value && (yn.value += 1);
}
function Tn() {
xn.value || (xn.value = !0, _(() => {
xn.value = !1, Sn(), wn();
}));
}
let En = ke({
elementRef: vn,
minimumWidth: 2,
minimumHeight: 2,
stableFramesRequired: 2,
once: !1,
onSizeAccepted: () => {
wn();
}
}), Dn = S(null), On = S(null), kn = S(null), An = S(null), jn = S(null), Mn = S(!1), F = Qe(null), I = Qe(null), Nn = S(null), L = S(null), Pn = S(!1), Fn = nt, In = u(() => !!O.dataset && O.dataset.length);
Xe(() => {
pn.value = !0, Sn(), En.start(), Rn(), wn();
});
let Ln = u(() => !!R.value.debug);
function Rn() {
if (ce(O.dataset) ? (me({
componentName: "VueUiDonutEvolution",
type: "dataset",
debug: Ln.value
}), Un.value = !0) : O.dataset.length && O.dataset.forEach((e, t) => {
de({
datasetObject: e,
requiredAttributes: ["name", "values"]
}).forEach((e) => {
me({
componentName: "VueUiDonutEvolution",
type: "datasetSerieAttribute",
property: e,
index: t,
debug: Ln.value
}), Un.value = !0;
});
}), ce(O.dataset) || (Un.value = R.value.loading), setTimeout(() => {
Mn.value = !0;
}, 10), Kn(), R.value.responsive) {
let e = Pe(() => {
Mn.value = !1;
let { width: e, height: t } = Fe({
chart: P.value,
title: R.value.style.chart.title.text ? Dn.value : null,
legend: R.value.style.chart.legend.show ? On.value : null,
slicer: R.value.style.chart.zoom.show && Wn.value > 1 ? jn.value : null,
source: kn.value
});
requestAnimationFrame(() => {
B.value.width = e, B.value.height = t - 12, Tn(), clearTimeout(Nn.value), Nn.value = setTimeout(() => {
Mn.value = !0;
}, 10);
});
});
F.value && (I.value && F.value.unobserve(I.value), F.value.disconnect()), F.value = new ResizeObserver(e), I.value = P.value.parentNode, F.value.observe(I.value);
}
Tn();
}
let R = S(Qn());
ve({
config: () => R.value,
dataset: () => O.dataset,
component: "VueUiDonutEvolution",
rules: [
ye.emptyArray,
{
test: (e) => e.length === 1,
message: [
"👀 There is only a single series in your dataset. Consider:",
"",
"▶️ Using VueUiXy instead, for a regular line chart."
]
},
{
test: (e) => e.length > 6,
message: [
"👀 The number of series is > 6, which makes donuts hard to read. Consider:",
"",
"▶️ Grouping small values dynamically into a single \"Other\" series.",
"",
"▶️ Using filters to let users choose a maximum number of series to display.",
"",
"▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read."
]
},
{
test: (e) => e.some((e) => e.values.length > 24),
message: [
"👀 Some series have a number of data points > 24, which can make the chart and donuts hard to read. Consider:",
"",
"▶️ Using larger time scales, or aggregated values.",
"",
"▶️ Filtering the time range by adding date intputs in your UI.",
"",
"▶️ Using VueUiXy to show longer series in a more comfortable display."
]
}
]
});
let { transitionEnabled: zn } = Oe({
config: () => R.value.transitions,
dataset: () => O.dataset
}), z = u(() => R.value.userOptions.useCursorPointer), Bn = u(() => a({
defaultConfig: {
useCssAnimation: !1,
table: { show: !1 },
userOptions: { show: !1 },
style: { chart: {
backgroundColor: "#99999930",
layout: {
dataLabels: { show: !1 },
grid: {
stroke: "#6A6A6A",
axis: {
yLabel: "",
xLabel: ""
},
yAxis: {
scaleMin: null,
scaleMax: null,
autoScale: !1,
dataLabels: { show: !1 }
},
xAxis: { dataLabels: { show: !1 } }
},
line: { stroke: "#CACACA60" }
},
legend: {
backgroundColor: "transparent",
showValue: !1,
showPercentage: !1
},
zoom: {
show: !1,
startIndex: null,
endIndex: null
}
} }
},
userConfig: R.value.skeletonConfig ?? {}
})), { loading: Vn, FINAL_DATASET: Hn, manualLoading: Un } = Ce({
...$e(O),
FINAL_CONFIG: R,
prepareConfig: Qn,
callback: () => {
Promise.resolve().then(async () => {
await Kn();
});
},
skeletonDataset: O.config?.skeletonDataset ?? [
{
name: "",
values: [
1,
2,
3,
5,
8,
13
],
color: "#AAAAAA"
},
{
name: "",
values: [
1,
2,
3,
5,
8,
13
],
color: "#BABABA"
},
{
name: "",
values: [
1,
2,
3,
5,
8,
13
],
color: "#CACACA"
}
],
skeletonConfig: a({
defaultConfig: R.value,
userConfig: Bn.value
})
}), B = S({
width: R.value.style.chart.layout.width,
height: R.value.style.chart.layout.height
}), Wn = u(() => Math.max(...Hn.value.map((e) => e.values.length))), V = S({
start: 0,
end: Wn.value
});
function Gn() {
Kn();
}
async function Kn() {
await _(), await _();
let { startIndex: e, endIndex: t } = R.value.style.chart.zoom, n = An.value;
V.value = {
start: 0,
max: q.value
}, (e != null || t != null) && n ? (e == null ? (V.value.start = 0, n.setStartValue(0)) : n.setStartValue(e), t == null ? (V.value.end = q.value, n.setEndValue(q.value)) : n.setEndValue(qn(t + 1))) : (V.value = {
start: 0,
end: q.value
}, an.value += 1), Tn();
}
function qn(e) {
let t = q.value;
return e > t ? t : e < 0 || R.value.style.chart.zoom.startIndex !== null && e < R.value.style.chart.zoom.startIndex ? R.value.style.chart.zoom.startIndex === null ? 1 : R.value.style.chart.zoom.startIndex + 1 : e;
}
let { userOptionsVisible: Jn, setUserOptionsVisibility: Yn, keepUserOptionState: Xn } = ze({ config: R.value }), { svgRef: Zn } = Be({ config: R.value.style.chart.title });
function Qn() {
let e = Ee({
userConfig: O.config,
defaultConfig: Qt
}), t = {}, n = e.theme;
if (n) if (!$t.value(e)) en(e), t = e;
else {
let r = Ee({
userConfig: He[n] || O.config,
defaultConfig: e
});
t = {
...Ee({
userConfig: O.config,
defaultConfig: r
}),
customPalette: e.customPalette ? e.customPalette : o[n] || s
};
}
else t = e;
return t;
}
et(() => O.config, (e) => {
Vn.value || (R.value = Qn()), Jn.value = !R.value.userOptions.showOnChartHover, Rn(), on.value += 1, sn.value += 1, cn.value += 1, H.value.showTable = R.value.table.show;
}, { deep: !0 }), et(() => O.dataset, (e) => {
Array.isArray(e) && e.length > 0 && (Un.value = !1), Gn();
}, { deep: !0 });
let { isPrinting: $n, isImaging: er, generatePdf: tr, generateImage: nr } = Se({
elementId: k.value,
fileName: R.value.style.chart.title.text || "vue-ui-donut-evolution",
options: R.value.userOptions.print
}), rr = u(() => R.value.userOptions.show && !R.value.style.chart.title.text), ir = u(() => he(R.value.customPalette)), H = S({ showTable: R.value.table.show });
et(R, () => {
H.value = { showTable: R.value.table.show };
}, { immediate: !0 });
let U = u(() => ({
top: R.value.style.chart.layout.padding.top,
right: R.value.style.chart.layout.padding.right,
bottom: R.value.style.chart.layout.padding.bottom,
left: R.value.style.chart.layout.padding.left
})), W = u(() => R.value.style.chart.layout.grid.yAxis.position === "right");
function ar() {
let e = 0;
ln.value && (e = Array.from(ln.value.querySelectorAll("text")).reduce((e, t) => {
let n = t.getComputedTextLength();
return n > e ? n : e;
}, 0));
let t = fn.value ? fn.value.getBoundingClientRect().width + R.value.style.chart.layout.grid.axis.yLabelOffsetX + R.value.style.chart.layout.grid.axis.fontSize : 0, n = e + t + 5;
return {
left: W.value ? 0 : n,
right: W.value ? n : 0,
scaleLabelsWidth: e,
yAxisLabelWidth: t,
crosshair: 5
};
}
let or = S(0), sr = Pe((e) => {
or.value = e;
}, 100);
tt((e) => {
let t = un.value;
if (!t) return;
let n = new ResizeObserver((e) => {
sr(e[0].contentRect.height);
});
n.observe(t), e(() => n.disconnect());
}), Ye(() => {
or.value = 0, En.stop(), clearTimeout(Nn.value), F.value && (I.value && F.value.unobserve(I.value), F.value.disconnect(), F.value = null, I.value = null);
});
let cr = u(() => {
let e = 0;
dn.value && (e = dn.value.getBBox().height);
let t = 0;
return un.value && (t = or.value), e + t + R.value.style.chart.layout.grid.axis.fontSize + R.value.style.chart.layout.grid.xAxis.dataLabels.offsetY;
}), G = u(() => {
yn.value;
let e = ar(), t = R.value.style.chart.layout.dataLabels.fontSize * 3, n = B.value.width, r = B.value.height, i = U.value.left + e.left, a = n - U.value.right - e.right, o = n - i - U.value.right - e.right, s = r - U.value.top - U.value.bottom - t - cr.value, c = U.value.top + t;
return {
top: c,
left: i,
right: a,
bottom: r - U.value.bottom - cr.value,
absoluteHeight: r,
absoluteWidth: n,
centerX: i + Math.max(10, o) / 2,
centerY: c + Math.max(10, s) / 2,
width: Math.max(10, o),
height: Math.max(10, s),
scaleLabelsWidth: e.scaleLabelsWidth,
yAxisLabelWidth: e.yAxisLabelWidth,
crosshair: e.crosshair
};
}), K = u(() => (Hn.value.forEach((e, t) => {
[null, void 0].includes(e.name) && me({
componentName: "VueUiDonutEvolution",
type: "datasetSerieAttribute",
property: "name",
index: t,
debug: Ln.value
}), [null, void 0].includes(e.values) && me({
componentName: "VueUiDonutEvolution",
type: "datasetSerieAttribute",
property: "values",
index: t,
debug: Ln.value
});
}), Hn.value.map((e, t) => ({
...e,
values: ee(e.values),
color: te(e.color) || ir.value[t] || s[t] || s[t % s.length],
length: (e.values || []).length,
uid: fe()
})))), lr = u(() => K.value.filter((e) => !A.value.includes(e.uid)).map((e) => ({
...e,
values: e.values.filter((e, t) => t >= V.value.start && t <= V.value.end)
}))), q = u(() => Math.max(...K.value.map((e) => e.length))), J = S([]), ur = 0;
tt(() => {
let e = ++ur;
(async () => {
let t = await be({
values: R.value.style.chart.layout.grid.xAxis.dataLabels.values,
maxDatapoints: q.value,
formatter: R.value.style.chart.layout.grid.xAxis.dataLabels.datetimeFormatter,
start: V.value.start,
end: V.value.end
});
e === ur && (J.value = t);
})();
});
let Y = u(() => G.value.width / (V.value.end - V.value.start)), dr = u(() => {
let e = [];
for (let t = 0; t < V.value.end - V.value.start; t += 1) {
let n = lr.value.map((e) => e.values[t] ?? null), r = n.filter((e) => [void 0, null].includes(e)).length === n.length, i = n.reduce((e, t) => e + t, 0), a = n.map((e) => e / i), o = G.value.left + Y.value * t + Y.value / 2;
e.push({
index: t,
percentages: a,
subtotal: r || i < 0 ? null : i,
values: n,
x: o
});
}
return e;
}), fr = u(() => {
let e = Math.max(...dr.value.map((e) => e.subtotal).filter((e) => ge(e))) ?? 1, t = Math.min(...dr.value.map((e) => e.subtotal).filter((e) => ge(e))) ?? 0, n = Math.max(R.value.style.chart.layout.grid.yAxis.scaleMax ?? 0, e), r;
return r = R.value.style.chart.layout.grid.yAxis.scaleMin == null ? 0 : Math.min(t, R.value.style.chart.layout.grid.yAxis.scaleMin), R.value.style.chart.layout.grid.yAxis.autoScale && (r = t, n = e), r === n && (r = n / 2, n *= 1.5), {
max: n,
min: r
};
}), X = u(() => {
let e = dr.value.length === 1 ? fr.value.max * 2 : fr.value.max;
return ie(fr.value.min, e, R.value.style.chart.layout.grid.yAxis.dataLabels.steps);
});
et(() => X.value.ticks.join("|"), () => {
Tn();
}, { flush: "post" });
function pr(e) {
return (e - X.value.min) / (X.value.max - X.value.min);
}
let mr = u(() => X.value.ticks.map((e) => ({
y: G.value.bottom - G.value.height * pr(e),
value: e
}))), Z = u(() => {
let e = dr.value, t = Math.max(...e.map((e) => e.subtotal));
return e.length === 1 && t * 2, e.map((t, n) => {
let r = Math.min(G.value.width / 24, Y.value / 2 * .7), i = r > G.value.width / 16 ? G.value.width / 16 : r, a = j.value === t.index ? G.value.width / 16 : i, o = e.length > 4 ? r * 2 : r * 2 > Y.value / 2 * .7 ? Y.value / 2 * .7 : r * 2, s = G.value.bottom - G.value.height * pr(t.subtotal), c = lr.value.map((e) => ({
color: e.color,
name: e.name,
value: e.values[n] ?? 0
})).toSorted((e, t) => t.value - e.value);
return {
...t,
y: s,
radius: i,
activeRadius: a,
hoverRadius: o,
donut: le({ series: c }, t.x, s, i, i, 1.99999, 2, 1, 360, 105.25, i / 2),
donutHover: le({ series: c }, t.x, s, o, o, 1.99999, 2, 1, 360, 105.25, o / 2),
donutFocus: le({ series: c }, G.value.centerX, G.value.centerY, G.value.height / 3.6, G.value.height / 3.6, 1.99999, 2, 1, 360, 105.25, G.value.height / 6)
};
});
});
function hr(e, t, n) {
return se(R.value.style.chart.layout.dataLabels.formatter, e, re({
p: R.value.style.chart.layout.dataLabels.prefix,
v: e,
s: R.value.style.chart.layout.dataLabels.suffix,
r: R.value.style.chart.layout.dataLabels.rounding
}), {
datapoint: t,
index: n
});
}
function gr(e, t) {
return isNaN(e.value / ne(t, "value")) ? 0 : (e.value / ne(t, "value") * 100).toFixed(0) + "%";
}
function _r(e) {
j.value = null, M.value = null, L.value = null, R.value.events.datapointLeave && R.value.events.datapointLeave({
datapoint: e,
seriesIndex: e.seriesIndex + V.value.start
});
}
function vr(e) {
R.value.events.datapointEnter && R.value.events.datapointEnter({
datapoint: e,
seriesIndex: e.index + V.value.start
}), j.value = e.index, M.value = e, L.value = e.index;
}
let yr = S(null);
function br(e, t) {
R.value.events.datapointClick && R.value.events.datapointClick({
datapoint: e,
seriesIndex: e.index + V.value.start
}), !(!e.subtotal || !R.value.style.chart.dialog.show) && (M.value = null, j.value = null, tn.value = !0, N.value = e, zr(e), [null, void 0].includes(t) || (yr.value = t));
}
let xr = u(() => K.value.map((e, t) => ({
name: e.name,
value: e.values.slice(V.value.start, V.value.end).reduce((e, t) => e + t, 0),
shape: "circle",
uid: e.uid,
color: e.color
})).sort((e, t) => t.value - e.value).map((e, t) => ({
...e,
opacity: A.value.includes(e.uid) ? .5 : 1,
segregate: () => Tr(e.uid),
isSegregated: A.value.includes(e.uid),
display: `${e.name}${R.value.style.chart.legend.showPercentage || R.value.style.chart.legend.showValue ? ": " : ""}${R.value.style.chart.legend.showValue ? se(R.value.style.chart.layout.dataLabels.formatter, e.value, re({
p: R.value.style.chart.layout.dataLabels.prefix,
v: e.value,
s: R.value.style.chart.layout.dataLabels.suffix,
r: R.value.style.chart.legend.roundingValue
}), {
datapoint: e,
seriesIndex: t
}) : ""}${R.value.style.chart.legend.showPercentage ? A.value.includes(e.uid) ? `${R.value.style.chart.legend.showValue ? " (" : ""}- %${R.value.style.chart.legend.showValue ? ")" : ""}` : `${R.value.style.chart.legend.showValue ? " (" : ""}${isNaN(e.value / Sr.value) ? "-" : re({
v: e.value / Sr.value * 100,
s: "%",
r: R.value.style.chart.legend.roundingPercentage
})}${R.value.style.chart.legend.showValue ? ")" : ""}` : ""}`
}))), Sr = u(() => Z.value.map((e) => e.subtotal).reduce((e, t) => e + t, 0)), Cr = u(() => ({
cy: "donut-div-legend",
backgroundColor: R.value.style.chart.legend.backgroundColor,
color: R.value.style.chart.legend.color,
fontSize: R.value.style.chart.legend.fontSize,
paddingBottom: 12,
fontWeight: R.value.style.chart.legend.bold ? "bold" : ""
}));
function wr() {
A.value.length ? A.value = [] : xr.value.forEach((e) => {
A.value.push(e.uid);
}), Fn("selectLegend", lr.value);
}
function Tr(e) {
if (A.value.includes(e)) A.value = A.value.filter((t) => t !== e), Fn("selectLegend", lr.value);
else {
if (A.value.length === K.value.length - 1) return;
A.value.push(e), Fn("selectLegend", lr.value);
}
N.value && br(Z.value.find((e, t) => t === yr.value));
}
function Er(e) {
return K.value.length ? K.value.find((t) => t.name === e) || (R.value.debug && console.warn(`VueUiDonutEvolution - Series name not found "${e}"`), null) : (R.value.debug && console.warn("VueUiDonutEvolution - There are no series to show."), null);
}
function Dr(e) {
let t = Er(e);
t !== null && A.value.includes(t.uid) && Tr(t.uid);
}
function Or(e) {
let t = Er(e);
t !== null && (A.value.includes(t.uid) || Tr(t.uid));
}
let Q = u(() => {
let e = [""].concat(K.value.filter((e) => !A.value.includes(e.uid)).map((e) => ({
name: e.name,
color: e.color
})), ["Σ"]), t = [];
for (let e = 0; e < q.value; e += 1) {
let n = K.value.filter((e) => !A.value.includes(e.uid)).map((t) => t.values[e] ?? 0).reduce((e, t) => e + t, 0);
t.push([J.value[e] ? J.value[e].text : "-"].concat(K.value.filter((e) => !A.value.includes(e.uid)).map((t) => ({
value: t.values[e] ?? 0,
percentage: t.values[e] ? t.values[e] / n * 100 : 0
})), [`${R.value.style.chart.layout.dataLabels.prefix}${Number(n.toFixed(R.value.table.td.roundingValue))}${R.value.style.chart.layout.dataLabels.suffix}`]));
}
return {
head: e,
body: t,
bodyA11y: t.map((e) => e.map((t, n) => n === 0 || n === e.length - 1 ? t : `${hr(t.value ?? 0, null, n)} (${t.percentage.toFixed(1)}%)`)),
config: {
th: {
backgroundColor: R.value.table.th.backgroundColor,
color: R.value.table.th.color,
outline: R.value.table.th.outline
},
td: {
backgroundColor: R.value.table.td.backgroundColor,
color: R.value.table.td.color,
outline: R.value.table.td.outline
},
breakpoint: R.value.table.responsiveBreakpoint
},
colNames: [R.value.table.columnNames.period].concat(K.value.filter((e) => !A.value.includes(e.uid)).map((e) => e.name), R.value.table.columnNames.total)
};
});
function kr() {
return K.value;
}
function Ar(e = null) {
_(() => {
let n = [
[R.value.style.chart.title.text],
[R.value.style.chart.title.subtitle.text],
[""]
], i = [...Q.value.head.map((e) => e.name ?? e)], a = [...Q.value.body.map((e) => e.map((e) => e.value ?? e))], o = n.concat([i]).concat(a), s = r(o);
e ? e(s) : t({
csvContent: s,
title: R.value.style.chart.title.text || "vue-ui-donut-evolution"
});
});
}
let $ = S(!1);
function jr(e) {
$.value = e, rn.value += 1;
}
function Mr() {
H.value.showTable = !H.value.showTable;
}
let Nr = S(!1);
function Pr() {
Nr.value = !Nr.value;
}
function Fr(e) {
return e.proportion * 100 > R.value.style.chart.donuts.hover.hideLabelsUnderValue;
}
let Ir = S([]), Lr = S({}), Rr = S(null);
function zr(e) {
Ir.value = e.donut.map((e) => ({
name: e.name,
values: [e.value],
color: e.color
})), Lr.value = c({
...R.value.style.chart.dialog.donutChart,
responsive: !0,
theme: R.value.theme
}), Rr.value && Rr.value.open();
}
async function Br({ scale: e = 2 } = {}) {
if (!P.value) return;
let { width: t, height: n } = P.value.getBoundingClientRect(), r = t / n, { imageUri: i, base64: a } = await je({
domElement: P.value,
base64: !0,
img: !0,
scale: e
});
return {
imageUri: i,
base64: a,
title: R.value.style.chart.title.text,
width: t,
height: n,
aspectRatio: r
};
}
let Vr = u(() => B.value.width), Hr = u(() => B.value.height);
Ae({
timeLabelsEls: un,
timeLabels: J,
slicer: V,
configRef: R,
rotationPath: [
"style",
"chart",
"layout",
"grid",
"xAxis",
"dataLabels",
"rotation"
],
autoRotatePath: [
"style",
"chart",
"layout",
"grid",
"xAxis",
"dataLabels",
"autoRotate",
"enable"
],
isAutoSize: !1,
width: Vr,
height: Hr,
rotation: R.value.style.chart.layout.grid.xAxis.dataLabels.autoRotate.angle
});
let Ur = u(() => {
let e = R.value.table.useDialog && !R.value.table.show, t = H.value.showTable;
return {
component: e ? Zt : Wt,
title: `${R.value.style.chart.title.text}${R.value.style.chart.title.subtitle.text ? `: ${R.value.style.chart.title.subtitle.text}` : ""}`,
props: e ? {
backgroundColor: R.value.table.th.backgroundColor,
color: R.value.table.th.color,
headerColor: R.value.table.th.color,
headerBg: R.value.table.th.backgroundColor,
isFullscreen: $.value,
fullscreenParent: P.value,
forcedWidth: Math.min(800, window.innerWidth * .8),
isCursorPointer: z.value
} : {
hideDetails: !0,
config: {
open: t,
maxHeight: 1e4,
body: {
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color
},
head: {
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color
}
}
}
};
});
et(() => H.value.showTable, (e) => {
R.value.table.show || (e && R.value.table.useDialog && mn.value ? mn.value.open() : "close" in mn.value && mn.value.close());
});
function Wr() {
H.value.showTable = !1, hn.value && hn.value.setTableIconState(!1);
}
let Gr = u(() => xr.value.map((e) => ({
...e,
name: e.display
}))), Kr = u(() => R.value.style.chart.backgroundColor), qr = u(() => R.value.style.chart.legend), Jr = u(() => R.value.style.chart.title), { exportSvg: Yr, getSvg: Xr } = Te({
svg: Zn,
title: Jr,
legend: qr,
legendItems: Gr,
backgroundColor: Kr
});
async function Zr({ isCb: e }) {
_n.value = !0, await _();
try {
if (e) {
let { blob: e, url: t, text: n, dataUrl: r } = await Xr();
await Promise.resolve(R.value.userOptions.callbacks.svg({
blob: e,
url: t,
text: n,
dataUrl: r
}));
} else await Promise.resolve(Yr());
} finally {
_n.value = !1;
}
}
function Qr(e) {
if (e?.stage === "start") {
gn.value = !0;
return;
}
if (e?.stage === "end") {
gn.value = !1;
return;
}
nr();
}
async function $r() {
if (Fn("copyAlt", {
config: R.value,
dataset: Z.value
}), !R.value.userOptions.callbacks.altCopy) {
console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");
return;
}
await Promise.resolve(R.value.userOptions.callbacks.altCopy({
config: R.value,
dataset: Z.value
}));
}
function ei() {
L.value = null, Pn.value = !0;
}
function ti() {
L.value = null, j.value = null, M.value = null, Pn.value = !1;
}
function ni(e) {
if (!Zn.value || Nr.value || document.activeElement !== Zn.value || !Z.value.length) return;
let t = e.key === "ArrowLeft", n = e.key === "ArrowRight", r = e.key === "Enter" || e.key === " ", i = e.key === "Escape";
if (!t && !n && !r && !i) return;
if (e.preventDefault(), e.stopPropagation(), i) {
L.value = null, j.value = null, M.value = null;
return;
}
if (r) {
if (L.value === null) return;
let e = Z.value[L.value];
if (!e) return;
br(e, L.value);
return;
}
let a = L.value, o = j.value, s = a !== null && a >= 0 && a < Z.value.length, c = o !== null && o >= 0 && o < Z.value.length;
s ? n ? (a += 1, a >= Z.value.length && (a = 0)) : t && (--a, a < 0 && (a = Z.value.length - 1)) : c ? (a = n ? o + 1 : o - 1, a >= Z.value.length && (a = 0), a < 0 && (a = Z.value.length - 1)) : a = n ? 0 : Z.value.length - 1;
let ee = Z.value[a];
ee && vr(ee);
}
let ri = u(() => ({
headers: Q.value?.colNames ?? [],
rows: Q.value?.bodyA11y ?? []
}));
return Ne({
getData: kr,
getImage: Br,
generatePdf: tr,
generateCsv: Ar,
generateImage: nr,
generateSvg: Zr,
hideSeries: Or,
showSeries: Dr,
toggleTable: Mr,
toggleAnnotator: Pr,
toggleFullscreen: jr,
copyAlt: $r
}), (e, t) => (x(), p("div", {
ref_key: "donutEvolutionChart",
ref: P,
class: v(`vue-data-ui-component vue-ui-donut-evolution ${$.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${R.value.useCssAnimation ? "" : "vue-ui-dna"}`),
style: b(`font-family:${R.value.style.fontFamily};width:100%; text-align:center;background:${R.value.style.chart.backgroundColor}`),
id: k.value,
onMouseenter: t[5] ||= () => E(Yn)(!0),
onMouseleave: t[6] ||= () => E(Yn)(!1)
}, [
m("div", {
id: `chart-instructions-${k.value}`,
class: "sr-only"
}, [m("p", null, T(R.value.a11y.translations.keyboardNavigation), 1)], 8, it),
ri.value?.rows?.length ? (x(), d(Re, {
key: 0,
uid: k.value,
head: ri.value.headers,
body: ri.value.rows,
notice: R.value.a11y.translations.tableAvailable,
caption: R.value.a11y.translations.tableCaption
}, null, 8, [
"uid",
"head",
"body",
"notice",
"caption"
])) : f("", !0),
R.value.userOptions.buttons.annotator ? (x(), d(E(Jt), {
key: 1,
svgRef: E(Zn),
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color,
active: Nr.value,
isCursorPointer: z.value,
onClose: Pr
}, {
"annotator-action-close": D(() => [w(e.$slots, "annotator-action-close", {}, void 0, !0)]),
"annotator-action-color": D(({ color: t }) => [w(e.$slots, "annotator-action-color", y(g({ color: t })), void 0, !0)]),
"annotator-action-draw": D(({ mode: t }) => [w(e.$slots, "annotator-action-draw", y(g({ mode: t })), void 0, !0)]),
"annotator-action-undo": D(({ disabled: t }) => [w(e.$slots, "annotator-action-undo", y(g({ disabled: t })), void 0, !0)]),
"annotator-action-redo": D(({ disabled: t }) => [w(e.$slots, "annotator-action-redo", y(g({ disabled: t })), void 0, !0)]),
"annotator-action-delete": D(({ disabled: t }) => [w(e.$slots, "annotator-action-delete", y(g({ disabled: t })), void 0, !0)]),
_: 3
}, 8, [
"svgRef",
"backgroundColor",
"color",
"active",
"isCursorPointer"
])) : f("", !0),
rr.value ? (x(), p("div", {
key: 2,
ref_key: "noTitle",
ref: nn,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : f("", !0),
R.value.style.chart.title.text ? (x(), p("div", {
key: 3,
ref_key: "chartTitle",
ref: Dn,
style: "width:100%;background:transparent;padding-bottom:24px",
onMouseleave: _r
}, [(x(), d(Me, {
key: `title_${on.value}`,
config: {
title: {
cy: "donut-evolution-div-title",
...R.value.style.chart.title
},
subtitle: {
cy: "donut-evolution-div-subtitle",
...R.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))], 544)) : f("", !0),
m("div", { id: `legend-top-${k.value}` }, null, 8, at),
R.value.userOptions.show && In.value && (E(Xn) || E(Jn)) ? (x(), d(E(Yt), {
ref_key: "userOptionsRef",
ref: hn,
key: `user_options_${rn.value}`,
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color,
isPrinting: E($n),
isImaging: E(er),
uid: k.value,
hasPdf: R.value.userOptions.buttons.pdf,
hasImg: R.value.userOptions.buttons.img,
hasSvg: R.value.userOptions.buttons.svg,
hasXls: R.value.userOptions.buttons.csv,
hasTable: R.value.userOptions.buttons.table,
hasFullscreen: R.value.userOptions.buttons.fullscreen,
hasAltCopy: R.value.userOptions.buttons.altCopy,
isFullscreen: $.value,
titles: { ...R.value.userOptions.buttonTitles },
chartElement: P.value,
position: R.value.userOptions.position,
hasAnnotator: R.value.userOptions.buttons.annotator,
isAnnotation: Nr.value,
callbacks: R.value.userOptions.callbacks,
printScale: R.value.userOptions.print.scale,
tableDialog: R.value.table.useDialog,
isCursorPointer: z.value,
onToggleFullscreen: jr,
onGeneratePdf: E(tr),
onGenerateCsv: Ar,
onGenerateImage: Qr,
onGenerateSvg: Zr,
onToggleTable: Mr,
onToggleAnnotator: Pr,
onCopyAlt: $r,
style: b({ visibility: E(Xn) ? E(Jn) ? "visible" : "hidden" : "visible" })
}, Ge({ _: 2 }, [
e.$slots.menuIcon ? {
name: "menuIcon",
fn: D(({ isOpen: t, color: n }) => [w(e.$slots, "menuIcon", y(g({
isOpen: t,
color: n
})), void 0, !0)]),
key: "0"
} : void 0,
e.$slots.optionPdf ? {
name: "optionPdf",
fn: D(() => [w(e.$slots, "optionPdf", {}, void 0, !0)]),
key: "1"
} : void 0,
e.$slots.optionCsv ? {
name: "optionCsv",
fn: D(() => [w(e.$slots, "optionCsv", {}, void 0, !0)]),
key: "2"
} : void 0,
e.$slots.optionImg ? {
name: "optionImg",
fn: D(() => [w(e.$slots, "optionImg", {}, void 0, !0)]),
key: "3"
} : void 0,
e.$slots.optionSvg ? {
name: "optionSvg",
fn: D(() => [w(e.$slots, "optionSvg", {}, void 0, !0)]),
key: "4"
} : void 0,
e.$slots.optionTable ? {
name: "optionTable",
fn: D(() => [w(e.$slots, "optionTable", {}, void 0, !0)]),
key: "5"
} : void 0,
e.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: D(({ toggleFullscreen: t, isFullscreen: n }) => [w(e.$slots, "optionFullscreen", y(g({
toggleFullscreen: t,
isFullscreen: n
})), void 0, !0)]),
key: "6"
} : void 0,
e.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: D(({ toggleAnnotator: t, isAnnotator: n }) => [w(e.$slots, "optionAnnotator", y(g({
toggleAnnotator: t,
isAnnotator: n
})), void 0, !0)]),
key: "7"
} : void 0,
e.$slots.optionAltCopy ? {
name: "optionAltCopy",
fn: D(({ altCopy: t }) => [w(e.$slots, "optionAltCopy", y(g({ altCopy: t })), void 0, !0)]),
key: "8"
} : void 0,
e.$slots["custom-menu-before"] ? {
name: "custom-menu-before",
fn: D(() => [w(e.$slots, "custom-menu-before", {}, void 0, !0)]),
key: "9"
} : void 0,
e.$slots["custom-menu-after"] ? {
name: "custom-menu-after",
fn: D(() => [w(e.$slots, "custom-menu-after", {}, void 0, !0)]),
key: "10"
} : void 0
]), 1032, [
"backgroundColor",
"color",
"isPrinting",
"isImaging",
"uid",
"hasPdf",
"hasImg",
"hasSvg",
"hasXls",
"hasTable",
"hasFullscreen",
"hasAltCopy",
"isFullscreen",
"titles",
"chartElement",
"position",
"hasAnnotator",
"isAnnotation",
"callbacks",
"printScale",
"tableDialog",
"isCursorPointer",
"onGeneratePdf",
"style"
])) : f("", !0),
m("div", ot, [(x(), p("svg", {
ref_key: "svgRef",
ref: Zn,
xmlns: E(pe),
"aria-describedby": `chart-instructions-${k.value}`,
class: v({
"vue-data-ui-fullscreen--on": $.value,
"vue-data-ui-fulscreen--off": !$.value,
"vue-data-ui-no-transition": !E(zn)
}),
viewBox: `0 0 ${G.value.absoluteWidth} ${G.value.absoluteHeight}`,
style: b(`max-width:100%; overflow: visible; background:transparent;color:${R.value.style.chart.color};`),
tabindex: "0",
onFocus: ei,
onBlur: ti,
onKeydown: ni
}, [
qe(E(qt)),
e.$slots["chart-background"] ? (x(), p("foreignObject", {
key: 0,
x: G.value.left,
y: G.value.top,
width: G.value.width,
height: G.value.height,
style: { pointerEvents: "none" }
}, [w(e.$slots, "chart-background", {}, void 0, !0)], 8, ct)) : f("", !0),
m("defs", null, [qe(Ie, {
t: "linear",
id: `hover_${k.value}`,
x1: "0%",
y1: "0%",
x2: "0%",
y2: "100%",
stops: [[
"0%",
E(n)(R.value.style.chart.backgroundColor, R.value.style.chart.layout.highlighter.opacity),
1
], [
"100%",
E(n)(R.value.style.chart.layout.highlighter.color, R.value.style.chart.layout.highlighter.opacity),
1
]]
}, null, 8, ["id", "stops"]), qe(Ie, {
t: "radial",
id: `focus_${k.value}`,
stops: [
[
"0%",
E(n)(E(te)(R.value.style.chart.backgroundColor), 0),
1
],
[
"77%",
E(n)("#FFFFFF", 30),
1
],
[
"100%",
E(n)(E(te)(R.value.style.chart.backgroundColor), 0),
1
]
]
}, null, 8, ["id", "stops"])]),
R.value.style.chart.layout.grid.show ? (x(), p("g", lt, [
m("line", {
x1: W.value ? G.value.right : G.value.left,
x2: W.value ? G.value.right : G.value.left,
y1: G.value.top,
y2: G.value.top + G.value.height,
stroke: R.value.style.chart.layout.grid.stroke,
"stroke-width": R.value.style.chart.layout.grid.strokeWidth,
"stroke-linecap": "round"
}, null, 8, ut),
m("line", {
x1: G.value.left,
x2: G.value.right,
y1: G.value.bottom,
y2: G.value.bottom,
stroke: R.value.style.chart.layout.grid.stroke,
"stroke-width": R.value.style.chart.layout.grid.strokeWidth,
"stroke-linecap": "round"
}, null, 8, dt),
R.value.style.chart.layout.grid.showVerticalLines ? (x(), p("g", ft, [(x(!0), p(l, null, C(V.value.end - V.value.start, (e, t) => (x(), p("line", {
x1: G.value.left + (t + 1) * Y.value,
x2: G.value.left + (t + 1) * Y.value,
y1: G.value.top,
y2: G.value.bottom,
stroke: R.value.style.chart.layout.grid.stroke,
"stroke-width": R.value.style.chart.layout.grid.strokeWidth,
"stroke-linecap": "round"
}, null, 8, pt))), 256))])) : f("", !0)
])) : f("", !0),
m("g", null, [R.value.style.chart.layout.grid.axis.yLabel ? (x(), p("text", {
key: 0,
ref_key: "yAxisLabel",
ref: fn,
"font-size": R.value.style.chart.layout.grid.axis.fontSize,
fill: R.value.style.chart.layout.grid.axis.color,
transform: `translate(${W.value ? G.value.absoluteWidth - R.value.style.chart.layout.grid.axis.fontSize / 2 - R.value.style.chart.layout.grid.axis.yLabelOffsetX : R.value.style.chart.layout.grid.axis.fontSize}, ${G.value.top + G.value.height / 2}) rotate(-90)`,
"text-anchor": "middle",
style: { transition: "none" }
}, T(R.value.style.chart.layout.grid.axis.yLabel), 9, mt)) : f("", !0), R.value.style.chart.layout.grid.axis.xLabel ? (x(), p("text", {
key: 1,
ref_key: "xAxisLabel",
ref: dn,
"text-anchor": "middle",
x: G.value.absoluteWidth / 2,
y: G.value.absoluteHeight - 3,
"font-size": R.value.style.chart.layout.grid.axis.fontSize,
fill: R.value.style.chart.layout.grid.axis.color
}, T(R.value.style.chart.layout.grid.axis.xLabel), 9, ht)) : f("", !0)]),
R.value.style.chart.layout.grid.yAxis.dataLabels.show ? (x(), p("g", {
key: 2,
ref_key: "scaleLabels",
ref: ln,
class: v({
"donut-opacity": !0,
"donut-behind": j.value !== null
})
}, [(x(!0), p(l, null, C(mr.value, (e, t) => (x(), p("g", { key: `sl_${t}` }, [e.value >= X.value.min && e.value <= X.value.max ? (x(), p("path", {
key: 0,
class: v({ "vue-data-ui-transition": E(zn) }),
d: `M${W.value ? G.value.right : G.value.left},${e.y} ${W.value ? G.value.right + 5 : G.value.left - 5},${e.y}`,
stroke: R.value.style.chart.layout.grid.stroke,
"stroke-width": R.value.style.chart.layout.grid.strokeWidth,
"stroke-linecap": "round"
}, null, 10, gt)) : f("", !0), e.value >= X.value.min && e.value <= X.value.max ? (x(), p("text", {
key: 1,
class: v({ "vue-data-ui-transition": E(zn) }),
transform: `translate(${W.value ? G.value.right - R.value.style.chart.layout.grid.yAxis.dataLabels.offsetX + 7 : G.value.left + R.value.style.chart.layout.grid.yAxis.dataLabels.offsetX - 7}, ${e.y + R.value.style.chart.layout.grid.yAxis.dataLabels.fontSize / 3})`,
"font-size": R.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,
"text-anchor": W.value ? "start" : "end",
fill: R.value.style.chart.layout.grid.yAxis.dataLabels.color,
"font-weight": R.value.style.chart.layout.grid.yAxis.dataLabels.bold ? "bold" : "normal"
}, T(E(_e)(e.value) ? E(se)(R.value.style.chart.layout.dataLabels.formatter, e.value, E(re)({
p: R.value.style.chart.layout.dataLabels.prefix,
v: e.value,
s: R.value.style.chart.layout.dataLabels.suffix,
r: R.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue
}), {
datapoint: e,
seriesIndex: t
}) : ""), 11, _t)) : f("", !0)]))), 128))], 2)) : f("", !0),
R.value.style.chart.layout.grid.xAxis.dataLabels.show ? (x(), p("g", {
key: 3,
ref_key: "timeLabelsEls",
ref: un,
class: v({ "donut-opacity": !0 })
}, [(x(!0), p(l, null, C(V.value.end - V.value.start, (e, t) => (x(), p("g", null, [(R.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast && (t === 0 || t === q.value - 1) || !R.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast) && J.value[t] && J.value[t].text ? (x(), p("g", vt, [String(J.value[t].text).includes("\n") ? (x(), p("text", {
key: 1,
class: "vue-data-ui-time-label",
"text-anchor": R.value.style.chart.layout.grid.xAxis.dataLabels.rotation > 0 ? "start" : R.value.style.chart.layout.grid.xAxis.dataLabels.rotation < 0 ? "end" : "middle",
"font-size": R.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,
fill: R.value.style.chart.layout.grid.xAxis.dataLabels.color,
transform: `translate(${G.value.left + Y.value * t + Y.value / 2}, ${G.value.bottom + R.value.style.chart.layout.grid.xAxis.dataLabels.fontSize + R.value.style.chart.layout.grid.xAxis.dataLabels.offsetY}), rotate(${R.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`,
innerHTML: E(i)({
content: String(J.value[t].text),
fontSize: R.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,
fill: R.value.style.chart.layout.grid.xAxis.dataLabels.color,
x: 0,
y: 0
})
}, null, 8, bt)) : (x(), p("text", {
key: 0,
class: "vue-data-ui-time-label",
"text-anchor": R.value.style.chart.layout.grid.xAxis.dataLabels.rotation > 0 ? "start" : R.value.style.chart.layout.grid.xAxis.dataLabels.rotation < 0 ? "end" : "middle",
"font-size": R.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,
fill: R.value.style.chart.layout.grid.xAxis.dataLabels.color,
transform: `translate(${G.value.left + Y.value * t + Y.value / 2}, ${G.value.bottom + R.value.style.chart.layout.grid.xAxis.dataLabels.fontSize + R.value.style.chart.layout.grid.xAxis.dataLabels.offsetY}), rotate(${R.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`
}, T(J.value[t].text || ""), 9, yt))])) : f("", !0)]))), 256))], 512)) : f("", !0),
(x(!0), p(l, null, C(Z.value, (e, t) => (x(), p("g", null, [R.value.style.chart.layout.line.show && t < Z.value.length - 1 && ![e.subtotal, Z.value[t + 1].subtotal].includes(null) ? (x(), p("line", {
key: 0,
class: v({
"donut-opacity": !0,
"donut-behind": j.value !== null
}),
x1: e.x,
y1: e.y,
x2: Z.value[t + 1].x,
y2: Z.value[t + 1].y,
stroke: R.value.style.chart.layout.line.stroke,
"stroke-width": R.value.style.chart.layout.line.strokeWidth,
"stroke-linecap": "round",
"stroke-linejoin": "round"
}, null, 10, xt)) : f("", !0), e.subtotal === null ? f("", !0) : (x(), p("g", St, [e.subtotal ? (x(), p("circle", {
key: 0,
cx: e.x,
cy: e.y,
r: e.activeRadius,
fill: R.value.style.chart.backgroundColor
}, null, 8, Ct)) : f("", !0)]))]))), 256)),
(x(!0), p(l, null, C(Z.value, (e, t) => (x(), p("g", { class: v({
"donut-opacity": !0,
"donut-behind": t !== j.value && j.value !== null
}) }, [e.subtotal ? (x(), p("g", wt, [j.value !== null && j.value === t ? (x(), p("g", Tt, [
(x(!0), p(l, null, C(e.donutHover, (t) => (x(), p("g", null, [Fr(t) ? (x(), p("path", {
key: 0,
d: E(oe)(t, {
x: t.center.endX,
y: t.center.endY
}, 12, 12, {
x: e.x,
y: e.y
}, !1, 20),
stroke: t.color,
"stroke-width": "1",
"stroke-linecap": "round",
"stroke-linejoin": "round",
fill: "none"
}, null, 8, Et)) : f("", !0)]))), 256)),
(x(!0), p(l, null, C(e.donutHover, (t, n) => (x(), p("g", null, [Fr(t) ? (x(), p("text", {
key: 0,
"data-cy-hover-label": "",
"text-anchor": E(ae)(t, !0, 0).anchor,
x: E(ae)(t, !0, 9).x,
y: E(ue)(t, 14, 10),
fill: R.value.style.chart.layout.grid.yAxis.dataLabels.color,
"font-size": 8,
"font-weight": "bold"
}, T(t.name) + ": " + T(gr(t, e.donut)) + " (" + T(t.value === null ? "-" : hr(t.value, t, n)) + ") ", 9, Dt)) : f("", !0)]))), 256)),
m("g", null, [m("circle", {
cx: e.x,
cy: e.y,
r: e.hoverRadius,
fill: R.value.style.chart.backgroundColor
}, null, 8, Ot)])
])) : f("", !0)])) : f("", !0)], 2))), 256)),
(x(!0), p(l, null, C(Z.value, (e, t) => (x(), p("g", { class: v({
"donut-opacity": !0,
"donut-behind": t !== j.value && j.value !== null
}) }, [e.subtotal === null ? f("", !0) : (x(), p("g", kt, [e.subtotal === 0 ? (x(), p("circle", {
key: 0,
cx: e.x,
cy: e.y,
r: 3,
fill: R.value.style.chart.color
}, null, 8, At)) : j.value !== null && j.value === t ? (x(), p("g", jt, [(x(!0), p(l, null, C(e.donutHover, (e, t) => (x(), p("path", {
d: e.arcSlice,
fill: `${e.color}`,
"stroke-width": 1,
stroke: R.value.style.chart.backgroundColor
}, null, 8, Mt))), 256))])) : (x(), p("g", Nt, [(x(!0), p(l, null, C(e.donut, (e, t) => (x(), p("path", {
d: e.arcSlice,
fill: `${e.color}`,
"stroke-width": .5,
stroke: R.value.style.chart.backgroundColor
}, null, 8, Pt))), 256))]))]))], 2))), 256)),
(x(!0), p(l, null, C(Z.value, (e, t) => (x(), p("g", { class: v({
"donut-opacity": !0,
"donut-behind": t !== j.value && j.value !== null || tn.value && t !== N.value.index
}) }, [e.subtotal !== null && R.value.style.chart.layout.dataLabels.show ? (x(), p("text", {
key: 0,
"text-anchor": "middle",
x: e.x,
y: j.value === e.index && e.subtotal ? e.y + R.value.style.chart.layout.dataLabels.fontSize / 3 : e.y - e.radius - R.value.style.chart.layout.dataLabels.fontSize + R.value.style.chart.layout.dataLabels.offsetY,
"font-size": R.value.style.chart.layout.dataLabels.fontSize,
"font-weight": "bold",
fill: R.value.style.chart.layout.dataLabels.color
}, T(hr(e.subtotal, e, t)), 9, Ft)) : f("", !0)], 2))), 256)),
(x(!0), p(l, null, C(Z.value, (e, t) => (x(), p("rect", {
x: G.value.left + t * Y.value,
y: G.value.top,
width: Y.value,
height: G.value.height,
fill: [j.value, yr.value].includes(e.index) ? `url(#hover_${k.value})` : "transparent",
class: v({ "donut-hover": z.value && e.subtotal && [j.value, yr.value].includes(e.index) }),
style: { pointerEvents: "none" }
}, null, 10, It))), 256)),
(x(!0), p(l, null, C(Z.value, (e, t) => (x(), p("rect", {
"data-cy-trap": "",
x: G.value.left + t * Y.value,
y: G.value.top,
width: Y.value,
height: G.value.height,
fill: "transparent",
onMouseenter: (t) => vr(e),
onMouseleave: (t) => _r(e),
onClick: (n) => br(e, t),
class: v({ "donut-hover": z.value && j.value === e.index && e.subtotal })
}, null, 42, Lt))), 256)),
w(e.$slots, "svg", { svg: {
...G.value,
isPrintingImg: E($n) || E(er) || gn.value,
isPrintingSvg: _n.value
} }, void 0, !0)
], 46, st)), e.$slots.hint ? (x(), p("div", Rt, [w(e.$slots, "hint", y(g({
hint: R.value.a11y.translations.keyboardNavigation,
isVisible: Pn.value
})), void 0, !0)])) : f("", !0)]),
e.$slots.watermark ? (x(), p("div", zt, [w(e.$slots, "watermark", y(g({ isPrinting: E($n) || E(er) || gn.value || _n.value })), void 0, !0)])) : f("", !0),
m("div", {
ref_key: "chartSlicer",
ref: jn,
style: b(`width:100%;background:${R.value.style.chart.backgroundColor}`),
"data-dom-to-png-ignore": ""
}, [q