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