vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
808 lines (807 loc) • 35 kB
JavaScript
import { defineAsyncComponent as N, computed as x, ref as h, watch as ot, shallowRef as Ie, onMounted as st, onBeforeUnmount as nt, createElementBlock as u, openBlock as i, unref as d, normalizeStyle as z, normalizeClass as W, createBlock as I, createCommentVNode as m, createElementVNode as E, createVNode as _e, createSlots as it, withCtx as w, renderSlot as g, normalizeProps as B, guardReactiveProps as U, Fragment as C, renderList as _, toDisplayString as V, createTextVNode as ut } from "vue";
import { u as rt, c as ae, t as ct, p as G, a as vt, o as dt, e as Ne, g as ht, b as pt, d as yt, D as mt, U as ft, V as gt, W as bt, X as xt, I as kt, x as Pe, E as Y, q as wt, r as Ct, i as Oe, f as Le, y as $t } from "./index-BLtEpj8j.js";
import { t as At, u as zt } from "./useResponsive-DfdjqQps.js";
import { u as De } from "./useNestedProp-Bw1KcAmj.js";
import { u as Tt } from "./usePrinter-DnRwTdvS.js";
import { u as Mt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as Ft } from "./useChartAccessibility-9icAAmYg.js";
import St from "./Title-DkG60EPg.js";
import It from "./Legend-E7G897sw.js";
import { _ as _t } from "./Shape-Cqnzky8X.js";
import Nt from "./img-D-vWHxhM.js";
import { _ as Pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Ot = ["id"], Lt = ["xmlns", "viewBox"], Dt = ["x", "y", "width", "height"], Rt = { style: { "pointer-events": "none" } }, Et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Bt = ["x", "y", "fill", "font-size", "font-weight"], Ut = ["x", "y", "fill", "font-size", "font-weight", "innerHTML"], Vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Wt = ["x", "y", "fill", "font-size", "font-weight"], Ht = { key: 0 }, jt = ["x", "y", "font-size", "fill"], Xt = ["width", "x", "y"], Gt = { style: { width: "100%" } }, Yt = ["x", "y", "fill", "font-weight", "font-size", "onMouseenter"], qt = ["d", "stroke", "stroke-width", "onMouseenter"], Jt = ["d", "onMouseenter"], Kt = {
key: 5,
class: "vue-data-ui-watermark"
}, Qt = ["onClick"], Zt = ["innerHTML"], ea = {
__name: "vue-ui-parallel-coordinate-plot",
props: {
config: {
type: Object,
default() {
return {};
}
},
dataset: {
type: Array,
default() {
return [];
}
}
},
emits: ["selectLegend", "selectDatapoint"],
setup(Re, { expose: Ee, emit: Be }) {
const Ue = N(() => import("./vue-ui-accordion-B6Svdk-2.js")), Ve = N(() => import("./DataTable-CS_V_Adx.js")), We = N(() => import("./PackageVersion-CnRyWKP-.js")), He = N(() => import("./PenAndPaper-7BWf7zgA.js")), je = N(() => import("./vue-ui-skeleton-CsMU8DwQ.js")), Xe = N(() => import("./Tooltip-CuHsd1IQ.js")), Ge = N(() => import("./UserOptions-DGw0HvSp.js")), { vue_ui_parallel_coordinate_plot: Ye } = rt(), T = Re, P = x({
get() {
return !!T.dataset && T.dataset.length;
},
set(t) {
return t;
}
}), le = h(0), M = h(null), oe = h(null), se = h(null), ne = h(null), ie = h(null), ue = h(0), re = h(0), ce = h(0), q = h(ae()), O = h(!1);
function ve(t) {
O.value = t, le.value += 1;
}
const e = x({
get: () => ye(),
set: (t) => t
}), { userOptionsVisible: J, setUserOptionsVisibility: de, keepUserOptionState: he } = Mt({ config: e.value }), { svgRef: pe } = Ft({ config: e.value.style.chart.title });
function ye() {
const t = De({
userConfig: T.config,
defaultConfig: Ye
});
return t.theme ? {
...De({
userConfig: vt.vue_ui_parallel_coordinate_plot[t.theme] || T.config,
defaultConfig: t
}),
customPalette: ct[t.theme] || G
} : t;
}
ot(() => T.config, (t) => {
e.value = ye(), J.value = !e.value.userOptions.showOnChartHover, me(), ue.value += 1, ce.value += 1, re.value += 1, p.value.dataLabels.show = e.value.style.chart.yAxis.labels.datapoints.show, p.value.showTable = e.value.table.show, p.value.showTooltip = e.value.style.chart.tooltip.show;
}, { deep: !0 });
const F = Ie(null), L = Ie(null);
st(() => {
me();
});
function me() {
if (dt(T.dataset) ? Ne({
componentName: "VueUiParallelCoordinatePlot",
type: "dataset"
}) : T.dataset.forEach((t, l) => {
ht({
datasetObject: t,
requiredAttributes: ["name", "series"]
}).forEach((a) => {
P.value = !1, Ne({
componentName: "VueUiParallelCoordinatePlot",
type: "datasetSerieAttribute",
property: a,
index: l
});
});
}), e.value.responsive) {
const t = At(() => {
const { width: l, height: a } = zt({
chart: M.value,
title: e.value.style.chart.title.text ? oe.value : null,
legend: e.value.style.chart.legend.show ? se.value : null,
source: ne.value,
noTitle: ie.value
});
requestAnimationFrame(() => {
c.value.width = l, c.value.height = a, e.value.responsiveProportionalSizing ? (c.value.plotSize = Y({
relator: Math.min(l, a),
adjuster: 600,
source: e.value.style.chart.plots.radius,
threshold: 2,
fallback: 2
}), c.value.ticksFontSize = Y({
relator: Math.min(l, a),
adjuster: 600,
source: e.value.style.chart.yAxis.labels.ticks.fontSize,
threshold: 10,
fallback: 10
}), c.value.datapointFontSize = Y({
relator: Math.min(l, a),
adjuster: 600,
source: e.value.style.chart.yAxis.labels.datapoints.fontSize,
threshold: 10,
fallback: 10
}), c.value.axisNameFontSize = Y({
relator: Math.min(l, a),
adjuster: 600,
source: e.value.style.chart.yAxis.labels.axisNamesFontSize,
threshold: 12,
fallback: 12
})) : (c.value.plotSize = e.value.style.chart.plots.radius, c.value.ticksFontSize = e.value.style.chart.yAxis.labels.ticks.fontSize, c.value.datapointFontSize = e.value.style.chart.yAxis.labels.datapoints.fontSize, c.value.axisNameFontSize = e.value.style.chart.yAxis.labels.axisNamesFontSize);
});
});
F.value && (L.value && F.value.unobserve(L.value), F.value.disconnect()), F.value = new ResizeObserver(t), L.value = M.value.parentNode, F.value.observe(L.value);
}
}
nt(() => {
F.value && (L.value && F.value.unobserve(L.value), F.value.disconnect());
});
const { isPrinting: fe, isImaging: ge, generatePdf: be, generateImage: xe } = Tt({
elementId: `pcp_${q.value}`,
fileName: e.value.style.chart.title.text || "vue-ui-parallel-coordinate-plot",
options: e.value.userOptions.print
}), qe = x(() => e.value.userOptions.show && !e.value.style.chart.title.text), c = h({
height: e.value.style.chart.height,
width: e.value.style.chart.width,
plotSize: e.value.style.chart.plots.radius,
// ratio 100
ticksFontSize: e.value.style.chart.yAxis.labels.ticks.fontSize,
// ratio 42.85
datapointFontSize: e.value.style.chart.yAxis.labels.datapoints.fontSize,
axisNameFontSize: e.value.style.chart.yAxis.labels.axisNamesFontSize
}), r = x(() => {
const { top: t, right: l, bottom: a, left: o } = e.value.style.chart.padding, n = c.value.height, s = c.value.width;
return {
chartHeight: n,
chartWidth: s,
height: n - t - a,
width: s - o - l,
top: t,
left: o,
right: s - l,
bottom: n - a
};
}), Je = x(() => pt(e.value.customPalette)), p = h({
dataLabels: {
show: e.value.style.chart.yAxis.labels.datapoints.show
},
showTable: e.value.table.show,
showTooltip: e.value.style.chart.tooltip.show
}), $ = h([]);
function ke(t) {
$.value.includes(t) ? $.value = $.value.filter((l) => l !== t) : $.value.push(t);
}
const S = x(() => T.dataset.map((t, l) => {
const a = yt(t.color) || Je.value[l] || G[l] || G[l % G.length];
return {
...t,
series: t.series.map((o) => ({
...o,
id: ae(),
color: a
})),
seriesIndex: l,
color: a,
id: ae(),
shape: t.shape || "circle"
};
})), Ke = x(() => S.value.map((t) => ({
...t,
opacity: $.value.includes(t.id) ? 0.5 : 1,
segregate: () => ke(t.id),
isSegregated: $.value.includes(t.id)
}))), Qe = x(() => ({
cy: "pcp-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,
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
})), we = x(() => Math.max(
...S.value.filter((t) => !$.value.includes(t.id)).map((t) => Math.max(...t.series.flatMap((l) => l.values.length)))
)), k = x(() => r.value.width / we.value), K = x(() => S.value.filter((t) => !$.value.includes(t.id))), b = x(() => {
let t = [];
for (let l = 0; l < we.value; l += 1) {
const a = Math.min(...K.value.flatMap((y) => y.series.map((X) => X.values[l] || 0) || 0)), o = Math.max(...K.value.flatMap((y) => y.series.map((X) => X.values[l] || 0) || 0)), n = o === a ? a / 4 : a, s = o === a ? o * 2 : o, v = mt(n, s, e.value.style.chart.yAxis.scaleTicks), A = v.ticks.map((y, X) => {
const at = v.min < 0 ? y + Math.abs(v.min) : y - Math.abs(v.min), lt = v.min < 0 ? v.max + Math.abs(v.min) : v.max - Math.abs(v.min);
return {
y: r.value.bottom - r.value.height * (at / lt),
x: r.value.left + k.value * l + k.value / 2,
value: y
};
});
t.push({
scale: v,
ticks: A,
name: e.value.style.chart.yAxis.labels.axisNames[l] || `Y-${l + 1}`
});
}
return t;
}), Q = x(() => K.value.map((t, l) => ({
...t,
series: t.series.map((a, o) => ({
...a,
datapoints: a.values.map((n, s) => {
const v = b.value[s].scale.min < 0 ? (n || 0) + Math.abs(b.value[s].scale.min) : (n || 0) - Math.abs(b.value[s].scale.min), A = b.value[s].scale.min < 0 ? b.value[s].scale.max + Math.abs(b.value[s].scale.min) : b.value[s].scale.max - Math.abs(b.value[s].scale.min);
return {
name: a.name,
seriesName: t.name,
axisIndex: s,
datapointIndex: o,
seriesIndex: l,
value: n || 0,
x: r.value.left + k.value * s + k.value / 2,
y: r.value.bottom - r.value.height * (v / A),
comment: a.comments && a.comments[s] || ""
};
})
}))
})).map((t) => ({
...t,
series: t.series.map((l) => {
const a = ft(l.datapoints), o = gt(l.datapoints), n = bt(e.value.style.chart.lines.smooth ? `M ${o}` : `M ${a}`);
return {
...l,
smoothPath: o,
straightPath: a,
pathLength: n
};
})
})));
function Ce({ value: t, index: l, datapoint: a }) {
return Oe(
e.value.style.chart.yAxis.labels.formatters[l] || null,
t,
Le({
p: e.value.style.chart.yAxis.labels.prefixes[l] || "",
v: t,
s: e.value.style.chart.yAxis.labels.suffixes[l] || "",
r: e.value.style.chart.yAxis.labels.roundings[l] || 0
}),
{ datapoint: a, seriesIndex: l }
);
}
const f = h(null), Z = h(null), D = h(!1), ee = h("");
function H({ shape: t, serieName: l, serie: a, relativeIndex: o, seriesIndex: n }) {
Z.value = { serie: a, relativeIndex: o, seriesIndex: n, series: S.value, scales: b.value }, D.value = !0, f.value = a.id;
let s = "";
const v = e.value.style.chart.tooltip.customFormat;
Pe(v) && $t(() => v({
serie: a,
seriesIndex: a.seriesIndex,
series: S.value,
config: e.value,
scales: b.value
})) ? ee.value = v({
serie: a,
seriesIndex: a.seriesIndex,
series: S.value,
config: e.value,
scales: b.value
}) : (s += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l ? l + " - " : ""}${a.name}</div>`, b.value.map((A) => A.name).forEach((A, y) => {
s += `
<div class="vue-ui-tooltip-item" style="text-align:left">
<span>${A}: </span>
<span>
${Oe(
e.value.style.chart.yAxis.labels.formatters[y] || null,
a.datapoints[y].value,
Le({
p: e.value.style.chart.yAxis.labels.prefixes[y] || "",
v: a.datapoints[y].value,
s: e.value.style.chart.yAxis.labels.suffixes[y] || "",
r: e.value.style.chart.yAxis.labels.roundings[y] || ""
}),
{ datapoint: a.datapoints[y], seriesIndex: y }
)}
</span>
</div>
`, e.value.style.chart.comments.showInTooltip && a.datapoints[y].comment && (s += `<div class="vue-data-ui-tooltip-comment" style="background:${a.color}20; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${a.color}">${a.datapoints[y].comment}</div>`);
}), ee.value = `<div>${s}</div>`);
}
function Ze() {
return S.value;
}
const R = x(() => {
const t = [e.value.table.columnNames.series].concat([e.value.table.columnNames.item]).concat(b.value.map((n) => n.name)), l = Q.value.flatMap((n, s) => n.series.map((v) => [n.name].concat([v.name]).concat(v.values))), a = {
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
}, o = [e.value.table.columnNames.series].concat([e.value.table.columnNames.item]).concat(b.value.map((n) => n.name));
return {
body: l,
head: t,
config: a,
colNames: o
};
}), $e = x(() => Q.value.length === 0 ? { head: [], body: [], config: {}, columnNames: [] } : {
head: R.value.head,
body: R.value.body
});
function Ae(t = null) {
const l = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], a = $e.value.head, o = $e.value.body, n = l.concat([a]).concat(o), s = wt(n);
t ? t(s) : Ct({ csvContent: s, title: e.value.style.chart.title.text || "vue-ui-parallel-coordinate-plot" });
}
const ze = Be;
function et(t) {
ze("selectDatapoint", t);
}
function Te(t) {
ze("selectLegend", {
...t,
isSegregated: !t.isSegregated,
opacity: t.isSegregated ? 1 : 0.5
});
}
function Me() {
p.value.showTable = !p.value.showTable;
}
function Fe() {
p.value.dataLabels.show = !p.value.dataLabels.show;
}
function Se() {
p.value.showTooltip = !p.value.showTooltip;
}
const j = h(!1);
function te() {
j.value = !j.value;
}
async function tt({ scale: t = 2 } = {}) {
if (!M.value) return;
const { width: l, height: a } = M.value.getBoundingClientRect(), o = l / a, { imageUri: n, base64: s } = await Nt({ domElement: M.value, base64: !0, img: !0, scale: t });
return {
imageUri: n,
base64: s,
title: e.value.style.chart.title.text,
width: l,
height: a,
aspectRatio: o
};
}
return Ee({
getData: Ze,
getImage: tt,
generateCsv: Ae,
generatePdf: be,
generateImage: xe,
toggleTable: Me,
toggleLabels: Fe,
toggleTooltip: Se,
toggleAnnotator: te,
toggleFullscreen: ve
}), (t, l) => (i(), u("div", {
ref_key: "pcpChart",
ref: M,
class: W(`vue-ui-pcp ${O.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
style: z(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
id: `pcp_${q.value}`,
onMouseenter: l[6] || (l[6] = () => d(de)(!0)),
onMouseleave: l[7] || (l[7] = () => d(de)(!1))
}, [
e.value.userOptions.buttons.annotator ? (i(), I(d(He), {
key: 0,
svgRef: d(pe),
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
active: j.value,
onClose: te
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : m("", !0),
qe.value ? (i(), u("div", {
key: 1,
ref_key: "noTitle",
ref: ie,
class: "vue-data-ui-no-title-space",
style: "height:36px; width: 100%;background:transparent"
}, null, 512)) : m("", !0),
e.value.style.chart.title.text ? (i(), u("div", {
key: 2,
ref_key: "chartTitle",
ref: oe,
style: "width:100%;background:transparent;padding-bottom:24px"
}, [
(i(), I(St, {
key: `title_${ue.value}`,
config: {
title: {
cy: "pcp-div-title",
...e.value.style.chart.title
},
subtitle: {
cy: "pcp-div-subtitle",
...e.value.style.chart.title.subtitle
}
}
}, null, 8, ["config"]))
], 512)) : m("", !0),
e.value.userOptions.show && P.value && (d(he) || d(J)) ? (i(), I(d(Ge), {
ref: "details",
key: `user_options_${le.value}`,
backgroundColor: e.value.style.chart.backgroundColor,
color: e.value.style.chart.color,
isPrinting: d(fe),
isImaging: d(ge),
uid: q.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,
isFullscreen: O.value,
isTooltip: p.value.showTooltip,
titles: { ...e.value.userOptions.buttonTitles },
chartElement: M.value,
position: e.value.userOptions.position,
hasAnnotator: e.value.userOptions.buttons.annotator,
isAnnotation: j.value,
callbacks: e.value.userOptions.callbacks,
printScale: e.value.userOptions.print.scale,
onToggleFullscreen: ve,
onGeneratePdf: d(be),
onGenerateCsv: Ae,
onGenerateImage: d(xe),
onToggleTable: Me,
onToggleLabels: Fe,
onToggleTooltip: Se,
onToggleAnnotator: te,
style: z({
visibility: d(he) ? d(J) ? "visible" : "hidden" : "visible"
})
}, it({ _: 2 }, [
t.$slots.menuIcon ? {
name: "menuIcon",
fn: w(({ isOpen: a, color: o }) => [
g(t.$slots, "menuIcon", B(U({ isOpen: a, color: o })), void 0, !0)
]),
key: "0"
} : void 0,
t.$slots.optionPdf ? {
name: "optionPdf",
fn: w(() => [
g(t.$slots, "optionPdf", {}, void 0, !0)
]),
key: "1"
} : void 0,
t.$slots.optionCsv ? {
name: "optionCsv",
fn: w(() => [
g(t.$slots, "optionCsv", {}, void 0, !0)
]),
key: "2"
} : void 0,
t.$slots.optionImg ? {
name: "optionImg",
fn: w(() => [
g(t.$slots, "optionImg", {}, void 0, !0)
]),
key: "3"
} : void 0,
t.$slots.optionTable ? {
name: "optionTable",
fn: w(() => [
g(t.$slots, "optionTable", {}, void 0, !0)
]),
key: "4"
} : void 0,
t.$slots.optionLabels ? {
name: "optionLabels",
fn: w(() => [
g(t.$slots, "optionLabels", {}, void 0, !0)
]),
key: "5"
} : void 0,
t.$slots.optionFullscreen ? {
name: "optionFullscreen",
fn: w(({ toggleFullscreen: a, isFullscreen: o }) => [
g(t.$slots, "optionFullscreen", B(U({ toggleFullscreen: a, isFullscreen: o })), void 0, !0)
]),
key: "6"
} : void 0,
t.$slots.optionAnnotator ? {
name: "optionAnnotator",
fn: w(({ toggleAnnotator: a, isAnnotator: o }) => [
g(t.$slots, "optionAnnotator", B(U({ toggleAnnotator: a, isAnnotator: o })), void 0, !0)
]),
key: "7"
} : void 0
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : m("", !0),
P.value ? (i(), u("svg", {
key: 4,
ref_key: "svgRef",
ref: pe,
xmlns: d(xt),
class: W({ "vue-data-ui-fullscreen--on": O.value, "vue-data-ui-fulscreen--off": !O.value }),
viewBox: `0 0 ${r.value.chartWidth <= 0 ? 10 : r.value.chartWidth} ${r.value.chartHeight <= 0 ? 10 : r.value.chartHeight}`,
style: z(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
}, [
_e(d(We)),
t.$slots["chart-background"] ? (i(), u("foreignObject", {
key: 0,
x: r.value.left,
y: r.value.top,
width: r.value.width,
height: r.value.height,
style: {
pointerEvents: "none"
}
}, [
g(t.$slots, "chart-background", {}, void 0, !0)
], 8, Dt)) : m("", !0),
(i(!0), u(C, null, _(b.value, (a, o) => (i(), u("g", Rt, [
E("line", {
x1: r.value.left + k.value * o + k.value / 2,
x2: r.value.left + k.value * o + k.value / 2,
y1: r.value.top,
y2: r.value.bottom,
stroke: e.value.style.chart.yAxis.stroke,
"stroke-width": e.value.style.chart.yAxis.strokeWidth
}, null, 8, Et),
String(a.name).includes(`
`) ? (i(), u("text", {
key: 1,
x: r.value.left + k.value * o + k.value / 2,
y: r.value.top - 24,
fill: e.value.style.chart.yAxis.labels.axisNamesColor,
"font-size": c.value.axisNameFontSize,
"font-weight": e.value.style.chart.yAxis.labels.axisNamesBold ? "bold" : "",
"text-anchor": "middle",
innerHTML: d(kt)({
content: String(a.name),
fontSize: c.value.axisNameFontSize,
fill: e.value.style.chart.yAxis.labels.axisNamesColor,
x: r.value.left + k.value * o + k.value / 2,
y: r.value.top - 24
})
}, null, 8, Ut)) : (i(), u("text", {
key: 0,
x: r.value.left + k.value * o + k.value / 2,
y: r.value.top - 24,
fill: e.value.style.chart.yAxis.labels.axisNamesColor,
"font-size": c.value.axisNameFontSize,
"font-weight": e.value.style.chart.yAxis.labels.axisNamesBold ? "bold" : "",
"text-anchor": "middle"
}, V(a.name), 9, Bt)),
e.value.style.chart.yAxis.labels.ticks.show ? (i(), u(C, { key: 2 }, [
(i(!0), u(C, null, _(a.ticks, (n) => (i(), u("line", {
x1: n.x,
x2: n.x - 10,
y1: n.y,
y2: n.y,
stroke: e.value.style.chart.yAxis.stroke,
"stroke-width": e.value.style.chart.yAxis.strokeWidth,
style: z(`opacity:${f.value && !p.value.showTooltip ? 0.2 : 1}`)
}, null, 12, Vt))), 256)),
(i(!0), u(C, null, _(a.ticks, (n) => (i(), u("text", {
x: n.x - 12 + e.value.style.chart.yAxis.labels.ticks.offsetX,
y: n.y + e.value.style.chart.yAxis.labels.ticks.offsetY + c.value.ticksFontSize / 3,
fill: e.value.style.chart.yAxis.labels.ticks.color,
"text-anchor": "end",
"font-size": c.value.ticksFontSize,
"font-weight": e.value.style.chart.yAxis.labels.ticks.bold ? "bold" : "normal",
style: z(`opacity:${f.value && !p.value.showTooltip ? 0.2 : 1}`)
}, V(Ce({ value: n.value, index: o, datapoint: n })), 13, Wt))), 256))
], 64)) : m("", !0)
]))), 256)),
(i(!0), u(C, null, _(Q.value, (a) => (i(), u("g", null, [
(i(!0), u(C, null, _(a.series, (o, n) => (i(), u("g", null, [
e.value.style.chart.plots.show ? (i(), u("g", Ht, [
(i(!0), u(C, null, _(o.datapoints, (s) => (i(), I(_t, {
plot: { x: s.x, y: s.y },
color: a.color,
shape: a.shape,
radius: a.shape === "triangle" ? c.value.plotSize * 1.2 : c.value.plotSize,
stroke: e.value.style.chart.backgroundColor,
strokeWidth: 0.5,
onMouseenter: (v) => H({
shape: a.shape,
serieName: a.name,
serie: o,
relativeIndex: n,
seriesIndex: o.seriesIndex
}),
onMouseleave: l[0] || (l[0] = (v) => {
f.value = null, D.value = !1;
}),
style: z(`opacity:${f.value ? f.value === o.id ? e.value.style.chart.plots.opacity : 0.2 : e.value.style.chart.plots.opacity}`),
onClick: () => et(s)
}, null, 8, ["plot", "color", "shape", "radius", "stroke", "onMouseenter", "style", "onClick"]))), 256)),
p.value.showTooltip ? m("", !0) : (i(), u(C, { key: 0 }, [
f.value && f.value === o.id && o.datapoints.length ? (i(), u("text", {
key: 0,
x: o.datapoints[0].x - c.value.ticksFontSize,
y: o.datapoints[0].y + c.value.ticksFontSize / 3,
"text-anchor": "end",
"font-size": c.value.ticksFontSize,
fill: a.color,
"font-weight": "bold"
}, V(o.name), 9, jt)) : m("", !0)
], 64)),
e.value.style.chart.comments.show ? (i(!0), u(C, { key: 1 }, _(o.datapoints, (s) => (i(), u("g", null, [
s.comment ? (i(), u("foreignObject", {
key: 0,
style: { overflow: "visible" },
height: "12",
width: e.value.style.chart.comments.width,
x: s.x - e.value.style.chart.comments.width / 2 + e.value.style.chart.comments.offsetX,
y: s.y + e.value.style.chart.comments.offsetY + 6
}, [
E("div", Gt, [
g(t.$slots, "plot-comment", {
plot: { ...s, color: a.color }
}, void 0, !0)
])
], 8, Xt)) : m("", !0)
]))), 256)) : m("", !0)
])) : m("", !0),
p.value.dataLabels.show || f.value && f.value === o.id ? (i(!0), u(C, { key: 1 }, _(o.datapoints, (s, v) => (i(), u("text", {
x: s.x + 12 + e.value.style.chart.yAxis.labels.datapoints.offsetX,
y: s.y + e.value.style.chart.yAxis.labels.datapoints.offsetY + c.value.datapointFontSize / 3,
fill: e.value.style.chart.yAxis.labels.datapoints.useSerieColor ? a.color : e.value.style.chart.yAxis.labels.datapoints.color,
"text-anchor": "start",
"font-weight": e.value.style.chart.yAxis.labels.datapoints.bold ? "bold" : "normal",
class: W({ "vue-ui-pcp-animated": !1, "vue-ui-pcp-transition": !0 }),
"font-size": c.value.datapointFontSize,
onMouseenter: (A) => H({
shape: a.shape,
serieName: a.name,
serie: o,
relativeIndex: n,
seriesIndex: o.seriesIndex
}),
onMouseleave: l[1] || (l[1] = (A) => {
f.value = null, D.value = !1;
}),
style: z(`opacity:${f.value ? f.value === o.id ? 1 : 0.2 : 1}`)
}, V(Ce({ value: s.value, index: v, datapoint: s })), 45, Yt))), 256)) : m("", !0),
E("path", {
d: `M${e.value.style.chart.lines.smooth ? o.smoothPath : o.straightPath}`,
stroke: a.color,
"stroke-width": e.value.style.chart.lines.strokeWidth,
fill: "none",
class: W({ "vue-ui-pcp-animated vue-data-ui-line-animated": e.value.useCssAnimation, "vue-ui-pcp-transition": !0 }),
onMouseenter: (s) => H({
shape: a.shape,
serieName: a.name,
serie: o,
relativeIndex: n,
seriesIndex: o.seriesIndex
}),
onMouseleave: l[2] || (l[2] = (s) => {
f.value = null, D.value = !1;
}),
style: z(`opacity:${f.value ? f.value === o.id ? e.value.style.chart.lines.opacity : 0.2 : e.value.style.chart.lines.opacity}; stroke-dasharray:${o.pathLength}; stroke-dashoffset: ${e.value.useCssAnimation ? o.pathLength : 0}`)
}, null, 46, qt),
p.value.showTooltip ? (i(), u("path", {
key: 2,
d: `M${e.value.style.chart.lines.smooth ? o.smoothPath : o.straightPath}`,
stroke: "transparent",
"stroke-width": 12,
fill: "none",
class: W({ "vue-ui-pcp-animated vue-data-ui-line-animated": e.value.useCssAnimation, "vue-ui-pcp-transition": !0 }),
onMouseenter: (s) => H({
shape: a.shape,
serieName: a.name,
serie: o,
relativeIndex: n,
seriesIndex: o.seriesIndex
}),
onMouseleave: l[3] || (l[3] = (s) => {
f.value = null, D.value = !1;
}),
style: { opacity: "0" }
}, null, 42, Jt)) : m("", !0)
]))), 256))
]))), 256)),
g(t.$slots, "svg", { svg: r.value }, void 0, !0)
], 14, Lt)) : m("", !0),
t.$slots.watermark ? (i(), u("div", Kt, [
g(t.$slots, "watermark", B(U({ isPrinting: d(fe) || d(ge) })), void 0, !0)
])) : m("", !0),
P.value ? m("", !0) : (i(), I(d(je), {
key: 6,
config: {
type: "parallelCoordinatePlot",
style: {
backgroundColor: e.value.style.chart.backgroundColor
}
}
}, null, 8, ["config"])),
E("div", {
ref_key: "chartLegend",
ref: se
}, [
e.value.style.chart.legend.show && P.value ? (i(), I(It, {
key: `legend_${re.value}`,
legendSet: Ke.value,
config: Qe.value,
onClickMarker: l[4] || (l[4] = ({ legend: a }) => {
ke(a.id), Te(a);
})
}, {
item: w(({ legend: a, index: o }) => [
E("div", {
onClick: (n) => {
a.segregate(), Te(a);
},
style: z(`opacity:${$.value.includes(a.id) ? 0.5 : 1}`)
}, V(a.name), 13, Qt)
]),
_: 1
}, 8, ["legendSet", "config"])) : g(t.$slots, "legend", {
key: 1,
legend: S.value
}, void 0, !0)
], 512),
t.$slots.source ? (i(), u("div", {
key: 7,
ref_key: "source",
ref: ne,
dir: "auto"
}, [
g(t.$slots, "source", {}, void 0, !0)
], 512)) : m("", !0),
_e(d(Xe), {
show: p.value.showTooltip && D.value,
backgroundColor: e.value.style.chart.tooltip.backgroundColor,
color: e.value.style.chart.tooltip.color,
fontSize: e.value.style.chart.tooltip.fontSize,
borderRadius: e.value.style.chart.tooltip.borderRadius,
borderColor: e.value.style.chart.tooltip.borderColor,
borderWidth: e.value.style.chart.tooltip.borderWidth,
backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
position: e.value.style.chart.tooltip.position,
offsetY: e.value.style.chart.tooltip.offsetY,
parent: M.value,
content: ee.value,
isFullscreen: O.value,
isCustom: d(Pe)(e.value.style.chart.tooltip.customFormat)
}, {
"tooltip-before": w(() => [
g(t.$slots, "tooltip-before", B(U({ ...Z.value })), void 0, !0)
]),
"tooltip-after": w(() => [
g(t.$slots, "tooltip-after", B(U({ ...Z.value })), void 0, !0)
]),
_: 3
}, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
P.value ? (i(), I(d(Ue), {
key: 8,
hideDetails: "",
config: {
open: p.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: w(() => [
(i(), I(d(Ve), {
key: `table_${ce.value}`,
colNames: R.value.colNames,
head: R.value.head,
body: R.value.body,
config: R.value.config,
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
onClose: l[5] || (l[5] = (a) => p.value.showTable = !1)
}, {
th: w(({ th: a }) => [
E("div", { innerHTML: a }, null, 8, Zt)
]),
td: w(({ td: a }) => [
ut(V(a), 1)
]),
_: 1
}, 8, ["colNames", "head", "body", "config", "title"]))
]),
_: 1
}, 8, ["config"])) : m("", !0)
], 46, Ot));
}
}, ha = /* @__PURE__ */ Pt(ea, [["__scopeId", "data-v-0e1743f3"]]);
export {
ha as default
};