vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
931 lines (930 loc) • 39.5 kB
JavaScript
import { defineAsyncComponent as T, ref as i, computed as v, toRefs as gt, onMounted as ht, watch as Ae, createElementBlock as h, openBlock as s, unref as a, normalizeStyle as j, normalizeClass as we, createBlock as k, createCommentVNode as y, createElementVNode as n, withCtx as c, renderSlot as d, normalizeProps as C, guardReactiveProps as A, createVNode as G, createSlots as Fe, Fragment as xe, renderList as $e, toDisplayString as V, Teleport as ft, resolveDynamicComponent as pt, mergeProps as bt, createTextVNode as Pe, nextTick as De } from "vue";
import { c as kt, t as mt, o as Ct, g as _e, e as At, a as Te, d as H, X as wt, s as $, h as Ft, af as xt, v as $t, r as Pt } from "./lib-BwysEpWI.js";
import { t as Dt, u as _t } from "./useResponsive-DfdjqQps.js";
import { u as Tt, a as oe } from "./useNestedProp-OFRiX4kU.js";
import { u as Mt, B as Bt } from "./BaseScanner-BMpwQAfz.js";
import { u as Ot } from "./usePrinter-BJzHDpYF.js";
import { u as Et } from "./useSvgExport-ByUukOZt.js";
import { u as Nt } from "./useThemeCheck-DGJ31Vi5.js";
import { u as Lt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as St } from "./useChartAccessibility-9icAAmYg.js";
import It from "./img-DKigoPDs.js";
import Rt from "./Title-DGnfNZuO.js";
import jt from "./Legend-D6z73edh.js";
import { _ as Vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Me = { style: { chart: { backgroundColor: "#1A1A1A", color: "#CCCCCC", layout: { grid: { stroke: "#4A4A4A" }, outerPolygon: { stroke: "#5A5A5A" }, dataLabel: { color: "#CCCCCC" } }, legend: { backgroundColor: "#1A1A1A", color: "#CCCCCC" }, title: { color: "#CCCCCC", subtitle: { color: "#757575" } } } }, table: { th: { backgroundColor: "#1A1A1A", color: "#CCCCCC" }, td: { backgroundColor: "#1A1A1A", color: "#CCCCCC" } } }, Be = { style: { chart: { backgroundColor: "#FFF8E1", color: "#424242", layout: { grid: { stroke: "#5D403780" }, outerPolygon: { stroke: "#5D4037" }, dataPolygon: { color: "#D32F2F", stroke: "#D32F2F" }, smileys: { colors: { 1: "#FFC107", 2: "#FF9800", 3: "#F57C00", 4: "#E64A19", 5: "#D32F2F" } }, dataLabel: { color: "#424242" } }, legend: { backgroundColor: "#FFF8E1", color: "#424242" }, title: { color: "#424242", subtitle: { color: "#757575" } } } }, table: { th: { backgroundColor: "#FFF8E1", color: "#424242" }, td: { backgroundColor: "#FFF8E1", color: "#424242" } } }, Oe = { style: { chart: { backgroundColor: "#1E1E1E", color: "#BDBDBD", layout: { grid: { stroke: "#5D403780" }, outerPolygon: { stroke: "#5D4037" }, dataPolygon: { color: "#D32F2F", stroke: "#D32F2F" }, smileys: { colors: { 1: "#FFC107", 2: "#FF9800", 3: "#F57C00", 4: "#E64A19", 5: "#D32F2F" } }, dataLabel: { color: "#BDBDBD" } }, legend: { backgroundColor: "#1E1E1E", color: "#BDBDBD" }, title: { color: "#FFF8E1", subtitle: { color: "#BDBDBD" } } } }, table: { th: { backgroundColor: "#FFF8E1", color: "#424242" }, td: { backgroundColor: "#FFF8E1", color: "#424242" } } }, Ee = { style: { chart: { backgroundColor: "#1A1A1A", color: "#99AA99", layout: { grid: { stroke: "#333333" }, outerPolygon: { stroke: "#334C33" }, dataPolygon: { color: "#33B333", stroke: "#00FF00" }, smileys: { colors: { 1: "#336633", 2: "#338033", 3: "#339933", 4: "#33E633", 5: "#00FF00" } }, dataLabel: { color: "#00FF00" } }, legend: { backgroundColor: "#1A1A1A", color: "#99AA99" }, title: { color: "#66CC66", subtitle: { color: "#99AA99" } } } }, table: { th: { backgroundColor: "#1A1A1A", color: "#99AA99" }, td: { backgroundColor: "#1A1A1A", color: "#AACCAA" } } }, Ne = { style: { chart: { backgroundColor: "#fbfafa", color: "#8A9892", layout: { grid: { stroke: "#C5B8A7" }, outerPolygon: { strokeWidth: 0 }, dataPolygon: { color: "#858480", stroke: "#C09E85" }, smileys: { colors: { 1: "#C09E85", 2: "#DCB482", 3: "#DFCA99", 4: "#E0CFC3", 5: "#B9B99D" } }, dataLabel: { color: "#606C5A" } }, legend: { backgroundColor: "#fbfafa", color: "#99AA99" }, title: { color: "#8A9892", subtitle: { color: "#99AA99" } } } }, table: { th: { backgroundColor: "#fbfafa", color: "#8F837A" }, td: { backgroundColor: "#fbfafa", color: "#8F837A" } } }, Le = { style: { chart: { backgroundColor: "#f6f6fb", color: "#50606C", layout: { grid: { stroke: "#61747E" }, outerPolygon: { stroke: "#50606C" }, dataPolygon: { color: "#A3C4BE", stroke: "#92B0B5" }, smileys: { colors: { 1: "#5C6B5B", 2: "#4A6A75", 3: "#6C94A0", 4: "#7DA9B5", 5: "#8EBFCA" } }, dataLabel: { color: "#50606C" } }, legend: { backgroundColor: "#f6f6fb", color: "#61747E" }, title: { color: "#50606C", subtitle: { color: "#718890" } } } }, table: { th: { backgroundColor: "#f6f6fb", color: "#50606C" }, td: { backgroundColor: "#f6f6fb", color: "#50606C" } } }, Se = {
default: {},
dark: Me,
celebration: Be,
celebrationNight: Oe,
hack: Ee,
zen: Ne,
concrete: Le
}, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
celebration: Be,
celebrationNight: Oe,
concrete: Le,
dark: Me,
default: Se,
hack: Ee,
zen: Ne
}, Symbol.toStringTag, { value: "Module" })), zt = ["id"], Ut = ["id"], Wt = ["xmlns", "viewBox"], Gt = ["width", "height"], Ht = ["id"], Xt = ["stop-color"], Kt = ["stop-color"], qt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Yt = ["d", "stroke", "stroke-width"], Jt = ["transform"], Qt = ["stroke"], Zt = ["fill"], eo = ["transform"], to = ["stroke"], oo = ["fill"], lo = ["transform"], ao = ["stroke"], no = ["fill"], ro = ["transform"], so = ["stroke"], uo = ["fill"], io = ["transform"], co = ["stroke"], vo = ["fill"], yo = ["d", "stroke", "stroke-width", "fill"], go = ["x1", "y1", "x2", "y2", "stroke"], ho = ["cx", "cy", "fill", "stroke"], fo = ["cx", "cy", "fill", "stroke"], po = ["x", "y", "fill", "font-weight"], bo = ["x", "y", "fill"], ko = {
key: 4,
class: "vue-data-ui-watermark"
}, mo = ["id"], Co = ["onClick"], Ao = ["innerHTML"], wo = {
__name: "vue-ui-mood-radar",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Object,
default() {
return {};
}
}
},
setup(Ie, { expose: Re }) {
const M = T(() => import("./BaseIcon-4i3dd7Ty.js")), je = T(() => import("./vue-ui-accordion-DUuwVsuJ.js")), Ve = T(() => import("./DataTable-WrXCJkfE.js")), ze = T(() => import("./PenAndPaper-DxIUvoQ8.js")), Ue = T(() => import("./UserOptions-CzJWRC4s.js")), We = T(() => import("./PackageVersion-BLzm8l_I.js")), Ge = T(() => import("./BaseDraggableDialog-CAJxIF6g.js")), { vue_ui_mood_radar: He } = Tt(), { isThemeValid: Xe, warnInvalidTheme: Ke } = Nt(), w = Ie, m = i(kt()), F = i(null), f = i(null), le = i(null), qe = i(0), Ye = i(0), ae = i(0), ne = i(null), re = i(null), E = i(null), z = i(null), se = i(null), ue = i(!1), N = i(null), X = i(null), ie = v(() => !!w.dataset && Object.keys(w.dataset).length), e = i(J()), { loading: K, FINAL_DATASET: P } = Mt({
...gt(w),
FINAL_CONFIG: e,
prepareConfig: J,
callback: () => {
Promise.resolve().then(async () => {
await De(), D.value.showTable = e.value.table.show;
});
},
skeletonDataset: {
1: 1,
2: 1,
3: 1,
4: 1,
5: 1
},
skeletonConfig: mt({
defaultConfig: e.value,
userConfig: {
userOptions: { show: !1 },
table: { show: !1 },
style: {
chart: {
backgroundColor: "#99999930",
layout: {
grid: {
stroke: "#6A6A6A"
},
outerPolygon: {
stroke: "#6A6A6A"
},
dataPolygon: {
color: "#6A6A6A",
opacity: 30,
stroke: "#6A6A6A"
},
smileys: {
colors: {
1: "#DBDBDB",
2: "#C4C4C4",
3: "#ADADAD",
4: "#969696",
5: "#808080"
}
},
dataLabel: {
color: "transparent"
}
},
legend: {
backgroundColor: "transparent"
}
}
}
}
})
});
ht(() => {
ue.value = !0, ce();
});
const Je = v(() => e.value.debug);
function ce() {
if (Ct(w.dataset) && _e({
componentName: "VueUiMoodRadar",
type: "dataset",
debug: Je.value
}), e.value.responsive) {
const t = Dt(() => {
const { width: l, height: o } = _t({
chart: F.value,
title: e.value.style.chart.title.text ? ne.value : null,
legend: e.value.style.chart.legend.show ? re.value : null,
noTitle: le.value,
source: se.value
});
requestAnimationFrame(() => {
r.value.width = l, r.value.height = o - 12;
});
});
E.value && (z.value && E.value.unobserve(z.value), E.value.disconnect()), E.value = new ResizeObserver(t), z.value = F.value.parentNode, E.value.observe(z.value);
}
}
const { userOptionsVisible: q, setUserOptionsVisibility: de, keepUserOptionState: ve } = Lt({ config: e.value }), { svgRef: Y } = St({ config: e.value.style.chart.title });
function J() {
const t = oe({
userConfig: w.config,
defaultConfig: He
}), l = t.theme;
if (!l) return t;
if (!Xe.value(t))
return Ke(t), t;
const o = oe({
userConfig: Se[l] || w.config,
defaultConfig: t
});
return oe({
userConfig: w.config,
defaultConfig: o
});
}
Ae(() => w.config, (t) => {
e.value = J(), q.value = !e.value.userOptions.showOnChartHover, ce(), qe.value += 1, Ye.value += 1, ae.value += 1, D.value.showTable = e.value.table.show;
}, { deep: !0 });
const { isPrinting: ye, isImaging: ge, generatePdf: he, generateImage: fe } = Ot({
elementId: m.value,
fileName: e.value.style.chart.title.text || "vue-ui-mood-radar",
options: e.value.userOptions.print
}), Qe = v(() => e.value.userOptions.show && !e.value.style.chart.title.text), D = i({
showTable: e.value.table.show
}), r = i({
height: 256,
width: 256
}), Ze = {
5: { x: 128, y: 35 },
4: { x: 218, y: 98.5 },
3: { x: 185, y: 204 },
2: { x: 70, y: 204 },
1: { x: 38.5, y: 98.5 }
}, et = v(() => {
const t = {};
return Z.value.forEach((l) => {
t[l.key] = { x: l.x, y: l.y };
}), t;
});
function L(t) {
const l = Ze[t], o = et.value[t] || l;
return `translate(${o.x - l.x}, ${o.y - l.y})`;
}
const Q = v(() => At({
plot: { x: r.value.width / 2, y: r.value.height / 2 },
radius: Math.min(r.value.height, r.value.width) * 0.35,
sides: 5,
rotation: 11
}));
function tt({ centerX: t, centerY: l, apexX: o, apexY: u, proportion: p, key: b, value: yt }) {
return {
x: t + (o - t) * p,
y: l + (u - l) * p,
key: b,
value: yt
};
}
const ot = v(() => Math.max(...Object.values(P.value).map((t) => isNaN(t) ? 0 : t))), _ = v(() => Object.values(P.value).reduce((t, l) => (isNaN(t) ? 0 : t) + (isNaN(l) ? 0 : l), 0)), g = v(() => Object.keys(P.value).map((t, l) => {
const o = typeof P.value[t] != "number" || isNaN(P.value[t]) ? 0 : P.value[t];
return {
index: l,
key: t,
value: o,
proportion: o / _.value,
color: e.value.style.chart.layout.smileys.colors[t]
};
}).sort((t, l) => l.key - t.key)), pe = v(() => g.value.map((t, l) => ({
...t,
display: `${Te(
e.value.style.chart.layout.dataLabel.formatter,
t.value,
H({
p: e.value.style.chart.layout.dataLabel.prefix,
v: t.value,
s: e.value.style.chart.layout.dataLabel.suffix,
r: e.value.style.chart.layout.dataLabel.roundingValue
})
)}${K.value ? "" : ` (${H({
v: t.proportion * 100,
s: "%",
r: e.value.style.chart.legend.roundingPercentage
})})`}`
}))), Z = v(() => (["1", "2", "3", "4", "5"].forEach((t) => {
[null, void 0].includes(P.value[t]) && _e({
componentName: "VueUiMoodRadar",
type: "datasetAttribute",
property: t
});
}), Q.value.coordinates.map((t, l) => {
const o = tt({
centerX: r.value.width / 2,
centerY: r.value.height / 2,
apexX: t.x,
apexY: t.y,
proportion: g.value[l].value / ot.value,
key: g.value[l].key,
value: g.value[l].value
});
return {
...t,
plots: o,
key: g.value[l].key
};
}))), lt = v(() => ({
cy: "mood-radar-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" : ""
}));
function at(t) {
t === f.value ? f.value = null : (f.value = t, B(t));
}
function S(t) {
f.value = t;
const l = g.value.find((o) => o.key === t);
e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: l, seriesIndex: l.index });
}
function I(t) {
f.value = null;
const l = g.value.find((o) => o.key === t);
e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: l, seriesIndex: l.index });
}
function B(t) {
const l = g.value.find((o) => o.key === t);
e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: l, seriesIndex: l.index });
}
const x = v(() => {
const t = g.value.map((o) => ({
name: o.key,
color: o.color
})), l = g.value.map((o) => isNaN(o.value) ? 0 : o.value);
return { head: t, body: l };
});
function ee(t = null) {
De(() => {
const l = x.value.head.map((p, b) => [[
p.name
], [x.value.body[b]], [isNaN(x.value.body[b] / _.value) ? "-" : x.value.body[b] / _.value * 100]]), o = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(l), u = $t(o);
t ? t(u) : Pt({ csvContent: u, title: e.value.style.chart.title.text || "vue-ui-mood-radar" });
});
}
const U = v(() => {
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>',
Number(_.value.toFixed(e.value.table.td.roundingValue)).toLocaleString(),
"100%"
], l = x.value.head.map((p, b) => [
{
color: p.color,
name: p.name
},
x.value.body[b].toFixed(e.value.table.td.roundingValue),
isNaN(x.value.body[b] / _.value) ? "-" : (x.value.body[b] / _.value * 100).toFixed(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
}, u = [
e.value.table.columnNames.series,
e.value.table.columnNames.value,
e.value.table.columnNames.percentage
];
return {
head: t,
body: l,
config: o,
colNames: u
};
});
function nt() {
return g.value;
}
function be() {
D.value.showTable = !D.value.showTable;
}
const O = i(!1);
function ke(t) {
O.value = t;
}
const W = i(!1);
function te() {
W.value = !W.value;
}
async function rt({ scale: t = 2 } = {}) {
if (!F.value) return;
const { width: l, height: o } = F.value.getBoundingClientRect(), u = l / o, { imageUri: p, base64: b } = await It({ domElement: F.value, base64: !0, img: !0, scale: t });
return {
imageUri: p,
base64: b,
title: e.value.style.chart.title.text,
width: l,
height: o,
aspectRatio: u
};
}
const R = v(() => {
const t = e.value.table.useDialog && !e.value.table.show, l = D.value.showTable;
return {
component: t ? Ge : je,
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? `: ${e.value.style.chart.title.subtitle.text}` : ""}`,
props: t ? {
backgroundColor: e.value.table.th.backgroundColor,
color: e.value.table.th.color,
headerColor: e.value.table.th.color,
headerBg: e.value.table.th.backgroundColor,
isFullscreen: O.value,
fullscreenParent: F.value,
forcedWidth: Math.min(800, window.innerWidth * 0.8)
} : {
hideDetails: !0,
config: {
open: l,
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
}
}
}
};
});
Ae(() => D.value.showTable, (t) => {
e.value.table.show || (t && e.value.table.useDialog && N.value ? N.value.open() : "close" in N.value && N.value.close());
});
function me() {
D.value.showTable = !1, X.value && X.value.setTableIconState(!1);
}
const st = v(() => pe.value.map((t) => ({
...t,
name: t.display,
shape: "circle"
}))), ut = v(() => e.value.style.chart.backgroundColor), it = v(() => e.value.style.chart.legend), ct = v(() => e.value.style.chart.title), { exportSvg: dt, getSvg: vt } = Et({
svg: Y,
title: ct,
legend: it,
legendItems: st,
backgroundColor: ut
});
async function Ce({ isCb: t }) {
if (t) {
const { blob: l, url: o, text: u, dataUrl: p } = await vt();
e.value.userOptions.callbacks.svg({ blob: l, url: o, text: u, dataUrl: p });
} else
dt();
}
return Re({
getData: nt,
getImage: rt,
generatePdf: he,
generateCsv: ee,
generateImage: fe,
generateSvg: Ce,
toggleTable: be,
toggleAnnotator: te,
toggleFullscreen: ke
}), (t, l) => (s(), h("div", {
class: we(`vue-data-ui-component vue-ui-mood-radar ${O.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
ref_key: "moodRadarChart",
ref: F,
id: `${m.value}`,
style: j(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor}`),
onMouseenter: l[16] || (l[16] = () => a(de)(!0)),
onMouseleave: l[17] || (l[17] = () => a(de)(!1))
}, [
e.value.userOptions.buttons.annotator ? (s(), k(a(ze), {
key: 0,
svgRef: a(Y),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: W.value,
onClose: te
}, {
"annotator-action-close": c(() => [
d(t.$slots, "annotator-action-close", {}, void 0, !0)
]),
"annotator-action-color": c(({ color: o }) => [
d(t.$slots, "annotator-action-color", C(A({ color: o })), void 0, !0)
]),
"annotator-action-draw": c(({ mode: o }) => [
d(t.$slots, "annotator-action-draw", C(A({ mode: o })), void 0, !0)
]),
"annotator-action-undo": c(({ disabled: o }) => [
d(t.$slots, "annotator-action-undo", C(A({ disabled: o })), void 0, !0)
]),
"annotator-action-redo": c(({ disabled: o }) => [
d(t.$slots, "annotator-action-redo", C(A({ disabled: o })), void 0, !0)
]),
"annotator-action-delete": c(({ disabled: o }) => [
d(t.$slots, "annotator-action-delete", C(A({ disabled: o })), void 0, !0)
]),
_: 3
}, 8, ["svgRef", "backgroundColor", "color", "active"])) : y("", !0),
Qe.value ? (s(), h("div", {
key: 1,
ref_key: "noTitle",
ref: le,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : y("", !0),
e.value.style.chart.title.text ? (s(), h("div", {
key: 2,
ref_key: "chartTitle",
ref: ne,
style: "width:100%;background:transparent"
}, [
G(Rt, {
config: {
title: {
cy: "mood-radar-title",
...e.value.style.chart.title
},
subtitle: {
cy: "mood-radar-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"])
], 512)) : y("", !0),
n("div", {
id: `legend-top-${m.value}`
}, null, 8, Ut),
e.value.userOptions.show && ie.value && (a(ve) || a(q)) ? (s(), k(a(Ue), {
key: 3,
ref_key: "userOptionsRef",
ref: X,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: a(ye),
isImaging: a(ge),
uid: m.value,
hasPdf: e.value.userOptions.buttons.pdf,
hasXls: e.value.userOptions.buttons.csv,
hasImg: e.value.userOptions.buttons.img,
hasSvg: e.value.userOptions.buttons.svg,
hasTable: e.value.userOptions.buttons.table,
hasFullscreen: e.value.userOptions.buttons.fullscreen,
isFullscreen: O.value,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: F.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: W.value,
callbacks: e.value.userOptions.callbacks,
printScale: e.value.userOptions.print.scale,
tableDialog: e.value.table.useDialog,
onToggleFullscreen: ke,
onGeneratePdf: a(he),
onGenerateCsv: ee,
onGenerateImage: a(fe),
onGenerateSvg: Ce,
onToggleTable: be,
onToggleAnnotator: te,
style: j({
visibility: a(ve) ? a(q) ? "visible" : "hidden" : "visible"
})
}, Fe({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: c(({ isOpen: o, color: u }) => [
d(t.$slots, "menuIcon", C(A({ isOpen: o, color: u })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: c(() => [
d(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: c(() => [
d(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: c(() => [
d(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionSvg ? {
name: "optionSvg",
fn: c(() => [
d(t.$slots, "optionSvg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: c(() => [
d(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: c(({ toggleFullscreen: o, isFullscreen: u }) => [
d(t.$slots, "optionFullscreen", C(A({ toggleFullscreen: o, isFullscreen: u })), void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: c(({ toggleAnnotator: o, isAnnotator: u }) => [
d(t.$slots, "optionAnnotator", C(A({ toggleAnnotator: o, isAnnotator: u })), void 0, !0)
]),
key: "7"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasSvg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "tableDialog", "onGeneratePdf", "onGenerateImage", "style"])) : y("", !0),
(s(), h("svg", {
ref_key: "svgRef",
ref: Y,
xmlns: a(wt),
viewBox: `0 0 ${r.value.width} ${r.value.height}`,
class: we({ "vue-data-ui-fullscreen--on": O.value, "vue-data-ui-fulscreen--off": !O.value }),
style: j(`overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
}, [
G(a(We)),
t.$slots["chart-background"] ? (s(), h("foreignObject", {
key: 0,
x: 0,
y: 0,
width: r.value.width,
height: r.value.height,
style: {
pointerEvents: "none"
}
}, [
d(t.$slots, "chart-background", {}, void 0, !0)
], 8, Gt)) : y("", !0),
n("defs", null, [
n("radialGradient", {
cx: "50%",
cy: "50%",
r: "50%",
fx: "50%",
fy: "50%",
id: `mood_radar_gradient_${m.value}`
}, [
n("stop", {
offset: "0%",
"stop-color": a($)(e.value.style.chart.layout.dataPolygon.color, e.value.style.chart.layout.dataPolygon.opacity)
}, null, 8, Xt),
n("stop", {
offset: "100%",
"stop-color": a($)(a(Ft)(e.value.style.chart.layout.dataPolygon.color, e.value.style.chart.layout.dataPolygon.gradient.intensity / 100), e.value.style.chart.layout.dataPolygon.opacity)
}, null, 8, Kt)
], 8, Ht)
]),
(s(!0), h(xe, null, $e(Q.value.coordinates, (o) => (s(), h("line", {
x1: r.value.width / 2,
y1: r.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, qt))), 256)),
n("path", {
d: Q.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, Yt),
n("g", {
transform: L("5")
}, [
n("path", {
fill: "none",
stroke: e.value.style.chart.layout.smileys.colors[5],
"stroke-width": "1",
"stroke-linecap": "round",
d: "M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22"
}, null, 8, Qt),
n("circle", {
class: "vue-ui-mood-radar-trap",
cx: "128",
cy: "25",
r: "20",
fill: f.value === "5" ? a($)(e.value.style.chart.layout.smileys.colors[5], 20) : "transparent",
onMouseenter: l[0] || (l[0] = (o) => S("5")),
onMouseleave: l[1] || (l[1] = (o) => I("5")),
onClick: l[2] || (l[2] = (o) => B("5"))
}, null, 40, Zt)
], 8, Jt),
n("g", {
transform: L("4")
}, [
n("path", {
fill: "none",
stroke: e.value.style.chart.layout.smileys.colors[4],
"stroke-width": "1",
"stroke-linecap": "round",
d: "M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92"
}, null, 8, to),
n("circle", {
class: "vue-ui-mood-radar-trap",
cx: "227",
cy: "95.5",
r: "20",
fill: f.value === "4" ? a($)(e.value.style.chart.layout.smileys.colors[4], 20) : "transparent",
onMouseenter: l[3] || (l[3] = (o) => S("4")),
onMouseleave: l[4] || (l[4] = (o) => I("4")),
onClick: l[5] || (l[5] = (o) => B("4"))
}, null, 40, oo)
], 8, eo),
n("g", {
transform: L("3")
}, [
n("path", {
fill: "none",
stroke: e.value.style.chart.layout.smileys.colors[3],
"stroke-width": "1",
"stroke-linecap": "round",
d: "M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215"
}, null, 8, ao),
n("circle", {
class: "vue-ui-mood-radar-trap",
cx: "190",
cy: "213.5",
r: "20",
fill: f.value === "3" ? a($)(e.value.style.chart.layout.smileys.colors[3], 20) : "transparent",
onMouseenter: l[6] || (l[6] = (o) => S("3")),
onMouseleave: l[7] || (l[7] = (o) => I("3")),
onClick: l[8] || (l[8] = (o) => B("3"))
}, null, 40, no)
], 8, lo),
n("g", {
transform: L("2")
}, [
n("path", {
fill: "none",
stroke: e.value.style.chart.layout.smileys.colors[2],
"stroke-width": "1",
"stroke-linecap": "round",
d: "M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210"
}, null, 8, so),
n("circle", {
class: "vue-ui-mood-radar-trap",
cx: "65",
cy: "213.5",
r: "20",
fill: f.value === "2" ? a($)(e.value.style.chart.layout.smileys.colors[2], 20) : "transparent",
onMouseenter: l[9] || (l[9] = (o) => S("2")),
onMouseleave: l[10] || (l[10] = (o) => I("2")),
onClick: l[11] || (l[11] = (o) => B("2"))
}, null, 40, uo)
], 8, ro),
n("g", {
transform: L("1")
}, [
n("path", {
fill: "none",
stroke: e.value.style.chart.layout.smileys.colors[1],
"stroke-width": "1",
"stroke-linecap": "round",
d: "M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93"
}, null, 8, co),
n("circle", {
class: "vue-ui-mood-radar-trap",
cx: "29",
cy: "95.5",
r: "20",
fill: f.value === "1" ? a($)(e.value.style.chart.layout.smileys.colors[1], 20) : "transparent",
onMouseenter: l[12] || (l[12] = (o) => S("1")),
onMouseleave: l[13] || (l[13] = (o) => I("1")),
onClick: l[14] || (l[14] = (o) => B("1"))
}, null, 40, vo)
], 8, io),
n("path", {
d: a(xt)(Z.value.map((o) => o.plots)),
stroke: e.value.style.chart.layout.dataPolygon.stroke,
"stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth,
"stroke-linecap": "round",
"stroke-linejoin": "round",
fill: e.value.style.chart.layout.dataPolygon.gradient.show ? `url(#mood_radar_gradient_${m.value})` : a($)(e.value.style.chart.layout.dataPolygon.color, e.value.style.chart.layout.dataPolygon.opacity)
}, null, 8, yo),
(s(!0), h(xe, null, $e(Z.value.map((o) => o.plots), (o, u) => (s(), h("g", {
class: "vue-ui-mood-radar-trap",
style: j(`opacity:${f.value == o.key ? "1" : "0"}`)
}, [
n("line", {
x1: o.x,
y1: o.y,
x2: r.value.width / 2,
y2: r.value.height / 2,
stroke: e.value.style.chart.layout.smileys.colors[o.key]
}, null, 8, go),
n("circle", {
cx: o.x,
cy: o.y,
fill: e.value.style.chart.layout.smileys.colors[o.key],
r: "3",
stroke: e.value.style.chart.backgroundColor,
"stroke-width": 0.5
}, null, 8, ho),
n("circle", {
cx: r.value.width / 2,
cy: r.value.height / 2,
fill: e.value.style.chart.layout.smileys.colors[o.key],
r: "3",
stroke: e.value.style.chart.backgroundColor,
"stroke-width": 0.5
}, null, 8, fo),
n("text", {
x: r.value.width / 2,
y: ["5", 5].includes(o.key) ? r.value.height / 2 * 1.13 : r.value.height / 2 * 0.9375,
fill: e.value.style.chart.layout.dataLabel.color,
"font-size": "12",
"text-anchor": "middle",
"font-weight": e.value.style.chart.layout.dataLabel.bold ? "bold" : "normal"
}, V(a(Te)(
e.value.style.chart.layout.dataLabel.formatter,
o.value,
a(H)({
p: e.value.style.chart.layout.dataLabel.prefix,
v: o.value,
s: e.value.style.chart.layout.dataLabel.suffix,
r: e.value.style.chart.layout.dataLabel.roundingValue
}),
{ datapoint: o, seriesIndex: u }
)), 9, po),
n("text", {
x: r.value.width / 2,
y: ["5", 5].includes(o.key) ? r.value.height / 2 * 1.273 : r.value.height / 2 * 0.7968,
fill: e.value.style.chart.layout.dataLabel.color,
"font-size": "12",
"text-anchor": "middle"
}, " (" + V(a(H)({
v: o.value / _.value * 100,
s: "%",
r: e.value.style.chart.layout.dataLabel.roundingPercentage
})) + ") ", 9, bo)
], 4))), 256)),
d(t.$slots, "svg", { svg: r.value }, void 0, !0)
], 14, Wt)),
t.$slots.watermark ? (s(), h("div", ko, [
d(t.$slots, "watermark", C(A({ isPrinting: a(ye) || a(ge) })), void 0, !0)
])) : y("", !0),
n("div", {
id: `legend-bottom-${m.value}`
}, null, 8, mo),
ue.value ? (s(), k(ft, {
key: 5,
to: e.value.style.chart.legend.position === "top" ? `#legend-top-${m.value}` : `#legend-bottom-${m.value}`
}, [
n("div", {
ref_key: "chartLegend",
ref: re
}, [
e.value.style.chart.legend.show ? (s(), k(jt, {
legendSet: pe.value,
config: lt.value,
key: `legend_${ae.value}`,
style: { display: "flex", "row-gap": "6px" }
}, {
item: c(({ legend: o, index: u }) => [
n("div", {
onClick: () => at(o.key),
style: { display: "flex", "flex-direction": "row", gap: "3px", "align-items": "center", margin: "3px 0" }
}, [
o.key == 1 ? (s(), k(a(M), {
key: 0,
strokeWidth: 1,
name: "moodSad",
stroke: e.value.style.chart.layout.smileys.colors[o.key]
}, null, 8, ["stroke"])) : y("", !0),
o.key == 2 ? (s(), k(a(M), {
key: 1,
strokeWidth: 1,
name: "moodFlat",
stroke: e.value.style.chart.layout.smileys.colors[o.key]
}, null, 8, ["stroke"])) : y("", !0),
o.key == 3 ? (s(), k(a(M), {
key: 2,
strokeWidth: 1,
name: "moodNeutral",
stroke: e.value.style.chart.layout.smileys.colors[o.key]
}, null, 8, ["stroke"])) : y("", !0),
o.key == 4 ? (s(), k(a(M), {
key: 3,
strokeWidth: 1,
name: "smiley",
stroke: e.value.style.chart.layout.smileys.colors[o.key]
}, null, 8, ["stroke"])) : y("", !0),
o.key == 5 ? (s(), k(a(M), {
key: 4,
strokeWidth: 1,
name: "moodHappy",
stroke: e.value.style.chart.layout.smileys.colors[o.key]
}, null, 8, ["stroke"])) : y("", !0),
a(K) ? y("", !0) : (s(), h("span", {
key: 5,
style: j({ fontWeight: e.value.style.chart.legend.bold ? "bold" : "normal" })
}, V(o.display), 5))
], 8, Co)
]),
_: 1
}, 8, ["legendSet", "config"])) : y("", !0),
d(t.$slots, "legend", { legend: g.value }, void 0, !0)
], 512)
], 8, ["to"])) : y("", !0),
t.$slots.source ? (s(), h("div", {
key: 6,
ref_key: "source",
ref: se,
dir: "auto"
}, [
d(t.$slots, "source", {}, void 0, !0)
], 512)) : y("", !0),
ie.value && e.value.userOptions.buttons.table ? (s(), k(pt(R.value.component), bt({ key: 7 }, R.value.props, {
ref_key: "tableUnit",
ref: N,
onClose: me
}), Fe({
content: c(() => [
G(a(Ve), {
colNames: U.value.colNames,
head: U.value.head,
body: U.value.body,
config: U.value.config,
title: e.value.table.useDialog ? "" : R.value.title,
withCloseButton: !e.value.table.useDialog,
onClose: me
}, {
th: c(({ th: o }) => [
n("div", {
innerHTML: o,
style: { display: "flex", "align-items": "center" }
}, null, 8, Ao)
]),
td: c(({ td: o }) => [
Pe(V(o.name || o), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title", "withCloseButton"])
]),
_: 2
}, [
e.value.table.useDialog ? {
name: "title",
fn: c(() => [
Pe(V(R.value.title), 1)
]),
key: "0"
} : void 0,
e.value.table.useDialog ? {
name: "actions",
fn: c(() => [
n("button", {
tabindex: "0",
class: "vue-ui-user-options-button",
onClick: l[15] || (l[15] = (o) => ee(e.value.userOptions.callbacks.csv))
}, [
G(a(M), {
name: "excel",
stroke: R.value.props.color
}, null, 8, ["stroke"])
])
]),
key: "1"
} : void 0
]), 1040)) : y("", !0),
a(K) ? (s(), k(Bt, { key: 8 })) : y("", !0)
], 46, zt));
}
}, Fo = /* @__PURE__ */ Vt(wo, [["__scopeId", "data-v-104510a1"]]), jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: Fo
}, Symbol.toStringTag, { value: "Module" }));
export {
Ro as a,
jo as b,
Fo as v
};