UNPKG

vue-data-ui

Version:

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

854 lines (853 loc) 42.2 kB
import { useCssVars as Ee, computed as p, ref as b, watch as Te, onMounted as Ge, createElementBlock as i, openBlock as o, unref as r, normalizeStyle as T, normalizeClass as Q, createBlock as D, createCommentVNode as d, createVNode as ie, createSlots as Ue, withCtx as A, renderSlot as m, normalizeProps as R, guardReactiveProps as X, Fragment as _, renderList as z, createElementVNode as v, toDisplayString as x, withKeys as Ye, createTextVNode as He, nextTick as De } from "vue"; import { u as je, o as We, e as Ae, c as re, a as qe, C as Ke, O as j, g as Je, X as Qe, G as ve, i as O, f as M, v as N, q as Ze, r as el, x as ll, y as tl } from "./index-BaaDnc4F.js"; import { _ as al } from "./Title-D_MGglyN.js"; import { u as ol, U as sl } from "./usePrinter-y4-4tCWT.js"; import { _ as ul } from "./Tooltip-HRgkF8HD.js"; import nl from "./vue-ui-skeleton-6RiQNJSb.js"; import il from "./BaseIcon-rw8rKNKS.js"; import rl from "./vue-ui-accordion-CF9kQTXq.js"; import { u as ze } from "./useNestedProp-D8vQcOps.js"; import { _ as vl } from "./PackageVersion-D9Lm1C1X.js"; import { P as yl } from "./PenAndPaper-DR58HO_U.js"; import { u as dl } from "./useUserOptionState-BIvW1Kz7.js"; import { u as cl } from "./useChartAccessibility-BWojgys7.js"; import { _ as hl } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const gl = ["id"], fl = { key: 2, style: "width:100%;background:transparent" }, pl = ["xmlns", "viewBox"], bl = ["width", "height"], ml = ["x", "y", "height", "width", "fill", "stroke", "stroke-width"], xl = ["x", "y", "height", "width", "fill", "stroke", "stroke-width"], wl = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], kl = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], _l = ["font-size", "font-weight", "fill", "x", "y"], $l = ["x", "y", "width", "height", "onMouseover"], Ll = { key: 0 }, Cl = ["font-size", "fill", "x", "y", "font-weight"], Tl = ["font-size", "fill", "x", "y", "font-weight"], Al = { key: 1 }, zl = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], Ml = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], Sl = { key: 2 }, Ol = ["text-anchor", "font-size", "fill", "font-weight", "transform"], Nl = ["text-anchor", "font-size", "fill", "font-weight", "transform"], Vl = { key: 4 }, Fl = ["x", "y", "width", "height", "stroke", "stroke-width"], Il = { key: 5 }, Pl = ["id"], Rl = ["stop-color"], Xl = ["stop-color"], Bl = ["x", "y", "font-size", "fill"], El = ["x", "y", "height", "rx", "fill"], Gl = ["x", "y", "font-size", "fill"], Ul = ["stroke", "x1", "x2", "y1", "y2"], Yl = ["fill", "d"], Hl = { key: 6 }, Dl = { id: "colorScaleHorizontal", x1: "0%", x2: "100%", y1: "0%", y2: "0%" }, jl = ["stop-color"], Wl = ["stop-color"], ql = ["x", "y", "width", "height", "rx"], Kl = ["x", "y", "font-size", "fill"], Jl = ["x", "y", "font-size", "fill"], Ql = ["stroke", "x1", "x2", "y1", "y2"], Zl = ["fill", "d"], et = { key: 5, class: "vue-data-ui-watermark" }, lt = { key: 6, ref: "source", dir: "auto" }, tt = { class: "vue-ui-data-table" }, at = { key: 0 }, ot = ["data-cell"], st = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, ut = ["data-cell"], nt = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, it = { __name: "vue-ui-heatmap", props: { config: { type: Object, default() { return {}; } }, dataset: { type: Array, default() { return []; } } }, setup(B, { expose: Me }) { Ee((l) => ({ 14959484: l.tdo })); const { vue_ui_heatmap: Se } = je(), y = B, W = p(() => !!y.dataset && y.dataset.length); We(y.dataset) && Ae({ componentName: "VueUiHeatmap", type: "dataset" }); const E = b(re()), Z = b(null), Oe = b(null), ee = b(!1), le = b(""), ye = b(void 0), G = b(null), de = b(0), ce = b(null), Ne = b(null), he = b(!1), ge = b(0), e = p({ get: () => me(), set: (l) => l }), { userOptionsVisible: te, setUserOptionsVisibility: fe, keepUserOptionState: pe } = dl({ config: e.value }), { svgRef: be } = cl({ config: e.value.style.title }); function me() { const l = ze({ userConfig: y.config, defaultConfig: Se }); let s = {}; return l.theme ? s = { ...ze({ userConfig: qe.vue_ui_heatmap[l.theme] || y.config, defaultConfig: l }) } : s = l, y.config && Ke(y.config, "style.layout.dataLabels.xAxis.showOnlyAtModulo") ? s.style.layout.dataLabels.xAxis.showOnlyAtModulo = y.config.style.layout.dataLabels.xAxis.showOnlyAtModulo : s.style.layout.dataLabels.xAxis.showOnlyAtModulo = null, s; } Te(() => y.config, (l) => { e.value = me(), te.value = !e.value.userOptions.showOnChartHover, ae(), ge.value += 1, $.value.showTable = e.value.table.show, $.value.showTooltip = e.value.style.tooltip.show; }, { deep: !0 }), Te(() => y.dataset, () => { ae(); }, { deep: !0 }); const { isPrinting: xe, isImaging: we, generatePdf: ke, generateImage: _e } = ol({ elementId: `heatmap__${E.value}`, fileName: e.value.style.title.text || "vue-ui-heatmap" }), Ve = p(() => e.value.userOptions.show && !e.value.style.title.text), $ = b({ showTable: e.value.table.show, showTooltip: e.value.style.tooltip.show }), Fe = p(() => e.value.table.responsiveBreakpoint); function Ie() { new ResizeObserver((s) => { s.forEach((n) => { he.value = n.contentRect.width < Fe.value; }); }).observe(ce.value); } Ge(ae); function ae() { Ie(); } const V = p(() => Math.max(...y.dataset.flatMap((l) => (l.values || []).length))), L = p(() => { const l = e.value.style.layout.padding.top + e.value.style.layout.padding.bottom + y.dataset.length * e.value.style.layout.cells.height, s = e.value.style.layout.padding.left + e.value.style.layout.padding.right + (V.value < y.dataset.length ? y.dataset.length : V.value) * e.value.style.layout.cells.height, n = l + (e.value.style.legend.show ? e.value.style.legend.position === "right" ? 0 : e.value.style.layout.cells.height * 2 : 0); return { height: l, heightWithLegend: n, width: s }; }), q = p(() => e.value.style.legend.position), t = p(() => ({ top: e.value.style.layout.padding.top, left: e.value.style.layout.padding.left, right: L.value.width - e.value.style.layout.padding.right - (q.value === "right" && e.value.style.legend.show ? 92 : 0), bottom: L.value.height - e.value.style.layout.padding.bottom, height: L.value.height - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom, width: L.value.width - e.value.style.layout.padding.right - e.value.style.layout.padding.left - (q.value === "right" && e.value.style.legend.show ? 92 : 0) })), oe = p(() => a.value.height * y.dataset.length), C = p(() => Math.max(...y.dataset.flatMap((l) => l.values))), F = p(() => Math.min(...y.dataset.flatMap((l) => l.values))), I = p(() => { const l = y.dataset.flatMap((n) => n.values); return l.reduce((n, u) => n + u, 0) / l.length; }), a = p(() => ({ width: t.value.width / V.value, height: t.value.width / (V.value < y.dataset.length ? y.dataset.length : V.value) })), g = p(() => { const l = e.value.style.layout.dataLabels.yAxis.values.length ? e.value.style.layout.dataLabels.yAxis.values : y.dataset.map((h) => h.name), s = e.value.style.layout.dataLabels.xAxis.values, n = y.dataset.map((h) => h.values.reduce((w, ne) => w + ne, 0)), u = Math.max(...n), c = Math.min(...n), f = []; for (let h = 0; h < V.value; h += 1) f.push(y.dataset.map((w) => w.values[h] || 0).reduce((w, ne) => w + ne, 0)); const k = Math.max(...f), ue = Math.min(...f); return { yTotals: n.map((h) => { const w = isNaN(h / u) ? 0 : h / u; return { total: h, proportion: w, color: j(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, c, u, h) }; }), xTotals: f.map((h) => { const w = isNaN(h / k) ? 0 : h / k; return { total: h, proportion: w, color: j(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, ue, k, h) }; }), yLabels: l, xLabels: s.slice(0, V.value) }; }), K = p(() => (y.dataset.forEach((l, s) => { Je({ datasetObject: l, requiredAttributes: ["values"] }).forEach((n) => { Ae({ componentName: "VueUiHeatmap", type: "datasetSerieAttribute", property: "values", index: s }); }); }), y.dataset.map((l) => ({ ...l, temperatures: (l.values || []).map((s, n) => s >= I.value ? { side: "up", color: j(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, F.value, C.value, s), ratio: Math.abs(Math.abs(s - I.value) / Math.abs(C.value - I.value)) > 1 ? 1 : Math.abs(Math.abs(s - I.value) / Math.abs(C.value - I.value)), value: s, yAxisName: l.name, xAxisName: g.value.xLabels[n], id: `vue-data-ui-heatmap-cell-${re()}` } : { side: "down", ratio: Math.abs(1 - Math.abs(s) / Math.abs(I.value)) > 1 ? 1 : Math.abs(1 - Math.abs(s) / Math.abs(I.value)), color: j(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, F.value, C.value, s), value: s, yAxisName: l.name, xAxisName: g.value.xLabels[n], id: `vue-data-ui-heatmap-cell-${re()}` }) })))), S = b(null), U = b(null); function Pe(l, s, n, u) { G.value = { x: n, y: u }; const { value: c, yAxisName: f, xAxisName: k, id: ue } = l; ye.value = ue, S.value = c, U.value = { datapoint: l, seriesIndex: s, series: K.value, config: e.value }, ee.value = !0; let h = ""; const w = e.value.style.tooltip.customFormat; ll(w) && tl(() => w({ datapoint: l, seriesIndex: s, series: K.value, config: e.value })) ? le.value = w({ datapoint: l, seriesIndex: s, series: K.value, config: e.value }) : (h += `<div>${f} ${k ? `${k}` : ""}</div>`, h += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor};font-weight:bold;display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:center"><span style="color:${j(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, F.value, C.value, c)}">⬤</span><span>${isNaN(c) ? "-" : O( e.value.style.layout.cells.value.formatter, c, M({ p: e.value.style.layout.dataLabels.prefix, v: c, s: e.value.style.layout.dataLabels.suffix, r: e.value.style.tooltip.roundingValue }), { datapoint: l, seriesIndex: s } )}</span></div>`, le.value = `<div style="font-size:${e.value.style.tooltip.fontSize}px">${h}</div>`); } const Y = p(() => t.value.top + oe.value * (1 - S.value / C.value)), H = p(() => t.value.left + (L.value.width - t.value.left - e.value.style.layout.padding.right) * (S.value / C.value)); function Re(l) { return O( e.value.style.layout.cells.value.formatter, g.value.yTotals[l].total, M({ p: e.value.style.layout.dataLabels.prefix, v: g.value.yTotals[l].total, s: e.value.style.layout.dataLabels.suffix, r: e.value.style.layout.cells.value.roundingValue }), { datapoint: g.value.yTotals[l], rowIndex: l } ); } function Xe(l) { return O( e.value.style.layout.cells.value.formatter, g.value.xTotals[l].total, M({ p: e.value.style.layout.dataLabels.prefix, v: g.value.xTotals[l].total, s: e.value.style.layout.dataLabels.suffix, r: e.value.style.layout.cells.value.roundingValue }), { datapoint: g.value.xTotals[l], colIndex: l } ); } p(() => { const l = y.dataset.map((n) => ({ name: n.name })), s = y.dataset.map((n) => n.values); return { head: l, body: s }; }); function $e() { De(() => { const l = ["", ...y.dataset.map((c, f) => c.name)], s = []; for (let c = 0; c < g.value.xLabels.length; c += 1) { const f = [g.value.xLabels[c]]; for (let k = 0; k < y.dataset.length; k += 1) f.push([y.dataset[k].values[c]]); s.push(f); } const n = [[e.value.style.title.text], [e.value.style.title.subtitle.text], [[""], [""], [""]]].concat([l]).concat(s), u = Ze(n); el({ csvContent: u, title: e.value.style.title.text || "vue-ui-heatmap" }); }); } const P = b(!1); function Be(l) { P.value = l, de.value += 1; } function Le() { $.value.showTable = !$.value.showTable; } function Ce() { $.value.showTooltip = !$.value.showTooltip; } const J = b(!1); function se() { J.value = !J.value; } return Me({ generatePdf: ke, generateCsv: $e, generateImage: _e, toggleTable: Le, toggleTooltip: Ce, toggleAnnotator: se }), (l, s) => (o(), i("div", { ref_key: "heatmapChart", ref: Z, class: Q(`vue-ui-heatmap ${P.value ? "vue-data-ui-wrapper-fullscreen" : ""}`), style: T(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.backgroundColor}`), id: `heatmap__${E.value}`, onMouseenter: s[3] || (s[3] = () => r(fe)(!0)), onMouseleave: s[4] || (s[4] = () => r(fe)(!1)) }, [ e.value.userOptions.buttons.annotator ? (o(), D(yl, { key: 0, svgRef: r(be), backgroundColor: e.value.style.backgroundColor, color: e.value.style.color, active: J.value, onClose: se }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : d("", !0), Ve.value ? (o(), i("div", { key: 1, ref_key: "noTitle", ref: Ne, class: "vue-data-ui-no-title-space", style: "height:36px; width: 100%;background:transparent" }, null, 512)) : d("", !0), e.value.style.title.text ? (o(), i("div", fl, [ (o(), D(al, { key: `title_${ge.value}`, config: { title: { cy: "heatmap-div-title", ...e.value.style.title }, subtitle: { cy: "heatmap-div-subtitle", ...e.value.style.title.subtitle } } }, null, 8, ["config"])) ])) : d("", !0), e.value.userOptions.show && W.value && (r(pe) || r(te)) ? (o(), D(sl, { ref_key: "details", ref: Oe, key: `user_options_${de.value}`, backgroundColor: e.value.style.backgroundColor, color: e.value.style.color, isImaging: r(we), isPrinting: r(xe), uid: E.value, hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.tooltip.show, 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: P.value, isTooltip: $.value.showTooltip, titles: { ...e.value.userOptions.buttonTitles }, chartElement: Z.value, position: e.value.userOptions.position, hasAnnotator: e.value.userOptions.buttons.annotator, isAnnotation: J.value, onToggleFullscreen: Be, onGeneratePdf: r(ke), onGenerateCsv: $e, onGenerateImage: r(_e), onToggleTable: Le, onToggleTooltip: Ce, onToggleAnnotator: se, style: T({ visibility: r(pe) ? r(te) ? "visible" : "hidden" : "visible" }) }, Ue({ _: 2 }, [ l.$slots.menuIcon ? { name: "menuIcon", fn: A(({ isOpen: n, color: u }) => [ m(l.$slots, "menuIcon", R(X({ isOpen: n, color: u })), void 0, !0) ]), key: "0" } : void 0, l.$slots.optionTooltip ? { name: "optionTooltip", fn: A(() => [ m(l.$slots, "optionTooltip", {}, void 0, !0) ]), key: "1" } : void 0, l.$slots.optionPdf ? { name: "optionPdf", fn: A(() => [ m(l.$slots, "optionPdf", {}, void 0, !0) ]), key: "2" } : void 0, l.$slots.optionCsv ? { name: "optionCsv", fn: A(() => [ m(l.$slots, "optionCsv", {}, void 0, !0) ]), key: "3" } : void 0, l.$slots.optionImg ? { name: "optionImg", fn: A(() => [ m(l.$slots, "optionImg", {}, void 0, !0) ]), key: "4" } : void 0, l.$slots.optionTable ? { name: "optionTable", fn: A(() => [ m(l.$slots, "optionTable", {}, void 0, !0) ]), key: "5" } : void 0, l.$slots.optionFullscreen ? { name: "optionFullscreen", fn: A(({ toggleFullscreen: n, isFullscreen: u }) => [ m(l.$slots, "optionFullscreen", R(X({ toggleFullscreen: n, isFullscreen: u })), void 0, !0) ]), key: "6" } : void 0, l.$slots.optionAnnotator ? { name: "optionAnnotator", fn: A(({ toggleAnnotator: n, isAnnotator: u }) => [ m(l.$slots, "optionAnnotator", R(X({ toggleAnnotator: n, isAnnotator: u })), void 0, !0) ]), key: "7" } : void 0 ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : d("", !0), W.value ? (o(), i("svg", { key: 4, ref_key: "svgRef", ref: be, xmlns: r(Qe), class: Q({ "vue-data-ui-fullscreen--on": P.value, "vue-data-ui-fulscreen--off": !P.value }), viewBox: `0 0 ${L.value.width} ${L.value.heightWithLegend}`, style: T(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.color}`) }, [ ie(vl), l.$slots["chart-background"] ? (o(), i("foreignObject", { key: 0, x: 0, y: 0, width: L.value.width, height: L.value.heightWithLegend, style: { pointerEvents: "none" } }, [ m(l.$slots, "chart-background", {}, void 0, !0) ], 8, bl)) : d("", !0), e.value.style.layout.cells.columnTotal.color.show ? (o(), i(_, { key: 1 }, [ (o(!0), i(_, null, z(g.value.xTotals, (n, u) => (o(), i("rect", { x: t.value.left + a.value.width * u + e.value.style.layout.cells.spacing / 2 + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0), y: t.value.top - a.value.height / 3 - e.value.style.layout.cells.spacing, height: a.value.height / 3, width: a.value.width - e.value.style.layout.cells.spacing, fill: e.value.style.layout.cells.colors.underlayer, stroke: e.value.style.backgroundColor, "stroke-width": e.value.style.layout.cells.spacing }, null, 8, ml))), 256)), (o(!0), i(_, null, z(g.value.xTotals, (n, u) => (o(), i("rect", { x: t.value.left + a.value.width * u + e.value.style.layout.cells.spacing / 2 + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0), y: t.value.top - a.value.height / 3 - e.value.style.layout.cells.spacing, height: a.value.height / 3, width: a.value.width - e.value.style.layout.cells.spacing, fill: n.color, stroke: e.value.style.backgroundColor, "stroke-width": e.value.style.layout.cells.spacing }, null, 8, xl))), 256)) ], 64)) : d("", !0), (o(!0), i(_, null, z(K.value, (n, u) => (o(), i("g", null, [ (o(!0), i(_, null, z(n.temperatures, (c, f) => (o(), i("g", null, [ v("rect", { x: t.value.left + a.value.width * f + e.value.style.layout.cells.spacing / 2 + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0), y: t.value.top + a.value.height * u + e.value.style.layout.cells.spacing / 2, width: a.value.width - e.value.style.layout.cells.spacing, height: a.value.height - e.value.style.layout.cells.spacing, fill: e.value.style.layout.cells.colors.underlayer, stroke: e.value.style.backgroundColor, "stroke-width": e.value.style.layout.cells.spacing }, null, 8, wl), v("rect", { x: t.value.left + a.value.width * f + e.value.style.layout.cells.spacing / 2 + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0), y: t.value.top + a.value.height * u + e.value.style.layout.cells.spacing / 2, width: a.value.width - e.value.style.layout.cells.spacing, height: a.value.height - e.value.style.layout.cells.spacing, fill: c.color, stroke: e.value.style.backgroundColor, "stroke-width": e.value.style.layout.cells.spacing }, null, 8, kl), e.value.style.layout.cells.value.show ? (o(), i("text", { key: 0, "text-anchor": "middle", "font-size": e.value.style.layout.cells.value.fontSize, "font-weight": e.value.style.layout.cells.value.bold ? "bold" : "normal", fill: r(ve)(c.color), x: t.value.left + a.value.width * f + a.value.width / 2 + +(e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0), y: t.value.top + a.value.height * u + a.value.height / 2 + e.value.style.layout.cells.value.fontSize / 3 }, x(r(O)( e.value.style.layout.cells.value.formatter, c.value, r(M)({ p: e.value.style.layout.dataLabels.prefix, v: c.value, s: e.value.style.layout.dataLabels.suffix, r: e.value.style.layout.cells.value.roundingValue }), { datapoint: c } )), 9, _l)) : d("", !0) ]))), 256)), (o(!0), i(_, null, z(n.temperatures, (c, f) => (o(), i("g", null, [ v("rect", { x: t.value.left + a.value.width * f + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0), y: t.value.top + a.value.height * u, width: a.value.width, height: a.value.height, fill: "transparent", stroke: "none", onMouseover: (k) => Pe(c, u, t.value.left + a.value.width * f, t.value.top + a.value.height * u), onMouseout: s[0] || (s[0] = (k) => { ee.value = !1, ye.value = void 0, S.value = null, G.value = null; }) }, null, 40, $l) ]))), 256)), e.value.style.layout.dataLabels.yAxis.show ? (o(), i("g", Ll, [ v("text", { class: "vue-ui-heatmap-row-name", "font-size": e.value.style.layout.dataLabels.yAxis.fontSize, fill: e.value.style.layout.dataLabels.yAxis.color, x: t.value.left + e.value.style.layout.dataLabels.yAxis.offsetX - 6, y: t.value.top + a.value.height * u + a.value.height / 2 + e.value.style.layout.dataLabels.yAxis.fontSize / 3 + e.value.style.layout.dataLabels.yAxis.offsetY - (e.value.style.layout.cells.rowTotal.value.show ? e.value.style.layout.dataLabels.yAxis.fontSize / 1.5 : 0), "text-anchor": "end", "font-weight": e.value.style.layout.dataLabels.yAxis.bold ? "bold" : "normal" }, x(g.value.yLabels[u]), 9, Cl), e.value.style.layout.cells.rowTotal.value.show ? (o(), i("text", { key: 0, class: "vue-ui-heatmap-row-total", "font-size": e.value.style.layout.dataLabels.yAxis.fontSize, fill: e.value.style.layout.dataLabels.yAxis.color, x: t.value.left + e.value.style.layout.dataLabels.yAxis.offsetX - 6, y: t.value.top + a.value.height * u + a.value.height / 2 + e.value.style.layout.dataLabels.yAxis.fontSize + e.value.style.layout.dataLabels.yAxis.offsetY, "text-anchor": "end", "font-weight": e.value.style.layout.dataLabels.yAxis.bold ? "bold" : "normal" }, x(Re(u)), 9, Tl)) : d("", !0) ])) : d("", !0), e.value.style.layout.cells.rowTotal.color.show ? (o(), i("g", Al, [ v("rect", { x: t.value.left, y: t.value.top + a.value.height * u, width: a.value.height / 3, height: a.value.height - e.value.style.layout.cells.spacing, fill: e.value.style.layout.cells.colors.underlayer, stroke: e.value.style.backgroundColor, "stroke-width": e.value.style.layout.cells.spacing }, null, 8, zl), v("rect", { x: t.value.left, y: t.value.top + a.value.height * u + e.value.style.layout.cells.spacing / 2, width: a.value.height / 3, height: a.value.height - e.value.style.layout.cells.spacing, fill: g.value.yTotals[u].color, stroke: e.value.style.backgroundColor, "stroke-width": e.value.style.layout.cells.spacing }, null, 8, Ml) ])) : d("", !0) ]))), 256)), e.value.style.layout.dataLabels.xAxis.show ? (o(), i("g", Sl, [ (o(!0), i(_, null, z(g.value.xLabels, (n, u) => (o(), i(_, null, [ !e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo || e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo && u % e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo === 0 ? (o(), i("text", { key: 0, class: "vue-ui-heatmap-col-name", "text-anchor": e.value.style.layout.dataLabels.xAxis.rotation === 0 ? "middle" : e.value.style.layout.dataLabels.xAxis.rotation < 0 ? "start" : "end", "font-size": e.value.style.layout.dataLabels.xAxis.fontSize, fill: e.value.style.layout.dataLabels.xAxis.color, "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal", transform: `translate(${t.value.left + a.value.width / 2 + t.value.width / g.value.xLabels.length * u + e.value.style.layout.dataLabels.xAxis.offsetX + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0)}, ${t.value.top + e.value.style.layout.dataLabels.xAxis.offsetY - 6 - (e.value.style.layout.cells.columnTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0)}), rotate(${e.value.style.layout.dataLabels.xAxis.rotation})` }, x(n), 9, Ol)) : d("", !0) ], 64))), 256)) ])) : d("", !0), e.value.style.layout.cells.columnTotal.value.show ? (o(!0), i(_, { key: 3 }, z(g.value.xLabels, (n, u) => (o(), i("text", { class: "vue-ui-heatmap-col-total", "text-anchor": e.value.style.layout.cells.columnTotal.value.rotation === 0 ? "middle" : e.value.style.layout.cells.columnTotal.value.rotation < 0 ? "end" : "start", "font-size": e.value.style.layout.dataLabels.xAxis.fontSize, fill: e.value.style.layout.dataLabels.xAxis.color, "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal", transform: `translate(${t.value.left + a.value.width / 2 + t.value.width / g.value.xLabels.length * u + e.value.style.layout.dataLabels.xAxis.offsetX + e.value.style.layout.cells.columnTotal.value.offsetX + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0)}, ${(a.value.height + e.value.style.layout.cells.spacing) * (B.dataset.length + 1) + e.value.style.layout.cells.columnTotal.value.offsetY}), rotate(${e.value.style.layout.cells.columnTotal.value.rotation})` }, x(Xe(u)), 9, Nl))), 256)) : d("", !0), G.value ? (o(), i("g", Vl, [ v("rect", { style: { "pointer-events": "none" }, x: G.value.x - e.value.style.layout.cells.selected.border / 2 + e.value.style.layout.cells.spacing + (e.value.style.layout.cells.rowTotal.color.show ? a.value.height / 3 + e.value.style.layout.cells.spacing : 0), y: G.value.y - e.value.style.layout.cells.selected.border / 2 + e.value.style.layout.cells.spacing, width: a.value.width - e.value.style.layout.cells.spacing + e.value.style.layout.cells.selected.border - e.value.style.layout.cells.spacing, height: a.value.height - e.value.style.layout.cells.spacing + e.value.style.layout.cells.selected.border - e.value.style.layout.cells.spacing, fill: "transparent", stroke: e.value.style.layout.cells.selected.color, "stroke-width": e.value.style.layout.cells.selected.border, rx: 1 }, null, 8, Fl) ])) : d("", !0), e.value.style.legend.show && q.value === "right" ? (o(), i("g", Il, [ v("defs", null, [ v("linearGradient", { id: `colorScaleVertical_${E.value}`, x2: "0%", y2: "100%" }, [ v("stop", { offset: "0%", "stop-color": e.value.style.layout.cells.colors.hot }, null, 8, Rl), v("stop", { offset: "100%", "stop-color": e.value.style.layout.cells.colors.cold }, null, 8, Xl) ], 8, Pl) ]), v("text", { x: t.value.right + 36 + 18, y: t.value.top - e.value.style.legend.fontSize * 1.5, "text-anchor": "middle", "font-size": e.value.style.legend.fontSize * 2, fill: e.value.style.legend.color }, x(r(O)( e.value.style.layout.cells.value.formatter, r(N)(C.value), r(M)({ p: e.value.style.layout.dataLabels.prefix, v: r(N)(C.value), s: e.value.style.layout.dataLabels.suffix, r: e.value.style.legend.roundingValue }) )), 9, Bl), v("rect", { x: t.value.right + 36, y: t.value.top, width: 36, height: oe.value, rx: e.value.style.legend.scaleBorderRadius, fill: `url(#colorScaleVertical_${E.value})` }, null, 8, El), v("text", { x: t.value.right + 36 + 18, y: t.value.top + oe.value + e.value.style.legend.fontSize * 2.5, "text-anchor": "middle", "font-size": e.value.style.legend.fontSize * 2, fill: e.value.style.legend.color }, x(r(O)( e.value.style.layout.cells.value.formatter, r(N)(F.value), r(M)({ p: e.value.style.layout.dataLabels.prefix, v: r(N)(F.value), s: e.value.style.layout.dataLabels.suffix, r: e.value.style.legend.roundingValue }) )), 9, Gl), S.value !== null ? (o(), i("line", { key: 0, stroke: r(ve)(U.value.datapoint.color), "stroke-width": "2", x1: t.value.right + 36, x2: t.value.right + 72, y1: Y.value, y2: Y.value }, null, 8, Ul)) : d("", !0), S.value !== null ? (o(), i("path", { key: 1, fill: e.value.style.color, stroke: "none", d: `M ${t.value.right + 36},${Y.value} ${t.value.right + 26},${Y.value - 8} ${t.value.right + 26},${Y.value + 8}z` }, null, 8, Yl)) : d("", !0) ])) : d("", !0), e.value.style.legend.show && q.value === "bottom" ? (o(), i("g", Hl, [ v("defs", null, [ v("linearGradient", Dl, [ v("stop", { offset: "0%", "stop-color": e.value.style.layout.cells.colors.cold }, null, 8, jl), v("stop", { offset: "100%", "stop-color": e.value.style.layout.cells.colors.hot }, null, 8, Wl) ]) ]), v("rect", { x: t.value.left, y: t.value.bottom + e.value.style.layout.cells.height, width: L.value.width - t.value.left - e.value.style.layout.padding.right, height: e.value.style.layout.cells.height, rx: e.value.style.legend.scaleBorderRadius > e.value.style.layout.cells.height / 2 ? e.value.style.layout.cells.height / 2 : e.value.style.legend.scaleBorderRadius, fill: "url(#colorScaleHorizontal)" }, null, 8, ql), v("text", { x: t.value.left, y: t.value.bottom + e.value.style.layout.cells.height * 2 + e.value.style.legend.fontSize * 2, "text-anchor": "start", "font-size": e.value.style.legend.fontSize * 2, fill: e.value.style.legend.color }, x(r(O)( e.value.style.layout.cells.value.formatter, r(N)(F.value), r(M)({ p: e.value.style.layout.dataLabels.prefix, v: r(N)(F.value), s: e.value.style.layout.dataLabels.suffix, r: e.value.style.legend.roundingValue }) )), 9, Kl), v("text", { x: t.value.right, y: t.value.bottom + e.value.style.layout.cells.height * 2 + e.value.style.legend.fontSize * 2, "text-anchor": "end", "font-size": e.value.style.legend.fontSize * 2, fill: e.value.style.legend.color }, x(r(O)( e.value.style.layout.cells.value.formatter, r(N)(C.value), r(M)({ p: e.value.style.layout.dataLabels.prefix, v: r(N)(C.value), s: e.value.style.layout.dataLabels.suffix, r: e.value.style.legend.roundingValue }) )), 9, Jl), S.value !== null ? (o(), i("line", { key: 0, stroke: r(ve)(U.value.datapoint.color), "stroke-width": "2", x1: H.value, x2: H.value, y1: t.value.bottom + e.value.style.layout.cells.height, y2: t.value.bottom + e.value.style.layout.cells.height * 2 }, null, 8, Ql)) : d("", !0), S.value !== null ? (o(), i("path", { key: 1, fill: e.value.style.color, stroke: "none", d: `M ${H.value},${t.value.bottom + e.value.style.layout.cells.height} ${H.value - 12},${t.value.bottom + e.value.style.layout.cells.height - 20} ${H.value + 12},${t.value.bottom + e.value.style.layout.cells.height - 20}z` }, null, 8, Zl)) : d("", !0) ])) : d("", !0), m(l.$slots, "svg", { svg: L.value }, void 0, !0) ], 14, pl)) : d("", !0), l.$slots.watermark ? (o(), i("div", et, [ m(l.$slots, "watermark", R(X({ isPrinting: r(xe) || r(we) })), void 0, !0) ])) : d("", !0), l.$slots.source ? (o(), i("div", lt, [ m(l.$slots, "source", {}, void 0, !0) ], 512)) : d("", !0), W.value ? d("", !0) : (o(), D(nl, { key: 7, config: { type: "heatmap", style: { backgroundColor: e.value.style.backgroundColor, heatmap: { color: "#CCCCCC" } } } }, null, 8, ["config"])), ie(ul, { show: $.value.showTooltip && ee.value, backgroundColor: e.value.style.tooltip.backgroundColor, color: e.value.style.tooltip.color, borderRadius: e.value.style.tooltip.borderRadius, borderColor: e.value.style.tooltip.borderColor, borderWidth: e.value.style.tooltip.borderWidth, fontSize: e.value.style.tooltip.fontSize, backgroundOpacity: e.value.style.tooltip.backgroundOpacity, position: e.value.style.tooltip.position, offsetY: e.value.style.tooltip.offsetY, parent: Z.value, content: le.value, isFullscreen: P.value, isCustom: e.value.style.tooltip.customFormat && typeof e.value.style.tooltip.customFormat == "function" }, { "tooltip-before": A(() => [ m(l.$slots, "tooltip-before", R(X({ ...U.value })), void 0, !0) ]), "tooltip-after": A(() => [ m(l.$slots, "tooltip-after", R(X({ ...U.value })), void 0, !0) ]), _: 3 }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]), W.value ? (o(), D(rl, { key: 8, hideDetails: "", config: { open: $.value.showTable, maxHeight: 1e4, body: { backgroundColor: e.value.style.backgroundColor, color: e.value.style.color }, head: { backgroundColor: e.value.style.backgroundColor, color: e.value.style.color } } }, { content: A(() => [ v("div", { ref_key: "tableContainer", ref: ce, class: "vue-ui-heatmap-table atom-data-table" }, [ v("div", { style: "width:100%;overflow-x:auto;padding-top:36px;position:relative", class: Q({ "vue-ui-responsive": he.value }) }, [ v("div", { role: "button", tabindex: "0", style: T(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${e.value.table.th.backgroundColor};`), onClick: s[1] || (s[1] = (n) => $.value.showTable = !1), onKeypress: s[2] || (s[2] = Ye((n) => $.value.showTable = !1, ["enter"])) }, [ ie(il, { name: "close", stroke: e.value.table.th.color, "stroke-width": 2 }, null, 8, ["stroke"]) ], 36), v("table", tt, [ v("caption", { style: T(`backgroundColor:${e.value.table.th.backgroundColor};color:${e.value.table.th.color};outline:${e.value.table.th.outline}`) }, [ He(x(e.value.style.title.text) + " ", 1), e.value.style.title.subtitle.text ? (o(), i("span", at, x(e.value.style.title.subtitle.text), 1)) : d("", !0) ], 4), v("thead", null, [ v("tr", { role: "row", style: T(`background:${e.value.table.th.backgroundColor};color:${e.value.table.th.color}`) }, [ v("th", { style: T(`outline:${e.value.table.th.outline};padding-right:6px`) }, null, 4), (o(!0), i(_, null, z(B.dataset, (n, u) => (o(), i("th", { align: "right", style: T(`outline:${e.value.table.th.outline};padding-right:6px`) }, x(n.name), 5))), 256)) ], 4) ]), v("tbody", null, [ (o(!0), i(_, null, z(g.value.xLabels, (n, u) => (o(), i("tr", { role: "row", class: Q({ "vue-ui-data-table__tbody__row": !0, "vue-ui-data-table__tbody__row-even": u % 2 === 0, "vue-ui-data-table__tbody__row-odd": u % 2 !== 0 }), style: T(`background:${e.value.table.td.backgroundColor};color:${e.value.table.td.color}`) }, [ v("td", { "data-cell": e.value.table.colNames.xAxis, class: "vue-ui-data-table__tbody__td", style: T(`outline:${e.value.table.td.outline}`) }, [ v("div", st, x(n), 1) ], 12, ot), (o(!0), i(_, null, z(B.dataset, (c, f) => (o(), i("td", { class: "vue-ui-data-table__tbody__td", "data-cell": B.dataset[f].name, style: T(`outline:${e.value.table.td.outline}`) }, [ v("div", nt, x(isNaN(c.values[u]) ? "-" : r(M)({ p: e.value.style.layout.dataLabels.prefix, v: c.values[u], s: e.value.style.layout.dataLabels.suffix, r: e.value.table.td.roundingValue })), 1) ], 12, ut))), 256)) ], 6))), 256)) ]) ]) ], 2) ], 512) ]), _: 1 }, 8, ["config"])) : d("", !0) ], 46, gl)); } }, _t = /* @__PURE__ */ hl(it, [["__scopeId", "data-v-f5643af6"]]); export { _t as default };