vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
741 lines (740 loc) • 31.3 kB
JavaScript
import { computed as g, ref as d, watch as fe, onMounted as be, onBeforeUnmount as Ie, createElementBlock as r, openBlock as o, unref as u, normalizeStyle as F, normalizeClass as ge, createBlock as L, createCommentVNode as v, createElementVNode as i, createSlots as Ge, withCtx as _, renderSlot as m, normalizeProps as V, guardReactiveProps as E, createVNode as Me, Fragment as C, renderList as $, toDisplayString as A, createTextVNode as me, nextTick as De } from "vue";
import { u as Fe, c as pe, a as Ve, o as Ee, e as _e, g as Re, v as ke, D as He, f as z, X as xe, i as B, l as we, h as Ce, q as We, r as Ue } from "./index-CHWA6Lnw.js";
import { t as Be, u as je } from "./useResponsive-vZgZwV-S.js";
import { _ as qe } from "./Title-BwZtefYd.js";
import { u as Ye, U as Ze } from "./usePrinter-DibtVl2x.js";
import { D as Je } from "./DataTable-B4YF6guk.js";
import Ke from "./vue-ui-skeleton-BSUFPx4a.js";
import { L as Qe } from "./Legend-BMXzxIhA.js";
import et from "./vue-ui-accordion-gHGrRoVr.js";
import { u as $e } from "./useNestedProp-ByBiJC9_.js";
import { _ as tt } from "./PackageVersion-DcMafJMi.js";
import { P as lt } from "./PenAndPaper-ljJaW1FE.js";
import { u as at } from "./useUserOptionState-BIvW1Kz7.js";
import { u as st } from "./useChartAccessibility-BWojgys7.js";
import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const rt = ["id"], nt = ["xmlns", "viewBox"], ut = ["x", "y", "width", "height"], it = { key: 1 }, ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], dt = { key: 2 }, vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ht = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], yt = { key: 3 }, ft = ["x", "y", "font-size", "fill", "font-weight"], bt = ["x", "y", "font-size", "fill"], gt = { key: 4 }, mt = ["x", "y", "font-size", "fill", "font-weight"], pt = ["id"], _t = ["stop-color"], kt = ["stop-color"], xt = ["stop-color"], wt = ["id"], Ct = ["stop-color"], $t = ["stop-color"], Lt = ["stop-color"], At = ["id"], zt = ["stop-color"], St = ["stop-color"], Xt = ["id"], Nt = ["stop-color"], Tt = ["stop-color"], Pt = { key: 0 }, Ot = ["d", "fill"], It = { key: 1 }, Gt = ["x", "y", "height", "width", "fill"], Mt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Dt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ft = { key: 5 }, Vt = ["x", "y", "fill", "font-size"], Et = { key: 6 }, Rt = ["x", "y", "fill", "font-size"], Ht = {
key: 5,
class: "vue-data-ui-watermark"
}, Wt = ["xmlns", "height", "width"], Ut = ["fill"], Bt = ["innerHTML"], jt = {
__name: "vue-ui-dumbbell",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectDatapoint"],
setup(Le, { expose: Ae, emit: qt }) {
const { vue_ui_dumbbell: ze } = Fe(), b = Le, S = g({
get() {
return !!b.dataset && b.dataset.length;
},
set(l) {
return l;
}
}), y = d(pe()), j = d(0), P = d(null), q = d(null), Y = d(null), Z = d(null), J = d(null), K = d(0), Q = d(0), ee = d(0), e = g({
get: () => se(),
set: (l) => l
}), { userOptionsVisible: R, setUserOptionsVisibility: te, keepUserOptionState: le } = at({ config: e.value }), { svgRef: ae } = st({ config: e.value.style.chart.title });
function se() {
const l = $e({
userConfig: b.config,
defaultConfig: ze
});
return l.theme ? {
...$e({
userConfig: Ve.vue_ui_dumbbell[l.theme] || b.config,
defaultConfig: l
})
} : l;
}
fe(() => b.config, (l) => {
e.value = se(), R.value = !e.value.userOptions.showOnChartHover, oe(), K.value += 1, Q.value += 1, ee.value += 1, h.value = e.value.style.chart.rowHeight, N.value = e.value.style.chart.width, X.value.showTable = e.value.table.show;
}, { deep: !0 }), fe(() => b.dataset, (l) => {
de();
}, { deep: !0 });
const O = d(null);
be(() => {
oe();
});
function oe() {
if (Ee(b.dataset) ? _e({
componentName: "VueUiDumbbell",
type: "dataset"
}) : b.dataset.forEach((l, n) => {
Re({
datasetObject: l,
requiredAttributes: ["name", "start", "end"]
}).forEach((t) => {
S.value = !1, _e({
componentName: "VueUiDumbbell",
type: "datasetSerieAttribute",
property: t,
index: n
});
});
}), e.value.responsive) {
const l = Be(() => {
const { width: n, height: t } = je({
chart: P.value,
title: e.value.style.chart.title.text ? q.value : null,
legend: e.value.style.chart.legend.show ? Y.value : null,
source: Z.value,
noTitle: J.value
});
requestAnimationFrame(() => {
N.value = n, h.value = t / b.dataset.length, f.value = I();
});
});
O.value = new ResizeObserver(l), O.value.observe(P.value.parentNode);
}
}
Ie(() => {
O.value && O.value.disconnect();
});
const { isPrinting: re, isImaging: ne, generatePdf: ue, generateImage: ie } = Ye({
elementId: `dumbbell_${y.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-dumbbell"
}), Se = g(() => e.value.userOptions.show && !e.value.style.chart.title.text), X = d({
showTable: e.value.table.show
}), k = g(() => b.dataset.map((l, n) => ({
...l,
start: ke(l.start),
end: ke(l.end),
id: pe()
}))), H = g(() => ({
max: Math.max(...k.value.flatMap((l) => [l.start, l.end])),
min: Math.min(...k.value.flatMap((l) => [l.start, l.end]))
})), c = g(() => He(H.value.min < 0 ? H.value.min : 0, H.value.max, e.value.style.chart.grid.scaleSteps)), h = d(e.value.style.chart.rowHeight), N = d(e.value.style.chart.width), s = g(() => {
const l = h.value, n = e.value.style.chart.padding.left + e.value.style.chart.padding.right + N.value, t = e.value.style.chart.padding.top + e.value.style.chart.padding.bottom + l * b.dataset.length, a = c.value.ticks.length * (N.value / c.value.ticks.length);
return {
left: e.value.style.chart.padding.left,
right: n - e.value.style.chart.padding.right,
top: e.value.style.chart.padding.top,
bottom: t - e.value.style.chart.padding.bottom,
width: N.value,
height: l * b.dataset.length,
rowHeight: l,
absoluteHeight: t,
absoluteWidth: n,
widthPlotReference: a
};
});
function I() {
return k.value.map((l, n) => {
const t = s.value.left + (l.start + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * s.value.widthPlotReference, a = s.value.left + (l.end + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * s.value.widthPlotReference, p = t + (a - t) / 2;
return {
...l,
startX: t,
endX: a,
centerX: p,
y: s.value.top + n * h.value + h.value / 2,
endVal: l.start
};
});
}
const f = d([]), ce = d(null), Xe = g(() => k.value.map((l) => l.end).reduce((l, n) => l + n, 0));
be(() => {
de();
});
function de() {
f.value = I();
let l = f.value.map((t) => t.start).reduce((t, a) => t + a, 0);
function n() {
const t = k.value.map((a) => a.end - a.start);
l >= Xe.value ? (cancelAnimationFrame(ce.value), f.value = I()) : (f.value = f.value.map((a, p) => {
a.endVal += t[p] * (e.value.animationSpeed / 100);
const w = s.value.left + (a.start + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * s.value.widthPlotReference, D = s.value.left + (a.endVal + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * s.value.widthPlotReference, U = w + (D - w) / 2;
return {
...a,
startX: w,
endX: D,
centerX: U,
y: s.value.top + p * h.value + h.value / 2,
endVal: a.endVal
};
}), l = f.value.map((a) => a.endVal).reduce((a, p) => a + p, 0), ce.value = requestAnimationFrame(n));
}
e.value.useAnimation ? n() : f.value = I();
}
const ve = g(() => [
{ name: e.value.style.chart.legend.labelStart, color: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${y.value})` : e.value.style.chart.plots.startColor },
{ name: e.value.style.chart.legend.labelEnd, color: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${y.value})` : e.value.style.chart.plots.endColor }
]), Ne = g(() => ({
cy: "donut-div-legend",
backgroundColor: e.value.style.chart.legend.backgroundColor,
color: e.value.style.chart.legend.color,
fontSize: e.value.style.chart.legend.fontSize,
paddingBottom: 12,
paddingTop: 12,
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
})), x = g(() => {
const l = f.value.map((t) => ({
name: t.name
})), n = f.value.map((t) => ({
start: t.start,
end: t.end
}));
return { head: l, body: n };
}), G = g(() => {
const l = [
e.value.table.columnNames.series,
e.value.table.columnNames.start,
e.value.table.columnNames.end,
e.value.table.columnNames.progression
], n = x.value.head.map((p, w) => {
const D = z({
p: e.value.style.chart.labels.prefix,
v: x.value.body[w].start,
s: e.value.style.chart.labels.suffix,
r: e.value.table.td.roundingValue
}), U = z({
p: e.value.style.chart.labels.prefix,
v: x.value.body[w].end,
s: e.value.style.chart.labels.suffix,
r: e.value.table.td.roundingValue
}), Oe = z({
v: 100 * (x.value.body[w].end / x.value.body[w].start - 1),
s: "%",
r: e.value.table.td.roundingPercentage
});
return [
{ name: p.name },
D,
U,
Oe
];
}), t = {
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.start,
e.value.table.columnNames.end,
e.value.table.columnNames.progression
],
head: l,
body: n,
config: t
};
});
function he() {
De(() => {
const l = x.value.head.map((a, p) => [[
a.name
], [x.value.body[p].start], [x.value.body[p].end]]), n = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[e.value.table.columnNames.series], [e.value.table.columnNames.start], [e.value.table.columnNames.end]]].concat(l), t = We(n);
Ue({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-dumbbell" });
});
}
const T = d(!1);
function Te(l) {
T.value = l, j.value += 1;
}
function Pe() {
return f.value;
}
function ye() {
X.value.showTable = !X.value.showTable;
}
const M = d(!1);
function W() {
M.value = !M.value;
}
return Ae({
getData: Pe,
generatePdf: ue,
generateCsv: he,
generateImage: ie,
toggleTable: ye,
toggleAnnotator: W
}), (l, n) => (o(), r("div", {
ref_key: "dumbbellChart",
ref: P,
class: ge(`vue-ui-dumbbell ${T.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
style: F(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
id: `dumbbell_${y.value}`,
onMouseenter: n[1] || (n[1] = () => u(te)(!0)),
onMouseleave: n[2] || (n[2] = () => u(te)(!1))
}, [
e.value.userOptions.buttons.annotator ? (o(), L(lt, {
key: 0,
svgRef: u(ae),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: M.value,
onClose: W
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : v("", !0),
Se.value ? (o(), r("div", {
key: 1,
ref_key: "noTitle",
ref: J,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : v("", !0),
e.value.style.chart.title.text ? (o(), r("div", {
key: 2,
ref_key: "chartTitle",
ref: q,
style: "width:100%;background:transparent;padding-bottom:24px"
}, [
(o(), L(qe, {
key: `title_${K.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)) : v("", !0),
e.value.userOptions.show && S.value && (u(le) || u(R)) ? (o(), L(Ze, {
ref: "details",
key: `user_option_${j.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: u(re),
isImaging: u(ne),
uid: y.value,
hasPdf: e.value.userOptions.buttons.pdf,
hasXls: e.value.userOptions.buttons.csv,
hasImg: e.value.userOptions.buttons.img,
hasTable: e.value.userOptions.buttons.table,
hasFullscreen: e.value.userOptions.buttons.fullscreen,
isFullscreen: T.value,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: P.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: M.value,
onToggleFullscreen: Te,
onGeneratePdf: u(ue),
onGenerateCsv: he,
onGenerateImage: u(ie),
onToggleTable: ye,
onToggleAnnotator: W,
style: F({
visibility: u(le) ? u(R) ? "visible" : "hidden" : "visible"
})
}, Ge({ _: 2 }, [
l.$slots.menuIcon ? {
name: "menuIcon",
fn: _(({ isOpen: t, color: a }) => [
m(l.$slots, "menuIcon", V(E({ isOpen: t, color: a })), void 0, !0)
]),
key: "0"
} : void 0,
l.$slots.optionPdf ? {
name: "optionPdf",
fn: _(() => [
m(l.$slots, "optionPdf", {}, void 0, !0)
]),
key: "1"
} : void 0,
l.$slots.optionCsv ? {
name: "optionCsv",
fn: _(() => [
m(l.$slots, "optionCsv", {}, void 0, !0)
]),
key: "2"
} : void 0,
l.$slots.optionImg ? {
name: "optionImg",
fn: _(() => [
m(l.$slots, "optionImg", {}, void 0, !0)
]),
key: "3"
} : void 0,
l.$slots.optionTable ? {
name: "optionTable",
fn: _(() => [
m(l.$slots, "optionTable", {}, void 0, !0)
]),
key: "4"
} : void 0,
l.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: _(({ toggleFullscreen: t, isFullscreen: a }) => [
m(l.$slots, "optionFullscreen", V(E({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
]),
key: "5"
} : void 0,
l.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: _(({ toggleAnnotator: t, isAnnotator: a }) => [
m(l.$slots, "optionAnnotator", V(E({ toggleAnnotator: t, isAnnotator: a })), void 0, !0)
]),
key: "6"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : v("", !0),
S.value ? (o(), r("svg", {
key: 4,
ref_key: "svgRef",
ref: ae,
xmlns: u(xe),
class: ge({ "vue-data-ui-fullscreen--on": T.value, "vue-data-ui-fulscreen--off": !T.value }),
viewBox: `0 0 ${s.value.absoluteWidth <= 0 ? 10 : s.value.absoluteWidth} ${s.value.absoluteHeight <= 0 ? 10 : s.value.absoluteHeight}`,
style: F(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
}, [
Me(tt),
l.$slots["chart-background"] ? (o(), r("foreignObject", {
key: 0,
x: s.value.left,
y: s.value.top,
width: s.value.width,
height: s.value.height,
style: {
pointerEvents: "none"
}
}, [
m(l.$slots, "chart-background", {}, void 0, !0)
], 8, ut)) : v("", !0),
e.value.style.chart.grid.verticalGrid.show ? (o(), r("g", it, [
(o(!0), r(C, null, $(c.value.ticks, (t, a) => (o(), r("line", {
x1: s.value.left + a * s.value.width / (c.value.ticks.length - 1),
x2: s.value.left + a * s.value.width / (c.value.ticks.length - 1),
y1: s.value.top,
y2: s.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
}, null, 8, ct))), 256))
])) : v("", !0),
e.value.style.chart.grid.horizontalGrid.show ? (o(), r("g", dt, [
(o(!0), r(C, null, $(k.value, (t, a) => (o(), r("line", {
x1: s.value.left,
x2: s.value.right,
y1: s.value.top + a * h.value,
y2: s.value.top + a * h.value,
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
}, null, 8, vt))), 256)),
i("line", {
x1: s.value.left,
x2: s.value.right,
y1: s.value.bottom,
y2: s.value.bottom,
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
}, null, 8, ht)
])) : v("", !0),
e.value.style.chart.labels.yAxisLabels.show ? (o(), r("g", yt, [
(o(!0), r(C, null, $(k.value, (t, a) => (o(), r("text", {
x: s.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
y: s.value.top + a * h.value + (e.value.style.chart.labels.yAxisLabels.showProgression ? h.value / 3 : h.value / 2) + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
"font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
fill: e.value.style.chart.labels.yAxisLabels.color,
"font-weight": e.value.style.chart.labels.yAxisLabels.bold ? "bold" : "normal",
"text-anchor": "end"
}, A(t.name), 9, ft))), 256)),
e.value.style.chart.labels.yAxisLabels.showProgression ? (o(!0), r(C, { key: 0 }, $(k.value, (t, a) => (o(), r("text", {
x: s.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
y: s.value.top + a * h.value + h.value / 1.3 + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
"font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
fill: e.value.style.chart.labels.yAxisLabels.color,
"text-anchor": "end"
}, A(u(z)({
v: 100 * (t.end / t.start - 1),
s: "%",
r: e.value.style.chart.labels.yAxisLabels.rounding
})), 9, bt))), 256)) : v("", !0)
])) : v("", !0),
e.value.style.chart.labels.xAxisLabels.show ? (o(), r("g", gt, [
(o(!0), r(C, null, $(c.value.ticks, (t, a) => (o(), r("text", {
x: s.value.left + a * (s.value.width / (c.value.ticks.length - 1)),
y: s.value.bottom + e.value.style.chart.labels.xAxisLabels.fontSize + e.value.style.chart.labels.xAxisLabels.offsetY,
"font-size": e.value.style.chart.labels.xAxisLabels.fontSize,
fill: e.value.style.chart.labels.xAxisLabels.color,
"font-weight": e.value.style.chart.labels.xAxisLabels.bold ? "bold" : "normal",
"text-anchor": "middle"
}, A(u(B)(
e.value.style.chart.labels.formatter,
t,
u(z)({
p: e.value.style.chart.labels.prefix,
v: t,
s: e.value.style.chart.labels.suffix,
r: e.value.style.chart.labels.xAxisLabels.rounding
}),
{ datapoint: t, seriesIndex: a }
)), 9, mt))), 256))
])) : v("", !0),
i("defs", null, [
i("radialGradient", {
id: `start_grad_${y.value}`,
fy: "30%"
}, [
i("stop", {
offset: "10%",
"stop-color": u(we)(e.value.style.chart.plots.startColor, e.value.style.chart.plots.gradient.intensity / 100)
}, null, 8, _t),
i("stop", {
offset: "90%",
"stop-color": u(Ce)(e.value.style.chart.plots.startColor, 0.1)
}, null, 8, kt),
i("stop", {
offset: "100%",
"stop-color": e.value.style.chart.plots.startColor
}, null, 8, xt)
], 8, pt),
i("radialGradient", {
id: `end_grad_${y.value}`,
fy: "30%"
}, [
i("stop", {
offset: "10%",
"stop-color": u(we)(e.value.style.chart.plots.endColor, e.value.style.chart.plots.gradient.intensity / 100)
}, null, 8, Ct),
i("stop", {
offset: "90%",
"stop-color": u(Ce)(e.value.style.chart.plots.endColor, 0.1)
}, null, 8, $t),
i("stop", {
offset: "100%",
"stop-color": e.value.style.chart.plots.endColor
}, null, 8, Lt)
], 8, wt)
]),
(o(!0), r(C, null, $(f.value, (t, a) => (o(), r("g", null, [
i("defs", null, [
i("linearGradient", {
id: `grad_positive_${y.value}`,
x1: "0%",
x2: "100%",
y1: "0%",
y2: "0%"
}, [
i("stop", {
offset: "0%",
"stop-color": e.value.style.chart.plots.startColor
}, null, 8, zt),
i("stop", {
offset: "100%",
"stop-color": e.value.style.chart.plots.endColor
}, null, 8, St)
], 8, At),
i("linearGradient", {
id: `grad_negative_${y.value}`,
x1: "0%",
x2: "100%",
y1: "0%",
y2: "0%"
}, [
i("stop", {
offset: "0%",
"stop-color": e.value.style.chart.plots.endColor
}, null, 8, Nt),
i("stop", {
offset: "100%",
"stop-color": e.value.style.chart.plots.startColor
}, null, 8, Tt)
], 8, Xt)
]),
e.value.style.chart.plots.link.type === "curved" ? (o(), r("g", Pt, [
i("path", {
d: `M
${t.startX},${t.y + e.value.style.chart.plots.radius / 2}
C ${t.centerX},${t.y} ${t.centerX},${t.y}
${t.endX},${t.y + e.value.style.chart.plots.radius / 2}
L ${t.endX},${t.y - e.value.style.chart.plots.radius / 2}
C ${t.centerX},${t.y} ${t.centerX},${t.y}
${t.startX},${t.y - e.value.style.chart.plots.radius / 2}
Z
`,
fill: t.endX > t.startX ? `url(#grad_positive_${y.value})` : `url(#grad_negative_${y.value})`
}, null, 8, Ot)
])) : (o(), r("g", It, [
i("rect", {
x: t.endX > t.startX ? t.startX : t.endX,
y: t.y - e.value.style.chart.plots.link.strokeWidth / 2,
height: e.value.style.chart.plots.link.strokeWidth,
width: Math.abs(t.endX - t.startX),
fill: t.endX > t.startX ? `url(#grad_positive_${y.value})` : `url(#grad_negative_${y.value})`
}, null, 8, Gt)
])),
i("circle", {
cx: t.startX,
cy: t.y,
r: e.value.style.chart.plots.radius,
fill: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${y.value})` : e.value.style.chart.plots.startColor,
stroke: e.value.style.chart.plots.stroke,
"stroke-width": e.value.style.chart.plots.strokeWidth
}, null, 8, Mt),
i("circle", {
cx: t.endX,
cy: t.y,
r: e.value.style.chart.plots.radius,
fill: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${y.value})` : e.value.style.chart.plots.endColor,
stroke: e.value.style.chart.plots.stroke,
"stroke-width": e.value.style.chart.plots.strokeWidth
}, null, 8, Dt)
]))), 256)),
e.value.style.chart.labels.startLabels.show ? (o(), r("g", Ft, [
(o(!0), r(C, null, $(f.value, (t, a) => (o(), r("text", {
x: t.startX,
y: s.value.top + (a + 1) * h.value - e.value.style.chart.labels.startLabels.fontSize / 3 + e.value.style.chart.labels.startLabels.offsetY,
fill: e.value.style.chart.labels.startLabels.useStartColor ? e.value.style.chart.plots.startColor : e.value.style.chart.labels.startLabels.color,
"font-size": e.value.style.chart.labels.startLabels.fontSize,
"text-anchor": "middle"
}, A(u(B)(
e.value.style.chart.labels.formatter,
t.start,
u(z)({
p: e.value.style.chart.labels.prefix,
v: t.start,
s: e.value.style.chart.labels.suffix,
r: e.value.style.chart.labels.startLabels.rounding
}),
{ datapoint: t, seriesIndex: a }
)), 9, Vt))), 256))
])) : v("", !0),
e.value.style.chart.labels.endLabels.show ? (o(), r("g", Et, [
(o(!0), r(C, null, $(f.value, (t, a) => (o(), r("text", {
x: t.endX,
y: s.value.top + a * h.value + e.value.style.chart.labels.endLabels.fontSize + e.value.style.chart.labels.endLabels.offsetY,
fill: e.value.style.chart.labels.endLabels.useEndColor ? e.value.style.chart.plots.endColor : e.value.style.chart.labels.endLabels.color,
"font-size": e.value.style.chart.labels.endLabels.fontSize,
"text-anchor": "middle"
}, A(u(B)(
e.value.style.chart.labels.formatter,
t.end,
u(z)({
p: e.value.style.chart.labels.prefix,
v: t.end,
s: e.value.style.chart.labels.suffix,
r: e.value.style.chart.labels.endLabels.rounding
}),
{ datapoint: t, seriesIndex: a }
)), 9, Rt))), 256))
])) : v("", !0),
m(l.$slots, "svg", { svg: s.value }, void 0, !0)
], 14, nt)) : v("", !0),
l.$slots.watermark ? (o(), r("div", Ht, [
m(l.$slots, "watermark", V(E({ isPrinting: u(re) || u(ne) })), void 0, !0)
])) : v("", !0),
S.value ? v("", !0) : (o(), L(Ke, {
key: 6,
config: {
type: "dumbbell",
style: {
backgroundColor: e.value.style.chart.backgroundColor,
dumbbell: {
color: "#CCCCCC"
}
}
}
}, null, 8, ["config"])),
i("div", {
ref_key: "chartLegend",
ref: Y
}, [
e.value.style.chart.legend.show && S.value ? (o(), L(Qe, {
key: `legend_${ee.value}`,
legendSet: ve.value,
config: Ne.value
}, {
item: _(({ legend: t }) => [
i("div", {
style: F(`display:flex;align-items:center;gap:4px;font-size:${e.value.style.chart.legend.fontSize}px`)
}, [
(o(), r("svg", {
xmlns: u(xe),
viewBox: "0 0 20 20",
height: e.value.style.chart.legend.fontSize,
width: e.value.style.chart.legend.fontSize
}, [
i("circle", {
cx: 10,
cy: 10,
r: 9,
fill: t.color
}, null, 8, Ut)
], 8, Wt)),
me(" " + A(t.name), 1)
], 4)
]),
_: 1
}, 8, ["legendSet", "config"])) : m(l.$slots, "legend", {
key: 1,
legend: ve.value
}, void 0, !0)
], 512),
l.$slots.source ? (o(), r("div", {
key: 7,
ref_key: "source",
ref: Z,
dir: "auto"
}, [
m(l.$slots, "source", {}, void 0, !0)
], 512)) : v("", !0),
S.value ? (o(), L(et, {
key: 8,
hideDetails: "",
config: {
open: X.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: _(() => [
(o(), L(Je, {
key: `table_${Q.value}`,
colNames: G.value.colNames,
head: G.value.head,
body: G.value.body,
config: G.value.config,
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
onClose: n[0] || (n[0] = (t) => X.value.showTable = !1)
}, {
th: _(({ th: t }) => [
i("div", {
innerHTML: t,
style: { display: "flex", "align-items": "center" }
}, null, 8, Bt)
]),
td: _(({ td: t }) => [
me(A(t.name || t), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : v("", !0)
], 46, rt));
}
}, cl = /* @__PURE__ */ ot(jt, [["__scopeId", "data-v-7b7a74b1"]]);
export {
cl as default
};