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