UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

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