UNPKG

vue-data-ui

Version:

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

954 lines (953 loc) 34.3 kB
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js"; import { Bt as t, G as n, Jt as r, Kt as i, Mt as a, O as ee, Pt as te, S as ne, X as o, b as re, f as ie, i as ae, jt as oe, kt as s, pt as se, q as ce, qt as le, t as ue, tt as c, w as de } from "./lib-Bttd6u5E.js"; import { n as fe } from "./useHints-Dq_w2E8B.js"; import { t as pe } from "./useConfig-D3scuR88.js"; import { t as me } from "./usePrinter-DN5bYhTG.js"; import { n as he, t as ge } from "./BaseScanner-DZvpgOjM.js"; import { t as _e } from "./useSvgExport-DH-FfcqQ.js"; import { t as ve } from "./useNestedProp-vPNvh7rV.js"; import { t as ye } from "./useThemeCheck-C43Tcqmk.js"; import { t as be } from "./img-Bnokohej.js"; import { n as xe } from "./Title-BE3qg9xl.js"; import { t as Se } from "./_plugin-vue_export-helper-B3ysoDQm.js"; import { l as Ce, t as we } from "./useResponsive-ZtArZtUf.js"; import { t as Te } from "./DefGrad-DVBqDjhO.js"; import { t as Ee } from "./useUserOptionState-DK-_1ddE.js"; import { t as De } from "./useChartAccessibility-DYqac8yF.js"; import { t as Oe } from "./usePrefersMotion-BC-CsqR1.js"; import { t as ke } from "./useAutoSizeLabelsInsideViewbox-DvDwcwi_.js"; import { t as Ae } from "./vue_ui_gauge-Cf1RZc9q.js"; import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as je, createVNode as Me, defineAsyncComponent as Ne, guardReactiveProps as h, mergeProps as g, nextTick as Pe, normalizeClass as Fe, normalizeProps as _, normalizeStyle as Ie, onBeforeUnmount as Le, onMounted as Re, openBlock as v, ref as y, renderList as b, renderSlot as x, shallowRef as ze, toDisplayString as S, toRefs as Be, unref as C, watch as w, withCtx as T } from "vue"; //#region src/components/vue-ui-gauge.vue var Ve = /* @__PURE__ */ e({ default: () => yt }), He = ["id"], Ue = { key: 0 }, We = ["xmlns", "viewBox"], Ge = ["width", "height"], Ke = ["id"], qe = ["stdDeviation"], Je = { key: 1 }, Ye = [ "d", "fill", "stroke" ], Xe = [ "d", "fill", "stroke" ], Ze = ["d", "fill"], Qe = ["id", "d"], $e = [ "fill", "font-size", "font-weight" ], et = ["href", "startOffset"], tt = [ "text-anchor", "fill", "font-size", "font-weight", "innerHTML" ], nt = ["d", "filter"], rt = ["stroke", "stroke-width"], it = ["stroke", "stroke-width"], at = ["stroke", "stroke-width"], ot = ["stroke", "stroke-width"], st = { key: 8 }, ct = [ "x", "y", "text-anchor", "font-size", "font-weight", "fill" ], lt = [ "x", "y", "font-size", "font-weight", "fill" ], ut = { key: 0 }, dt = [ "x1", "y1", "x2", "y2", "stroke", "stroke-width" ], ft = [ "x1", "y1", "x2", "y2", "stroke", "stroke-width" ], pt = [ "x1", "y1", "x2", "y2", "stroke-width", "filter" ], mt = { key: 1 }, ht = [ "d", "fill", "stroke", "stroke-width" ], gt = [ "cx", "cy", "fill", "r", "stroke-width", "stroke" ], _t = [ "x", "y", "font-size", "fill" ], vt = { key: 4, class: "vue-data-ui-watermark" }, yt = /*#__PURE__*/ Se({ __name: "vue-ui-gauge", props: { config: { type: Object, default() { return {}; } }, dataset: { type: Object, default() { return {}; } } }, emits: ["copyAlt"], setup(e, { expose: Se, emit: Ve }) { let yt = Ne(() => import("./PenAndPaper-DAE-tnEQ.js").then((e) => e.t)), bt = Ne(() => import("./UserOptions-Dt98of5H.js").then((e) => e.n)), xt = Ne(() => import("./PackageVersion-D6d8SCp9.js").then((e) => e.t)), { vue_ui_gauge: St } = pe(), { isThemeValid: Ct, warnInvalidTheme: wt } = ye(), Tt = Oe(), E = e, Et = Ve, Dt = u(() => !!E.dataset && Object.keys(E.dataset).length > 0 && E.dataset.series && E.dataset.series.length), D = y(ce()), Ot = y(null), kt = y(0), O = y(null), At = y(null), jt = y(null), Mt = y(null), Nt = y(null), Pt = y(0), k = y(!1), A = y(!1), j = y(Vt()); fe({ config: () => j.value, dataset: () => E.dataset, component: "VueUiGauge", rules: [{ test: (e) => e?.series && e.series?.length > 6, message: [ "👀 The number of steps is > 6, which can make the chart hard to read and labels overlap. Consider:", "", "▶️ Using broader steps." ] }] }); let Ft = u(() => j.value.userOptions.useCursorPointer), It = u(() => r({ defaultConfig: { userOptions: { show: !1 }, style: { chart: { backgroundColor: "#99999930", animation: { use: !1 }, layout: { markers: { show: !1 }, segmentSeparators: { stroke: "#6A6A6A" }, segmentNames: { show: !1 }, indicatorArc: { fill: "#6A6A6A50" }, pointer: { stroke: "#6A6A6A", useRatingColor: !0, circle: { stroke: "#6A6A6A", color: "#6A6A6A" } } }, legend: { show: !1 } } } }, userConfig: j.value.skeletonConfig ?? {} })), { loading: Lt, FINAL_DATASET: M, manualLoading: N } = he({ ...Be(E), FINAL_CONFIG: j, prepareConfig: Vt, callback: () => { Promise.resolve().then(async () => { await Pe(); }); }, skeletonDataset: E.config?.skeletonDataset ?? { value: 0, series: [{ from: -1, to: 0, name: "_", color: "#A1A1A1" }, { from: 0, to: 1, name: "__", color: "#CACACA" }] }, skeletonConfig: r({ defaultConfig: j.value, userConfig: It.value }) }), { userOptionsVisible: Rt, setUserOptionsVisibility: zt, keepUserOptionState: Bt } = Ee({ config: j.value }), { svgRef: P } = De({ config: j.value.style.chart.title }); w(() => E.config, (e) => { Lt.value || (j.value = Vt()), Rt.value = !j.value.userOptions.showOnChartHover, Qt(), Pt.value += 1; }, { deep: !0 }), w(() => E.dataset, (e) => { Qt(), e && Object.keys(e).length > 0 && (N.value = j.value?.loading ?? !1); }, { deep: !0, immediate: !1 }); function Vt() { let e = ve({ userConfig: E.config, defaultConfig: St }), t = e.theme; if (!t) return e; if (!Ct.value(e)) return wt(e), e; let n = ve({ userConfig: Ae[t] || E.config, defaultConfig: e }), r = ve({ userConfig: E.config, defaultConfig: n }); return { ...r, customPalette: r.customPalette.length ? r.customPalette : i[t] || te }; } let { isPrinting: Ht, isImaging: Ut, generatePdf: Wt, generateImage: Gt } = me({ elementId: `vue-ui-gauge_${D.value}`, fileName: j.value.style.chart.title.text || "vue-ui-gauge", options: j.value.userOptions.print }), Kt = u(() => j.value.userOptions.show && !j.value.style.chart.title.text), qt = u(() => de(j.value.customPalette)), F = u(() => { if (oe(M.value.series || {})) return { value: 0, series: [{ from: 0, to: 0 }] }; let e = []; (M.value.series || []).forEach((t) => { e.push(t.from || 1e-7), e.push(t.to || 1e-7); }); let t = Math.max(...e); return { ...M.value, series: (M.value.series || []).map((e, n) => ({ ...e, color: ne(e.color) || qt.value[n] || te[n], value: ((e.to || 0) - (e.from || 0)) / t * 100 })) }; }), I = y(512), L = y({ height: 358.4, width: I.value, top: 0, bottom: 358.4, centerX: 179.2, centerY: I.value / 2, labelFontSize: 18, legendFontSize: j.value.style.chart.legend.fontSize, pointerRadius: j.value.style.chart.layout.pointer.circle.radius, trackSize: j.value.style.chart.layout.track.size, pointerSize: j.value.style.chart.layout.pointer.size, pointerStrokeWidth: j.value.style.chart.layout.pointer.strokeWidth, markerOffset: j.value.style.chart.layout.markers.offsetY + 3, segmentFontSize: j.value.style.chart.layout.segmentNames.fontSize }), R = y(0), z = y(0), B = u(() => j.value.style.chart.animation.use && !Tt.value), V = y(B.value ? Math.min(...M.value.series.map((e) => e.from)) : M.value.value), H = null; function Jt() { H !== null && (cancelAnimationFrame(H), H = null); } w(B, (e) => { e || (Jt(), V.value = M.value.value); }), w(() => M.value.value, () => { $t(M.value.value); }); let U = u(() => { let e = L.value.width / 2, t = J.value.base, n = Math.PI * ((V.value + 0 - z.value) / (R.value - z.value)) + Math.PI; return { x1: e, y1: t, x2: e + J.value.pointerSize * L.value.pointerSize * .9 * Math.cos(n), y2: t + J.value.pointerSize * L.value.pointerSize * .9 * Math.sin(n) }; }), Yt = u(() => { let e = L.value.width / 2, t = J.value.base, n = Math.PI * ((V.value + 0 - z.value) / (R.value - z.value)) + Math.PI, r = e + J.value.pointerSize * L.value.pointerSize * .9 * Math.cos(n), i = t + J.value.pointerSize * L.value.pointerSize * .9 * Math.sin(n), a = L.value.pointerRadius, ee = e + a * Math.cos(n + Math.PI / 2), te = t + a * Math.sin(n + Math.PI / 2), ne = e + a * Math.cos(n - Math.PI / 2), o = t + a * Math.sin(n - Math.PI / 2); return isNaN(r) ? null : `M ${r},${i} ${ee},${te} ${ne},${o} Z`; }), Xt = u(() => { for (let e = 0; e < F.value.series.length; e += 1) { let { color: t, from: n, to: r } = F.value.series[e]; if (V.value >= n && V.value <= r) return t; } return "#2D353C"; }), W = ze(null), G = ze(null), K = u({ get: () => L.value.segmentFontSize, set: (e) => e }), { autoSizeLabels: Zt } = ke({ svgRef: P, fontSize: L.value.segmentFontSize, minFontSize: j.value.style.chart.layout.segmentNames.minFontSize, sizeRef: K, labelClass: ".vue-ui-gauge-label-flat" }), q = u(() => !!j.value.debug); function Qt() { let e = !1; if (oe(E.dataset) ? (c({ componentName: "VueUiGauge", type: "dataset", debug: q.value }), N.value = !0, e = !0) : (se({ datasetObject: E.dataset, requiredAttributes: ["value", "series"] }).forEach((t) => { c({ componentName: "VueUiGauge", type: "datasetAttribute", property: t, debug: q.value }), N.value = !0, e = !0; }), Object.hasOwn(E.dataset, "series") && (E.dataset.series.length ? E.dataset.series.forEach((t, n) => { se({ datasetObject: t, requiredAttributes: ["from", "to"] }).forEach((t) => { c({ componentName: "VueUiGauge", type: "datasetSerieAttribute", property: t, index: n, debug: q.value }), N.value = !0, e = !0; }); }) : (c({ componentName: "VueUiGauge", type: "datasetAttributeEmpty", property: "series", debug: q.value }), N.value = !0, e = !0))), N.value = e, $t(M.value.value || 0), j.value.responsive) { let e = Ce(() => { let { width: e, height: t } = we({ chart: O.value, title: j.value.style.chart.title.text ? At.value : null, legend: jt.value, source: Mt.value, noTitle: Nt.value }); t -= 12, requestAnimationFrame(() => { L.value.width = e, L.value.height = t, L.value.centerX = e / 2, L.value.centerY = I.value / 2 / 358.4 * t, L.value.bottom = t, L.value.labelFontSize = 18 / I.value * Math.min(t, e) < 10 ? 10 : 18 / I.value * Math.min(t, e), L.value.legendFontSize = j.value.style.chart.legend.fontSize / I.value * Math.min(t, e) < 14 ? 14 : j.value.style.chart.legend.fontSize / I.value * Math.min(t, e), L.value.pointerRadius = j.value.style.chart.layout.pointer.circle.radius / I.value * Math.min(t, e), L.value.trackSize = j.value.style.chart.layout.track.size / I.value * Math.min(t, e), L.value.pointerStrokeWidth = le({ relator: Math.min(e, t), adjuster: I.value, source: j.value.style.chart.layout.pointer.strokeWidth, threshold: 2, fallback: 2 }), L.value.markerOffset = le({ relator: Math.max(e, t), adjuster: I.value, source: j.value.style.chart.layout.markers.offsetY + 3, threshold: 2, fallback: 2 }), L.value.segmentFontSize = le({ relator: Math.min(e, t), adjuster: I.value, source: j.value.style.chart.layout.segmentNames.fontSize, threshold: 8, fallback: 8 }); }), Zt(); }); W.value && (G.value && W.value.unobserve(G.value), W.value.disconnect()), W.value = new ResizeObserver(e), G.value = O.value.parentNode, W.value.observe(G.value); } Zt(); } Re(() => { Qt(); }), Le(() => { Jt(), W.value && (G.value && W.value.unobserve(G.value), W.value.disconnect()); }); function $t(e) { let t = []; if ((F.value.series || []).forEach((e) => { t.push(e.from || 0), t.push(e.to || 0); }), R.value = Math.max(...t), z.value = Math.min(...t), Jt(), !B.value) { V.value = e; return; } let n = j.value.style.chart.animation.speed, r = Math.abs(e - V.value) / (n * 60); function i() { if (!B.value) { V.value = e, H = null; return; } V.value < e ? V.value = Math.min(V.value + r, e) : V.value > e && (V.value = Math.max(V.value - r, e)), H = V.value === e ? null : requestAnimationFrame(i); } i(); } let J = u(() => { let e = j.value.responsive ? Math.min(L.value.width, L.value.height) : L.value.width, t = 2.5 / j.value.style.chart.layout.radiusRatio; return { arcs: e / t, gradients: e / (t * 1.1), base: j.value.responsive ? L.value.height / 1.618 : L.value.height * .7, ratingBase: j.value.responsive ? L.value.height / 2 + L.value.height / 4 : L.value.height * .9, pointerSize: j.value.responsive ? Math.min(L.value.width, L.value.height) / 3 : L.value.width / 3.2 }; }), Y = u(() => s({ series: F.value.series }, L.value.width / 2, J.value.base, J.value.arcs, J.value.arcs, 1, 1, 1, 180, 109.9495, 40 * L.value.trackSize)), en = u(() => s({ series: F.value.series }, L.value.width / 2, J.value.base, J.value.arcs * j.value.style.chart.layout.segmentNames.offsetRatio, J.value.arcs * j.value.style.chart.layout.segmentNames.offsetRatio, 1, 1, 1, 180, 109.9495, 40 * L.value.trackSize)), X = u(() => Y.value.map((e) => J.value.arcs * j.value.style.chart.layout.segmentNames.offsetRatio * (e.nameOffsetRatio || 1))), tn = u(() => { let { x: e, y: t } = a({ initX: Y.value[0].firstSeparator.x, initY: Y.value[0].firstSeparator.y, centerX: U.value.x1, centerY: U.value.y1, offset: -j.value.style.chart.layout.segmentSeparators.offsetIn }), { x: n, y: r } = a({ initX: Y.value[0].startX, initY: Y.value[0].startY, centerX: U.value.x1, centerY: U.value.y1, offset: j.value.style.chart.layout.segmentSeparators.offsetOut }); return { x1: e, y1: t, x2: n, y2: r }; }), nn = u(() => Y.value.map((e) => { let { x: t, y: n } = a({ initX: e.separator.x, initY: e.separator.y, centerX: U.value.x1, centerY: U.value.y1, offset: -j.value.style.chart.layout.segmentSeparators.offsetIn }), { x: r, y: i } = a({ initX: e.endX, initY: e.endY, centerX: U.value.x1, centerY: U.value.y1, offset: j.value.style.chart.layout.segmentSeparators.offsetOut }); return { x1: t, y1: n, x2: r, y2: i }; })); function rn(e) { if (e.reduce((e, t) => e + t, 0) > 100) throw Error("Total % must not exceed 100"); let t = 0; return e.map((e) => (t += e, `${t / 100 * 50 - e / 4}%`)); } let an = u(() => rn(Y.value.map((e) => e.proportion * 100))), on = u(() => s({ series: F.value.series }, L.value.width / 2, J.value.base, J.value.gradients, J.value.gradients, .95, 1, 1, 180, 110.02, 2 * L.value.trackSize)), sn = u(() => { let e = z.value >= 0 ? -z.value : Math.abs(z.value); return ee({ radius: j.value.style.chart.layout.indicatorArc.radius * L.value.trackSize, centerX: L.value.width / 2, centerY: J.value.base, percentage: re((V.value + e) / (R.value + e)) }); }), Z = y(!1); function cn(e) { Z.value = e, kt.value += 1; } let Q = y(!1); function $() { Q.value = !Q.value; } async function ln({ scale: e = 2 } = {}) { if (!O.value) return; let { width: t, height: n } = O.value.getBoundingClientRect(), r = t / n, { imageUri: i, base64: a } = await be({ domElement: O.value, base64: !0, img: !0, scale: e }); return { imageUri: i, base64: a, title: j.value.style.chart.title.text, width: t, height: n, aspectRatio: r }; } let un = u(() => j.value.style.chart.backgroundColor), dn = u(() => j.value.style.chart.title), { exportSvg: fn, getSvg: pn } = _e({ svg: P, title: dn, backgroundColor: un }); async function mn({ isCb: e }) { A.value = !0, await Pe(); try { if (e) { let { blob: e, url: t, text: n, dataUrl: r } = await pn(); await Promise.resolve(j.value.userOptions.callbacks.svg({ blob: e, url: t, text: n, dataUrl: r })); } else await Promise.resolve(fn()); } finally { A.value = !1; } } function hn(e) { if (e?.stage === "start") { k.value = !0; return; } if (e?.stage === "end") { k.value = !1; return; } Gt(); } async function gn() { if (Et("copyAlt", { config: j.value, dataset: F.value }), !j.value.userOptions.callbacks.altCopy) { console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions."); return; } await Promise.resolve(j.value.userOptions.callbacks.altCopy({ config: j.value, dataset: F.value })); } return Se({ getImage: ln, generatePdf: Wt, generateImage: Gt, generateSvg: mn, toggleAnnotator: $, toggleFullscreen: cn, copyAlt: gn }), (e, r) => (v(), p("div", { class: Fe(`vue-data-ui-component vue-ui-gauge ${Z.value ? "vue-data-ui-wrapper-fullscreen" : ""}`), ref_key: "gaugeChart", ref: O, id: `vue-ui-gauge_${D.value}`, style: Ie(`font-family:${j.value.style.fontFamily};width:100%; text-align:center;background:${j.value.style.chart.backgroundColor};${j.value.responsive ? "height: 100%" : ""}`), onMouseenter: r[0] ||= () => C(zt)(!0), onMouseleave: r[1] ||= () => C(zt)(!1) }, [ j.value.userOptions.buttons.annotator ? (v(), d(C(yt), { key: 0, svgRef: C(P), backgroundColor: j.value.style.chart.backgroundColor, color: j.value.style.chart.color, active: Q.value, isCursorPointer: Ft.value, onClose: $ }, { "annotator-action-close": T(() => [x(e.$slots, "annotator-action-close", {}, void 0, !0)]), "annotator-action-color": T(({ color: t }) => [x(e.$slots, "annotator-action-color", _(h({ color: t })), void 0, !0)]), "annotator-action-draw": T(({ mode: t }) => [x(e.$slots, "annotator-action-draw", _(h({ mode: t })), void 0, !0)]), "annotator-action-undo": T(({ disabled: t }) => [x(e.$slots, "annotator-action-undo", _(h({ disabled: t })), void 0, !0)]), "annotator-action-redo": T(({ disabled: t }) => [x(e.$slots, "annotator-action-redo", _(h({ disabled: t })), void 0, !0)]), "annotator-action-delete": T(({ disabled: t }) => [x(e.$slots, "annotator-action-delete", _(h({ disabled: t })), void 0, !0)]), _: 3 }, 8, [ "svgRef", "backgroundColor", "color", "active", "isCursorPointer" ])) : f("", !0), Kt.value ? (v(), p("div", { key: 1, ref_key: "noTitle", ref: Nt, class: "vue-data-ui-no-title-space", style: "height:36px; width: 100%;background:transparent" }, null, 512)) : f("", !0), j.value.style.chart.title.text ? (v(), p("div", { key: 2, ref_key: "chartTitle", ref: At, style: "width:100%;background:transparent;padding-bottom:12px" }, [(v(), d(xe, { key: `title_${Pt.value}`, config: { title: { cy: "gauge-div-title", ...j.value.style.chart.title }, subtitle: { cy: "gauge-div-subtitle", ...j.value.style.chart.title.subtitle } } }, { default: T(() => [j.value.translations.base && C(M).base ? (v(), p("span", Ue, S(j.value.translations.base) + ": " + S(C(M).base), 1)) : f("", !0)]), _: 1 }, 8, ["config"]))], 512)) : f("", !0), j.value.userOptions.show && Dt.value && (C(Bt) || C(Rt)) ? (v(), d(C(bt), { ref_key: "details", ref: Ot, key: `user_options_${kt.value}`, backgroundColor: j.value.style.chart.backgroundColor, color: j.value.style.chart.color, isImaging: C(Ut), isPrinting: C(Ht), uid: D.value, hasXls: !1, hasPdf: j.value.userOptions.buttons.pdf, hasImg: j.value.userOptions.buttons.img, hasSvg: j.value.userOptions.buttons.svg, hasFullscreen: j.value.userOptions.buttons.fullscreen, hasAltCopy: j.value.userOptions.buttons.altCopy, isFullscreen: Z.value, titles: { ...j.value.userOptions.buttonTitles }, chartElement: O.value, callbacks: j.value.userOptions.callbacks, printScale: j.value.userOptions.print.scale, position: j.value.userOptions.position, hasAnnotator: j.value.userOptions.buttons.annotator, isAnnotation: Q.value, isCursorPointer: Ft.value, onToggleFullscreen: cn, onGeneratePdf: C(Wt), onGenerateImage: hn, onGenerateSvg: mn, onToggleAnnotator: $, onCopyAlt: gn, style: Ie({ visibility: C(Bt) ? C(Rt) ? "visible" : "hidden" : "visible" }) }, je({ _: 2 }, [ e.$slots.menuIcon ? { name: "menuIcon", fn: T(({ isOpen: t, color: n }) => [x(e.$slots, "menuIcon", _(h({ isOpen: t, color: n })), void 0, !0)]), key: "0" } : void 0, e.$slots.optionPdf ? { name: "optionPdf", fn: T(() => [x(e.$slots, "optionPdf", {}, void 0, !0)]), key: "1" } : void 0, e.$slots.optionImg ? { name: "optionImg", fn: T(() => [x(e.$slots, "optionImg", {}, void 0, !0)]), key: "2" } : void 0, e.$slots.optionSvg ? { name: "optionSvg", fn: T(() => [x(e.$slots, "optionSvg", {}, void 0, !0)]), key: "3" } : void 0, e.$slots.optionFullscreen ? { name: "optionFullscreen", fn: T(({ toggleFullscreen: t, isFullscreen: n }) => [x(e.$slots, "optionFullscreen", _(h({ toggleFullscreen: t, isFullscreen: n })), void 0, !0)]), key: "4" } : void 0, e.$slots.optionAnnotator ? { name: "optionAnnotator", fn: T(({ toggleAnnotator: t, isAnnotator: n }) => [x(e.$slots, "optionAnnotator", _(h({ toggleAnnotator: t, isAnnotator: n })), void 0, !0)]), key: "5" } : void 0, e.$slots.optionAltCopy ? { name: "optionAltCopy", fn: T(({ altCopy: t }) => [x(e.$slots, "optionAltCopy", _(h({ altCopy: t })), void 0, !0)]), key: "6" } : void 0, e.$slots["custom-menu-before"] ? { name: "custom-menu-before", fn: T(() => [x(e.$slots, "custom-menu-before", {}, void 0, !0)]), key: "7" } : void 0, e.$slots["custom-menu-after"] ? { name: "custom-menu-after", fn: T(() => [x(e.$slots, "custom-menu-after", {}, void 0, !0)]), key: "8" } : void 0 ]), 1032, [ "backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasPdf", "hasImg", "hasSvg", "hasFullscreen", "hasAltCopy", "isFullscreen", "titles", "chartElement", "callbacks", "printScale", "position", "hasAnnotator", "isAnnotation", "isCursorPointer", "onGeneratePdf", "style" ])) : f("", !0), (v(), p("svg", { ref_key: "svgRef", ref: P, xmlns: C(ue), class: Fe({ "vue-data-ui-fullscreen--on": Z.value, "vue-data-ui-fulscreen--off": !Z.value }), viewBox: `0 0 ${L.value.width <= 0 ? 10 : L.value.width} ${L.value.height <= 0 ? 10 : L.value.height}`, style: Ie(`max-width:100%;overflow:hidden !important;background:transparent;color:${j.value.style.chart.color}`) }, [ Me(C(xt)), e.$slots["chart-background"] ? (v(), p("foreignObject", { key: 0, x: 0, y: 0, width: L.value.width <= 0 ? 10 : L.value.width, height: L.value.height <= 0 ? 10 : L.value.height, style: { pointerEvents: "none" } }, [x(e.$slots, "chart-background", {}, void 0, !0)], 8, Ge)) : f("", !0), m("defs", null, [Me(Te, { t: "radial", id: `gradient_${D.value}`, cx: "50%", cy: "50%", r: "50%", fx: "50%", fy: "50%", stops: [ [ "0%", C(t)("#FFFFFF", 1), 1 ], [ "80%", C(t)("#FFFFFF", j.value.style.chart.layout.track.gradientIntensity), 1 ], [ "100%", C(t)("#FFFFFF", 1), 1 ] ] }, null, 8, ["id", "stops"])]), m("defs", null, [m("filter", { id: `blur_${D.value}`, x: "-50%", y: "-50%", width: "200%", height: "200%" }, [m("feGaussianBlur", { in: "SourceGraphic", stdDeviation: 100 / j.value.style.chart.layout.track.gradientIntensity }, null, 8, qe)], 8, Ke)]), e.$slots.pattern ? (v(), p("g", Je, [(v(!0), p(l, null, b(Y.value, (t, n) => (v(), p("defs", null, [x(e.$slots, "pattern", g({ ref_for: !0 }, { seriesIndex: n, patternId: `pattern_${D.value}_${n}` }), void 0, !0)]))), 256))])) : f("", !0), (v(!0), p(l, null, b(Y.value, (e, t) => (v(), p("path", { key: `arc_${t}`, d: e.arcSlice, fill: e.color, stroke: j.value.style.chart.backgroundColor, "stroke-linecap": "round" }, null, 8, Ye))), 128)), e.$slots.pattern ? (v(!0), p(l, { key: 2 }, b(Y.value, (e, t) => (v(), p("path", { key: `arc_${t}`, d: e.arcSlice, fill: `url(#pattern_${D.value}_${t})`, stroke: j.value.style.chart.backgroundColor, "stroke-linecap": "round" }, null, 8, Xe))), 128)) : f("", !0), j.value.style.chart.layout.indicatorArc.show ? (v(), p("path", { key: 3, d: sn.value, fill: j.value.style.chart.layout.indicatorArc.fill }, null, 8, Ze)) : f("", !0), j.value.style.chart.layout.segmentNames.show && j.value.style.chart.layout.segmentNames.curved ? (v(), p(l, { key: 4 }, [(v(!0), p(l, null, b(Y.value, (e, t) => (v(), p("path", { id: `curve_${D.value}_${t}`, d: `M ${U.value.x1},${U.value.y1} m -${X.value[t]},0 a ${X.value[t]},${X.value[t]} 0 1,1 ${2 * X.value[t]},0 a ${X.value[t]},${X.value[t]} 0 1,1 -${2 * X.value[t]},0`, fill: "transparent" }, null, 8, Qe))), 256)), (v(!0), p(l, null, b(Y.value, (e, t) => (v(), p("text", { fill: j.value.style.chart.layout.segmentNames.useSerieColor ? e.color : j.value.style.chart.layout.segmentNames.color, "font-size": K.value, "font-weight": j.value.style.chart.layout.segmentNames.bold ? "bold" : "normal", "text-anchor": "middle" }, [m("textPath", { href: `#curve_${D.value}_${t}`, startOffset: an.value[t] }, S(e.name || ""), 9, et)], 8, $e))), 256))], 64)) : f("", !0), j.value.style.chart.layout.segmentNames.show && !j.value.style.chart.layout.segmentNames.curved ? (v(!0), p(l, { key: 5 }, b(en.value, (e, t) => (v(), p("text", { class: "vue-ui-gauge-label-flat", "text-anchor": C(ie)(e, !1, 12).anchor, fill: j.value.style.chart.layout.segmentNames.useSerieColor ? e.color : j.value.style.chart.layout.segmentNames.color, "font-size": K.value, "font-weight": j.value.style.chart.layout.segmentNames.bold ? "bold" : "normal", innerHTML: C(n)({ content: String(e.name ?? ""), fontSize: K.value, fill: j.value.style.chart.layout.segmentNames.useSerieColor ? e.color : j.value.style.chart.layout.segmentNames.color, x: e.center.endX, y: e.center.endY }) }, null, 8, tt))), 256)) : f("", !0), j.value.style.chart.layout.track.useGradient ? (v(!0), p(l, { key: 6 }, b(on.value, (e, t) => (v(), p("path", { key: `arc_${t}`, d: e.arcSlice, fill: "#FFFFFF", stroke: "none", "stroke-linecap": "round", filter: `url(#blur_${D.value})` }, null, 8, nt))), 128)) : f("", !0), j.value.style.chart.layout.segmentSeparators.show ? (v(), p(l, { key: 7 }, [ m("line", g(tn.value, { stroke: j.value.style.chart.backgroundColor, "stroke-width": j.value.style.chart.layout.segmentSeparators.strokeWidth + 2, "stroke-linecap": "round" }), null, 16, rt), m("line", g(tn.value, { stroke: j.value.style.chart.layout.segmentSeparators.stroke, "stroke-width": j.value.style.chart.layout.segmentSeparators.strokeWidth, "stroke-linecap": "round" }), null, 16, it), (v(!0), p(l, null, b(nn.value, (e) => (v(), p("line", g({ ref_for: !0 }, e, { stroke: j.value.style.chart.backgroundColor, "stroke-width": j.value.style.chart.layout.segmentSeparators.strokeWidth + 2, "stroke-linecap": "round" }), null, 16, at))), 256)), (v(!0), p(l, null, b(nn.value, (e) => (v(), p("line", g({ ref_for: !0 }, e, { stroke: j.value.style.chart.layout.segmentSeparators.stroke, "stroke-width": j.value.style.chart.layout.segmentSeparators.strokeWidth, "stroke-linecap": "round" }), null, 16, ot))), 256)) ], 64)) : f("", !0), j.value.style.chart.layout.markers.show ? (v(), p("g", st, [(v(!0), p(l, null, b(Y.value, (e, t) => (v(), p("text", { x: C(a)({ centerX: U.value.x1, centerY: J.value.base, initX: e.center.startX, initY: e.center.startY, offset: L.value.markerOffset }).x, y: C(a)({ centerX: U.value.x1, centerY: J.value.base, initX: e.center.startX, initY: e.center.startY, offset: L.value.markerOffset }).y, "text-anchor": e.center.startX < U.value.x1 - 5 ? "end" : e.center.startX > U.value.x1 + 5 ? "start" : "middle", "font-size": L.value.labelFontSize * j.value.style.chart.layout.markers.fontSizeRatio, "font-weight": `${j.value.style.chart.layout.markers.bold ? "bold" : "normal"}`, fill: j.value.style.chart.layout.markers.color }, S(C(ae)(j.value.style.chart.layout.markers.formatter, e.from, C(o)({ p: j.value.style.chart.layout.markers.prefix, v: e.from, s: j.value.style.chart.layout.markers.suffix, r: j.value.style.chart.layout.markers.roundingValue }))), 9, ct))), 256))])) : f("", !0), j.value.style.chart.layout.markers.show ? (v(), p("text", { key: 9, x: C(a)({ centerX: L.value.width / 2, centerY: J.value.base, initX: Y.value.at(-1).endX, initY: Y.value.at(-1).endY, offset: L.value.markerOffset }).x, y: C(a)({ centerX: L.value.width / 2, centerY: J.value.base, initX: Y.value.at(-1).endX, initY: Y.value.at(-1).endY, offset: L.value.markerOffset }).y, "text-anchor": "start", "font-size": L.value.labelFontSize * j.value.style.chart.layout.markers.fontSizeRatio, "font-weight": `${j.value.style.chart.layout.markers.bold ? "bold" : "normal"}`, fill: j.value.style.chart.layout.markers.color }, S(C(ae)(j.value.style.chart.layout.markers.formatter, R.value, C(o)({ p: j.value.style.chart.layout.markers.prefix, v: R.value, s: j.value.style.chart.layout.markers.suffix, r: j.value.style.chart.layout.markers.roundingValue }))), 9, lt)) : f("", !0), j.value.style.chart.layout.pointer.show ? (v(), p(l, { key: 10 }, [j.value.style.chart.layout.pointer.type === "rounded" ? (v(), p("g", ut, [ isNaN(U.value.x2) ? f("", !0) : (v(), p("line", { key: 0, x1: U.value.x1, y1: U.value.y1, x2: U.value.x2, y2: U.value.y2, stroke: j.value.style.chart.layout.pointer.stroke, "stroke-width": L.value.pointerStrokeWidth, "stroke-linecap": "round" }, null, 8, dt)), isNaN(U.value.x2) ? f("", !0) : (v(), p("line", { key: 1, x1: U.value.x1, y1: U.value.y1, x2: U.value.x2, y2: U.value.y2, stroke: j.value.style.chart.layout.pointer.useRatingColor ? Xt.value : j.value.style.chart.layout.pointer.color, "stroke-linecap": "round", "stroke-width": L.value.pointerStrokeWidth * .7 }, null, 8, ft)), !isNaN(U.value.x2) && j.value.style.chart.layout.track.useGradient ? (v(), p("line", { key: 2, x1: U.value.x1, y1: U.value.y1, x2: U.value.x2, y2: U.value.y2, stroke: "white", "stroke-linecap": "round", "stroke-width": L.value.pointerStrokeWidth * .3, filter: `url(#blur_${D.value})` }, null, 8, pt)) : f("", !0) ])) : (v(), p("g", mt, [Yt.value ? (v(), p("path", { key: 0, d: Yt.value, fill: j.value.style.chart.layout.pointer.useRatingColor ? Xt.value : j.value.style.chart.layout.pointer.color, stroke: j.value.style.chart.layout.pointer.stroke, "stroke-width": j.value.style.chart.layout.pointer.circle.strokeWidth, "stroke-linejoin": "round" }, null, 8, ht)) : f("", !0)])), m("circle", { cx: L.value.width / 2, cy: J.value.base, fill: j.value.style.chart.layout.pointer.circle.color, r: L.value.pointerRadius <= 0 ? 1e-4 : L.value.pointerRadius, "stroke-width": j.value.style.chart.layout.pointer.circle.strokeWidth, stroke: j.value.style.chart.layout.pointer.circle.stroke }, null, 8, gt)], 64)) : f("", !0), j.value.style.chart.legend.show ? (v(), p("text", { key: 11, x: L.value.width / 2, y: J.value.ratingBase, "text-anchor": "middle", "font-size": L.value.legendFontSize, "font-weight": "bold", fill: j.value.style.chart.legend.useRatingColor ? Xt.value : j.value.style.chart.legend.color }, S(C(ae)(j.value.style.chart.legend.formatter, V.value, C(o)({ p: j.value.style.chart.legend.prefix + (j.value.style.chart.legend.showPlusSymbol && V.value > 0 ? "+" : ""), v: V.value, s: j.value.style.chart.legend.suffix, r: j.value.style.chart.legend.roundingValue }))), 9, _t)) : f("", !0), x(e.$slots, "svg", { svg: { ...L.value, isPrintingImg: C(Ht) || C(Ut) || k.value, isPrintingSvg: A.value } }, void 0, !0) ], 14, We)), e.$slots.watermark ? (v(), p("div", vt, [x(e.$slots, "watermark", _(h({ isPrinting: C(Ht) || C(Ut) || k.value || A.value })), void 0, !0)])) : f("", !0), m("div", { ref_key: "chartLegend", ref: jt }, [x(e.$slots, "legend", { legend: F.value }, void 0, !0)], 512), e.$slots.source ? (v(), p("div", { key: 5, ref_key: "source", ref: Mt, dir: "auto" }, [x(e.$slots, "source", {}, void 0, !0)], 512)) : f("", !0), x(e.$slots, "skeleton", {}, () => [C(Lt) ? (v(), d(ge, { key: 0 })) : f("", !0)], !0) ], 46, He)); } }, [["__scopeId", "data-v-ac56d34e"]]); //#endregion export { Ve as n, yt as t };