vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
742 lines (741 loc) • 30.5 kB
JavaScript
import { defineAsyncComponent as _, computed as p, ref as c, watch as nt, shallowRef as Se, onMounted as ut, onBeforeUnmount as it, createElementBlock as u, openBlock as r, unref as n, normalizeStyle as q, normalizeClass as B, createBlock as x, createCommentVNode as d, createElementVNode as O, createVNode as oe, createSlots as ct, withCtx as f, renderSlot as g, normalizeProps as z, guardReactiveProps as M, Fragment as A, renderList as F, toDisplayString as D, createTextVNode as Ne, nextTick as dt } from "vue";
import { u as vt, c as pt, t as ht, p as S, a as gt, o as ft, e as V, b as yt, g as Ie, d as Re, R as Le, v as mt, i as ze, f as G, X as bt, s as le, w as kt, S as Me, q as Ct, r as wt, x as $t, y as _t } from "./index-BLtEpj8j.js";
import { t as Tt, u as Pt } from "./useResponsive-DfdjqQps.js";
import { u as Ve } from "./useNestedProp-Bw1KcAmj.js";
import { u as xt } from "./usePrinter-DnRwTdvS.js";
import { u as Ot } from "./useUserOptionState-BIvW1Kz7.js";
import { u as At } from "./useChartAccessibility-9icAAmYg.js";
import Ft from "./Legend-E7G897sw.js";
import St from "./Title-DkG60EPg.js";
import Nt from "./img-D-vWHxhM.js";
import { _ as It } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Rt = ["id"], Lt = ["xmlns", "viewBox"], zt = ["width", "height"], Mt = ["id"], Vt = ["stop-color"], Ut = ["stop-color"], Et = { key: 1 }, Bt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Dt = { key: 0 }, Gt = ["d", "stroke", "stroke-width"], Wt = ["d", "stroke", "stroke-width"], Xt = { key: 2 }, jt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], qt = ["points", "stroke", "stroke-width"], Ht = ["points", "stroke", "stroke-width", "fill"], Yt = { key: 3 }, Jt = ["cx", "cy", "fill", "r", "stroke"], Kt = {
key: 5,
class: "vue-data-ui-watermark"
}, Qt = ["onClick"], Zt = {
key: 0,
style: { "max-width": "200px", margin: "0 auto" }
}, ea = {
__name: "vue-ui-radar",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Object,
default() {
return {};
}
}
},
emits: ["selectLegend"],
setup(Ue, { expose: Ee, emit: Be }) {
const De = _(() => import("./DataTable-CS_V_Adx.js")), Ge = _(() => import("./PenAndPaper-7BWf7zgA.js")), We = _(() => import("./vue-ui-accordion-B6Svdk-2.js")), Xe = _(() => import("./vue-ui-skeleton-CsMU8DwQ.js")), je = _(() => import("./Tooltip-CuHsd1IQ.js")), qe = _(() => import("./UserOptions-DGw0HvSp.js")), He = _(() => import("./PackageVersion-CnRyWKP-.js")), Ye = _(() => import("./vue-ui-sparkbar-A_U6AgV-.js")), { vue_ui_radar: Je } = vt(), h = Ue, U = p(() => !!h.dataset && Object.keys(h.dataset).length), T = c(pt()), Ke = c(null), H = c(!1), Y = c(""), re = c(0), C = c(null), se = c(null), ne = c(null), ue = c(null), ie = c(null), ce = c(0), de = c(0), ve = c(0), e = p({
get: () => fe(),
set: (t) => t
}), { userOptionsVisible: J, setUserOptionsVisibility: pe, keepUserOptionState: he } = Ot({ config: e.value }), { svgRef: ge } = At({ config: e.value.style.chart.title });
function fe() {
const t = Ve({
userConfig: h.config,
defaultConfig: Je
});
return t.theme ? {
...Ve({
userConfig: gt.vue_ui_radar[t.theme] || h.config,
defaultConfig: t
}),
customPalette: ht[t.theme] || S
} : t;
}
nt(() => h.config, (t) => {
e.value = fe(), J.value = !e.value.userOptions.showOnChartHover, ye(), ce.value += 1, de.value += 1, ve.value += 1, b.value.dataLabels.show = e.value.style.chart.layout.labels.dataLabels.show, b.value.showTable = e.value.table.show, b.value.showTooltip = e.value.style.chart.tootlip ? e.value.style.chart.tootlip.show : !1;
}, { deep: !0 });
const w = Se(null), N = Se(null);
function ye() {
if (ft(h.dataset) && V({
componentName: "VueUiRadar",
type: "dataset"
}), e.value.responsive) {
const t = Tt(() => {
const { width: a, height: o } = Pt({
chart: C.value,
title: e.value.style.chart.title.text ? se.value : null,
legend: e.value.style.chart.legend.show ? ne.value : null,
source: ue.value,
noTitle: ie.value
});
requestAnimationFrame(() => {
i.value.width = a, i.value.height = o;
});
});
w.value && (N.value && w.value.unobserve(N.value), w.value.disconnect()), w.value = new ResizeObserver(t), N.value = C.value.parentNode, w.value.observe(N.value);
}
}
ut(() => {
ye();
}), it(() => {
w.value && (N.value && w.value.unobserve(N.value), w.value.disconnect());
});
const { isPrinting: me, isImaging: be, generatePdf: ke, generateImage: Ce } = xt({
elementId: `vue-ui-radar_${T.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-radar",
options: e.value.userOptions.print
}), Qe = p(() => e.value.userOptions.show && !e.value.style.chart.title.text), we = p(() => yt(e.value.customPalette)), b = c({
dataLabels: {
show: e.value.style.chart.layout.labels.dataLabels.show
},
showTable: e.value.table.show,
showTooltip: e.value.style.chart.tooltip.show
}), Ze = p(() => ({
style: {
backgroundColor: "#FFFFFF00",
animation: {
show: e.value.style.chart.tooltip.animation.show,
animationFrames: e.value.style.chart.tooltip.animation.animationFrames
},
labels: {
fontSize: e.value.style.chart.tooltip.fontSize,
name: {
color: e.value.style.chart.tooltip.color
}
},
gutter: {
backgroundColor: "#CCCCCC",
opacity: 30
}
}
})), i = c({
height: 312,
width: 512
}), et = Be, v = c([]), E = c(null), I = c(!1);
function $e(t) {
I.value = !0, v.value.includes(t) ? (E.value = t, v.value = v.value.filter((a) => a !== t), setTimeout(() => {
I.value = !1, E.value = null;
}, 500)) : (v.value.push(t), setTimeout(() => {
I.value = !1;
}, 500)), et("selectLegend", R.value.filter((a, o) => !v.value.includes(o)).map((a) => ({
name: a.name,
color: a.color,
proportion: a.totalProportion
})));
}
function tt() {
return R.value.map((t) => ({
name: t.name,
color: t.color,
proportion: t.totalProportion
}));
}
const y = p(() => [null, void 0].includes(h.dataset.categories) ? (V({
componentName: "VueUiRadar",
type: "datasetAttribute",
property: "categories ({ name: string; prefix?: string; suffix?: string}[])"
}), []) : (h.dataset.categories.length === 0 ? V({
componentName: "VueUiRadar",
type: "datasetAttributeEmpty",
property: "categories"
}) : h.dataset.categories.forEach((t, a) => {
Ie({
datasetObject: t,
requiredAttributes: ["name"]
}).forEach((o) => {
V({
componentName: "VueUiRadar",
type: "datasetAttribute",
property: `category.${o} at index ${a}`,
index: a
});
});
}), [null, void 0].includes(h.dataset.series) ? V({
componentName: "VueUiRadar",
type: "datasetAttribute",
property: "series ({ name: string; values: number[]; color?: string; target: number}[])"
}) : h.dataset.series.forEach((t, a) => {
Ie({
datasetObject: t,
requiredAttributes: ["name", "values", "target"]
}).forEach((o) => {
V({
componentName: "VueUiRadar",
type: "datasetSerieAttribute",
key: "series",
property: o,
index: a
});
});
}), h.dataset.categories.map((t, a) => ({
name: t.name,
categoryId: `radar_category_${T.value}_${a}`,
color: Re(t.color) || we.value[a] || S[a] || S[a % S.length],
prefix: t.prefix ?? "",
suffix: t.suffix ?? ""
})))), k = p(() => U.value ? h.dataset.series.map((t, a) => ({
...t,
color: Re(t.color) || we.value[a] || S[a] || S[a % S.length],
serieId: `radar_serie_${T.value}_${a}`,
formatter: t.formatter || null
})) : []), _e = p(() => Math.max(...k.value.flatMap((t) => t.values))), Te = p(() => k.value.length), K = p(() => Math.min(i.value.width, i.value.height) / 3), Pe = p(() => Le({
plot: { x: i.value.width / 2, y: i.value.height / 2 },
radius: K.value,
sides: Te.value,
rotation: 0
})), at = p(() => {
const t = [];
for (let a = 0; a < K.value; a += K.value / e.value.style.chart.layout.grid.graduations)
t.push(a);
return t;
}), $ = p(() => Pe.value.coordinates.map((t, a) => {
const o = k.value[a].values.map((l) => ot({
centerX: i.value.width / 2,
centerY: i.value.height / 2,
apexX: t.x,
apexY: t.y,
proportion: l / (k.value[a].target || _e.value)
}));
return {
...t,
...k.value[a],
plots: o
};
}));
function Q({ x: t, y: a }) {
let o = "middle";
return t = Math.round(t), a = Math.round(a), t > i.value.width / 2 && (t += 12, o = "start"), t < i.value.width / 2 && (t -= 12, o = "end"), a > i.value.height / 2 && (a += 20), a < i.value.height / 2 && (a -= 12), a === i.value.height / 2 && (a += 4), { x: t, y: a, anchor: o };
}
function ot({ centerX: t, centerY: a, apexX: o, apexY: l, proportion: s }) {
return {
x: t + (o - t) * s,
y: a + (l - a) * s
};
}
const R = p(() => {
const t = k.value.map((a, o) => a.values.map((l) => l / (a.target || _e.value)));
return y.value.map((a, o) => ({
...a,
totalProportion: mt(t.map((l) => l[o]).reduce((l, s) => l + s, 0) / k.value.length),
shape: "circle",
opacity: v.value.includes(o) ? 0.5 : 1,
segregate: () => $e(o),
isSegregated: v.value.includes(o)
}));
}), lt = p(() => ({
cy: "radar-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 = p(() => {
const t = [
{ name: e.value.translations.datapoint, color: "" },
{ name: e.value.translations.target, color: "" },
...R.value
], a = h.dataset.series.map((l) => [
l.name,
ze(
l.formatter,
l.target,
G({
p: l.prefix,
v: l.target,
s: l.suffix,
r: e.value.table.td.roundingValue
})
),
...l.values.map((s, m) => `${ze(
l.formatter,
s,
G({ p: y.value[m].prefix, v: s, s: y.value[m].suffix, r: e.value.table.td.roundingValue })
)} (${isNaN(s / l.target) ? "" : G({
v: s / l.target * 100,
s: "%",
r: e.value.table.td.roundingPercentage
})})`)
]), o = {
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 { head: t, body: a, config: o, colNames: t };
}), X = c(null), Z = c([]), ee = c(null);
function rt(t, a) {
Z.value = [], X.value = a, H.value = !0;
let o = "";
ee.value = {
datapoint: t,
seriesIndex: a,
series: {
categories: y.value,
datapoints: k.value,
radar: $.value
},
config: e.value
};
const l = e.value.style.chart.tooltip.customFormat;
if ($t(l) && _t(() => l({
seriesIndex: a,
datapoint: t,
series: { categories: y.value, datapoints: k.value, radar: $.value },
config: e.value
})))
Y.value = l({
seriesIndex: a,
datapoint: t,
series: { categories: y.value, datapoints: k.value, radar: $.value },
config: e.value
});
else {
o += `<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>`;
for (let s = 0; s < t.values.length; s += 1)
v.value.includes(s) || Z.value.push({
name: y.value[s].name,
value: t.values[s] / t.target * 100,
color: y.value[s].color,
suffix: "%)",
prefix: `${G({ p: y.value[s].prefix ?? "", v: t.values[s], s: y.value[s].suffix ?? "", r: e.value.style.chart.tooltip.roundingValue })} (`,
rounding: e.value.style.chart.tooltip.roundingPercentage,
formatter: t.formatter
});
Y.value = o;
}
}
function xe(t = null) {
dt(() => {
const a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], o = [[""], [e.value.translations.target], ...R.value.flatMap((P) => [[P.name], ["%"]])], l = h.dataset.series.map((P, ta) => [P.name, P.target, ...P.values.flatMap((ae) => [
ae,
isNaN(ae / P.target) ? "" : ae / P.target * 100
])]), s = a.concat([o]).concat(l), m = Ct(s);
t ? t(m) : wt({ csvContent: m, title: e.value.style.chart.title.text || "vue-ui-radar" });
});
}
const L = c(!1);
function Oe(t) {
L.value = t, re.value += 1;
}
function Ae() {
b.value.showTable = !b.value.showTable;
}
function Fe() {
b.value.showTooltip = !b.value.showTooltip;
}
const j = c(!1);
function te() {
j.value = !j.value;
}
async function st({ scale: t = 2 } = {}) {
if (!C.value) return;
const { width: a, height: o } = C.value.getBoundingClientRect(), l = a / o, { imageUri: s, base64: m } = await Nt({ domElement: C.value, base64: !0, img: !0, scale: t });
return {
imageUri: s,
base64: m,
title: e.value.style.chart.title.text,
width: a,
height: o,
aspectRatio: l
};
}
return Ee({
getData: tt,
getImage: st,
generatePdf: ke,
generateCsv: xe,
generateImage: Ce,
toggleTable: Ae,
toggleTooltip: Fe,
toggleAnnotator: te,
toggleFullscreen: Oe
}), (t, a) => (r(), u("div", {
class: B(`vue-ui-radar ${L.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
ref_key: "radarChart",
ref: C,
id: `vue-ui-radar_${T.value}`,
style: q(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height: 100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`),
onMouseenter: a[3] || (a[3] = () => n(pe)(!0)),
onMouseleave: a[4] || (a[4] = () => n(pe)(!1))
}, [
e.value.userOptions.buttons.annotator ? (r(), x(n(Ge), {
key: 0,
svgRef: n(ge),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: j.value,
onClose: te
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : d("", !0),
Qe.value ? (r(), u("div", {
key: 1,
ref_key: "noTitle",
ref: ie,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : d("", !0),
e.value.style.chart.title.text ? (r(), u("div", {
key: 2,
ref_key: "chartTitle",
ref: se,
style: "width:100%;background:transparent;padding-bottom:12px"
}, [
(r(), x(St, {
key: `title_${ce.value}`,
config: {
title: {
cy: "radar-div-title",
...e.value.style.chart.title
},
subtitle: {
cy: "radar-div-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 512)) : d("", !0),
e.value.userOptions.show && U.value && (n(he) || n(J)) ? (r(), x(n(qe), {
ref_key: "details",
ref: Ke,
key: `user_options_${re.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isImaging: n(be),
isPrinting: n(me),
uid: T.value,
hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
hasPdf: e.value.userOptions.buttons.pdf,
hasImg: e.value.userOptions.buttons.img,
hasXls: e.value.userOptions.buttons.csv,
hasTable: e.value.userOptions.buttons.table,
hasFullscreen: e.value.userOptions.buttons.fullscreen,
isFullscreen: L.value,
isTooltip: b.value.showTooltip,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: C.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: j.value,
callbacks: e.value.userOptions.callbacks,
printScale: e.value.userOptions.print.scale,
onToggleFullscreen: Oe,
onGeneratePdf: n(ke),
onGenerateCsv: xe,
onGenerateImage: n(Ce),
onToggleTable: Ae,
onToggleTooltip: Fe,
onToggleAnnotator: te,
style: q({
visibility: n(he) ? n(J) ? "visible" : "hidden" : "visible"
})
}, ct({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: f(({ isOpen: o, color: l }) => [
g(t.$slots, "menuIcon", z(M({ isOpen: o, color: l })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionTooltip ? {
name: "optionTooltip",
fn: f(() => [
g(t.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: f(() => [
g(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: f(() => [
g(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: f(() => [
g(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: f(() => [
g(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: f(({ toggleFullscreen: o, isFullscreen: l }) => [
g(t.$slots, "optionFullscreen", z(M({ toggleFullscreen: o, isFullscreen: l })), void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: f(({ toggleAnnotator: o, isAnnotator: l }) => [
g(t.$slots, "optionAnnotator", z(M({ toggleAnnotator: o, isAnnotator: l })), void 0, !0)
]),
key: "7"
} : void 0
]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : d("", !0),
U.value ? (r(), u("svg", {
key: 4,
ref_key: "svgRef",
ref: ge,
xmlns: n(bt),
class: B({ "vue-data-ui-fullscreen--on": L.value, "vue-data-ui-fulscreen--off": !L.value }),
viewBox: `0 0 ${i.value.width <= 0 ? 10 : i.value.width} ${i.value.height <= 0 ? 10 : i.value.height}`,
style: q(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
}, [
oe(n(He)),
t.$slots["chart-background"] ? (r(), u("foreignObject", {
key: 0,
x: 0,
y: 0,
width: i.value.width <= 0 ? 10 : i.value.width,
height: i.value.height <= 0 ? 10 : i.value.height,
style: {
pointerEvents: "none"
}
}, [
g(t.$slots, "chart-background", {}, void 0, !0)
], 8, zt)) : d("", !0),
O("defs", null, [
(r(!0), u(A, null, F(y.value, (o, l) => (r(), u("radialGradient", {
cx: "50%",
cy: "50%",
r: "50%",
fx: "50%",
fy: "50%",
id: `radar_gradient_${T.value}_${l}`
}, [
O("stop", {
offset: "0%",
"stop-color": n(le)(n(kt)(o.color, 0.05), e.value.style.chart.layout.dataPolygon.opacity)
}, null, 8, Vt),
O("stop", {
offset: "100%",
"stop-color": n(le)(o.color, e.value.style.chart.layout.dataPolygon.opacity)
}, null, 8, Ut)
], 8, Mt))), 256))
]),
e.value.style.chart.layout.grid.show ? (r(), u("g", Et, [
(r(!0), u(A, null, F($.value, (o) => (r(), u("line", {
x1: i.value.width / 2,
y1: i.value.height / 2,
x2: o.x,
y2: o.y,
stroke: e.value.style.chart.layout.grid.stroke,
"stroke-width": e.value.style.chart.layout.grid.strokeWidth
}, null, 8, Bt))), 256)),
e.value.style.chart.layout.grid.graduations > 0 ? (r(), u("g", Dt, [
(r(!0), u(A, null, F(at.value, (o) => (r(), u("path", {
d: n(Le)({
plot: { x: i.value.width / 2, y: i.value.height / 2 },
radius: o,
sides: Te.value,
rotation: 0
}).path,
fill: "none",
stroke: e.value.style.chart.layout.grid.stroke,
"stroke-width": e.value.style.chart.layout.grid.strokeWidth
}, null, 8, Gt))), 256))
])) : d("", !0)
])) : d("", !0),
O("path", {
d: Pe.value.path,
fill: "none",
stroke: e.value.style.chart.layout.outerPolygon.stroke,
"stroke-width": e.value.style.chart.layout.outerPolygon.strokeWidth,
"stroke-linejoin": "round",
"stroke-linecap": "round"
}, null, 8, Wt),
e.value.style.chart.layout.labels.dataLabels.show ? (r(), u("g", Xt, [
(r(!0), u(A, null, F($.value, (o, l) => (r(), u("text", {
x: Q(o).x,
y: Q(o).y,
"text-anchor": Q(o).anchor,
"font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
fill: e.value.style.chart.layout.labels.dataLabels.color,
onMouseenter: (s) => rt(o, l),
onMouseleave: a[0] || (a[0] = (s) => {
H.value = !1, X.value = null;
})
}, D(o.name), 41, jt))), 256))
])) : d("", !0),
(r(!0), u(A, null, F(y.value, (o, l) => (r(), u("g", null, [
O("g", null, [
e.value.useCssAnimation || !e.value.useCssAnimation && !v.value.includes(l) ? (r(), u("polygon", {
key: 0,
points: n(Me)($.value.map((s) => s.plots[l]), !1, !0),
stroke: e.value.style.chart.backgroundColor,
"stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth + 1,
fill: "none",
class: B({ "animated-out": v.value.includes(l) && e.value.useCssAnimation, "animated-in": I.value && E.value === l && e.value.useCssAnimation })
}, null, 10, qt)) : d("", !0),
e.value.useCssAnimation || !e.value.useCssAnimation && !v.value.includes(l) ? (r(), u("polygon", {
key: 1,
points: n(Me)($.value.map((s) => s.plots[l]), !1, !0),
stroke: o.color,
"stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth,
fill: e.value.style.chart.layout.dataPolygon.transparent ? "transparent" : e.value.style.chart.layout.dataPolygon.useGradient ? `url(#radar_gradient_${T.value}_${l})` : n(le)(o.color, e.value.style.chart.layout.dataPolygon.opacity),
class: B({ "animated-out": v.value.includes(l) && e.value.useCssAnimation, "animated-in": I.value && E.value === l && e.value.useCssAnimation })
}, null, 10, Ht)) : d("", !0)
])
]))), 256)),
e.value.style.chart.layout.plots.show ? (r(), u("g", Yt, [
(r(!0), u(A, null, F($.value, (o, l) => (r(), u("g", null, [
(r(!0), u(A, null, F(o.plots, (s, m) => (r(), u("circle", {
cx: s.x,
cy: s.y,
fill: v.value.includes(m) ? "transparent" : y.value[m].color,
r: X.value !== null && X.value === l ? e.value.style.chart.layout.plots.radius * 1.6 : e.value.style.chart.layout.plots.radius,
stroke: v.value.includes(m) ? "transparent" : e.value.style.chart.backgroundColor,
"stroke-width": 0.5,
class: B({ "animated-out": v.value.includes(m) && e.value.useCssAnimation, "animated-in": I.value && E.value === m && e.value.useCssAnimation })
}, null, 10, Jt))), 256))
]))), 256))
])) : d("", !0),
g(t.$slots, "svg", { svg: i.value }, void 0, !0)
], 14, Lt)) : d("", !0),
t.$slots.watermark ? (r(), u("div", Kt, [
g(t.$slots, "watermark", z(M({ isPrinting: n(me) || n(be) })), void 0, !0)
])) : d("", !0),
U.value ? d("", !0) : (r(), x(n(Xe), {
key: 6,
config: {
type: "radar",
style: {
backgroundColor: e.value.style.chart.backgroundColor,
radar: {
grid: {
color: e.value.style.chart.layout.outerPolygon.stroke
},
shapes: {
color: e.value.style.chart.layout.outerPolygon.stroke
}
}
}
}
}, null, 8, ["config"])),
O("div", {
ref_key: "chartLegend",
ref: ne
}, [
e.value.style.chart.legend.show ? (r(), x(Ft, {
key: `legend_${ve.value}`,
legendSet: R.value,
config: lt.value,
onClickMarker: a[1] || (a[1] = ({ i: o }) => $e(o))
}, {
item: f(({ legend: o, index: l }) => [
O("div", {
onClick: (s) => o.segregate(),
style: q(`opacity:${v.value.includes(l) ? 0.5 : 1}`)
}, D(o.name) + ": " + D(n(G)({
v: o.totalProportion * 100,
s: "%",
r: e.value.style.chart.legend.roundingPercentage
})), 13, Qt)
]),
_: 1
}, 8, ["legendSet", "config"])) : g(t.$slots, "legend", {
key: 1,
legend: R.value
}, void 0, !0)
], 512),
t.$slots.source ? (r(), u("div", {
key: 7,
ref_key: "source",
ref: ue,
dir: "auto"
}, [
g(t.$slots, "source", {}, void 0, !0)
], 512)) : d("", !0),
oe(n(je), {
show: b.value.showTooltip && H.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,
backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
fontSize: e.value.style.chart.tooltip.fontSize,
position: e.value.style.chart.tooltip.position,
offsetY: e.value.style.chart.tooltip.offsetY,
parent: C.value,
content: Y.value,
isFullscreen: L.value,
isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
}, {
"tooltip-before": f(() => [
g(t.$slots, "tooltip-before", z(M({ ...ee.value })), void 0, !0)
]),
"tooltip-after": f(() => [
["function"].includes(typeof e.value.style.chart.tooltip.customFormat) ? d("", !0) : (r(), u("div", Zt, [
oe(n(Ye), {
dataset: Z.value,
config: Ze.value,
backgroundOpacity: 0
}, null, 8, ["dataset", "config"])
])),
g(t.$slots, "tooltip-after", z(M({ ...ee.value })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "fontSize", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
U.value ? (r(), x(n(We), {
key: 8,
hideDetails: "",
config: {
open: b.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: f(() => [
(r(), x(n(De), {
key: `table_${de.value}`,
colNames: W.value.colNames,
head: W.value.head,
body: W.value.body,
config: W.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[2] || (a[2] = (o) => b.value.showTable = !1)
}, {
th: f(({ th: o }) => [
Ne(D(o.name), 1)
]),
td: f(({ td: o }) => [
Ne(D(o), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : d("", !0)
], 46, Rt));
}
}, pa = /* @__PURE__ */ It(ea, [["__scopeId", "data-v-699cbae7"]]);
export {
pa as default
};