vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
827 lines (826 loc) • 29.4 kB
JavaScript
import { toRef as de, resolveComponent as ve, createElementBlock as d, openBlock as s, Fragment as k, renderList as _, createCommentVNode as m, createBlock as R, createElementVNode as V, withModifiers as ze, renderSlot as $, mergeProps as Ce, withCtx as T, toDisplayString as Te, ref as p, onMounted as Le, onUnmounted as He, watchEffect as Be, computed as N, watch as Ge, unref as b, normalizeStyle as ce, normalizeClass as we, createVNode as ae, createSlots as Ve, normalizeProps as B, guardReactiveProps as G, createTextVNode as Xe, nextTick as je } from "vue";
import { u as qe, o as Ye, e as We, c as $e, t as Ze, p as xe, a as Qe, b as Je, X as Ke, l as et, P as tt, q as ot, r as lt, x as st, y as at } from "./index-BaaDnc4F.js";
import { _ as nt } from "./Title-D_MGglyN.js";
import { u as rt, U as it } from "./usePrinter-y4-4tCWT.js";
import { D as ut } from "./DataTable-DvwmNjb-.js";
import { _ as ct } from "./Tooltip-HRgkF8HD.js";
import dt from "./vue-ui-skeleton-6RiQNJSb.js";
import vt from "./vue-ui-accordion-CF9kQTXq.js";
import { u as Pe } from "./useNestedProp-D8vQcOps.js";
import { _ as ht } from "./PackageVersion-D9Lm1C1X.js";
import { P as ft } from "./PenAndPaper-DR58HO_U.js";
import { u as yt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as pt } from "./useChartAccessibility-BWojgys7.js";
import { _ as mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const gt = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick", "onMouseover"], bt = ["x", "y", "height", "width", "onClick", "onMouseover"], kt = {
__name: "RecursiveCircles",
props: {
color: {
type: String,
default: "#000000"
},
dataset: {
type: Array,
default: () => []
},
hoveredUid: {
type: String,
default: null
},
linkColor: {
type: String,
default: "#CCCCCC"
},
stroke: {
type: String,
default: "#FFFFFF"
},
strokeHovered: {
type: String,
default: "#000000"
}
},
emits: ["click", "hover"],
setup(r, { emit: M }) {
const z = r, S = M;
function n(a) {
S("click", a);
}
function C(a) {
S("hover", a);
}
return de(z, "dataset").value.forEach((a) => {
a.nodes && a.nodes.length > 0 && a.nodes.forEach((h) => {
h.ancestor = a;
});
}), (a, h) => {
const H = ve("RecursiveCircles", !0);
return s(!0), d(k, null, _(r.dataset, (i) => (s(), d(k, null, [
i.polygonPath && i.polygonPath.coordinates ? (s(), d(k, { key: 0 }, [
(s(!0), d(k, null, _(i.polygonPath.coordinates, (x, U) => (s(), d(k, null, [
V("circle", {
cx: x.x,
cy: x.y,
r: i.circleRadius,
fill: `url(#gradient_${i.color})`,
stroke: r.hoveredUid && r.hoveredUid === i.uid ? r.strokeHovered : r.stroke,
"stroke-width": r.hoveredUid && r.hoveredUid === i.uid ? i.circleRadius / 6 : i.circleRadius / 12,
style: { cursor: "pointer" },
onClick: (O) => n(i),
onMouseover: (O) => C(i),
onMouseleave: h[0] || (h[0] = (O) => C(null))
}, null, 40, gt),
a.$slots.node ? (s(), d("foreignObject", {
key: 0,
x: x.x - i.circleRadius,
y: x.y - i.circleRadius,
height: i.circleRadius * 2,
width: i.circleRadius * 2,
style: { overflow: "visible" },
onClick: ze((O) => n(i), ["stop"]),
onMouseover: (O) => C(i),
onMouseleave: h[1] || (h[1] = (O) => C(null))
}, [
$(a.$slots, "node", Ce({ ref_for: !0 }, { node: i }))
], 40, bt)) : m("", !0)
], 64))), 256)),
i.nodes && i.nodes.length > 0 ? (s(), R(H, {
key: 0,
dataset: i.nodes,
color: r.color,
stroke: r.stroke,
strokeHovered: r.strokeHovered,
hoveredUid: r.hoveredUid,
onClick: n,
onHover: C
}, {
node: T(({ node: x }) => [
$(a.$slots, "node", Ce({ ref_for: !0 }, { node: x }))
]),
_: 2
}, 1032, ["dataset", "color", "stroke", "strokeHovered", "hoveredUid"])) : m("", !0)
], 64)) : m("", !0)
], 64))), 256);
};
}
}, Ct = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], wt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], $t = {
__name: "RecursiveLinks",
props: {
dataset: {
type: Array,
default: () => []
},
color: {
type: String,
default: "#DDDDDD"
},
backgroundColor: {
type: String,
default: "#FFFFFF"
}
},
setup(r) {
return de(r, "dataset").value.forEach((S) => {
S.nodes && S.nodes.length > 0 && S.nodes.forEach((n) => {
n.ancestor = S;
});
}), (S, n) => {
const C = ve("RecursiveLinks", !0);
return s(), d(k, null, [
(s(!0), d(k, null, _(r.dataset, (c) => (s(), d(k, null, [
c.polygonPath && c.polygonPath.coordinates ? (s(!0), d(k, { key: 0 }, _(c.polygonPath.coordinates, (a, h) => (s(), d(k, null, [
c.ancestor && c.ancestor.polygonPath ? (s(), d(k, { key: 0 }, [
V("line", {
x1: a.x,
y1: a.y,
x2: c.ancestor.polygonPath.coordinates[0].x,
y2: c.ancestor.polygonPath.coordinates[0].y,
stroke: r.backgroundColor,
"stroke-width": c.circleRadius / 1.5
}, null, 8, Ct),
V("line", {
x1: a.x,
y1: a.y,
x2: c.ancestor.polygonPath.coordinates[0].x,
y2: c.ancestor.polygonPath.coordinates[0].y,
stroke: r.color,
"stroke-width": c.circleRadius / 2
}, null, 8, wt)
], 64)) : m("", !0)
], 64))), 256)) : m("", !0)
], 64))), 256)),
(s(!0), d(k, null, _(r.dataset, (c) => (s(), d(k, null, [
c.polygonPath && c.polygonPath.coordinates ? (s(), d(k, { key: 0 }, [
c.nodes && c.nodes.length > 0 ? (s(), R(C, {
key: 0,
dataset: c.nodes,
color: r.color,
backgroundColor: r.backgroundColor
}, null, 8, ["dataset", "color", "backgroundColor"])) : m("", !0)
], 64)) : m("", !0)
], 64))), 256))
], 64);
};
}
}, xt = ["x", "y", "fill", "font-size"], Pt = {
__name: "RecursiveLabels",
props: {
color: {
type: String,
default: "#000000"
},
dataset: {
type: Array,
default: () => []
},
hoveredUid: {
type: String,
default: null
}
},
emits: ["zoom", "hover"],
setup(r, { emit: M }) {
return de(r, "dataset").value.forEach((n) => {
n.nodes && n.nodes.length > 0 && n.nodes.forEach((C) => {
C.ancestor = n;
});
}), (n, C) => {
const c = ve("RecursiveLabels", !0);
return s(!0), d(k, null, _(r.dataset, (a) => (s(), d(k, null, [
a.polygonPath && a.polygonPath.coordinates ? (s(), d(k, { key: 0 }, [
(s(!0), d(k, null, _(a.polygonPath.coordinates, (h) => (s(), d("text", {
x: h.x,
y: h.y + a.circleRadius * 2,
fill: r.color,
"font-size": a.circleRadius,
"text-anchor": "middle",
style: { opacity: "0.8", "pointer-events": "none" }
}, Te(a.name), 9, xt))), 256)),
a.nodes && a.nodes.length > 0 ? (s(), R(c, {
key: 0,
dataset: a.nodes,
color: r.color,
hoveredUid: r.hoveredUid
}, null, 8, ["dataset", "color", "hoveredUid"])) : m("", !0)
], 64)) : m("", !0)
], 64))), 256);
};
}
};
function Tt(r, M = { x: 0, y: 0, width: 100, height: 100 }, z = 1, S) {
const n = p({ ...M }), C = p(1), c = p(!1), a = p({ x: 0, y: 0 });
let h = { x: 0, y: 0 }, H = null, i = null;
function x(o) {
var D;
const v = r.value;
if (!v) return { x: 0, y: 0 };
const g = v.createSVGPoint();
g.x = o.clientX, g.y = o.clientY;
const L = (D = v.getScreenCTM()) == null ? void 0 : D.inverse();
return L ? g.matrixTransform(L) : { x: 0, y: 0 };
}
function U(o) {
c.value = !0;
const v = x(o.touches ? o.touches[0] : o);
a.value = { x: v.x, y: v.y }, h = { x: 0, y: 0 };
}
function O(o) {
if (!c.value) return;
const v = x(o.touches ? o.touches[0] : o);
let g = v.x - a.value.x, L = v.y - a.value.y;
Math.abs(g) < 0.3 && Math.abs(L) < 0.3 || (h.x = g * 0.8 + h.x * 0.2, h.y = L * 0.8 + h.y * 0.2, a.value = v, H || (H = requestAnimationFrame(te)));
}
function te() {
n.value.x -= h.x, n.value.y -= h.y, H = null;
}
function A() {
c.value = !1;
}
function e(o) {
o.preventDefault();
const v = o.deltaY > 0 ? 0.9 : 1.1;
j(v, x(o));
}
function X(o) {
o.preventDefault();
const v = x(o), g = 1.02 * (1 + z / 100);
oe(g, v);
}
function oe(o, v) {
i && cancelAnimationFrame(i);
let g = C.value, L = g * o, D = 0;
const w = () => {
D += 0.02;
let Y = g + (L - g) * le(D);
if (D >= 1) {
C.value = L, i = null;
return;
}
j(Y / g, v), i = requestAnimationFrame(w);
};
w();
}
const le = (o) => o < 0.5 ? 2 * o * o : -1 + (4 - 2 * o) * o;
function j(o, v) {
const g = C.value * o, L = g / C.value, D = n.value.width / L, w = n.value.height / L, Y = (v.x - n.value.x) * (1 - 1 / L), ne = (v.y - n.value.y) * (1 - 1 / L);
n.value.x += Y, n.value.y += ne, n.value.width = D, n.value.height = w, C.value = g;
}
Le(Z), He(q);
function Z() {
const o = r.value;
o && (o.addEventListener("mousedown", U), o.addEventListener("mousemove", O), o.addEventListener("mouseup", A), o.addEventListener("mouseleave", A), o.addEventListener("wheel", e, { passive: !1 }), o.addEventListener("dblclick", X), o.addEventListener("touchstart", (v) => {
v.preventDefault(), U(v);
}, { passive: !1 }), o.addEventListener("touchmove", (v) => {
v.preventDefault(), O(v);
}, { passive: !1 }), o.addEventListener("touchend", A));
}
function q() {
const o = r.value;
o && (o.removeEventListener("mousedown", U), o.removeEventListener("mousemove", O), o.removeEventListener("mouseup", A), o.removeEventListener("mouseleave", A), o.removeEventListener("wheel", e), o.removeEventListener("dblclick", X), o.removeEventListener("touchstart", U), o.removeEventListener("touchmove", O), o.removeEventListener("touchend", A));
}
return Be(() => (S.value ? Z() : q(), () => {
q();
})), { viewBox: n };
}
const Lt = ["id"], Ft = {
key: 1,
ref: "noTitle",
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, Et = {
key: 2,
style: "width:100%;background:transparent;"
}, St = ["xmlns", "viewBox"], Ot = ["width", "height"], Dt = ["id"], Rt = ["stop-color"], Ut = ["stop-color"], At = {
key: 5,
class: "vue-data-ui-watermark"
}, It = {
key: 7,
ref: "source",
dir: "auto"
}, Nt = ["innerHTML"], _t = {
__name: "vue-ui-molecule",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectNode"],
setup(r, { expose: M, emit: z }) {
const { vue_ui_molecule: S } = qe(), n = r, C = z, c = N(() => !!n.dataset && n.dataset.length);
Le(() => {
a();
});
function a() {
Ye(n.dataset) && We({
componentName: "VueUiMolecule",
type: "dataset"
});
}
const h = p($e()), H = p(null), i = p(!1), x = p(""), U = p(null), O = p(0), te = p(0), A = p(0), e = N({
get: () => Z(),
set: (t) => t
}), { userOptionsVisible: X, setUserOptionsVisibility: oe, keepUserOptionState: le } = yt({ config: e.value }), { svgRef: j } = pt({ config: e.value.style.chart.title });
function Z() {
const t = Pe({
userConfig: n.config,
defaultConfig: S
});
return t.theme ? {
...Pe({
userConfig: Qe.vue_ui_molecule[t.theme] || n.config,
defaultConfig: t
}),
customPalette: Ze[t.theme] || xe
} : t;
}
Ge(() => n.config, (t) => {
e.value = Z(), X.value = !e.value.userOptions.showOnChartHover, a(), te.value += 1, A.value += 1, w.value.showTable = e.value.table.show, w.value.showTooltip = e.value.style.chart.tooltip.show;
}, { deep: !0 });
const { isPrinting: q, isImaging: o, generatePdf: v, generateImage: g } = rt({
elementId: `cluster_${h.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-molecule"
}), L = N(() => e.value.userOptions.show && !e.value.style.chart.title.text), D = N(() => Je(e.value.customPalette)), w = p({
showTable: e.value.table.show,
showDataLabels: !0,
showTooltip: e.value.style.chart.tooltip.show
});
function Y(t, u = 0) {
return Array.isArray(t) && t.length > 0 && t[0].nodes ? Y(t[0].nodes, u + 1) : u;
}
function ne() {
const t = Y(n.dataset);
let u = 100, l = u;
for (let f = 0; f < t; f += 1)
u /= 1, l += u;
return {
height: l,
width: l
};
}
const F = p(ne());
p(`0 0 ${F.value.width} ${F.value.height}`);
function he(t, u = { x: -F.value.width / 2.43, y: F.value.height / 2 }, l = F.value.width / 1.1, f = 24, y = 0, P = 0, ue = "#BBBBBB") {
if (t && t.length > 0) {
const _e = tt({
plot: u,
radius: l,
sides: t.length,
rotation: y
});
t.forEach((E, be) => {
const ke = _e.coordinates[be];
let ee;
if (E.ancestor ? E.ancestor.ancestor ? ee = E.ancestor.color || ue : (ee = D.value[P] || xe[P] || ue, P += 1) : ee = ue, E.polygonPath = {
coordinates: [ke]
}, E.circleRadius = f, E.color = ee, E.uid = $e(), E.nodes && E.nodes.length > 0) {
const Me = !E.ancestor || !E.ancestor.ancestor ? P : 0;
E.nodes = he(
E.nodes,
ke,
l / 2.9,
f / 2.2,
y + Math.PI * be / E.nodes.length,
Me,
ee
);
}
});
}
return t;
}
function Fe(t) {
const u = /* @__PURE__ */ new Set();
function l(y) {
y.forEach((P) => {
P.color && !u.has(P.color) && u.add(P.color), P.nodes && P.nodes.length > 0 && l(P.nodes);
});
}
l(t);
const f = {};
return Array.from(u).forEach((y, P) => {
f[y] = `gradient_${P}`;
}), f;
}
const Ee = N(() => Fe(I.value)), I = N(() => he(n.dataset)), re = p(null);
function Se(t) {
re.value = {
datapoint: t,
seriesIndex: -1,
series: I.value,
config: e.value
};
const u = e.value.style.chart.tooltip.customFormat;
if (st(u) && at(() => u({
seriesIndex: -1,
datapoint: t,
series: I.value,
config: e.value
})))
x.value = u({
seriesIndex: -1,
// well, ok
datapoint: t,
series: I.value,
config: e.value
});
else {
let l = "";
l += `<div style="display:flex;align-items:center;gap:3px"><div style="color:${t.color}">⬤</div><div>${t.name}</div></div>`, t.details && (l += `<div style="width:100%;border-top:1px solid ${e.value.style.chart.tooltip.borderColor};margin-top: 2px">${t.details}</div>`), x.value = `<div style="font-family:inherit">${l}</div>`;
}
}
const fe = p(null), Q = p(null);
function Oe(t) {
fe.value = t, t ? (i.value = !0, Se(t), Q.value = t.uid) : (i.value = !1, x.value = "", Q.value = null);
}
function De(t) {
const u = [];
function l(f) {
f.forEach((y) => {
const P = {
name: y.name,
details: y.details || "-",
ancestor: y.ancestor && y.ancestor.name || "-",
color: y.color || ""
};
u.push(P), y.nodes && y.nodes.length > 0 && l(y.nodes, y.name);
});
}
return l(t), u;
}
const Re = N(() => De(I.value)), W = N(() => {
const t = [
e.value.table.translations.nodeName,
e.value.table.translations.details,
e.value.table.translations.ancestor
], u = Re.value.map((y, P) => [
{
color: y.color,
name: y.name
},
y.details,
y.ancestor || ""
]), 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
}, f = [
e.value.table.translations.nodeName,
e.value.table.translations.details,
e.value.table.translations.ancestor
];
return {
head: t,
body: u,
config: l,
colNames: f
};
});
function ye() {
je(() => {
const t = W.value.body.map((f, y) => [[f[0].name], [f[1]], [f[2]]]), u = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[...W.value.head]]].concat(t), l = ot(u);
lt({ csvContent: l, title: e.value.style.chart.title.text || "vue-ui-molecule" });
});
}
function Ue() {
return I.value;
}
const J = p(!1);
function Ae(t) {
J.value = t, O.value += 1;
}
function pe() {
w.value.showTable = !w.value.showTable;
}
function me() {
w.value.showDataLabels = !w.value.showDataLabels;
}
function ge() {
w.value.showTooltip = !w.value.showTooltip;
}
const K = p(!1);
function ie() {
K.value = !K.value;
}
const Ie = N(() => !K.value), { viewBox: se } = Tt(j, {
x: 0,
y: 0,
width: F.value.width <= 0 ? 10 : F.value.width,
height: F.value.height <= 0 ? 10 : F.value.height
}, e.value.style.chart.zoom.speed, Ie);
function Ne(t) {
C("selectNode", t);
}
return M({
getData: Ue,
generatePdf: v,
generateCsv: ye,
generateImage: g,
toggleTable: pe,
toggleLabels: me,
toggleTooltip: ge,
toggleAnnotator: ie
}), (t, u) => (s(), d("div", {
ref_key: "moleculeChart",
ref: U,
class: we(`vue-ui-molecule ${J.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
style: ce(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor}`),
id: `cluster_${h.value}`,
onMouseleave: u[1] || (u[1] = (l) => {
fe.value = null, Q.value = null, b(oe)(!1);
}),
onMouseenter: u[2] || (u[2] = () => b(oe)(!0))
}, [
e.value.userOptions.buttons.annotator ? (s(), R(ft, {
key: 0,
svgRef: b(j),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: K.value,
onClose: ie
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : m("", !0),
L.value ? (s(), d("div", Ft, null, 512)) : m("", !0),
e.value.style.chart.title.text ? (s(), d("div", Et, [
(s(), R(nt, {
key: `title_${te.value}`,
config: {
title: {
cy: "molecule-div-title",
...e.value.style.chart.title
},
subtitle: {
cy: "molecule-div-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
])) : m("", !0),
e.value.userOptions.show && c.value && (b(le) || b(X)) ? (s(), R(it, {
ref_key: "details",
ref: H,
key: `user_options_${O.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: b(q),
isImaging: b(o),
uid: h.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,
hasLabel: e.value.userOptions.buttons.labels,
hasFullscreen: e.value.userOptions.buttons.fullscreen,
isTooltip: w.value.showTooltip,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: U.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: K.value,
onToggleFullscreen: Ae,
onGeneratePdf: b(v),
onGenerateCsv: ye,
onGenerateImage: b(g),
onToggleTable: pe,
onToggleLabels: me,
onToggleTooltip: ge,
onToggleAnnotator: ie,
style: ce({
visibility: b(le) ? b(X) ? "visible" : "hidden" : "visible"
})
}, Ve({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: T(({ isOpen: l, color: f }) => [
$(t.$slots, "menuIcon", B(G({ isOpen: l, color: f })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionTooltip ? {
name: "optionTooltip",
fn: T(() => [
$(t.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: T(() => [
$(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: T(() => [
$(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: T(() => [
$(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: T(() => [
$(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionLabels ? {
name: "optionLabels",
fn: T(() => [
$(t.$slots, "optionLabels", {}, void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: T(({ toggleFullscreen: l, isFullscreen: f }) => [
$(t.$slots, "optionFullscreen", B(G({ toggleFullscreen: l, isFullscreen: f })), void 0, !0)
]),
key: "7"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: T(({ toggleAnnotator: l, isAnnotator: f }) => [
$(t.$slots, "optionAnnotator", B(G({ toggleAnnotator: l, isAnnotator: f })), void 0, !0)
]),
key: "8"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasLabel", "hasFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : m("", !0),
c.value ? (s(), d("svg", {
key: 4,
ref_key: "svgRef",
ref: j,
xmlns: b(Ke),
viewBox: `${b(se).x} ${b(se).y} ${b(se).width} ${b(se).height}`,
class: we({ "vue-data-ui-fullscreen--on": J.value, "vue-data-ui-fulscreen--off": !J.value }),
style: ce(`overflow: hidden; background:transparent;color:${e.value.style.chart.color}`)
}, [
ae(ht),
t.$slots["chart-background"] ? (s(), d("foreignObject", {
key: 0,
x: 0,
y: 0,
width: F.value.width <= 0 ? 10 : F.value.width,
height: F.value.height <= 0 ? 10 : F.value.height,
style: {
pointerEvents: "none"
}
}, [
$(t.$slots, "chart-background", {}, void 0, !0)
], 8, Ot)) : m("", !0),
V("defs", null, [
(s(!0), d(k, null, _(Object.keys(Ee.value), (l) => (s(), d("radialGradient", {
id: `gradient_${l}`,
cx: "50%",
cy: "30%",
r: "50%",
fx: "50%",
fy: "50%"
}, [
V("stop", {
offset: "0%",
"stop-color": b(et)(l, 0.5)
}, null, 8, Rt),
V("stop", {
offset: "100%",
"stop-color": l
}, null, 8, Ut)
], 8, Dt))), 256))
]),
ae($t, {
dataset: I.value,
color: e.value.style.chart.links.stroke,
backgroundColor: e.value.style.chart.backgroundColor
}, null, 8, ["dataset", "color", "backgroundColor"]),
ae(kt, {
dataset: I.value,
hoveredUid: Q.value,
stroke: e.value.style.chart.nodes.stroke,
strokeHovered: e.value.style.chart.nodes.strokeHovered,
onClick: Ne,
onHover: Oe
}, {
node: T(({ node: l }) => [
$(t.$slots, "node", B(G({ node: l })), void 0, !0)
]),
_: 3
}, 8, ["dataset", "hoveredUid", "stroke", "strokeHovered"]),
w.value.showDataLabels ? (s(), R(Pt, {
key: 1,
dataset: I.value,
color: e.value.style.chart.color,
hoveredUid: Q.value
}, null, 8, ["dataset", "color", "hoveredUid"])) : m("", !0),
$(t.$slots, "svg", { svg: F.value }, void 0, !0)
], 14, St)) : m("", !0),
t.$slots.watermark ? (s(), d("div", At, [
$(t.$slots, "watermark", B(G({ isPrinting: b(q) || b(o) })), void 0, !0)
])) : m("", !0),
c.value ? m("", !0) : (s(), R(dt, {
key: 6,
config: {
type: "molecule",
style: {
backgroundColor: e.value.style.chart.backgroundColor,
molecule: {
color: "#CCCCCC"
}
}
}
}, null, 8, ["config"])),
t.$slots.source ? (s(), d("div", It, [
$(t.$slots, "source", {}, void 0, !0)
], 512)) : m("", !0),
ae(ct, {
show: w.value.showTooltip && i.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: U.value,
content: x.value,
isFullscreen: J.value,
isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
}, {
"tooltip-before": T(() => [
$(t.$slots, "tooltip-before", B(G({ ...re.value })), void 0, !0)
]),
"tooltip-after": T(() => [
$(t.$slots, "tooltip-after", B(G({ ...re.value })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
c.value ? (s(), R(vt, {
key: 8,
hideDetails: "",
config: {
open: w.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: T(() => [
(s(), R(ut, {
key: `table_${A.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: u[0] || (u[0] = (l) => w.value.showTable = !1)
}, {
th: T(({ th: l }) => [
V("div", {
innerHTML: l,
style: { display: "flex", "align-items": "center" }
}, null, 8, Nt)
]),
td: T(({ td: l }) => [
Xe(Te(l.name || l), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : m("", !0)
], 46, Lt));
}
}, Kt = /* @__PURE__ */ mt(_t, [["__scopeId", "data-v-c4dc9cf3"]]);
export {
Kt as default
};