vue-data-ui 3.28.11 → 3.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseScanner-m6QR9rwD.js +1 -0
- package/dist/{PackageVersion-ksOit8fp.js → PackageVersion-B9qiUJPH.js} +1 -1
- package/dist/SlicerPreview-Ks9FNVzh.js +1 -0
- package/dist/Tooltip-B432XpvC.js +1 -0
- package/dist/{XyAnalysisOptions-CUtj1x2f.js → XyAnalysisOptions-DKCLKOkA.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-label.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/package-GInOA5jS.js +1 -0
- package/dist/{render-common-CPA2hfDW.js → render-common-DF3B4DW7.js} +1 -1
- package/dist/ssr/vue-ui-donut.js +1 -1
- package/dist/ssr/vue-ui-xy.js +1 -1
- package/dist/ssr.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +56 -9
- package/dist/useAnimationFrame-D8gcRfnW.js +1 -0
- package/dist/useConfig-9oDGTWWG.js +1 -0
- package/dist/useLoading-BwiplGDB.js +1 -0
- package/dist/{useObjectBindings-D789Dz63.js → useObjectBindings-DlxSTJOa.js} +1 -1
- package/dist/usePanZoom-CTGk8aJt.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-Bx6exT7_.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-DkehT0SI.js +10 -0
- package/dist/{vue-ui-accordion-DxGxf-Rm.js → vue-ui-accordion-CnAwFOgA.js} +1 -1
- package/dist/vue-ui-age-pyramid-DXEyySR3.js +1 -0
- package/dist/vue-ui-annotator-DqrdF7bH.js +259 -0
- package/dist/vue-ui-bullet-BNgmEm8g.js +11 -0
- package/dist/vue-ui-bump-nFpAoRy7.js +8 -0
- package/dist/vue-ui-candlestick-DvBj3KWq.js +22 -0
- package/dist/vue-ui-carousel-table-ChEpsK7w.js +1 -0
- package/dist/vue-ui-chestnut-C-_fkI6E.js +1 -0
- package/dist/vue-ui-chord-WqXXM4Qs.js +9 -0
- package/dist/vue-ui-circle-pack-Bti7Wq1h.js +13 -0
- package/dist/vue-ui-cursor-C_zzn7Ua.js +1 -0
- package/dist/vue-ui-dag-BevQ37Gp.js +7 -0
- package/dist/vue-ui-dashboard-ruhBa6cl.js +1 -0
- package/dist/vue-ui-digits-B9ksORds.js +1 -0
- package/dist/{vue-ui-donut-iyVVIGoJ.js → vue-ui-donut-DhrhMru7.js} +1 -1
- package/dist/vue-ui-donut-SbqIxWeM.js +23 -0
- package/dist/vue-ui-donut-evolution-BkuALrYS.js +2 -0
- package/dist/vue-ui-dumbbell-SOI5CdGX.js +9 -0
- package/dist/vue-ui-flow-DqVrfXJo.js +3 -0
- package/dist/vue-ui-funnel-Byx_0z_B.js +1 -0
- package/dist/vue-ui-galaxy-BYbvOTrG.js +1 -0
- package/dist/vue-ui-gauge-3_cwmDni.js +1 -0
- package/dist/vue-ui-geo-HaNxzfYO.js +1 -0
- package/dist/vue-ui-gizmo-C38WKy7L.js +1 -0
- package/dist/{vue-ui-graph-C4kfE4G8.js → vue-ui-graph-Dp5FNReE.js} +2 -2
- package/dist/vue-ui-heatmap-DM0tteNh.js +1 -0
- package/dist/{vue-ui-hill-3GVfKQmi.js → vue-ui-hill-Dr6Du4gm.js} +1 -1
- package/dist/vue-ui-history-plot-C7iVkeuY.js +2 -0
- package/dist/vue-ui-horizontal-bar-BP2tt9hA.js +4 -0
- package/dist/vue-ui-kpi-8BL_aylw.js +1 -0
- package/dist/{vue-ui-label-CBrMoFDG.js → vue-ui-label-D9tcQ8rR.js} +1 -1
- package/dist/{vue-ui-mini-loader-PsWZLMLF.js → vue-ui-mini-loader-D5-HI4Wi.js} +1 -1
- package/dist/vue-ui-molecule-Bg1GqvBM.js +1 -0
- package/dist/vue-ui-mood-radar-DIiMInOP.js +1 -0
- package/dist/vue-ui-nested-donuts-BCyX7Z7n.js +19 -0
- package/dist/vue-ui-onion-EkxCuuTI.js +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-CE80aawg.js +9 -0
- package/dist/vue-ui-quadrant-DJIuGrF9.js +2 -0
- package/dist/vue-ui-quick-chart-BBsBw9K3.js +9 -0
- package/dist/vue-ui-radar-BMYyMdOg.js +1 -0
- package/dist/{vue-ui-rating-D0QvpD3V.js → vue-ui-rating--jhcSeor.js} +1 -1
- package/dist/vue-ui-relation-circle-BLeJaQJH.js +1 -0
- package/dist/vue-ui-ridgeline-w92zZqP2.js +2 -0
- package/dist/vue-ui-rings-DUEitXix.js +1 -0
- package/dist/vue-ui-scatter-D1XzJLsA.js +9 -0
- package/dist/{vue-ui-skeleton-BLyh-ESb.js → vue-ui-skeleton-Bpwe9ox7.js} +2 -2
- package/dist/{vue-ui-smiley-C00q-teB.js → vue-ui-smiley-AEw3JB0L.js} +1 -1
- package/dist/vue-ui-spark-trend-B3TKtyLN.js +1 -0
- package/dist/vue-ui-sparkbar-CjLLQ0Ja.js +1 -0
- package/dist/vue-ui-sparkgauge-9g7UUVWq.js +1 -0
- package/dist/vue-ui-sparkhistogram-B_rUkfjQ.js +1 -0
- package/dist/vue-ui-sparkline-BJj8LCeA.js +1 -0
- package/dist/vue-ui-sparkstackbar-B5rGYUUe.js +1 -0
- package/dist/vue-ui-stackbar-k0mVr3qM.js +29 -0
- package/dist/vue-ui-stackline-D1sDzsaB.js +17 -0
- package/dist/vue-ui-strip-plot-bZisAUWl.js +2 -0
- package/dist/vue-ui-table-YFjpQD5z.js +14 -0
- package/dist/vue-ui-table-heatmap-Bl_rGqXv.js +1 -0
- package/dist/{vue-ui-table-sparkline-itq8yRCe.js → vue-ui-table-sparkline-D-FHk6aF.js} +1 -1
- package/dist/vue-ui-thermometer-1gRm4qfW.js +1 -0
- package/dist/vue-ui-timer-Urv_5Bq7.js +65 -0
- package/dist/vue-ui-tiremarks-CUCnVEGx.js +1 -0
- package/dist/vue-ui-treemap-NgjoCq7g.js +1 -0
- package/dist/vue-ui-waffle-Cy9bR4eg.js +1 -0
- package/dist/vue-ui-wheel-DdwADpJ9.js +1 -0
- package/dist/vue-ui-word-cloud-I1lrCi6H.js +4 -0
- package/dist/vue-ui-world-CFZoRY_U.js +19 -0
- package/dist/vue-ui-xy-BjZ7rM8l.js +27 -0
- package/dist/vue-ui-xy-BqivEt9H.js +31 -0
- package/dist/{vue-ui-xy-canvas-CRSisgSA.js → vue-ui-xy-canvas-DGniRsGt.js} +2 -2
- package/dist/xyScaleTicks-DMX-D9Wd.js +1 -0
- package/dist/xyScales-Cb-Z9Qso.js +1 -0
- package/package.json +3 -3
- package/dist/BaseScanner-8NdoBs7B.js +0 -1
- package/dist/SlicerPreview-0m9E7Zh_.js +0 -1
- package/dist/Tooltip-C1q0Qoh7.js +0 -1
- package/dist/package-vXTjpYqq.js +0 -1
- package/dist/useConfig-_JwRfIqE.js +0 -1
- package/dist/usePanZoom-CE6Ofyy8.js +0 -1
- package/dist/vue-data-ui-0NKIVNqt.js +0 -1
- package/dist/vue-ui-3d-bar-Cs-_W1Av.js +0 -19
- package/dist/vue-ui-age-pyramid-cWWVFoCj.js +0 -1
- package/dist/vue-ui-annotator-D31LD4-s.js +0 -331
- package/dist/vue-ui-bullet-CMQzoLKs.js +0 -34
- package/dist/vue-ui-bump-SSu5eVbF.js +0 -8
- package/dist/vue-ui-candlestick-Cm9jS3n7.js +0 -22
- package/dist/vue-ui-carousel-table-D-F54W90.js +0 -1
- package/dist/vue-ui-chestnut-DNe1s8TT.js +0 -1
- package/dist/vue-ui-chord-DGzpBpuI.js +0 -21
- package/dist/vue-ui-circle-pack--iJQtXys.js +0 -13
- package/dist/vue-ui-cursor-B7DJRSGD.js +0 -1
- package/dist/vue-ui-dag-tsM65e_V.js +0 -9
- package/dist/vue-ui-dashboard-CC7IhQZu.js +0 -1
- package/dist/vue-ui-digits-hv2QeC-H.js +0 -42
- package/dist/vue-ui-donut-B9WXaiPn.js +0 -47
- package/dist/vue-ui-donut-evolution-Wz_-FYab.js +0 -2
- package/dist/vue-ui-dumbbell-p3Q2LkBV.js +0 -9
- package/dist/vue-ui-flow-BCH8YU8H.js +0 -3
- package/dist/vue-ui-funnel-DdrBD9oX.js +0 -1
- package/dist/vue-ui-galaxy-DYKEOEL-.js +0 -1
- package/dist/vue-ui-gauge-CPgvR_YB.js +0 -1
- package/dist/vue-ui-geo-DhJ3Wr_5.js +0 -1
- package/dist/vue-ui-gizmo-BTy4Vr1e.js +0 -1
- package/dist/vue-ui-heatmap-lti43RhW.js +0 -1
- package/dist/vue-ui-history-plot-DMTPygZA.js +0 -2
- package/dist/vue-ui-horizontal-bar-DwWo0CvX.js +0 -4
- package/dist/vue-ui-kpi-BTMK37Ix.js +0 -1
- package/dist/vue-ui-molecule-rbDnRA7c.js +0 -1
- package/dist/vue-ui-mood-radar-8s1jnO3P.js +0 -1
- package/dist/vue-ui-nested-donuts-8bY4HvC-.js +0 -19
- package/dist/vue-ui-onion-CgLNDFrZ.js +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-ms14eLus.js +0 -9
- package/dist/vue-ui-quadrant-6GgQZ8fW.js +0 -2
- package/dist/vue-ui-quick-chart-CzRbFXIS.js +0 -16
- package/dist/vue-ui-radar-BxsD2JBj.js +0 -1
- package/dist/vue-ui-relation-circle-BFPAlaWQ.js +0 -1
- package/dist/vue-ui-ridgeline-G2m7eFWe.js +0 -2
- package/dist/vue-ui-rings-l_BLWL48.js +0 -1
- package/dist/vue-ui-scatter-C4hXe3DM.js +0 -9
- package/dist/vue-ui-spark-trend-D0hz9kNt.js +0 -1
- package/dist/vue-ui-sparkbar-Dweyr8h-.js +0 -1
- package/dist/vue-ui-sparkgauge-DQfCXKFj.js +0 -1
- package/dist/vue-ui-sparkhistogram-DOfAu86W.js +0 -1
- package/dist/vue-ui-sparkline-DuX09S8A.js +0 -1
- package/dist/vue-ui-sparkstackbar-vXOpiyrI.js +0 -1
- package/dist/vue-ui-stackbar-DsrwNY0p.js +0 -29
- package/dist/vue-ui-stackline-e7EYZet7.js +0 -39
- package/dist/vue-ui-strip-plot-2DxzeUXU.js +0 -2
- package/dist/vue-ui-table-B344jLaG.js +0 -14
- package/dist/vue-ui-table-heatmap-BwoRcqFD.js +0 -1
- package/dist/vue-ui-thermometer-BSRjS7l3.js +0 -1
- package/dist/vue-ui-timer-DM-urc2D.js +0 -64
- package/dist/vue-ui-tiremarks-CbIOAO3F.js +0 -1
- package/dist/vue-ui-treemap-Cgal4H5O.js +0 -1
- package/dist/vue-ui-waffle-BZFI7JLd.js +0 -1
- package/dist/vue-ui-wheel-DdKm_Vd8.js +0 -1
- package/dist/vue-ui-word-cloud-D40vUb5e.js +0 -4
- package/dist/vue-ui-world-BseI3A0C.js +0 -19
- package/dist/vue-ui-xy-Bl-DUFcf.js +0 -27
- package/dist/vue-ui-xy-DNVd3FPA.js +0 -31
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as ee}from"./annotationSlots-OLiW25XN.js";import{n as te,t as ne}from"./tableIntegration-CNoJ1CIY.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{$ as o,D as ie,Dt as ae,Ht as s,J as oe,Jt as se,Kt as ce,S as le,X as ue,Yt as de,Zt as fe,at as pe,b as me,i as he,in as ge,nn as _e,nt as ve,pt as ye,t as be,w as xe,yt as Se,zt as Ce}from"./lib-rPeBMZrn.js";import{t as we}from"./labelUtils-CdtU-yB_.js";import{c as Te}from"./canvas-lib-22VpOI4_.js";import{n as Ee,t as De}from"./useHints-C-TwxM0Y.js";import{t as Oe}from"./useConfig-_JwRfIqE.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{n as Ae,t as je}from"./BaseScanner-8NdoBs7B.js";import{t as Me}from"./useNestedProp-DnGoh-XS.js";import{t as Ne}from"./useResponsive-CENUxfEL.js";import{t as Pe}from"./useThemeCheck-BKNRbGeC.js";import{t as Fe}from"./useChartExport-BZts4KFb.js";import{t as Ie}from"./useTransitions-ChGGrtrv.js";import{t as Le}from"./useUserOptionState-CXlFnwPv.js";import{t as Re}from"./useChartAccessibility-DOMuYJfm.js";import{t as ze}from"./Shape-CRe8woTu.js";import{n as Be}from"./Title-BliHuXfT.js";import{t as Ve}from"./vue_ui_rings-C0puwNW1.js";import{t as He}from"./Legend-W9YVYVX-.js";import{t as Ue}from"./A11yDataTable-DWNlWXzs.js";import{t as We}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ge}from"./DefGrad-DKMq1REY.js";import{t as Ke}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as qe,Teleport as Je,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as Ye,createTextVNode as Xe,createVNode as Ze,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as Qe,nextTick as $e,normalizeClass as h,normalizeProps as g,normalizeStyle as _,onBeforeUnmount as et,onMounted as tt,openBlock as v,ref as y,renderList as nt,renderSlot as b,resolveDynamicComponent as rt,shallowRef as it,toDisplayString as at,toRefs as ot,unref as x,useSlots as st,watch as ct,withCtx as S}from"vue";var lt=/* @__PURE__ */ e({default:()=>At}),ut=[`id`],dt=[`id`],ft=[`id`],pt={style:{position:`relative`}},mt=[`xmlns`,`viewBox`,`aria-describedby`],ht=[`width`,`height`],gt={key:1},_t=[`stroke`,`cx`,`cy`,`r`,`fill`],vt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],yt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],bt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],xt=[`x`,`y`,`width`,`height`,`fill`,`rx`],St=[`cx`,`cy`,`r`,`fill`,`stroke`],Ct=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],wt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Tt={key:5,class:`vue-data-ui-watermark`},Et=[`id`],Dt=[`onClick`],Ot={key:0},kt={key:1},At=/*#__PURE__*/ Ke({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:Ke,emit:lt}){let At=p(()=>import(`./Tooltip-C1q0Qoh7.js`)),jt=p(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Mt=p(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Nt=p(()=>import(`./DataTable-KeuZB1JM.js`)),Pt=p(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Ft=p(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),It=p(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Lt=p(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_rings:Rt}=Oe(),{isThemeValid:zt,warnInvalidTheme:Bt}=Pe(),Vt=st(),C=e,w=y(!1),Ht=c(()=>!!C.dataset&&C.dataset.length),T=y(ue()),E=y(!1),Ut=y(``),D=y(null),Wt=y(0),O=y(null),Gt=y(null),Kt=y(null),qt=y(null),Jt=y(null),Yt=y(0),Xt=y(0),Zt=y(0),Qt=y(!1),$t=y(!1),en=y(null),tn=y(null),k=y(null),nn=y({x:0,y:0}),rn=y(`pointer`),an=y(!1),A=y(fn()),j=c(()=>A.value.userOptions),M=c(()=>A.value.style.chart.layout.rings),N=c(()=>A.value.style.chart.layout.labels),P=c(()=>A.value.style.chart.tooltip),F=c(()=>A.value.style.chart);Ee({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiRings`,rules:[De.singleSeries,De.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let{transitionEnabled:I}=Ie({config:()=>A.value.transitions,dataset:()=>C.dataset}),L=c(()=>A.value.userOptions.useCursorPointer),on=c(()=>ge({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{rings:{stroke:`#6A6A6A`,gradient:{underlayerColor:`#FFFFFF`}},labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:R,FINAL_DATASET:sn,manualLoading:cn}=Ae({...ot(C),FINAL_CONFIG:A,prepareConfig:fn,skeletonDataset:C.config?.skeletonDataset??[{name:`_`,values:[13],color:`#808080`},{name:`_`,values:[8],color:`#969696`},{name:`_`,values:[5],color:`#ADADAD`},{name:`_`,values:[3],color:`#C4C4C4`},{name:`_`,values:[2],color:`#DBDBDB`}],skeletonConfig:ge({defaultConfig:A.value,userConfig:on.value})}),{userOptionsVisible:ln,setUserOptionsVisibility:un,keepUserOptionState:dn}=Le({config:A.value}),{svgRef:z}=Re({config:F.value.title});function fn(){let e=Me({userConfig:C.config,defaultConfig:Rt}),t=e.theme;if(!t)return e;if(!zt.value(e))return Bt(e),e;let n=Me({userConfig:Ve[t]||C.config,defaultConfig:e});return{...Me({userConfig:C.config,defaultConfig:n}),customPalette:e.customPalette.length?e.customPalette:_e[e.theme]||s}}let pn=fe(C.config);ct(()=>C.config,(e,t)=>{let n=fe(e),r=n!==pn;pn=n;let i=fn();r?(R.value||(A.value=i),ln.value=!A.value.userOptions.showOnChartHover,gn(),Yt.value+=1,Xt.value+=1,Zt.value+=1,U.value.showTable=A.value.table.show,U.value.showTooltip=P.value.show,U.value.showLabels=N.value.dataLabels.show,W.value.width=F.value.size,W.value.height=F.value.size):(A.value.style.chart.tooltip=i.style.chart.tooltip,U.value.showTooltip=A.value.style.chart.tooltip.show)},{deep:!0});let mn=c(()=>{let{markers:e}=N.value.dataLabels,t=Y.value/2,n=U.value.showLabels?e.position===`left`?t:-t:0,r=U.value.showLabels?W.value.width/2-t:0,i=e.position===`left`?r:-r;return{x:A.value.responsive?i:n/F.value.size*W.value.width,y:0/F.value.size*W.value.height}}),B=c(()=>({x:W.value.width/2+mn.value.x,y:W.value.height/2+mn.value.y}));ct(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(cn.value=!1)},{deep:!0});let V=it(null),H=it(null);tt(()=>{$t.value=!0,gn()});let hn=c(()=>A.value.debug);function gn(){if(Ce(C.dataset)?(pe({componentName:`VueUiRings`,type:`dataset`,debug:hn.value}),cn.value=!0):C.dataset.forEach((e,t)=>{e.values.length||(pe({componentName:`VueUiRings`,type:`dataset`,debug:hn.value}),cn.value=!0),Se({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{pe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:hn.value})})}),Ce(C.dataset)||(cn.value=A.value.loading),A.value.responsive){let e=Te(()=>{Qt.value=!0;let{width:e,height:t}=Ne({chart:O.value,title:F.value.title.text?Gt.value:null,legend:F.value.legend.show?Kt.value:null,source:qt.value,noTitle:Jt.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t-12,Qt.value=!1})});V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(e),H.value=O.value.parentNode,V.value.observe(H.value)}setTimeout(()=>{w.value=!0},600)}et(()=>{V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:_n,isImaging:vn,generatePdf:yn,generateImage:bn}=ke({elementId:`rings_${T.value}`,fileName:F.value.title.text||`vue-ui-rings`,options:A.value.userOptions.print}),xn=c(()=>A.value.userOptions.show&&!F.value.title.text),Sn=c(()=>xe(A.value.customPalette)),U=y({showTable:A.value.table.show,showTooltip:P.value.show,showLabels:N.value.dataLabels.show});ct(A,()=>{U.value={showTable:A.value.table.show,showTooltip:P.value.show,showLabels:N.value.dataLabels.show}},{immediate:!0});let W=y({height:F.value.size,width:F.value.size}),Cn=c(()=>Math.min(W.value.height,W.value.width)),wn=lt,G=y([]);function Tn(){G.value.length?G.value=[]:Nn.value.forEach(e=>{G.value.push(e.uid)}),En()}function En(){wn(`selectLegend`,J.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Dn(e){if(G.value.includes(e))G.value=G.value.filter(t=>t!==e);else{if(G.value.length===K.value.length-1)return;G.value.push(e)}En()}function On(e){return K.value.length?K.value.find(t=>t.name===e)||(hn.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(hn.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function kn(e){let t=On(e);t!==null&&G.value.includes(t.uid)&&Dn(t.uid)}function An(e){let t=On(e);t!==null&&(G.value.includes(t.uid)||Dn(t.uid))}let jn=c(()=>Math.max(...K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e)));function Mn(e){return e/jn.value}let K=c(()=>sn.value.map(({values:e,name:t,color:n=null},r)=>{let i=ce(e).reduce((e,t)=>e+t,0);return{name:t,color:n||le(n)||Sn.value[r]||s[r]||s[r%s.length],value:i,proportion:i/sn.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),uid:ue(),absoluteIndex:r}})),Nn=c(()=>K.value.map((e,t)=>{let n=he(N.value.dataLabels.formatter,e.value,o({p:N.value.dataLabels.prefix,v:e.value,s:N.value.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,index:t}),r=isNaN(e.value/q.value)?`-`:o({v:e.value/q.value*100,s:`%`,r:F.value.legend.roundingPercentage}),i=Rn({showVal:F.value.legend.showValue,showPercentage:F.value.legend.showPercentage,val:n,percentage:G.value.includes(e.uid)?`-%`:r});return{...e,shape:`circle`,opacity:G.value.includes(e.uid)?.5:1,segregate:()=>Dn(e.uid),isSegregated:G.value.includes(e.uid),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${i}`}}).toSorted((e,t)=>t.value-e.value)),Pn=c(()=>({cy:`rings-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),q=c(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e).reduce((e,t)=>e+t,0)),J=c(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({name:e,value:t,color:n=null,uid:r,absoluteIndex:i},a)=>({absoluteIndex:i,uid:r,name:e,color:n||le(n)||Sn.value[a]||s[a]||s[a%s.length],value:t,proportion:Mn(t),percentage:t/q.value*100,strokeWidth:M.value.strokeWidth*Mn(t)})).toSorted((e,t)=>t.value-e.value));function Fn(){return J.value.map(({name:e,color:t,value:n,absoluteValues:r,percentage:i})=>({name:e,color:t,value:n,absoluteValues:r,percentage:i}))}let Y=c(()=>Cn.value-M.value.strokeWidth*2);function In(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Ln(e,t){D.value=null,E.value=!1,k.value=null,rn.value=`pointer`,A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Rn({val:e,percentage:t,showVal:n,showPercentage:r}){let i=N.value.dataLabels;return we({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function zn(e){let t=N.value.dataLabels,n=he(t.formatter,e.value,o({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),r=o({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${Rn({val:n,percentage:r,showVal:t.showValue,showPercentage:t.showPercentage})}`}function Bn(e){return me(Y.value*e.proportion/2*.9<=0?1e-4:Y.value*e.proportion/2*.9)}function Vn(e,t){return t===0?B.value.y:B.value.y+Y.value*J.value[0].proportion/2-Y.value*e.proportion/2-2*(t+1)}function X(e,t){let n=N.value.dataLabels.markers.position===`left`?-(Y.value/2):Y.value/2;return{x:B.value.x+n,y:Vn(e,t)-Bn(e)}}let Hn=y(null);function Un(e,t,n=`pointer`){if(A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:e,seriesIndex:t}),G.value.length===C.dataset.length)return;Hn.value={datapoint:e,seriesIndex:t,series:J.value,config:A.value},D.value=t,k.value=t,rn.value=n;let r=J.value[t],i=P.value.customFormat;if(ae(i)&&ye(()=>i({seriesIndex:t,datapoint:e,series:J.value,config:A.value})))Ut.value=i({seriesIndex:t,datapoint:e,series:J.value,config:A.value});else{let n=``;n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${P.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${r.color}" />${Vt.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${T.value}_${e.absoluteIndex})" />`:``}</svg>`,n+=`<b>${Rn({showVal:P.value.showValue,showPercentage:P.value.showPercentage,val:`<span>${he(N.value.dataLabels.formatter,r.value,o({p:N.value.dataLabels.prefix,v:r.value,s:N.value.dataLabels.suffix,r:P.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:o({v:r.value/q.value*100,s:`%`,r:P.value.roundingPercentage})})}</b></div>`,Ut.value=n}E.value=!0}let Z=c(()=>({head:J.value.map(e=>({name:e.name,color:e.color})),body:J.value.map(e=>e.value)})),Q=c(()=>{let e=[`__SUM__`,o({p:N.value.dataLabels.prefix,v:q.value,s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),`100%`],t=Z.value.head.map((e,t)=>[{color:e.color,name:e.name},o({p:N.value.dataLabels.prefix,v:Z.value.body[t],s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),isNaN(Z.value.body[t]/q.value)?`-`:(Z.value.body[t]/q.value*100).toFixed(A.value.table.td.roundingPercentage)+`%`]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.name:e)),config:{th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}});function Wn(e=null){$e(()=>{let t=Z.value.head.map((e,t)=>[[e.name],[Z.value.body[t]],[isNaN(Z.value.body[t]/q.value)?`-`:Z.value.body[t]/q.value*100]]),n=[[F.value.title.text],[F.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=ie(n);e?e(r):ve({csvContent:r,title:F.value.title.text||`vue-ui-rings`})})}let $=y(!1);function Gn(e){$.value=e,Wt.value+=1}function Kn(){U.value.showTable=!U.value.showTable}function qn(){U.value.showTooltip=!U.value.showTooltip}function Jn(){U.value.showLabels=!U.value.showLabels}let Yn=y(!1);function Xn(){Yn.value=!Yn.value}let Zn=re(O,()=>F.value.title.text),Qn=c(()=>ne({config:A,style:F,mutableConfig:U,dialog:Lt,accordion:Mt,isFullscreen:$,parent:O,maxWidth:800,isCursorPointer:L}));ct(()=>U.value.showTable,e=>te(e,A,en));function $n(){U.value.showTable=!1,tn.value&&tn.value.setTableIconState(!1)}let er=c(()=>Nn.value.map(e=>({...e,name:e.display}))),tr=c(()=>F.value.backgroundColor),nr=c(()=>F.value.legend),rr=c(()=>F.value.title),{isCallbackImaging:ir,isCallbackSvg:ar,generateSvg:or,onGenerateImage:sr}=Fe({svg:z,title:rr,legend:nr,legendItems:er,backgroundColor:tr,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:bn});async function cr(){wn(`copyAlt`,{config:A.value,dataset:J.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function lr(){k.value=null,an.value=!0}function ur(){k.value=null,rn.value=`pointer`,E.value=!1,D.value=null,an.value=!1}function dr(e){if(!z.value||Yn.value||document.activeElement!==z.value||!J.value.length||G.value.length===C.dataset.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){k.value=null,rn.value=`pointer`,E.value=!1,D.value=null;return}if(r){if(k.value===null)return;let e=J.value[k.value];if(!e)return;In(e,k.value);return}let a=k.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?(a+=1,a>=J.value.length&&(a=0)):t&&(--a,a<0&&(a=J.value.length-1));let ee=J.value[a];ee&&(fr(a),Un(ee,a,`keyboard`))}function fr(e){if(!Number.isFinite(e)||!z.value)return;let t=J.value[e];if(!t)return;let n=X(t,e),r=z.value.getBoundingClientRect();nn.value={x:r.left+n.x/W.value.width*r.width,y:r.top+n.y/W.value.height*r.height}}let pr=c(()=>({headers:Q.value?.colNames??[],rows:Q.value?.a11yBody??[]}));return Ke({getData:Fn,getImage:Zn,generatePdf:yn,generateCsv:Wn,generateImage:bn,generateSvg:or,hideSeries:An,showSeries:kn,toggleTable:Kn,toggleTooltip:qn,toggleAnnotator:Xn,toggleFullscreen:Gn,toggleLabels:Jn,copyAlt:cr}),(e,te)=>(v(),d(`div`,{ref_key:`ringsChart`,ref:O,class:h(`vue-data-ui-component vue-ui-rings ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:_(`font-family:${A.value.style.fontFamily};text-align:center;width:100%;background:${F.value.backgroundColor};${A.value.responsive?`height: 100%`:``}`),id:`rings_${T.value}`,onMouseleave:te[2]||=e=>{D.value=null,E.value=!1,x(un)(!1)},onMouseenter:te[3]||=()=>x(un)(!0)},[f(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[f(`p`,null,at(A.value.a11y.translations.keyboardNavigation),1)],8,dt),pr.value?.rows?.length?(v(),l(Ue,{key:0,uid:T.value,head:pr.value.headers,body:pr.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):u(``,!0),j.value.buttons.annotator?(v(),l(x(Pt),Qe({key:1},x(a)(j.value.annotator),{svgRef:x(z),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Yn.value,isCursorPointer:L.value,palette:j.value.annotatorPalette,onClose:Xn}),Ye({_:2},[nt(x(ee),t=>({name:t,fn:S(n=>[b(e.$slots,t,g(m(x(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):u(``,!0),xn.value?(v(),d(`div`,{key:2,ref_key:`noTitle`,ref:Jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):u(``,!0),F.value.title.text?(v(),d(`div`,{key:3,ref_key:`chartTitle`,ref:Gt,style:`width:100%;background:transparent`},[(v(),l(Be,{key:`title_${Yt.value}`,config:{title:{cy:`rings-div-title`,...F.value.title},subtitle:{cy:`rings-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):u(``,!0),f(`div`,{id:`legend-top-${T.value}`},null,8,ft),j.value.show&&Ht.value&&(x(dn)||x(ln))?(v(),l(x(Ft),Qe({ref_key:`userOptionsRef`,ref:tn,key:`user_options_${Wt.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:x(_n),isImaging:x(vn),uid:T.value,hasTooltip:j.value.buttons.tooltip&&P.value.show,isTooltip:U.value.showTooltip,isFullscreen:$.value,chartElement:O.value},x(n)(j.value,`pdf csv img svg labels table fullscreen altCopy annotator`),{isAnnotation:Yn.value,tableDialog:A.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:Gn,onGeneratePdf:x(yn),onGenerateCsv:Wn,onGenerateImage:x(sr),onGenerateSvg:x(or),onToggleTable:Kn,onToggleTooltip:qn,onToggleAnnotator:Xn,onToggleLabels:Jn,onCopyAlt:cr,style:{visibility:x(dn)?x(ln)?`visible`:`hidden`:`visible`}}),Ye({_:2},[nt(x(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[b(e.$slots,t,g(m(x(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):u(``,!0),f(`div`,pt,[(v(),d(`svg`,{ref_key:`svgRef`,ref:z,xmlns:x(be),class:h({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,resizing:Qt.value||x(R),"vue-data-ui-no-transition":!x(I)}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:_(`max-width:100%;overflow:hidden;background:transparent;color:${F.value.color}`),"aria-describedby":`chart-instructions-${T.value}`,tabindex:`0`,onFocus:lr,onBlur:ur,onKeydown:dr},[Ze(x(It)),b(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:x(_n)||x(vn)||x(ir),isPrintingSvg:x(ar)}},void 0,!0),e.$slots[`chart-background`]?(v(),d(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,ht)):u(``,!0),f(`defs`,null,[(v(!0),d(qe,null,nt(J.value,(e,t)=>(v(),l(Ge,{t:`radial`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${T.value}_${t}`,key:`gradient_${T.value}_${t}`,stops:[[`0%`,x(se)(x(de)(e.color,.05),100-M.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(v(),d(`g`,gt,[(v(!0),d(qe,null,nt(J.value,t=>(v(),d(`defs`,null,[b(e.$slots,`pattern`,Qe({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${T.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):u(``,!0),(v(!0),d(qe,null,nt(J.value,(t,n)=>(v(),d(`g`,{key:`r_${t.uid}`},[f(`circle`,{class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-opacity":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:M.value.gradient.underlayerColor},null,14,_t),f(`circle`,{class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:M.value.gradient.show?`url(#gradient_${T.value}_${n})`:t.color},null,14,vt),e.$slots.pattern?(v(),d(`circle`,{key:0,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:`url(#pattern_${T.value}_${t.absoluteIndex})`},null,14,yt)):u(``,!0),f(`circle`,{stroke:`none`,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:`transparent`,onMouseenter:e=>Un(t,n,`pointer`),onMouseleave:e=>Ln(t,n),onClick:e=>In(t,n)},null,40,bt),U.value.showLabels?(v(),d(qe,{key:1},[f(`rect`,{x:N.value.dataLabels.markers.position===`left`?X(t,n).x:B.value.x,y:X(t,n).y-N.value.dataLabels.markers.strokeWidth/2,width:Math.abs(B.value.x-X(t,n).x),height:N.value.dataLabels.markers.strokeWidth,fill:N.value.dataLabels.markers.stroke,rx:N.value.dataLabels.markers.strokeWidth,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n})},null,10,xt),f(`circle`,{cx:X(t,n).x,cy:X(t,n).y,r:N.value.dataLabels.markers.radius,fill:t.color,stroke:F.value.backgroundColor,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n})},null,10,St),f(`text`,{"text-anchor":N.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,"font-weight":N.value.dataLabels.bold?`bold`:`normal`,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),transform:`translate(${X(t,n).x+(N.value.dataLabels.markers.position===`left`?-N.value.dataLabels.offsetX-14:N.value.dataLabels.offsetX)+6}, ${X(t,n).y+N.value.dataLabels.fontSize/3})`,onMouseenter:e=>Un(t,n,`pointer`),onMouseleave:e=>Ln(t,n),onClick:e=>In(t,n),innerHTML:x(oe)({content:zn(t),fontSize:N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,Ct)],64)):u(``,!0)]))),128)),b(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:x(_n)||x(vn)||x(ir),isPrintingSvg:x(ar)}},void 0,!0)],46,mt)),e.$slots.hint?(v(),d(`div`,wt,[b(e.$slots,`hint`,g(m({hint:A.value.a11y.translations.keyboardNavigation,isVisible:an.value})),void 0,!0)])):u(``,!0)]),e.$slots.watermark?(v(),d(`div`,Tt,[b(e.$slots,`watermark`,g(m({isPrinting:x(_n)||x(vn)||x(ir)||x(ar)})),void 0,!0)])):u(``,!0),f(`div`,{id:`legend-bottom-${T.value}`},null,8,Et),$t.value&&(F.value.legend.show||e.$slots.legend)?(v(),l(Je,{key:6,to:F.value.legend.position===`top`?`#legend-top-${T.value}`:`#legend-bottom-${T.value}`},[f(`div`,{ref_key:`chartLegend`,ref:Kt},[b(e.$slots,`legend`,{legend:Nn.value},()=>[F.value.legend.show?(v(),l(He,{key:`legend_${Zt.value}`,legendSet:Nn.value,config:Pn.value,isCursorPointer:L.value,onClickMarker:te[0]||=({legend:e})=>Dn(e.uid)},Ye({item:S(({legend:e,index:t})=>[x(R)?u(``,!0):(v(),d(`div`,{key:0,onClick:t=>Dn(e.uid),style:_(`opacity:${G.value.includes(e.uid)?.5:1}`)},at(e.display),13,Dt))]),legendToggle:S(()=>[Nn.value.length>2&&F.value.legend.selectAllToggle.show&&!x(R)?(v(),l(We,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:G.value.length>0,isCursorPointer:L.value,onToggle:Tn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):u(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:S(({legend:e,index:t})=>[Ze(ze,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${T.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):u(``,!0)],!0)],512)],8,[`to`])):u(``,!0),e.$slots.source?(v(),d(`div`,{key:7,ref_key:`source`,ref:qt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),Ze(x(At),{teleportTo:P.value.teleportTo,show:U.value.showTooltip&&E.value&&G.value.length<C.dataset.length,backgroundColor:P.value.backgroundColor,color:P.value.color,borderRadius:P.value.borderRadius,borderColor:P.value.borderColor,borderWidth:P.value.borderWidth,fontSize:P.value.fontSize,backgroundOpacity:P.value.backgroundOpacity,position:P.value.position,offsetX:P.value.offsetX,offsetY:P.value.offsetY,parent:O.value,content:Ut.value,isFullscreen:$.value,isCustom:P.value.customFormat&&typeof P.value.customFormat==`function`,smooth:P.value.smooth,backdropFilter:P.value.backdropFilter,smoothForce:P.value.smoothForce,smoothSnapThreshold:P.value.smoothSnapThreshold,isA11yMode:rn.value===`keyboard`,a11yPosition:nn.value},{"tooltip-before":S(()=>[b(e.$slots,`tooltip-before`,g(m({...Hn.value})),void 0,!0)]),tooltip:S(()=>[b(e.$slots,`tooltip`,g(m({...Hn.value})),void 0,!0)]),"tooltip-after":S(()=>[b(e.$slots,`tooltip-after`,g(m({...Hn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Ht.value&&j.value.buttons.table?(v(),l(rt(Qn.value.component),Qe({key:8},Qn.value.props,{ref_key:`tableUnit`,ref:en,onClose:$n}),Ye({content:S(()=>[(v(),l(x(Nt),{key:`table_${Xt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:A.value.table.useDialog?``:Qn.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:L.value,onClose:$n},{th:S(({th:e})=>[e===`__SUM__`?(v(),d(`div`,Ot,[Ze(x(jt),{name:`sigma`,stroke:Q.value.config.th.color,size:16},null,8,[`stroke`])])):(v(),d(`div`,kt,at(e),1))]),td:S(({td:e})=>[Xe(at(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Xe(at(Qn.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[f(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:te[1]||=e=>Wn(j.value.callbacks.csv),style:_({cursor:L.value?`pointer`:`default`})},[Ze(x(jt),{name:`fileCsv`,stroke:Qn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):u(``,!0),b(e.$slots,`skeleton`,{},()=>[x(R)?(v(),l(je,{key:0})):u(``,!0)],!0)],46,ut))}},[[`__scopeId`,`data-v-08170d9a`]]);export{lt as n,At as t};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,Ct as d,D as f,Dt as p,F as m,Ht as h,Jt as g,P as ee,Qt as te,S as ne,X as re,_ as ie,at as ae,b as oe,i as se,in as ce,jt as le,nt as ue,pt as de,t as fe,tn as pe,v as me,w as he,yt as ge,zt as _e}from"./lib-rPeBMZrn.js";import{n as ve,t as ye}from"./useHints-C-TwxM0Y.js";import{t as be}from"./useSvgLabelLayout-42Kats14.js";import{t as xe}from"./useConfig-_JwRfIqE.js";import{n as Se,t as Ce}from"./BaseScanner-8NdoBs7B.js";import{t as we}from"./usePrinter-DVf3YcG5.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{t as De}from"./useTransitions-ChGGrtrv.js";import{t as Oe}from"./useUserOptionState-CXlFnwPv.js";import{t as ke}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ae}from"./img-D4RQwASc.js";import{t as je}from"./Shape-CRe8woTu.js";import{n as Me}from"./Title-BliHuXfT.js";import{t as Ne}from"./vue_ui_scatter-4as114Wa.js";import{t as Pe}from"./Legend-W9YVYVX-.js";import{t as Fe}from"./A11yDataTable-DWNlWXzs.js";import{t as Ie}from"./BaseLegendToggle-VzX69MCo.js";import{t as Le}from"./DefGrad-DKMq1REY.js";import{t as Re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,Teleport as ze,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as Ue,guardReactiveProps as We,mergeProps as Ge,nextTick as Ke,normalizeClass as qe,normalizeProps as Je,normalizeStyle as Ye,onBeforeUnmount as Xe,onMounted as Ze,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as Qe,shallowRef as $e,toDisplayString as D,toRefs as et,unref as O,watch as tt,withCtx as k}from"vue";var nt=/* @__PURE__ */ e({default:()=>yn}),rt=[`id`],it=[`id`],at={key:0,class:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`},ot=[`id`],st={style:{position:`relative`}},ct=[`xmlns`,`aria-describedby`,`viewBox`],lt=[`width`,`height`],ut={key:1},dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],pt={key:2},mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`opacity`],gt=[`stroke`,`stroke-width`,`d`],_t=[`transform`,`font-size`,`fill`,`stroke`],vt={key:4},yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`opacity`],xt=[`d`,`stroke`,`stroke-width`],St=[`transform`,`font-size`,`fill`,`stroke`],Ct={key:6},wt=[`data-cy`,`fill`,`stroke`,`stroke-width`,`rx`],Tt=[`onMouseenter`],Et={key:2,style:{"pointer-events":`none`}},Dt=[`fill`,`fill-opacity`],Ot=[`stroke`,`stroke-dasharray`,`stroke-width`],kt={key:0,style:{"pointer-events":`none`}},At=[`d`,`stroke`,`stroke-width`],jt=[`d`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`,`stroke-width`],Nt=[`d`,`stroke`,`stroke-width`],Pt={key:7},Ft=[`points`,`fill`,`stroke-width`,`stroke-dasharray`,`stroke`],It={key:0,class:`vue-ui-scatter-datapoint`},Lt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseover`,`onMouseleave`,`onClick`],Rt={key:1},zt=[`transform`,`font-size`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Bt=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-opacity`],Vt={key:0,style:{"pointer-events":`none`}},Ht=[`x`,`y`,`width`,`height`],Ut={key:0,style:{"pointer-events":`none !important`}},Wt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Kt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],qt=[`x`,`y`,`font-size`,`fill`,`font-weight`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Zt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Qt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],$t=[`id`,`transform`,`font-size`,`font-weight`,`fill`],en=[`font-size`,`fill`,`transform`],tn=[`transform`,`font-size`,`fill`],nn=[`x`,`y`,`font-size`,`fill`],rn=[`x`,`y`,`font-size`,`fill`],an=[`font-size`,`font-weight`,`fill`,`x`,`y`],on=[`id`],sn=[`x`,`y`,`width`,`height`],cn={key:14,style:{pointerEvents:`none`}},ln=[`x1`,`x2`,`y1`,`y2`,`stroke-dasharray`,`stroke`,`stroke-width`,`clip-path`],un=[`x`,`y`,`fill`,`font-size`,`font-weight`],dn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},fn={key:6,class:`vue-data-ui-watermark`},pn=[`id`],mn=[`onClick`],hn={key:0,style:{width:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`}},gn={viewBox:`0 0 20 20`,height:`20`,width:`20`,style:{overflow:`hidden`,background:`transparent`}},_n={key:0},vn=[`innerHTML`],yn=/*#__PURE__*/ Re({__name:`vue-ui-scatter`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`,`selectLegend`],setup(e,{expose:Re,emit:nt}){let yn=Ue(()=>import(`./Tooltip-C1q0Qoh7.js`)),bn=Ue(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),xn=Ue(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Sn=Ue(()=>import(`./DataTable-KeuZB1JM.js`)),Cn=Ue(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),wn=Ue(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Tn=Ue(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),En=Ue(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_scatter:Dn}=xe(),A=e,On=nt,kn=v(()=>!!A.dataset&&A.dataset.length),j=w(re()),An=w(!1),jn=w(``),Mn=w(0),Nn=w(null),Pn=w(null),Fn=w(null),In=w(null),Ln=w(null),Rn=w(0),zn=w(0),Bn=w(0),M=w([]),Vn=w(!1),Hn=w(null),Un=w(null),Wn=w(null),Gn=w(null),Kn=w(null),qn=w(null),Jn=w(null),Yn=w(null),Xn=w(null),Zn=w(null),Qn=w(null),$n=w({x:0,y:0}),er=w(`pointer`),tr=w(!1),nr=w(null),N=w(hr()),rr=v(()=>N.value.userOptions),P=v(()=>N.value.style.layout.dataLabels.xAxis),F=v(()=>N.value.style.layout.dataLabels.yAxis),I=v(()=>N.value.style.layout.marginalBars),L=v(()=>N.value.style.layout.plots),R=v(()=>N.value.style.tooltip),z=v(()=>N.value.style);ve({config:()=>N.value,dataset:()=>A.dataset,component:`VueUiScatter`,rules:[ye.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series (clusters) is > 6. Consider:`,``,``,`▶️ Using filters to let users choose a maximum number of series (clusters) to display.`]}]});let{transitionEnabled:ir}=De({config:()=>N.value.transitions,dataset:()=>A.dataset}),ar=v(()=>N.value.userOptions.useCursorPointer),or=v(()=>p(N.value.events?.datapointClick));function sr(e=100,t=.8,n={}){let{meanX:r=0,sdX:i=1,meanY:a=0,sdY:o=1,seed:s}=n,c=(s??Math.floor(Math.random()*2**31))>>>0,l=()=>(c=c*1664525+1013904223>>>0,c/2**32),u=()=>{let e=0,t=0;for(;e===0;)e=l();for(;t===0;)t=l();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*t)},d=e/2,f=Array.from({length:d},u),p=Array.from({length:d},u),m=e=>e.reduce((e,t)=>e+t,0)/e.length,h=m(f),g=m(p);for(let e=0;e<d;e+=1)f[e]-=h,p[e]-=g;let ee=(e,t)=>e.reduce((e,n,r)=>e+n*t[r],0),te=e=>ee(e,e),ne=ee(p,f)/te(f),re=p.map((e,t)=>e-ne*f[t]),ie=te(f)/d,ae=te(re)/d,oe=Math.sqrt((1-t*t)*ie/ae),se=f.map((e,n)=>t*e+oe*re[n]),ce=f.concat(f.map(e=>-e)),le=se.concat(se.map(e=>-e)),ue=e=>Math.sqrt(te(e)/e.length),de=(e,t,n)=>{let r=ue(e);return e.map(e=>n+(r?e/r*t:0))},fe=de(ce,i,r),pe=de(le,o,a);for(let e=fe.length-1;e>0;--e){let t=Math.floor(l()*(e+1));[fe[e],fe[t]]=[fe[t],fe[e]],[pe[e],pe[t]]=[pe[t],pe[e]]}return fe.map((e,t)=>({x:e,y:pe[t]}))}let cr=v(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{backgroundColor:`#99999930`,layout:{axis:{stroke:`#6A6A6A`},correlation:{label:{show:!1}},dataLabels:{xAxis:{show:!1},yAxis:{show:!1}},marginalBars:{fill:`#99999960`},padding:{top:12,right:12,bottom:12,left:12},plots:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}},userConfig:N.value.skeletonConfig??{}})),{loading:lr,FINAL_DATASET:ur,manualLoading:dr}=Se({...et(A),FINAL_CONFIG:N,prepareConfig:hr,skeletonDataset:A.config?.skeletonDataset??[{name:``,color:`#999999`,values:sr(100,.5,{seed:42})}],skeletonConfig:ce({defaultConfig:N.value,userConfig:cr.value})}),{userOptionsVisible:fr,setUserOptionsVisibility:pr,keepUserOptionState:mr}=Oe({config:N.value}),{svgRef:B}=ke({config:z.value.title});function hr(){return l(A.config,Dn,Ne)}let gr=te(A.config);tt(()=>A.config,(e,t)=>{let n=te(e),r=n!==gr;gr=n;let i=hr();r?(lr.value||(N.value=i),fr.value=!N.value.userOptions.showOnChartHover,Sr(),Rn.value+=1,zn.value+=1,Bn.value+=1,V.value.showTable=N.value.table.show,V.value.showTooltip=R.value.show,xr.value&&N.value.usePerformanceMode&&console.warn(`VueUiScatter : You are using performance mode
|
|
2
|
-
|
|
3
|
-
- downsampling is disabled in this mode, all plots are rendered
|
|
4
|
-
|
|
5
|
-
- plot significance is not active in this mode (all plots have the same opacity)
|
|
6
|
-
|
|
7
|
-
- Depending on plot density, shapes might not display a border (stroke) to avoid fuzziness
|
|
8
|
-
|
|
9
|
-
ℹ️ To remove this warning, set config.debug to false.`)):(N.value.style.tooltip=i.style.tooltip,V.value.showTooltip=N.value.style.tooltip.show)},{deep:!0}),tt(()=>A.dataset,e=>{Array.isArray(e)&&e.length>0&&(dr.value=!1)},{deep:!0});let _r=$e(null),vr=$e(null),yr=w(!1),br=0;Ze(async()=>{Sr(),await Ke(),Vn.value=!0});let xr=v(()=>N.value.debug);function Sr(){_e(A.dataset)&&(ae({componentName:`VueUiScatter`,type:`dataset`,debug:xr.value}),dr.value=!0),_e(A.dataset)||(dr.value=N.value.loading),N.value.responsive&&(_r.value&&(vr.value&&_r.value.unobserve(vr.value),_r.value.disconnect()),_r.value=new ResizeObserver(()=>{let{width:e,height:t}=Te({chart:Nn.value,title:z.value.title.text?Pn.value:null,legend:z.value.legend.show?Fn.value:null,source:In.value,noTitle:Ln.value});cancelAnimationFrame(br),br=requestAnimationFrame(()=>{H.value.width=e,H.value.height=t,yr.value=!0})}),vr.value=Nn.value.parentNode,_r.value.observe(vr.value))}Xe(()=>{cancelAnimationFrame(br),_r.value&&(vr.value&&_r.value.unobserve(vr.value),_r.value.disconnect())});let{isPrinting:Cr,isImaging:wr,generatePdf:Tr,generateImage:Er}=we({elementId:`vue-ui-scatter_${j.value}`,fileName:z.value.title.text||`vue-ui-scatter`,options:N.value.userOptions.print}),Dr=v(()=>N.value.userOptions.show&&!z.value.title.text),Or=v(()=>he(N.value.customPalette)),V=w({showTable:N.value.table.show,showTooltip:R.value.show});tt(N,()=>{V.value={showTable:N.value.table.show,showTooltip:R.value.show}},{immediate:!0});let H=w({height:z.value.layout.height,width:z.value.layout.width}),kr=v(()=>I.value.show?I.value.size+I.value.offset:0),{metrics:Ar,ready:jr,settling:Mr,update:Nr}=be({svgRef:B,canMeasure:()=>!N.value.responsive||yr.value,initialMetrics:{left:0,right:0,bottom:0},measure:e=>{let t=F.value.scales.show?e(Xn.value).textWidth:0,n=t=>{let n=e(t);return Math.max(0,n.x+n.width-H.value.width)},r=qn.value?n(qn.value):0,i=P.value.scales.show&&Zn.value?Math.max(0,...[...Zn.value.querySelectorAll(`text`)].map(n)):0,a=Math.max(r,i);return{left:Math.max(e(Kn.value).width,t?t+12:0),right:a?a+6:0,bottom:Yn.value?e(Yn.value).height+6:0}}}),U=v(()=>{let{left:e,right:t,bottom:n}=Ar.value;return{top:z.value.layout.padding.top+kr.value+F.value.fontSize*2,right:H.value.width-z.value.layout.padding.right-kr.value-6-t,bottom:H.value.height-z.value.layout.padding.bottom-n,left:z.value.layout.padding.left+e,height:H.value.height-z.value.layout.padding.top-z.value.layout.padding.bottom-kr.value-n-F.value.fontSize*2,width:H.value.width-z.value.layout.padding.left-z.value.layout.padding.right-kr.value-e-t-6}}),Pr=v(()=>{xr.value&&ur.value.forEach((e,t)=>{ge({datasetObject:e,requiredAttributes:[`values`]}).forEach(e=>{ae({componentName:`VueUiScatter`,type:`datasetSerieAttribute`,property:e,index:t})}),e.values&&e.values.forEach((e,n)=>{ge({datasetObject:e,requiredAttributes:[`x`,`y`]}).forEach(e=>{ae({componentName:`VueUiScatter`,type:`datasetSerieAttribute`,property:`values.${e}`,index:`${t} - ${n}`})})})});let e=Math.min(...q.value.filter(e=>!M.value.includes(e.id)).flatMap(e=>e.values.map(e=>e.x))),t=Math.max(...q.value.filter(e=>!M.value.includes(e.id)).flatMap(e=>e.values.map(e=>e.x))),n=Math.min(...q.value.filter(e=>!M.value.includes(e.id)).flatMap(e=>e.values.map(e=>e.y))),r=Math.max(...q.value.filter(e=>!M.value.includes(e.id)).flatMap(e=>e.values.map(e=>e.y)));return{xMin:e<0?e:0,xMax:t,yMin:n<0?n:0,yMax:r}}),Fr=v(()=>{let e=z.value.layout.axis;return{xMin:e.xMin!==null&&e.xMin!==void 0?e.xMin:Pr.value.xMin,xMax:e.xMax!==null&&e.xMax!==void 0?e.xMax:Pr.value.xMax,yMin:e.yMin!==null&&e.yMin!==void 0?e.yMin:Pr.value.yMin,yMax:e.yMax!==null&&e.yMax!==void 0?e.yMax:Pr.value.yMax}});function Ir(e){return Number.isFinite(e)?e<2?2:Math.trunc(e):5}function Lr(e){return e.roundingValue!==void 0&&e.roundingValue!==null?e.roundingValue:e.rounding!==void 0&&e.rounding!==null?e.rounding:0}function Rr({minimum:e,maximum:t,stepCount:n,useNiceScale:r}){let i=Ir(n);if(e===t){let n=t+(e===0?1:Math.abs(e)*.01);return(r?ie:me)(e,n,i)}return(r?ie:me)(e,t,i)}let zr=v(()=>{let e=P.value;return Rr({minimum:Fr.value.xMin,maximum:Fr.value.xMax,stepCount:e.scales.steps,useNiceScale:e.scales.useNiceScale})}),Br=v(()=>{let e=F.value;return Rr({minimum:Fr.value.yMin,maximum:Fr.value.yMax,stepCount:e.scales.steps,useNiceScale:e.scales.useNiceScale})}),W=v(()=>({xMin:zr.value.min,xMax:zr.value.max,yMin:Br.value.min,yMax:Br.value.max}));function G(e,t,n,r){return se(t,oe(e),u({p:L.value.selectors.labels.prefix,v:oe(e),s:L.value.selectors.labels.suffix,r:n}),...r?[r]:[])}function Vr(e,t,n,r){return t.ticks.map(t=>({value:t,[e]:r(t),label:G(t,n.scales.labels.formatter,Lr(n))}))}let Hr=v(()=>Vr(`x`,zr.value,P.value,Kr)),Ur=v(()=>Vr(`y`,Br.value,F.value,qr)),Wr=v(()=>ui.value.length>0&&P.value.scales.show),Gr=v(()=>ui.value.length>0&&F.value.scales.show);function Kr(e){let t=W.value.xMax-W.value.xMin;return t===0?U.value.left:U.value.left+(e-W.value.xMin)/t*U.value.width}function qr(e){let t=W.value.yMax-W.value.yMin;return t===0?U.value.bottom:U.value.bottom-(e-W.value.yMin)/t*U.value.height}let K=v(()=>{let{xMin:e,xMax:t,yMin:n,yMax:r}=W.value,i=e>0?e:t<0?t:0,a=n>0?n:r<0?r:0;return{x:Kr(i),y:qr(a)}}),q=v(()=>ur.value.map((e,t)=>{let n=`cluster_${j.value}_${t}`;return{...e,values:le({data:e.values,threshold:N.value.usePerformanceMode?e.values.length+1:N.value.downsample.threshold}),id:n,color:e.color?e.color:Or.value[t]||h[t]||h[t%h.length],opacity:M.value.includes(n)?.5:1,shape:e.shape??`circle`,segregate:()=>_i(n),isSegregated:M.value.includes(n),hasGroupSelection:!!ai.value,isGroupSelected:ai.value===n,onEnter:()=>si(n),onLeave:()=>ci()}})),Jr=v(()=>({cy:`scatter-div-legend`,backgroundColor:z.value.legend.backgroundColor,color:z.value.legend.color,fontSize:z.value.legend.fontSize,paddingBottom:12,fontWeight:z.value.legend.bold?`bold`:``})),J=v(()=>q.value.map((e,t)=>({...e,plots:e.values.map((n,r)=>({x:Kr(n.x),y:qr(n.y),v:{...n,name:n.name||``},clusterName:e.name,clusterId:e.id,color:e.color?e.color:Or.value[t]||h[t]||h[t%h.length],id:`plot_${j.value}_${t}_${r}`,weight:n.weight??L.value.radius}))})).filter(e=>!M.value.includes(e.id))),Y=v(()=>{let e=1e-9,t=({m:t,b:n,rect:r,verticalX:i=null})=>{let{left:a,right:o,top:s,bottom:c}=r,l=[],u=(e,t)=>{Number.isFinite(e)&&Number.isFinite(t)&&l.push({x:e,y:t})},d=({x:t,y:n})=>t>=a-e&&t<=o+e&&n>=s-e&&n<=c+e;i===null?Number.isFinite(t)&&(u(a,t*a+n),u(o,t*o+n),Math.abs(t)>e?(u((s-n)/t,s),u((c-n)/t,c)):n>=s-e&&n<=c+e&&(u(a,n),u(o,n))):i>=a-e&&i<=o+e&&(u(i,s),u(i,c));let f=l.filter(d),p=[];for(let e of f)p.some(t=>Math.abs(t.x-e.x)<1e-6&&Math.abs(t.y-e.y)<1e-6)||p.push(e);if(p.length<2)return null;let m=p[0],h=p[1],g=0;for(let e=0;e<p.length;e+=1)for(let t=e+1;t<p.length;t+=1){let n=p[e].x-p[t].x,r=p[e].y-p[t].y,i=n*n+r*r;i>g&&(g=i,m=p[e],h=p[t])}return{x1:m.x,y1:m.y,x2:h.x,y2:h.y}};return J.value.map(n=>{let r=n.plots.length,i=n.plots.reduce((e,t)=>e+t.x,0)/r,a=n.plots.reduce((e,t)=>e+t.y,0)/r,o=0,s=0,c=0;for(let e of n.plots){let t=e.x-i,n=e.y-a;o+=t*n,s+=t*t,c+=n*n}let l,u,d=null;s<e?(d=i,l=1/0,u=null):(l=o/s,u=a-l*i);let f,p;d===null?(f=l,p=u):(f=1/0,p=null);let m=n.plots.every(e=>e.v&&typeof e.v.x==`number`&&typeof e.v.y==`number`),h=NaN;if(r>=2){let t=0,o=0;m?(t=n.plots.reduce((e,t)=>e+t.v.x,0)/r,o=n.plots.reduce((e,t)=>e+t.v.y,0)/r):(t=i,o=-a);let s=0,c=0,l=0;for(let e of n.plots){let n=m?e.v.x:e.x,r=m?e.v.y:-e.y,i=n-t,a=r-o;s+=i*a,c+=i*i,l+=a*a}if(c>=e&&l>=e){let e=s/Math.sqrt(c*l);h=Math.max(-1,Math.min(1,e))}}let g=t({m:f,b:p,rect:U.value,verticalX:d});if(!g)return{...n,correlation:null,label:null,plots:n.plots.map(e=>({...e,deviation:0,shape:n.shape,color:ne(n.color)}))};let ee={x:(g.x1+g.x2)/2,y:(g.y1+g.y2)/2};return{...n,color:ne(n.color),correlation:{...g,coefficient:h},label:ee,plots:n.plots.map(t=>{let r,i;d===null?Math.abs(f)<e?(r=t.x,i=p):(r=(t.x+f*t.y-f*p)/(1+f*f),i=(f*t.x+f*f*t.y+p)/(1+f*f)):(r=d,i=t.y);let a=t.x-r,o=t.y-i,s=Math.sqrt(a*a+o*o);return{...t,deviation:s,shape:n.shape,color:ne(n.color)}})}})}),Yr=v(()=>Math.max(...Y.value.flatMap(e=>e.plots.map(e=>Math.abs(e.deviation)))));function Xr(){return Y.value}function Zr(e,t){let n=Array.isArray(e)?e.flatMap(e=>e.plots.map(e=>({x:e.x,y:e.y}))):e.plots.map(e=>({x:e.x,y:e.y})),r=1/0,i=-1/0,a=1/0,o=-1/0;n.forEach(({x:e,y:t})=>{r=Math.min(r,e),i=Math.max(i,e),a=Math.min(a,t),o=Math.max(o,t)});let s=i-r,c=o-a,l=s/t,u=c/t,d=Array(t).fill(0),f=Array(t).fill(0),p=(e,n,r)=>r>0?Math.max(0,Math.min(t-1,Math.floor((e-n)/r+1e-10))):0;n.forEach(({x:e,y:t})=>{let n=p(e,r,l),i=p(t,a,u);d[n]||(d[n]=0),f[i]||(f[i]=0),d[n]+=1,f[i]+=1});let m=[],h=[];for(let e=0;e<t;e+=1)m.push(r+(e+.5)*l),h.push(a+(e+.5)*u);return{x:d,y:f,avgX:m,avgY:h,maxX:Math.max(...d),maxY:Math.max(...f)}}let Qr=v(()=>I.value.tranches),$r=v(()=>Zr(J.value,Qr.value)),ei=[{key:`x`,onEnter:Ai,get selected(){return Hn.value}},{key:`y`,onEnter:ji,get selected(){return Un.value}}],ti=v(()=>Object.fromEntries(ei.map(({key:e})=>{let t=e===`x`,n=U.value,r=I.value,i=$r.value,a=t?i.avgX:i.avgY,o=t?i.maxX:i.maxY,s=(t?n.width:n.height)/Qr.value,c=s<=0?1e-4:s;return[e,i[e].map((e,i)=>{let l=a[i],u=l-s/2,d=e/o*r.size,f=d<=0?1e-4:d;return{count:e,average:l,bar:t?{x:u,y:n.top-r.offset-d,width:c,height:f}:{x:n.right+r.offset,y:u,width:f,height:c},trap:t?{x:u,y:n.top-r.offset-r.size,width:c,height:Math.max(.1,r.size)}:{x:n.right+r.offset,y:u,width:Math.max(.1,r.size),height:c},highlight:t?{x:u,y:n.top,width:c,height:n.height}:{x:n.left,y:u,width:n.width,height:c},lines:[u,u+c].map(e=>t?{x1:e,x2:e,y1:0,y2:n.top+n.height}:{x1:n.left,x2:H.value.width,y1:e,y2:e})}})]}))),ni=v(()=>{let e=U.value.top-I.value.offset,t=U.value.right+I.value.offset;return J.value.map(n=>{let r=Zr(n,Qr.value);return{coords:r,dX:ee(r.avgX.map((t,n)=>({x:t,y:e-r.x[n]/r.maxX*I.value.size}))),dY:m(r.avgY.map((e,n)=>({y:e,x:t+I.value.size*r.y[n]/r.maxY}))),color:n.color,id:n.id}})}),X=w(void 0),Z=w(null),Q=w([]),ri=w(!1),ii=w(null),ai=w(void 0);function oi(){An.value=!1,X.value=void 0,Q.value=[],Z.value=null,nr.value=null,Qn.value=null,ai.value=void 0}function si(e){let t=Y.value.find(t=>t.id===e);t?(Q.value=t.plots.map(e=>e.id),ai.value=e):Q.value=[]}function ci(){Q.value=[],ai.value=void 0}function li(e){if(!B.value||!e)return;let t=pe(e.x,e.y,B.value);t&&($n.value=t)}let ui=v(()=>Z.value?[Z.value]:Q.value.length?Y.value.flatMap(e=>e.plots).filter(e=>Q.value.includes(e.id)):[]);function di(e){return G(e.v.x,P.value.scales.labels.formatter,Lr(P.value),{datapoint:e})}function fi(e){return G(e.v.y,F.value.scales.labels.formatter,Lr(F.value),{datapoint:e})}function pi(e,t,n=`pointer`,r=null){X.value=e.id,Z.value=e,er.value=n,nr.value=r,Qn.value=e.id;let i=``;N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:t}),ii.value={datapoint:e,seriesIndex:t,series:Y.value,config:N.value};let a=R.value.customFormat;p(a)&&de(()=>a({datapoint:e,seriesIndex:t,series:Y.value,config:N.value}))?jn.value=a({datapoint:e,seriesIndex:t,series:Y.value,config:N.value}):(e.clusterName&&(i+=`<div style="display:flex;gap:3px;align-items:center">${e.clusterName}</div>`),e.v.name&&(i+=`<div>${e.v.name}</div>`),i+=`<div style="text-align:left;margin-top:6px;padding-top:6px;border-top:1px solid ${R.value.borderColor}">`,i+=`<div>${P.value.name}: <b>${isNaN(e.v.x)?`-`:se(L.value.selectors.labels.x.formatter,e.v.x,u({p:R.value.prefix,v:e.v.x,s:R.value.suffix,r:R.value.roundingValue}),{datapoint:e,seriesIndex:t})}</b></div>`,i+=`<div>${F.value.name}: <b>${isNaN(e.v.y)?`-`:se(L.value.selectors.labels.y.formatter,e.v.y,u({p:R.value.prefix,v:e.v.y,s:R.value.suffix,r:R.value.roundingValue}),{datapoint:e,seriesIndex:t})}</b></div>`,i+=`${L.value.deviation.translation}: <b>${u({v:e.deviation,r:L.value.deviation.roundingValue})}</b>`,i+=`</div>`,jn.value=`<div>${i}</div>`),An.value=!0,n===`keyboard`&&Ke(()=>{li(e)})}function mi(e,t){N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(er.value!==`keyboard`||Qn.value!==e?.id)&&(An.value=!1,X.value=void 0,Z.value=null)}function hi(e,t){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t})}function gi(){M.value.length?M.value=[]:q.value.forEach(e=>{M.value.push(e.id)}),On(`selectLegend`,J.value)}function _i(e){M.value.includes(e)?M.value=M.value.filter(t=>t!==e):M.value.length<ur.value.length-1&&M.value.push(e),On(`selectLegend`,J.value)}function vi(e){return q.value.length?q.value.find(t=>t.name===e)||(xr.value&&console.warn(`VueUiScatter - Series name not found "${e}"`),null):(xr.value&&console.warn(`VueUiScatter - There are no series to show.`),null)}function yi(e){let t=vi(e);t!==null&&M.value.includes(t.id)&&_i(t.id)}function bi(e){let t=vi(e);t!==null&&(M.value.includes(t.id)||_i(t.id))}function xi(e=null){Ke(()=>{let t=[``,N.value.table.translations.correlationCoefficient,N.value.table.translations.nbrPlots,`${P.value.name} ${N.value.table.translations.average}`,`${F.value.name} ${N.value.table.translations.average}`],n=Y.value.map(e=>[e.name,e.correlation.coefficient,e.plots.length,e.plots.map(e=>e.v.x).reduce((e,t)=>e+t,0)/e.plots.length,e.plots.map(e=>e.v.y).reduce((e,t)=>e+t,0)/e.plots.length]),r=[[z.value.title.text],[z.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),i=f(r);e?e(i):ue({csvContent:i,title:z.value.title.text||`vue-ui-heatmap`})})}let Si=v(()=>{let e=[N.value.table.translations.series,N.value.table.translations.correlationCoefficient,N.value.table.translations.nbrPlots,`${P.value.name} ${N.value.table.translations.average}`,`${F.value.name} ${N.value.table.translations.average}`],t=Y.value.map(e=>[{shape:e.shape,content:e.name??`-`,color:e.color},Number((e.correlation?.coefficient??0).toFixed(N.value.table.td.roundingValue)).toLocaleString(),e.plots.length.toLocaleString(),Number((e.plots.map(e=>e.v.x??0).reduce((e,t)=>e+t,0)/e.plots.length).toFixed(N.value.table.td.roundingAverage)).toLocaleString(),Number((e.plots.map(e=>e.v.y??0).reduce((e,t)=>e+t,0)/e.plots.length).toFixed(N.value.table.td.roundingAverage)).toLocaleString()]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.content:e)),config:{th:{backgroundColor:N.value.table.th.backgroundColor,color:N.value.table.th.color,outline:N.value.table.th.outline},td:{backgroundColor:N.value.table.td.backgroundColor,color:N.value.table.td.color,outline:N.value.table.td.outline},breakpoint:N.value.table.responsiveBreakpoint},colNames:e}}),Ci=w(!1);function wi(e){Ci.value=e,Mn.value+=1}function Ti(){V.value.showTable=!V.value.showTable}function Ei(){V.value.showTooltip=!V.value.showTooltip}let Di=w(!1);function Oi(){Di.value=!Di.value}async function ki({scale:e=2}={}){if(!Nn.value)return;let{width:t,height:n}=Nn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await Ae({domElement:Nn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:z.value.title.text,width:t,height:n,aspectRatio:r}}function Ai(e){Hn.value=e,I.value.highlighter.highlightBothAxes&&(Un.value=$r.value.y.length-2-e)}function ji(e){Un.value=e,I.value.highlighter.highlightBothAxes&&(Hn.value=e)}function Mi(){Hn.value=null,Un.value=null}let Ni={circle:1,square:1,diamond:1,triangle:1.2,star:1.3,pentagon:1.3,hexagon:1.3},$=e=>e.toFixed(3);function Pi({shape:e=`circle`,cx:t,cy:n,r}){if(!N.value.usePerformanceMode)return``;let i=Ni[e]*r;switch(e){case`circle`:{let e=$(t-i),r=$(n),a=$(t+i),o=$(i);return`M ${e} ${r} A ${o} ${o} 0 1 0 ${a} ${r} A ${o} ${o} 0 1 0 ${e} ${r} Z`}case`square`:{let e=$(t-i),r=$(n-i),a=$(t+i),o=$(n+i);return`M ${e} ${r} L ${a} ${r} L ${a} ${o} L ${e} ${o} Z`}case`diamond`:{let e=$(t),r=$(n);return`M ${e} ${$(n-i)} L ${$(t+i)} ${r} L ${e} ${$(n+i)} L ${$(t-i)} ${r} Z`}case`triangle`:{let e=i*Math.sqrt(3),r=t,a=n-2/3*e,o=t-i,s=n+1/3*e,c=t+i,l=s;return`M ${$(r)} ${$(a)} L ${$(o)} ${$(s)} L ${$(c)} ${$(l)} Z`}case`star`:{let e=i,r=i*.5,a=[];for(let i=0;i<10;i+=1){let o=(-90+i*36)*Math.PI/180,s=i%2==0?e:r;a.push([t+s*Math.cos(o),n+s*Math.sin(o)])}let o=`M ${$(a[0][0])} ${$(a[0][1])}`;for(let e=1;e<a.length;e+=1)o+=` L ${$(a[e][0])} ${$(a[e][1])}`;return o+` Z`}case`pentagon`:{let e=[];for(let r=0;r<5;r+=1){let a=(-90+r*72)*Math.PI/180;e.push([t+i*Math.cos(a),n+i*Math.sin(a)])}let r=`M ${$(e[0][0])} ${$(e[0][1])}`;for(let t=1;t<5;t+=1)r+=` L ${$(e[t][0])} ${$(e[t][1])}`;return r+` Z`}case`hexagon`:{let e=[];for(let r=0;r<6;r+=1){let a=(-60+r*60)*Math.PI/180;e.push([t+i*Math.cos(a),n+i*Math.sin(a)])}let r=`M ${$(e[0][0])} ${$(e[0][1])}`;for(let t=1;t<6;t+=1)r+=` L ${$(e[t][0])} ${$(e[t][1])}`;return r+` Z`}default:{let e=$(t-i),r=$(n),a=$(t+i),o=$(i);return`M ${e} ${r} A ${o} ${o} 0 1 0 ${a} ${r} A ${o} ${o} 0 1 0 ${e} ${r} Z`}}}let Fi=v(()=>{if(!N.value.usePerformanceMode)return[``];let{left:e,right:t,top:n,bottom:r}=U.value,i=Math.max(1,(t-e)*(r-n)),a=e=>e/i*1e4,o=L.value.stroke,s=L.value.strokeWidth,c=L.value.opacity;return Y.value.map(i=>{let l=[];for(let a of i.plots){let o=a.x,s=a.y;if(o<e||o>t||s<n||s>r)continue;let c=Math.max(L.value.radius,a.weight);l.push(Pi({shape:i.shape||`circle`,cx:o,cy:s,r:c}))}if(!l.length)return null;let u=a(i.plots.length)>2.5||i.plots.length>1e3;return{id:i.id,d:l.join(``),fill:g(i.color,c*100),stroke:u?`none`:o,strokeWidth:u?0:s,strokeOpacity:1}}).filter(Boolean)});function Ii(){return N.value.usePerformanceMode?e=>{let t=B.value;if(!t)return;let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(!r)return;let i=r.inverse(),a=n.matrixTransform(i),o=null,s=1/0,c=-1;if(Y.value.forEach((e,t)=>{e.plots.forEach(e=>{let n=e.x-a.x,r=e.y-a.y,i=n*n+r*r;i<=64&&i<s&&(s=i,o=e,c=t)})}),ri.value=!!o,o)X.value!==o.id&&(X.value=o.id,pi(o,c,`pointer`,na.value.get(o.id)??null));else if(X.value){let e=Z.value;X.value=void 0,mi(e,c)}}:()=>null}let Li=Ii();function Ri(){if(ri.value=!1,X.value){let e=Z.value;X.value=void 0,mi(e,null)}}function zi(e){let t=Z.value;if(t){let e=Y.value.findIndex(e=>e.id===t.clusterId);hi(t,e>=0?e:0)}}let Bi=v(()=>c({config:N,style:z,mutableConfig:V,dialog:En,accordion:xn,isFullscreen:Ci,parent:Nn,maxWidth:800,isCursorPointer:ar}));tt(()=>V.value.showTable,e=>s(e,N,Wn));function Vi(){V.value.showTable=!1,Gn.value&&Gn.value.setTableIconState(!1)}let Hi=v(()=>z.value.backgroundColor),Ui=v(()=>z.value.legend),Wi=v(()=>z.value.title),{isCallbackImaging:Gi,isCallbackSvg:Ki,generateSvg:qi,onGenerateImage:Ji}=Ee({svg:B,title:Wi,legend:Ui,legendItems:q,backgroundColor:Hi,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Er});async function Yi(){On(`copyAlt`,{config:N.value,dataset:J.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Xi(e,t){let n=ta.value.filter(t=>t.id!==e.id);if(!n.length)return null;let r=(n=>{if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=n.x-e.x,o=n.y-e.y,s=0,c=0;t===`right`||t===`left`?(s=Math.abs(a),c=Math.abs(o)):(s=Math.abs(o),c=Math.abs(a));let l=s*1e3+c;l<i&&(r=n,i=l)}),r})(n.filter(n=>t===`right`?n.x>e.x:t===`left`?n.x<e.x:t===`down`?n.y>e.y:t===`up`&&n.y<e.y));if(r)return r;let i=[];if(t===`right`){let e=Math.min(...n.map(e=>e.x));i=n.filter(t=>t.x===e)}if(t===`left`){let e=Math.max(...n.map(e=>e.x));i=n.filter(t=>t.x===e)}if(t===`down`){let e=Math.min(...n.map(e=>e.y));i=n.filter(t=>t.y===e)}if(t===`up`){let e=Math.max(...n.map(e=>e.y));i=n.filter(t=>t.y===e)}return i.length?i.reduce((n,r)=>{if(!n)return r;let i=Math.abs(t===`right`||t===`left`?n.y-e.y:n.x-e.x);return Math.abs(t===`right`||t===`left`?r.y-e.y:r.x-e.x)<i?r:n},null):null}function Zi(){nr.value=null,Qn.value=null,tr.value=!0}function Qi(){oi(),er.value=`pointer`,tr.value=!1}function $i(e){if(!B.value||Di.value||document.activeElement!==B.value||!ta.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){oi(),er.value=`pointer`;return}if(a){if(nr.value===null)return;let e=ta.value[nr.value];if(!e)return;hi(e,e.seriesIndex);return}let s=null;if(n&&(s=`right`),t&&(s=`left`),i&&(s=`down`),r&&(s=`up`),Qn.value===null){let e=Z.value;if(e&&e.id){let t=Xi(e,s);if(!t){let t=na.value.get(e.id);if(t===void 0)return;pi(e,e.seriesIndex,`keyboard`,t);return}let n=na.value.get(t.id);if(n===void 0)return;pi(t,t.seriesIndex,`keyboard`,n);return}let t=ta.value[0];if(!t)return;let n=na.value.get(t.id)??0;pi(t,t.seriesIndex,`keyboard`,n);return}let c=na.value.get(Qn.value);if(c===void 0)return;let l=ta.value[c];if(!l)return;let u=Xi(l,s);if(!u)return;let d=na.value.get(u.id);d!==void 0&&pi(u,u.seriesIndex,`keyboard`,d)}let ea=v(()=>{if(!Z.value)return``;let e=Z.value,t=isNaN(e.v.x)?`-`:se(L.value.selectors.labels.x.formatter,e.v.x,u({p:R.value.prefix,v:e.v.x,s:R.value.suffix,r:R.value.roundingValue}),{datapoint:e,seriesIndex:e.seriesIndex}),n=isNaN(e.v.y)?`-`:se(L.value.selectors.labels.y.formatter,e.v.y,u({p:R.value.prefix,v:e.v.y,s:R.value.suffix,r:R.value.roundingValue}),{datapoint:e,seriesIndex:e.seriesIndex});return[e.clusterName||``,e.v.name||``,`${P.value.name}: ${t}`,`${F.value.name}: ${n}`].filter(Boolean).join(`. `)}),ta=v(()=>Y.value.flatMap((e,t)=>e.plots.map(n=>({...n,seriesIndex:t,seriesId:e.id,seriesName:e.name,shape:e.shape||`circle`,color:e.color})))),na=v(()=>{let e=/* @__PURE__ */ new Map;return ta.value.forEach((t,n)=>{e.set(t.id,n)}),e}),ra=v(()=>({headers:Si.value?.colNames??[],rows:Si.value?.a11yBody??[]}));return Re({getData:Xr,getImage:ki,generatePdf:Tr,generateCsv:xi,generateImage:Er,generateSvg:qi,hideSeries:bi,showSeries:yi,toggleTable:Ti,toggleTooltip:Ei,toggleAnnotator:Oi,toggleFullscreen:wi,copyAlt:Yi}),tt(()=>[H.value,P.value,F.value,z.value.layout.padding,kr.value,W.value,L.value.selectors.labels,N.value.style.fontFamily,A.dataset,M.value,yr.value,Kn.value,qn.value,Yn.value,Zn.value,Xn.value],Nr,{flush:`post`,deep:!0}),(e,s)=>(C(),x(`div`,{class:qe(`vue-data-ui-component vue-ui-scatter ${Ci.value?`vue-data-ui-wrapper-fullscreen`:``} ${N.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`scatterChart`,ref:Nn,id:`vue-ui-scatter_${j.value}`,style:Ye(`font-family:${z.value.fontFamily};width:100%; text-align:center;background:${z.value.backgroundColor};${N.value.responsive?`height: 100%`:``}`),onMouseenter:s[4]||=()=>O(pr)(!0),onMouseleave:s[5]||=()=>{O(pr)(!1),tr.value||oi()}},[S(`div`,{id:`chart-instructions-${j.value}`,class:`sr-only`},[S(`p`,null,D(N.value.a11y.translations.keyboardNavigation),1)],8,it),V.value.showTooltip?b(``,!0):(C(),x(`div`,at,D(ea.value),1)),ra.value?.rows?.length&&kn.value?(C(),y(Fe,{key:1,uid:j.value,head:ra.value.headers,body:ra.value.rows,notice:N.value.a11y.translations.tableAvailable,caption:N.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):b(``,!0),rr.value.buttons.annotator?(C(),y(O(Cn),Ge({key:2},O(a)(rr.value.annotator),{svgRef:O(B),backgroundColor:z.value.backgroundColor,color:z.value.color,active:Di.value,isCursorPointer:ar.value,palette:rr.value.annotatorPalette,onClose:Oi}),Be({_:2},[T(O(o),t=>({name:t,fn:k(n=>[E(e.$slots,t,Je(We(O(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):b(``,!0),Dr.value?(C(),x(`div`,{key:3,ref_key:`noTitle`,ref:Ln,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):b(``,!0),z.value.title.text?(C(),x(`div`,{key:4,ref_key:`chartTitle`,ref:Pn,style:`width:100%;background:transparent`},[(C(),y(Me,{key:`title_${Rn.value}`,config:{title:{cy:`scatter-div-title`,...z.value.title},subtitle:{cy:`scatter-div-subtitle`,...z.value.title.subtitle}}},null,8,[`config`]))],512)):b(``,!0),S(`div`,{id:`legend-top-${j.value}`},null,8,ot),rr.value.show&&kn.value&&(O(mr)||O(fr))?(C(),y(O(wn),Ge({ref_key:`userOptionsRef`,ref:Gn,key:`user_options_${Mn.value}`,backgroundColor:z.value.backgroundColor,color:z.value.color,isImaging:O(wr),isPrinting:O(Cr),uid:j.value,hasTooltip:rr.value.buttons.tooltip&&R.value.show,isTooltip:V.value.showTooltip,isFullscreen:Ci.value,chartElement:Nn.value},O(n)(rr.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Di.value,tableDialog:N.value.table.useDialog,isCursorPointer:ar.value,onToggleFullscreen:wi,onGeneratePdf:O(Tr),onGenerateCsv:xi,onGenerateImage:O(Ji),onGenerateSvg:O(qi),onToggleTable:Ti,onToggleTooltip:Ei,onToggleAnnotator:Oi,onCopyAlt:Yi,style:{visibility:O(mr)?O(fr)?`visible`:`hidden`:`visible`}}),Be({_:2},[T(O(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:k(n=>[E(e.$slots,t,Je(We(O(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):b(``,!0),S(`div`,st,[(C(),x(`svg`,{ref_key:`svgRef`,ref:B,xmlns:O(fe),"aria-describedby":`chart-instructions-${j.value}`,class:qe({"vue-data-ui-fullscreen--on":Ci.value,"vue-data-ui-fulscreen--off":!Ci.value,"vue-data-ui-no-transition":!O(ir)||O(Mr)}),viewBox:`0 0 ${H.value.width<=0?10:H.value.width} ${H.value.height<=0?10:H.value.height}`,style:Ye(`max-width:100%;overflow:visible;background:transparent;color:${z.value.color};visibility:${O(jr)?`visible`:`hidden`}`),onMouseleave:Mi,tabindex:`0`,onFocus:Zi,onBlur:Qi,onKeydown:$i},[He(O(Tn)),E(e.$slots,`svg-underlayer`,{svg:{...H.value,drawingArea:{...U.value,zero:K.value},data:J.value,isPrintingImg:O(Cr)||O(wr)||O(Gi),isPrintingSvg:O(Ki)}},void 0,!0),e.$slots[`chart-background`]?(C(),x(`foreignObject`,{key:0,x:0,y:0,width:H.value.width<=0?10:H.value.width,height:H.value.height<=0?10:H.value.height,style:{pointerEvents:`none`}},[E(e.$slots,`chart-background`,{},void 0,!0)],8,lt)):b(``,!0),z.value.layout.axis.show?(C(),x(`g`,ut,[S(`line`,{x1:K.value.x,x2:K.value.x,y1:U.value.top,y2:U.value.bottom,stroke:z.value.layout.axis.stroke,"stroke-width":z.value.layout.axis.strokeWidth,"stroke-linecap":`round`},null,8,dt),S(`line`,{x1:U.value.left,x2:U.value.right,y1:K.value.y,y2:K.value.y,stroke:z.value.layout.axis.stroke,"stroke-width":z.value.layout.axis.strokeWidth,"stroke-linecap":`round`},null,8,ft)])):b(``,!0),P.value.scales.verticalLines.show?(C(),x(`g`,pt,[(C(!0),x(_,null,T(Hr.value,(e,t)=>(C(),x(`line`,{key:`scatter-x-scale-line-${j.value}-${t}`,x1:e.x,x2:e.x,y1:U.value.top,y2:U.value.bottom,stroke:P.value.scales.verticalLines.stroke,"stroke-width":P.value.scales.verticalLines.strokeWidth,"stroke-linecap":`round`},null,8,mt))),128))])):b(``,!0),P.value.scales.show?(C(),x(`g`,{key:3,ref_key:`xAxisScaleLabels`,ref:Zn},[(C(!0),x(_,null,T(Hr.value,(e,t)=>(C(),x(`g`,{class:`vue-ui-scatter-scale-group`,key:`scatter-x-scale-${j.value}-${t}`,opacity:+!Wr.value},[S(`path`,{class:qe({"vue-data-ui-transition":O(ir)&&!O(Mr)}),stroke:z.value.layout.axis.stroke,"stroke-width":z.value.layout.axis.strokeWidth,d:`M${e.x},${K.value.y-4} ${e.x},${K.value.y+4}`,"stroke-linecap":`round`},null,10,gt),S(`text`,{class:qe({"vue-data-ui-transition":O(ir)&&!O(Mr)}),transform:`translate(${e.x}, ${K.value.y+P.value.scales.labels.fontSize+6+P.value.scales.labels.offsetY})`,"text-anchor":`middle`,"font-size":P.value.scales.labels.fontSize,fill:P.value.scales.labels.color,stroke:z.value.backgroundColor,"stroke-width":`2`,"paint-order":`stroke`},D(e.label),11,_t)],8,ht))),128))],512)):b(``,!0),F.value.scales.horizontalLines.show?(C(),x(`g`,vt,[(C(!0),x(_,null,T(Ur.value,(e,t)=>(C(),x(`line`,{key:`scatter-y-scale-line-${j.value}-${t}`,x1:U.value.left,x2:U.value.right,y1:e.y,y2:e.y,stroke:F.value.scales.horizontalLines.stroke,"stroke-width":F.value.scales.horizontalLines.strokeWidth,"stroke-linecap":`round`},null,8,yt))),128))])):b(``,!0),F.value.scales.show?(C(),x(`g`,{key:5,ref_key:`yAxisScaleLabels`,ref:Xn,opacity:+!Gr.value,style:{transition:`opacity 0.1s ease-in-out`},class:`vue-ui-scatter-scale-group`},[(C(!0),x(_,null,T(Ur.value,(e,t)=>(C(),x(`g`,{key:`scatter-y-scale-${j.value}-${t}`},[S(`path`,{class:qe({"vue-data-ui-transition":O(ir)&&!O(Mr)}),d:`M${K.value.x-4},${e.y} ${K.value.x+4},${e.y}`,stroke:z.value.layout.axis.stroke,"stroke-width":z.value.layout.axis.strokeWidth,"stroke-linecap":`round`},null,10,xt),S(`text`,{class:qe({"vue-data-ui-transition":O(ir)&&!O(Mr)}),transform:`translate(${K.value.x-F.value.scales.labels.fontSize/2-8+F.value.scales.labels.offsetX}, ${e.y+F.value.scales.labels.fontSize/3})`,"text-anchor":`end`,"font-size":F.value.scales.labels.fontSize,fill:F.value.scales.labels.color,stroke:z.value.backgroundColor,"stroke-width":`2`,"paint-order":`stroke`},D(e.label),11,St)]))),128))],8,bt)):b(``,!0),I.value.show?(C(),x(`g`,Ct,[S(`defs`,null,[He(Le,{t:`linear`,id:`marginal_x_${j.value}`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,stops:[[`0%`,I.value.fill,1],[`100%`,z.value.backgroundColor,1]]},null,8,[`id`,`stops`]),He(Le,{t:`linear`,id:`marginal_y_${j.value}`,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,stops:[[`0%`,z.value.backgroundColor,1],[`100%`,I.value.fill,1]]},null,8,[`id`,`stops`])]),(C(),x(_,null,T(ei,e=>(C(),x(_,{key:e.key},[(C(!0),x(_,null,T(ti.value[e.key],(t,n)=>(C(),x(`g`,null,[t.count&&t.average?(C(),x(`rect`,Ge({key:0,"data-cy":O(!1)?`marginal-bar-`+e.key:void 0},{ref_for:!0},t.bar,{fill:I.value.useGradient?`url(#marginal_${e.key}_${j.value})`:I.value.fill,style:[`opacity:${I.value.opacity}`,{"pointer-events":`none`}],stroke:z.value.backgroundColor,"stroke-width":I.value.strokeWidth,rx:I.value.borderRadius}),null,16,wt)):b(``,!0),t.average?(C(),x(`rect`,Ge({key:1,ref_for:!0},t.trap,{fill:`transparent`,onMouseenter:t=>e.onEnter(n),onMouseleave:s[0]||=e=>Mi()}),null,16,Tt)):b(``,!0),t.average&&e.selected!=null&&e.selected===n?(C(),x(`g`,Et,[S(`rect`,Ge({ref_for:!0},t.highlight,{fill:I.value.highlighter.color,"fill-opacity":I.value.highlighter.opacity}),null,16,Dt),(C(!0),x(_,null,T(t.lines,e=>(C(),x(`line`,Ge({ref_for:!0},e,{stroke:I.value.highlighter.stroke,"stroke-dasharray":I.value.highlighter.strokeDasharray,"stroke-width":I.value.highlighter.strokeWidth,style:{transition:`none !important`,animation:`none !important`}}),null,16,Ot))),256))])):b(``,!0)]))),256))],64))),64)),I.value.showLines?(C(),x(`g`,kt,[(C(!0),x(_,null,T(ni.value,e=>(C(),x(_,null,[M.value.includes(e.id)?b(``,!0):(C(),x(`path`,{key:0,d:`M ${e.dX}`,stroke:z.value.backgroundColor,"stroke-width":I.value.linesStrokeWidth+1,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`},null,8,At)),M.value.includes(e.id)?b(``,!0):(C(),x(`path`,{key:1,d:`M ${e.dX}`,stroke:e.color,"stroke-width":I.value.linesStrokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`},null,8,jt)),M.value.includes(e.id)?b(``,!0):(C(),x(`path`,{key:2,d:`M ${e.dY}`,stroke:z.value.backgroundColor,"stroke-width":I.value.linesStrokeWidth+1,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`},null,8,Mt)),M.value.includes(e.id)?b(``,!0):(C(),x(`path`,{key:3,d:`M ${e.dY}`,stroke:e.color,"stroke-width":I.value.linesStrokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`},null,8,Nt))],64))),256))])):b(``,!0)])):b(``,!0),L.value.giftWrap.show?(C(),x(`g`,Pt,[(C(!0),x(_,null,T(Y.value,(e,t)=>(C(),x(`g`,null,[e.plots.length>2?(C(),x(`polygon`,{key:0,points:O(d)({series:e.plots}),fill:O(g)(e.color,L.value.giftWrap.fillOpacity*100),"stroke-width":L.value.giftWrap.strokeWidth,"stroke-dasharray":L.value.giftWrap.strokeDasharray,stroke:e.color,"stroke-linejoin":`round`,"stroke-linecap":`round`},null,8,Ft)):b(``,!0)]))),256))])):b(``,!0),N.value.usePerformanceMode?b(``,!0):(C(!0),x(_,{key:8},T(Y.value,(e,t)=>(C(),x(`g`,{key:e.id},[!e.shape||e.shape===`circle`?(C(),x(`g`,It,[(C(!0),x(_,null,T(e.plots,(n,r)=>(C(),x(`circle`,{key:n.id,cx:n.x,cy:n.y,r:X.value&&X.value===n.id||Q.value.includes(n.id)?n.weight*L.value.hoverRadiusRatio:n.weight,fill:O(g)(e.color,X.value&&X.value!==n.id||Q.value.length&&!Q.value.includes(n.id)?L.value.opacityNotSelected*100:L.value.opacity*100),stroke:L.value.stroke,"stroke-width":L.value.strokeWidth,style:Ye(`opacity:${X.value&&X.value===n.id||Q.value.includes(n.id)?1:L.value.significance.useDistanceOpacity?1-Math.abs(n.deviation)/Yr.value:L.value.significance.show&&Math.abs(n.deviation)>L.value.significance.deviationThreshold?L.value.significance.opacity:1}`),onMouseover:e=>pi(n,t,`pointer`,na.value.get(n.id)),onMouseleave:e=>mi(n,t),onClick:e=>hi(n,t)},null,44,Lt))),128))])):(C(),x(`g`,Rt,[(C(!0),x(_,null,T(e.plots,(n,r)=>(C(),y(je,{class:`vue-ui-scatter-datapoint`,plot:{x:n.x,y:n.y},radius:X.value&&X.value===n.id||Q.value.includes(n.id)?n.weight*L.value.hoverRadiusRatio:n.weight,shape:e.shape,color:O(g)(e.color,X.value&&X.value!==n.id||Q.value.length&&!Q.value.includes(n.id)?L.value.opacityNotSelected*100:L.value.opacity*100),stroke:L.value.stroke,strokeWidth:L.value.strokeWidth,style:Ye(`opacity:${X.value&&X.value===n.id||Q.value.includes(n.id)?1:L.value.significance.useDistanceOpacity?1-Math.abs(n.deviation)/Yr.value:L.value.significance.show&&Math.abs(n.deviation)>L.value.significance.deviationThreshold?L.value.significance.opacity:1}`),onMouseover:e=>pi(n,t,`pointer`,na.value.get(n.id)),onMouseleave:e=>mi(n,t),onClick:e=>hi(n,t)},null,8,[`plot`,`radius`,`shape`,`color`,`stroke`,`strokeWidth`,`style`,`onMouseover`,`onMouseleave`,`onClick`]))),256))])),L.value.name.show?(C(!0),x(_,{key:2},T(e.plots,(e,n)=>(C(),x(`text`,{class:`vue-ui-scatter-datapoint-label`,key:`datalabel-${e.id}`,transform:`translate(${e.x}, ${e.y-e.weight-L.value.name.fontSize+L.value.name.offsetY})`,"text-anchor":`middle`,"font-size":L.value.name.fontSize,fill:O(g)(L.value.name.color,X.value&&X.value!==e.id||Q.value.length&&!Q.value.includes(e.id)?L.value.opacityNotSelected*100:100),onMouseover:n=>pi(e,t,`pointer`,na.value.get(e.id)),onMouseleave:n=>mi(e,t),onClick:n=>hi(e,t)},D(e.clusterName),41,zt))),128)):b(``,!0)]))),128)),N.value.usePerformanceMode?(C(),x(_,{key:9},[S(`g`,null,[(C(!0),x(_,null,T(Fi.value,e=>(C(),x(`path`,{key:e.id,d:e.d,fill:e.fill,stroke:e.stroke,"stroke-width":e.strokeWidth,"stroke-opacity":e.strokeOpacity,"vector-effect":`non-scaling-stroke`,"paint-order":`fill`},null,8,Bt))),128))]),Z.value?(C(),x(`g`,Vt,[He(je,{shape:Z.value.shape||`circle`,color:Z.value.color,plot:{x:Z.value.x,y:Z.value.y},radius:Z.value.weight*L.value.hoverRadiusRatio,stroke:L.value.stroke,strokeWidth:L.value.strokeWidth},null,8,[`shape`,`color`,`plot`,`radius`,`stroke`,`strokeWidth`])])):b(``,!0),S(`rect`,{x:U.value.left,y:U.value.top,width:Math.max(1e-4,U.value.width),height:Math.max(1e-4,U.value.height),fill:`transparent`,style:Ye({cursor:ri.value&&or.value?`pointer`:`default`}),onMousemove:s[1]||=(...e)=>O(Li)&&O(Li)(...e),onMouseleave:Ri,onClick:zi},null,44,Ht)],64)):b(``,!0),(C(!0),x(_,null,T(ui.value,e=>(C(),x(_,{key:`selector_${e.id}`},[L.value.selectors.show?(C(),x(`g`,Ut,[S(`line`,{x1:K.value.x,x2:e.x,y1:e.y,y2:e.y,stroke:L.value.selectors.stroke,"stroke-width":L.value.selectors.strokeWidth,"stroke-dasharray":L.value.selectors.strokeDasharray,"stroke-linecap":`round`,class:`line-pointer`},null,8,Wt),S(`line`,{x1:e.x,x2:e.x,y1:K.value.y,y2:e.y,stroke:L.value.selectors.stroke,"stroke-width":L.value.selectors.strokeWidth,"stroke-dasharray":L.value.selectors.strokeDasharray,"stroke-linecap":`round`,class:`line-pointer`},null,8,Gt),F.value.scales.show?b(``,!0):(C(),x(`text`,{key:0,x:K.value.x+(e.x>K.value.x?-6:6),y:e.y+L.value.selectors.labels.fontSize/3,"font-size":L.value.selectors.labels.fontSize,fill:L.value.selectors.labels.color,"font-weight":L.value.selectors.labels.bold?`bold`:`normal`,"text-anchor":e.x>K.value.x?`end`:`start`},D(G(e.v.y,L.value.selectors.labels.y.formatter,L.value.selectors.labels.rounding,{datapoint:e})),9,Kt)),P.value.scales.show?b(``,!0):(C(),x(`text`,{key:1,x:e.x,y:K.value.y+(e.y>K.value.y?-6:L.value.selectors.labels.fontSize+6),"font-size":L.value.selectors.labels.fontSize,fill:L.value.selectors.labels.color,"font-weight":L.value.selectors.labels.bold?`bold`:`normal`,"text-anchor":`middle`},D(G(e.v.x,L.value.selectors.labels.y.formatter,L.value.selectors.labels.rounding,{datapoint:e})),9,qt)),P.value.scales.show?(C(),x(`text`,{key:2,x:e.x,y:K.value.y+P.value.scales.labels.fontSize+6+P.value.scales.labels.offsetY,"text-anchor":`middle`,"font-size":P.value.scales.labels.fontSize,fill:P.value.scales.labels.color},D(di(e)),9,Jt)):b(``,!0),F.value.scales.show?(C(),x(`text`,{key:3,x:K.value.x-F.value.scales.labels.fontSize/2-8+F.value.scales.labels.offsetX,y:e.y+F.value.scales.labels.fontSize/3,"text-anchor":`end`,"font-size":F.value.scales.labels.fontSize,fill:F.value.scales.labels.color},D(fi(e)),9,Yt)):b(``,!0),S(`circle`,{cx:K.value.x,cy:e.y,r:L.value.selectors.markers.radius,fill:L.value.selectors.markers.fill,stroke:L.value.selectors.markers.stroke,"stroke-width":L.value.selectors.markers.strokeWidth,class:`line-pointer`},null,8,Xt),S(`circle`,{cx:e.x,cy:K.value.y,r:L.value.selectors.markers.radius,fill:L.value.selectors.markers.fill,stroke:L.value.selectors.markers.stroke,"stroke-width":L.value.selectors.markers.strokeWidth,class:`line-pointer`},null,8,Zt),L.value.selectors.labels.showName&&!L.value.name.show?(C(),x(`text`,{key:4,x:e.x,y:e.y+(e.y<K.value.y?-L.value.selectors.labels.fontSize/2:L.value.selectors.labels.fontSize),"font-size":L.value.selectors.labels.fontSize,fill:L.value.selectors.labels.color,"font-weight":L.value.selectors.labels.bold?`bold`:`normal`,"text-anchor":e.x<U.value.left+100?`start`:e.x>U.value.right-100?`end`:e.x>K.value.x?`start`:`end`},D(e.v.name),9,Qt)):b(``,!0)])):b(``,!0)],64))),128)),P.value.show?(C(),x(`g`,{key:10,ref_key:`xAxisLabelLeft`,ref:Kn},[S(`text`,{id:`vue-ui-scatter-xAxis-label-${j.value}`,transform:`translate(${P.value.fontSize+(z.value.layout.dataLabels.reverseAxisLabels?F.value.offsetX:P.value.offsetX)}, ${U.value.top+U.value.height/2+(z.value.layout.dataLabels.reverseAxisLabels?F.value.offsetY:P.value.offsetY)}), rotate(-90)`,"text-anchor":`middle`,"font-size":P.value.fontSize,"font-weight":P.value.bold?`bold`:`normal`,fill:P.value.color},D(z.value.layout.dataLabels.reverseAxisLabels?F.value.name:P.value.name),9,$t),P.value.showValue?(C(),x(`text`,{key:0,"text-anchor":`middle`,"font-size":P.value.fontSize,fill:P.value.color,transform:`translate(${P.value.name?P.value.fontSize*3:0}, ${K.value.y+P.value.fontSize/3}), rotate(-90)`},D(G(W.value.xMin,L.value.selectors.labels.x.formatter,z.value.layout.dataLabels.xAxis.rounding)),9,en)):b(``,!0)],512)):b(``,!0),P.value.show&&P.value.showValue?(C(),x(`text`,{key:11,ref_key:`xAxisLabelRight`,ref:qn,"text-anchor":`middle`,transform:`translate(${U.value.right+z.value.layout.padding.right+6}, ${K.value.y+P.value.fontSize/3}), rotate(-90)`,"font-size":P.value.fontSize,fill:P.value.color},D(G(W.value.xMax,L.value.selectors.labels.x.formatter,P.value.rounding)),9,tn)):b(``,!0),F.value.show&&F.value.showValue?(C(),x(`text`,{key:12,ref_key:`yAxisLabelTop`,ref:Jn,x:K.value.x,y:U.value.top-F.value.fontSize,"text-anchor":`middle`,"font-size":F.value.fontSize,fill:F.value.color},D(G(W.value.yMax,L.value.selectors.labels.y.formatter,F.value.rounding)),9,nn)):b(``,!0),F.value.show?(C(),x(`g`,{key:13,ref_key:`yAxisLabelBottom`,ref:Yn},[F.value.showValue?(C(),x(`text`,{key:0,x:K.value.x,y:H.value.height-F.value.fontSize*2,"text-anchor":`middle`,"font-size":F.value.fontSize,fill:F.value.color},D(G(W.value.yMin,L.value.selectors.labels.y.formatter,z.value.layout.dataLabels.yAxis.rounding)),9,rn)):b(``,!0),S(`text`,{"text-anchor":`middle`,"font-size":F.value.fontSize,"font-weight":F.value.bold?`bold`:`normal`,fill:F.value.color,x:U.value.left+U.value.width/2+(z.value.layout.dataLabels.reverseAxisLabels?P.value.offsetX:F.value.offsetX),y:H.value.height+(z.value.layout.dataLabels.reverseAxisLabels?P.value.offsetY:F.value.offsetY)},D(z.value.layout.dataLabels.reverseAxisLabels?P.value.name:F.value.name),9,an)],512)):b(``,!0),S(`clipPath`,{id:`clip_path_${j.value}`},[S(`rect`,{x:U.value.left,y:U.value.top,width:U.value.width<=0?1e-4:U.value.width,height:U.value.height<=0?1e-4:U.value.height},null,8,sn)],8,on),z.value.layout.correlation.show?(C(),x(`g`,cn,[(C(!0),x(_,null,T(Y.value.filter(e=>e.correlation),(e,t)=>(C(),x(`line`,{x1:e.correlation.x1,x2:e.correlation.x2,y1:e.correlation.y1,y2:e.correlation.y2,"stroke-dasharray":z.value.layout.correlation.strokeDasharray,stroke:e.color,"stroke-width":z.value.layout.correlation.strokeWidth,"clip-path":`url(#clip_path_${j.value})`},null,8,ln))),256)),(C(!0),x(_,null,T(Y.value.filter(e=>e.correlation),(e,t)=>(C(),x(`g`,null,[z.value.layout.correlation.label.show?(C(),x(`text`,{key:0,x:e.correlation.x2,y:e.correlation.y2,fill:z.value.layout.correlation.label.useSerieColor?e.color:z.value.layout.correlation.label.color,"text-anchor":`end`,"font-size":z.value.layout.correlation.label.fontSize,"font-weight":z.value.layout.correlation.label.bold?`bold`:`normal`},D(O(u)({v:O(oe)(e.correlation?.coefficient??0),r:z.value.layout.correlation.label.roundingValue})),9,un)):b(``,!0)]))),256))])):b(``,!0),E(e.$slots,`svg`,{svg:{...H.value,drawingArea:{...U.value,zero:K.value},data:J.value,isPrintingImg:O(Cr)||O(wr)||O(Gi),isPrintingSvg:O(Ki)}},void 0,!0)],46,ct)),e.$slots.hint?(C(),x(`div`,dn,[E(e.$slots,`hint`,Je(We({hint:N.value.a11y.translations.keyboardNavigation,isVisible:tr.value})),void 0,!0)])):b(``,!0)]),e.$slots.watermark?(C(),x(`div`,fn,[E(e.$slots,`watermark`,Je(We({isPrinting:O(Cr)||O(wr)||O(Gi)||O(Ki)})),void 0,!0)])):b(``,!0),S(`div`,{id:`legend-bottom-${j.value}`},null,8,pn),kn.value&&Vn.value&&(z.value.legend.show||e.$slots.legend)?(C(),y(ze,{key:7,to:z.value.legend.position===`top`?`#legend-top-${j.value}`:`#legend-bottom-${j.value}`},[S(`div`,{ref_key:`chartLegend`,ref:Fn},[E(e.$slots,`legend`,{legend:q.value},()=>[z.value.legend.show?(C(),y(Pe,{key:`legend_${Bn.value}`,legendSet:q.value,config:Jr.value,isCursorPointer:ar.value,onClickMarker:s[2]||=({legend:e})=>_i(e.id)},{item:k(({legend:e})=>[S(`div`,{onClick:t=>e.segregate(),style:Ye(`opacity:${M.value.includes(e.id)?.5:1}`)},D(e.name),13,mn)]),legendToggle:k(()=>[q.value.length>2&&z.value.legend.selectAllToggle.show&&!O(lr)?(C(),y(Ie,{key:0,backgroundColor:z.value.legend.selectAllToggle.backgroundColor,color:z.value.legend.selectAllToggle.color,fontSize:z.value.legend.fontSize,checked:M.value.length>0,isCursorPointer:ar.value,onToggle:gi},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):b(``,!0)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):b(``,!0)],!0)],512)],8,[`to`])):b(``,!0),e.$slots.source?(C(),x(`div`,{key:8,ref_key:`source`,ref:In,dir:`auto`},[E(e.$slots,`source`,{},void 0,!0)],512)):b(``,!0),He(O(yn),{teleportTo:R.value.teleportTo,show:V.value.showTooltip&&An.value,backgroundColor:R.value.backgroundColor,color:R.value.color,borderRadius:R.value.borderRadius,borderColor:R.value.borderColor,borderWidth:R.value.borderWidth,fontSize:R.value.fontSize,backgroundOpacity:R.value.backgroundOpacity,position:R.value.position,offsetX:R.value.offsetX,offsetY:R.value.offsetY,parent:Nn.value,content:jn.value,isFullscreen:Ci.value,isCustom:R.value.customFormat&&typeof R.value.customFormat==`function`,smooth:R.value.smooth,backdropFilter:R.value.backdropFilter,smoothForce:R.value.smoothForce,smoothSnapThreshold:R.value.smoothSnapThreshold,isA11yMode:er.value===`keyboard`,a11yPosition:$n.value},{"tooltip-before":k(()=>[E(e.$slots,`tooltip-before`,Je(We({...ii.value})),void 0,!0)]),tooltip:k(()=>[E(e.$slots,`tooltip`,Je(We({...ii.value})),void 0,!0)]),"tooltip-after":k(()=>[E(e.$slots,`tooltip-after`,Je(We({...ii.value})),void 0,!0)]),default:k(()=>[R.value.showShape?(C(),x(`div`,hn,[(C(),x(`svg`,gn,[He(je,{shape:Z.value.shape,color:Z.value.color,plot:{x:10,y:10},radius:7},null,8,[`shape`,`color`])]))])):b(``,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),kn.value&&rr.value.buttons.table?(C(),y(Qe(Bi.value.component),Ge({key:9},Bi.value.props,{ref_key:`tableUnit`,ref:Wn,onClose:Vi}),Be({content:k(()=>[(C(),y(O(Sn),{key:`table_${zn.value}`,colNames:Si.value.colNames,head:Si.value.head,body:Si.value.body,config:Si.value.config,title:N.value.table.useDialog?``:Bi.value.title,withCloseButton:!N.value.table.useDialog,isCursorPointer:ar.value,onClose:Vi},{th:k(({th:e})=>[Ve(D(e),1)]),td:k(({td:e})=>[e.shape?(C(),x(`div`,_n,[S(`span`,null,D(e.content),1)])):(C(),x(`div`,{key:1,innerHTML:e},null,8,vn))]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[N.value.table.useDialog?{name:`title`,fn:k(()=>[Ve(D(Bi.value.title),1)]),key:`0`}:void 0,N.value.table.useDialog?{name:`actions`,fn:k(()=>[S(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[3]||=e=>xi(rr.value.callbacks.csv),style:Ye({cursor:ar.value?`pointer`:`default`})},[He(O(bn),{name:`fileCsv`,stroke:Bi.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):b(``,!0),E(e.$slots,`skeleton`,{},()=>[O(lr)?(C(),y(Ce,{key:0})):b(``,!0)],!0)],46,rt))}},[[`__scopeId`,`data-v-fa5b113c`]]);export{nt as n,yn as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Jt as r,Mt as i,P as a,X as ee,at as te,b as o,g as ne,i as re,in as ie,t as ae,zt as s}from"./lib-rPeBMZrn.js";import{c as oe}from"./canvas-lib-22VpOI4_.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./useConfig-_JwRfIqE.js";import{n as ue,t as de}from"./BaseScanner-8NdoBs7B.js";import{t as fe}from"./useFitSvgText-C1QC4P5G.js";import{t as pe}from"./useResponsive-CENUxfEL.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./vue_ui_spark_trend-BgPQfeCz.js";import{t as ge}from"./DefGrad-DKMq1REY.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as l,createBlock as _e,createCommentVNode as u,createElementBlock as d,createElementVNode as ve,createVNode as ye,defineAsyncComponent as be,nextTick as xe,normalizeStyle as Se,onMounted as Ce,openBlock as f,ref as p,renderSlot as m,toDisplayString as h,toRefs as we,unref as g,watch as _}from"vue";var Te=/* @__PURE__ */ e({default:()=>v}),Ee=[`id`,`aria-describedby`],De=[`id`],Oe=[`xmlns`,`viewBox`],ke=[`width`,`height`],Ae={key:1},je=[`d`,`fill`],Me=[`d`,`fill`],Ne=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Pe=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Fe=[`d`],Ie=[`fill`,`d`],Le=[`x`,`y`,`width`,`height`],Re=[`x`,`y`,`fill`,`font-size`,`font-weight`],ze=[`stroke`,`cx`,`cy`,`fill`],Be=[`x`,`y`,`font-size`,`fill`,`font-weight`],v=/*#__PURE__*/ c({__name:`vue-ui-spark-trend`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(e){let c=be(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_spark_trend:Te}=le(),v=me(),y=e,b=p(null),Ve=p(null),x=p(null),S=p(null),C=p(null),w=p(!1),T=p(null),E=p(ee()),D=p(I()),O=l(()=>D.value.style.dataLabel),k=l(()=>D.value.style.trendLabel),A=l(()=>D.value.style.line),j=l(()=>D.value.style.area),M=l(()=>D.value.style);se({config:()=>D.value,dataset:()=>y.dataset,component:`VueUiSparkTrend`,rules:[ce.emptyArray,{test:e=>e.length>1095,message:[`👀 The dataset has > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});let He=l(()=>ie({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`,line:{stroke:`#6A6A6A`,useColorTrend:!1},dataLabel:{show:!1,useColorTrend:!1,color:`#6A6A6A`}}},userConfig:D.value.skeletonConfig??{}})),{loading:N,FINAL_DATASET:P,manualLoading:F}=ue({...we(y),FINAL_CONFIG:D,prepareConfig:I,skeletonDataset:y.config?.skeletonDataset??[1,2,3,5,8,13,21,34,55,89,144,233],skeletonConfig:ie({defaultConfig:D.value,userConfig:He.value})});function I(){return t(y.config,Te,he)}let L=l(()=>i({data:P.value,threshold:D.value.downsample.threshold}));_(()=>y.config,e=>{D.value=I(),H.value=M.value.width,U.value=M.value.height,V()},{deep:!0});function R(e){return e.map(e=>o(e))}let z=p(i({data:P.value,threshold:D.value.downsample.threshold}).map(e=>M.value.animation.show&&!v.value||[void 0,1/0,-1/0,null,NaN].includes(e)?null:e));_(L,e=>{T.value&&=(cancelAnimationFrame(T.value),null),M.value.animation.show&&!v.value?z.value=Array(e.length).fill(null):z.value=e.map(e=>![void 0,1/0,-1/0,null].includes(e)&&!Number.isNaN(e)?e:null),B(),xe(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!0,immediate:!0}),_(()=>JSON.stringify(y.dataset),()=>{T.value&&=(cancelAnimationFrame(T.value),null),F.value=s(y.dataset);let e=L.value;z.value=M.value.animation.show&&!v.value?Array(e.length).fill(null):e.map(e=>Number.isFinite(e)?e:null),B(),xe(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!1,immediate:!0});function B(){let e=1e3/M.value.animation.animationFrames,t=performance.now();if(!N.value&&M.value.animation.show&&!v.value&&M.value.animation.animationFrames&&P.value.length>1){z.value=[];let n=0;function r(){w.value=!0;let i=performance.now(),a=i-t;a>e?(t=i-a%e,n<L.value.length?(z.value.push(L.value[n]),n+=1,T.value=requestAnimationFrame(r)):(cancelAnimationFrame(T.value),z.value=R(L.value),w.value=!1,$(`.vue-ui-sparktrend-progress-label`,6))):T.value=requestAnimationFrame(r)}r()}}Ce(()=>{V()});let Ue=l(()=>D.value.debug);function V(){if(s(y.dataset)&&(te({componentName:`VueUiSparkTrend`,type:`dataset`,debug:Ue.value}),F.value=!0),s(y.dataset)||(F.value=!1),D.value.responsive){let e=oe(()=>{let{width:e,height:t}=pe({chart:b.value,source:x.value});requestAnimationFrame(()=>{H.value=e,U.value=t})});S.value&&(C.value&&S.value.unobserve(C.value),S.value.disconnect()),S.value=new ResizeObserver(e),C.value=b.value.parentNode,S.value.observe(C.value)}B(),$(`.vue-ui-sparktrend-progress-label`,6)}let H=p(M.value.width),U=p(M.value.height),W=l(()=>({height:U.value,width:H.value})),G=l(()=>({top:M.value.padding.top,left:M.value.padding.left,right:W.value.width-M.value.padding.right,bottom:W.value.height-M.value.padding.bottom,height:W.value.height-(M.value.padding.top+M.value.padding.bottom)-(O.value.show?O.value.fontSize:0),width:W.value.width-(M.value.padding.left+M.value.padding.right)})),K=l(()=>{let e=R(L.value).filter(Number.isFinite);if(!e.length)return{max:0,min:0};let t=e[0],n=e[0];for(let r=1;r<e.length;r++){let i=e[r];i>t&&(t=i),i<n&&(n=i)}return{max:t,min:n}}),We=l(()=>{let e=L.value,t=e.length?e[e.length-1]:`x`;return[E.value,e.length,Number.isFinite(t)?t:`x`,D.value.downsample.threshold,A.value.smooth?`s`:`l`].join(`-`)}),q=l(()=>{let e=K.value.min>=0?0:K.value.min;return Math.abs(e)}),Ge=l(()=>K.value.max+q.value);function Ke(e){return e/Ge.value}let qe=l(()=>L.value.length),J=l(()=>z.value.map((e,t)=>{let n=isNaN(e)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(e)?0:e||0;return{value:o(e),absoluteValue:o(n),plotValue:o(n+q.value),toMax:Ke(n+q.value),x:G.value.left+o(t*(G.value.width/(qe.value-1)))-M.value.padding.right,y:G.value.bottom-o(G.value.height*Ke(n+q.value))}})),Y=l(()=>{let e=R(L.value);return k.value.trendType===`global`?ne(e):k.value.trendType===`n-1`&&e.length>1?(e.at(-1)/e.at(-2)-1)*100:k.value.trendType===`lastToFirst`?(e.at(-1)/e[0]-1)*100:0}),X=l(()=>w.value||Y.value===0?`neutral`:Y.value>0?`positive`:`negative`),Z=l(()=>M.value.arrow.colors[X.value]),Je=l(()=>{let e={x:J.value[0].x,y:W.value.height-6},t={x:J.value[J.value.length-1].x,y:W.value.height-6},n=[];return J.value.forEach(e=>{n.push(`${e.x},${e.y} `)}),[e.x,e.y,...n,t.x,t.y].toString()}),Ye=l(()=>{let e=[];return J.value.forEach(t=>{e.push(`${t.x},${t.y} `)}),`M ${e.toString()}`}),Q=l(()=>U.value/2-k.value.fontSize),Xe=l(()=>G.value.left*.8),{fitText:$}=fe({svgRef:Ve,unitWidth:Xe,fontSize:k.value.fontSize}),Ze=l(()=>{if(N.value||w.value)return`Trend chart loading`;let e=J.value?.at(-1),t=e?.value,r=n({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:k.value.rounding}),i=t==null?`not available`:re(O.value.formatter,t,n({p:O.value.prefix,v:t,s:O.value.suffix,r:O.value.rounding}),{datapoint:e});return`Progression ${X.value===`positive`?`up ${r}`:X.value===`negative`?`down ${r}`:`stable at ${r}`}. Last value ${i}.`}),Qe=l(()=>`sparktrend-a11y-${E.value}`);return(e,t)=>(f(),d(`div`,{ref_key:`sparkTrendChart`,ref:b,class:`vue-data-ui-component vue-ui-spark-trend`,id:E.value,style:Se(`width:100%;font-family:${M.value.fontFamily};background:${M.value.backgroundColor}`),role:`img`,"aria-describedby":Qe.value},[ve(`p`,{id:Qe.value,class:`sr-only`,"aria-live":`polite`},h(Ze.value),9,De),(f(),d(`svg`,{key:We.value,ref_key:`svgRef`,ref:Ve,xmlns:g(ae),viewBox:`0 0 ${W.value.width} ${W.value.height}`,style:`width:100%;background:transparent;overflow:visible`,"aria-hidden":`true`},[ye(g(c)),e.$slots[`chart-background`]?(f(),d(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[m(e.$slots,`chart-background`,{},void 0,!0)],8,ke)):u(``,!0),ve(`defs`,null,[ye(ge,{t:`linear`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,id:`pill_gradient_${E.value}`,stops:[[`0%`,g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),1],[`100%`,M.value.backgroundColor,1]]},null,8,[`id`,`stops`])]),j.value.show&&J.value[0]?(f(),d(`g`,Ae,[A.value.smooth?(f(),d(`path`,{key:0,d:`M ${J.value[0].x},${G.value.bottom} ${g(a)(J.value)} L ${J.value.at(-1).x},${G.value.bottom} Z`,fill:j.value.useGradient?`url(#pill_gradient_${E.value})`:g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),stroke:`none`},null,8,je)):(f(),d(`path`,{key:1,d:`M${Je.value}Z`,fill:j.value.useGradient?`url(#pill_gradient_${E.value})`:g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),stroke:`none`},null,8,Me))])):u(``,!0),A.value.smooth&&J.value.length?(f(),d(`path`,{key:2,d:`M ${g(a)(J.value)}`,stroke:A.value.useColorTrend?Z.value:A.value.stroke,fill:`none`,"stroke-width":A.value.strokeWidth,"stroke-linecap":A.value.strokeLinecap,"stroke-linejoin":A.value.strokeLinejoin},null,8,Ne)):u(``,!0),!A.value.smooth&&J.value.length?(f(),d(`path`,{key:3,d:Ye.value,stroke:A.value.useColorTrend?Z.value:A.value.stroke,fill:`none`,"stroke-width":A.value.strokeWidth,"stroke-linecap":A.value.strokeLinecap,"stroke-linejoin":A.value.strokeLinejoin},null,8,Pe)):u(``,!0),g(N)?(f(),d(`path`,{key:4,fill:`#6A6A6A`,d:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Fe)):(f(),d(`path`,{key:5,fill:Z.value,d:X.value===`positive`?`M ${G.value.left/2}, ${Q.value} ${G.value.left/2-7}, ${Q.value+12} ${G.value.left/2+7}, ${Q.value+12} Z`:X.value===`negative`?`M ${G.value.left/2}, ${Q.value+12} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2+7}, ${Q.value} Z`:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Ie)),g(N)?(f(),d(`rect`,{key:6,x:G.value.left/2-k.value.fontSize-2,y:U.value/2+k.value.fontSize-2,width:k.value.fontSize*2,height:k.value.fontSize,fill:`#6A6A6A80`,rx:`3`},null,8,Le)):u(``,!0),!w.value&&!g(N)?(f(),d(`text`,{key:7,class:`vue-ui-sparktrend-progress-label`,x:G.value.left/2,y:U.value/2+k.value.fontSize*2,"text-anchor":`middle`,fill:k.value.useColorTrend?Z.value:k.value.color,"font-size":k.value.fontSize,"font-weight":k.value.bold?`bold`:`normal`},h(g(n)({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:k.value.rounding})),9,Re)):u(``,!0),J.value.length&&J.value.at(-1).x!==void 0?(f(),d(`circle`,{key:8,stroke:M.value.backgroundColor,"stroke-width":2,cx:J.value.at(-1).x,cy:J.value.at(-1).y,r:4,fill:g(N)?`#6A6A6A`:Z.value},null,8,ze)):u(``,!0),J.value.length&&J.value.at(-1).x!==void 0&&O.value.show?(f(),d(`text`,{key:9,"text-anchor":`middle`,x:J.value.at(-1).x,y:J.value.at(-1).y-O.value.fontSize/1.5,"font-size":O.value.fontSize,fill:O.value.useColorTrend?Z.value:O.value.color,"font-weight":O.value.bold?`bold`:`normal`},h(g(re)(O.value.formatter,J.value.at(-1).value,g(n)({p:O.value.prefix,v:J.value.at(-1).value,s:O.value.suffix,r:O.value.rounding}),{datapoint:J.value.at(-1)})),9,Be)):u(``,!0)],8,Oe)),e.$slots.source?(f(),d(`div`,{key:0,ref_key:`source`,ref:x,dir:`auto`},[m(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),m(e.$slots,`skeleton`,{},()=>[g(N)?(f(),_e(de,{key:0})):u(``,!0)],!0)],12,Ee))}},[[`__scopeId`,`data-v-814f1b0f`]]);export{Te as n,v as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Ht as r,Jt as i,S as a,X as ee,Yt as te,at as o,i as s,in as c,t as ne,w as re,yt as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./useHints-C-TwxM0Y.js";import{t as ce}from"./useConfig-_JwRfIqE.js";import{n as le,t as ue}from"./BaseScanner-8NdoBs7B.js";import{t as de}from"./usePrefersMotion-XLHwega2.js";import{t as l}from"./vue_ui_sparkbar-CvcZ5nwT.js";import{t as u}from"./DefGrad-DKMq1REY.js";import{Fragment as d,computed as f,createBlock as fe,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as pe,guardReactiveProps as me,mergeProps as he,nextTick as ge,normalizeProps as _e,normalizeStyle as _,onMounted as v,openBlock as y,ref as b,renderList as ve,renderSlot as x,toDisplayString as S,toRefs as ye,unref as C,useSlots as w,watch as T}from"vue";var E=/* @__PURE__ */ e({default:()=>P}),D=[`onClick`,`onMouseenter`,`onMouseleave`],O={key:1,class:`vue-ui-sparkbar-datapoint-value`},k=[`xmlns`,`viewBox`],A=[`height`,`width`,`fill`,`rx`],j=[`height`,`width`,`fill`,`rx`],M=[`height`,`width`,`fill`,`rx`],N={key:2,ref:`source`,dir:`auto`},P={__name:`vue-ui-sparkbar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:[`selectDatapoint`],setup(e,{emit:E}){let P=pe(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_sparkbar:be}=ce(),F=de(),I=e,xe=w(),L=b(ee()),R=b(G()),z=f(()=>R.value.style.bar),B=f(()=>R.value.style.labels),V=f(()=>R.value.style),H=f(()=>R.value.debug);v(()=>{xe[`chart-background`]&&H.value&&console.warn(`VueUiSparkbar does not support the #chart-background slot.`)}),oe({config:()=>R.value,dataset:()=>I.dataset,component:`VueUiSparkbar`,rules:[se.noHint]});let Se=f(()=>c({defaultConfig:{style:{backgroundColor:`#99999930`,animation:{show:!1},layout:{independant:!0},gutter:{backgroundColor:`#6A6A6A`,opacity:50},bar:{gradient:{underlayerColor:`#6A6A6A`}}}},userConfig:R.value.skeletonConfig??{}})),{loading:U,FINAL_DATASET:W,manualLoading:Ce}=le({...ye(I),FINAL_CONFIG:R,prepareConfig:G,skeletonDataset:I.config?.skeletonDataset??[{name:`_`,value:21,target:25,color:`#808080`},{name:`_`,value:13,target:25,color:`#ADADAD`},{name:`_`,value:8,target:25,color:`#DBDBDB`}],skeletonConfig:c({defaultConfig:R.value,userConfig:Se.value})});function G(){return t(I.config,be,l)}T(()=>I.config,e=>{R.value=G()},{deep:!0});let we=f(()=>re(R.value.customPalette)),K=b(W.value.map(e=>({...e,value:V.value.animation.show?0:e.value||0,formatter:e.formatter||null}))),q=b(null);v(async()=>{ae(I.dataset)&&o({componentName:`VueUiSparkbar`,type:`dataset`,debug:H.value}),J()});function J(){if(V.value.animation.show&&!F.value){let e=V.value.animation.animationFrames,t=W.value.map((t,n)=>t.value/e),n=W.value.map(e=>e.value||0).reduce((e,t)=>e+t,0),r=0;function i(){r+=n/e,r<n?(K.value=K.value.map((e,n)=>({...e,value:e.value+=t[n]})),q.value=requestAnimationFrame(i)):K.value=W.value.map(e=>({...e,value:e.value||0,formatter:e.formatter||null}))}i()}}T(()=>W.value,async e=>{cancelAnimationFrame(q.value),K.value=W.value.map(e=>({...e,value:V.value.animation.show&&!F.value?0:e.value||0,formatter:e.formatter||null})),ge(J)},{deep:!0});let Y=b({width:500,height:16}),Te=f(()=>Math.max(...W.value.map(e=>e.value))),Ee=f(()=>(H.value&&W.value.forEach((e,t)=>{ie({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{o({componentName:`VueUiSparkbar`,type:`datasetSerieAttribute`,property:e,index:t})})}),K.value.map((e,t)=>({...e,value:e.value||0,color:a(e.color)||we.value[t]||r[t]||r[t%r.length]}))));function X(e){return e/Te.value}function Z(e){return V.value.layout.independant?e.target?e.value/e.target:V.value.layout.percentage?e.value>100?1:e.value/100:V.value.layout.target===0?1:e.value/V.value.layout.target:X(e.value)}function Q(e){return V.value.layout.independant&&e.target||V.value.layout.target}let De=E;function Oe(e,t){De(`selectDatapoint`,{datapoint:e,index:t}),R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:e,seriesIndex:t})}function ke(e,t){R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Ae(e,t){R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:e,seriesIndex:t})}let $=f(()=>z.value.borderRadius==null?Y.value.height/2:Math.min(Y.value.height/2,z.value.borderRadius));return(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkbar`,style:_({width:`100%`,position:`relative`,fontFamily:V.value.fontFamily,background:I.backgroundOpacity===null?V.value.backgroundColor:C(i)(V.value.backgroundColor,I.backgroundOpacity)})},[e.$slots.title?x(e.$slots,`title`,_e(me({title:{...e.title,title:V.value.title.text,subtitle:V.value.title.subtitle.text}})),void 0,void 0,0):p(``,!0),!e.$slots.title&&V.value.title.text?(y(),m(`div`,{key:1,class:`vue-ui-sparkbar-title-container`,style:_({background:V.value.title.backgroundColor,margin:V.value.title.margin,textAlign:V.value.title.textAlign})},[h(`div`,{class:`vue-ui-sparkbar-title`,style:_({fontSize:V.value.title.fontSize+`px`,color:V.value.title.color,fontWeight:V.value.title.bold?`bold`:`normal`})},S(V.value.title.text),5),V.value.title.subtitle.text?(y(),m(`div`,{key:0,class:`vue-ui-sparkbar-subtitle`,style:_({fontSize:V.value.title.subtitle.fontSize+`px`,color:V.value.title.subtitle.color,fontWeight:V.value.title.subtitle.bold?`bold`:`normal`})},S(V.value.title.subtitle.text),5)):p(``,!0)],4)):p(``,!0),(y(!0),m(d,null,ve(Ee.value,(t,r)=>(y(),m(`div`,{style:_(`display:flex !important;${[`left`,`right`].includes(B.value.name.position)?`flex-direction: ${B.value.name.position===`right`?`row-reverse`:`row`} !important`:`flex-direction:column !important`};gap:${V.value.gap}px !important;align-items:center;${C(W).length>0&&r!==C(W).length-1?`margin-bottom:6px`:``}`),onClick:e=>Oe(t,r),onMouseenter:e=>ke(t,r),onMouseleave:e=>Ae(t,r)},[C(U)?p(``,!0):x(e.$slots,`data-label`,he({ref_for:!0},{bar:{...t,target:Q(t),valueLabel:C(s)(t.formatter,t.value,C(n)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r}),targetLabel:C(s)(t.formatter,Q(t),C(n)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})}}),void 0,void 0,0),!e.$slots[`data-label`]||C(U)?(y(),m(`div`,{key:1,style:_({display:`flex`,justifyContent:[`right`,`top-right`].includes(B.value.name.position)?`flex-end`:[`top-center`].includes(B.value.name.position)?`center`:`flex-start`,alignItems:`center`,width:B.value.name.width,color:B.value.name.color,fontSize:B.value.fontSize+`px`,fontWeight:B.value.name.bold?`bold`:`normal`,flexWrap:`wrap`})},[C(U)?(y(),m(`div`,{key:0,class:`vue-ui-sparkbar-skeleton-name`,style:_({width:`60px`,height:B.value.fontSize+`px`,borderRadius:B.value.fontSize/4+`px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:`5px`})},[h(`div`,{style:_({height:`100%`,width:`40px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4),h(`div`,{style:_({height:`100%`,width:`15px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4)],4)):(y(),m(d,{key:1},[h(`span`,null,S(t.name),1),B.value.value.show?(y(),m(`span`,{key:0,style:_(`font-weight:${B.value.value.bold?`bold`:`normal`}`),class:`vue-ui-sparkbar-datapoint-name`},`: `+S(C(s)(t.formatter,t.value,C(n)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})),5)):p(``,!0),V.value.layout.showTargetValue?(y(),m(`span`,O,S(` `+V.value.layout.targetValueText)+` `+S(C(s)(t.formatter,Q(t),C(n)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})),1)):p(``,!0)],64))],4)):p(``,!0),(y(),m(`svg`,{role:`img`,xmlns:C(ne),viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,width:`100%`},[g(C(P)),h(`defs`,null,[g(u,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`sparkbar_gradient_${r}_${L.value}`,stops:[[`0%`,C(i)(C(te)(t.color,.03),100-z.value.gradient.intensity),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),h(`rect`,{height:Y.value.height,width:Y.value.width,x:0,y:0,fill:C(i)(V.value.gutter.backgroundColor,V.value.gutter.opacity),rx:$.value},null,8,A),h(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.underlayerColor,rx:$.value},null,8,j),h(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.show?`url(#sparkbar_gradient_${r}_${L.value})`:t.color,rx:$.value},null,8,M)],8,k))],44,D))),256)),e.$slots.source?(y(),m(`div`,N,[x(e.$slots,`source`)],512)):p(``,!0),C(U)?(y(),fe(ue,{key:3})):p(``,!0)],4))}};export{E as n,P as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Tt as r,X as i,at as a,b as o,i as s,in as c,t as l,yt as u,zt as ee}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-_JwRfIqE.js";import{n as ie,t as ae}from"./BaseScanner-8NdoBs7B.js";import{t as oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as se}from"./usePrefersMotion-XLHwega2.js";import{t as ce}from"./vue_ui_sparkgauge-D3xirz2w.js";import{t as le}from"./DefGrad-DKMq1REY.js";import{computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as ue,normalizeClass as de,normalizeStyle as _,onBeforeUnmount as fe,onMounted as v,openBlock as y,ref as b,renderSlot as x,toDisplayString as S,toRefs as pe,unref as C,watch as w}from"vue";var T=/* @__PURE__ */ e({default:()=>j}),E=[`xmlns`,`viewBox`],me=[`width`,`height`],he=[`d`,`stroke`,`stroke-linecap`],D=[`d`,`stroke`,`stroke-linecap`,`stroke-dashoffset`],O=[`x`,`y`,`width`,`height`],k=[`x`,`y`,`font-size`,`fill`,`font-weight`],A={key:2,ref:`source`,dir:`auto`},j={__name:`vue-ui-sparkgauge`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(e){let T=ue(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_sparkgauge:j}=re(),M=se(),N=b(null),P=e,F=b(i()),I=b(W()),L=d(()=>I.value.style.dataLabel),R=d(()=>I.value.style);te({config:()=>I.value,dataset:()=>P.dataset,component:`VueUiSparkgauge`,rules:[ne.noHint]});let z=d(()=>R.value.animation.show&&!M.value),ge=d(()=>c({defaultConfig:{style:{animation:{show:!1},background:`#99999930`,colors:{min:`#CACACA`,max:`#6A6A6A`},track:{autoColor:!0},gutter:{color:`#6A6A6A80`}}},userConfig:I.value.skeletonConfig??{}})),{loading:B,FINAL_DATASET:V}=ie({...pe(P),FINAL_CONFIG:I,prepareConfig:W,skeletonDataset:P.config?.skeletonDataset??{value:0,min:-1,max:1,title:``},skeletonConfig:c({defaultConfig:I.value,userConfig:ge.value})}),H=d(()=>{let e=V.value.min??0,t=V.value.max??0;return{min:e,max:t,diff:t-e}}),U=d(()=>H.value.diff/R.value.animation.speedMs),{svgRef:_e}=oe({config:{text:P.dataset?.title||``}});function W(){return t(P.config,j,ce)}v(()=>{K()});let G=d(()=>I.value.debug);function K(){ee(P.dataset)?a({componentName:`VueUiSparkgauge`,type:`dataset`,debug:G.value}):u({datasetObject:P.dataset,requiredAttributes:[`value`,`min`,`max`]}).forEach(e=>{a({componentName:`VueUiSparkgauge`,type:`datasetAttribute`,property:e,debug:G.value})})}w(()=>P.config,()=>{I.value=W(),J.value=z.value?H.value.min:V.value.value,K()},{deep:!0});let q=d(()=>({height:R.value.height,width:128,base:R.value.basePosition})),J=b(z.value?H.value.min:V.value.value);w([()=>V.value.value,z],([e,t])=>{Y(e||0,t)},{immediate:!0});let ve=d(()=>J.value>H.value.max?H.value.max:J.value<H.value.min?H.value.min:J.value);v(()=>{Y(V.value.value||0)});function Y(e,t=z.value){if(N.value&&=(cancelAnimationFrame(N.value),null),!t){J.value=e;return}function n(){J.value<e?J.value=Math.min(J.value+U.value,e):J.value>e&&(J.value=Math.max(J.value-U.value,e)),J.value===e?N.value=null:N.value=requestAnimationFrame(n)}n()}let X=d(()=>V.value.title??``),Z=d(()=>{let e=H.value.diff;if(!isFinite(e)||e===0)return 0;let t=H.value.min,n=ve.value;return n>=0?(n-t)/e:(Math.abs(t)-Math.abs(n))/e}),Q=d(()=>r(R.value.colors.min,R.value.colors.max,H.value.min,H.value.max,J.value)),$=d(()=>L.value.autoColor?Q.value:L.value.color),ye=d(()=>R.value.track.autoColor?Q.value:R.value.track.color);return fe(()=>{N.value&&cancelAnimationFrame(N.value)}),(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkgauge`,style:_(`font-family:${R.value.fontFamily};width: 100%; background:${R.value.background}`)},[R.value.title.show&&X.value&&R.value.title.position===`top`?(y(),m(`div`,{key:0,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),(y(),m(`svg`,{ref_key:`svgRef`,ref:_e,xmlns:C(l),viewBox:`0 0 ${q.value.width} ${q.value.height}`,style:`overflow: visible; background:transparent; width:100%;`},[g(C(T)),e.$slots[`chart-background`]&&!C(B)?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`)],8,me)):p(``,!0),h(`defs`,null,[g(le,{t:`linear`,id:`gradient_${F.value}`,x1:`-10%`,y1:`100%`,x2:`110%`,y2:`100%`,stops:[[`0%`,R.value.colors.min,1],[`100%`,R.value.colors.max,1]]},null,8,[`id`,`stops`])]),h(`path`,{d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.gutter.color,"stroke-width":8,"stroke-linecap":R.value.gutter.strokeLinecap,fill:`none`},null,8,he),Z.value===0?p(``,!0):(y(),m(`path`,{key:1,d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.colors.showGradient?`url(#gradient_${F.value})`:ye.value,"stroke-width":8,"stroke-linecap":R.value.track.strokeLinecap,fill:`none`,"stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*Z.value,class:de({"vue-ui-sparkgauge-track":R.value.animation.show}),style:_(R.value.animation.show?`animation: vue-ui-sparkgauge-animation ${R.value.animation.speedMs}ms ease-in;`:``)},null,14,D)),C(B)?(y(),m(`rect`,{key:2,x:q.value.width/2-L.value.fontSize/2,y:q.value.base+6+L.value.offsetY-L.value.fontSize,width:L.value.fontSize,height:L.value.fontSize,fill:`#6A6A6A50`,rx:3},null,8,O)):(y(),m(`text`,{key:3,"text-anchor":`middle`,x:q.value.width/2,y:q.value.base+6+L.value.offsetY,"font-size":L.value.fontSize,fill:$.value,"font-weight":L.value.bold?`bold`:`normal`},S(C(s)(L.value.formatter,C(o)(J.value),C(n)({p:L.value.prefix,v:C(o)(J.value),s:L.value.suffix,r:L.value.rounding}),{datapoint:C(o)(J.value),color:$.value})),9,k))],8,E)),R.value.title.show&&X.value&&R.value.title.position===`bottom`?(y(),m(`div`,{key:1,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),e.$slots.source?(y(),m(`div`,A,[x(e.$slots,`source`)],512)):p(``,!0),x(e.$slots,`skeleton`,{},()=>[C(B)?(y(),f(ae,{key:0})):p(``,!0)])],4))}};export{T as n,j as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Jt as r,X as i,Yt as a,at as o,i as s,in as c,t as l,yt as ee,zt as u}from"./lib-rPeBMZrn.js";import{c as d}from"./canvas-lib-22VpOI4_.js";import{n as f,t as te}from"./useHints-C-TwxM0Y.js";import{t as ne}from"./useConfig-_JwRfIqE.js";import{n as re,t as ie}from"./BaseScanner-8NdoBs7B.js";import{t as ae}from"./useFitSvgText-C1QC4P5G.js";import{t as oe}from"./useResponsive-CENUxfEL.js";import{t as se}from"./useChartAccessibility-DOMuYJfm.js";import{t as ce}from"./Shape-CRe8woTu.js";import{t as le}from"./vue_ui_sparkhistogram-E6G1761_.js";import{t as ue}from"./A11yDataTable-DWNlWXzs.js";import{t as p}from"./DefGrad-DKMq1REY.js";import{t as m}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as h,computed as g,createBlock as _,createCommentVNode as v,createElementBlock as y,createElementVNode as b,createTextVNode as de,createVNode as fe,defineAsyncComponent as pe,guardReactiveProps as me,nextTick as he,normalizeClass as ge,normalizeProps as _e,normalizeStyle as x,onMounted as ve,openBlock as S,ref as C,renderList as w,renderSlot as T,toDisplayString as E,toRefs as ye,unref as D,useCssVars as be,watch as xe}from"vue";var O=/* @__PURE__ */ e({default:()=>k}),Se=[`id`],Ce={key:0},we={key:1},Te={style:{position:`relative`}},Ee=[`xmlns`,`viewBox`,`aria-describedby`],De=[`width`,`height`],Oe=[`height`,`width`,`fill`,`x`,`stroke`,`stroke-width`,`rx`,`stroke-dasharray`],ke={key:1},Ae=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`rx`],je={key:2},Me=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ne=[`x`,`y`,`font-size`,`fill`],Pe=[`x`,`y`,`font-size`,`fill`],Fe=[`height`,`width`,`x`,`onMouseover`,`onMouseleave`,`onClick`],Ie={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},k=/*#__PURE__*/ m({__name:`vue-ui-sparkhistogram`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`],setup(e,{emit:m}){be(e=>({v57deebda:Xe.value}));let O=pe(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_sparkhistogram:k}=ne(),A=e,j=C(i()),M=C(null),Le=C(null),N=C(null),P=C(null),F=C(null),I=C(!1),L=C(null),R=C(`pointer`),z=C(q()),B=g(()=>z.value.style.labels),V=g(()=>z.value.style.bars),H=g(()=>z.value.style);f({config:()=>z.value,dataset:()=>A.dataset,component:`VueUiSparkHistogram`,rules:[te.singleSeries,{test:e=>e.length>31,message:[`👀 The number of datapoints is > 31. For a more readable chart, consider:`,``,`▶️ Using VueUiXy with a line series`]}]});let Re=g(()=>c({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`}},userConfig:z.value.skeletonConfig??{}})),{loading:ze,FINAL_DATASET:U,manualLoading:Be}=re({...ye(A),FINAL_CONFIG:z,prepareConfig:q,skeletonDataset:A.config?.skeletonDataset??[{value:1,intensity:.2,color:`#CACACA`},{value:2,intensity:.3,color:`#CACACA`},{value:3,intensity:.5,color:`#CACACA`},{value:5,intensity:.7,color:`#CACACA`},{value:8,intensity:.9,color:`#CACACA`},{value:13,intensity:.95,color:`#CACACA`},{value:21,intensity:1,color:`#CACACA`},{value:13,intensity:.95,color:`#CACACA`},{value:8,intensity:.9,color:`#CACACA`},{value:5,intensity:.7,color:`#CACACA`},{value:3,intensity:.5,color:`#CACACA`},{value:2,intensity:.3,color:`#CACACA`},{value:1,intensity:.2,color:`#CACACA`}],skeletonConfig:c({defaultConfig:z.value,userConfig:Re.value})}),W=C(H.value.layout.width),G=C(H.value.layout.height),{svgRef:K}=se({config:H.value.title});function q(){return t(A.config,k,le)}ve(()=>{He()});let Ve=g(()=>z.value.debug);function He(){if(u(A.dataset)?o({componentName:`VueUiSparkHistogram`,type:`dataset`,debug:Ve.value}):Ve.value&&A.dataset.forEach((e,t)=>{ee({datasetObject:e,requiredAttributes:[`value`]}).forEach(e=>{o({componentName:`VueUiSparkHistogram`,type:`datasetSerieAttribute`,property:e,index:t})})}),z.value.responsive){let e=d(()=>{let{width:e,height:t}=oe({chart:N.value,title:H.value.title.text?Le.value:null,source:M.value}),n=B.value.timeLabel.show?B.value.timeLabel.fontSize*2:0,r=B.value.valueLabel.show?B.value.valueLabel.fontSize*2:0;requestAnimationFrame(()=>{W.value=Math.max(10,e),G.value=Math.max(10,t-12-n-r)})});P.value&&(F.value&&P.value.unobserve(F.value),P.value.disconnect()),P.value=new ResizeObserver(e),F.value=N.value.parentNode,P.value.observe(F.value)}}xe(()=>A.config,e=>{z.value=q(),He()},{deep:!0});let J=g(()=>{let e=B.value.timeLabel.show?B.value.timeLabel.fontSize*2:0,t=B.value.valueLabel.show?B.value.valueLabel.fontSize*2:0,n=G.value+e+t,r=W.value,i=H.value.layout.padding.top,a=n-H.value.layout.padding.bottom,o=H.value.layout.padding.left,s=r-H.value.layout.padding.right;return{bottom:a,centerY:i+(n-i-H.value.layout.padding.bottom)/2,drawingHeight:n-H.value.layout.padding.top-H.value.layout.padding.bottom-e-t,drawingWidth:r-H.value.layout.padding.left-H.value.layout.padding.right,height:n,left:o,right:s,top:i,width:r}}),Ue=g(()=>Math.max(...U.value.map(e=>Math.abs(e.value||0))));function We(e){return Math.abs(e)/Ue.value}let Y=g(()=>U.value.map((e,t)=>{let n=We(e.value||0),i=J.value.drawingHeight*n,a=J.value.drawingWidth/U.value.length,o=a*(V.value.gap/100),s=a-o,c=J.value.centerY-i/2,l=J.value.left+(o/2+t*a),ee=J.value.left+t*a,u=e.intensity===void 0?100:Math.round(e.intensity*100),d=e.color?e.color:e.value>=0?r(V.value.colors.positive,u):r(V.value.colors.negative,u),f=e.color?e.color:e.value>=0?V.value.colors.positive:V.value.colors.negative,te=e.color?`url(#gradient_datapoint_${t}_${j.value})`:e.value>=0?`url(#gradient_positive_${t}_${j.value})`:`url(#gradient_negative_${t}_${j.value})`,ne=l+s/2;return{...e,color:d,gradient:te,height:i,intensity:u,proportion:n,stroke:f,textAnchor:ne,trapX:ee,unitWidth:a,width:s,x:l,y:c}}));function Ge(e,t){return s(B.value.value.formatter,e.value,n({p:B.value.value.prefix,v:e.value,s:B.value.value.suffix,r:B.value.value.rounding}),{datapoint:e,seriesIndex:t})}let X=C(null),Ke=m;function Z(e,t){Ke(`selectDatapoint`,{datapoint:e,index:t}),z.value.events.datapointClick&&z.value.events.datapointClick({datapoint:e,seriesIndex:t})}function qe(e,t){R.value=`pointer`,L.value=t,X.value=t,z.value.events.datapointEnter&&z.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Je(e,t){R.value!==`keyboard`&&(X.value=null,L.value=null,z.value.events.datapointLeave&&z.value.events.datapointLeave({datapoint:e,seriesIndex:t}))}function Ye(){R.value!==`keyboard`&&(X.value=null,L.value=null)}let Xe=g(()=>`${H.value.animation.speedMs}ms`),Ze=g(()=>J.value.drawingWidth/U.value.length*.9),{fitText:Q}=ae({svgRef:K,unitWidth:Ze});ve(async()=>{await he(),Q(`.vue-ui-sparkhistogram-top-label`,B.value.value.minFontSize),Q(`.vue-ui-sparkhistogram-bottom-label`,B.value.valueLabel.minFontSize),Q(`.vue-ui-sparkhistogram-time-label`,B.value.timeLabel.minFontSize)}),xe([W,G,()=>U.value],async()=>{await he(),Q(`.vue-ui-sparkhistogram-top-label`,B.value.value.minFontSize),Q(`.vue-ui-sparkhistogram-bottom-label`,B.value.valueLabel.minFontSize),Q(`.vue-ui-sparkhistogram-time-label`,B.value.timeLabel.minFontSize)});function Qe(){I.value=!0}function $e(){I.value=!1,L.value=null,R.value=`pointer`,X.value=null}function et(e){if(!K.value||document.activeElement!==K.value||!Y.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){L.value=null,X.value=null,R.value=`pointer`;return}if(r){if(X.value===null)return;let e=Y.value[X.value];if(!e)return;Z(e,X.value);return}R.value=`keyboard`;let a=L.value;a===null||a<0||a>=Y.value.length?a=n?0:Y.value.length-1:n?(a+=1,a>=Y.value.length&&(a=0)):t&&(--a,a<0&&(a=Y.value.length-1)),L.value=a,X.value=a;let o=Y.value[a];z.value.events.datapointEnter&&z.value.events.datapointEnter({datapoint:o,seriesIndex:a})}let $=g(()=>({headers:[z.value.a11y?.translations?.series??`Series`,z.value.a11y?.translations?.time??`Time`,z.value.a11y?.translations?.value??`Value`,z.value.a11y?.translations?.valueLabel??`Label`],rows:Y.value.map((e,t)=>[t+1,e.timeLabel??``,e.value??``,e.valueLabel??``])}));return(e,t)=>(S(),y(`div`,{class:`vue-data-ui-component vue-ui-spark-histogram`,ref_key:`histogramChart`,ref:N,style:x(`width:100%;background:${H.value.backgroundColor};font-family:${H.value.fontFamily}`),onMouseleave:Ye},[b(`div`,{id:`chart-instructions-${j.value}`,class:`sr-only`},[b(`p`,null,E(z.value.a11y.translations.keyboardNavigation),1)],8,Se),$.value?.rows?.length?(S(),_(ue,{key:0,uid:j.value,head:$.value.headers,body:$.value.rows,notice:z.value.a11y.translations.tableAvailable,caption:z.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):v(``,!0),H.value.title.text?(S(),y(`div`,{key:1,ref_key:`chartTitle`,ref:Le,style:x(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${H.value.title.margin};padding: 0 6px;text-align:${H.value.title.textAlign}`)},[b(`div`,{style:x(`font-size:${H.value.title.fontSize}px;color:${H.value.title.color};font-weight:${H.value.title.bold?`bold`:`normal`}`)},[de(E(H.value.title.text)+` `,1),X.value===null?v(``,!0):(S(),y(`span`,Ce,`- `+E(Y.value[X.value].timeLabel||``)+` `+E(D(s)(B.value.value.formatter,Y.value[X.value].value,D(n)({p:B.value.value.prefix,v:Y.value[X.value].value,s:B.value.value.suffix,r:B.value.value.rounding}),{datapoint:Y.value[X.value],seriesIndex:X.value})),1)),![void 0,null].includes(X.value)&&![null,void 0].includes(Y.value[X.value].valueLabel)?(S(),y(`span`,we,E(` (${Y.value[X.value].valueLabel||0})`),1)):v(``,!0)],4),H.value.title.subtitle.text?(S(),y(`div`,{key:0,style:x(`font-size:${H.value.title.subtitle.fontSize}px;color:${H.value.title.subtitle.color};font-weight:${H.value.title.subtitle.bold?`bold`:`normal`}`)},E(H.value.title.subtitle.text),5)):v(``,!0)],4)):v(``,!0),b(`div`,Te,[(S(),y(`svg`,{ref_key:`svgRef`,ref:K,xmlns:D(l),viewBox:`0 0 ${J.value.width} ${J.value.height}`,style:{overflow:`visible`},"aria-describedby":`chart-instructions-${j.value}`,tabindex:`0`,onFocus:Qe,onBlur:$e,onKeydown:et},[fe(D(O)),e.$slots[`chart-background`]?(S(),y(`foreignObject`,{key:0,x:0,y:0,width:J.value.width,height:J.value.height,style:{pointerEvents:`none`}},[T(e.$slots,`chart-background`,{},void 0,!0)],8,De)):v(``,!0),b(`defs`,null,[(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),_(p,{t:`radial`,id:`gradient_positive_${t}_${j.value}`,key:`gradient_positive_${t}_${j.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,D(r)(D(a)(V.value.colors.positive,.05),e.intensity),1],[`100%`,D(r)(V.value.colors.positive,e.intensity),1]]},null,8,[`id`,`stops`]))),128)),(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),_(p,{t:`radial`,id:`gradient_negative_${t}_${j.value}`,key:`gradient_negative_${t}_${j.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,D(r)(D(a)(V.value.colors.negative,.05),e.intensity),1],[`100%`,D(r)(V.value.colors.negative,e.intensity),1]]},null,8,[`id`,`stops`]))),128)),(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),_(p,{t:`radial`,id:`gradient_datapoint_${t}_${j.value}`,key:`gradient_datapoint_${t}_${j.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,D(r)(D(a)(e.color,.05),e.intensity),1],[`100%`,D(r)(e.color,e.intensity),1]]},null,8,[`id`,`stops`]))),128))]),(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),y(`g`,null,[X.value!==null&&X.value===t?(S(),y(`rect`,{key:0,height:J.value.height,width:e.unitWidth,fill:H.value.selector.fill,x:e.trapX,y:0,stroke:H.value.selector.stroke,"stroke-width":H.value.selector.strokeWidth,rx:H.value.selector.borderRadius,"stroke-dasharray":H.value.selector.strokeDasharray},null,8,Oe)):v(``,!0)]))),256)),!V.value.shape||V.value.shape===`square`?(S(),y(`g`,ke,[(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),y(`rect`,{x:e.x,y:e.y,height:e.height,width:e.width,fill:V.value.colors.gradient.show?e.gradient:e.color,stroke:e.stroke,"stroke-width":V.value.strokeWidth,rx:`${V.value.borderRadius*e.proportion/12}%`,class:ge({"vue-ui-sparkhistogram-shape":H.value.animation.show})},null,10,Ae))),256))])):(S(),y(`g`,je,[(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),_(ce,{plot:{x:e.x+e.width/2,y:e.y+e.height/2},color:V.value.colors.gradient.show?e.gradient:e.color,shape:V.value.shape,radius:Math.min(e.height*.4,e.width*.4),class:ge({"vue-ui-sparkhistogram-shape":H.value.animation.show})},null,8,[`plot`,`color`,`shape`,`radius`,`class`]))),256))])),D(ze)?v(``,!0):(S(),y(h,{key:3},[(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),y(`g`,null,[B.value.value.show?(S(),y(`text`,{key:0,class:`vue-ui-sparkhistogram-top-label`,"text-anchor":`middle`,x:e.textAnchor,y:e.y-B.value.value.fontSize/3+B.value.value.offsetY,"font-size":B.value.value.fontSize,"font-weight":B.value.value.bold?`bold`:`normal`,fill:B.value.value.color},E(Ge(e,t)),9,Me)):v(``,!0)]))),256)),(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),y(`g`,null,[e.valueLabel&&B.value.valueLabel.show?(S(),y(`text`,{key:0,class:`vue-ui-sparkhistogram-bottom-label`,x:e.textAnchor,y:e.y+e.height+B.value.valueLabel.fontSize,"font-size":B.value.valueLabel.fontSize,"text-anchor":`middle`,fill:B.value.valueLabel.color},E(e.valueLabel),9,Ne)):v(``,!0)]))),256)),(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),y(`g`,null,[e.timeLabel&&B.value.timeLabel.show?(S(),y(`text`,{key:0,class:`vue-ui-sparkhistogram-time-label`,x:e.textAnchor,y:J.value.height,"font-size":B.value.timeLabel.fontSize,fill:B.value.timeLabel.color,"text-anchor":`middle`},E(e.timeLabel),9,Pe)):v(``,!0)]))),256))],64)),(S(!0),y(h,null,w(Y.value,(e,t)=>(S(),y(`g`,null,[b(`rect`,{height:J.value.height,width:e.unitWidth,fill:`transparent`,x:e.trapX,y:0,onMouseover:n=>qe(e,t),onMouseleave:n=>Je(e,t),onClick:()=>Z(e,t)},null,40,Fe)]))),256))],40,Ee)),e.$slots.hint?(S(),y(`div`,Ie,[T(e.$slots,`hint`,_e(me({hint:z.value.a11y.translations.keyboardNavigation,isVisible:I.value})),void 0,!0)])):v(``,!0)]),e.$slots.source?(S(),y(`div`,{key:2,ref_key:`source`,ref:M,dir:`auto`},[T(e.$slots,`source`,{},void 0,!0)],512)):v(``,!0),T(e.$slots,`skeleton`,{},()=>[D(ze)?(S(),_(ie,{key:0})):v(``,!0)],!0)],36))}},[[`__scopeId`,`data-v-e5a32af0`]]);export{O as n,k as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as t,A as n,Et as r,G as i,I as a,Jt as o,K as s,L as c,N as l,Nt as u,P as d,R as f,S as p,U as ee,W as te,X as ne,Yt as re,at as ie,d as ae,dt as oe,i as se,in as ce,k as le,lt as ue,m as de,qt as fe,t as pe,yt as me,zt as he}from"./lib-rPeBMZrn.js";import{c as ge}from"./canvas-lib-22VpOI4_.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useConfig-_JwRfIqE.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./useNestedProp-DnGoh-XS.js";import{t as Ce}from"./useResponsive-CENUxfEL.js";import{t as we}from"./useThemeCheck-BKNRbGeC.js";import{t as Te}from"./useTimeLabels-Das5O74F.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./usePrefersMotion-XLHwega2.js";import{t as Oe}from"./vue_ui_sparkline-DKZdnbap.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as m,computed as h,createBlock as Me,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as Fe,guardReactiveProps as Ie,nextTick as y,normalizeClass as Le,normalizeProps as Re,normalizeStyle as ze,onBeforeUnmount as Be,onMounted as Ve,openBlock as b,ref as x,renderList as S,renderSlot as He,shallowRef as Ue,toDisplayString as We,toRefs as Ge,unref as C,watch as w,watchEffect as Ke,withCtx as qe}from"vue";var Je={key:0,style:{"pointer-events":`none`}},Ye=[`r`,`fill`,`filter`],Xe=[`begin`,`dur`,`repeatCount`,`fill`,`calcMode`,`keySplines`,`keyTimes`,`keyPoints`],Ze=[`href`],Qe=[`dur`,`repeatCount`,`fill`,`values`],$e=[`r`,`fill`],et=[`begin`,`dur`,`repeatCount`,`calcMode`,`keySplines`,`keyTimes`,`keyPoints`],T=[`href`],tt=[`dur`,`repeatCount`],nt={__name:`SparklinePulse`,props:{uid:{type:String,required:!0},svgRef:{type:Object,default:null},pulsePathId:{type:String,required:!0},pulsePathLength:{type:Number,required:!0},pulseDur:{type:String,required:!0},pulseBegin:{type:String,required:!0},pulseRepeatCount:{type:String,required:!0},pulseFillMode:{type:String,default:void 0},pulseKeyPoints:{type:String,required:!0},pulseMotion:{type:Object,required:!0},pulse:{type:Object,required:!0},pulseTrail:{type:Object,required:!0},pulseTrailLength:{type:Number,required:!0},prefersReducedMotion:{type:Boolean,required:!0},loading:{type:Boolean,required:!0},isBar:{type:Boolean,required:!0}},setup(e){let t=e,n=h(()=>Math.min(t.pulseTrailLength,45)),r=h(()=>!!t.pulse?.show&&!t.isBar&&!t.prefersReducedMotion&&!t.loading&&Number(t.pulsePathLength)>0);function i(){let e=t.svgRef?.value;e&&(typeof e.pauseAnimations==`function`&&e.pauseAnimations(),typeof e.setCurrentTime==`function`&&e.setCurrentTime(0),typeof e.unpauseAnimations==`function`&&e.unpauseAnimations())}function a(e,t){if(typeof e!=`string`)return e;let n=e.trim().match(/^([\d.]+)\s*(ms|s)$/);if(!n)return e;let r=Number(n[1]),i=n[2];return Number.isNaN(r)?e:`${r+t}${i}`}function o(e){return(n.value-e)/n.value*t.pulse.radius}function s(e){let r=t.pulse.trail.opacity,i=(n.value-e)/n.value,a=e===0?1:i*r;return`0;${a};${a};0`}return w(()=>t.loading,async e=>{e||await y(),i()}),w(()=>t.pulsePathId,async()=>{await y(),i()}),Be(()=>{i()}),(t,i)=>r.value?(b(),_(`g`,Je,[(b(!0),_(m,null,S(n.value,(t,n)=>(b(),_(m,null,[n%3==0?(b(),_(`circle`,{key:`sparkline_dot_${n}_${e.pulsePathId}`,r:o(n),fill:e.pulse.color,filter:`url(#sparkline_pulse_glow_${e.uid})`,opacity:`0`},[v(`animateMotion`,{begin:a(e.pulseBegin,n*10),dur:e.pulseDur,repeatCount:e.pulseRepeatCount,fill:e.pulseFillMode,calcMode:e.pulseMotion.calcMode,keySplines:e.pulseMotion.keySplines||void 0,keyTimes:e.pulseMotion.keyTimes||void 0,keyPoints:e.pulseKeyPoints,rotate:`auto`},[v(`mpath`,{href:`#${e.pulsePathId}`},null,8,Ze)],8,Xe),v(`animate`,{attributeName:`opacity`,dur:e.pulseDur,repeatCount:e.pulseRepeatCount,fill:e.pulseFillMode,values:s(n),keyTimes:`0;0.1;0.9;1`},null,8,Qe)],8,Ye)):g(``,!0)],64))),256)),(b(),_(`circle`,{key:`sparkline_halo_${e.pulsePathId}`,r:Math.max(e.pulse.radius*1.3),fill:e.pulse.color,opacity:`0`},[v(`animateMotion`,{begin:e.pulseBegin,dur:e.pulseDur,repeatCount:e.pulseRepeatCount,calcMode:e.pulseMotion.calcMode,keySplines:e.pulseMotion.keySplines||void 0,keyTimes:e.pulseMotion.keyTimes||void 0,keyPoints:e.pulseKeyPoints,rotate:`auto`},[v(`mpath`,{href:`#${e.pulsePathId}`},null,8,T)],8,et),v(`animate`,{attributeName:`opacity`,values:`0;0.35;0.35;0`,keyTimes:`0;0.15;0.85;1`,dur:e.pulseDur,repeatCount:e.pulseRepeatCount},null,8,tt)],8,$e))])):g(``,!0)}},E={canvas:null,ctx:null};function rt(){if(typeof document>`u`)throw Error(`color-utils: document is not available (browser-only).`);if(!E.canvas){let e=document.createElement(`canvas`);e.width=1,e.height=1;let t=e.getContext(`2d`,{willReadFrequently:!0});if(!t)throw Error(`color-utils: unable to get 2D canvas context.`);E.canvas=e,E.ctx=t}return E.ctx}function it(e){return e<0?0:e>255?255:Math.round(e)}function at(e){return e<0?0:e>1?1:e}function D(e,t=null){if(typeof e!=`string`||e.trim().length===0)throw Error(`colorToRgba: inputColor must be a non-empty string.`);let n=e.trim();if(n.toLowerCase()===`transparent`)return{red:0,green:0,blue:0,alpha:0};let r=k(n,t),i=rt();i.clearRect(0,0,1,1),i.fillStyle=`#000`;let a=i.fillStyle;if(i.fillStyle=r,i.fillStyle===a&&!ot(r))throw Error(`colorToRgba: unsupported or invalid color "${e}".`);i.fillRect(0,0,1,1);let o=i.getImageData(0,0,1,1).data;return{red:o[0],green:o[1],blue:o[2],alpha:o[3]/255}}function O(e,t=null){if(!Array.isArray(e)||e.length===0)throw Error(`colorsToRgba: colors must be a non-empty array.`);let n=Array(e.length);for(let r=0;r<e.length;r+=1)n[r]=D(e[r],t);return n}function k(e,t=null){return e!==`currentColor`||typeof window>`u`||!t?e:window.getComputedStyle(t).color||e}function ot(e){let t=e.trim().toLowerCase();return t===`black`||t===`#000`||t===`#000000`||t===`rgb(0, 0, 0)`||t===`rgba(0, 0, 0, 1)`||t===`rgba(0, 0, 0, 0)`}function A(e){let t=at(e/255);return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function j(e){let t=at(e),n;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,it(n*255)}function st(e,t,n,r){let i=at(n);if(r===`linearRGB`){let n=A(e.red),r=A(e.green),a=A(e.blue),o=A(t.red),s=A(t.green),c=A(t.blue),l=n+(o-n)*i,u=r+(s-r)*i,d=a+(c-a)*i;return{red:j(l),green:j(u),blue:j(d),alpha:e.alpha+(t.alpha-e.alpha)*i}}return{red:e.red+(t.red-e.red)*i,green:e.green+(t.green-e.green)*i,blue:e.blue+(t.blue-e.blue)*i,alpha:e.alpha+(t.alpha-e.alpha)*i}}function M(e,t,n){let r=e;return r<t&&(r=t),r>n&&(r=n),r}function N(e,t){let n=10**t;return Math.round(e*n)/n}function P(e){return Number.isFinite(e)?e.toString():`0`}function F(e){let t=M(e,0,255).toString(16);return t.length===1?`0`+t:t}function I(e){if(typeof e!=`string`)return;let t=Number.parseFloat(e);return Number.isFinite(t)?t:void 0}function ct(e,t,n,r=!0){let i=n-t;if(i===0)return 0;let a=(e-t)/i;return r?M(a,0,1):a}var lt=`http://www.w3.org/2000/svg`;function L(e){if(typeof document>`u`)throw Error(`SvgPathGradientAsync: document is not available (browser-only implementation).`);let t=document.createElementNS(lt,`svg`);t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.setAttribute(`viewBox`,`0 0 0 0`),t.style.position=`absolute`,t.style.left=`-10000px`,t.style.top=`-10000px`,t.style.visibility=`hidden`,t.style.pointerEvents=`none`;let n=document.createElementNS(lt,`path`);return e===`M `&&(e=`M 0,0`),n.setAttribute(`d`,e),t.appendChild(n),document.body.appendChild(t),{svgElement:t,pathElement:n}}function R(e){if(e)try{e.svgElement?.remove?.()}catch{}}function ut(e,t,n){if(typeof n==`number`&&n>0)return n;let r=t*.75;r<.5&&(r=.5),r>8&&(r=8);let i=e/2;return r>i&&i>0&&(r=i),r<=0&&(r=1),r}function z(e,t,n){if(typeof t==`number`&&t>=1)return Math.floor(t);let r=Math.ceil(e/(typeof n==`number`&&n>0?n:2));return r<1?1:r}function dt(e,t,n,r,i,a){let o=n-t,s=Math.ceil(o/r)+1;s<2&&(s=2),s>a&&(s=a);let c=s>1?o/(s-1):0,l=e.getPointAtLength(t),u=`M ${P(N(l.x,i))} ${P(N(l.y,i))}`;for(let n=1;n<s;n+=1){let r=t+n*c,a=e.getPointAtLength(r);u+=` L ${P(N(a.x,i))} ${P(N(a.y,i))}`}return u}function B(e,t,n,r,i,a){let o=n-t,s=Math.ceil(o/r)+1;s<2&&(s=2),s>a&&(s=a);let c=s>1?o/(s-1):0,l=e.getPointAtLength(t),u=l.x,d=l.x,f=l.y,p=l.y,ee=`M ${P(N(l.x,i))} ${P(N(l.y,i))}`;for(let n=1;n<s;n+=1){let r=t+n*c,a=e.getPointAtLength(r);a.x<u&&(u=a.x),a.x>d&&(d=a.x),a.y<f&&(f=a.y),a.y>p&&(p=a.y),ee+=` L ${P(N(a.x,i))} ${P(N(a.y,i))}`}return{pathData:ee,bounds:{minX:u,maxX:d,minY:f,maxY:p}}}function ft(e){if(e.length===1)return[{position:0,rgba:e[0]}];let t=Array(e.length),n=e.length-1;for(let r=0;r<e.length;r+=1)t[r]={position:r/n,rgba:e[r]};return t}function pt(e,t,n,r){let i=M(t,0,1),a=r;for(a<0&&(a=0),a>e.length-2&&(a=e.length-2);a>0&&i<e[a].position;)--a;for(;a<e.length-2&&i>e[a+1].position;)a+=1;let o=e[a],s=e[a+1],c=s.position-o.position,l=c>0?(i-o.position)/c:0;return _t(mt(o.rgba,s.rgba,l,n))}function mt(e,t,n,r){let i=M(n,0,1);if(r===`linearRGB`){let n=ht(e.red),r=ht(e.green),a=ht(e.blue),o=ht(t.red),s=ht(t.green),c=ht(t.blue),l=n+(o-n)*i,u=r+(s-r)*i,d=a+(c-a)*i;return{red:gt(l),green:gt(u),blue:gt(d),alpha:e.alpha+(t.alpha-e.alpha)*i}}return{red:e.red+(t.red-e.red)*i,green:e.green+(t.green-e.green)*i,blue:e.blue+(t.blue-e.blue)*i,alpha:e.alpha+(t.alpha-e.alpha)*i}}function ht(e){let t=M(e/255,0,1);return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function gt(e){let t=M(e,0,1),n;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,M(Math.round(n*255),0,255)}function _t(e){let t=M(e.alpha,0,1),n=M(Math.round(e.red),0,255),r=M(Math.round(e.green),0,255),i=M(Math.round(e.blue),0,255);return t>=1?`#${F(n)}${F(r)}${F(i)}`:`rgba(${n}, ${r}, ${i}, ${N(t,4).toString()})`}function vt(e){let t=`fill="${V(e.fill??`none`)}"`,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(i===`stroke`||i===`d`)continue;let a=e[i];t+=` ${i}="${V(a)}"`}return t}function yt(e,t,n){return`<path d="${V(e)}" stroke="${V(t)}" ${n} />`}function bt(e){let t=[],n=e.segmentAttributeMap.fill??`none`;t.push(`fill="${V(n)}"`),t.push(`stroke="${V(e.stroke)}"`);for(let n of Object.keys(e.segmentAttributeMap)){if(n===`stroke`||n===`d`)continue;let r=e.segmentAttributeMap[n];t.push(`${n}="${V(r)}"`)}return`<path d="${V(e.pathData)}" ${t.join(` `)} />`}function xt(e,t){let n=[];for(let e of Object.keys(t))n.push(`${e}="${V(t[e])}"`);return`<g data-svg-path-gradient="true"${n.length?` `+n.join(` `):``}>${e.join(``)}</g>`}function V(e){return String(e).replaceAll(`&`,`&`).replaceAll(`"`,`"`).replaceAll(`<`,`<`).replaceAll(`>`,`>`)}function St(e,t=null,n={}){return new Promise((r,i)=>{let a=null;try{if(!e||typeof e!=`string`)throw Error(`SvgPathGradientAsync: pathData must be a non-empty string.`);let i=n.temperatureMode??null;if(i===null&&(!Array.isArray(t)||t.length===0))throw Error(`SvgPathGradientAsync: colors must be a non-empty array when temperatureMode is not enabled.`);if((n.returnMode??`string`)!==`string`)throw Error(`SvgPathGradientAsync: only returnMode="string" is supported for the async version.`);let o=typeof n.decimalPlaces==`number`?n.decimalPlaces:3,s=typeof n.flattenTolerance==`number`&&n.flattenTolerance>0?n.flattenTolerance:.25,c=n.attrs?{...n.attrs}:{},l=n.groupAttrs?{...n.groupAttrs}:{},u=I(c[`stroke-width`]),d=typeof n.strokeWidth==`number`&&n.strokeWidth>0?n.strokeWidth:typeof u==`number`&&u>0?u:1;a=L(e);let f=a.pathElement,p=f.getTotalLength(),ee=i===null?O(t,n.colorReferenceElement):[];if(i===null&&(!(p>0)||ee.length===1)){let t=xt([bt({pathData:e,stroke:_t(ee[0]),segmentAttributeMap:c})],l);R(a),r(t);return}let te=n.colorSpace??`linearRGB`;if(i!==null){let e=n.temperatureColors;if(!Array.isArray(e)||e.length!==2)throw Error(`SvgPathGradientAsync: temperatureColors must be a tuple of exactly 2 colors when temperatureMode is enabled.`)}let ne=i===null?null:O(n.temperatureColors,n.colorReferenceElement),re=i===null?(()=>{let e=ft(ee),t=Array(e.length);for(let n=0;n<e.length;n+=1)t[n]={position:e[n].position,rgba:e[n].rgba};return t})():[],ie=ut(p,d,n.maxSegmentLength),ae=z(p,n.segments,ie),oe=p/ae,se=typeof n.overlap==`number`&&n.overlap>=0?n.overlap:d*.5,ce=oe*.45;se>ce&&(se=ce);let le=typeof n.samplePointLimitPerSegment==`number`&&n.samplePointLimitPerSegment>10?n.samplePointLimitPerSegment:250,ue=vt(c),de=[],fe=i===null?null:[],pe=i===null?null:[],me=0,he=i===null?re.length-2:0,ge=0,_e=()=>{let e=performance.now(),t=typeof n.frameBudgetMs==`number`?n.frameBudgetMs:8;for(;ge<ae&&performance.now()-e<t;){let e=ge*oe,t=(ge+1)*oe,n=e,r=t;if(ge!==0&&(n=e-se),ge!==ae-1&&(r=t+se),n=M(n,0,p),r=M(r,0,p),r>n){if(i!==null){let e=B(f,n,r,s,o,le);fe.push(e.pathData),pe.push(e.bounds)}else{let e=(n+r)*.5/p;for(;me<he&&e>re[me+1].position;)me+=1;let t=pt(re,e,te,me),i=dt(f,n,r,s,o,le);de.push(yt(i,t,ue))}}ge+=1}if(ge<ae){requestAnimationFrame(_e);return}if(i!==null){let e=1/0,t=-1/0;for(let n=0;n<pe.length;n+=1){let r=pe[n],a=i===`vertical`?r.minY:r.minX,o=i===`vertical`?r.maxY:r.maxX;a<e&&(e=a),o>t&&(t=o)}let n=ne[0],r=ne[1];de.length=0;for(let a=0;a<pe.length;a+=1){let o=pe[a],s=ct(((i===`vertical`?o.minY:o.minX)+(i===`vertical`?o.maxY:o.maxX))*.5,e,t,!0),c=_t(i===`vertical`?st(n,r,s,te):st(r,n,s,te)),l=fe[a];de.push(yt(l,c,ue))}}let c=xt(de,l);R(a),r(c)};requestAnimationFrame(_e)}catch(e){R(a),i(e)}})}var H=[`innerHTML`],Ct={__name:`SparklineGradientPath`,props:{svgPathData:{type:String,required:!0},enabled:{type:Boolean,required:!0},strokeWidth:{type:Number,required:!0},highColor:{type:String,required:!0},lowColor:{type:String,required:!0},segments:{type:Number,required:!0}},setup(e){let t=e,n=x(``),r=0;return w(()=>[t.enabled,t.svgPathData,t.strokeWidth,t.highColor,t.lowColor,t.segments],async([e])=>{let i=++r;if(!e){n.value=``;return}let a=await St(t.svgPathData,null,{segments:t.segments,temperatureMode:`vertical`,temperatureColors:[t.highColor,t.lowColor],attrs:{"stroke-width":t.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},groupAttrs:{class:`vue-ui-sparkline-gradient`}});i===r&&(n.value=a)},{immediate:!0}),(e,t)=>(b(),_(`g`,{innerHTML:n.value},null,8,H))}},wt=/* @__PURE__ */ e({default:()=>U}),Tt=[`id`],Et=[`id`],Dt={style:{position:`relative`}},Ot=[`xmlns`,`viewBox`,`aria-describedby`],kt=[`width`,`height`],At=[`id`],jt=[`id`,`y1`,`y2`],Mt=[`stop-color`,`offset`],Nt=[`id`],Pt=[`x`,`y`,`width`,`height`],Ft=[`clip-path`],It={key:0},Lt=[`data-cy`,`d`,`fill`],Rt=[`id`,`d`,`stroke-width`],zt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],Bt=[`d`,`stroke`,`stroke-width`],Vt=[`id`,`d`,`stroke-width`],Ht=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],Ut=[`d`,`stroke`,`stroke-width`],Wt=[`x`,`y`,`width`,`height`,`fill`,`rx`],Gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Kt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],qt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Jt=[`x`,`y`,`font-size`,`font-weight`,`fill`],Yt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Xt=[`x`,`y`,`height`,`width`,`onMouseenter`,`onMouseleave`,`onClick`],Zt=[`title`,`aria-label`],Qt={viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`,focusable:`false`},$t=[`stroke`],en={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},tn=280,U=/*#__PURE__*/ je({__name:`vue-ui-sparkline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30},zoomState:{type:Object,default:null}},emits:[`hoverIndex`,`selectDatapoint`,`zoom`,`zoomReset`,`update:zoomState`],setup(e,{expose:je,emit:Je}){let Ye=Fe(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Xe=Fe(()=>import(`./SparkTooltip-Ch06CV71.js`)),{vue_ui_sparkline:Ze}=ye(),{isThemeValid:Qe,warnInvalidTheme:$e}=we(),et=De(),T=e,tt=h(()=>Array.isArray(T.dataset)&&T.dataset.length>0),E=x(ne()),rt=x(null),it=x(null),at=x(null),D=x(null),O=x(null),k=x(void 0),ot=x(void 0),A=x(dt()),j=h(()=>A.value.style.tooltip),st=h(()=>A.value.style.bar),M=h(()=>A.value.style.line),N=h(()=>A.value.style.area),P=h(()=>A.value.style.dataLabel),F=h(()=>A.value.style),I=h(()=>A.value.style.zoom);_e({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiSparkline`,rules:[ve.emptyArray,{test:e=>e.length>500,message:[`👀 The dataset has > 500 datapoints. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values`]},{test:e=>e.length>1095,message:[`👀 The dataset has > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});function ct(e){return T.config?.skeletonDataset&&Array.isArray(T.config.skeletonDataset)?T.config.skeletonDataset.map(e=>({period:`-`,value:e})):ue(e).map(e=>({period:`-`,value:e}))}let lt=h(()=>ce({defaultConfig:{gradientPath:{show:!1},temperatureColors:{show:!1},style:{backgroundColor:`#99999930`,scaleMin:0,scaleMax:null,animation:{show:!1},line:{color:`#AAAAAA`,pulse:{show:!1},dashIndices:[]},bar:{color:`#AAAAAA`},area:{color:`#CACACA`},zeroLine:{color:`#6A6A6A`},dataLabel:{show:!1},tooltip:{show:!1}}},userConfig:A.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:R,manualLoading:ut}=be({...Ge(T),FINAL_CONFIG:A,prepareConfig:dt,callback:()=>{Promise.resolve().then(async()=>{await y(),En()})},skeletonDataset:ct(12),skeletonConfig:ce({defaultConfig:A.value,userConfig:lt.value})}),{svgRef:z}=Ee({config:F.value.title});function dt(){let e=Se({userConfig:T.config,defaultConfig:Ze}),t={},n=e.theme;if(n){if(!Qe.value(e))$e(e),t=e;else{let r=Se({userConfig:Oe[n]||T.config,defaultConfig:e});t={...Se({userConfig:T.config,defaultConfig:r})}}}else t=e;return t}let B=h(()=>A.value?.style?.line.pulse||{}),ft=h(()=>`${Math.max(200,Number(B.value.durationMs)||4e3)/1e3}s`),pt=x(0),mt=h(()=>B.value?.begin||`0ms`),ht=x(`0;1`),gt=h(()=>B.value?.loop===!1?`1`:`indefinite`),_t=h(()=>B.value?.loop===!1?`freeze`:void 0),vt=h(()=>B.value.trail.show&&V.value.lengthPx||1),yt=h(()=>!!B.value?.show&&!Z.value&&!et.value&&!L.value&&(X.value?.length||0)>1);function bt(){if(!yt.value){pt.value=0;return}let e=z.value;if(!e)return;let t=`#${On.value}`,n=e.querySelector?.(t);if(n&&typeof n.getTotalLength==`function`){let e=n.getTotalLength();Number.isFinite(e)&&e>0&&(pt.value=e)}else requestAnimationFrame(()=>{let n=e.querySelector?.(t);if(n&&typeof n.getTotalLength==`function`){let e=n.getTotalLength();Number.isFinite(e)&&e>0&&(pt.value=e)}})}let xt=h(()=>{let e=B.value?.easing||`ease-in-out`,t={ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};return e===`linear`?{calcMode:`linear`,keySplines:null,keyTimes:`0;1`}:e===`steps`?{calcMode:`discrete`,keySplines:null,keyTimes:`0;1`}:{calcMode:`spline`,keySplines:(e===`cubic-bezier`?Array.isArray(B.value?.cubicBezier)&&B.value.cubicBezier.length===4?B.value.cubicBezier:[.4,0,.2,1]:t[e]||t[`ease-in-out`]).join(` `),keyTimes:`0;1`}}),V=h(()=>{let e=B.value?.trail||{},t=M.value.strokeWidth||1;return{show:e.show!==!1,lengthPx:e.length,width:Math.max(1,Number(e.strokeWidth)||t*2.2),opacity:Math.min(1,Math.max(0,Number(e.opacity)??.6)),fadeIn:.5,fadeOut:.2}}),St=x({start:0,end:null}),H=x(!1),wt=x(!1),U=x(!1),nn=x(`matrix(1, 0, 0, 1, 0, 0)`),rn=x(!1),an=0,on=0,sn=0,cn=0,ln=x(null),W=x(null),un=x(!1),dn=x({time:0,x:0,y:0,pointerType:null}),G=h(()=>{let e=R.value.length;if(!e)return{start:0,end:-1};let t=Math.min(Math.max(0,St.value.start||0),e-1);return{start:t,end:Math.min(Math.max(t,St.value.end==null?e-1:St.value.end),e-1)}}),fn=h(()=>{let e=R.value.length;return e?G.value.start>0||G.value.end<e-1:!1}),pn=h(()=>{let{start:e,end:t}=G.value;return t<e?[]:R.value.slice(e,t+1).map((t,n)=>({...t,__sourceIndex:e+n}))}),mn=h(()=>u({data:pn.value,threshold:A.value.downsample.threshold}));h(()=>{if(!A.value.temperatureColors.show)return!1;let e=pn.value.map(({value:e})=>e).filter(e=>Number.isFinite(e));return new Set(e).size<=1}),w(()=>T.config,e=>{L.value||(A.value=dt()),Mn(),q.value.chartWidth=F.value.chartWidth},{deep:!0}),w(()=>T.dataset,e=>{Array.isArray(e)&&e.length>0&&(ut.value=!1),Xn(),Wn(),dn.value={time:0,x:0,y:0,pointerType:null},St.value={start:0,end:null},Yn(),K.value=u({data:pn.value.map(e=>({...e,value:[void 0].includes(e.value)?null:e.value})),threshold:A.value.downsample.threshold});let t=Nn();J(`update:zoomState`,t),J(`zoomReset`,t)},{deep:!0});let K=x(hn());function hn(){return u({data:pn.value.map(e=>F.value.animation.show&&R.value.length>1?{...e,value:null}:{...e,value:[void 0].includes(e.value)?null:e.value}),threshold:A.value.downsample.threshold})}let gn=Ue(null),_n=Ue(null),vn=x(!1),yn=x(0),bn=x([]),xn=x(``),Sn=!1,Cn=h(()=>{let e=(mn.value||[]).map(e=>`${e.period}::${Number.isFinite(e.value)?e.value:0}`).join(`|`),t=A.value?.style?.animation||{},n=!!A.value?.gradientPath?.show&&!A.value.temperatureColors.show;return`${e}#${!!t.show}#${t.animationFrames||0}#${n}`});function wn(){Sn=!0,Tn()}function Tn(){yn.value&&=(cancelAnimationFrame(yn.value),0),bn.value.forEach(e=>clearTimeout(e)),bn.value=[],vn.value=!1}function En(){let e=A.value?.style?.animation||{},t=mn.value||[],n=Cn.value,r=!!A.value.gradientPath.show&&!A.value.temperatureColors.show;if(n&&n===xn.value&&(vn.value||K.value.length===t.length))return;if(Tn(),r||!e.show||L.value||t.length<=1||et.value){K.value=t,xn.value=n;return}vn.value=!0,xn.value=n,K.value=[];let i=Math.max(1,Number(e.animationFrames)||1),a=Math.max(1,Math.floor(i/t.length)),o=0,s=()=>{if(n!==Cn.value)Tn();else if(o<t.length){K.value.push(t[o]);let e=setTimeout(()=>{yn.value=requestAnimationFrame(s)},a);bn.value.push(e),o+=1}else K.value=t,Tn()};yn.value=requestAnimationFrame(s)}w(Cn,()=>{Sn?(Sn=!1,Tn(),K.value=mn.value||[],xn.value=Cn.value):En()}),Ve(()=>{Mn(),En()}),Be(()=>{Tn(),Wn()});let Dn=x(0);w(()=>L.value,async e=>{e||(await y(),Dn.value+=1)}),w(()=>vn.value,async e=>{e||L.value||(await y(),Dn.value+=1)});let On=h(()=>`sparkline_line_path_${E.value}`),kn=x(!0);async function An(){kn.value=!1,await y(),kn.value=!0,await y(),bt()}let jn=h(()=>A.value.debug);function Mn(){if(he(T.dataset)?(ie({componentName:`VueUiSparkline`,type:`dataset`,debug:jn.value}),ut.value=!0):jn.value&&T.dataset.forEach((e,t)=>{me({datasetObject:e,requiredAttributes:[`period`,`value`]}).forEach(e=>{ie({componentName:`VueUiSparkline`,type:`datasetSerieAttribute`,property:e,index:t})})}),he(T.dataset)||(ut.value=A.value.loading),A.value.responsive){let e=ge(()=>{let{width:e,height:t}=Ce({chart:rt.value,title:F.value.title.show&&T.showInfo?it.value:null,source:at.value});requestAnimationFrame(()=>{q.value.width=e,q.value.height=t,q.value.chartWidth=F.value.chartWidth/500*e,q.value.padding=T.forcedPadding/500*e})});gn.value&&(_n.value&&gn.value.unobserve(_n.value),gn.value.disconnect()),gn.value=new ResizeObserver(e),_n.value=rt.value.parentNode,gn.value.observe(_n.value)}}Be(()=>{gn.value&&(_n.value&&gn.value.unobserve(_n.value),gn.value.disconnect())});let q=x({height:80*T.heightRatio,width:500,chartWidth:F.value.chartWidth,padding:T.forcedPadding}),J=Je;function Nn(){if(!R.value.length)return{start:0,end:0};let{start:e,end:t}=G.value;return{start:e,end:t+1}}function Pn(e,t=Nn()){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function Fn(e){let t=Pn(e);if(!t)return null;let n=R.value.length;if(!n)return{start:0,end:0};let r=Math.max(0,Math.min(Math.trunc(t.start),n-1));return{start:r,end:Math.max(r+1,Math.min(Math.trunc(t.end),n))}}function In(e,{skipAnimation:t=!0,transition:n=!1}={}){let r=Fn(e);if(!r)return null;let i=Nn();if(r.start!==i.start||r.end!==i.end){Xn(),dn.value={time:0,x:0,y:0,pointerType:null};let e={start:r.start,end:r.end>r.start?r.end-1:r.start};n?Gn(e):(t&&wn(),St.value=e),Yn()}return Nn()}function Ln(e){let t=In(e,{transition:!0});t&&J(`update:zoomState`,t)}w([()=>T.zoomState,()=>R.value.length],([e,t])=>{!e||t<=0||In(e,{transition:!0})},{deep:!0,immediate:!0});let Y=h(()=>{let{top:e,right:t,bottom:n,left:r}=F.value.padding;return{top:e,left:r,right:q.value.width-t,bottom:q.value.height-n,start:T.showInfo&&P.value.show&&P.value.position===`left`?q.value.width-q.value.chartWidth+r:q.value.padding+r,width:T.showInfo&&P.value.show?q.value.chartWidth-r-t:q.value.width-q.value.padding-r-t,height:q.value.height-e-n}});function Rn(e){let t=R.value.length;if(!t)return{start:0,end:-1};let n=Math.max(0,Math.min(Math.trunc(Number(e?.start)||0),t-1)),r=e?.end===null||e?.end===void 0?t-1:Math.trunc(Number(e.end));return{start:n,end:Math.max(n,Math.min(Number.isFinite(r)?r:n,t-1))}}function zn(e){let t=(e||[]).map(e=>{let t=e?.value;return isNaN(t)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(t)?0:t||0}),n=F.value.scaleMin,r=F.value.scaleMax,i=[null,void 0].includes(n)?t.length?Math.min(...t):0:n,a=[null,void 0].includes(r)?t.length?Math.max(...t):0:r,o=Math.abs(i>=0?0:i),s=a+o;return{absoluteMin:Number.isFinite(o)?o:0,absoluteMax:Number.isFinite(s)?s:0}}function Bn(e,t){let n=t.absoluteMax===0?0:(e+t.absoluteMin)/t.absoluteMax;return Y.value.bottom-Y.value.height*n}function Vn(e,t,n,r){let i=Math.max(1,e.end-e.start),a=Math.max(1,t.end-t.start),o=Y.value.start,s=Y.value.width,c=i/a,l=o+s*(e.start-t.start)/a-c*o,u=Bn(0,n),d=Bn(0,r),f=1;n.absoluteMax>0&&r.absoluteMax>0&&(f=n.absoluteMax/r.absoluteMax);let p=d-f*u;return`matrix(${c}, 0, 0, ${f}, ${l}, ${p})`}function Hn(e){if(!U.value||!e)return;let t=nn.value.match(/^matrix\(([-+\d.eE]+),\s*[-+\d.eE]+,\s*[-+\d.eE]+,\s*([-+\d.eE]+),\s*([-+\d.eE]+),\s*([-+\d.eE]+)\)$/);if(!t)return;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=Number(t[4]);if([n,r,i,a].every(Number.isFinite))return{transform:`matrix(1, 0, 0, 1, ${(n-1)*e.x+i}, ${(r-1)*e.y+a})`,transformOrigin:`0 0`,transformBox:`view-box`,transition:rn.value?`transform ${tn}ms cubic-bezier(0.4, 0, 0.2, 1)`:`none`,willChange:`transform`}}function Un(e){if(!U.value||!e)return;let t=nn.value.match(/^matrix\(([-+\d.eE]+),\s*[-+\d.eE]+,\s*[-+\d.eE]+,\s*[-+\d.eE]+,\s*([-+\d.eE]+),\s*[-+\d.eE]+\)$/);if(!t)return;let n=Number(t[1]),r=Number(t[2]);if([n,r].every(Number.isFinite))return{transform:`matrix(1, 0, 0, 1, ${(n-1)*e.x+r}, 0)`,transformOrigin:`0 0`,transformBox:`view-box`,transition:rn.value?`transform ${tn}ms cubic-bezier(0.4, 0, 0.2, 1)`:`none`,willChange:`transform`}}function Wn({resetTransform:e=!0}={}){cn+=1,an&&=(cancelAnimationFrame(an),0),on&&=(cancelAnimationFrame(on),0),sn&&=(clearTimeout(sn),0),rn.value=!1,U.value=!1,e&&(nn.value=`matrix(1, 0, 0, 1, 0, 0)`)}async function Gn(e){let t=Rn(e),n={...G.value};if(t.start===n.start&&t.end===n.end)return;Wn();let r=vn.value;r&&(Tn(),K.value=mn.value||[]);let i=zn(K.value);wn(),St.value={start:t.start,end:t.end};let a=mn.value||[];if(r||!z.value||L.value||et.value||n.end<n.start||t.end<t.start||a.length<=1){K.value=a,xn.value=Cn.value,nn.value=`matrix(1, 0, 0, 1, 0, 0)`;return}let o=Vn(t,n,zn(a),i),s=++cn;U.value=!0,rn.value=!1,nn.value=o,K.value=a,xn.value=Cn.value,await y(),s===cn&&(an=requestAnimationFrame(()=>{an=0,on=requestAnimationFrame(()=>{on=0,s===cn&&(rn.value=!0,nn.value=`matrix(1, 0, 0, 1, 0, 0)`,sn=setTimeout(async()=>{sn=0,s===cn&&(rn.value=!1,U.value=!1,await An())},tn))})}))}let Kn=h(()=>!H.value||ln.value==null||W.value==null?null:{x:Math.min(ln.value,W.value),width:Math.abs(W.value-ln.value),y:0,height:q.value.height});function qn(e){let t=z.value;if(!t)return null;let n=t.getScreenCTM?.();if(n&&typeof t.createSVGPoint==`function`){let r=t.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r.matrixTransform(n.inverse()).x}let r=t.getBoundingClientRect?.();return r?.width?(e.clientX-r.left)/r.width*q.value.width:null}function Jn(e){return Math.min(Math.max(e,Y.value.start),Y.value.start+Y.value.width)}function Yn(){ot.value=k.value,k.value=void 0,O.value=null,D.value=null,J(`hoverIndex`,{index:void 0})}function Xn(e){e?.pointerId!=null&&z.value?.hasPointerCapture?.(e.pointerId)&&z.value.releasePointerCapture(e.pointerId),H.value=!1,ln.value=null,W.value=null}function Zn(e){(fn.value||H.value)&&(Xn(e),dn.value={time:0,x:0,y:0,pointerType:null},Gn({start:0,end:Math.max(0,R.value.length-1)}),Yn(),J(`update:zoomState`,Nn()),J(`zoomReset`))}function Qn(e){(e.button===void 0||e.button===0)&&(e.preventDefault(),e.stopPropagation(),Zn())}function $n(e){e.detail===0&&Zn()}function er(e){if(!I.value.show)return;if(!fn.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=dn.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?(un.value=!0,Zn(e),setTimeout(()=>{un.value=!1},0),!0):(dn.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function tr(e=z.value){wt.value=!0,e?.classList?.add(`vue-ui-sparkline-pointer-focus`)}function nr(){wt.value=!1,z.value?.classList?.remove(`vue-ui-sparkline-pointer-focus`)}function rr(e){if(e.button!==void 0&&e.button!==0||(tr(e.currentTarget),!I.value.show)||L.value||pn.value.length<2)return;let t=qn(e);if(t==null)return;let n=Y.value.start,r=n+Y.value.width;t<n||t>r||(z.value?.focus?.({preventScroll:!0}),H.value=!0,ln.value=Jn(t),W.value=Jn(t))}function ir(e){if(!I.value.show||!H.value)return;let t=qn(e);t!=null&&(W.value=Jn(t),ln.value!=null&&Math.abs(W.value-ln.value)>=2&&!z.value?.hasPointerCapture?.(e.pointerId)&&z.value?.setPointerCapture?.(e.pointerId))}function ar(e){if(!I.value.show||!H.value)return;let t=qn(e);t!=null&&(W.value=Jn(t));let n=ln.value,r=W.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,Y.value.width*.01)){if(er(e))return;Xn(e);return}let i=Math.min(n,r),a=Math.max(n,r),o=Math.max(1,Y.value.width),s=pn.value.length,c=(i-Y.value.start)/o,l=(a-Y.value.start)/o,u=Math.max(0,Math.min(s-1,Math.floor(c*(s-1)))),d=Math.max(u,Math.min(s-1,Math.ceil(l*(s-1))));if(d<=u){Xn(e);return}let f=G.value.start+u,p=G.value.start+d;Gn({start:f,end:p}),dn.value={time:0,x:0,y:0,pointerType:null},Yn(),J(`zoom`,{start:f,end:p}),J(`update:zoomState`,{start:f,end:p+1}),un.value=!0,setTimeout(()=>{un.value=!1},0),Xn(e)}let or=h(()=>[null,void 0].includes(F.value.scaleMin)?Math.min(...K.value.map(e=>isNaN(e.value)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(e.value)?0:e.value||0)):F.value.scaleMin),sr=h(()=>[null,void 0].includes(F.value.scaleMax)?Math.max(...K.value.map(e=>isNaN(e.value)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(e.value)?0:e.value||0)):F.value.scaleMax),cr=h(()=>{let e=or.value>=0?0:or.value;return Math.abs(e)}),lr=h(()=>sr.value+cr.value),ur=h(()=>Y.value.bottom-Y.value.height*dr(cr.value));function dr(e){return isNaN(e/lr.value)?0:e/lr.value}let fr=h(()=>K.value.length-1||1),pr=x([]),mr=0;Ke(()=>{let e=++mr;(async()=>{let t=await Te({values:mn.value.map(e=>e.period),maxDatapoints:mn.value.length,formatter:P.value.datetimeFormatter,start:0,end:mn.value.length});e===mr&&(pr.value=t)})()});let X=h(()=>{let e=K.value.length,t=Y.value.width/fr.value,n=Math.max(0,Y.value.start),r=Math.min(q.value.width,Y.value.right,Y.value.start+Y.value.width),i=Math.max(0,r-n),a=e>0?i/e:0;return K.value.map((e,r)=>{let i=isNaN(e.value)||[void 0,`NaN`,NaN,1/0,-1/0].includes(e.value)?0:e.value,o=n+r*a,s=Z.value?a:t,c=Z.value?o+a/2:Y.value.start+r*t;return{value:e.value,absoluteValue:i,period:pr.value&&pr.value[r]&&pr.value[r].text?pr.value[r].text:e.period,plotValue:i+cr.value,toMax:dr(i+cr.value),sourceIndex:e.__sourceIndex??r,x:c,barX:o,y:Y.value.bottom-Y.value.height*dr(i+cr.value),id:`plot_${E.value}_${r}`,color:Z.value?st.value.color:N.value.useGradient?re(M.value.color,.05*(1-r/fr.value)):M.value.color,width:s}})}),hr=h(()=>{if(T.selectedIndex!==void 0&&T.selectedIndex!==null&&T.selectedIndex>=0&&T.selectedIndex<R.value.length){let e=X.value.findIndex(e=>e.sourceIndex===T.selectedIndex);return e>=0?e:null}return O.value!==void 0&&O.value!==null&&O.value>=0&&O.value<X.value.length?O.value:null});function gr(e,t){return Number.isFinite(e?.sourceIndex)?e.sourceIndex:t}function _r(e,t){let n=gr(e,t);A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:e,seriesIndex:n}),O.value=t,D.value=t,k.value=e,ot.value||=e,J(`hoverIndex`,{index:n})}function vr(e,t){let n=gr(e,t);A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:e,seriesIndex:n}),ot.value=k.value,k.value=void 0,O.value=null,D.value=null,J(`hoverIndex`,{index:void 0})}let yr=h(()=>{if(tt.value){let e=X.value.map(e=>e.absoluteValue),t=e.reduce((e,t)=>e+t,0);return{latest:X.value[X.value.length-1]?X.value[X.value.length-1].absoluteValue:0,sum:t,average:t/X.value.length,median:de(e),trend:ae(X.value.map(({x:e,y:t,absoluteValue:n})=>({x:e,y:t,value:n}))).trend}}return{latest:null,sum:null,average:null,median:null,trend:null}}),br=h(()=>tt.value?P.value.valueType===`latest`?yr.value.latest:P.value.valueType===`sum`?yr.value.sum:P.value.valueType===`average`?yr.value.average:0:0),Z=h(()=>A.value.type&&A.value.type===`bar`);function xr(e,t){if(un.value)return;let n=gr(e,t);A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:e,seriesIndex:n}),J(`selectDatapoint`,{datapoint:e,index:n})}let Q=h(()=>M.value.cutNullValues);function Sr(e){return![null,void 0,`NaN`,NaN,1/0,-1/0].includes(e)}function Cr(e,t){let n=e[t-1],r=e[t+1],i=!!n&&!!r&&n.value==null&&r.value==null||!n&&!!r&&r.value==null||!!n&&!r&&n.value==null;return Sr(e[t]?.value)&&i&&Q.value}function wr(e,t){return k.value&&e.id===k.value.id||hr.value===t||R.value.length===1}function Tr(e,t){return Z.value||!Sr(e?.value)?!1:F.value.plot.show&&wr(e,t)||Cr(X.value,t)}function Er(e,t){return Math.max(1,wr(e,t)?F.value.plot.radius:F.value.plot.radius*.7)}function Dr(e,t){return wr(e,t)?F.value.plot.stroke:F.value.backgroundColor}let Or=h(()=>Q.value?X.value:X.value.filter(e=>e.value!==null)),kr=h(()=>Array.isArray(M.value.dashIndices)?M.value.dashIndices.map(e=>Math.trunc(Number(e))).filter(Number.isFinite):[]),Ar=h(()=>new Set(kr.value));function jr(e,t){let n=e?.sourceIndex,r=t?.sourceIndex;if(!Number.isFinite(n)||!Number.isFinite(r))return!1;let i=Math.min(n,r),a=Math.max(n,r);for(let e of kr.value)if(e>=i&&e<=a)return!0;return!1}function Mr(e){let t=/* @__PURE__ */ new Set;for(let n=1;n<e.length;n+=1)jr(e[n-1],e[n])&&t.add(n-1);return t}function Nr(e){let t=/* @__PURE__ */ new Set;if(Q.value||!M.value.nullDashes?.show)return t;for(let n=1;n<e.length;n+=1){let r=e[n-1]?.sourceIndex,i=e[n]?.sourceIndex;Number.isFinite(r)&&Number.isFinite(i)&&Math.abs(i-r)>1&&t.add(n-1)}return t}let Pr=h(()=>Q.value?/* @__PURE__ */ new Set:Mr(Or.value)),Fr=h(()=>Nr(Or.value)),Ir=h(()=>/* @__PURE__ */ new Set([...Pr.value,...Fr.value])),Lr=h(()=>Q.value?X.value.reduce((e,t,n)=>(Ar.value.has(t.sourceIndex)&&e.push(n),e),[]):[]),Rr=h(()=>Q.value?Lr.value.length>0:Ir.value.size>0),zr=h(()=>X.value.filter(e=>e.value!==null)),Br=h(()=>zr.value.length>1),Vr=h(()=>Z.value||!Br.value?``:Q.value?a(X.value):d(Or.value)),Hr=h(()=>Z.value||!Br.value?``:Q.value?te(X.value):ee(Or.value)),Ur=h(()=>Z.value||!Rr.value||!Br.value?[]:Q.value?c(X.value,Lr.value):f(Or.value,Ir.value)),Wr=h(()=>Z.value||!Rr.value||!Br.value?[]:Q.value?i(X.value,Lr.value):s(Or.value,Ir.value)),Gr=h(()=>Z.value||!N.value.show||!Br.value?[]:M.value.smooth?l(Or.value,Y.value.bottom,Q.value).filter(Boolean):(Q.value?n(X.value,Y.value.bottom):le(Or.value,Y.value.bottom)).split(`;`).filter(Boolean).map(e=>`M${e}Z`)),Kr=h(()=>Z.value||!A.value.gradientPath.show||A.value.temperatureColors.show?``:`M ${(M.value.smooth?Vr.value:Hr.value)||`0,0`}`),qr=h(()=>{if(!A.value.temperatureColors.show)return null;let e=A.value.temperatureColors.colors;return!Array.isArray(e)||!e.length?null:e.map(e=>p(e))}),$=h(()=>{if(!A.value.temperatureColors.show)return null;let e=A.value.temperatureColors.colors;return!Array.isArray(e)||!e.length?null:e.map(e=>p(e))});function Jr(e){if(!Number.isFinite(e?.y))return 0;let t=Y.value.height||1,n=(e.y-Y.value.top)/t;return Math.min(1,Math.max(0,n))}function Yr(e){let t=qr.value;return!Array.isArray(t)||!t.length?e.color:r({colors:t,ratio:Jr(e)})}w(()=>[yt.value,On.value,X.value.length,q.value.width,q.value.height,A.value?.style?.line?.smooth],async()=>{await y(),bt()},{immediate:!0}),Ve(async()=>{await y(),bt()}),w(()=>L.value,async e=>{e||await An()}),w(()=>vn.value,async e=>{e||L.value||await An()}),w([()=>T.selectedIndex,()=>X.value],([e],[t])=>{if(e==null){if(t!=null){O.value=null,D.value=null,k.value=void 0;return}let e=k.value?.sourceIndex;if(e==null)return;let n=X.value.findIndex(t=>t.sourceIndex===e);if(n<0){O.value=null,D.value=null,k.value=void 0;return}O.value=n,D.value=n,k.value=X.value[n];return}if(e<0||e>=R.value.length)return;let n=X.value.findIndex(t=>t.sourceIndex===e);if(n<0){O.value=null,D.value=null,k.value=void 0;return}let r=X.value[n];r&&(O.value=n,D.value=n,k.value=r)});let Xr=x(!1);function Zr(){let e=hr.value;if(e!==null&&e>=0&&e<X.value.length){let t=X.value[e];if(t){D.value=e,k.value=t,O.value=e,Xr.value=!0;return}}D.value=null,!k.value&&X.value.length&&_r(X.value.at(-1),X.value.length-1),Xr.value=!0}function Qr(){nr(),ot.value=k.value,(T.selectedIndex===void 0||T.selectedIndex===null)&&(D.value=null,k.value=void 0,O.value=null,J(`hoverIndex`,{index:void 0})),Xr.value=!1}je({resetZoom:Zn,setZoomState:Ln});function $r(e){if(!z.value||document.activeElement!==z.value)return;if(nr(),ot.value=k.value,e.key===`Escape`){(fn.value||H.value)&&(e.preventDefault(),e.stopPropagation(),Zn());return}let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`;if(!t&&!n)return;let r=X.value.length;if(!r)return;e.preventDefault(),e.stopPropagation();let i=D.value,a=i!==null&&i>=0&&i<r,o=k.value?X.value.findIndex(e=>e.id===k.value.id):-1;a?n?(i+=1,i>=r&&(i=0)):t&&(--i,i<0&&(i=r-1)):o!==null&&o>=0&&o<r?(i=n?o+1:o-1,i>=r&&(i=0),i<0&&(i=r-1)):i=n?0:r-1;let s=X.value[i];s&&(D.value=i,_r(s,i))}let ei=h(()=>({headers:[A.value.translations.period,A.value.translations.value],rows:X.value.map(e=>[e.period,e.absoluteValue])}));return(n,r)=>(b(),_(`div`,{ref_key:`sparklineChart`,ref:rt,class:`vue-data-ui-component vue-ui-sparkline`,id:E.value,style:ze(`width:100%;font-family:${F.value.fontFamily};`)},[v(`p`,{id:`chart-instructions-${E.value}`,class:`sr-only`},We(A.value.a11y.translations.keyboardNavigation),9,Et),ei.value?.rows?.length?(b(),Me(ke,{key:0,uid:E.value,head:ei.value.headers,body:ei.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):g(``,!0),He(n.$slots,`before`,Re(Ie({selected:k.value,latest:yr.value.latest,sum:yr.value.sum,average:yr.value.average,median:yr.value.median,trend:yr.value.trend})),void 0,!0),F.value.title.show&&e.showInfo?(b(),_(`div`,{key:1,ref_key:`chartTitle`,ref:it,class:`vue-ui-sparkline-title`,style:ze(`display:flex;align-items:center;width:100%;color:${F.value.title.color};background:${F.value.backgroundColor};justify-content:${F.value.title.textAlign===`left`?`flex-start`:F.value.title.textAlign===`right`?`flex-end`:`center`};height:${F.value.title.fontSize*2}px;font-size:${F.value.title.fontSize}px;font-weight:${F.value.title.bold?`bold`:`normal`};`)},[v(`span`,{style:ze(`padding:${F.value.title.textAlign===`left`?`0 0 0 12px`:F.value.title.textAlign===`right`?`0 12px 0 0`:`0`}`)},We(k.value?k.value.period:F.value.title.text),5)],4)):g(``,!0),v(`div`,Dt,[(b(),_(`svg`,{ref_key:`svgRef`,ref:z,class:Le({"vue-ui-sparkline-pointer-focus":wt.value}),xmlns:C(pe),viewBox:`0 0 ${q.value.width} ${q.value.height}`,style:ze({background:F.value.backgroundColor,overflow:`visible`,direction:`ltr`,cursor:I.value.show?H.value?`col-resize`:`crosshair`:`default`,touchAction:`pan-y`,userSelect:`none`}),tabindex:`0`,"aria-describedby":`chart-instructions-${E.value}`,"aria-keyshortcuts":`Escape`,onMouseleave:r[0]||=e=>ot.value=void 0,onFocus:Zr,onBlur:Qr,onKeydown:$r,onPointerdown:rr,onPointermove:ir,onPointerup:ar,onPointercancel:Xn},[Pe(C(Ye)),He(n.$slots,`svg-underlayer`,{svg:{...q.value,drawingArea:Y.value,timeLabels:pr.value,series:X.value,hoveredIndex:D.value,isZoomed:fn.value,zoomRange:G.value}},void 0,!0),n.$slots[`chart-background`]?(b(),_(`foreignObject`,{key:0,x:0,y:0,width:q.value.width<=0?10:q.value.width,height:q.value.height<=0?10:q.value.height,style:{pointerEvents:`none`}},[He(n.$slots,`chart-background`,{},void 0,!0)],8,kt)):g(``,!0),v(`defs`,null,[Pe(Ae,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`sparkline_gradient_${E.value}`,stops:[[`0%`,C(o)(C(re)(N.value.color,.05),N.value.opacity),1],[`100%`,C(o)(N.value.color,N.value.opacity),1]]},null,8,[`id`,`stops`]),Pe(Ae,{t:`linear`,x2:`0%`,y2:`100%`,id:`sparkline_bar_gradient_pos_${E.value}`,stops:[[`0%`,st.value.color,1],[`100%`,C(re)(st.value.color,.05),1]]},null,8,[`id`,`stops`]),Pe(Ae,{t:`linear`,x2:`0%`,y2:`100%`,id:`sparkline_bar_gradient_neg_${E.value}`,stops:[[`0%`,C(re)(st.value.color,.05),1],[`100%`,st.value.color,1]]},null,8,[`id`,`stops`]),v(`filter`,{id:`sparkline_pulse_glow_${E.value}`,filterUnits:`userSpaceOnUse`,x:`-50`,y:`-50`,width:`100`,height:`100`},[...r[1]||=[v(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`3`,result:`blur`},null,-1),v(`feMerge`,null,[v(`feMergeNode`,{in:`blur`}),v(`feMergeNode`,{in:`SourceGraphic`})],-1)]],8,At),A.value.temperatureColors.show&&$.value?(b(),_(`linearGradient`,{key:0,id:`temperature_grad_sparkline_${E.value}`,gradientUnits:`userSpaceOnUse`,x1:`0`,x2:`0`,y1:Y.value.top,y2:Y.value.bottom},[(b(!0),_(m,null,S($.value,(e,t)=>(b(),_(`stop`,{key:`temperature_grad_stop_${t}_${E.value}`,"stop-color":e,offset:$.value.length===1?`0%`:C(fe)(t,$.value.length)},null,8,Mt))),128))],8,jt)):g(``,!0),v(`clipPath`,{id:`sparkline_zoom_clip_${E.value}`},[v(`rect`,{x:Y.value.start-4,y:Y.value.top-8,width:Y.value.width+8,height:Y.value.height+16},null,8,Pt)],8,Nt)]),v(`g`,{"clip-path":U.value?`url(#sparkline_zoom_clip_${E.value})`:void 0},[v(`g`,{style:ze({transform:nn.value,transformOrigin:`0 0`,transformBox:`view-box`,transition:rn.value?`transform ${tn}ms cubic-bezier(0.4, 0, 0.2, 1)`:`none`,willChange:U.value?`transform`:void 0})},[N.value.show&&!Z.value&&Gr.value.length?(b(),_(`g`,It,[(b(!0),_(m,null,S(Gr.value,(e,t)=>(b(),_(`path`,{key:`sparkline_area_${t}_${E.value}`,class:`vue-ui-sparkline-area`,"data-cy":M.value.smooth?`sparkline-smooth-area`:`sparkline-angle-area`,d:e,fill:N.value.useGradient?`url(#sparkline_gradient_${E.value})`:C(o)(N.value.color,N.value.opacity),"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,Lt))),128))])):g(``,!0),M.value.smooth&&!Z.value?(b(),_(m,{key:1},[v(`path`,{id:On.value,d:`M ${Vr.value||`0,0`}`,fill:`none`,stroke:`transparent`,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,Rt),Rr.value?(b(!0),_(m,{key:0},S(Ur.value,e=>(b(),_(`path`,{key:e.path,class:`vue-ui-sparkline-path`,d:`M ${e.path}`,stroke:$.value?`url(#temperature_grad_sparkline_${E.value})`:M.value.color,fill:`none`,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-dasharray":e.dashed?M.value.dashArray:0},null,8,zt))),128)):(b(),_(`path`,{key:1,class:`vue-ui-sparkline-path`,d:`M ${Vr.value||`0,0`}`,stroke:$.value?`url(#temperature_grad_sparkline_${E.value})`:M.value.color,fill:`none`,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,Bt))],64)):g(``,!0),!M.value.smooth&&!Z.value?(b(),_(m,{key:2},[v(`path`,{id:On.value,d:`M ${Hr.value||`0,0`}`,fill:`none`,stroke:`transparent`,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,Vt),Rr.value?(b(!0),_(m,{key:0},S(Wr.value,e=>(b(),_(`path`,{key:e.path,class:`vue-ui-sparkline-path`,d:`M ${e.path}`,stroke:$.value?`url(#temperature_grad_sparkline_${E.value})`:M.value.color,fill:`none`,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-dasharray":e.dashed?M.value.dashArray*2:0},null,8,Ht))),128)):(b(),_(`path`,{key:1,class:`vue-ui-sparkline-path`,d:`M ${Hr.value||`0,0`}`,stroke:$.value?`url(#temperature_grad_sparkline_${E.value})`:M.value.color,fill:`none`,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,Ut))],64)):g(``,!0),Kr.value&&!$.value?(b(),Me(Ct,{key:3,svgPathData:Kr.value,enabled:A.value.gradientPath.show&&!Z.value&&!$.value,strokeWidth:M.value.strokeWidth,highColor:A.value.gradientPath.colors.high,lowColor:A.value.gradientPath.colors.low,segments:A.value.gradientPath.segments},null,8,[`svgPathData`,`enabled`,`strokeWidth`,`highColor`,`lowColor`,`segments`])):g(``,!0),kn.value&&yt.value?(b(),Me(nt,{key:4,uid:E.value,svgRef:C(z),pulsePathId:On.value,pulsePathLength:pt.value,pulseDur:ft.value,pulseBegin:mt.value,pulseRepeatCount:gt.value,pulseFillMode:_t.value,pulseKeyPoints:ht.value,pulseMotion:xt.value,pulse:B.value,pulseTrail:V.value,pulseTrailLength:vt.value,prefersReducedMotion:C(et),loading:C(L),isBar:Z.value},null,8,[`uid`,`svgRef`,`pulsePathId`,`pulsePathLength`,`pulseDur`,`pulseBegin`,`pulseRepeatCount`,`pulseFillMode`,`pulseKeyPoints`,`pulseMotion`,`pulse`,`pulseTrail`,`pulseTrailLength`,`prefersReducedMotion`,`loading`,`isBar`])):g(``,!0),(b(!0),_(m,null,S(X.value,(e,t)=>(b(),_(`g`,null,[Z.value?(b(),_(`rect`,{key:0,x:e.barX,y:isNaN(e.absoluteValue>0?e.y:ur.value)?0:e.absoluteValue>0?e.y:ur.value,width:e.width,height:isNaN(Math.abs(e.y-ur.value))?0:Math.abs(e.y-ur.value),fill:e.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${E.value})`:`url(#sparkline_bar_gradient_neg_${E.value})`,rx:st.value.borderRadius},null,8,Wt)):g(``,!0)]))),256)),or.value<0?(b(),_(`line`,{key:5,x1:Y.value.start,x2:Y.value.start+Y.value.width,y1:C(oe)(ur.value,Y.value.bottom),y2:C(oe)(ur.value,Y.value.bottom),stroke:F.value.zeroLine.color,"stroke-dasharray":F.value.zeroLine.strokeWidth*2,"stroke-width":F.value.zeroLine.strokeWidth,"stroke-linecap":`round`},null,8,Gt)):g(``,!0)],4),(b(!0),_(m,null,S(X.value,(e,t)=>(b(),_(`g`,{key:`sparkline_indicator_${e.id}`,style:ze(Un(e))},[F.value.verticalIndicator.show&&(k.value&&e.id===k.value.id||hr.value===t)?(b(),_(`line`,{key:0,x1:e.x,x2:e.x,y1:Y.value.top-6,y2:Y.value.bottom,stroke:F.value.verticalIndicator.color||e.color,"stroke-width":F.value.verticalIndicator.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":F.value.verticalIndicator.strokeDasharray||0},null,8,Kt)):g(``,!0)],4))),128)),(b(!0),_(m,null,S(X.value,(e,t)=>(b(),_(`g`,{key:`sparkline_plot_${e.id}`,style:ze(Hn(e))},[Tr(e,t)?(b(),_(`circle`,{key:0,cx:e.x,cy:e.y,r:Er(e,t),fill:Yr(e),stroke:Dr(e,t),"stroke-width":F.value.plot.strokeWidth},null,8,qt)):g(``,!0)],4))),128))],8,Ft),e.showInfo&&P.value.show?(b(),_(`text`,{key:1,x:P.value.position===`left`?12+P.value.offsetX:Y.value.width+12+P.value.offsetX,y:q.value.height/2+P.value.fontSize/2.5+P.value.offsetY,"font-size":P.value.fontSize,"font-weight":P.value.bold?`bold`:`normal`,fill:P.value.color},We(k.value?C(se)(P.value.formatter,k.value.absoluteValue,C(t)({p:P.value.prefix,v:k.value.absoluteValue,s:P.value.suffix,r:P.value.roundingValue}),{datapoint:k.value}):C(se)(P.value.formatter,br.value,C(t)({p:P.value.prefix,v:br.value,s:P.value.suffix,r:P.value.roundingValue}))),9,Jt)):g(``,!0),Kn.value?(b(),_(`rect`,{key:2,x:Kn.value.x,y:Kn.value.y,width:Kn.value.width,height:Kn.value.height,fill:I.value.selection.fill,"fill-opacity":I.value.selection.fillOpacity,stroke:I.value.selection.stroke,"stroke-opacity":I.value.selection.strokeOpacity,"stroke-width":I.value.selection.strokeWidth,"stroke-dasharray":I.value.selection.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`},null,8,Yt)):g(``,!0),(b(!0),_(m,null,S(X.value,(e,t)=>(b(),_(`rect`,{x:Z.value?e.barX:e.x-(Y.value.width/(fr.value+1)>q.value.padding?q.value.padding:Y.value.width/(fr.value+1))/2,y:Y.value.top-6,height:Y.value.height+6,width:Z.value?e.width:Y.value.width/(fr.value+1)>q.value.padding?q.value.padding:Y.value.width/(fr.value+1),fill:`transparent`,onMouseenter:()=>_r(e,t),onMouseleave:()=>vr(e,t),onClick:()=>xr(e,t)},null,40,Xt))),256)),He(n.$slots,`svg`,{svg:{...q.value,drawingArea:Y.value,timeLabels:pr.value,series:X.value,hoveredIndex:D.value,isZoomed:fn.value,zoomRange:G.value}},void 0,!0)],46,Ot)),fn.value&&I.value.resetButton.show?(b(),_(`button`,{key:0,type:`button`,class:`vue-ui-sparkline-reset-zoom`,title:I.value.resetButton.title,"aria-label":I.value.resetButton.ariaLabel,style:ze({cursor:A.value.useCursorPointer?`pointer`:`default`}),onPointerdown:Qn,onClick:$n},[(b(),_(`svg`,Qt,[v(`path`,{d:`M2 10a1 1 0 0 0 15 0c0-5-5-8-10-6l3-3M7 4l3 3`,stroke:I.value.resetButton.color,fill:`none`,"stroke-width":`2.5`,"stroke-linecap":`round`},null,8,$t)]))],44,Zt)):g(``,!0),n.$slots.hint?(b(),_(`div`,en,[He(n.$slots,`hint`,Re(Ie({hint:A.value.a11y.translations.keyboardNavigation,isVisible:Xr.value})),void 0,!0)])):g(``,!0)]),k.value&&j.value.show?(b(),Me(C(Xe),{key:2,x:k.value.x,y:k.value.y,prevX:ot.value.x,prevY:ot.value.y,offsetY:F.value.plot.radius*3+j.value.offsetY,svgRef:C(z),background:j.value.backgroundColor,color:j.value.color,fontSize:j.value.fontSize,borderWidth:j.value.borderWidth,borderColor:j.value.borderColor,borderRadius:j.value.borderRadius,backgroundOpacity:j.value.backgroundOpacity},{default:qe(()=>[He(n.$slots,`tooltip`,Re(Ie({...k.value})),()=>[Ne(We(k.value.period)+`: `+We(C(se)(P.value.formatter,k.value.absoluteValue,C(t)({p:P.value.prefix,v:k.value.absoluteValue,s:P.value.suffix,r:P.value.roundingValue}),{datapoint:k.value})),1)],!0)]),_:3},8,[`x`,`y`,`prevX`,`prevY`,`offsetY`,`svgRef`,`background`,`color`,`fontSize`,`borderWidth`,`borderColor`,`borderRadius`,`backgroundOpacity`])):g(``,!0),n.$slots.source?(b(),_(`div`,{key:3,ref_key:`source`,ref:at,dir:`auto`},[He(n.$slots,`source`,{},void 0,!0)],512)):g(``,!0),He(n.$slots,`skeleton`,{},()=>[C(L)?(b(),Me(xe,{key:0})):g(``,!0)],!0)],12,Tt))}},[[`__scopeId`,`data-v-114e8926`]]);export{wt as n,U as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Dt as r,Ht as i,Jt as a,Qt as o,S as s,X as c,Yt as ee,at as te,i as ne,in as re,t as ie,w as ae,yt as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./useHints-C-TwxM0Y.js";import{t as ue}from"./useConfig-_JwRfIqE.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{t as pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./vue_ui_sparkstackbar-DZX34uPS.js";import{t as ge}from"./BaseLegendToggle-VzX69MCo.js";import{t as _e}from"./A11yDataTable-DWNlWXzs.js";import{t as ve}from"./DefGrad-DKMq1REY.js";import{t as ye}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createVNode as be,defineAsyncComponent as xe,guardReactiveProps as h,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onMounted as Se,openBlock as y,ref as b,renderList as x,renderSlot as S,toDisplayString as C,toRefs as Ce,unref as w,useSlots as we,watch as Te,withCtx as T}from"vue";var Ee=/* @__PURE__ */ e({default:()=>Ke}),De=[`id`],Oe={style:{position:`relative`}},ke=[`xmlns`,`viewBox`,`aria-describedby`],Ae=[`id`],je=[`width`,`height`,`rx`],Me=[`clip-path`],Ne=[`x`,`width`,`height`,`fill`],Pe=[`x`,`width`,`height`,`fill`],Fe=[`x`,`height`,`fill`],Ie=[`x`,`width`,`height`,`onClick`,`onMouseenter`,`onMouseleave`],Le=[`width`,`height`,`rx`,`stroke`],Re=[`width`,`height`,`rx`],ze={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Be=[`aria-pressed`,`aria-label`,`onClick`,`onFocus`,`onKeydown`],Ve={style:{display:`flex`,"flex-direction":`row`,"align-items":`center`,gap:`4px`,"justify-content":`center`}},He=[`height`,`width`],Ue=[`rx`,`fill`],We=[`rx`,`fill`],Ge={key:3,ref:`source`,dir:`auto`},Ke=/*#__PURE__*/ ye({__name:`vue-ui-sparkstackbar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`selectLegend`],setup(e,{expose:ye,emit:Ee}){let Ke=xe(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),qe=xe(()=>import(`./Tooltip-C1q0Qoh7.js`)),{vue_ui_sparkstackbar:Je}=ue(),Ye=me(),Xe=we(),E=e,Ze=b(null),D=b(c()),O=b(!1),Qe=b(``),k=b(null),A=b(!1),j=b(null),$e=b({x:0,y:0}),M=b(`pointer`),et=b(!1),N=b(null),tt=b([]),P=b(at()),F=u(()=>P.value.style.bar),I=u(()=>P.value.style.legend),L=u(()=>P.value.style.tooltip),R=u(()=>P.value.style),nt=u(()=>P.value.debug);Se(()=>{Xe[`chart-background`]&&nt.value&&console.warn(`VueUiSparkStackbar does not support the #chart-background slot.`)}),ce({config:()=>P.value,dataset:()=>E.dataset,component:`VueUiSparkStackbar`,rules:[le.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let rt=u(()=>P.value.useCursorPointer),it=u(()=>re({defaultConfig:{style:{backgroundColor:`#99999930`,animation:{show:!1},bar:{gradient:{inderlayerColor:`#6A6A6A`}},title:{backgroundColor:`transparent`}}},userConfig:P.value.skeletonConfig??{}})),{loading:z,FINAL_DATASET:B}=de({...Ce(E),FINAL_CONFIG:P,prepareConfig:at,skeletonDataset:E.config?.skeletonDataset??[{name:`_`,value:8,color:`#808080`},{name:`_`,value:5,color:`#ADADAD`},{name:`_`,value:3,color:`#DBDBDB`}],skeletonConfig:re({defaultConfig:P.value,userConfig:it.value})}),{svgRef:V}=pe({config:R.value.title});function at(){return t(E.config,Je,he)}let ot=o(E.config);Te(()=>E.config,(e,t)=>{let n=o(e),r=n!==ot;ot=n;let i=at();r?(P.value=i,ct()):P.value.style.tooltip=i.style.tooltip},{deep:!0}),Te(()=>B.value,e=>{U.value=B.value.map((e,t)=>({...e,color:e.color?s(e.color):H.value[t]||i[t]||i[t%i.length]})),st()},{deep:!0});let H=u(()=>ae(P.value.customPalette)),U=b(B.value.map((e,t)=>({...e,value:R.value.animation.show?0:e.value||0,color:e.color?s(e.color):H.value[t]||i[t]||i[t%i.length]}))),W=b(!0);function st(){if(!R.value.animation.show||Ye.value){W.value=!1;return}let e=R.value.animation.animationFrames,t=B.value.map(e=>e.value||0),n=t.map(t=>t/e),r=t.reduce((e,t)=>e+t,0),a=0;W.value=!0,U.value=B.value.map((e,t)=>({...e,value:0,color:e.color?s(e.color):H.value[t]||i[t]||i[t%i.length]}));function o(){a+=r/e,a<r?(U.value=U.value.map((e,r)=>({...e,value:Math.min(e.value+n[r],t[r]),color:e.color?s(e.color):H.value[r]||i[r]||i[r%i.length]})),requestAnimationFrame(o)):(W.value=!1,U.value=B.value.map((e,n)=>({...e,value:t[n],color:e.color?s(e.color):H.value[n]||i[n]||i[n%i.length],id:c()})))}o()}Se(()=>{ct()});function ct(){se(E.dataset)?te({componentName:`VueUiSparkStackbar`,type:`dataset`,debug:nt.value}):nt.value&&E.dataset.forEach((e,t)=>{oe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{te({componentName:`VueUiSparkStackbar`,type:`datasetSerieAttribute`,property:e,index:t})})}),st()}let G=b({width:500,height:16}),K=b([]),lt=u(()=>B.value.map(e=>e.value||0).filter((e,t)=>!K.value.includes(t)).reduce((e,t)=>e+t,0)),q=u(()=>U.value.map((e,t)=>{let r=e.value||0,a=r/lt.value,o=isNaN(a)?0:a,c=o*G.value.width;return{...e,color:s(B.value[t]?.color?B.value[t]?.color:H.value[t]||i[t]||i[t%i.length]),value:r,proportion:o,width:c,seriesIndex:t,proportionLabel:n({v:o*100,s:`%`,r:I.value.percentage.rounding})}})),J=u(()=>q.value.filter((e,t)=>!K.value.includes(t)));function ut(){O.value=!1,N.value=null,j.value=null,M.value=`pointer`}function dt(){ut(),K.value.length?K.value=[]:q.value.forEach((e,t)=>{K.value.push(t)}),gt(`selectLegend`,J.value)}function Y(e){ut(),K.value.includes(e)?K.value=K.value.filter(t=>t!==e):K.value.length<U.value.length-1&&K.value.push(e),gt(`selectLegend`,J.value)}function ft(e){return q.value.length?q.value.find(t=>t.name===e)||(P.value.debug&&console.warn(`VueUiSparkStackbar - Series name not found "${e}"`),null):(P.value.debug&&console.warn(`VueUiSparkStackbar - There are no series to show.`),null)}function pt(e){let t=ft(e);t!==null&&K.value.includes(t.id)&&Y(t.seriesIndex)}function mt(e){let t=ft(e);t!==null&&(K.value.includes(t.id)||Y(t.seriesIndex))}let X=u(()=>{let e=0,t=[];for(let n=0;n<J.value.length;n+=1)t.push({...J.value[n],start:e}),e+=J.value[n].width;return t}),ht=u(()=>{let e=X.value.reduce((e,t)=>e+t.width,0);return Math.min(Math.max(e,0),G.value.width)}),gt=Ee;function Z(e,t,n=!1){gt(`selectDatapoint`,{datapoint:e,index:t}),P.value.events.datapointClick&&!n&&P.value.events.datapointClick({datapoint:e,seriesIndex:e.seriesIndex})}function _t({datapoint:e,seriesIndex:t}){O.value=!1,N.value=null,j.value=null,M.value=`pointer`,P.value.events.datapointLeave&&P.value.events.datapointLeave({datapoint:e,seriesIndex:e.seriesIndex})}function vt({datapoint:e,seriesIndex:t,triggerMode:i=`pointer`}){if(A.value=!1,P.value.events.datapointEnter&&P.value.events.datapointEnter({datapoint:e,seriesIndex:e.seriesIndex}),!L.value.show)return;M.value=i,k.value={datapoint:e,seriesIndex:t,config:P.value,series:q.value},O.value=!0,N.value=e.seriesIndex;let o=L.value.customFormat;if(r(o))try{let t=o({seriesIndex:e.seriesIndex,datapoint:e,series:q.value,config:P.value});typeof t==`string`&&(Qe.value=t,A.value=!0)}catch{console.warn(`Custom format cannot be applied.`),A.value=!1}if(!A.value){let r=``,i=F.value.gradient.show,o=`tooltip_grad_${t}_${D.value}`,s=a(ee(e.color,.05),100-F.value.gradient.intensity),c=i?`<rect x="0" y="0" width="10" height="10" rx="${Q.value}" fill="${F.value.gradient.underlayerColor}"/>`:``,te=i?`<defs><radialGradient id="${o}"><stop offset="0%" stop-color="${s}"/><stop offset="100%" stop-color="${e.color}"/></radialGradient></defs>`:``;r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${L.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 10 10" height="14" width="14">${te}${c}<rect x="0" y="0" width="10" height="10" rx="${Q.value}" fill="${i?`url(#${o})`:e.color}"/></svg>`,r+=`<b>${e.proportionLabel}</b>`,r+=`<span>(${ne(I.value.value.formatter,e.value,n({p:I.value.value.prefix,v:e.value,s:I.value.value.suffix,r:I.value.value.rounding}),{datapoint:e,seriesIndex:t})})</span>`,Qe.value=`<div>${r}</div>`}}let yt=u(()=>{let e=F.value.borderRadius==null?G.value.height/2:F.value.borderRadius;return Math.min(Math.max(e,0),G.value.height/2)}),Q=u(()=>{let e=G.value.height/2;return e===0?5:yt.value/e*5});function $(e){let t=tt.value[e];t&&typeof t.focus==`function`&&t.focus()}function bt(e){if(!Number.isFinite(e)||!V.value)return;let t=X.value[e];if(!t)return;let n=V.value.getBoundingClientRect(),r=t.start+t.width/2,i=G.value.height/2;$e.value={x:n.left+r/G.value.width*n.width,y:n.top+i/G.value.height*n.height}}function xt(){j.value=null,et.value=!0}function St(){j.value=null,M.value=`pointer`,O.value=!1,N.value=null,et.value=!1}function Ct(e){if(!V.value||document.activeElement!==V.value||!X.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`,a=e.key===`Home`,o=e.key===`End`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),i){j.value=null,M.value=`pointer`,O.value=!1,N.value=null;return}if(r){if(j.value===null)return;let e=X.value[j.value];if(!e)return;Z(e,e.seriesIndex);return}let s=j.value;a?s=0:o?s=X.value.length-1:s===null||s<0||s>=X.value.length?s=n?0:X.value.length-1:n?(s+=1,s>=X.value.length&&(s=0)):t&&(--s,s<0&&(s=X.value.length-1));let c=X.value[s];c&&(j.value=s,bt(s),vt({datapoint:c,seriesIndex:c.seriesIndex,triggerMode:`keyboard`}))}function wt(e){O.value=!1,j.value=null,M.value=`pointer`,N.value=e.seriesIndex}function Tt(){j.value=null,M.value=`pointer`,O.value=!1,N.value=null}function Et(e,t,n){let r=e.key===`Enter`||e.key===` `,i=e.key===`ArrowLeft`||e.key===`ArrowUp`,a=e.key===`ArrowRight`||e.key===`ArrowDown`,o=e.key===`Home`,s=e.key===`End`,c=e.key===`Escape`;(r||i||a||o||s||c)&&(e.preventDefault(),e.stopPropagation(),c?Tt():r?(Y(n),Z(t,n,!0)):o?$(0):s?$(q.value.length-1):i?$(n<=0?q.value.length-1:n-1):a&&$(n>=q.value.length-1?0:n+1))}let Dt=u(()=>({headers:[P.value.a11y.translations.series,P.value.a11y.translations.percentage,P.value.a11y.translations.value],rows:q.value.map((e,t)=>[e.name,K.value.includes(t)?` - `:e.proportionLabel,ne(I.value.value.formatter,e.value,n({p:I.value.value.prefix,v:e.value,s:I.value.value.suffix,r:I.value.value.rounding}),{datapoint:e,seriesIndex:t})])}));return ye({hideSeries:mt,showSeries:pt}),(e,t)=>(y(),p(`div`,{class:`vue-data-ui-component vue-ui-spark-stackbar`,ref_key:`sparkstackbarChart`,ref:Ze,style:v(`width:100%; background:${R.value.backgroundColor}`)},[m(`div`,{id:`chart-instructions-${D.value}`,class:`sr-only`},[m(`p`,null,C(P.value.a11y.translations.keyboardNavigation),1)],8,De),Dt.value?.rows?.length?(y(),d(_e,{key:0,uid:D.value,head:Dt.value.headers,body:Dt.value.rows,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),R.value.title.text?(y(),p(`div`,{key:1,style:v(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${R.value.title.margin};padding: 0 6px;text-align:${R.value.title.textAlign}`)},[m(`div`,{class:`atom-title`,style:v(`font-size:${R.value.title.fontSize}px;color:${R.value.title.color};font-weight:${R.value.title.bold?`bold`:`normal`}`)},C(R.value.title.text),5),R.value.title.subtitle.text?(y(),p(`div`,{key:0,class:`atom-subtitle`,style:v(`font-size:${R.value.title.subtitle.fontSize}px;color:${R.value.title.subtitle.color};font-weight:${R.value.title.subtitle.bold?`bold`:`normal`}`)},C(R.value.title.subtitle.text),5)):f(``,!0)],4)):f(``,!0),m(`div`,Oe,[(y(),p(`svg`,{ref_key:`svgRef`,ref:V,xmlns:w(ie),width:`100%`,viewBox:`0 0 ${G.value.width} ${G.value.height}`,"aria-describedby":`chart-instructions-${D.value}`,tabindex:`0`,onFocus:xt,onBlur:St,onKeydown:Ct},[be(w(Ke)),m(`defs`,null,[(y(!0),p(l,null,x(X.value,(e,t)=>(y(),d(ve,{t:`linear`,id:`stack_gradient_${t}_${D.value}`,key:`stack_gradient_${t}`,gradientTransform:`rotate(90)`,stops:[[`0%`,e.color,1],[`50%`,w(a)(w(ee)(e.color,.05),100-F.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),m(`clipPath`,{id:`stackPill_${D.value}`},[m(`rect`,{x:`0`,y:`0`,width:ht.value,height:G.value.height,rx:yt.value,class:g({animated:!W.value&&!w(z)})},null,10,je)],8,Ae)]),lt.value>0?(y(),p(l,{key:0},[m(`g`,{"clip-path":`url(#stackPill_${D.value})`},[(y(!0),p(l,null,x(X.value,(e,t)=>(y(),p(`rect`,{key:`stack_underlayer_${t}`,x:e.start,y:0,width:e.width,height:G.value.height,fill:F.value.gradient.underlayerColor,class:g({animated:!W.value&&!w(z)}),style:v({opacity:O.value&&N.value!==null&&L.value.show?N.value===e.seriesIndex?1:.5:1})},null,14,Ne))),128)),(y(!0),p(l,null,x(X.value,(e,t)=>(y(),p(`rect`,{key:`stack_${t}`,x:e.start,y:0,width:e.width,height:G.value.height,fill:F.value.gradient.show?`url(#stack_gradient_${t}_${D.value})`:e.color,class:g({animated:!W.value&&!w(z)}),style:v({opacity:O.value&&N.value!==null&&L.value.show?N.value===e.seriesIndex?1:.5:1})},null,14,Pe))),128)),(y(!0),p(l,null,x(X.value.slice(1),(e,t)=>(y(),p(`rect`,{key:`stack_separator_${t}`,x:e.start-.5,y:`0`,width:`1`,height:G.value.height,fill:R.value.backgroundColor,"pointer-events":`none`,class:g({animated:!W.value&&!w(z)})},null,10,Fe))),128)),(y(!0),p(l,null,x(X.value,(e,t)=>(y(),p(`rect`,{key:`stack_trap_${t}`,x:e.start,y:0,width:e.width,height:G.value.height,fill:`transparent`,stroke:`none`,class:g({animated:!W.value&&!w(z)}),onClick:()=>Z(e,t),onMouseenter:()=>vt({datapoint:e,seriesIndex:e.seriesIndex}),onMouseleave:t=>_t({datapoint:e,seriesIndex:e.seriesIndex})},null,42,Ie))),128))],8,Me),m(`rect`,{x:`0.5`,y:`0.5`,width:G.value.width-1,height:G.value.height-1,rx:Math.max(0,yt.value-.5),fill:`none`,stroke:R.value.backgroundColor,"stroke-width":`1`,"pointer-events":`none`},null,8,Le)],64)):(y(),p(`rect`,{key:1,x:2,y:1,width:G.value.width-4,height:G.value.height-2,stroke:`#CCCCCC`,"stroke-width":`2`,fill:`transparent`,rx:(G.value.height-4)/2},null,8,Re))],40,ke)),e.$slots.hint?(y(),p(`div`,ze,[S(e.$slots,`hint`,_(h({hint:P.value.a11y.translations.keyboardNavigation,isVisible:et.value})),void 0,!0)])):f(``,!0)]),I.value.show?(y(),p(`div`,{key:2,style:v(`background:transparent;margin:0 auto;margin:${I.value.margin};justify-content:${I.value.textAlign===`left`?`flex-start`:I.value.textAlign===`right`?`flex-end`:`center`}`),class:`vue-ui-sparkstackbar-legend`,"aria-label":`legend`,role:`toolbar`},[I.value.selectAllToggle.show&&q.value.length>2&&!w(z)?(y(),d(ge,{key:0,backgroundColor:I.value.selectAllToggle.backgroundColor,color:I.value.selectAllToggle.color,fontSize:I.value.fontSize,checked:K.value.length>0,isCursorPointer:rt.value,onToggle:dt},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):f(``,!0),(y(!0),p(l,null,x(q.value,(e,t)=>(y(),p(`div`,{role:`button`,tabindex:`0`,"aria-pressed":K.value.includes(t),"aria-label":`${e.name}, ${K.value.includes(t)?`hidden`:`visible`}, ${e.proportionLabel}`,style:v(`font-size:${I.value.fontSize}px;cursor:${rt.value?`pointer`:`default`}`),class:g({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":K.value.includes(t)}),onClick:n=>{Y(t),Z(e,t,!0)},onFocus:t=>wt(e),onBlur:Tt,onKeydown:n=>Et(n,e,t)},[m(`div`,Ve,[(y(),p(`svg`,{height:`${I.value.fontSize}px`,width:`${I.value.fontSize}px`,viewBox:`0 0 10 10`},[m(`defs`,null,[be(ve,{t:`radial`,id:`legend_grad_${t}-${D.value}`,stops:[[`0%`,w(z)?`#FFFFFF`:w(a)(w(ee)(e.color,.05),100-F.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`])]),F.value.gradient.show?(y(),p(`rect`,{key:0,x:`0`,y:`0`,width:`10`,height:`10`,rx:Q.value,fill:F.value.gradient.underlayerColor},null,8,Ue)):f(``,!0),m(`rect`,{x:`0`,y:`0`,width:`10`,height:`10`,rx:Q.value,fill:F.value.gradient.show?`url(#legend_grad_${t}-${D.value})`:e.color},null,8,We)],8,He)),w(z)?f(``,!0):(y(),p(l,{key:0},[m(`span`,{style:v(`color:${I.value.name.color}; font-weight:${I.value.name.bold?`bold`:`normal`}`)},C(e.name),5),W.value?f(``,!0):(y(),p(l,{key:0},[I.value.percentage.show?(y(),p(`span`,{key:0,style:v(`font-weight:${I.value.percentage.bold?`bold`:`normal`};color:${I.value.percentage.color}`)},C(K.value.includes(t)?` - `:e.proportionLabel),5)):f(``,!0),I.value.value.show?(y(),p(`span`,{key:1,style:v(`font-weight:${I.value.value.bold?`bold`:`normal`};color:${I.value.value.color}`)},` (`+C(w(ne)(I.value.value.formatter,e.value,w(n)({p:I.value.value.prefix,v:e.value,s:I.value.value.suffix,r:I.value.value.rounding}),{datapoint:e,seriesIndex:t}))+`) `,5)):f(``,!0)],64))],64))])],46,Be))),256))],4)):f(``,!0),be(w(qe),{teleportTo:L.value.teleportTo,show:O.value&&L.value.show,parent:Ze.value,backgroundColor:L.value.backgroundColor,color:L.value.color,fontSize:L.value.fontSize,borderRadius:L.value.borderRadius,borderColor:L.value.borderColor,borderWidth:L.value.borderWidth,backgroundOpacity:L.value.backgroundOpacity,position:L.value.position,content:Qe.value,isCustom:A.value,offsetX:L.value.offsetX,offsetY:-124+L.value.offsetY,blockShiftY:!0,smooth:L.value.smooth,backdropFilter:L.value.backdropFilter,smoothForce:L.value.smoothForce,smoothSnapThreshold:L.value.smoothSnapThreshold,isA11yMode:M.value===`keyboard`,a11yPosition:$e.value},{"tooltip-before":T(()=>[S(e.$slots,`tooltip-before`,_(h({...k.value})),void 0,!0)]),tooltip:T(()=>[S(e.$slots,`tooltip`,_(h({...k.value})),void 0,!0)]),"tooltip-after":T(()=>[S(e.$slots,`tooltip-after`,_(h({...k.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`parent`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`content`,`isCustom`,`offsetX`,`offsetY`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),e.$slots.source?(y(),p(`div`,Ge,[S(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),S(e.$slots,`skeleton`,{},()=>[w(z)?(y(),d(fe,{key:0})):f(``,!0)],!0)],4))}},[[`__scopeId`,`data-v-2bce158b`]]);export{Ee as n,Ke as t};
|