vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
692 lines (691 loc) • 29 kB
JavaScript
import { defineAsyncComponent as $, ref as s, computed as d, toRefs as nt, onMounted as rt, watch as it, createElementBlock as i, openBlock as n, unref as o, normalizeStyle as z, normalizeClass as R, createBlock as x, createCommentVNode as c, createElementVNode as T, createVNode as _e, createSlots as ct, withCtx as g, renderSlot as h, normalizeProps as I, guardReactiveProps as L, Fragment as Se, renderList as Pe, Teleport as vt, toDisplayString as F, createTextVNode as dt, nextTick as ht } from "vue";
import { u as gt, c as Oe, t as pt, o as yt, f as Ie, g as ft, a as bt, p as W, b as mt, d as kt, G as Le, e as wt, M as Ct, i as _, X as $t, k as Ae, y as Ne, v as xt, w as Tt, z as _t } from "./index-q-LPw2IT.js";
import { t as St, u as Pt } from "./useResponsive-DfdjqQps.js";
import { u as Ot, B as It } from "./useLoading-D7YHNtLX.js";
import { u as Lt } from "./usePrinter-DX7efa1s.js";
import { u as Fe } from "./useNestedProp-04aFeUYu.js";
import { u as At } from "./useUserOptionState-BIvW1Kz7.js";
import { u as Nt } from "./useChartAccessibility-9icAAmYg.js";
import Ft from "./img-Ctts6JQb.js";
import { _ as Vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Dt = ["id"], Bt = ["id"], Mt = ["xmlns", "viewBox"], Et = ["width", "height"], zt = ["id"], Rt = ["stdDeviation"], Wt = ["d", "stroke", "stroke-width"], Gt = ["d", "stroke", "stroke-width"], Ht = ["filter"], Ut = ["d", "stroke", "stroke-width"], Xt = ["d", "stroke-width", "onMouseenter", "onMouseleave", "onClick"], Yt = {
key: 4,
class: "vue-data-ui-watermark"
}, jt = ["id"], qt = ["onClick"], Jt = ["innerHTML"], Kt = {
__name: "vue-ui-galaxy",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectLegend", "selectDatapoint"],
setup(Ve, { expose: De, emit: Be }) {
const Me = $(() => import("./Title-B55R8CAZ.js")), Ee = $(() => import("./Legend-DcDSkq99.js")), ze = $(() => import("./vue-ui-accordion-D46i_gkB.js")), Re = $(() => import("./DataTable-rj9-mAwF.js")), We = $(() => import("./Tooltip-BMOddG-M.js")), Ge = $(() => import("./PenAndPaper-BJ0hcgsa.js")), He = $(() => import("./UserOptions-DVzyjG-W.js")), Ue = $(() => import("./PackageVersion-5ZjKSIei.js")), { vue_ui_galaxy: Xe } = gt(), m = Ve, f = s(Oe()), k = s(null), Ye = s(null), G = s(!1), H = s(""), S = s(null), Q = s(0), Z = s(0), ee = s(0), te = s(0), le = s(null), ae = s(null), oe = s(null), se = s(null), A = s(null), V = s(null), ue = s(!1), ne = d(() => !!m.dataset && m.dataset.length), e = s(Y()), { loading: U, FINAL_DATASET: re } = Ot({
...nt(m),
FINAL_CONFIG: e,
prepareConfig: Y,
skeletonDataset: [
{ name: "_", values: [21], color: "#DBDBDB" },
{ name: "_", values: [13], color: "#C4C4C4" },
{ name: "_", values: [8], color: "#ADADAD" }
],
skeletonConfig: pt({
defaultConfig: e.value,
userConfig: {
userOptions: { show: !1 },
table: { show: !1 },
useCssAnimation: !1,
style: {
chart: {
backgroundColor: "#99999930",
legend: {
backgroundColor: "transparent"
}
}
}
}
})
});
rt(() => {
ue.value = !0, ce();
});
const ie = d(() => !!e.value.debug);
function ce() {
if (yt(m.dataset) ? Ie({
componentName: "VueUiGalaxy",
type: "dataset",
debug: ie.value
}) : m.dataset.forEach((t, a) => {
ft({
datasetObject: t,
requiredAttributes: ["name", "values"]
}).forEach((l) => {
Ie({
componentName: "VueUiGalaxy",
type: "datasetSerieAttribute",
property: l,
index: a,
debug: ie.value
});
});
}), e.value.responsive) {
const t = St(() => {
const { width: a, height: l } = Pt({
chart: k.value,
title: e.value.style.chart.title.text ? le.value : null,
legend: e.value.style.chart.legend.show ? ae.value : null,
noTitle: se.value,
source: oe.value
});
requestAnimationFrame(() => {
D.value = Math.max(0.1, a), B.value = Math.max(0.1, l - 12);
});
});
A.value && (V.value && A.value.unobserve(V.value), A.value.disconnect()), A.value = new ResizeObserver(t), V.value = k.value.parentNode, A.value.observe(V.value);
}
}
const { userOptionsVisible: X, setUserOptionsVisibility: ve, keepUserOptionState: de } = At({ config: e.value }), { svgRef: he } = Nt({ config: e.value.style.chart.title });
function Y() {
const t = Fe({
userConfig: m.config,
defaultConfig: Xe
});
return t.theme ? {
...Fe({
userConfig: mt.vue_ui_galaxy[t.theme] || m.config,
defaultConfig: t
}),
customPalette: bt[t.theme] || W
} : t;
}
it(() => m.config, (t) => {
e.value = Y(), X.value = !e.value.userOptions.showOnChartHover, ce(), Z.value += 1, ee.value += 1, te.value += 1, p.value.dataLabels.show = e.value.style.chart.layout.labels.dataLabels.show, p.value.showTable = e.value.table.show, p.value.showTooltip = e.value.style.chart.tooltip.show;
}, { deep: !0 });
const { isPrinting: ge, isImaging: pe, generatePdf: ye, generateImage: fe } = Lt({
elementId: `galaxy_${f.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-galaxy",
options: e.value.userOptions.print
}), je = d(() => e.value.userOptions.show && !e.value.style.chart.title.text), qe = d(() => kt(e.value.customPalette)), p = s({
dataLabels: {
show: e.value.style.chart.layout.labels.dataLabels.show
},
showTable: e.value.table.show,
showTooltip: e.value.style.chart.tooltip.show
}), D = s(250), B = s(180), Je = s(0), Ke = s(0), w = d(() => ({
width: D.value,
height: B.value,
viewBox: `${Je.value} ${Ke.value} ${D.value} ${B.value}`
})), be = Be, y = s([]);
function j(t) {
y.value.includes(t.id) ? y.value = y.value.filter((a) => a !== t.id) : y.value.push(t.id), be("selectLegend", N.value.map((a) => ({
name: a.name,
color: a.color,
value: a.value
})));
}
const P = d(() => re.value.map((t, a) => ({
name: t.name,
color: wt(t.color) || qe.value[a] || W[a] || W[a % W.length],
value: t.values ? Le(t.values).reduce((l, u) => l + u, 0) : 0,
absoluteValues: Le(t.values),
id: Oe()
})).sort((t, a) => a.value - t.value).map((t, a) => ({
...t,
absoluteIndex: a
})));
function Qe() {
return P.value.map((t) => ({
name: t.name,
color: t.color,
value: t.value
}));
}
const b = d(() => P.value.filter((t) => !y.value.includes(t.id)).map((t) => t.value).reduce((t, a) => t + a, 0)), me = s(190), ke = d(() => P.value.filter((t) => !y.value.includes(t.id))), Ze = d(
() => (e.value.style.chart.layout.arcs.strokeWidth + e.value.style.chart.layout.arcs.borderWidth) / 2 + (e.value.style.chart.layout.padding ?? 12)
), et = d(() => Ct({
maxPoints: me.value,
a: e.value.style.chart.layout.arcs.a ?? 6,
b: e.value.style.chart.layout.arcs.b ?? 6,
angleStep: e.value.style.chart.layout.arcs.angleStep ?? 0.07,
startX: w.value.width / 2 + e.value.style.chart.layout.arcs.offsetX,
startY: w.value.height / 2 + e.value.style.chart.layout.arcs.offsetY,
boxWidth: w.value.width,
boxHeight: w.value.height,
padding: Ze.value
})), N = d(() => {
const t = [];
for (let a = 0; a < ke.value.length; a += 1) {
const l = ke.value[a], u = l.value / b.value * me.value + (a > 0 && t.length ? t[a - 1].points : 0);
t.push({
points: u,
...l,
seriesIndex: a,
proportion: l.value / b.value,
path: et.value(u)
});
}
return t.filter((a) => !y.value.includes(a.id)).toSorted((a, l) => l.points - a.points);
});
function q(t) {
const a = Math.min(D.value, B.value), l = S.value === t.id && e.value.style.chart.layout.arcs.hoverEffect.show ? e.value.style.chart.layout.arcs.hoverEffect.multiplicator : 1, u = (e.value.style.chart.layout.arcs.strokeWidth + e.value.style.chart.layout.arcs.borderWidth) * l, r = e.value.style.chart.layout.arcs.strokeWidth * l, v = e.value.style.chart.layout.arcs.strokeWidth / 2 * l;
return {
border: u / 180 * a,
path: r / 180 * a,
blur: v / 180 * a
};
}
const O = s(!1);
function we(t) {
O.value = t, Q.value += 1;
}
const J = s(null);
function tt(t) {
G.value = !1, S.value = null, e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: t, seriesIndex: t.absoluteIndex });
}
function lt(t) {
be("selectDatapoint", t), e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: t, seriesIndex: t.absoluteIndex });
}
function at({ datapoint: t, _relativeIndex: a, seriesIndex: l, show: u = !1 }) {
e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: t, seriesIndex: t.absoluteIndex }), J.value = {
datapoint: t,
seriesIndex: l,
series: P.value,
config: e.value
}, G.value = u, S.value = t.id;
let r = "";
const v = e.value.style.chart.tooltip.customFormat;
Ne(v) && _t(() => v({
seriesIndex: l,
datapoint: t,
series: P.value,
config: e.value
})) ? H.value = v({
seriesIndex: l,
datapoint: t,
series: P.value,
config: e.value
}) : (r += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${t.name}</div>`, r += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.color}"/></svg>`, e.value.style.chart.tooltip.showValue && (r += `<b>${Ae(
e.value.style.chart.layout.labels.dataLabels.formatter,
t.value,
_({
p: e.value.style.chart.layout.labels.dataLabels.prefix,
v: t.value,
s: e.value.style.chart.layout.labels.dataLabels.suffix,
r: e.value.style.chart.tooltip.roundingValue
}),
{ datapoint: t, seriesIndex: l }
)}</b>`), e.value.style.chart.tooltip.showPercentage && (e.value.style.chart.tooltip.showValue ? r += `<span>(${_({
v: t.proportion * 100,
s: "%",
r: e.value.style.chart.tooltip.roundingPercentage
})})</span></div>` : r += `<b>${_({
v: t.proportion * 100,
s: "%",
r: e.value.style.chart.tooltip.roundingPercentage
})}</b></div>`), H.value = `<div>${r}</div>`);
}
const Ce = d(() => P.value.map((t, a) => ({
...t,
proportion: (t.value || 0) / re.value.map((l) => (l.values || []).reduce((u, r) => u + r, 0)).reduce((l, u) => l + u, 0),
opacity: y.value.includes(t.id) ? 0.5 : 1,
shape: t.shape || "circle",
segregate: () => j(t),
isSegregated: y.value.includes(t.id)
}))), ot = d(() => ({
cy: "galaxy-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" : ""
})), C = d(() => {
const t = N.value.map((l) => ({
name: l.name,
color: l.color
})), a = N.value.map((l) => l.value);
return { head: t, body: a };
});
function $e(t = null) {
ht(() => {
const a = C.value.head.map((r, v) => [[
r.name
], [C.value.body[v]], [isNaN(C.value.body[v] / b.value) ? "-" : C.value.body[v] / b.value * 100]]), l = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(a), u = xt(l);
t ? t(u) : Tt({ csvContent: u, title: e.value.style.chart.title.text || "vue-ui-galaxy" });
});
}
const M = d(() => {
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>',
_({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: b.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
"100%"
], a = C.value.head.map((r, v) => {
const ut = _({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: C.value.body[v], s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue });
return [
{
color: r.color,
name: r.name
},
ut,
isNaN(C.value.body[v] / b.value) ? "-" : _({
v: C.value.body[v] / b.value * 100,
s: "%",
r: 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
};
return {
colNames: [
e.value.table.columnNames.series,
e.value.table.columnNames.value,
e.value.table.columnNames.percentage
],
head: t,
body: a,
config: l
};
});
function xe() {
p.value.showTable = !p.value.showTable;
}
function Te() {
p.value.showTooltip = !p.value.showTooltip;
}
const E = s(!1);
function K() {
E.value = !E.value;
}
async function st({ scale: t = 2 } = {}) {
if (!k.value) return;
const { width: a, height: l } = k.value.getBoundingClientRect(), u = a / l, { imageUri: r, base64: v } = await Ft({ domElement: k.value, base64: !0, img: !0, scale: t });
return {
imageUri: r,
base64: v,
title: e.value.style.chart.title.text,
width: a,
height: l,
aspectRatio: u
};
}
return De({
getData: Qe,
getImage: st,
generatePdf: ye,
generateCsv: $e,
generateImage: fe,
toggleTable: xe,
toggleTooltip: Te,
toggleAnnotator: K,
toggleFullscreen: we
}), (t, a) => (n(), i("div", {
ref_key: "galaxyChart",
ref: k,
class: R(`vue-ui-galaxy ${O.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"} ${o(U) ? "loading" : ""}`),
style: z(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor}`),
id: `galaxy_${f.value}`,
onMouseenter: a[2] || (a[2] = () => o(ve)(!0)),
onMouseleave: a[3] || (a[3] = () => o(ve)(!1))
}, [
e.value.userOptions.buttons.annotator ? (n(), x(o(Ge), {
key: 0,
svgRef: o(he),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: E.value,
onClose: K
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : c("", !0),
je.value ? (n(), i("div", {
key: 1,
ref_key: "noTitle",
ref: se,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : c("", !0),
e.value.style.chart.title.text ? (n(), i("div", {
key: 2,
ref_key: "chartTitle",
ref: le,
style: "width:100%;background:transparent;padding-bottom:24px"
}, [
(n(), x(o(Me), {
key: `title_${Z.value}`,
config: {
title: {
cy: "galaxy-div-title",
...e.value.style.chart.title
},
subtitle: {
cy: "galaxy-div-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 512)) : c("", !0),
T("div", {
id: `legend-top-${f.value}`
}, null, 8, Bt),
e.value.userOptions.show && ne.value && (o(de) || o(X)) ? (n(), x(o(He), {
ref_key: "details",
ref: Ye,
key: `user_option_${Q.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: o(ge),
isImaging: o(pe),
uid: f.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: p.value.showTooltip,
isFullscreen: O.value,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: k.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: E.value,
callbacks: e.value.userOptions.callbacks,
printScale: e.value.userOptions.print.scale,
onToggleFullscreen: we,
onGeneratePdf: o(ye),
onGenerateCsv: $e,
onGenerateImage: o(fe),
onToggleTable: xe,
onToggleTooltip: Te,
onToggleAnnotator: K,
style: z({
visibility: o(de) ? o(X) ? "visible" : "hidden" : "visible"
})
}, ct({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: g(({ isOpen: l, color: u }) => [
h(t.$slots, "menuIcon", I(L({ isOpen: l, color: u })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionTooltip ? {
name: "optionTooltip",
fn: g(() => [
h(t.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: g(() => [
h(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: g(() => [
h(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: g(() => [
h(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: g(() => [
h(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: g(({ toggleFullscreen: l, isFullscreen: u }) => [
h(t.$slots, "optionFullscreen", I(L({ toggleFullscreen: l, isFullscreen: u })), void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: g(({ toggleAnnotator: l, isAnnotator: u }) => [
h(t.$slots, "optionAnnotator", I(L({ toggleAnnotator: l, isAnnotator: u })), 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"])) : c("", !0),
(n(), i("svg", {
ref_key: "svgRef",
ref: he,
xmlns: o($t),
class: R({ "vue-data-ui-fullscreen--on": O.value, "vue-data-ui-fulscreen--off": !O.value }),
viewBox: w.value.viewBox,
style: z(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
}, [
_e(o(Ue)),
t.$slots["chart-background"] ? (n(), i("foreignObject", {
key: 0,
x: 0,
y: 0,
width: w.value.width,
height: w.value.height,
style: {
pointerEvents: "none"
}
}, [
h(t.$slots, "chart-background", {}, void 0, !0)
], 8, Et)) : c("", !0),
T("defs", null, [
T("filter", {
id: `blur_${f.value}`,
x: "-50%",
y: "-50%",
width: "200%",
height: "200%"
}, [
T("feGaussianBlur", {
in: "SourceGraphic",
stdDeviation: 100 / e.value.style.chart.layout.arcs.gradient.intensity
}, null, 8, Rt)
], 8, zt)
]),
(n(!0), i(Se, null, Pe(N.value, (l) => (n(), i("g", null, [
l.value ? (n(), i("path", {
key: 0,
d: l.path,
fill: "none",
stroke: e.value.style.chart.backgroundColor,
"stroke-width": q(l).border,
"stroke-linecap": "round"
}, null, 8, Wt)) : c("", !0),
l.value ? (n(), i("path", {
key: 1,
d: l.path,
fill: "none",
stroke: l.color,
"stroke-width": q(l).path,
"stroke-linecap": "round",
class: R(`${S.value && S.value !== l.id && e.value.useBlurOnHover ? "vue-ui-galaxy-blur" : ""}`)
}, null, 10, Gt)) : c("", !0),
l.value && e.value.style.chart.layout.arcs.gradient.show ? (n(), i("g", {
key: 2,
filter: `url(#blur_${f.value})`
}, [
T("path", {
d: l.path,
fill: "none",
stroke: e.value.style.chart.layout.arcs.gradient.color,
"stroke-width": q(l).blur,
"stroke-linecap": "round",
class: R(`vue-ui-galaxy-gradient ${S.value && S.value !== l.id && e.value.useBlurOnHover ? "vue-ui-galaxy-blur" : ""}`)
}, null, 10, Ut)
], 8, Ht)) : c("", !0)
]))), 256)),
(n(!0), i(Se, null, Pe(N.value, (l, u) => (n(), i("g", null, [
l.value ? (n(), i("path", {
key: 0,
d: l.path,
fill: "none",
stroke: "transparent",
"stroke-width": e.value.style.chart.layout.arcs.strokeWidth + e.value.style.chart.layout.arcs.borderWidth,
"stroke-linecap": "round",
onMouseenter: (r) => at({
datapoint: l,
seriesIndex: l.seriesIndex,
show: !0
}),
onMouseleave: (r) => tt(l),
onClick: (r) => lt(l)
}, null, 40, Xt)) : c("", !0)
]))), 256)),
h(t.$slots, "svg", { svg: w.value }, void 0, !0)
], 14, Mt)),
t.$slots.watermark ? (n(), i("div", Yt, [
h(t.$slots, "watermark", I(L({ isPrinting: o(ge) || o(pe) })), void 0, !0)
])) : c("", !0),
T("div", {
id: `legend-bottom-${f.value}`
}, null, 8, jt),
ue.value ? (n(), x(vt, {
key: 5,
to: e.value.style.chart.legend.position === "top" ? `#legend-top-${f.value}` : `#legend-bottom-${f.value}`
}, [
T("div", {
ref_key: "chartLegend",
ref: ae
}, [
e.value.style.chart.legend.show ? (n(), x(o(Ee), {
key: `legend_${te.value}`,
legendSet: Ce.value,
config: ot.value,
onClickMarker: a[0] || (a[0] = ({ legend: l }) => j(l))
}, {
item: g(({ legend: l, index: u }) => [
o(U) ? c("", !0) : (n(), i("div", {
key: 0,
onClick: (r) => j(l),
style: z(`opacity:${y.value.includes(l.id) ? 0.5 : 1}`)
}, F(l.name) + F(e.value.style.chart.legend.showPercentage || e.value.style.chart.legend.showValue ? ":" : "") + " " + F(e.value.style.chart.legend.showValue ? o(Ae)(
e.value.style.chart.layout.labels.dataLabels.formatter,
l.value,
o(_)({
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: u }
) : "") + " " + F(e.value.style.chart.legend.showPercentage ? y.value.includes(l.id) ? `${e.value.style.chart.legend.showValue ? "(" : ""}- %${e.value.style.chart.legend.showValue ? ")" : ""}` : `${e.value.style.chart.legend.showValue ? "(" : ""}${isNaN(l.value / b.value) ? "-" : o(_)({
v: l.value / b.value * 100,
s: "%",
r: e.value.style.chart.legend.roundingPercentage
})}${e.value.style.chart.legend.showValue ? ")" : ""}` : ""), 13, qt))
]),
_: 1
}, 8, ["legendSet", "config"])) : c("", !0),
h(t.$slots, "legend", { legend: Ce.value }, void 0, !0)
], 512)
], 8, ["to"])) : c("", !0),
t.$slots.source ? (n(), i("div", {
key: 6,
ref_key: "source",
ref: oe,
dir: "auto"
}, [
h(t.$slots, "source", {}, void 0, !0)
], 512)) : c("", !0),
_e(o(We), {
show: p.value.showTooltip && G.value,
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: k.value,
content: H.value,
isFullscreen: O.value,
isCustom: o(Ne)(e.value.style.chart.tooltip.customFormat),
smooth: e.value.style.chart.tooltip.smooth,
backdropFilter: e.value.style.chart.tooltip.backdropFilter
}, {
"tooltip-before": g(() => [
h(t.$slots, "tooltip-before", I(L({ ...J.value })), void 0, !0)
]),
"tooltip-after": g(() => [
h(t.$slots, "tooltip-after", I(L({ ...J.value })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom", "smooth", "backdropFilter"]),
ne.value ? (n(), x(o(ze), {
key: 7,
hideDetails: "",
config: {
open: p.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(() => [
(n(), x(o(Re), {
key: `table_${ee.value}`,
colNames: M.value.colNames,
head: M.value.head,
body: M.value.body,
config: M.value.config,
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
onClose: a[1] || (a[1] = (l) => p.value.showTable = !1)
}, {
th: g(({ th: l }) => [
T("div", {
innerHTML: l,
style: { display: "flex", "align-items": "center" }
}, null, 8, Jt)
]),
td: g(({ td: l }) => [
dt(F(l.name || l), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : c("", !0),
o(U) ? (n(), x(It, { key: 8 })) : c("", !0)
], 46, Dt));
}
}, rl = /* @__PURE__ */ Vt(Kt, [["__scopeId", "data-v-f08fb5f3"]]);
export {
rl as default
};