vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
686 lines (685 loc) • 29.4 kB
JavaScript
import { defineAsyncComponent as P, useSlots as et, ref as i, computed as f, watch as tt, shallowRef as _e, onMounted as lt, onBeforeUnmount as ot, createElementBlock as p, openBlock as r, unref as s, normalizeStyle as S, normalizeClass as U, createBlock as N, createCommentVNode as m, createElementVNode as T, createVNode as Q, createSlots as Oe, withCtx as g, renderSlot as d, normalizeProps as R, guardReactiveProps as M, Fragment as Z, renderList as ee, mergeProps as at, toDisplayString as B, createTextVNode as st, nextTick as nt } from "vue";
import { u as ut, c as Ie, t as rt, p as A, a as it, o as vt, e as te, g as ct, b as dt, G as ht, d as Pe, f as F, X as pt, s as gt, w as ft, v as j, i as Se, q as yt, r as mt, x as bt, y as kt } from "./index-BLtEpj8j.js";
import { t as wt, u as Ct } from "./useResponsive-DfdjqQps.js";
import { u as Ne } from "./useNestedProp-Bw1KcAmj.js";
import { u as $t } from "./usePrinter-DnRwTdvS.js";
import { u as Tt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as xt } from "./useChartAccessibility-9icAAmYg.js";
import _t from "./Legend-E7G897sw.js";
import Ot from "./Title-DkG60EPg.js";
import { _ as It } from "./Shape-Cqnzky8X.js";
import Pt from "./img-D-vWHxhM.js";
import { _ as St } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Nt = ["id"], At = ["xmlns", "viewBox"], Ft = ["width", "height"], Lt = ["id"], Vt = ["stop-color"], Rt = ["stop-color"], Mt = { key: 1 }, zt = ["stroke", "cx", "cy", "r", "fill"], Ut = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], Bt = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], Et = ["cx", "cy", "r", "onMouseenter"], Wt = {
key: 5,
class: "vue-data-ui-watermark"
}, Dt = ["onClick"], Gt = ["innerHTML"], Ht = {
__name: "vue-ui-rings",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectLegend"],
setup(Ae, { expose: Fe, emit: Le }) {
const Ve = P(() => import("./vue-ui-accordion-B6Svdk-2.js")), Re = P(() => import("./DataTable-CS_V_Adx.js")), Me = P(() => import("./PackageVersion-CnRyWKP-.js")), ze = P(() => import("./PenAndPaper-7BWf7zgA.js")), Ue = P(() => import("./vue-ui-skeleton-CsMU8DwQ.js")), Be = P(() => import("./Tooltip-CuHsd1IQ.js")), Ee = P(() => import("./UserOptions-DGw0HvSp.js")), { vue_ui_rings: We } = ut(), De = et(), b = Ae, I = i(!1), E = f(() => !!b.dataset && b.dataset.length), C = i(Ie()), Ge = i(null), W = i(!1), X = i(""), $ = i(null), le = i(0), x = i(null), oe = i(null), ae = i(null), se = i(null), ne = i(null), ue = i(0), re = i(0), ie = i(0), e = f({
get: () => he(),
set: (t) => t
}), { userOptionsVisible: q, setUserOptionsVisibility: ve, keepUserOptionState: ce } = Tt({ config: e.value }), { svgRef: de } = xt({ config: e.value.style.chart.title });
function he() {
const t = Ne({
userConfig: b.config,
defaultConfig: We
});
return t.theme ? {
...Ne({
userConfig: it.vue_ui_rings[t.theme] || b.config,
defaultConfig: t
}),
customPalette: rt[t.theme] || A
} : t;
}
tt(() => b.config, (t) => {
e.value = he(), q.value = !e.value.userOptions.showOnChartHover, pe(), ue.value += 1, re.value += 1, ie.value += 1, k.value.showTable = e.value.table.show, k.value.showTooltip = e.value.style.chart.tooltip.show;
}, { deep: !0 });
const _ = _e(null), L = _e(null);
lt(() => {
pe();
});
function pe() {
if (vt(b.dataset) ? te({
componentName: "VueUiRings",
type: "dataset"
}) : b.dataset.forEach((t, o) => {
t.values.length || te({
componentName: "VueUiRings",
type: "dataset"
}), ct({
datasetObject: t,
requiredAttributes: ["name", "values"]
}).forEach((l) => {
te({
componentName: "VueUiRings",
type: "datasetSerieAttribute",
property: l,
index: o
});
});
}), e.value.responsive) {
const t = wt(() => {
const { width: o, height: l } = Ct({
chart: x.value,
title: e.value.style.chart.title.text ? oe.value : null,
legend: e.value.style.chart.legend.show ? ae.value : null,
source: se.value,
noTitle: ne.value
});
requestAnimationFrame(() => {
n.value.width = o, n.value.height = l;
});
});
_.value && (L.value && _.value.unobserve(L.value), _.value.disconnect()), _.value = new ResizeObserver(t), L.value = x.value.parentNode, _.value.observe(L.value);
}
setTimeout(() => {
I.value = !0;
}, 600);
}
ot(() => {
_.value && (L.value && _.value.unobserve(L.value), _.value.disconnect());
});
const { isPrinting: ge, isImaging: fe, generatePdf: ye, generateImage: me } = $t({
elementId: `rings_${C.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-rings",
options: e.value.userOptions.print
}), He = f(() => e.value.userOptions.show && !e.value.style.chart.title.text), be = f(() => dt(e.value.customPalette)), k = i({
showTable: e.value.table.show,
showTooltip: e.value.style.chart.tooltip.show
}), n = i({
height: 360,
width: 360
}), je = f(() => Math.min(n.value.height, n.value.width)), Xe = Le, y = i([]);
function Y(t) {
y.value.includes(t) ? y.value = y.value.filter((o) => o !== t) : y.value.push(t), Xe("selectLegend", h.value.map((o) => ({
name: o.name,
color: o.color,
value: o.value
})));
}
const qe = f(() => Math.max(
...D.value.filter((t) => !y.value.includes(t.uid)).map(({ value: t }) => t)
));
function ke(t) {
return t / qe.value;
}
const D = f(() => b.dataset.map(({ values: t, name: o, color: l = null }, a) => {
const u = ht(t).reduce((v, z) => v + z, 0);
return {
name: o,
color: l || Pe(l) || be.value[a] || A[a] || A[a % A.length],
value: u,
proportion: u / b.dataset.map((v) => (v.values || []).reduce((z, Ze) => z + Ze, 0)).reduce((v, z) => v + z, 0),
uid: Ie(),
absoluteIndex: a
};
})), we = f(() => D.value.map((t) => ({
...t,
shape: "circle",
opacity: y.value.includes(t.uid) ? 0.5 : 1,
segregate: () => Y(t.uid),
isSegregated: y.value.includes(t.uid)
})).toSorted((t, o) => o.value - t.value)), Ye = f(() => ({
cy: "rings-div-legend",
backgroundColor: e.value.style.chart.legend.backgroundColor,
color: e.value.style.chart.legend.color,
fontSize: e.value.style.chart.legend.fontSize,
paddingBottom: 12,
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
})), w = f(() => D.value.filter((t) => !y.value.includes(t.uid)).map(({ value: t }) => t).reduce((t, o) => t + o, 0)), h = f(() => D.value.filter((t) => !y.value.includes(t.uid)).map(({ name: t, value: o, color: l = null, uid: a, absoluteIndex: u }, v) => ({
absoluteIndex: u,
uid: a,
name: t,
color: l || Pe(l) || be.value[v] || A[v] || A[v % A.length],
value: o,
proportion: ke(o),
percentage: o / w.value * 100,
strokeWidth: e.value.style.chart.layout.rings.strokeWidth * ke(o)
})).toSorted((t, o) => o.value - t.value));
function Je() {
return h.value.map(
({ name: t, color: o, value: l, absoluteValues: a, percentage: u }) => ({
name: t,
color: o,
value: l,
absoluteValues: a,
percentage: u
})
);
}
const c = f(() => je.value - e.value.style.chart.layout.rings.strokeWidth * 2), J = i(null);
function Ke(t, o) {
if (y.value.length === b.dataset.length) return;
J.value = {
datapoint: o,
seriesIndex: t,
series: h.value,
config: e.value
}, $.value = t;
const l = h.value[t], a = e.value.style.chart.tooltip.customFormat;
if (bt(a) && kt(() => a({
seriesIndex: t,
datapoint: o,
series: h.value,
config: e.value
})))
X.value = a({
seriesIndex: t,
datapoint: o,
series: h.value,
config: e.value
});
else {
let u = "";
u += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`, u += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${l.color}" />${De.pattern ? `<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${C.value}_${o.absoluteIndex})" />` : ""}</svg>`, e.value.style.chart.tooltip.showValue && (u += `<b>${Se(
e.value.style.chart.layout.labels.dataLabels.formatter,
l.value,
F({
p: e.value.style.chart.layout.labels.dataLabels.prefix,
v: l.value,
s: e.value.style.chart.layout.labels.dataLabels.suffix,
r: e.value.style.chart.tooltip.roundingValue
}),
{ datapoint: o, seriesIndex: t }
)}
</b>`), e.value.style.chart.tooltip.showPercentage && (e.value.style.chart.tooltip.showValue ? u += `<span>(${F({
v: l.value / w.value * 100,
s: "%",
r: e.value.style.chart.tooltip.roundingPercentage
})})</span></div>` : u += `<b>${F({
v: l.value / w.value * 100,
s: "%",
r: e.value.style.chart.tooltip.roundingPercentage
})}</b></div>`), X.value = u;
}
W.value = !0;
}
const O = f(() => {
const t = h.value.map((l) => ({
name: l.name,
color: l.color
})), o = h.value.map((l) => l.value);
return { head: t, body: o };
}), G = f(() => {
const t = [
' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',
F({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: w.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
"100%"
], o = O.value.head.map((u, v) => [
{
color: u.color,
name: u.name
},
F({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: O.value.body[v], s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
isNaN(O.value.body[v] / w.value) ? "-" : (O.value.body[v] / w.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
]), l = {
th: {
backgroundColor: e.value.table.th.backgroundColor,
color: e.value.table.th.color,
outline: e.value.table.th.outline
},
td: {
backgroundColor: e.value.table.td.backgroundColor,
color: e.value.table.td.color,
outline: e.value.table.td.outline
},
breakpoint: e.value.table.responsiveBreakpoint
}, a = [
e.value.table.columnNames.series,
e.value.table.columnNames.value,
e.value.table.columnNames.percentage
];
return {
head: t,
body: o,
config: l,
colNames: a
};
});
function Ce(t = null) {
nt(() => {
const o = O.value.head.map((u, v) => [[
u.name
], [O.value.body[v]], [isNaN(O.value.body[v] / w.value) ? "-" : O.value.body[v] / w.value * 100]]), l = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(o), a = yt(l);
t ? t(a) : mt({ csvContent: a, title: e.value.style.chart.title.text || "vue-ui-rings" });
});
}
const V = i(!1);
function $e(t) {
V.value = t, le.value += 1;
}
function Te() {
k.value.showTable = !k.value.showTable;
}
function xe() {
k.value.showTooltip = !k.value.showTooltip;
}
const H = i(!1);
function K() {
H.value = !H.value;
}
async function Qe({ scale: t = 2 } = {}) {
if (!x.value) return;
const { width: o, height: l } = x.value.getBoundingClientRect(), a = o / l, { imageUri: u, base64: v } = await Pt({ domElement: x.value, base64: !0, img: !0, scale: t });
return {
imageUri: u,
base64: v,
title: e.value.style.chart.title.text,
width: o,
height: l,
aspectRatio: a
};
}
return Fe({
getData: Je,
getImage: Qe,
generatePdf: ye,
generateCsv: Ce,
generateImage: me,
toggleTable: Te,
toggleTooltip: xe,
toggleAnnotator: K,
toggleFullscreen: $e
}), (t, o) => (r(), p("div", {
ref_key: "ringsChart",
ref: x,
class: U(`vue-ui-rings ${V.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
style: S(`font-family:${e.value.style.fontFamily};text-align:center;width:100%;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height: 100%" : ""}`),
id: `rings_${C.value}`,
onMouseleave: o[3] || (o[3] = (l) => {
$.value = null, W.value = !1, s(ve)(!1);
}),
onMouseenter: o[4] || (o[4] = () => s(ve)(!0))
}, [
e.value.userOptions.buttons.annotator ? (r(), N(s(ze), {
key: 0,
svgRef: s(de),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: H.value,
onClose: K
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : m("", !0),
He.value ? (r(), p("div", {
key: 1,
ref_key: "noTitle",
ref: ne,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : m("", !0),
e.value.style.chart.title.text ? (r(), p("div", {
key: 2,
ref_key: "chartTitle",
ref: oe,
style: "width:100%;background:transparent"
}, [
(r(), N(Ot, {
key: `title_${ue.value}`,
config: {
title: {
cy: "rings-div-title",
...e.value.style.chart.title
},
subtitle: {
cy: "rings-div-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 512)) : m("", !0),
e.value.userOptions.show && E.value && (s(ce) || s(q)) ? (r(), N(s(Ee), {
ref_key: "details",
ref: Ge,
key: `user_options_${le.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: s(ge),
isImaging: s(fe),
uid: C.value,
hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
hasPdf: e.value.userOptions.buttons.pdf,
hasXls: e.value.userOptions.buttons.csv,
hasImg: e.value.userOptions.buttons.img,
hasTable: e.value.userOptions.buttons.table,
hasFullscreen: e.value.userOptions.buttons.fullscreen,
isTooltip: k.value.showTooltip,
isFullscreen: V.value,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: x.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: H.value,
callbacks: e.value.userOptions.callbacks,
printScale: e.value.userOptions.print.scale,
onToggleFullscreen: $e,
onGeneratePdf: s(ye),
onGenerateCsv: Ce,
onGenerateImage: s(me),
onToggleTable: Te,
onToggleTooltip: xe,
onToggleAnnotator: K,
style: S({
visibility: s(ce) ? s(q) ? "visible" : "hidden" : "visible"
})
}, Oe({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: g(({ isOpen: l, color: a }) => [
d(t.$slots, "menuIcon", R(M({ isOpen: l, color: a })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionTooltip ? {
name: "optionTooltip",
fn: g(() => [
d(t.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: g(() => [
d(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: g(() => [
d(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: g(() => [
d(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: g(() => [
d(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: g(({ toggleFullscreen: l, isFullscreen: a }) => [
d(t.$slots, "optionFullscreen", R(M({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: g(({ toggleAnnotator: l, isAnnotator: a }) => [
d(t.$slots, "optionAnnotator", R(M({ toggleAnnotator: l, isAnnotator: a })), void 0, !0)
]),
key: "7"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : m("", !0),
E.value ? (r(), p("svg", {
key: 4,
ref_key: "svgRef",
ref: de,
xmlns: s(pt),
class: U({ "vue-data-ui-fullscreen--on": V.value, "vue-data-ui-fulscreen--off": !V.value }),
viewBox: `0 0 ${n.value.width <= 0 ? 10 : n.value.width} ${n.value.height <= 0 ? 10 : n.value.height}`,
style: S(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
}, [
Q(s(Me)),
t.$slots["chart-background"] ? (r(), p("foreignObject", {
key: 0,
x: 0,
y: 0,
width: n.value.width <= 0 ? 10 : n.value.width,
height: n.value.height <= 0 ? 10 : n.value.height,
style: {
pointerEvents: "none"
}
}, [
d(t.$slots, "chart-background", {}, void 0, !0)
], 8, Ft)) : m("", !0),
T("defs", null, [
(r(!0), p(Z, null, ee(h.value, (l, a) => (r(), p("radialGradient", {
cx: "50%",
cy: "30%",
r: "50%",
fx: "50%",
fy: "50%",
id: `gradient_${C.value}_${a}`
}, [
T("stop", {
offset: "0%",
"stop-color": s(gt)(s(ft)(l.color, 0.05), 100 - e.value.style.chart.layout.rings.gradient.intensity)
}, null, 8, Vt),
T("stop", {
offset: "100%",
"stop-color": l.color
}, null, 8, Rt)
], 8, Lt))), 256))
]),
t.$slots.pattern ? (r(), p("g", Mt, [
(r(!0), p(Z, null, ee(h.value, (l) => (r(), p("defs", null, [
d(t.$slots, "pattern", at({ ref_for: !0 }, { seriesIndex: l.absoluteIndex, patternId: `pattern_${C.value}_${l.absoluteIndex}` }), void 0, !0)
]))), 256))
])) : m("", !0),
(r(!0), p(Z, null, ee(h.value, (l, a) => (r(), p("g", null, [
T("circle", {
class: U({
"vue-ui-rings-item": I.value && e.value.useCssAnimation,
"vue-rings-item-onload": !I.value && e.value.useCssAnimation,
"vue-ui-rings-opacity": $.value !== null && $.value !== a
}),
style: S(`animation-delay:${a * 100}ms`),
stroke: e.value.style.chart.layout.rings.stroke,
cx: n.value.width / 2,
cy: a === 0 ? n.value.height / 2 : n.value.height / 2 + c.value * h.value[0].proportion / 2 - c.value * l.proportion / 2 - 2 * (a + 1),
r: s(j)(c.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : c.value * l.proportion / 2 * 0.9),
fill: e.value.style.chart.layout.rings.gradient.underlayerColor
}, null, 14, zt),
T("circle", {
class: U({
"vue-ui-rings-item": I.value && e.value.useCssAnimation,
"vue-rings-item-onload": !I.value && e.value.useCssAnimation,
"vue-ui-rings-shadow": e.value.style.chart.layout.rings.useShadow,
"vue-ui-rings-blur": $.value !== null && $.value !== a
}),
style: S(`animation-delay:${a * 100}ms`),
stroke: e.value.style.chart.layout.rings.stroke,
"stroke-width": l.strokeWidth < 0.5 ? 0.5 : l.strokeWidth,
cx: n.value.width / 2,
cy: a === 0 ? n.value.height / 2 : n.value.height / 2 + c.value * h.value[0].proportion / 2 - c.value * l.proportion / 2 - 2 * (a + 1),
r: s(j)(c.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : c.value * l.proportion / 2 * 0.9),
fill: e.value.style.chart.layout.rings.gradient.show ? `url(#gradient_${C.value}_${a})` : l.color
}, null, 14, Ut),
t.$slots.pattern ? (r(), p("circle", {
key: 0,
class: U({
"vue-ui-rings-item": I.value && e.value.useCssAnimation,
"vue-rings-item-onload": !I.value && e.value.useCssAnimation,
"vue-ui-rings-shadow": e.value.style.chart.layout.rings.useShadow,
"vue-ui-rings-blur": $.value !== null && $.value !== a
}),
style: S(`animation-delay:${a * 100}ms`),
stroke: e.value.style.chart.layout.rings.stroke,
"stroke-width": l.strokeWidth < 0.5 ? 0.5 : l.strokeWidth,
cx: n.value.width / 2,
cy: a === 0 ? n.value.height / 2 : n.value.height / 2 + c.value * h.value[0].proportion / 2 - c.value * l.proportion / 2 - 2 * (a + 1),
r: s(j)(c.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : c.value * l.proportion / 2 * 0.9),
fill: `url(#pattern_${C.value}_${l.absoluteIndex})`
}, null, 14, Bt)) : m("", !0),
T("circle", {
stroke: "none",
cx: n.value.width / 2,
cy: a === 0 ? n.value.height / 2 : n.value.height / 2 + c.value * h.value[0].proportion / 2 - c.value * l.proportion / 2 - 2 * (a + 1),
r: s(j)(c.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : c.value * l.proportion / 2 * 0.9),
fill: "transparent",
onMouseenter: (u) => Ke(a, l),
onMouseleave: o[0] || (o[0] = (u) => {
$.value = null, W.value = !1;
})
}, null, 40, Et)
]))), 256)),
d(t.$slots, "svg", { svg: n.value }, void 0, !0)
], 14, At)) : m("", !0),
t.$slots.watermark ? (r(), p("div", Wt, [
d(t.$slots, "watermark", R(M({ isPrinting: s(ge) || s(fe) })), void 0, !0)
])) : m("", !0),
E.value ? m("", !0) : (r(), N(s(Ue), {
key: 6,
config: {
type: "rings",
style: {
backgroundColor: e.value.style.chart.backgroundColor,
rings: {
color: "#CCCCCC"
}
}
}
}, null, 8, ["config"])),
T("div", {
ref_key: "chartLegend",
ref: ae
}, [
e.value.style.chart.legend.show ? (r(), N(_t, {
key: `legend_${ie.value}`,
legendSet: we.value,
config: Ye.value,
onClickMarker: o[1] || (o[1] = ({ legend: l }) => Y(l.uid))
}, Oe({
item: g(({ legend: l, index: a }) => [
T("div", {
onClick: (u) => Y(l.uid),
style: S(`opacity:${y.value.includes(l.uid) ? 0.5 : 1}`)
}, B(l.name) + B(e.value.style.chart.legend.showPercentage || e.value.style.chart.legend.showValue ? ":" : "") + " " + B(e.value.style.chart.legend.showValue ? s(Se)(
e.value.style.chart.layout.labels.dataLabels.formatter,
l.value,
s(F)({
p: e.value.style.chart.layout.labels.dataLabels.prefix,
v: l.value,
s: e.value.style.chart.layout.labels.dataLabels.suffix,
r: e.value.style.chart.legend.roundingValue
}),
{ datapoint: l, seriesIndex: a }
) : "") + " " + B(e.value.style.chart.legend.showPercentage ? y.value.includes(l.uid) ? `${e.value.style.chart.legend.showValue ? "(" : ""}- %${e.value.style.chart.legend.showValue ? ")" : ""}` : `${e.value.style.chart.legend.showValue ? "(" : ""}${isNaN(l.value / w.value) ? "-" : s(F)({
v: l.value / w.value * 100,
s: "%",
r: e.value.style.chart.legend.roundingPercentage
})}${e.value.style.chart.legend.showValue ? ")" : ""}` : ""), 13, Dt)
]),
_: 2
}, [
t.$slots.pattern ? {
name: "legend-pattern",
fn: g(({ legend: l, index: a }) => [
Q(It, {
shape: l.shape,
radius: 30,
stroke: "none",
plot: { x: 30, y: 30 },
fill: `url(#pattern_${C.value}_${a})`
}, null, 8, ["shape", "fill"])
]),
key: "0"
} : void 0
]), 1032, ["legendSet", "config"])) : d(t.$slots, "legend", {
key: 1,
legend: we.value
}, void 0, !0)
], 512),
t.$slots.source ? (r(), p("div", {
key: 7,
ref_key: "source",
ref: se,
dir: "auto"
}, [
d(t.$slots, "source", {}, void 0, !0)
], 512)) : m("", !0),
Q(s(Be), {
show: k.value.showTooltip && W.value && y.value.length < b.dataset.length,
backgroundColor: e.value.style.chart.tooltip.backgroundColor,
color: e.value.style.chart.tooltip.color,
borderRadius: e.value.style.chart.tooltip.borderRadius,
borderColor: e.value.style.chart.tooltip.borderColor,
borderWidth: e.value.style.chart.tooltip.borderWidth,
fontSize: e.value.style.chart.tooltip.fontSize,
backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
position: e.value.style.chart.tooltip.position,
offsetY: e.value.style.chart.tooltip.offsetY,
parent: x.value,
content: X.value,
isFullscreen: V.value,
isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
}, {
"tooltip-before": g(() => [
d(t.$slots, "tooltip-before", R(M({ ...J.value })), void 0, !0)
]),
"tooltip-after": g(() => [
d(t.$slots, "tooltip-after", R(M({ ...J.value })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
E.value ? (r(), N(s(Ve), {
key: 8,
hideDetails: "",
config: {
open: k.value.showTable,
maxHeight: 1e4,
body: {
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color
},
head: {
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color
}
}
}, {
content: g(() => [
(r(), N(s(Re), {
key: `table_${re.value}`,
colNames: G.value.colNames,
head: G.value.head,
body: G.value.body,
config: G.value.config,
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
onClose: o[2] || (o[2] = (l) => k.value.showTable = !1)
}, {
th: g(({ th: l }) => [
T("div", {
innerHTML: l,
style: { display: "flex", "align-items": "center" }
}, null, 8, Gt)
]),
td: g(({ td: l }) => [
st(B(l.name || l), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : m("", !0)
], 46, Nt));
}
}, al = /* @__PURE__ */ St(Ht, [["__scopeId", "data-v-a8630f5d"]]);
export {
al as default
};