vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
674 lines (673 loc) • 27.8 kB
JavaScript
import { useCssVars as at, computed as z, defineAsyncComponent as V, ref as b, watch as Re, shallowRef as Ee, onMounted as ot, onBeforeUnmount as st, watchEffect as nt, createElementBlock as g, openBlock as y, unref as u, normalizeStyle as le, normalizeClass as Me, createBlock as B, createCommentVNode as k, renderSlot as x, createSlots as rt, withCtx as $, normalizeProps as W, guardReactiveProps as X, createVNode as ut, Fragment as ae, renderList as it, createElementVNode as _, mergeProps as Ae, toDisplayString as Y, createTextVNode as ct, nextTick as De } from "vue";
import { u as vt, c as Le, t as de, p as oe, a as dt, o as ht, e as ft, b as yt, d as mt, h as Ve, f as he, X as pt, l as bt, F as Z, ag as gt, q as kt, r as xt, i as Be } from "./index-BLtEpj8j.js";
import { u as He } from "./useNestedProp-Bw1KcAmj.js";
import { u as wt } from "./usePrinter-DnRwTdvS.js";
import { u as Ct } from "./useUserOptionState-BIvW1Kz7.js";
import { u as zt } from "./useChartAccessibility-9icAAmYg.js";
import { t as _t, u as $t } from "./useResponsive-DfdjqQps.js";
import Tt from "./Title-DkG60EPg.js";
import Pt from "./img-D-vWHxhM.js";
import { _ as St } from "./_plugin-vue_export-helper-CHgC5LLL.js";
function Ue(r, i = 0) {
const f = r.reduce((a, { x: n, r: v }) => Math.min(a, n - v - i), 1 / 0), m = r.reduce((a, { x: n, r: v }) => Math.max(a, n + v + i), -1 / 0), c = r.reduce((a, { y: n, r: v }) => Math.min(a, n - v - i), 1 / 0), o = r.reduce((a, { y: n, r: v }) => Math.max(a, n + v + i), -1 / 0);
return [f, c, m - f, o - c];
}
function Ot(r, i, f) {
const m = r._, c = r.next._, o = m.r + c.r, a = (m.x * c.r + c.x * m.r) / o, n = (m.y * c.r + c.y * m.r) / o;
return Math.max(Math.abs(a * f), Math.abs(n * i));
}
function Ge(r, i, f) {
const m = Ot, c = r.length;
if (!c) return r;
let o, a, n;
if (o = r[0], o.x = 0, o.y = 0, !(c > 1) || (a = r[1], o.x = -a.r, a.x = o.r, a.y = 0, !(c > 2))) return r;
je(a, o, n = r[2]), o = new se(o), a = new se(a), n = new se(n), o.next = n.previous = a, a.next = o.previous = n, n.next = a.previous = o;
e: for (let v = 3; v < c; ++v) {
je(o._, a._, n = r[v]), n = new se(n);
let p = a.next, T = o.previous, J = a._.r, N = o._.r;
do
if (J <= N) {
if (qe(p._, n._)) {
a = p, o.next = a, a.previous = o, --v;
continue e;
}
J += p._.r, p = p.next;
} else {
if (qe(T._, n._)) {
o = T, o.next = a, a.previous = o, --v;
continue e;
}
N += T._.r, T = T.previous;
}
while (p !== T.next);
n.previous = o, n.next = a, o.next = a.previous = a = n;
let P = m(o, f, i), w;
for (; (n = n.next) !== a; )
(w = m(n, f, i)) < P && (o = n, P = w);
a = o.next;
}
return r;
}
function je(r, i, f) {
const m = r.x - i.x, c = r.y - i.y, o = m * m + c * c;
if (o) {
const a = (i.r + f.r) ** 2, n = (r.r + f.r) ** 2;
if (a > n) {
const v = (o + n - a) / (2 * o), p = Math.sqrt(Math.max(0, n / o - v * v));
f.x = r.x - v * m - p * c, f.y = r.y - v * c + p * m;
} else {
const v = (o + a - n) / (2 * o), p = Math.sqrt(Math.max(0, a / o - v * v));
f.x = i.x + v * m - p * c, f.y = i.y + v * c + p * m;
}
} else
f.x = i.x + f.r, f.y = i.y;
}
function qe(r, i) {
const f = r.r + i.r - 1e-6, m = i.x - r.x, c = i.y - r.y;
return f > 0 && f * f > m * m + c * c;
}
class se {
constructor(i) {
this._ = i, this.next = null, this.previous = null;
}
}
const It = ["id"], Ft = ["xmlns", "viewBox", "height", "width"], Nt = ["x", "y", "width", "height"], Rt = ["id"], Et = ["stop-color"], Mt = ["stop-color"], At = ["stop-color"], Dt = { key: 0 }, Lt = ["x", "y", "width", "height", "stroke", "stroke-width", "fill", "rx", "onMouseenter", "onClick"], Vt = ["x", "y", "width", "height", "stroke", "stroke-width", "fill", "rx"], Bt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Ht = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Ut = ["cx", "cy", "r", "opacity", "stroke", "stroke-width", "fill"], Gt = {
key: 0,
style: { pointerEvents: "none" }
}, jt = { key: 1 }, qt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Wt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Xt = {
key: 6,
class: "vue-data-ui-watermark"
}, Yt = ["innerHTML"], Zt = {
__name: "vue-ui-circle-pack",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectDatapoint"],
setup(r, { expose: i, emit: f }) {
at((t) => ({
"1096c176": L.value,
"329ac07e": ue.value
}));
const m = V(() => import("./vue-ui-accordion-B6Svdk-2.js")), c = V(() => import("./DataTable-CS_V_Adx.js")), o = V(() => import("./PackageVersion-CnRyWKP-.js")), a = V(() => import("./PenAndPaper-7BWf7zgA.js")), n = V(() => import("./vue-ui-skeleton-CsMU8DwQ.js")), v = V(() => import("./UserOptions-DGw0HvSp.js")), p = r, T = f, { vue_ui_circle_pack: J } = vt(), N = z(() => !!p.dataset && p.dataset.length), P = b(Le()), w = b(null), fe = b(null), ye = b(null), me = b(0), pe = b(0), be = b(0), We = b(null), e = z({
get: () => we(),
set: (t) => t
}), { svgRef: ge } = zt({ config: e.value.style.chart.title }), {
userOptionsVisible: ne,
setUserOptionsVisibility: ke,
keepUserOptionState: xe
} = Ct({ config: e.value });
function we() {
const t = He({
userConfig: p.config,
defaultConfig: J
});
return t.theme ? {
...He({
userConfig: dt.vue_ui_circle_pack[t.theme] || p.config,
defaultConfig: t
}),
customPalette: de[t.theme] || oe
} : t;
}
Re(() => p.config, (t) => {
e.value = we(), ne.value = !e.value.userOptions.showOnChartHover, re(), me.value += 1, pe.value += 1, H.value.showTable = e.value.table.show;
}, { deep: !0 });
const { isPrinting: Ce, isImaging: ze, generatePdf: _e, generateImage: $e } = wt({
elementId: `vue-ui-circle-pack_${P.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-circle-pack",
options: e.value.userOptions.print
}), Xe = z(() => e.value.userOptions.show && !e.value.style.chart.title.text), H = b({
showTable: e.value.table.show
}), S = Ee(null), E = Ee(null), M = b({ h: 10, w: 10 }), Te = b(0), A = b([0, 0, 100, 100]), K = b({ h: 0, w: 0 });
async function re() {
ht(p.dataset) && ft({
componentName: "VueUiCirclePack",
type: "dataset"
}), D.value = await Ge(Q.value), O.value = Ue(D.value, 1).join(" "), K.value = Pe(w.value);
const t = _t(() => {
const { width: s, height: l, heightTitle: h, heightNoTitle: C } = $t({
chart: w.value,
title: fe.value,
noTitle: ye.value
}), R = s || 10, ve = l && l > 10 ? l : 10;
Te.value = e.value.style.chart.title.text ? h : C, requestAnimationFrame(() => {
M.value.w = R, M.value.h = ve - Te.value, De(async () => {
const tt = Q.value.map((lt) => ({ ...lt }));
D.value = await Ge(tt, M.value.h, M.value.w), A.value = Ue(D.value, 1), O.value = A.value.join(" "), K.value = Pe(w.value);
});
});
});
S.value && (E.value && S.value.unobserve(E.value), S.value.disconnect()), S.value = new ResizeObserver(t), E.value = w.value.parentNode, S.value.observe(E.value);
}
ot(re), st(() => {
S.value && (E.value && S.value.unobserve(E.value), S.value.disconnect());
});
function Pe(t) {
if (!t || !t.parentElement)
return console.warn("Component or parent element is missing."), { w: 0, h: 0 };
const s = t.parentElement;
if (s.offsetWidth > 0 && s.offsetHeight > 0)
return { w: s.offsetWidth, h: s.offsetHeight };
const l = window.getComputedStyle(s), h = l.width, C = l.height;
return h !== "auto" && C !== "auto" && parseFloat(h) > 0 && parseFloat(C) > 0 ? { w: parseFloat(h), h: parseFloat(C) } : { w: 0, h: 0 };
}
Re(() => p.dataset, async (t) => {
await re();
}, { deep: !0 });
const Ye = z(() => yt(e.value.customPalette)), Q = z(() => p.dataset.map((t, s) => {
const l = mt(t.color) || Ye.value[s] || de[e.value.theme || "default"][s % de[e.value.theme || "default"].length] || oe[s] || oe[s % oe.length];
return {
...t,
r: t.value,
id: Le(),
color: l
};
}).filter((t) => ![null, void 0, 1 / 0, -1 / 0].includes(t.value))), D = b([]), O = b("0 0 100 100"), U = z(() => Math.max(...D.value.map((t) => t.r)));
function Se(t, s) {
return s / U.value * t;
}
const d = b(null);
function Ze(t) {
e.value.style.chart.circles.zoom.show && (d.value = t);
}
const L = z(() => d.value ? d.value.r : 0), ue = z(() => F.value ? L.value : d.value ? d.value.r > A.value[3] / 6 * e.value.style.chart.circles.zoom.zoomRatio ? d.value.r : A.value[3] / 6 * e.value.style.chart.circles.zoom.zoomRatio : 0), I = b(0), Je = z(() => ({
pointerEvents: "none",
opacity: I.value,
filter: `drop-shadow(0px 0px 6px ${Ve(d.value.color, e.value.style.chart.circles.zoom.shadowForce)})`
})), G = b(L.value);
nt(() => {
G.value = L.value, I.value = 0;
let t = null;
function s(l) {
t || (t = l);
const h = (l - t) / e.value.style.chart.circles.zoom.animationFrameMs;
h < 1 ? (G.value = L.value + (ue.value - L.value) * h, I.value = 0 + e.value.style.chart.circles.zoom.opacity * h, requestAnimationFrame(s)) : (G.value = ue.value, I.value = e.value.style.chart.circles.zoom.opacity);
}
requestAnimationFrame(s);
});
const j = z(() => ({
name: e.value.style.chart.circles.zoom.label.name.fontSize * A.value[3] / 300,
value: e.value.style.chart.circles.zoom.label.value.fontSize * A.value[3] / 300
}));
function ie(t) {
return Be(
e.value.style.chart.circles.labels.value.formatter,
t.value,
he({
p: e.value.style.chart.circles.labels.value.prefix,
v: t.value,
s: e.value.style.chart.circles.labels.value.suffix,
r: e.value.style.chart.circles.labels.value.rounding
})
);
}
function Ke() {
return Be(
e.value.style.chart.circles.zoom.label.value.formatter,
d.value.value,
he({
p: e.value.style.chart.circles.zoom.label.value.prefix,
v: d.value.value,
s: e.value.style.chart.circles.zoom.label.value.suffix,
r: e.value.style.chart.circles.zoom.label.value.rounding
})
);
}
function Oe(t) {
if (!t)
return 0;
const s = t.r / ie(t).length * (ie(t).length === 1 ? 1 : 2);
return Math.min(t.r / 2.5, s);
}
const q = b(!1);
function Ie(t) {
q.value = t, be.value += 1;
}
const F = b(!1);
function ce() {
F.value = !F.value;
}
const ee = z(() => {
const t = Q.value.map((l) => ({
name: l.name,
value: l.value,
color: l.color
})).toSorted((l, h) => h.value - l.value), s = t.map((l) => l.value);
return { head: t, body: s };
});
function Fe(t = null) {
De(() => {
const s = ee.value.head.map((C, R) => [[
C.name
], [ee.value.body[R]]]), l = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(s), h = kt(l);
t ? t(h) : xt({ csvContent: h, title: e.value.style.chart.title.text || "vue-ui-circle-pack" });
});
}
const te = z(() => {
const t = [
e.value.table.columnNames.datapoint,
e.value.table.columnNames.value
], s = ee.value.head.map((C, R) => {
const ve = he({
p: e.value.style.chart.circles.labels.value.prefix,
v: ee.value.body[R],
s: e.value.style.chart.circles.labels.value.suffix,
r: e.value.style.chart.circles.labels.value.rounding
});
return [
{
color: C.color,
name: C.name
},
ve
];
}), l = {
th: {
backgroundColor: e.value.table.th.backgroundColor,
color: e.value.table.th.color,
outline: e.value.table.th.outline
},
td: {
backgroundColor: e.value.table.td.backgroundColor,
color: e.value.table.td.color,
outline: e.value.table.td.outline
},
breakpoint: e.value.table.responsiveBreakpoint
};
return {
colNames: [
e.value.table.columnNames.datapoint,
e.value.table.columnNames.value
],
head: t,
body: s,
config: l
};
});
function Ne() {
H.value.showTable = !H.value.showTable;
}
function Qe() {
return Q.value;
}
async function et({ scale: t = 2 } = {}) {
if (!w.value) return;
const { width: s, height: l } = w.value.getBoundingClientRect(), h = s / l, { imageUri: C, base64: R } = await Pt({ domElement: w.value, base64: !0, img: !0, scale: t });
return {
imageUri: C,
base64: R,
title: e.value.style.chart.title.text,
width: s,
height: l,
aspectRatio: h
};
}
return i({
getData: Qe,
getImage: et,
generateCsv: Fe,
generatePdf: _e,
generateImage: $e,
toggleTable: Ne,
toggleAnnotator: ce,
toggleFullscreen: Ie
}), (t, s) => (y(), g("div", {
id: `vue-ui-circle-pack_${P.value}`,
class: Me(`vue-ui-circle-pack ${q.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
ref_key: "circlePackChart",
ref: w,
style: le(`font-family:${e.value.style.fontFamily};text-align:center;background:${e.value.style.chart.backgroundColor}; height: ${K.value.h}px; width:${K.value.w}px`),
onMouseenter: s[2] || (s[2] = () => u(ke)(!0)),
onMouseleave: s[3] || (s[3] = () => u(ke)(!1))
}, [
e.value.userOptions.buttons.annotator ? (y(), B(u(a), {
key: 0,
svgRef: u(ge),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: F.value,
scale: U.value / 100,
onClose: ce
}, null, 8, ["svgRef", "backgroundColor", "color", "active", "scale"])) : k("", !0),
x(t.$slots, "userConfig", {}, void 0, !0),
Xe.value ? (y(), g("div", {
key: 1,
ref_key: "noTitle",
ref: ye,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : k("", !0),
e.value.style.chart.title.text ? (y(), g("div", {
key: 2,
ref_key: "chartTitle",
ref: fe,
style: "width:100%;background:transparent;padding-bottom:12px"
}, [
(y(), B(Tt, {
key: `title_${me.value}`,
config: {
title: {
cy: "donut-div-title",
...e.value.style.chart.title
},
subtitle: {
cy: "donut-div-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 512)) : k("", !0),
e.value.userOptions.show && N.value && (u(xe) || u(ne)) ? (y(), B(u(v), {
ref: "details",
key: `user_option_${be.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: u(Ce),
isImaging: u(ze),
uid: P.value,
hasTooltip: !1,
hasLabel: !1,
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: q.value,
chartElement: w.value,
position: e.value.userOptions.position,
callbacks: e.value.userOptions.callbacks,
printScale: e.value.userOptions.print.scale,
titles: { ...e.value.userOptions.buttonTitles },
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: F.value,
onToggleFullscreen: Ie,
onGeneratePdf: u(_e),
onGenerateCsv: Fe,
onGenerateImage: u($e),
onToggleTable: Ne,
onToggleAnnotator: ce,
style: le({
visibility: u(xe) ? u(ne) ? "visible" : "hidden" : "visible"
})
}, rt({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: $(({ isOpen: l, color: h }) => [
x(t.$slots, "menuIcon", W(X({ isOpen: l, color: h })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: $(() => [
x(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: $(() => [
x(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: $(() => [
x(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: $(() => [
x(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: $(({ toggleFullscreen: l, isFullscreen: h }) => [
x(t.$slots, "optionFullscreen", W(X({ toggleFullscreen: l, isFullscreen: h })), void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: $(({ toggleAnnotator: l, isAnnotator: h }) => [
x(t.$slots, "optionAnnotator", W(X({ toggleAnnotator: l, isAnnotator: h })), void 0, !0)
]),
key: "6"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "chartElement", "position", "callbacks", "printScale", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : k("", !0),
N.value ? (y(), g("svg", {
key: 4,
ref_key: "svgRef",
ref: ge,
xmlns: u(pt),
viewBox: O.value,
height: M.value.h,
width: M.value.w,
class: Me({ "vue-data-ui-fullscreen--on": q.value, "vue-data-ui-fulscreen--off": !q.value }),
style: le(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color};background:${e.value.style.chart.backgroundColor};`)
}, [
ut(u(o)),
t.$slots["chart-background"] ? (y(), g("foreignObject", {
key: 0,
x: O.value.x,
y: O.value.y,
width: O.value.width,
height: O.value.height,
style: {
pointerEvents: "none"
}
}, [
x(t.$slots, "chart-background", {}, void 0, !0)
], 8, Nt)) : k("", !0),
(y(!0), g(ae, null, it(D.value, (l) => (y(), g(ae, null, [
_("defs", null, [
_("radialGradient", {
id: l.id,
fy: "30%"
}, [
_("stop", {
offset: "10%",
"stop-color": u(bt)(l.color, e.value.style.chart.circles.gradient.intensity / 100)
}, null, 8, Et),
_("stop", {
offset: "90%",
"stop-color": u(Ve)(l.color, 0.1)
}, null, 8, Mt),
_("stop", {
offset: "100%",
"stop-color": l.color
}, null, 8, At)
], 8, Rt)
]),
t.$slots.pattern ? (y(), g("g", Dt, [
_("defs", null, [
x(t.$slots, "pattern", Ae({ ref_for: !0 }, { ...l, patternId: `pattern_${P.value}_${l.id}` }), void 0, !0)
])
])) : k("", !0),
_("rect", {
x: l.x - l.r,
y: l.y - l.r,
width: l.r * 2,
height: l.r * 2,
stroke: e.value.style.chart.circles.stroke,
"stroke-width": e.value.style.chart.circles.strokeWidth * U.value / 100,
fill: e.value.style.chart.circles.gradient.show ? `url(#${l.id})` : l.color,
rx: l.r,
onMouseenter: () => Ze(l),
onMouseout: s[0] || (s[0] = (h) => d.value = null),
onClick: (h) => T("selectDatapoint", l)
}, null, 40, Lt),
t.$slots.pattern ? (y(), g("rect", {
key: 1,
x: l.x - l.r,
y: l.y - l.r,
width: l.r * 2,
height: l.r * 2,
stroke: e.value.style.chart.circles.stroke,
"stroke-width": e.value.style.chart.circles.strokeWidth * U.value / 100,
fill: `url(#pattern_${P.value}_${l.id})`,
rx: l.r,
style: {
pointerEvents: "none"
}
}, null, 8, Vt)) : k("", !0),
t.$slots["data-label"] ? x(t.$slots, "data-label", Ae({
key: 2,
ref_for: !0
}, { ...l, createTSpans: u(gt), fontSize: { name: l.r / 3 * e.value.style.chart.circles.labels.name.fontSizeRatio, value: Oe(l) * e.value.style.chart.circles.labels.value.fontSizeRatio }, color: e.value.style.chart.circles.labels.name.color ? e.value.style.chart.circles.labels.name.color : u(Z)(l.color) }), void 0, !0) : (y(), g(ae, { key: 3 }, [
e.value.style.chart.circles.labels.name.show && l.name ? (y(), g("text", {
key: 0,
style: {
pointerEvents: "none",
transition: "opacity 0.2s ease-in-out"
},
opacity: d.value && !F.value ? 0.2 : 1,
x: l.x,
y: l.y + Se(l.r, e.value.style.chart.circles.labels.name.offsetY) - l.r / 10,
"font-size": l.r / 3 * e.value.style.chart.circles.labels.name.fontSizeRatio,
fill: e.value.style.chart.circles.labels.name.color ? e.value.style.chart.circles.labels.name.color : u(Z)(l.color),
"font-weight": e.value.style.chart.circles.labels.name.bold ? "bold" : "normal",
"text-anchor": "middle"
}, Y(l.name), 9, Bt)) : k("", !0),
e.value.style.chart.circles.labels.value.show ? (y(), g("text", {
key: 1,
style: {
pointerEvents: "none",
transition: "opacity 0.2s ease-in-out"
},
opacity: d.value && !F.value ? 0.2 : 1,
x: l.x,
y: l.y + Se(l.r, e.value.style.chart.circles.labels.value.offsetY) + l.r / 2.5,
"font-size": Oe(l) * e.value.style.chart.circles.labels.value.fontSizeRatio,
fill: e.value.style.chart.circles.labels.value.color ? e.value.style.chart.circles.labels.value.color : u(Z)(l.color),
"font-weight": e.value.style.chart.circles.labels.value.bold ? "bold" : "normal",
"text-anchor": "middle"
}, Y(ie(l)), 9, Ht)) : k("", !0)
], 64))
], 64))), 256)),
d.value && e.value.style.chart.circles.zoom.show && !F.value ? (y(), g(ae, { key: 1 }, [
_("circle", {
style: le(Je.value),
cx: d.value.x,
cy: d.value.y,
r: G.value,
opacity: I.value,
stroke: e.value.style.chart.circles.stroke,
"stroke-width": e.value.style.chart.circles.strokeWidth * U.value / 100,
fill: e.value.style.chart.circles.gradient.show ? `url(#${d.value.id})` : d.value.color
}, null, 12, Ut),
t.$slots["zoom-label"] ? (y(), g("g", Gt, [
x(t.$slots, "zoom-label", W(X({ ...d.value, zoomOpacity: I.value, currentRadius: G.value, fontSize: j.value })), void 0, !0)
])) : (y(), g("g", jt, [
_("text", {
style: {
pointerEvents: "none"
},
opacity: I.value,
x: d.value.x,
y: d.value.y + e.value.style.chart.circles.zoom.label.name.offsetY - j.value.name / 4,
"text-anchor": "middle",
"font-size": j.value.name,
fill: e.value.style.chart.circles.zoom.label.name.color ? e.value.style.chart.circles.zoom.label.name.color : u(Z)(d.value.color),
"font-weight": e.value.style.chart.circles.zoom.label.name.bold ? "bold" : "normal"
}, Y(d.value.name), 9, qt),
_("text", {
style: {
pointerEvents: "none"
},
opacity: I.value,
x: d.value.x,
y: d.value.y + j.value.value + e.value.style.chart.circles.zoom.label.value.offsetY,
"text-anchor": "middle",
"font-size": j.value.value,
fill: e.value.style.chart.circles.zoom.label.value.color ? e.value.style.chart.circles.zoom.label.value.color : u(Z)(d.value.color),
"font-weight": e.value.style.chart.circles.zoom.label.value.bold ? "bold" : "normal"
}, Y(Ke()), 9, Wt)
]))
], 64)) : k("", !0),
x(t.$slots, "svg", {
svg: { ...O.value }
}, void 0, !0)
], 14, Ft)) : k("", !0),
N.value ? k("", !0) : (y(), B(u(n), {
key: 5,
config: {
type: "circlePack",
style: {
color: "#CCCCCC"
}
}
})),
t.$slots.watermark ? (y(), g("div", Xt, [
x(t.$slots, "watermark", W(X({ isPrinting: u(Ce) || u(ze) })), void 0, !0)
])) : k("", !0),
t.$slots.source ? (y(), g("div", {
key: 7,
ref_key: "source",
ref: We,
dir: "auto"
}, [
x(t.$slots, "source", {}, void 0, !0)
], 512)) : k("", !0),
N.value ? (y(), B(u(m), {
key: 8,
hideDetails: "",
config: {
open: H.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: $(() => [
(y(), B(u(c), {
key: `table_${pe.value}`,
colNames: te.value.colNames,
head: te.value.head,
body: te.value.body,
config: te.value.config,
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
onClose: s[1] || (s[1] = (l) => H.value.showTable = !1)
}, {
th: $(({ th: l }) => [
_("div", {
innerHTML: l,
style: { display: "flex", "align-items": "center" }
}, null, 8, Yt)
]),
td: $(({ td: l }) => [
ct(Y(l.name || l), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : k("", !0)
], 46, It));
}
}, rl = /* @__PURE__ */ St(Zt, [["__scopeId", "data-v-49649767"]]);
export {
rl as default
};