vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
749 lines (748 loc) • 34.8 kB
JavaScript
import { useCssVars as Re, computed as h, ref as p, watch as Ce, onMounted as Be, createElementBlock as n, openBlock as s, unref as u, normalizeStyle as k, normalizeClass as q, createBlock as H, createCommentVNode as c, createVNode as se, createSlots as Ee, withCtx as _, renderSlot as f, normalizeProps as V, guardReactiveProps as P, Fragment as A, renderList as M, createElementVNode as i, toDisplayString as b, withKeys as Ge, createTextVNode as Ue, nextTick as He } from "vue";
import { u as Xe, o as De, e as Le, c as ue, a as je, C as We, g as Ye, O as ne, X as qe, G as ie, i as I, f as S, v as T, q as Ke, r as Je, x as Qe, y as Ze } from "./index-CHWA6Lnw.js";
import { _ as et } from "./Title-BwZtefYd.js";
import { u as tt, U as lt } from "./usePrinter-DibtVl2x.js";
import { _ as at } from "./Tooltip-eCCz9HFo.js";
import ot from "./vue-ui-skeleton-BSUFPx4a.js";
import st from "./BaseIcon-AmoKryXo.js";
import ut from "./vue-ui-accordion-gHGrRoVr.js";
import { u as Ae } from "./useNestedProp-ByBiJC9_.js";
import { _ as nt } from "./PackageVersion-DcMafJMi.js";
import { P as it } from "./PenAndPaper-ljJaW1FE.js";
import { u as rt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as vt } from "./useChartAccessibility-BWojgys7.js";
import { _ as dt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const yt = ["id"], ct = {
key: 2,
style: "width:100%;background:transparent"
}, ht = ["xmlns", "viewBox"], pt = ["width", "height"], gt = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], ft = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], bt = ["font-size", "font-weight", "fill", "x", "y"], mt = ["x", "y", "width", "height", "onMouseover"], xt = { key: 0 }, wt = ["font-size", "fill", "x", "y", "font-weight"], kt = { key: 1 }, _t = ["text-anchor", "font-size", "fill", "font-weight", "transform"], $t = { key: 2 }, Ct = ["x", "y", "width", "height", "stroke", "stroke-width"], Lt = { key: 3 }, At = ["id"], Tt = ["stop-color"], zt = ["stop-color"], Ot = ["x", "y", "font-size", "fill"], Mt = ["x", "y", "height", "rx", "fill"], St = ["x", "y", "font-size", "fill"], Nt = ["stroke", "x1", "x2", "y1", "y2"], Ft = ["fill", "d"], Vt = { key: 4 }, Pt = {
id: "colorScaleHorizontal",
x1: "0%",
x2: "100%",
y1: "0%",
y2: "0%"
}, It = ["stop-color"], Rt = ["stop-color"], Bt = ["x", "y", "width", "height", "rx"], Et = ["x", "y", "font-size", "fill"], Gt = ["x", "y", "font-size", "fill"], Ut = ["stroke", "x1", "x2", "y1", "y2"], Ht = ["fill", "d"], Xt = {
key: 5,
class: "vue-data-ui-watermark"
}, Dt = {
key: 6,
ref: "source",
dir: "auto"
}, jt = { class: "vue-ui-data-table" }, Wt = { key: 0 }, Yt = ["data-cell"], qt = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, Kt = ["data-cell"], Jt = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, Qt = {
__name: "vue-ui-heatmap",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
setup(X, { expose: Te }) {
Re((t) => ({
d6e15a20: t.tdo
}));
const { vue_ui_heatmap: ze } = Xe(), v = X, D = h(() => !!v.dataset && v.dataset.length);
De(v.dataset) && Le({
componentName: "VueUiHeatmap",
type: "dataset"
});
const R = p(ue()), K = p(null), Oe = p(null), J = p(!1), Q = p(""), re = p(void 0), B = p(null), ve = p(0), de = p(null), Me = p(null), ye = p(!1), ce = p(0), e = h({
get: () => fe(),
set: (t) => t
}), { userOptionsVisible: Z, setUserOptionsVisibility: he, keepUserOptionState: pe } = rt({ config: e.value }), { svgRef: ge } = vt({ config: e.value.style.title });
function fe() {
const t = Ae({
userConfig: v.config,
defaultConfig: ze
});
let l = {};
return t.theme ? l = {
...Ae({
userConfig: je.vue_ui_heatmap[t.theme] || v.config,
defaultConfig: t
})
} : l = t, v.config && We(v.config, "style.layout.dataLabels.xAxis.showOnlyAtModulo") ? l.style.layout.dataLabels.xAxis.showOnlyAtModulo = v.config.style.layout.dataLabels.xAxis.showOnlyAtModulo : l.style.layout.dataLabels.xAxis.showOnlyAtModulo = null, l;
}
Ce(() => v.config, (t) => {
e.value = fe(), Z.value = !e.value.userOptions.showOnChartHover, ee(), ce.value += 1, m.value.showTable = e.value.table.show, m.value.showTooltip = e.value.style.tooltip.show;
}, { deep: !0 }), Ce(() => v.dataset, () => {
ee();
}, { deep: !0 });
const { isPrinting: be, isImaging: me, generatePdf: xe, generateImage: we } = tt({
elementId: `heatmap__${R.value}`,
fileName: e.value.style.title.text || "vue-ui-heatmap"
}), Se = h(() => e.value.userOptions.show && !e.value.style.title.text), m = p({
showTable: e.value.table.show,
showTooltip: e.value.style.tooltip.show
}), Ne = h(() => e.value.table.responsiveBreakpoint);
function Fe() {
new ResizeObserver((l) => {
l.forEach((o) => {
ye.value = o.contentRect.width < Ne.value;
});
}).observe(de.value);
}
Be(ee);
function ee() {
Fe();
}
const N = h(() => Math.max(...v.dataset.flatMap((t) => (t.values || []).length))), x = h(() => {
const t = e.value.style.layout.padding.top + e.value.style.layout.padding.bottom + v.dataset.length * e.value.style.layout.cells.height, l = e.value.style.layout.padding.left + e.value.style.layout.padding.right + (N.value < v.dataset.length ? v.dataset.length : N.value) * e.value.style.layout.cells.height, o = t + (e.value.style.legend.show ? e.value.style.legend.position === "right" ? 0 : e.value.style.layout.cells.height * 2 : 0);
return {
height: t,
heightWithLegend: o,
width: l
};
}), j = h(() => e.value.style.legend.position), a = h(() => ({
top: e.value.style.layout.padding.top,
left: e.value.style.layout.padding.left,
right: x.value.width - e.value.style.layout.padding.right - (j.value === "right" && e.value.style.legend.show ? 92 : 0),
bottom: x.value.height - e.value.style.layout.padding.bottom,
height: x.value.height - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom,
width: x.value.width - e.value.style.layout.padding.right - e.value.style.layout.padding.left - (j.value === "right" && e.value.style.legend.show ? 92 : 0)
})), te = h(() => d.value.height * v.dataset.length), w = h(() => Math.max(...v.dataset.flatMap((t) => t.values))), z = h(() => Math.min(...v.dataset.flatMap((t) => t.values))), O = h(() => {
const t = v.dataset.flatMap((o) => o.values);
return t.reduce((o, r) => o + r, 0) / t.length;
}), d = h(() => ({
width: a.value.width / N.value,
height: a.value.width / (N.value < v.dataset.length ? v.dataset.length : N.value)
})), $ = h(() => {
const t = e.value.style.layout.dataLabels.yAxis.values.length ? e.value.style.layout.dataLabels.yAxis.values : v.dataset.map((o) => o.name), l = e.value.style.layout.dataLabels.xAxis.values;
return {
yLabels: t,
xLabels: l.slice(0, N.value)
};
}), W = h(() => (v.dataset.forEach((t, l) => {
Ye({
datasetObject: t,
requiredAttributes: ["values"]
}).forEach((o) => {
Le({
componentName: "VueUiHeatmap",
type: "datasetSerieAttribute",
property: "values",
index: l
});
});
}), v.dataset.map((t) => ({
...t,
temperatures: (t.values || []).map((l, o) => l >= O.value ? {
side: "up",
color: ne(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, z.value, w.value, l),
ratio: Math.abs(Math.abs(l - O.value) / Math.abs(w.value - O.value)) > 1 ? 1 : Math.abs(Math.abs(l - O.value) / Math.abs(w.value - O.value)),
value: l,
yAxisName: t.name,
xAxisName: $.value.xLabels[o],
id: `vue-data-ui-heatmap-cell-${ue()}`
} : {
side: "down",
ratio: Math.abs(1 - Math.abs(l) / Math.abs(O.value)) > 1 ? 1 : Math.abs(1 - Math.abs(l) / Math.abs(O.value)),
color: ne(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, z.value, w.value, l),
value: l,
yAxisName: t.name,
xAxisName: $.value.xLabels[o],
id: `vue-data-ui-heatmap-cell-${ue()}`
})
})))), C = p(null), E = p(null);
function Ve(t, l, o, r) {
B.value = { x: o, y: r };
const { value: y, yAxisName: g, xAxisName: L, id: Ie } = t;
re.value = Ie, C.value = y, E.value = {
datapoint: t,
seriesIndex: l,
series: W.value,
config: e.value
}, J.value = !0;
let ae = "";
const oe = e.value.style.tooltip.customFormat;
Qe(oe) && Ze(() => oe({
datapoint: t,
seriesIndex: l,
series: W.value,
config: e.value
})) ? Q.value = oe({
datapoint: t,
seriesIndex: l,
series: W.value,
config: e.value
}) : (ae += `<div>${g} ${L ? `${L}` : ""}</div>`, ae += `<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:${ne(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, z.value, w.value, y)}">⬤</span><span>${isNaN(y) ? "-" : I(
e.value.style.layout.cells.value.formatter,
y,
S({
p: e.value.style.layout.dataLabels.prefix,
v: y,
s: e.value.style.layout.dataLabels.suffix,
r: e.value.style.tooltip.roundingValue
}),
{ datapoint: t, seriesIndex: l }
)}</span></div>`, Q.value = `<div style="font-size:${e.value.style.tooltip.fontSize}px">${ae}</div>`);
}
const G = h(() => a.value.top + te.value * (1 - C.value / w.value)), U = h(() => a.value.left + (x.value.width - a.value.left - e.value.style.layout.padding.right) * (C.value / w.value));
h(() => {
const t = v.dataset.map((o) => ({
name: o.name
})), l = v.dataset.map((o) => o.values);
return { head: t, body: l };
});
function ke() {
He(() => {
const t = ["", ...v.dataset.map((y, g) => y.name)], l = [];
for (let y = 0; y < $.value.xLabels.length; y += 1) {
const g = [$.value.xLabels[y]];
for (let L = 0; L < v.dataset.length; L += 1)
g.push([v.dataset[L].values[y]]);
l.push(g);
}
const o = [[e.value.style.title.text], [e.value.style.title.subtitle.text], [[""], [""], [""]]].concat([t]).concat(l), r = Ke(o);
Je({ csvContent: r, title: e.value.style.title.text || "vue-ui-heatmap" });
});
}
const F = p(!1);
function Pe(t) {
F.value = t, ve.value += 1;
}
function _e() {
m.value.showTable = !m.value.showTable;
}
function $e() {
m.value.showTooltip = !m.value.showTooltip;
}
const Y = p(!1);
function le() {
Y.value = !Y.value;
}
return Te({
generatePdf: xe,
generateCsv: ke,
generateImage: we,
toggleTable: _e,
toggleTooltip: $e,
toggleAnnotator: le
}), (t, l) => (s(), n("div", {
ref_key: "heatmapChart",
ref: K,
class: q(`vue-ui-heatmap ${F.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
style: k(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.backgroundColor}`),
id: `heatmap__${R.value}`,
onMouseenter: l[3] || (l[3] = () => u(he)(!0)),
onMouseleave: l[4] || (l[4] = () => u(he)(!1))
}, [
e.value.userOptions.buttons.annotator ? (s(), H(it, {
key: 0,
svgRef: u(ge),
backgroundColor: e.value.style.backgroundColor,
color: e.value.style.color,
active: Y.value,
onClose: le
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : c("", !0),
Se.value ? (s(), n("div", {
key: 1,
ref_key: "noTitle",
ref: Me,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : c("", !0),
e.value.style.title.text ? (s(), n("div", ct, [
(s(), H(et, {
key: `title_${ce.value}`,
config: {
title: {
cy: "heatmap-div-title",
...e.value.style.title
},
subtitle: {
cy: "heatmap-div-subtitle",
...e.value.style.title.subtitle
}
}
}, null, 8, ["config"]))
])) : c("", !0),
e.value.userOptions.show && D.value && (u(pe) || u(Z)) ? (s(), H(lt, {
ref_key: "details",
ref: Oe,
key: `user_options_${ve.value}`,
backgroundColor: e.value.style.backgroundColor,
color: e.value.style.color,
isImaging: u(me),
isPrinting: u(be),
uid: R.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: F.value,
isTooltip: m.value.showTooltip,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: K.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: Y.value,
onToggleFullscreen: Pe,
onGeneratePdf: u(xe),
onGenerateCsv: ke,
onGenerateImage: u(we),
onToggleTable: _e,
onToggleTooltip: $e,
onToggleAnnotator: le,
style: k({
visibility: u(pe) ? u(Z) ? "visible" : "hidden" : "visible"
})
}, Ee({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: _(({ isOpen: o, color: r }) => [
f(t.$slots, "menuIcon", V(P({ isOpen: o, color: r })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionTooltip ? {
name: "optionTooltip",
fn: _(() => [
f(t.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: _(() => [
f(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: _(() => [
f(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: _(() => [
f(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: _(() => [
f(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: _(({ toggleFullscreen: o, isFullscreen: r }) => [
f(t.$slots, "optionFullscreen", V(P({ toggleFullscreen: o, isFullscreen: r })), void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: _(({ toggleAnnotator: o, isAnnotator: r }) => [
f(t.$slots, "optionAnnotator", V(P({ toggleAnnotator: o, isAnnotator: r })), 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"])) : c("", !0),
D.value ? (s(), n("svg", {
key: 4,
ref_key: "svgRef",
ref: ge,
xmlns: u(qe),
class: q({ "vue-data-ui-fullscreen--on": F.value, "vue-data-ui-fulscreen--off": !F.value }),
viewBox: `0 0 ${x.value.width} ${x.value.heightWithLegend}`,
style: k(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.color}`)
}, [
se(nt),
t.$slots["chart-background"] ? (s(), n("foreignObject", {
key: 0,
x: 0,
y: 0,
width: x.value.width,
height: x.value.heightWithLegend,
style: {
pointerEvents: "none"
}
}, [
f(t.$slots, "chart-background", {}, void 0, !0)
], 8, pt)) : c("", !0),
(s(!0), n(A, null, M(W.value, (o, r) => (s(), n("g", null, [
(s(!0), n(A, null, M(o.temperatures, (y, g) => (s(), n("g", null, [
i("rect", {
x: a.value.left + d.value.width * g + e.value.style.layout.cells.spacing / 2,
y: a.value.top + d.value.height * r + e.value.style.layout.cells.spacing / 2,
width: d.value.width - e.value.style.layout.cells.spacing,
height: d.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, gt),
i("rect", {
x: a.value.left + d.value.width * g + e.value.style.layout.cells.spacing / 2,
y: a.value.top + d.value.height * r + e.value.style.layout.cells.spacing / 2,
width: d.value.width - e.value.style.layout.cells.spacing,
height: d.value.height - e.value.style.layout.cells.spacing,
fill: y.color,
stroke: e.value.style.backgroundColor,
"stroke-width": e.value.style.layout.cells.spacing
}, null, 8, ft),
e.value.style.layout.cells.value.show ? (s(), n("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: u(ie)(y.color),
x: a.value.left + d.value.width * g + d.value.width / 2,
y: a.value.top + d.value.height * r + d.value.height / 2 + e.value.style.layout.cells.value.fontSize / 3
}, b(u(I)(
e.value.style.layout.cells.value.formatter,
y.value,
u(S)({
p: e.value.style.layout.dataLabels.prefix,
v: y.value,
s: e.value.style.layout.dataLabels.suffix,
r: e.value.style.layout.cells.value.roundingValue
}),
{ datapoint: y }
)), 9, bt)) : c("", !0)
]))), 256)),
(s(!0), n(A, null, M(o.temperatures, (y, g) => (s(), n("g", null, [
i("rect", {
x: a.value.left + d.value.width * g,
y: a.value.top + d.value.height * r,
width: d.value.width,
height: d.value.height,
fill: "transparent",
stroke: "none",
onMouseover: (L) => Ve(y, r, a.value.left + d.value.width * g, a.value.top + d.value.height * r),
onMouseout: l[0] || (l[0] = (L) => {
J.value = !1, re.value = void 0, C.value = null, B.value = null;
})
}, null, 40, mt)
]))), 256)),
e.value.style.layout.dataLabels.yAxis.show ? (s(), n("g", xt, [
i("text", {
"font-size": e.value.style.layout.dataLabels.yAxis.fontSize,
fill: e.value.style.layout.dataLabels.yAxis.color,
x: a.value.left + e.value.style.layout.dataLabels.yAxis.offsetX - 6,
y: a.value.top + d.value.height * r + d.value.height / 2 + e.value.style.layout.dataLabels.yAxis.fontSize / 3 + e.value.style.layout.dataLabels.yAxis.offsetY,
"text-anchor": "end",
"font-weight": e.value.style.layout.dataLabels.yAxis.bold ? "bold" : "normal"
}, b($.value.yLabels[r]), 9, wt)
])) : c("", !0)
]))), 256)),
e.value.style.layout.dataLabels.xAxis.show ? (s(), n("g", kt, [
(s(!0), n(A, null, M($.value.xLabels, (o, r) => (s(), n(A, null, [
!e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo || e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo && r % e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo === 0 ? (s(), n("text", {
key: 0,
"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(${a.value.left + d.value.width / 2 + a.value.width / $.value.xLabels.length * r + e.value.style.layout.dataLabels.xAxis.offsetX}, ${a.value.top + e.value.style.layout.dataLabels.xAxis.offsetY - 6}), rotate(${e.value.style.layout.dataLabels.xAxis.rotation})`
}, b(o), 9, _t)) : c("", !0)
], 64))), 256))
])) : c("", !0),
B.value ? (s(), n("g", $t, [
i("rect", {
style: { "pointer-events": "none" },
x: B.value.x - e.value.style.layout.cells.selected.border / 2 + e.value.style.layout.cells.spacing,
y: B.value.y - e.value.style.layout.cells.selected.border / 2 + e.value.style.layout.cells.spacing,
width: d.value.width - e.value.style.layout.cells.spacing + e.value.style.layout.cells.selected.border - e.value.style.layout.cells.spacing,
height: d.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, Ct)
])) : c("", !0),
e.value.style.legend.show && j.value === "right" ? (s(), n("g", Lt, [
i("defs", null, [
i("linearGradient", {
id: `colorScaleVertical_${R.value}`,
x2: "0%",
y2: "100%"
}, [
i("stop", {
offset: "0%",
"stop-color": e.value.style.layout.cells.colors.hot
}, null, 8, Tt),
i("stop", {
offset: "100%",
"stop-color": e.value.style.layout.cells.colors.cold
}, null, 8, zt)
], 8, At)
]),
i("text", {
x: a.value.right + 36 + 18,
y: a.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
}, b(u(I)(
e.value.style.layout.cells.value.formatter,
u(T)(w.value),
u(S)({
p: e.value.style.layout.dataLabels.prefix,
v: u(T)(w.value),
s: e.value.style.layout.dataLabels.suffix,
r: e.value.style.legend.roundingValue
})
)), 9, Ot),
i("rect", {
x: a.value.right + 36,
y: a.value.top,
width: 36,
height: te.value,
rx: e.value.style.legend.scaleBorderRadius,
fill: `url(#colorScaleVertical_${R.value})`
}, null, 8, Mt),
i("text", {
x: a.value.right + 36 + 18,
y: a.value.top + te.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
}, b(u(I)(
e.value.style.layout.cells.value.formatter,
u(T)(z.value),
u(S)({
p: e.value.style.layout.dataLabels.prefix,
v: u(T)(z.value),
s: e.value.style.layout.dataLabels.suffix,
r: e.value.style.legend.roundingValue
})
)), 9, St),
C.value !== null ? (s(), n("line", {
key: 0,
stroke: u(ie)(E.value.datapoint.color),
"stroke-width": "2",
x1: a.value.right + 36,
x2: a.value.right + 72,
y1: G.value,
y2: G.value
}, null, 8, Nt)) : c("", !0),
C.value !== null ? (s(), n("path", {
key: 1,
fill: e.value.style.color,
stroke: "none",
d: `M ${a.value.right + 36},${G.value} ${a.value.right + 26},${G.value - 8} ${a.value.right + 26},${G.value + 8}z`
}, null, 8, Ft)) : c("", !0)
])) : c("", !0),
e.value.style.legend.show && j.value === "bottom" ? (s(), n("g", Vt, [
i("defs", null, [
i("linearGradient", Pt, [
i("stop", {
offset: "0%",
"stop-color": e.value.style.layout.cells.colors.cold
}, null, 8, It),
i("stop", {
offset: "100%",
"stop-color": e.value.style.layout.cells.colors.hot
}, null, 8, Rt)
])
]),
i("rect", {
x: a.value.left,
y: a.value.bottom + e.value.style.layout.cells.height,
width: x.value.width - a.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, Bt),
i("text", {
x: a.value.left,
y: a.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
}, b(u(I)(
e.value.style.layout.cells.value.formatter,
u(T)(z.value),
u(S)({
p: e.value.style.layout.dataLabels.prefix,
v: u(T)(z.value),
s: e.value.style.layout.dataLabels.suffix,
r: e.value.style.legend.roundingValue
})
)), 9, Et),
i("text", {
x: a.value.right,
y: a.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
}, b(u(I)(
e.value.style.layout.cells.value.formatter,
u(T)(w.value),
u(S)({
p: e.value.style.layout.dataLabels.prefix,
v: u(T)(w.value),
s: e.value.style.layout.dataLabels.suffix,
r: e.value.style.legend.roundingValue
})
)), 9, Gt),
C.value !== null ? (s(), n("line", {
key: 0,
stroke: u(ie)(E.value.datapoint.color),
"stroke-width": "2",
x1: U.value,
x2: U.value,
y1: a.value.bottom + e.value.style.layout.cells.height,
y2: a.value.bottom + e.value.style.layout.cells.height * 2
}, null, 8, Ut)) : c("", !0),
C.value !== null ? (s(), n("path", {
key: 1,
fill: e.value.style.color,
stroke: "none",
d: `M ${U.value},${a.value.bottom + e.value.style.layout.cells.height} ${U.value - 12},${a.value.bottom + e.value.style.layout.cells.height - 20} ${U.value + 12},${a.value.bottom + e.value.style.layout.cells.height - 20}z`
}, null, 8, Ht)) : c("", !0)
])) : c("", !0),
f(t.$slots, "svg", { svg: x.value }, void 0, !0)
], 14, ht)) : c("", !0),
t.$slots.watermark ? (s(), n("div", Xt, [
f(t.$slots, "watermark", V(P({ isPrinting: u(be) || u(me) })), void 0, !0)
])) : c("", !0),
t.$slots.source ? (s(), n("div", Dt, [
f(t.$slots, "source", {}, void 0, !0)
], 512)) : c("", !0),
D.value ? c("", !0) : (s(), H(ot, {
key: 7,
config: {
type: "heatmap",
style: {
backgroundColor: e.value.style.backgroundColor,
heatmap: {
color: "#CCCCCC"
}
}
}
}, null, 8, ["config"])),
se(at, {
show: m.value.showTooltip && J.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: K.value,
content: Q.value,
isFullscreen: F.value,
isCustom: e.value.style.tooltip.customFormat && typeof e.value.style.tooltip.customFormat == "function"
}, {
"tooltip-before": _(() => [
f(t.$slots, "tooltip-before", V(P({ ...E.value })), void 0, !0)
]),
"tooltip-after": _(() => [
f(t.$slots, "tooltip-after", V(P({ ...E.value })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
D.value ? (s(), H(ut, {
key: 8,
hideDetails: "",
config: {
open: m.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: _(() => [
i("div", {
ref_key: "tableContainer",
ref: de,
class: "vue-ui-heatmap-table atom-data-table"
}, [
i("div", {
style: "width:100%;overflow-x:auto;padding-top:36px;position:relative",
class: q({ "vue-ui-responsive": ye.value })
}, [
i("div", {
role: "button",
tabindex: "0",
style: k(`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: l[1] || (l[1] = (o) => m.value.showTable = !1),
onKeypress: l[2] || (l[2] = Ge((o) => m.value.showTable = !1, ["enter"]))
}, [
se(st, {
name: "close",
stroke: e.value.table.th.color,
"stroke-width": 2
}, null, 8, ["stroke"])
], 36),
i("table", jt, [
i("caption", {
style: k(`backgroundColor:${e.value.table.th.backgroundColor};color:${e.value.table.th.color};outline:${e.value.table.th.outline}`)
}, [
Ue(b(e.value.style.title.text) + " ", 1),
e.value.style.title.subtitle.text ? (s(), n("span", Wt, b(e.value.style.title.subtitle.text), 1)) : c("", !0)
], 4),
i("thead", null, [
i("tr", {
role: "row",
style: k(`background:${e.value.table.th.backgroundColor};color:${e.value.table.th.color}`)
}, [
i("th", {
style: k(`outline:${e.value.table.th.outline};padding-right:6px`)
}, null, 4),
(s(!0), n(A, null, M(X.dataset, (o, r) => (s(), n("th", {
align: "right",
style: k(`outline:${e.value.table.th.outline};padding-right:6px`)
}, b(o.name), 5))), 256))
], 4)
]),
i("tbody", null, [
(s(!0), n(A, null, M($.value.xLabels, (o, r) => (s(), n("tr", {
role: "row",
class: q({ "vue-ui-data-table__tbody__row": !0, "vue-ui-data-table__tbody__row-even": r % 2 === 0, "vue-ui-data-table__tbody__row-odd": r % 2 !== 0 }),
style: k(`background:${e.value.table.td.backgroundColor};color:${e.value.table.td.color}`)
}, [
i("td", {
"data-cell": e.value.table.colNames.xAxis,
class: "vue-ui-data-table__tbody__td",
style: k(`outline:${e.value.table.td.outline}`)
}, [
i("div", qt, b(o), 1)
], 12, Yt),
(s(!0), n(A, null, M(X.dataset, (y, g) => (s(), n("td", {
class: "vue-ui-data-table__tbody__td",
"data-cell": X.dataset[g].name,
style: k(`outline:${e.value.table.td.outline}`)
}, [
i("div", Jt, b(isNaN(y.values[r]) ? "-" : u(S)({ p: e.value.style.layout.dataLabels.prefix, v: y.values[r], s: e.value.style.layout.dataLabels.suffix, r: e.value.table.td.roundingValue })), 1)
], 12, Kt))), 256))
], 6))), 256))
])
])
], 2)
], 512)
]),
_: 1
}, 8, ["config"])) : c("", !0)
], 46, yt));
}
}, cl = /* @__PURE__ */ dt(Qt, [["__scopeId", "data-v-83ad9004"]]);
export {
cl as default
};