vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
959 lines (958 loc) • 29.9 kB
JavaScript
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
import { $ as t, D as n, Jt as r, Kt as i, M as a, Ot as o, Pt as ee, S as te, Z as s, ct as c, jt as ne, q as re, t as l, tt as u, w as ie, xt as ae } from "./lib-Bttd6u5E.js";
import { n as oe, t as se } from "./useHints-Dq_w2E8B.js";
import { t as ce } from "./useConfig-D3scuR88.js";
import { t as le } from "./usePrinter-DN5bYhTG.js";
import { n as ue, t as de } from "./BaseScanner-DZvpgOjM.js";
import { t as fe } from "./useSvgExport-DH-FfcqQ.js";
import { t as pe } from "./useNestedProp-vPNvh7rV.js";
import { t as me } from "./useThemeCheck-C43Tcqmk.js";
import { t as he } from "./img-Bnokohej.js";
import { t as ge } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { t as _e } from "./DefGrad-DVBqDjhO.js";
import { t as ve } from "./useUserOptionState-DK-_1ddE.js";
import { t as ye } from "./useChartAccessibility-DYqac8yF.js";
import { t as be } from "./vue_ui_molecule-CO9L59SF.js";
import { t as xe } from "./usePanZoom-CYU3B4T3.js";
import { Fragment as Se, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as Ce, createTextVNode as we, createVNode as g, defineAsyncComponent as _, guardReactiveProps as v, mergeProps as Te, nextTick as y, normalizeClass as Ee, normalizeProps as b, normalizeStyle as x, onMounted as De, openBlock as S, ref as C, renderList as Oe, renderSlot as w, resolveDynamicComponent as ke, toDisplayString as Ae, toRefs as je, unref as T, useCssVars as Me, watch as E, withCtx as D } from "vue";
//#region src/components/vue-ui-molecule.vue
var Ne = /* @__PURE__ */ e({ default: () => O }), Pe = ["id"], Fe = {
key: 1,
ref: "noTitle",
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, Ie = {
key: 2,
style: "width:100%;background:transparent;"
}, Le = ["xmlns", "viewBox"], Re = ["width", "height"], ze = {
key: 4,
class: "vue-data-ui-watermark"
}, Be = {
key: 5,
"data-dom-to-png-ignore": "",
class: "reset-wrapper"
}, Ve = {
key: 6,
ref: "source",
dir: "auto"
}, He = ["innerHTML"], O = /*#__PURE__*/ ge({
__name: "vue-ui-molecule",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectNode", "copyAlt"],
setup(e, { expose: ge, emit: Ne }) {
Me((e) => ({ v2082f13d: tn.value }));
let O = _(() => import("./Title-BE3qg9xl.js").then((e) => e.t)), Ue = _(() => import("./Tooltip-DhjyfHwz.js")), We = _(() => import("./BaseIcon-BfndwIWE.js").then((e) => e.n)), Ge = _(() => import("./vue-ui-accordion-BxGriZik.js").then((e) => e.n)), Ke = _(() => import("./DataTable-BbKgJ5UI.js")), qe = _(() => import("./PenAndPaper-DAE-tnEQ.js").then((e) => e.t)), Je = _(() => import("./UserOptions-Dt98of5H.js").then((e) => e.n)), Ye = _(() => import("./PackageVersion-D6d8SCp9.js").then((e) => e.t)), Xe = _(() => import("./RecursiveLinks-BygcpDiT.js")), Ze = _(() => import("./RecursiveLabels-D9rfID6q.js")), Qe = _(() => import("./RecursiveCircles-D6aDPmoe.js")), $e = _(() => import("./BaseDraggableDialog-LoqqwRtV.js").then((e) => e.n)), { vue_ui_molecule: et } = ce(), { isThemeValid: tt, warnInvalidTheme: nt } = me(), k = e, rt = Ne, it = d(() => !!k.dataset && k.dataset.length);
De(() => {
ot();
});
let at = d(() => R.value.debug);
function ot() {
ne(k.dataset) && u({
componentName: "VueUiMolecule",
type: "dataset",
debug: at.value
});
}
let A = C(re()), j = C(!1), M = C(""), N = C(null), st = C(0), ct = C(0), lt = C(0), P = C(null), F = C(null), I = C(!1), L = C(!1), R = C(mt());
oe({
config: () => R.value,
dataset: () => k.dataset,
component: "VueUiMolecule",
rules: [
se.emptyArray,
{
test: (e) => e[0] && e[0].nodes && e[0].nodes.length === 0,
message: [
"👀 There are no children nodes attached to the root node. Consider:",
"",
"▶️ Adding children nodes to the root node."
]
},
{
test: (e) => e[0] && e[0].nodes && e[0].nodes.length > 8,
message: [
"👀 The number of children nodes > 8, some nodes might overlap. Consider:",
"",
"▶️ Grouping data into broader categories."
]
}
]
});
let z = d(() => R.value.userOptions.useCursorPointer), ut = d(() => r({
defaultConfig: {
userOptions: { show: !1 },
table: { show: !1 },
style: { chart: {
backgroundColor: "#99999930",
nodes: { stroke: "#6A6A6A" },
links: { stroke: "#6A6A6A80" }
} }
},
userConfig: R.value.skeletonConfig ?? {}
})), { loading: B, FINAL_DATASET: V } = ue({
...je(k),
FINAL_CONFIG: R,
prepareConfig: mt,
skeletonDataset: k.config?.skeletonDataset ?? [{
name: "_",
color: "#CACACA",
nodes: [
{
name: "_",
color: "#CACACA",
nodes: [
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
}
]
},
{
name: "_",
color: "#CACACA",
nodes: [
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
}
]
},
{
name: "_",
color: "#CACACA",
nodes: [
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
}
]
},
{
name: "_",
color: "#CACACA",
nodes: [
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
}
]
},
{
name: "_",
color: "#CACACA",
nodes: [
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
}
]
},
{
name: "_",
color: "#CACACA",
nodes: [
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
},
{
name: "_",
color: "#CACACA"
}
]
}
]
}],
skeletonConfig: r({
defaultConfig: R.value,
userConfig: ut.value
})
}), { userOptionsVisible: dt, setUserOptionsVisibility: ft, keepUserOptionState: pt } = ve({ config: R.value }), { svgRef: H } = ye({ config: R.value.style.chart.title });
function mt() {
let e = pe({
userConfig: k.config,
defaultConfig: et
}), t = e.theme;
if (!t) return e;
if (!tt.value(e)) return nt(e), e;
let n = pe({
userConfig: be[t] || k.config,
defaultConfig: e
}), r = pe({
userConfig: k.config,
defaultConfig: n
});
return {
...r,
customPalette: r.customPalette.length ? r.customPalette : i[t] || ee
};
}
E(() => k.config, (e) => {
R.value = mt(), dt.value = !R.value.userOptions.showOnChartHover, ot(), ct.value += 1, lt.value += 1, U.value.showTable = R.value.table.show, U.value.showTooltip = R.value.style.chart.tooltip.show, U.value.showZoom = R.value.style.chart.zoom.show;
}, { deep: !0 });
let ht = C(0), gt = () => {
ht.value += 1;
};
E([() => B.value, () => V.value], async ([e]) => {
e || (await y(), W.value = wt(), await y(), gt(), await y(), Wt({
x: 0,
y: 0,
width: 400,
height: 400
}), Ht(!1));
}, {
flush: "post",
deep: !1
});
let { isPrinting: _t, isImaging: vt, generatePdf: yt, generateImage: bt } = le({
elementId: `cluster_${A.value}`,
fileName: R.value.style.chart.title.text || "vue-ui-molecule",
options: R.value.userOptions.print
}), xt = d(() => R.value.userOptions.show && !R.value.style.chart.title.text), St = d(() => ie(R.value.customPalette)), U = C({
showTable: R.value.table.show,
showDataLabels: !0,
showTooltip: R.value.style.chart.tooltip.show,
showZoom: R.value.style.chart.zoom.show
});
E(R, () => {
U.value = {
showTable: R.value.table.show,
showDataLabels: !0,
showTooltip: R.value.style.chart.tooltip.show,
showZoom: R.value.style.chart.zoom.show
};
}, { immediate: !0 });
function Ct(e, t = 0) {
return Array.isArray(e) && e.length > 0 && e[0].nodes ? Ct(e[0].nodes, t + 1) : t;
}
function wt() {
let e = Ct(V.value), t = 100, n = t;
for (let r = 0; r < e; r += 1) t /= 1, n += t;
return {
height: n,
width: n
};
}
let W = C(wt());
function Tt(e, t = {
x: -W.value.width / 2.43,
y: W.value.height / 2
}, n = W.value.width / 1.1, r = 24, i = 0, o = 0, s = "#BBBBBB", c = 0) {
if (!Array.isArray(e) || e.length === 0) return e;
let ne = a({
plot: t,
radius: n,
sides: e.length,
rotation: i
});
return e.forEach((e, t) => {
let a = ne.coordinates[t], l = e.color ? (() => {
let t = te(e.color);
return t.startsWith("#") ? t : `#${t}`;
})() : null, u;
l ? u = l : c === 0 ? u = s : c === 1 ? (u = St.value[o] || ee[o] || s, o += 1) : u = s, e.polygonPath = { coordinates: [a] }, e.circleRadius = r, e.color = u, e.strokeWidth = Math.min(R.value.style.chart.links.strokeWidth / (c + 1), r / 2), e.uid = re(), Array.isArray(e.nodes) && e.nodes.length && (e.nodes = Tt(e.nodes, a, n / 2.9, r / 2.2, i + Math.PI * t / e.nodes.length, o, u, c + 1));
}), e;
}
function Et(e) {
let t = /* @__PURE__ */ new Set();
function n(e) {
e.forEach((e) => {
if (!e.color) return;
let r = e.color;
/^#?[0-9A-F]{6}$/i.test(r) || (r = te(r)), r.startsWith("#") || (r = `#${r}`), t.add(r), Array.isArray(e.nodes) && e.nodes.length && n(e.nodes);
});
}
n(e);
let r = {};
return Array.from(t).forEach((e) => {
let t = e.slice(1);
r[e] = `gradient_${t}`;
}), r;
}
let Dt = d(() => Et(G.value)), G = d(() => Tt(s(V.value))), K = C(null);
function Ot(e) {
K.value = {
datapoint: e,
seriesIndex: -1,
series: G.value,
config: R.value
};
let t = R.value.style.chart.tooltip.customFormat;
if (ae(t) && c(() => t({
seriesIndex: -1,
datapoint: e,
series: G.value,
config: R.value
}))) M.value = t({
seriesIndex: -1,
datapoint: e,
series: G.value,
config: R.value
});
else {
let t = "";
t += `<div style="display:flex;align-items:center;gap:3px"><div style="color:${e.color}">⬤</div><div>${e.name}</div></div>`, e.details && (t += `<div style="width:100%;border-top:1px solid ${R.value.style.chart.tooltip.borderColor};margin-top: 2px">${e.details}</div>`), M.value = `<div style="font-family:inherit">${t}</div>`;
}
}
let q = C(null), J = C(null), kt = C(null);
function At(e) {
kt.value = q.value, q.value = e, e ? R.value.events.datapointEnter && R.value.events.datapointEnter({
datapoint: e,
seriesIndex: -1
}) : R.value.events.datapointLeave && R.value.events.datapointLeave({
datapoint: kt.value || q.value,
seriesIndex: -1
}), e ? (j.value = !0, Ot(e), J.value = e.uid) : (j.value = !1, M.value = "", J.value = null);
}
function jt(e) {
let t = [];
function n(e) {
e.forEach((e) => {
let r = {
name: e.name,
details: e.details || "-",
ancestor: e.ancestor && e.ancestor.name || "-",
color: e.color || ""
};
t.push(r), e.nodes && e.nodes.length > 0 && n(e.nodes, e.name);
});
}
return n(e), t;
}
let Mt = d(() => jt(G.value)), Y = d(() => ({
head: [
R.value.table.translations.nodeName,
R.value.table.translations.details,
R.value.table.translations.ancestor
],
body: Mt.value.map((e, t) => [
{
color: e.color,
name: e.name
},
e.details,
e.ancestor || ""
]),
config: {
th: {
backgroundColor: R.value.table.th.backgroundColor,
color: R.value.table.th.color,
outline: R.value.table.th.outline
},
td: {
backgroundColor: R.value.table.td.backgroundColor,
color: R.value.table.td.color,
outline: R.value.table.td.outline
},
breakpoint: R.value.table.responsiveBreakpoint
},
colNames: [
R.value.table.translations.nodeName,
R.value.table.translations.details,
R.value.table.translations.ancestor
]
}));
function Nt(e = null) {
y(() => {
let r = Y.value.body.map((e, t) => [
[e[0].name],
[e[1]],
[e[2]]
]), i = [
[R.value.style.chart.title.text],
[R.value.style.chart.title.subtitle.text],
[[...Y.value.head]]
].concat(r), a = n(i);
e ? e(a) : t({
csvContent: a,
title: R.value.style.chart.title.text || "vue-ui-molecule"
});
});
}
function Pt() {
return G.value;
}
let X = C(!1);
function Ft(e) {
X.value = e, st.value += 1;
}
function It() {
U.value.showTable = !U.value.showTable;
}
function Lt() {
U.value.showDataLabels = !U.value.showDataLabels;
}
function Rt() {
U.value.showTooltip = !U.value.showTooltip;
}
function zt() {
U.value.showZoom = !U.value.showZoom;
}
let Z = C(!1);
function Bt() {
Z.value = !Z.value;
}
let Vt = d(() => !Z.value && U.value.showZoom), { viewBox: Q, resetZoom: Ht, isZoom: Ut, setInitialViewBox: Wt } = xe(H, {
x: 0,
y: 0,
width: Math.max(10, W.value.width),
height: Math.max(10, W.value.height)
}, R.value.style.chart.zoom.speed, Vt);
function Gt(e) {
R.value.events.datapointClick && R.value.events.datapointClick({
datapoint: e,
seriesIndex: -1
}), rt("selectNode", e);
}
async function Kt({ scale: e = 2 } = {}) {
if (!N.value) return;
let { width: t, height: n } = N.value.getBoundingClientRect(), r = t / n, { imageUri: i, base64: a } = await he({
domElement: N.value,
base64: !0,
img: !0,
scale: e
});
return {
imageUri: i,
base64: a,
title: R.value.style.chart.title.text,
width: t,
height: n,
aspectRatio: r
};
}
let $ = d(() => {
let e = R.value.table.useDialog && !R.value.table.show, t = U.value.showTable;
return {
component: e ? $e : Ge,
title: `${R.value.style.chart.title.text}${R.value.style.chart.title.subtitle.text ? `: ${R.value.style.chart.title.subtitle.text}` : ""}`,
props: e ? {
backgroundColor: R.value.table.th.backgroundColor,
color: R.value.table.th.color,
headerColor: R.value.table.th.color,
headerBg: R.value.table.th.backgroundColor,
isFullscreen: X.value,
fullscreenParent: N.value,
forcedWidth: Math.min(800, window.innerWidth * .8),
isCursorPointer: z.value
} : {
hideDetails: !0,
config: {
open: t,
maxHeight: 1e4,
body: {
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color
},
head: {
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color
}
}
}
};
});
E(() => U.value.showTable, (e) => {
R.value.table.show || (e && R.value.table.useDialog && P.value ? P.value.open() : "close" in P.value && P.value.close());
});
function qt() {
U.value.showTable = !1, F.value && F.value.setTableIconState(!1);
}
let Jt = d(() => R.value.style.chart.backgroundColor), Yt = d(() => R.value.style.chart.title), { exportSvg: Xt, getSvg: Zt } = fe({
svg: H,
title: Yt,
backgroundColor: Jt
});
async function Qt({ isCb: e }) {
L.value = !0, await y();
try {
if (e) {
let { blob: e, url: t, text: n, dataUrl: r } = await Zt();
await Promise.resolve(R.value.userOptions.callbacks.svg({
blob: e,
url: t,
text: n,
dataUrl: r
}));
} else await Promise.resolve(Xt());
} finally {
L.value = !1;
}
}
function $t(e) {
if (e?.stage === "start") {
I.value = !0;
return;
}
if (e?.stage === "end") {
I.value = !1;
return;
}
bt();
}
async function en() {
if (rt("copyAlt", {
config: R.value,
dataset: G.value
}), !R.value.userOptions.callbacks.altCopy) {
console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");
return;
}
await Promise.resolve(R.value.userOptions.callbacks.altCopy({
config: R.value,
dataset: G.value
}));
}
let tn = d(() => R.value.style.chart.color);
return ge({
getData: Pt,
getImage: Kt,
generatePdf: yt,
generateCsv: Nt,
generateImage: bt,
generateSvg: Qt,
toggleTable: It,
toggleLabels: Lt,
toggleTooltip: Rt,
toggleAnnotator: Bt,
toggleFullscreen: Ft,
toggleZoom: zt,
copyAlt: en
}), (e, t) => (S(), m("div", {
ref_key: "moleculeChart",
ref: N,
class: Ee(`vue-data-ui-component vue-ui-molecule ${X.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
style: x(`font-family:${R.value.style.fontFamily};width:100%; text-align:center;background:${R.value.style.chart.backgroundColor}`),
id: `cluster_${A.value}`,
onMouseleave: t[2] ||= (e) => {
q.value = null, J.value = null, T(ft)(!1);
},
onMouseenter: t[3] ||= () => T(ft)(!0)
}, [
R.value.userOptions.buttons.annotator && T(H) ? (S(), f(T(qe), {
key: 0,
svgRef: T(H),
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color,
active: Z.value,
isCursorPointer: z.value,
onClose: Bt
}, {
"annotator-action-close": D(() => [w(e.$slots, "annotator-action-close", {}, void 0, !0)]),
"annotator-action-color": D(({ color: t }) => [w(e.$slots, "annotator-action-color", b(v({ color: t })), void 0, !0)]),
"annotator-action-draw": D(({ mode: t }) => [w(e.$slots, "annotator-action-draw", b(v({ mode: t })), void 0, !0)]),
"annotator-action-undo": D(({ disabled: t }) => [w(e.$slots, "annotator-action-undo", b(v({ disabled: t })), void 0, !0)]),
"annotator-action-redo": D(({ disabled: t }) => [w(e.$slots, "annotator-action-redo", b(v({ disabled: t })), void 0, !0)]),
"annotator-action-delete": D(({ disabled: t }) => [w(e.$slots, "annotator-action-delete", b(v({ disabled: t })), void 0, !0)]),
_: 3
}, 8, [
"svgRef",
"backgroundColor",
"color",
"active",
"isCursorPointer"
])) : p("", !0),
xt.value ? (S(), m("div", Fe, null, 512)) : p("", !0),
R.value.style.chart.title.text ? (S(), m("div", Ie, [(S(), f(T(O), {
key: `title_${ct.value}`,
config: {
title: {
cy: "molecule-div-title",
...R.value.style.chart.title
},
subtitle: {
cy: "molecule-div-subtitle",
...R.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))])) : p("", !0),
R.value.userOptions.show && it.value && (T(pt) || T(dt)) ? (S(), f(T(Je), {
ref_key: "userOptionsRef",
ref: F,
key: `user_options_${st.value}`,
backgroundColor: R.value.style.chart.backgroundColor,
color: R.value.style.chart.color,
isPrinting: T(_t),
isImaging: T(vt),
uid: A.value,
hasTooltip: R.value.userOptions.buttons.tooltip && R.value.style.chart.tooltip.show,
hasPdf: R.value.userOptions.buttons.pdf,
hasXls: R.value.userOptions.buttons.csv,
hasImg: R.value.userOptions.buttons.img,
hasSvg: R.value.userOptions.buttons.svg,
hasTable: R.value.userOptions.buttons.table,
hasLabel: R.value.userOptions.buttons.labels,
hasFullscreen: R.value.userOptions.buttons.fullscreen,
hasAltCopy: R.value.userOptions.buttons.altCopy,
isTooltip: U.value.showTooltip,
titles: { ...R.value.userOptions.buttonTitles },
chartElement: N.value,
position: R.value.userOptions.position,
hasAnnotator: R.value.userOptions.buttons.annotator,
isAnnotation: Z.value,
callbacks: R.value.userOptions.callbacks,
printScale: R.value.userOptions.print.scale,
tableDialog: R.value.table.useDialog,
hasZoom: R.value.userOptions.buttons.zoom,
isZoom: U.value.showZoom,
isCursorPointer: z.value,
onToggleFullscreen: Ft,
onGeneratePdf: T(yt),
onGenerateCsv: Nt,
onGenerateImage: $t,
onGenerateSvg: Qt,
onToggleTable: It,
onToggleLabels: Lt,
onToggleTooltip: Rt,
onToggleAnnotator: Bt,
onToggleZoom: zt,
onCopyAlt: en,
style: x({ visibility: T(pt) ? T(dt) ? "visible" : "hidden" : "visible" })
}, Ce({ _: 2 }, [
e.$slots.menuIcon ? {
name: "menuIcon",
fn: D(({ isOpen: t, color: n }) => [w(e.$slots, "menuIcon", b(v({
isOpen: t,
color: n
})), void 0, !0)]),
key: "0"
} : void 0,
e.$slots.optionTooltip ? {
name: "optionTooltip",
fn: D(() => [w(e.$slots, "optionTooltip", {}, void 0, !0)]),
key: "1"
} : void 0,
e.$slots.optionPdf ? {
name: "optionPdf",
fn: D(() => [w(e.$slots, "optionPdf", {}, void 0, !0)]),
key: "2"
} : void 0,
e.$slots.optionCsv ? {
name: "optionCsv",
fn: D(() => [w(e.$slots, "optionCsv", {}, void 0, !0)]),
key: "3"
} : void 0,
e.$slots.optionImg ? {
name: "optionImg",
fn: D(() => [w(e.$slots, "optionImg", {}, void 0, !0)]),
key: "4"
} : void 0,
e.$slots.optionSvg ? {
name: "optionSvg",
fn: D(() => [w(e.$slots, "optionSvg", {}, void 0, !0)]),
key: "5"
} : void 0,
e.$slots.optionTable ? {
name: "optionTable",
fn: D(() => [w(e.$slots, "optionTable", {}, void 0, !0)]),
key: "6"
} : void 0,
e.$slots.optionLabels ? {
name: "optionLabels",
fn: D(() => [w(e.$slots, "optionLabels", {}, void 0, !0)]),
key: "7"
} : void 0,
e.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: D(({ toggleFullscreen: t, isFullscreen: n }) => [w(e.$slots, "optionFullscreen", b(v({
toggleFullscreen: t,
isFullscreen: n
})), void 0, !0)]),
key: "8"
} : void 0,
e.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: D(({ toggleAnnotator: t, isAnnotator: n }) => [w(e.$slots, "optionAnnotator", b(v({
toggleAnnotator: t,
isAnnotator: n
})), void 0, !0)]),
key: "9"
} : void 0,
e.$slots.optionZoom ? {
name: "optionZoom",
fn: D(({ toggleZoom: t, isZoomLocked: n }) => [w(e.$slots, "optionZoom", b(v({
toggleZoom: t,
isZoomLocked: n
})), void 0, !0)]),
key: "10"
} : void 0,
e.$slots.optionAltCopy ? {
name: "optionAltCopy",
fn: D(({ altCopy: t }) => [w(e.$slots, "optionAltCopy", b(v({ altCopy: t })), void 0, !0)]),
key: "11"
} : void 0,
e.$slots["custom-menu-before"] ? {
name: "custom-menu-before",
fn: D(() => [w(e.$slots, "custom-menu-before", {}, void 0, !0)]),
key: "12"
} : void 0,
e.$slots["custom-menu-after"] ? {
name: "custom-menu-after",
fn: D(() => [w(e.$slots, "custom-menu-after", {}, void 0, !0)]),
key: "13"
} : void 0
]), 1032, /* @__PURE__ */ "backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasLabel.hasFullscreen.hasAltCopy.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.hasZoom.isZoom.isCursorPointer.onGeneratePdf.style".split("."))) : p("", !0),
(S(), m("svg", {
ref_key: "svgRef",
ref: H,
key: `svg_${ht.value}`,
xmlns: T(l),
viewBox: `${T(Q).x} ${T(Q).y} ${T(Q).width} ${T(Q).height}`,
class: Ee({
"vue-data-ui-fullscreen--on": X.value,
"vue-data-ui-fulscreen--off": !X.value
}),
style: x(`overflow: hidden; background:transparent;color:${R.value.style.chart.color}`)
}, [
g(T(Ye)),
e.$slots["chart-background"] ? (S(), m("foreignObject", {
key: 0,
x: 0,
y: 0,
width: W.value.width <= 0 ? 10 : W.value.width,
height: W.value.height <= 0 ? 10 : W.value.height,
style: { pointerEvents: "none" }
}, [w(e.$slots, "chart-background", {}, void 0, !0)], 8, Re)) : p("", !0),
h("defs", null, [(S(!0), m(Se, null, Oe(Object.keys(Dt.value), (e, t) => (S(), f(_e, {
t: "radial",
id: `gradient_${e}`,
key: `gradient_${e}_${t}`,
cx: "50%",
cy: "30%",
r: "50%",
fx: "50%",
fy: "50%",
stops: [[
"0%",
T(o)(e, .5),
1
], [
"100%",
e,
1
]]
}, null, 8, ["id", "stops"]))), 128))]),
g(T(Xe), {
dataset: G.value,
color: R.value.style.chart.links.stroke,
backgroundColor: R.value.style.chart.backgroundColor,
useChildColor: R.value.style.chart.links.useChildColor
}, null, 8, [
"dataset",
"color",
"backgroundColor",
"useChildColor"
]),
g(T(Qe), {
dataset: G.value,
hoveredUid: J.value,
stroke: R.value.style.chart.nodes.stroke,
strokeHovered: R.value.style.chart.nodes.strokeHovered,
onClick: Gt,
onHover: At
}, {
node: D(({ node: t }) => [w(e.$slots, "node", b(v({ node: t })), void 0, !0)]),
"node-svg": D(({ nodeSvg: t }) => [w(e.$slots, "node-svg", b(v({ nodeSvg: t })), void 0, !0)]),
_: 3
}, 8, [
"dataset",
"hoveredUid",
"stroke",
"strokeHovered"
]),
U.value.showDataLabels && !T(B) ? (S(), f(T(Ze), {
key: 1,
dataset: G.value,
color: R.value.style.chart.color,
hoveredUid: J.value
}, null, 8, [
"dataset",
"color",
"hoveredUid"
])) : p("", !0),
w(e.$slots, "svg", { svg: {
...W.value,
drawingArea: { ...T(Q) },
isPrintingImg: T(_t) || T(vt) || I.value,
isPrintingSvg: L.value
} }, void 0, !0)
], 14, Le)),
e.$slots.watermark ? (S(), m("div", ze, [w(e.$slots, "watermark", b(v({ isPrinting: T(_t) || T(vt) || I.value || L.value })), void 0, !0)])) : p("", !0),
T(Ut) ? (S(), m("div", Be, [w(e.$slots, "reset-action", { reset: T(Ht) }, () => [h("button", {
"data-cy-reset": "",
tabindex: "0",
role: "button",
class: "vue-data-ui-refresh-button",
style: x({
background: R.value.style.chart.backgroundColor,
cursor: z.value ? "pointer" : "default"
}),
onClick: t[0] ||= (e) => T(Ht)(!0)
}, [g(T(We), {
name: "refresh",
stroke: R.value.style.chart.color
}, null, 8, ["stroke"])], 4)], !0)])) : p("", !0),
e.$slots.source ? (S(), m("div", Ve, [w(e.$slots, "source", {}, void 0, !0)], 512)) : p("", !0),
g(T(Ue), {
teleportTo: R.value.style.chart.tooltip.teleportTo,
show: U.value.showTooltip && j.value,
backgroundColor: R.value.style.chart.tooltip.backgroundColor,
color: R.value.style.chart.tooltip.color,
borderRadius: R.value.style.chart.tooltip.borderRadius,
borderColor: R.value.style.chart.tooltip.borderColor,
borderWidth: R.value.style.chart.tooltip.borderWidth,
fontSize: R.value.style.chart.tooltip.fontSize,
backgroundOpacity: R.value.style.chart.tooltip.backgroundOpacity,
position: R.value.style.chart.tooltip.position,
offsetX: R.value.style.chart.tooltip.offsetX,
offsetY: R.value.style.chart.tooltip.offsetY,
parent: N.value,
content: M.value,
isFullscreen: X.value,
isCustom: R.value.style.chart.tooltip.customFormat && typeof R.value.style.chart.tooltip.customFormat == "function",
smooth: R.value.style.chart.tooltip.smooth,
backdropFilter: R.value.style.chart.tooltip.backdropFilter,
smoothForce: R.value.style.chart.tooltip.smoothForce,
smoothSnapThreshold: R.value.style.chart.tooltip.smoothSnapThreshold
}, {
"tooltip-before": D(() => [w(e.$slots, "tooltip-before", b(v({ ...K.value })), void 0, !0)]),
tooltip: D(() => [w(e.$slots, "tooltip", b(v({ ...K.value })), void 0, !0)]),
"tooltip-after": D(() => [w(e.$slots, "tooltip-after", b(v({ ...K.value })), void 0, !0)]),
_: 3
}, 8, [
"teleportTo",
"show",
"backgroundColor",
"color",
"borderRadius",
"borderColor",
"borderWidth",
"fontSize",
"backgroundOpacity",
"position",
"offsetX",
"offsetY",
"parent",
"content",
"isFullscreen",
"isCustom",
"smooth",
"backdropFilter",
"smoothForce",
"smoothSnapThreshold"
]),
it.value && R.value.userOptions.buttons.table ? (S(), f(ke($.value.component), Te({ key: 7 }, $.value.props, {
ref_key: "tableUnit",
ref: P,
onClose: qt
}), Ce({
content: D(() => [(S(), f(T(Ke), {
key: `table_${lt.value}`,
colNames: Y.value.colNames,
head: Y.value.head,
body: Y.value.body,
config: Y.value.config,
title: R.value.table.useDialog ? "" : $.value.title,
withCloseButton: !R.value.table.useDialog,
isCursorPointer: z.value,
onClose: qt
}, {
th: D(({ th: e }) => [h("div", {
innerHTML: e,
style: {
display: "flex",
"align-items": "center"
}
}, null, 8, He)]),
td: D(({ td: e }) => [we(Ae(e.name || e), 1)]),
_: 1
}, 8, [
"colNames",
"head",
"body",
"config",
"title",
"withCloseButton",
"isCursorPointer"
]))]),
_: 2
}, [R.value.table.useDialog ? {
name: "title",
fn: D(() => [we(Ae($.value.title), 1)]),
key: "0"
} : void 0, R.value.table.useDialog ? {
name: "actions",
fn: D(() => [h("button", {
tabindex: "0",
class: "vue-ui-user-options-button",
onClick: t[1] ||= (e) => Nt(R.value.userOptions.callbacks.csv),
style: x({ cursor: z.value ? "pointer" : "default" })
}, [g(T(We), {
name: "fileCsv",
stroke: $.value.props.color
}, null, 8, ["stroke"])], 4)]),
key: "1"
} : void 0]), 1040)) : p("", !0),
w(e.$slots, "skeleton", {}, () => [T(B) ? (S(), f(de, { key: 0 })) : p("", !0)], !0)
], 46, Pe));
}
}, [["__scopeId", "data-v-b2f52ff6"]]);
//#endregion
export { Ne as n, O as t };