vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
733 lines (732 loc) • 30.5 kB
JavaScript
import { computed as f, ref as n, watch as Ue, onMounted as Ve, onBeforeUnmount as Ee, createElementBlock as u, openBlock as s, unref as v, normalizeStyle as B, normalizeClass as M, createBlock as T, createCommentVNode as c, createVNode as _e, createSlots as He, withCtx as y, renderSlot as p, normalizeProps as O, guardReactiveProps as z, createElementVNode as k, Fragment as g, renderList as w, toDisplayString as L, mergeProps as Be, createTextVNode as Xe, nextTick as je } from "vue";
import { u as Ye, c as ee, t as qe, p as A, a as Je, o as Ke, e as te, g as Te, b as Qe, d as Le, v as Ze, D as et, f as X, X as tt, i as le, l as lt, h as at, x as Ae, F as ot, q as st, r as rt, y as ut } from "./index-BaaDnc4F.js";
import { t as it, u as nt } from "./useResponsive-vZgZwV-S.js";
import { _ as vt } from "./Title-D_MGglyN.js";
import { u as ct, U as ht } from "./usePrinter-y4-4tCWT.js";
import { _ as dt } from "./Tooltip-HRgkF8HD.js";
import { D as pt } from "./DataTable-DvwmNjb-.js";
import ft from "./vue-ui-skeleton-6RiQNJSb.js";
import { _ as yt } from "./Shape-BuwIrUMv.js";
import bt from "./vue-ui-accordion-CF9kQTXq.js";
import { u as Pe } from "./useNestedProp-D8vQcOps.js";
import { _ as mt } from "./PackageVersion-D9Lm1C1X.js";
import { P as gt } from "./PenAndPaper-DR58HO_U.js";
import { u as kt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as xt } from "./useChartAccessibility-BWojgys7.js";
import { _ as wt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Ct = ["id"], $t = ["xmlns", "viewBox"], _t = ["x", "y", "width", "height"], Tt = { key: 1 }, Lt = { key: 0 }, At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Pt = { key: 1 }, St = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], zt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Nt = ["x", "y", "fill", "font-size"], Ft = ["x", "y", "font-size", "fill"], It = ["fill", "font-size", "transform"], Mt = ["fill", "font-size", "x", "y"], Wt = ["x1", "x2", "y1", "y2", "stroke"], Dt = ["cx", "cy", "fill"], Gt = ["cx", "cy", "fill"], Rt = ["id"], Ut = ["stop-color"], Vt = ["stop-color"], Et = ["stop-color"], Ht = { key: 0 }, Bt = ["x", "y", "font-size", "fill"], Xt = {
key: 5,
class: "vue-data-ui-watermark"
}, jt = ["innerHTML"], Yt = {
__name: "vue-ui-strip-plot",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectDatapoint"],
setup(Se, { expose: Oe, emit: ze }) {
const { vue_ui_strip_plot: Ne } = Ye(), b = Se, Fe = ze, C = f({
get() {
return !!b.dataset && b.dataset.length;
},
set(t) {
return t;
}
}), j = n(ee()), ae = n(0), Y = n(!1), q = n(""), N = n(null), oe = n(null), se = n(null), re = n(null), ue = n(!1), ie = n(0), ne = n(0), e = f({
get: () => de(),
set: (t) => t
}), { userOptionsVisible: J, setUserOptionsVisibility: ve, keepUserOptionState: ce } = kt({ config: e.value }), { svgRef: he } = xt({ config: e.value.style.chart.title });
function de() {
const t = Pe({
userConfig: b.config,
defaultConfig: Ne
});
return t.theme ? {
...Pe({
userConfig: Je.vue_ui_strip_plot[t.theme] || b.config,
defaultConfig: t
}),
customPalette: qe[t.theme] || A
} : t;
}
Ue(() => b.config, (t) => {
e.value = de(), J.value = !e.value.userOptions.showOnChartHover, pe(), ie.value += 1, ne.value += 1, d.value.dataLabels.show = e.value.style.chart.labels.bestPlotLabel.show, d.value.showTable = e.value.table.show, d.value.showTooltip = e.value.style.chart.tooltip.show;
}, { deep: !0 });
const W = n(null);
Ve(() => {
pe();
});
function pe() {
if (Ke(b.dataset) ? te({
componentName: "VueUiStripPlot",
type: "dataset"
}) : b.dataset.forEach((t, o) => {
Te({
datasetObject: t,
requiredAttributes: ["name", "plots"]
}).forEach((l) => {
C.value = !1, te({
componentName: "VueUiStripPlot",
type: "datasetSerieAttribute",
property: l,
index: o
});
}), t.plots && t.plots.forEach((l, r) => {
Te({
datasetObject: l,
requiredAttributes: ["name", "value"]
}).forEach((i) => {
C.value = !1, te({
componentName: "VueUiStripPlot",
type: "datasetSerieAttribute",
property: i,
index: `${o},${r}`
});
});
});
}), e.value.responsive) {
const t = it(() => {
const { width: o, height: l } = nt({
chart: N.value,
title: e.value.style.chart.title.text ? oe.value : null,
source: se.value,
noTitle: re.value
});
requestAnimationFrame(() => {
D.value = l, P.value.width = o, P.value.height = l, I.value = (o - m.value.left - m.value.right) / b.dataset.length, G.value = ot({
relator: Math.min(l, o),
adjuster: 600,
source: e.value.style.chart.plots.radius,
threshold: 6,
fallback: 6
});
});
});
W.value = new ResizeObserver(t), W.value.observe(N.value.parentNode);
}
ue.value = !0, setTimeout(() => {
F.value = !1;
}, Me.value * 50);
}
Ee(() => {
W.value && W.value.disconnect();
});
const { isPrinting: fe, isImaging: ye, generatePdf: be, generateImage: me } = ct({
elementId: `strip-plot_${j.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-strip-plot"
}), Ie = f(() => e.value.userOptions.show && !e.value.style.chart.title.text), ge = f(() => Qe(e.value.customPalette)), F = n(e.value.useCssAnimation), d = n({
showTable: e.value.table.show,
dataLabels: {
show: e.value.style.chart.labels.bestPlotLabel.show
},
showTooltip: e.value.style.chart.tooltip.show
}), m = n({
top: e.value.style.chart.padding.top,
bottom: e.value.style.chart.padding.bottom,
left: e.value.style.chart.padding.left,
right: e.value.style.chart.padding.right
}), I = n(e.value.style.chart.stripWidth), D = n(e.value.style.chart.height), G = n(e.value.style.chart.plots.radius), P = n({
width: I.value * b.dataset.length + m.value.left + m.value.right,
height: e.value.style.chart.height
}), a = f(() => {
const t = I.value * b.dataset.length + m.value.left + m.value.right;
return {
left: m.value.left,
right: t - m.value.right,
top: m.value.top,
bottom: D.value - m.value.bottom,
width: I.value * b.dataset.length,
height: D.value - m.value.top - m.value.bottom,
stripWidth: I.value,
absoluteHeight: D.value,
absoluteWidth: t
};
}), R = f(() => C.value ? b.dataset.map((t, o) => {
const l = ee();
return {
...t,
id: l,
color: t.color ? Le(t.color) : ge.value[o] || A[o] || A[o % A.length],
plots: t.plots.map((r) => ({
...r,
value: Ze(r.value),
parentId: l,
color: t.color ? Le(t.color) : ge.value[o] || A[o] || A[o % A.length],
id: ee()
})).sort((r, i) => r.value - i.value)
};
}) : null), x = f(() => (R.value || []).map((t, o) => ({
...t,
plots: t.plots.map((l) => ({
...l,
x: a.value.left + (o + 1) * a.value.stripWidth - a.value.stripWidth / 2
}))
}))), Me = f(() => Math.max(...x.value.map((t) => t.plots.length))), K = f(() => {
const t = x.value.flatMap((o) => o.plots.map((l) => l.value));
return {
max: Math.max(...t),
min: Math.min(...t)
};
}), $ = f(() => et(K.value.min < 0 ? K.value.min : 0, K.value.max, e.value.style.chart.grid.scaleSteps)), We = f(() => (x.value || []).map((t, o) => ({
...t,
plots: t.plots.map((l) => ({
...l,
y: a.value.bottom - (l.value + Math.abs($.value.min)) / ($.value.max + Math.abs($.value.min)) * a.value.height
}))
}))), ke = f(() => $.value.ticks.map((t) => ({
y: a.value.bottom - a.value.height * ((t + Math.abs($.value.min)) / ($.value.max + Math.abs($.value.min))),
x1: a.value.left,
x2: a.value.right,
value: t
}))), Q = n(null), h = n(null);
function De({ datapoint: t, seriesIndex: o }) {
Q.value = { datapoint: t, seriesIndex: o, config: e.value, series: R.value }, Y.value = !0, h.value = t;
const l = e.value.style.chart.tooltip.customFormat;
if (Ae(l) && ut(() => l({
seriesIndex: o,
datapoint: t,
series: R.value,
config: e.value
})))
q.value = l({
seriesIndex: o,
datapoint: t,
series: R.value,
config: e.value
});
else {
let r = "";
r += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${e.value.style.chart.plots.gradient.show ? `url(#${t.parentId})` : t.color}"/></svg>${t.name}</div>`, r += `<div>${le(
e.value.style.chart.labels.formatter,
t.value,
X({
p: e.value.style.chart.labels.prefix,
v: t.value,
s: e.value.style.chart.labels.suffix,
r: e.value.style.chart.tooltip.roundingValue
}),
{ datapoint: t, seriesIndex: o }
)}</div>`, q.value = `<div>${r}</div>`;
}
}
const U = f(() => {
const t = x.value.flatMap((l) => JSON.parse(JSON.stringify(l.plots)).sort((r, i) => i.value - r.value).map((r) => ({
name: `${l.name} - ${r.name}`,
color: r.color
}))), o = x.value.flatMap((l) => JSON.parse(JSON.stringify(l.plots)).sort((r, i) => i.value - r.value).map((r) => r.value));
return { head: t, body: o };
});
function xe() {
je(() => {
const t = U.value.head.map((r, i) => [[
r.name
], [U.value.body[i]]]), o = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[e.value.table.columnNames.series], [e.value.table.columnNames.value]]].concat(t), l = st(o);
rt({ csvContent: l, title: e.value.style.chart.title.text || "vue-ui-strip-plot" });
});
}
const V = f(() => {
const t = [
e.value.table.columnNames.series,
e.value.table.columnNames.value
], o = U.value.head.map((i, _) => {
const H = X({
p: e.value.style.chart.labels.prefix,
v: U.value.body[_],
s: e.value.style.chart.labels.suffix,
r: e.value.table.td.roundingValue
});
return [
{
color: i.color,
name: i.name
},
H
];
}), l = {
th: {
backgroundColor: e.value.table.th.backgroundColor,
color: e.value.table.th.color,
outline: e.value.table.th.outline
},
td: {
backgroundColor: e.value.table.td.backgroundColor,
color: e.value.table.td.color,
outline: e.value.table.td.outline
},
breakpoint: e.value.table.responsiveBreakpoint
};
return {
colNames: [
e.value.table.columnNames.series,
e.value.table.columnNames.value
],
head: t,
body: o,
config: l
};
}), S = n(!1);
function Ge(t) {
S.value = t, ae.value += 1;
}
function Re() {
return x.value;
}
function we() {
d.value.showTable = !d.value.showTable;
}
function Ce() {
d.value.dataLabels.show = !d.value.dataLabels.show;
}
function $e() {
d.value.showTooltip = !d.value.showTooltip;
}
const E = n(!1);
function Z() {
E.value = !E.value;
}
return Oe({
getData: Re,
generatePdf: be,
generateCsv: xe,
generateImage: me,
toggleTable: we,
toggleLabels: Ce,
toggleTooltip: $e,
toggleAnnotator: Z
}), (t, o) => (s(), u("div", {
ref_key: "stripPlotChart",
ref: N,
class: M(`vue-ui-strip-plot ${S.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
style: B(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
id: `strip-plot_${j.value}`,
onMouseenter: o[2] || (o[2] = () => v(ve)(!0)),
onMouseleave: o[3] || (o[3] = () => v(ve)(!1))
}, [
e.value.userOptions.buttons.annotator ? (s(), T(gt, {
key: 0,
svgRef: v(he),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: E.value,
onClose: Z
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : c("", !0),
Ie.value ? (s(), u("div", {
key: 1,
ref_key: "noTitle",
ref: re,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : c("", !0),
e.value.style.chart.title.text ? (s(), u("div", {
key: 2,
ref_key: "chartTitle",
ref: oe,
style: "width:100%;background:transparent;padding-bottom:24px"
}, [
(s(), T(vt, {
key: `title_${ie.value}`,
config: {
title: {
cy: "donut-div-title",
...e.value.style.chart.title
},
subtitle: {
cy: "donut-div-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 512)) : c("", !0),
e.value.userOptions.show && C.value && (v(ce) || v(J)) ? (s(), T(ht, {
ref: "details",
key: `user_option_${ae.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: v(fe),
isImaging: v(ye),
uid: j.value,
hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
hasPdf: e.value.userOptions.buttons.pdf,
hasXls: e.value.userOptions.buttons.csv,
hasImg: e.value.userOptions.buttons.img,
hasTable: e.value.userOptions.buttons.table,
hasLabel: e.value.userOptions.buttons.labels,
hasFullscreen: e.value.userOptions.buttons.fullscreen,
isTooltip: d.value.showTooltip,
isFullscreen: S.value,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: N.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: E.value,
onToggleFullscreen: Ge,
onGeneratePdf: v(be),
onGenerateCsv: xe,
onGenerateImage: v(me),
onToggleTable: we,
onToggleLabels: Ce,
onToggleTooltip: $e,
onToggleAnnotator: Z,
style: B({
visibility: v(ce) ? v(J) ? "visible" : "hidden" : "visible"
})
}, He({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: y(({ isOpen: l, color: r }) => [
p(t.$slots, "menuIcon", O(z({ isOpen: l, color: r })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionTooltip ? {
name: "optionTooltip",
fn: y(() => [
p(t.$slots, "optionTooltip", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: y(() => [
p(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: y(() => [
p(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: y(() => [
p(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: y(() => [
p(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionLabels ? {
name: "optionLabels",
fn: y(() => [
p(t.$slots, "optionLabels", {}, void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: y(({ toggleFullscreen: l, isFullscreen: r }) => [
p(t.$slots, "optionFullscreen", O(z({ toggleFullscreen: l, isFullscreen: r })), void 0, !0)
]),
key: "7"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: y(({ toggleAnnotator: l, isAnnotator: r }) => [
p(t.$slots, "optionAnnotator", O(z({ toggleAnnotator: l, isAnnotator: r })), void 0, !0)
]),
key: "8"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasLabel", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : c("", !0),
C.value ? (s(), u("svg", {
key: 4,
ref_key: "svgRef",
ref: he,
xmlns: v(tt),
class: M({ "vue-data-ui-fullscreen--on": S.value, "vue-data-ui-fulscreen--off": !S.value }),
viewBox: `0 0 ${P.value.width <= 0 ? 10 : P.value.width} ${P.value.height <= 0 ? 10 : P.value.height}`,
style: B(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color};`)
}, [
_e(mt),
t.$slots["chart-background"] ? (s(), u("foreignObject", {
key: 0,
x: a.value.left,
y: a.value.top,
width: a.value.width,
height: a.value.height,
style: {
pointerEvents: "none"
}
}, [
p(t.$slots, "chart-background", {}, void 0, !0)
], 8, _t)) : c("", !0),
e.value.style.chart.grid.show ? (s(), u("g", Tt, [
e.value.style.chart.grid.horizontalGrid.show ? (s(), u("g", Lt, [
(s(!0), u(g, null, w(ke.value, (l) => (s(), u("line", {
x1: l.x1,
x2: l.x2,
y1: l.y,
y2: l.y,
stroke: e.value.style.chart.grid.horizontalGrid.stroke,
"stroke-width": e.value.style.chart.grid.horizontalGrid.strokeWidth,
"stroke-dasharray": e.value.style.chart.grid.horizontalGrid.strokeDasharray,
"stroke-linecap": "round"
}, null, 8, At))), 256))
])) : c("", !0),
e.value.style.chart.grid.verticalGrid.show ? (s(), u("g", Pt, [
(s(!0), u(g, null, w(x.value, (l, r) => (s(), u("line", {
x1: a.value.left + (r + 1) * a.value.stripWidth,
x2: a.value.left + (r + 1) * a.value.stripWidth,
y1: a.value.top,
y2: a.value.bottom,
stroke: e.value.style.chart.grid.verticalGrid.stroke,
"stroke-width": e.value.style.chart.grid.verticalGrid.strokeWidth,
"stroke-dasharray": e.value.style.chart.grid.verticalGrid.strokeDasharray,
"stroke-linecap": "round"
}, null, 8, St))), 256))
])) : c("", !0),
k("line", {
x1: a.value.left,
x2: a.value.left,
y1: a.value.top,
y2: a.value.bottom,
stroke: e.value.style.chart.grid.stroke,
"stroke-width": e.value.style.chart.grid.strokeWidth,
"stroke-linecap": "round"
}, null, 8, Ot),
k("line", {
x1: a.value.left,
x2: a.value.right,
y1: a.value.bottom,
y2: a.value.bottom,
stroke: e.value.style.chart.grid.stroke,
"stroke-width": e.value.style.chart.grid.strokeWidth,
"stroke-linecap": "round"
}, null, 8, zt)
])) : c("", !0),
e.value.style.chart.labels.yAxisLabels.show ? (s(!0), u(g, { key: 2 }, w(ke.value, (l, r) => (s(), u("text", {
x: l.x1 - e.value.style.chart.labels.yAxisLabels.fontSize / 2 + e.value.style.chart.labels.yAxisLabels.offsetX,
y: l.y + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
fill: e.value.style.chart.labels.yAxisLabels.color,
"font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
"text-anchor": "end"
}, L(v(le)(
e.value.style.chart.labels.formatter,
l.value,
v(X)({
p: e.value.style.chart.labels.prefix,
v: l.value,
s: e.value.style.chart.labels.suffix,
r: e.value.style.chart.labels.yAxisLabels.rounding
}),
{ datapoint: l, seriesIndex: r }
)), 9, Nt))), 256)) : c("", !0),
e.value.style.chart.labels.xAxisLabels.show ? (s(!0), u(g, { key: 3 }, w(x.value, (l, r) => (s(), u("text", {
x: a.value.left + (r + 1) * a.value.stripWidth - a.value.stripWidth / 2,
y: a.value.bottom + e.value.style.chart.labels.xAxisLabels.fontSize * 2 + e.value.style.chart.labels.xAxisLabels.offsetY,
"font-size": e.value.style.chart.labels.xAxisLabels.fontSize,
fill: e.value.style.chart.labels.xAxisLabels.color,
"text-anchor": "middle"
}, L(l.name), 9, Ft))), 256)) : c("", !0),
e.value.style.chart.labels.axis.yLabel ? (s(), u("text", {
key: 4,
fill: e.value.style.chart.labels.axis.color,
"font-size": e.value.style.chart.labels.axis.fontSize,
transform: `translate(${e.value.style.chart.labels.axis.fontSize + e.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top + a.value.height / 2}) rotate(-90)`,
"text-anchor": "middle"
}, L(e.value.style.chart.labels.axis.yLabel), 9, It)) : c("", !0),
e.value.style.chart.labels.axis.xLabel ? (s(), u("text", {
key: 5,
fill: e.value.style.chart.labels.axis.color,
"font-size": e.value.style.chart.labels.axis.fontSize,
x: a.value.left + a.value.width / 2,
y: a.value.absoluteHeight,
"text-anchor": "middle"
}, L(e.value.style.chart.labels.axis.xLabel), 9, Mt)) : c("", !0),
h.value ? (s(), u(g, { key: 6 }, [
k("line", {
x1: a.value.left,
x2: a.value.right,
y1: h.value.y,
y2: h.value.y,
stroke: h.value.color,
"stroke-width": 1,
class: M({ "select-circle": e.value.useCssAnimation })
}, null, 10, Wt),
k("circle", {
cx: a.value.left,
cy: h.value.y,
r: 3,
fill: h.value.color,
class: M({ "select-circle": e.value.useCssAnimation })
}, null, 10, Dt),
k("circle", {
cx: a.value.right,
cy: h.value.y,
r: 3,
fill: h.value.color,
class: M({ "select-circle": e.value.useCssAnimation })
}, null, 10, Gt)
], 64)) : c("", !0),
k("defs", null, [
(s(!0), u(g, null, w(x.value, (l) => (s(), u("radialGradient", {
id: l.id,
fy: "30%"
}, [
k("stop", {
offset: "10%",
"stop-color": v(lt)(l.color, e.value.style.chart.plots.gradient.intensity / 100)
}, null, 8, Ut),
k("stop", {
offset: "90%",
"stop-color": v(at)(l.color, 0.1)
}, null, 8, Vt),
k("stop", {
offset: "100%",
"stop-color": l.color
}, null, 8, Et)
], 8, Rt))), 256))
]),
(s(!0), u(g, null, w(We.value, (l, r) => (s(), u(g, null, [
(s(!0), u(g, null, w(l.plots, (i, _) => (s(), T(yt, Be({
plot: { x: i.x, y: ue.value ? i.y : a.value.top },
radius: h.value && h.value.id === i.id ? G.value * 1.5 : G.value,
shape: e.value.style.chart.plots.shape,
stroke: e.value.style.chart.plots.stroke,
strokeWidth: e.value.style.chart.plots.strokeWidth,
color: e.value.style.chart.plots.gradient.show ? `url(#${l.id})` : l.color,
onMouseenter: (H) => De({ datapoint: i, seriesIndex: _ }),
onMouseleave: o[0] || (o[0] = (H) => {
Y.value = !1, h.value = null;
}),
onClick: (H) => Fe("selectDatapoint", i),
style: `transition: all 0.2s ease-in-out; opacity:${h.value ? h.value.id === i.id ? 1 : 0.2 : e.value.style.chart.plots.opacity};${F.value ? `transition-delay:${_ * 50}ms` : ""}`,
class: { "vue-ui-strip-plot-animated": e.value.useCssAnimation && F.value, "vue-ui-strip-plot-select-circle": e.value.useCssAnimation && !F.value },
ref_for: !0
}, t.$attrs), null, 16, ["plot", "radius", "shape", "stroke", "strokeWidth", "color", "onMouseenter", "onClick", "style", "class"]))), 256)),
d.value.dataLabels.show ? (s(), u("g", Ht, [
(s(!0), u(g, null, w(l.plots, (i, _) => (s(), u(g, null, [
_ === l.plots.length - 1 || h.value && h.value.id === i.id && !d.value.showTooltip ? (s(), u("text", {
key: 0,
x: i.x,
y: i.y + e.value.style.chart.labels.bestPlotLabel.offsetY - G.value * (h.value && h.value.id === i.id && !d.value.showTooltip ? 2 : 1.5),
"font-size": e.value.style.chart.labels.bestPlotLabel.fontSize,
fill: e.value.style.chart.labels.bestPlotLabel.color,
"text-anchor": "middle",
style: B(`opacity:${e.value.useCssAnimation && F.value ? 0 : 1};transition:opacity 0.2s ease-in;`)
}, L(i.name) + " " + L(e.value.style.chart.labels.bestPlotLabel.showValue ? v(le)(
e.value.style.chart.labels.formatter,
i.value,
v(X)({
p: `(${e.value.style.chart.labels.prefix}`,
v: i.value,
s: `${e.value.style.chart.labels.suffix})`,
r: e.value.style.chart.labels.bestPlotLabel.rounding
}),
{ datapoint: i, seriesIndex: _ }
) : ""), 13, Bt)) : c("", !0)
], 64))), 256))
])) : c("", !0)
], 64))), 256)),
p(t.$slots, "svg", { svg: a.value }, void 0, !0)
], 14, $t)) : c("", !0),
t.$slots.watermark ? (s(), u("div", Xt, [
p(t.$slots, "watermark", O(z({ isPrinting: v(fe) || v(ye) })), void 0, !0)
])) : c("", !0),
C.value ? c("", !0) : (s(), T(ft, {
key: 6,
config: {
type: "stripPlot",
style: {
backgroundColor: e.value.style.chart.backgroundColor,
stripPlot: {
color: "#CCCCCC"
}
}
}
}, null, 8, ["config"])),
t.$slots.source ? (s(), u("div", {
key: 7,
ref_key: "source",
ref: se,
dir: "auto"
}, [
p(t.$slots, "source", {}, void 0, !0)
], 512)) : c("", !0),
_e(dt, {
show: d.value.showTooltip && Y.value,
backgroundColor: e.value.style.chart.tooltip.backgroundColor,
color: e.value.style.chart.tooltip.color,
borderRadius: e.value.style.chart.tooltip.borderRadius,
borderColor: e.value.style.chart.tooltip.borderColor,
borderWidth: e.value.style.chart.tooltip.borderWidth,
fontSize: e.value.style.chart.tooltip.fontSize,
backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
position: e.value.style.chart.tooltip.position,
offsetY: e.value.style.chart.tooltip.offsetY,
parent: N.value,
content: q.value,
isFullscreen: S.value,
isCustom: v(Ae)(e.value.style.chart.tooltip.customFormat)
}, {
"tooltip-before": y(() => [
p(t.$slots, "tooltip-before", O(z({ ...Q.value })), void 0, !0)
]),
"tooltip-after": y(() => [
p(t.$slots, "tooltip-after", O(z({ ...Q.value })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
C.value ? (s(), T(bt, {
key: 8,
hideDetails: "",
config: {
open: d.value.showTable,
maxHeight: 1e4,
body: {
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color
},
head: {
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color
}
}
}, {
content: y(() => [
(s(), T(pt, {
key: `table_${ne.value}`,
colNames: V.value.colNames,
head: V.value.head,
body: V.value.body,
config: V.value.config,
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
onClose: o[1] || (o[1] = (l) => d.value.showTable = !1)
}, {
th: y(({ th: l }) => [
k("div", {
innerHTML: l,
style: { display: "flex", "align-items": "center" }
}, null, 8, jt)
]),
td: y(({ td: l }) => [
Xe(L(l.name || l), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : c("", !0)
], 46, Ct));
}
}, cl = /* @__PURE__ */ wt(Yt, [["__scopeId", "data-v-fd6179c0"]]);
export {
cl as default
};