UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

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