UNPKG

vue-data-ui

Version:

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

865 lines (864 loc) • 38.3 kB
import { defineAsyncComponent as K, computed as d, ref as y, toRefs as vt, watch as Q, shallowRef as $e, onMounted as dt, onBeforeUnmount as ht, createElementBlock as n, openBlock as r, unref as u, normalizeStyle as ee, normalizeClass as Fe, createBlock as W, createCommentVNode as c, createElementVNode as k, withCtx as b, renderSlot as h, normalizeProps as $, guardReactiveProps as F, toDisplayString as Y, createSlots as ft, createVNode as yt, Fragment as C, renderList as x, mergeProps as D, nextTick as gt } from "vue"; import { c as mt, t as pt, i as kt, j as ze, k as bt, o as Oe, m as Ct, g as U, l as Me, a3 as te, ac as M, ad as _t, U as St, X as wt, s as ae, $ as At, a6 as xt, a as oe, d as le, a2 as re } from "./lib-BwysEpWI.js"; import { t as $t, u as Ft } from "./useResponsive-DfdjqQps.js"; import { u as zt, B as Ot } from "./BaseScanner-BMpwQAfz.js"; import { u as Mt } from "./usePrinter-BJzHDpYF.js"; import { u as Nt, a as se } from "./useNestedProp-OFRiX4kU.js"; import { u as Pt } from "./useSvgExport-ByUukOZt.js"; import { u as It } from "./useThemeCheck-DGJ31Vi5.js"; import { u as Xt } from "./useUserOptionState-BIvW1Kz7.js"; import { u as Et } from "./useChartAccessibility-9icAAmYg.js"; import { u as Rt } from "./useAutoSizeLabelsInsideViewbox-DO2dxQ78.js"; import Yt from "./img-DKigoPDs.js"; import Bt from "./Title-DGnfNZuO.js"; import { _ as Dt } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const Ne = { style: { chart: { backgroundColor: "#1A1A1A", color: "#CCCCCC", layout: { markers: { color: "#CCCCCC" }, pointer: { stroke: "#1A1A1A", circle: { stroke: "#1A1A1A", color: "#5A5A5A" } } }, title: { color: "#CCCCCC", subtitle: { color: "#757575" } } } } }, Pe = { style: { chart: { backgroundColor: "#FFF8E1", color: "#424242", layout: { track: { useGradient: !1 }, markers: { color: "#5D4037" }, pointer: { type: "pointy", stroke: "#FFF8E1", circle: { stroke: "#FFF8E1", strokeWidth: 1, color: "#5D4037" } } }, title: { color: "#424242", subtitle: { color: "#757575" } } } } }, Ie = { style: { chart: { backgroundColor: "#1E1E1E", color: "#BDBDBD", layout: { track: { useGradient: !1 }, markers: { color: "#BDBDBD" }, pointer: { type: "pointy", stroke: "#1E1E1E", circle: { stroke: "#1E1E1E", strokeWidth: 1, color: "#5D4037" } } }, title: { color: "#FFF8E1", subtitle: { color: "#BDBDBD" } } } } }, Xe = { style: { chart: { backgroundColor: "#1A1A1A", color: "#99AA99", layout: { track: { useGradient: !1 }, markers: { color: "#99CC99", backgroundColor: "#1A1A1A", stroke: "#66CC66" }, pointer: { type: "pointy", stroke: "#1A1A1A", circle: { stroke: "#66CC66", strokeWidth: 1, color: "#1A1A1A" } } }, title: { color: "#66CC66", subtitle: { color: "#99AA99" } } } } }, Ee = { style: { chart: { backgroundColor: "#fbfafa", color: "#8A9892", layout: { track: { useGradient: !1 }, markers: { color: "#A0AC94", backgroundColor: "#fbfafa", stroke: "#EBD6CC" }, pointer: { type: "rounded", stroke: "#fbfafa", circle: { stroke: "#EBD6CC", strokeWidth: 1, color: "#fbfafa" } } }, title: { color: "#8A9892", subtitle: { color: "#99AA99" } } } } }, Re = { style: { chart: { backgroundColor: "#f6f6fb", color: "#50606C", layout: { track: { useGradient: !1 }, markers: { color: "#4F5B75", backgroundColor: "#4F5B75", stroke: "#9FA9BE" }, pointer: { type: "pointy", stroke: "#f6f6fb", circle: { stroke: "#f6f6fb", strokeWidth: 1, color: "#4F5B75" } } }, title: { color: "#66CC66", subtitle: { color: "#99AA99" } } } } }, Ye = { default: {}, dark: Ne, celebration: Pe, celebrationNight: Ie, hack: Xe, zen: Ee, concrete: Re }, Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, celebration: Pe, celebrationNight: Ie, concrete: Re, dark: Ne, default: Ye, hack: Xe, zen: Ee }, Symbol.toStringTag, { value: "Module" })), Tt = ["id"], Gt = { key: 0 }, Lt = ["xmlns", "viewBox"], jt = ["width", "height"], Wt = ["id"], Ut = ["stop-color"], Vt = ["stop-color"], Ht = ["stop-color"], qt = ["id"], Zt = ["stdDeviation"], Jt = { key: 1 }, Kt = ["d", "fill", "stroke"], Qt = ["d", "fill", "stroke"], ea = ["d", "fill"], ta = ["id", "d"], aa = ["fill", "font-size", "font-weight"], oa = ["href", "startOffset"], la = ["text-anchor", "fill", "font-size", "font-weight", "innerHTML"], ra = ["d", "filter"], sa = ["stroke", "stroke-width"], na = ["stroke", "stroke-width"], ua = ["stroke", "stroke-width"], ia = ["stroke", "stroke-width"], ca = { key: 8 }, va = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], da = ["x", "y", "font-size", "font-weight", "fill"], ha = { key: 0 }, fa = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], ya = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], ga = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], ma = { key: 1 }, pa = ["d", "fill", "stroke", "stroke-width"], ka = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], ba = ["x", "y", "font-size", "fill"], Ca = { key: 4, class: "vue-data-ui-watermark" }, _a = { __name: "vue-ui-gauge", props: { config: { type: Object, default() { return {}; } }, dataset: { type: Object, default() { return {}; } } }, setup(Be, { expose: De }) { const Te = K(() => import("./PenAndPaper-DxIUvoQ8.js")), Ge = K(() => import("./UserOptions-CzJWRC4s.js")), Le = K(() => import("./PackageVersion-BLzm8l_I.js")), { vue_ui_gauge: je } = Nt(), { isThemeValid: We, warnInvalidTheme: Ue } = It(), m = Be, Ve = d(() => !!m.dataset && Object.keys(m.dataset).length > 0 && m.dataset.series && m.dataset.series.length), w = y(mt()), He = y(null), ne = y(0), N = y(null), ue = y(null), ie = y(null), ce = y(null), ve = y(null), de = y(0), e = y(H()), { loading: he, FINAL_DATASET: A, manualLoading: X } = zt({ ...vt(m), FINAL_CONFIG: e, prepareConfig: H, callback: () => { Promise.resolve().then(async () => { await gt(); }); }, skeletonDataset: { value: 0, series: [ { from: -1, to: 0, name: "_", color: "#A1A1A1" }, { from: 0, to: 1, name: "__", color: "#CACACA" } ] }, skeletonConfig: pt({ defaultConfig: e.value, userConfig: { 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 } } } } }) }), { userOptionsVisible: V, setUserOptionsVisibility: fe, keepUserOptionState: ye } = Xt({ config: e.value }), { svgRef: T } = Et({ config: e.value.style.chart.title }); Q(() => m.config, (t) => { he.value || (e.value = H()), V.value = !e.value.userOptions.showOnChartHover, Z(), de.value += 1; }, { deep: !0 }), Q(() => m.dataset, (t) => { Z(), t && Object.keys(t).length > 0 && (X.value = e.value?.loading ?? !1); }, { deep: !0, immediate: !1 }); function H() { const t = se({ userConfig: m.config, defaultConfig: je }), s = t.theme; if (!s) return t; if (!We.value(t)) return Ue(t), t; const a = se({ userConfig: Ye[s] || m.config, defaultConfig: t }), o = se({ userConfig: m.config, defaultConfig: a }); return { ...o, customPalette: o.customPalette.length ? o.customPalette : kt[s] || ze }; } const { isPrinting: ge, isImaging: me, generatePdf: pe, generateImage: ke } = Mt({ elementId: `vue-ui-gauge_${w.value}`, fileName: e.value.style.chart.title.text || "vue-ui-gauge", options: e.value.userOptions.print }), qe = d(() => e.value.userOptions.show && !e.value.style.chart.title.text), Ze = d(() => bt(e.value.customPalette)), P = d(() => { if (Oe(A.value.series || {})) return { value: 0, series: [ { from: 0, to: 0 } ] }; const t = []; (A.value.series || []).forEach((a) => { t.push(a.from || 1e-7), t.push(a.to || 1e-7); }); const s = Math.max(...t); return { ...A.value, series: (A.value.series || []).map((a, o) => ({ ...a, color: Ct(a.color) || Ze.value[o] || ze[o], value: ((a.to || 0) - (a.from || 0)) / s * 100 })) }; }), _ = y(512), l = y({ height: 358.4, width: _.value, top: 0, bottom: 358.4, centerX: 179.2, centerY: _.value / 2, labelFontSize: 18, legendFontSize: e.value.style.chart.legend.fontSize, pointerRadius: e.value.style.chart.layout.pointer.circle.radius, trackSize: e.value.style.chart.layout.track.size, pointerSize: e.value.style.chart.layout.pointer.size, pointerStrokeWidth: e.value.style.chart.layout.pointer.strokeWidth, markerOffset: e.value.style.chart.layout.markers.offsetY + 3, segmentFontSize: e.value.style.chart.layout.segmentNames.fontSize }), E = y(0), z = y(0), g = y( e.value.style.chart.animation.use ? Math.min(...A.value.series.map((t) => t.from)) : A.value.value ); Q(() => A.value.value, () => { _e(A.value.value); }); const i = d(() => { const t = l.value.width / 2, s = v.value.base, a = Math.PI * ((g.value + 0 - z.value) / (E.value - z.value)) + Math.PI; return { x1: t, y1: s, x2: t + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.cos(a), y2: s + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.sin(a) }; }), be = d(() => { const t = l.value.width / 2, s = v.value.base, a = Math.PI * ((g.value + 0 - z.value) / (E.value - z.value)) + Math.PI, o = t + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.cos(a), p = s + v.value.pointerSize * l.value.pointerSize * 0.9 * Math.sin(a), S = l.value.pointerRadius, nt = t + S * Math.cos(a + Math.PI / 2), ut = s + S * Math.sin(a + Math.PI / 2), it = t + S * Math.cos(a - Math.PI / 2), ct = s + S * Math.sin(a - Math.PI / 2); return isNaN(o) ? null : `M ${o},${p} ${nt},${ut} ${it},${ct} Z`; }), q = d(() => { for (let t = 0; t < P.value.series.length; t += 1) { const { color: s, from: a, to: o } = P.value.series[t]; if (g.value >= a && g.value <= o) return s; } return "#2D353C"; }), O = $e(null), R = $e(null), G = d({ get: () => l.value.segmentFontSize, set: (t) => t }), { autoSizeLabels: Ce } = Rt({ svgRef: T, fontSize: l.value.segmentFontSize, minFontSize: e.value.style.chart.layout.segmentNames.minFontSize, sizeRef: G, labelClass: ".vue-ui-gauge-label-flat" }), L = d(() => !!e.value.debug); function Z() { let t = !1; if (Oe(m.dataset) ? (U({ componentName: "VueUiGauge", type: "dataset", debug: L.value }), X.value = !0, t = !0) : (Me({ datasetObject: m.dataset, requiredAttributes: ["value", "series"] }).forEach((s) => { U({ componentName: "VueUiGauge", type: "datasetAttribute", property: s, debug: L.value }), X.value = !0, t = !0; }), Object.hasOwn(m.dataset, "series") && (m.dataset.series.length ? m.dataset.series.forEach((s, a) => { Me({ datasetObject: s, requiredAttributes: ["from", "to"] }).forEach((o) => { U({ componentName: "VueUiGauge", type: "datasetSerieAttribute", property: o, index: a, debug: L.value }), X.value = !0, t = !0; }); }) : (U({ componentName: "VueUiGauge", type: "datasetAttributeEmpty", property: "series", debug: L.value }), X.value = !0, t = !0))), X.value = t, _e(A.value.value || 0), e.value.responsive) { const s = $t(() => { let { width: a, height: o } = Ft({ chart: N.value, title: e.value.style.chart.title.text ? ue.value : null, legend: ie.value, source: ce.value, noTitle: ve.value }); o -= 12, requestAnimationFrame(() => { l.value.width = a, l.value.height = o, l.value.centerX = a / 2, l.value.centerY = _.value / 2 / 358.4 * o, l.value.bottom = o, l.value.labelFontSize = 18 / _.value * Math.min(o, a) < 10 ? 10 : 18 / _.value * Math.min(o, a), l.value.legendFontSize = e.value.style.chart.legend.fontSize / _.value * Math.min(o, a) < 14 ? 14 : e.value.style.chart.legend.fontSize / _.value * Math.min(o, a), l.value.pointerRadius = e.value.style.chart.layout.pointer.circle.radius / _.value * Math.min(o, a), l.value.trackSize = e.value.style.chart.layout.track.size / _.value * Math.min(o, a), l.value.pointerStrokeWidth = re({ relator: Math.min(a, o), adjuster: _.value, source: e.value.style.chart.layout.pointer.strokeWidth, threshold: 2, fallback: 2 }), l.value.markerOffset = re({ relator: Math.max(a, o), adjuster: _.value, source: e.value.style.chart.layout.markers.offsetY + 3, threshold: 2, fallback: 2 }), l.value.segmentFontSize = re({ relator: Math.min(a, o), adjuster: _.value, source: e.value.style.chart.layout.segmentNames.fontSize, threshold: 8, fallback: 8 }); }), Ce(); }); O.value && (R.value && O.value.unobserve(R.value), O.value.disconnect()), O.value = new ResizeObserver(s), R.value = N.value.parentNode, O.value.observe(R.value); } Ce(); } dt(() => { Z(); }), ht(() => { O.value && (R.value && O.value.unobserve(R.value), O.value.disconnect()); }); function _e(t) { const s = []; (P.value.series || []).forEach((S) => { s.push(S.from || 0), s.push(S.to || 0); }), E.value = Math.max(...s), z.value = Math.min(...s); let a = e.value.style.chart.animation.speed; const o = Math.abs(t - g.value) / (a * 60); function p() { g.value < t ? g.value = Math.min(g.value + o, t) : g.value > t && (g.value = Math.max(g.value - o, t)), g.value !== t && requestAnimationFrame(p); } p(); } const v = d(() => { const t = e.value.responsive ? Math.min(l.value.width, l.value.height) : l.value.width, s = 2.5 / e.value.style.chart.layout.radiusRatio; return { arcs: t / s, gradients: t / (s * 1.1), base: e.value.responsive ? l.value.height / 1.618 : l.value.height * 0.7, ratingBase: e.value.responsive ? l.value.height / 2 + l.value.height / 4 : l.value.height * 0.9, pointerSize: e.value.responsive ? Math.min(l.value.width, l.value.height) / 3 : l.value.width / 3.2 }; }), f = d(() => te( { series: P.value.series }, l.value.width / 2, v.value.base, v.value.arcs, v.value.arcs, 1, 1, 1, 180, 109.9495, 40 * l.value.trackSize )), Je = d(() => te( { series: P.value.series }, l.value.width / 2, v.value.base, v.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio, v.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio, 1, 1, 1, 180, 109.9495, 40 * l.value.trackSize )), I = d(() => f.value.map((t) => v.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio * (t.nameOffsetRatio || 1))), Se = d(() => { const { x: t, y: s } = M({ initX: f.value[0].firstSeparator.x, initY: f.value[0].firstSeparator.y, centerX: i.value.x1, centerY: i.value.y1, offset: -e.value.style.chart.layout.segmentSeparators.offsetIn }), { x: a, y: o } = M({ initX: f.value[0].startX, initY: f.value[0].startY, centerX: i.value.x1, centerY: i.value.y1, offset: e.value.style.chart.layout.segmentSeparators.offsetOut }); return { x1: t, y1: s, x2: a, y2: o }; }), we = d(() => f.value.map((t) => { const { x: s, y: a } = M({ initX: t.separator.x, initY: t.separator.y, centerX: i.value.x1, centerY: i.value.y1, offset: -e.value.style.chart.layout.segmentSeparators.offsetIn }), { x: o, y: p } = M({ initX: t.endX, initY: t.endY, centerX: i.value.x1, centerY: i.value.y1, offset: e.value.style.chart.layout.segmentSeparators.offsetOut }); return { x1: s, y1: a, x2: o, y2: p }; })); function Ke(t) { if (t.reduce((p, S) => p + S, 0) > 100) throw new Error("Total % must not exceed 100"); const a = 50; let o = 0; return t.map((p) => (o += p, `${o / 100 * a - p / 4}%`)); } const Qe = d(() => Ke(f.value.map((t) => t.proportion * 100))), et = d(() => te( { series: P.value.series }, l.value.width / 2, v.value.base, v.value.gradients, v.value.gradients, 0.95, 1, 1, 180, 110.02, 2 * l.value.trackSize )), tt = d(() => { const t = z.value >= 0 ? -z.value : Math.abs(z.value); return _t({ radius: e.value.style.chart.layout.indicatorArc.radius * l.value.trackSize, centerX: l.value.width / 2, centerY: v.value.base, percentage: St((g.value + t) / (E.value + t)) }); }), B = y(!1); function Ae(t) { B.value = t, ne.value += 1; } const j = y(!1); function J() { j.value = !j.value; } async function at({ scale: t = 2 } = {}) { if (!N.value) return; const { width: s, height: a } = N.value.getBoundingClientRect(), o = s / a, { imageUri: p, base64: S } = await Yt({ domElement: N.value, base64: !0, img: !0, scale: t }); return { imageUri: p, base64: S, title: e.value.style.chart.title.text, width: s, height: a, aspectRatio: o }; } const ot = d(() => e.value.style.chart.backgroundColor), lt = d(() => e.value.style.chart.title), { exportSvg: rt, getSvg: st } = Pt({ svg: T, title: lt, backgroundColor: ot }); async function xe({ isCb: t }) { if (t) { const { blob: s, url: a, text: o, dataUrl: p } = await st(); e.value.userOptions.callbacks.svg({ blob: s, url: a, text: o, dataUrl: p }); } else rt(); } return De({ getImage: at, generatePdf: pe, generateImage: ke, generateSvg: xe, toggleAnnotator: J, toggleFullscreen: Ae }), (t, s) => (r(), n("div", { class: Fe(`vue-data-ui-component vue-ui-gauge ${B.value ? "vue-data-ui-wrapper-fullscreen" : ""}`), ref_key: "gaugeChart", ref: N, id: `vue-ui-gauge_${w.value}`, style: ee(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height: 100%" : ""}`), onMouseenter: s[0] || (s[0] = () => u(fe)(!0)), onMouseleave: s[1] || (s[1] = () => u(fe)(!1)) }, [ e.value.userOptions.buttons.annotator ? (r(), W(u(Te), { key: 0, svgRef: u(T), backgroundColor: e.value.style.chart.backgroundColor, color: e.value.style.chart.color, active: j.value, onClose: J }, { "annotator-action-close": b(() => [ h(t.$slots, "annotator-action-close", {}, void 0, !0) ]), "annotator-action-color": b(({ color: a }) => [ h(t.$slots, "annotator-action-color", $(F({ color: a })), void 0, !0) ]), "annotator-action-draw": b(({ mode: a }) => [ h(t.$slots, "annotator-action-draw", $(F({ mode: a })), void 0, !0) ]), "annotator-action-undo": b(({ disabled: a }) => [ h(t.$slots, "annotator-action-undo", $(F({ disabled: a })), void 0, !0) ]), "annotator-action-redo": b(({ disabled: a }) => [ h(t.$slots, "annotator-action-redo", $(F({ disabled: a })), void 0, !0) ]), "annotator-action-delete": b(({ disabled: a }) => [ h(t.$slots, "annotator-action-delete", $(F({ disabled: a })), void 0, !0) ]), _: 3 }, 8, ["svgRef", "backgroundColor", "color", "active"])) : c("", !0), qe.value ? (r(), n("div", { key: 1, ref_key: "noTitle", ref: ve, class: "vue-data-ui-no-title-space", style: "height:36px; width: 100%;background:transparent" }, null, 512)) : c("", !0), e.value.style.chart.title.text ? (r(), n("div", { key: 2, ref_key: "chartTitle", ref: ue, style: "width:100%;background:transparent;padding-bottom:12px" }, [ (r(), W(Bt, { key: `title_${de.value}`, config: { title: { cy: "gauge-div-title", ...e.value.style.chart.title }, subtitle: { cy: "gauge-div-subtitle", ...e.value.style.chart.title.subtitle } } }, { default: b(() => [ e.value.translations.base && u(A).base ? (r(), n("span", Gt, Y(e.value.translations.base) + ": " + Y(u(A).base), 1)) : c("", !0) ]), _: 1 }, 8, ["config"])) ], 512)) : c("", !0), e.value.userOptions.show && Ve.value && (u(ye) || u(V)) ? (r(), W(u(Ge), { ref_key: "details", ref: He, key: `user_options_${ne.value}`, backgroundColor: e.value.style.chart.backgroundColor, color: e.value.style.chart.color, isImaging: u(me), isPrinting: u(ge), uid: w.value, hasXls: !1, hasPdf: e.value.userOptions.buttons.pdf, hasImg: e.value.userOptions.buttons.img, hasSvg: e.value.userOptions.buttons.svg, hasFullscreen: e.value.userOptions.buttons.fullscreen, isFullscreen: B.value, titles: { ...e.value.userOptions.buttonTitles }, chartElement: N.value, callbacks: e.value.userOptions.callbacks, printScale: e.value.userOptions.print.scale, position: e.value.userOptions.position, hasAnnotator: e.value.userOptions.buttons.annotator, isAnnotation: j.value, onToggleFullscreen: Ae, onGeneratePdf: u(pe), onGenerateImage: u(ke), onGenerateSvg: xe, onToggleAnnotator: J, style: ee({ visibility: u(ye) ? u(V) ? "visible" : "hidden" : "visible" }) }, ft({ _: 2 }, [ t.$slots.menuIcon ? { name: "menuIcon", fn: b(({ isOpen: a, color: o }) => [ h(t.$slots, "menuIcon", $(F({ isOpen: a, color: o })), void 0, !0) ]), key: "0" } : void 0, t.$slots.optionPdf ? { name: "optionPdf", fn: b(() => [ h(t.$slots, "optionPdf", {}, void 0, !0) ]), key: "1" } : void 0, t.$slots.optionImg ? { name: "optionImg", fn: b(() => [ h(t.$slots, "optionImg", {}, void 0, !0) ]), key: "2" } : void 0, t.$slots.optionSvg ? { name: "optionSvg", fn: b(() => [ h(t.$slots, "optionSvg", {}, void 0, !0) ]), key: "3" } : void 0, t.$slots.optionFullscreen ? { name: "optionFullscreen", fn: b(({ toggleFullscreen: a, isFullscreen: o }) => [ h(t.$slots, "optionFullscreen", $(F({ toggleFullscreen: a, isFullscreen: o })), void 0, !0) ]), key: "4" } : void 0, t.$slots.optionAnnotator ? { name: "optionAnnotator", fn: b(({ toggleAnnotator: a, isAnnotator: o }) => [ h(t.$slots, "optionAnnotator", $(F({ toggleAnnotator: a, isAnnotator: o })), void 0, !0) ]), key: "5" } : void 0 ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasPdf", "hasImg", "hasSvg", "hasFullscreen", "isFullscreen", "titles", "chartElement", "callbacks", "printScale", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : c("", !0), (r(), n("svg", { ref_key: "svgRef", ref: T, xmlns: u(wt), class: Fe({ "vue-data-ui-fullscreen--on": B.value, "vue-data-ui-fulscreen--off": !B.value }), viewBox: `0 0 ${l.value.width <= 0 ? 10 : l.value.width} ${l.value.height <= 0 ? 10 : l.value.height}`, style: ee(`max-width:100%;overflow:hidden !important;background:transparent;color:${e.value.style.chart.color}`) }, [ yt(u(Le)), t.$slots["chart-background"] ? (r(), n("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" } }, [ h(t.$slots, "chart-background", {}, void 0, !0) ], 8, jt)) : c("", !0), k("defs", null, [ k("radialGradient", { id: `gradient_${w.value}`, cx: "50%", cy: "50%", r: "50%", fx: "50%", fy: "50%" }, [ k("stop", { offset: "0%", "stop-color": u(ae)("#FFFFFF", 1) }, null, 8, Ut), k("stop", { offset: "80%", "stop-color": u(ae)("#FFFFFF", e.value.style.chart.layout.track.gradientIntensity) }, null, 8, Vt), k("stop", { offset: "100%", "stop-color": u(ae)("#FFFFFF", 1) }, null, 8, Ht) ], 8, Wt) ]), k("defs", null, [ k("filter", { id: `blur_${w.value}`, x: "-50%", y: "-50%", width: "200%", height: "200%" }, [ k("feGaussianBlur", { in: "SourceGraphic", stdDeviation: 100 / e.value.style.chart.layout.track.gradientIntensity }, null, 8, Zt) ], 8, qt) ]), t.$slots.pattern ? (r(), n("g", Jt, [ (r(!0), n(C, null, x(f.value, (a, o) => (r(), n("defs", null, [ h(t.$slots, "pattern", D({ ref_for: !0 }, { seriesIndex: o, patternId: `pattern_${w.value}_${o}` }), void 0, !0) ]))), 256)) ])) : c("", !0), (r(!0), n(C, null, x(f.value, (a, o) => (r(), n("path", { key: `arc_${o}`, d: a.arcSlice, fill: a.color, stroke: e.value.style.chart.backgroundColor, "stroke-linecap": "round" }, null, 8, Kt))), 128)), t.$slots.pattern ? (r(!0), n(C, { key: 2 }, x(f.value, (a, o) => (r(), n("path", { key: `arc_${o}`, d: a.arcSlice, fill: `url(#pattern_${w.value}_${o})`, stroke: e.value.style.chart.backgroundColor, "stroke-linecap": "round" }, null, 8, Qt))), 128)) : c("", !0), e.value.style.chart.layout.indicatorArc.show ? (r(), n("path", { key: 3, d: tt.value, fill: e.value.style.chart.layout.indicatorArc.fill }, null, 8, ea)) : c("", !0), e.value.style.chart.layout.segmentNames.show && e.value.style.chart.layout.segmentNames.curved ? (r(), n(C, { key: 4 }, [ (r(!0), n(C, null, x(f.value, (a, o) => (r(), n("path", { id: `curve_${w.value}_${o}`, d: `M ${i.value.x1},${i.value.y1} m -${I.value[o]},0 a ${I.value[o]},${I.value[o]} 0 1,1 ${2 * I.value[o]},0 a ${I.value[o]},${I.value[o]} 0 1,1 -${2 * I.value[o]},0`, fill: "transparent" }, null, 8, ta))), 256)), (r(!0), n(C, null, x(f.value, (a, o) => (r(), n("text", { fill: e.value.style.chart.layout.segmentNames.useSerieColor ? a.color : e.value.style.chart.layout.segmentNames.color, "font-size": G.value, "font-weight": e.value.style.chart.layout.segmentNames.bold ? "bold" : "normal", "text-anchor": "middle" }, [ k("textPath", { href: `#curve_${w.value}_${o}`, startOffset: Qe.value[o] }, Y(a.name || ""), 9, oa) ], 8, aa))), 256)) ], 64)) : c("", !0), e.value.style.chart.layout.segmentNames.show && !e.value.style.chart.layout.segmentNames.curved ? (r(!0), n(C, { key: 5 }, x(Je.value, (a, o) => (r(), n("text", { class: "vue-ui-gauge-label-flat", "text-anchor": u(xt)(a, !1, 12).anchor, fill: e.value.style.chart.layout.segmentNames.useSerieColor ? a.color : e.value.style.chart.layout.segmentNames.color, "font-size": G.value, "font-weight": e.value.style.chart.layout.segmentNames.bold ? "bold" : "normal", innerHTML: u(At)({ content: String(a.name ?? ""), fontSize: G.value, fill: e.value.style.chart.layout.segmentNames.useSerieColor ? a.color : e.value.style.chart.layout.segmentNames.color, x: a.center.endX, y: a.center.endY }) }, null, 8, la))), 256)) : c("", !0), e.value.style.chart.layout.track.useGradient ? (r(!0), n(C, { key: 6 }, x(et.value, (a, o) => (r(), n("path", { key: `arc_${o}`, d: a.arcSlice, fill: "#FFFFFF", stroke: "none", "stroke-linecap": "round", filter: `url(#blur_${w.value})` }, null, 8, ra))), 128)) : c("", !0), e.value.style.chart.layout.segmentSeparators.show ? (r(), n(C, { key: 7 }, [ k("line", D(Se.value, { stroke: e.value.style.chart.backgroundColor, "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2, "stroke-linecap": "round" }), null, 16, sa), k("line", D(Se.value, { stroke: e.value.style.chart.layout.segmentSeparators.stroke, "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth, "stroke-linecap": "round" }), null, 16, na), (r(!0), n(C, null, x(we.value, (a) => (r(), n("line", D({ ref_for: !0 }, a, { stroke: e.value.style.chart.backgroundColor, "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2, "stroke-linecap": "round" }), null, 16, ua))), 256)), (r(!0), n(C, null, x(we.value, (a) => (r(), n("line", D({ ref_for: !0 }, a, { stroke: e.value.style.chart.layout.segmentSeparators.stroke, "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth, "stroke-linecap": "round" }), null, 16, ia))), 256)) ], 64)) : c("", !0), e.value.style.chart.layout.markers.show ? (r(), n("g", ca, [ (r(!0), n(C, null, x(f.value, (a, o) => (r(), n("text", { x: u(M)({ centerX: i.value.x1, centerY: v.value.base, initX: a.center.startX, initY: a.center.startY, offset: l.value.markerOffset }).x, y: u(M)({ centerX: i.value.x1, centerY: v.value.base, initX: a.center.startX, initY: a.center.startY, offset: l.value.markerOffset }).y, "text-anchor": a.center.startX < i.value.x1 - 5 ? "end" : a.center.startX > i.value.x1 + 5 ? "start" : "middle", "font-size": l.value.labelFontSize * e.value.style.chart.layout.markers.fontSizeRatio, "font-weight": `${e.value.style.chart.layout.markers.bold ? "bold" : "normal"}`, fill: e.value.style.chart.layout.markers.color }, Y(u(oe)( e.value.style.chart.layout.markers.formatter, a.from, u(le)({ p: e.value.style.chart.layout.markers.prefix, v: a.from, s: e.value.style.chart.layout.markers.suffix, r: e.value.style.chart.layout.markers.roundingValue }) )), 9, va))), 256)) ])) : c("", !0), e.value.style.chart.layout.markers.show ? (r(), n("text", { key: 9, x: u(M)({ centerX: l.value.width / 2, centerY: v.value.base, initX: f.value.at(-1).endX, initY: f.value.at(-1).endY, offset: l.value.markerOffset }).x, y: u(M)({ centerX: l.value.width / 2, centerY: v.value.base, initX: f.value.at(-1).endX, initY: f.value.at(-1).endY, offset: l.value.markerOffset }).y, "text-anchor": "start", "font-size": l.value.labelFontSize * e.value.style.chart.layout.markers.fontSizeRatio, "font-weight": `${e.value.style.chart.layout.markers.bold ? "bold" : "normal"}`, fill: e.value.style.chart.layout.markers.color }, Y(u(oe)( e.value.style.chart.layout.markers.formatter, E.value, u(le)({ p: e.value.style.chart.layout.markers.prefix, v: E.value, s: e.value.style.chart.layout.markers.suffix, r: e.value.style.chart.layout.markers.roundingValue }) )), 9, da)) : c("", !0), e.value.style.chart.layout.pointer.show ? (r(), n(C, { key: 10 }, [ e.value.style.chart.layout.pointer.type === "rounded" ? (r(), n("g", ha, [ isNaN(i.value.x2) ? c("", !0) : (r(), n("line", { key: 0, x1: i.value.x1, y1: i.value.y1, x2: i.value.x2, y2: i.value.y2, stroke: e.value.style.chart.layout.pointer.stroke, "stroke-width": l.value.pointerStrokeWidth, "stroke-linecap": "round" }, null, 8, fa)), isNaN(i.value.x2) ? c("", !0) : (r(), n("line", { key: 1, x1: i.value.x1, y1: i.value.y1, x2: i.value.x2, y2: i.value.y2, stroke: e.value.style.chart.layout.pointer.useRatingColor ? q.value : e.value.style.chart.layout.pointer.color, "stroke-linecap": "round", "stroke-width": l.value.pointerStrokeWidth * 0.7 }, null, 8, ya)), !isNaN(i.value.x2) && e.value.style.chart.layout.track.useGradient ? (r(), n("line", { key: 2, x1: i.value.x1, y1: i.value.y1, x2: i.value.x2, y2: i.value.y2, stroke: "white", "stroke-linecap": "round", "stroke-width": l.value.pointerStrokeWidth * 0.3, filter: `url(#blur_${w.value})` }, null, 8, ga)) : c("", !0) ])) : (r(), n("g", ma, [ be.value ? (r(), n("path", { key: 0, d: be.value, fill: e.value.style.chart.layout.pointer.useRatingColor ? q.value : e.value.style.chart.layout.pointer.color, stroke: e.value.style.chart.layout.pointer.stroke, "stroke-width": e.value.style.chart.layout.pointer.circle.strokeWidth, "stroke-linejoin": "round" }, null, 8, pa)) : c("", !0) ])), k("circle", { cx: l.value.width / 2, cy: v.value.base, fill: e.value.style.chart.layout.pointer.circle.color, r: l.value.pointerRadius <= 0 ? 1e-4 : l.value.pointerRadius, "stroke-width": e.value.style.chart.layout.pointer.circle.strokeWidth, stroke: e.value.style.chart.layout.pointer.circle.stroke }, null, 8, ka) ], 64)) : c("", !0), e.value.style.chart.legend.show ? (r(), n("text", { key: 11, x: l.value.width / 2, y: v.value.ratingBase, "text-anchor": "middle", "font-size": l.value.legendFontSize, "font-weight": "bold", fill: e.value.style.chart.legend.useRatingColor ? q.value : e.value.style.chart.legend.color }, Y(u(oe)( e.value.style.chart.legend.formatter, g.value, u(le)({ p: e.value.style.chart.legend.prefix + (e.value.style.chart.legend.showPlusSymbol && g.value > 0 ? "+" : ""), v: g.value, s: e.value.style.chart.legend.suffix, r: e.value.style.chart.legend.roundingValue }) )), 9, ba)) : c("", !0), h(t.$slots, "svg", { svg: l.value }, void 0, !0) ], 14, Lt)), t.$slots.watermark ? (r(), n("div", Ca, [ h(t.$slots, "watermark", $(F({ isPrinting: u(ge) || u(me) })), void 0, !0) ])) : c("", !0), k("div", { ref_key: "chartLegend", ref: ie }, [ h(t.$slots, "legend", { legend: P.value }, void 0, !0) ], 512), t.$slots.source ? (r(), n("div", { key: 5, ref_key: "source", ref: ce, dir: "auto" }, [ h(t.$slots, "source", {}, void 0, !0) ], 512)) : c("", !0), u(he) ? (r(), W(Ot, { key: 6 })) : c("", !0) ], 46, Tt)); } }, Sa = /* @__PURE__ */ Dt(_a, [["__scopeId", "data-v-5a38dabe"]]), Ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Sa }, Symbol.toStringTag, { value: "Module" })); export { Ya as a, Ba as b, Sa as v };