vue-data-ui 3.28.1 → 3.28.2
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/{PackageVersion-C4ZM3Vf7.js → PackageVersion-BIhjLNBU.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-age-pyramid.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-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-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-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-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.js +1 -1
- package/dist/package-DwcKiXuI.js +1 -0
- package/dist/{render-common-CJz0wn0I.js → render-common-B-s2XJ_I.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.d.ts +2 -0
- package/dist/style.d.css.ts +2 -0
- package/dist/vue-data-ui-BvHCscNE.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-CW8ahywt.js → vue-ui-3d-bar-CkHFiFp4.js} +1 -1
- package/dist/{vue-ui-age-pyramid-CxMwKICA.js → vue-ui-age-pyramid-vpIjdLg5.js} +1 -1
- package/dist/{vue-ui-bullet-ClnewIWQ.js → vue-ui-bullet-rgxGRR1p.js} +1 -1
- package/dist/{vue-ui-bump-C6FuNDUg.js → vue-ui-bump-CeDsunDi.js} +1 -1
- package/dist/{vue-ui-candlestick-CyewIjJk.js → vue-ui-candlestick-KJHOS5F7.js} +1 -1
- package/dist/{vue-ui-carousel-table-D0dD4kai.js → vue-ui-carousel-table-CeI5SIxH.js} +1 -1
- package/dist/{vue-ui-chestnut-nS1vjCqH.js → vue-ui-chestnut-CiY-2e77.js} +1 -1
- package/dist/{vue-ui-chord-B963Q_26.js → vue-ui-chord-8rk7304-.js} +1 -1
- package/dist/{vue-ui-circle-pack-DEY9X3jA.js → vue-ui-circle-pack-BsH09EPG.js} +1 -1
- package/dist/{vue-ui-cursor-CNv12HQG.js → vue-ui-cursor-Cpov2m58.js} +1 -1
- package/dist/{vue-ui-dag-s3-TMmid.js → vue-ui-dag-BHFL2cUA.js} +1 -1
- package/dist/{vue-ui-dashboard-B5zrGAvS.js → vue-ui-dashboard-BxXdhdNJ.js} +1 -1
- package/dist/{vue-ui-digits-DXQwmTUx.js → vue-ui-digits-xHOLjA2_.js} +1 -1
- package/dist/{vue-ui-donut-DHfOfLBF.js → vue-ui-donut-CR3klUbX.js} +1 -1
- package/dist/{vue-ui-donut-CDryub1L.js → vue-ui-donut-Vbp5Xs2-.js} +1 -1
- package/dist/{vue-ui-donut-evolution-C5pHSrza.js → vue-ui-donut-evolution-BTmztL3Y.js} +1 -1
- package/dist/{vue-ui-dumbbell-CQbGR7yM.js → vue-ui-dumbbell-CDcgKS2A.js} +1 -1
- package/dist/{vue-ui-flow-B16Mj6MW.js → vue-ui-flow-kVocPE27.js} +1 -1
- package/dist/{vue-ui-funnel-Dh-xi_Qi.js → vue-ui-funnel-CZAdPYqK.js} +1 -1
- package/dist/{vue-ui-galaxy-U_ZIP5vm.js → vue-ui-galaxy-hP-9mVlB.js} +1 -1
- package/dist/{vue-ui-gauge-Dr4zsf6D.js → vue-ui-gauge-BRabsLkh.js} +1 -1
- package/dist/{vue-ui-geo-DFebja0s.js → vue-ui-geo-Dacnp6iw.js} +1 -1
- package/dist/{vue-ui-gizmo-CssVcz-O.js → vue-ui-gizmo-Dp3hpHIX.js} +1 -1
- package/dist/{vue-ui-graph-BB_97Qz7.js → vue-ui-graph-DHU9hUry.js} +1 -1
- package/dist/{vue-ui-heatmap-DEBbVnrg.js → vue-ui-heatmap-kPnmZgWi.js} +1 -1
- package/dist/{vue-ui-hill-C1sHz3TI.js → vue-ui-hill-Ddbup7-b.js} +1 -1
- package/dist/{vue-ui-history-plot-CsBTJXR3.js → vue-ui-history-plot-CwO2o-2s.js} +1 -1
- package/dist/{vue-ui-horizontal-bar-D0kfcpEW.js → vue-ui-horizontal-bar-CvX77vE4.js} +1 -1
- package/dist/{vue-ui-kpi-CltKSYUI.js → vue-ui-kpi-CCOOwX_Q.js} +1 -1
- package/dist/{vue-ui-molecule-DtoyWWTf.js → vue-ui-molecule-BPGs9Dom.js} +1 -1
- package/dist/{vue-ui-mood-radar-ClOxfeH8.js → vue-ui-mood-radar-GJ-lhgI0.js} +1 -1
- package/dist/{vue-ui-nested-donuts-CULAXTg1.js → vue-ui-nested-donuts-CrlPwpg8.js} +1 -1
- package/dist/{vue-ui-onion-D7zu861i.js → vue-ui-onion-CKmyy-Y_.js} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-Cjbc-WUG.js → vue-ui-parallel-coordinate-plot-C0UqWt0M.js} +1 -1
- package/dist/{vue-ui-quadrant-DWAb_t6r.js → vue-ui-quadrant-CTGFBNo9.js} +1 -1
- package/dist/{vue-ui-quick-chart-oDZwgVo8.js → vue-ui-quick-chart-ZBOPZhxA.js} +1 -1
- package/dist/{vue-ui-radar-BWG_N0xO.js → vue-ui-radar-B1z3Ux3E.js} +1 -1
- package/dist/{vue-ui-relation-circle-BCRiS2n6.js → vue-ui-relation-circle-DqN5N08e.js} +1 -1
- package/dist/{vue-ui-ridgeline-VYcGUP_p.js → vue-ui-ridgeline-DcSB5Qef.js} +1 -1
- package/dist/{vue-ui-rings-Dl0AjrRj.js → vue-ui-rings-CJqAnf-l.js} +1 -1
- package/dist/{vue-ui-scatter-DTa48HvG.js → vue-ui-scatter-THQAeoWs.js} +1 -1
- package/dist/{vue-ui-skeleton-C5mGG8hR.js → vue-ui-skeleton-DqmhigQ0.js} +1 -1
- package/dist/{vue-ui-spark-trend--frxeJ8f.js → vue-ui-spark-trend-B2Nf1raK.js} +1 -1
- package/dist/{vue-ui-sparkbar-BS5v3HMo.js → vue-ui-sparkbar-CamZ_49V.js} +1 -1
- package/dist/{vue-ui-sparkgauge-B1TGfXvR.js → vue-ui-sparkgauge-Ffrp_7VV.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-Cs97AL6h.js → vue-ui-sparkhistogram-CLfzi3PO.js} +1 -1
- package/dist/{vue-ui-sparkline-Bp9J6x7z.js → vue-ui-sparkline-Y-sljnbS.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-BVuuRD10.js → vue-ui-sparkstackbar-CYZ-ADO1.js} +1 -1
- package/dist/{vue-ui-stackbar-CRuXn3XI.js → vue-ui-stackbar-CQLYm10x.js} +1 -1
- package/dist/{vue-ui-stackline-Besmr9vq.js → vue-ui-stackline-VpvF7MRx.js} +1 -1
- package/dist/{vue-ui-strip-plot-D-aRJkR7.js → vue-ui-strip-plot-B9Ogpw7K.js} +1 -1
- package/dist/{vue-ui-table-D_UdQwV3.js → vue-ui-table-Bi9C3LzP.js} +1 -1
- package/dist/{vue-ui-table-sparkline-BdNo8fW_.js → vue-ui-table-sparkline-DEVAL0cR.js} +1 -1
- package/dist/{vue-ui-thermometer-TFg1SGY7.js → vue-ui-thermometer-ClN4EO0I.js} +1 -1
- package/dist/{vue-ui-timer-BdPksC26.js → vue-ui-timer-nqZxt1vU.js} +1 -1
- package/dist/{vue-ui-tiremarks-HWuO-eyj.js → vue-ui-tiremarks-BeJBsgXo.js} +1 -1
- package/dist/{vue-ui-treemap-IegiAqaX.js → vue-ui-treemap-FA-yXwmv.js} +1 -1
- package/dist/{vue-ui-waffle-BEyGfPks.js → vue-ui-waffle-CO07S6HV.js} +1 -1
- package/dist/{vue-ui-wheel-k8GNPGET.js → vue-ui-wheel-BeaSWB4x.js} +1 -1
- package/dist/{vue-ui-word-cloud-D9_15Ve7.js → vue-ui-word-cloud-C1OWGFng.js} +1 -1
- package/dist/{vue-ui-world-rCp5Vb7u.js → vue-ui-world-CUS_mKgl.js} +1 -1
- package/dist/{vue-ui-xy-CFgFg11v.js → vue-ui-xy-6B_K-quN.js} +1 -1
- package/dist/{vue-ui-xy-42AXepcQ.js → vue-ui-xy-BigPHE0Q.js} +1 -1
- package/package.json +6 -2
- package/dist/package-DGRUegc-.js +0 -1
- package/dist/vue-data-ui-CxiWUtNw.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,J as a,N as ee,P as te,S as o,U as ne,X as re,Xt as ie,at as s,i as c,in as ae,nt as oe,r as se,t as ce,tt as le,w as ue,xt as de,yt as fe,zt as pe}from"./lib-rPeBMZrn.js";import{n as me,t as he}from"./BaseScanner-8NdoBs7B.js";import{n as ge,t as _e}from"./useHints-BH9r_0Vd.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ye}from"./resolveChartConfig-CIhClE5R.js";import{t as be}from"./chartImage-DPGnEuYM.js";import{n as xe}from"./Title-BliHuXfT.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{n as Ce,t as we}from"./tableIntegration-CNoJ1CIY.js";import{n as Te,t as Ee}from"./annotationSlots-BRR85CqJ.js";import{n as De,t as Oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-sVoTzet1.js";import{t as je}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Me}from"./Shape-CRe8woTu.js";import{c as Ne}from"./canvas-lib-22VpOI4_.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./Legend-DM0ClX3D.js";import{t as Ve}from"./vue_ui_ridgeline-Di26JtQu.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as He,createTextVNode as Ue,createVNode as We,defineAsyncComponent as h,guardReactiveProps as Ge,mergeProps as Ke,nextTick as qe,normalizeClass as Je,normalizeProps as Ye,normalizeStyle as g,onBeforeUnmount as Xe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as Ze,shallowRef as Qe,toDisplayString as x,toRefs as $e,unref as S,watch as et,watchEffect as tt,withCtx as C}from"vue";var nt=/* @__PURE__ */ e({default:()=>Tt}),rt=[`id`],it=[`id`],at={style:{position:`relative`}},ot=[`xmlns`,`aria-describedby`,`viewBox`],st={key:0},ct=[`fill`,`d`],lt=[`stroke`,`stroke-width`,`d`],ut=[`fill`,`d`],dt=[`stroke`,`stroke-dasharray`,`stroke-width`,`d`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],pt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],mt=[`x`,`y`,`font-size`,`font-weight`,`fill`,`text-decoration`,`onMouseenter`,`onClick`],ht={key:0},gt=[`font-size`,`fill`,`stroke`,`font-weight`,`transform`,`text-anchor`],_t=[`font-size`,`fill`,`font-weight`,`transform`,`text-anchor`,`innerHTML`],vt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],bt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],xt=[`x`,`y`,`stroke`,`text-anchor`,`font-size`,`fill`],St={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ct={key:5,class:`vue-data-ui-watermark`},wt=[`onClick`],Tt=/*#__PURE__*/ ve({__name:`vue-ui-ridgeline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`selectX`,`copyAlt`],setup(e,{expose:ve,emit:nt}){let Tt=h(()=>import(`./vue-ui-xy-CFgFg11v.js`).then(e=>e.n)),Et=h(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Dt=h(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Ot=h(()=>import(`./DataTable-0Vv-aGHD.js`)),kt=h(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),At=h(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),jt=h(()=>import(`./PackageVersion-C4ZM3Vf7.js`).then(e=>e.t)),Mt=h(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_ridgeline:Nt}=t(),w=e,Pt=u({get(){return Array.isArray(B.value)&&B.value.length>0},set(e){return e}}),Ft=nt,T=v(null),It=v(null),Lt=v(null),E=Qe(null),D=Qe(null),Rt=v(null),zt=v(null),Bt=v(0),Vt=v(0),Ht=v(0),O=v(re()),Ut=v(0),Wt=v(0),Gt=v(512),k=v(null),A=v(null),Kt=v(null),qt=v(0),Jt=v(null),Yt=v(null),Xt=v(null),j=v(null),Zt=v(!1);function Qt(){return ye(w.config,Nt,Ve)}let M=v(Qt()),N=u(()=>M.value.userOptions),P=u(()=>M.value.style.chart.areas),F=u(()=>M.value.style.chart.selector),I=u(()=>M.value.style.chart.xAxis.labels),L=u(()=>M.value.style.chart.yAxis.labels),R=u(()=>M.value.style.chart);ge({config:()=>M.value,dataset:()=>w.dataset,component:`VueUiRidgeline`,rules:[_e.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display`,``,`▶️ Use several instances of the component to show related series`]},{test:e=>e.some(e=>e.datapoints.some(e=>e.values.length>200)),message:[`👀 Some series contain > 200 data points, which can affect performance. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values.`,``,`▶️ Filter the time range by adding date inputs in your UI.`]},{test:e=>e.length<6&&e.length>0,message:[`👀 The number of series < 6. Consider:`,``,`▶️ Using VueUiXy instead`]}]});let z=u(()=>M.value.userOptions.useCursorPointer),$t=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,areas:{maxPoint:{show:!1},opacity:.9,stroke:{useSerieColor:!0}},legend:{backgroundColor:`transparent`},padding:{right:-24,left:0},xAxis:{labels:{values:[]}},yAxis:{labels:{fontSize:0}},zeroLine:{show:!1}}}},userConfig:M.value.skeletonConfig??{}})),{loading:en,FINAL_DATASET:B,manualLoading:tn}=me({...$e(w),FINAL_CONFIG:M,prepareConfig:Qt,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,datapoints:[{name:`__`,color:`#999999`,values:[28.639,32.04,41.134,44.525,21.151,2.436,.218,.024,.002,0,0,0]},{name:`_`,color:`#CACACA`,values:[13.253,15.621,23.36,33.698,29.935,10.874,2.364,.561,.107,.02,.006,.004]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[10.851,13.195,21.617,36.556,42.292,21.006,3.398,.223,.013,.001,0,0]},{name:`_`,color:`#CACACA`,values:[3.171,4.115,8.108,18.248,31.641,29.063,12.031,2.742,.504,.102,.032,.021]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[1.731,2.334,5.125,13.626,29.911,38.524,24.168,7.646,1.575,.317,.097,.063]},{name:`_`,color:`#CACACA`,values:[.25,.367,1.026,3.944,13.635,28.891,30.149,15.419,4.714,1.246,.442,.299]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[.034,.054,.194,1.065,5.747,20.735,38.306,32.899,15.318,5.566,2.422,1.76]},{name:`_`,color:`#CACACA`,values:[.001,.002,.009,.095,1.124,8.342,27.115,35.08,21.449,9.093,4.243,3.143]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,.001,.004,.051,.567,3.322,14.215,44.783,40.351,20.377,9.866,7.378]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,.001,.11,4.136,27.498,43.24,29.807,17.345,13.678]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,0,0,0,.025,.598,3.886,10.645,54.479,45.953,30.814,24.55]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,0,0,.007,1.655,26.63,52.017,45.192,39.651]}]}],skeletonConfig:ae({defaultConfig:M.value,userConfig:$t.value})}),V=v(Math.min(P.value.height,P.value.rowHeight)),{userOptionsVisible:nn,setUserOptionsVisibility:rn,keepUserOptionState:an}=Re({config:M.value}),{svgRef:H}=ze({config:R.value.title}),on=u(()=>M.value.debug);function sn(){let e=B.value||[];if(!Array.isArray(e)||e.length===0)s({componentName:`VueUiRidgeline`,type:`dataset`,debug:on.value}),tn.value=!0;else if(e.forEach((e,t)=>{fe({datasetObject:e,requiredAttributes:[`name`,`datapoints`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:e,index:t,debug:on.value})}),Array.isArray(e.datapoints)&&e.datapoints.length&&e.datapoints.forEach((e,n)=>{fe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:`datapoint.${e}`,index:`${t}-${n}`,debug:on.value})})})}),Wt.value=e.length,V.value=Math.min(P.value.height,P.value.rowHeight),pe(w.dataset)||(tn.value=M.value.loading),M.value.responsive){let t=Ne(()=>{let{width:t,height:n}=Pe({chart:T.value,title:R.value.title.text?It.value:null,legend:R.value.legend.show?Lt.value:null,source:Rt.value,noTitle:zt.value,padding:R.value.padding});requestAnimationFrame(()=>{Gt.value=t,V.value=e.length?n/e.length:0,qt.value=n-12})});E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect()),E.value=new ResizeObserver(t),D.value=T.value?.parentNode||null,D.value&&E.value.observe(D.value)}}Xe(()=>{E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect())});let{isPrinting:cn,isImaging:ln,generatePdf:un,generateImage:dn}=Ae({elementId:`vue-ui-ridgeline_${O.value}`,fileName:R.value.title.text||`vue-ui-ridgeline`,options:M.value.userOptions.print}),fn=u(()=>M.value.userOptions.show&&!R.value.title.text),pn=u(()=>ue(M.value.customPalette)),U=v({showTable:M.value.table.show});et(()=>B.value,async e=>{Array.isArray(e)&&e.length&&(nn.value=!M.value.userOptions.showOnChartHover,await qe(),sn(),Bt.value+=1,Ht.value+=1,U.value.showTable=M.value.table.show)},{deep:!0,immediate:!0}),et(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(tn.value=!1)},{deep:!0}),et(()=>en.value,async e=>{e||(await qe(),sn())},{immediate:!0}),et(()=>w.config,()=>{M.value=Qt(B.value||null),nn.value=!M.value.userOptions.showOnChartHover,V.value=Math.min(P.value.height,P.value.rowHeight),U.value.showTable=M.value.table.show,Bt.value+=1,Ht.value+=1},{deep:!0});let mn=u(()=>P.value.height/P.value.rowHeight);function hn(){X.value.length?X.value=[]:Z.value.forEach(e=>{X.value.push(e.id)}),Ft(`selectLegend`,Y.value)}function gn(e){X.value.includes(e)?X.value=X.value.filter(t=>t!==e):X.value.push(e),Ft(`selectLegend`,Y.value)}function _n(e){return Z.value.length?Z.value.find(t=>t.name===e)||(on.value&&console.warn(`VueUiRidgeline - Series name not found "${e}"`),null):(on.value&&console.warn(`VueUiRidgeline - There are no series to show.`),null)}function vn(e){let t=_n(e);t!==null&&X.value.includes(t.id)&&gn(t.id)}function yn(e){let t=_n(e);t!==null&&(X.value.includes(t.id)||gn(t.id))}let W=u(()=>Pt.value?(B.value||[]).map(e=>({...e,labelLen:Nn(e.name,L.value.fontSize),uid:re(),datapoints:e.datapoints.map((e,t)=>{let n=e.color?o(e.color):pn.value[t]||i[t]||i[t%i.length],r=ie(e.name);return{...e,color:n,id:r}})})):[]),bn=u(()=>R.value.padding.top+V.value*(B.value||[]).length+V.value*mn.value+R.value.padding.bottom),G=u(()=>{let e=R.value.padding;return{width:Gt.value,height:bn.value,padding:e}}),xn=u(()=>G.value.width),Sn=u(()=>G.value.height),Cn=v(0),wn=Ne(e=>{Cn.value=e},100);tt(e=>{let t=Jt.value;if(!t)return;let n=new ResizeObserver(e=>{wn(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Xe(()=>{Cn.value=0});let K=u(()=>({fullHeight:G.value.height+Cn.value,top:G.value.padding.top,left:G.value.padding.left,right:G.value.width-G.value.padding.right,bottom:G.value.height-R.value.padding.bottom,width:G.value.width-(G.value.padding.left+G.value.padding.right)})),Tn=u(()=>Math.max(...W.value.flatMap(e=>e.datapoints.map(e=>e.values.length)))),q=v([]),En=0;tt(()=>{let e=++En;(async()=>{let t=await ke({values:I.value.values,maxDatapoints:Tn.value,formatter:I.value.datetimeFormatter,start:0,end:I.value.values.length});e===En&&(q.value=t)})()});let J=u(()=>{let e=Math.max(...W.value.map(e=>e.labelLen)),t=G.value.padding.left+e+16+L.value.offsetX,n=(K.value.width-t)/Tn.value,r=[];for(let e=0;e<Tn.value;e+=1)r.push({selectorX:t+n*e,x:t+n*e-n/2,y:K.value.top,label:I.value.values[e]?q.value[e]?.text??``:``,index:e,width:n,height:bn.value});return r});function Dn(e){return W.value.map(t=>t.datapoints.map(t=>({dp:t,selected:t.values[e.index]})))}function On(e){k.value=e;let t=Dn(e);M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:e.index})}function kn(e){k.value=null;let t=Dn(e);M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:t,seriesIndex:e.index})}function An(e){let t=Dn(e);M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:e.index}),Ft(`selectX`,t)}function jn(e,t){return e.length*t/2+t}function Mn(e,t,n){return e+jn(t,n)>K.value.right}function Nn(e,t,n=`sans-serif`){let r=document.createElement(`canvas`).getContext(`2d`);return r.font=`${typeof t==`number`?`${t}px`:t} ${n}`,r.measureText(e).width}let Y=u(()=>{V.value;let e=Math.max(...W.value.map(e=>e.labelLen)),t=Math.max(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),n=Math.min(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),r=G.value.padding.left+e+16+L.value.offsetX,i=(K.value.width-r)/Tn.value,a=Math.abs(Math.min(n,0)),o=t+a;function ie(e){return isNaN(e/o)?0:e/o}return W.value.map((e,t)=>{let n=V.value*mn.value*(1-ie(a)),o=K.value.top+V.value*t,s=K.value.top+o+n;return{...e,label:{x:r-L.value.fontSize,y:(L.value.centered?s-n/2:s)+L.value.offsetY},datapoints:e.datapoints.map(e=>{let t=e.values.map((t,n)=>{let ee=isNaN(t)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(t)?0:t||0;return{x:r+i*n,y:K.value.top+o+V.value*mn.value*(1-ie(ee+a)),value:t,isMaxPoint:t===Math.max(...e.values),zero:s}}),n=`${ee(t,s,!1,!1)}`,c=`M ${r},${s} ${ne(t)} ${t.at(-1).x},${s}`,ae=`M ${r},${s} ${t.at(-1).x},${s}`,oe=`M ${te(t)}`,se=`M ${ne(t)}`,ce=de(P.value.smooth?oe:se);return{...e,uid:re(),plots:t,smoothPath:n,straightPath:c,zeroPath:ae,pathLength:ce,smoothPathRidge:oe,straightPathRidge:se}}).filter(e=>!X.value.includes(e.id))}})}),X=v([]);function Pn(e){let t=/* @__PURE__ */ new Map;return e.forEach(e=>{e.datapoints.forEach((e,n)=>{let r=ie(e.name);t.has(r)||t.set(r,{id:r,name:e.name,color:e.color,shape:`circle`,segregate:()=>gn(r),isSegregated:X.value.includes(r),opacity:X.value.includes(r)?.5:1})})}),Array.from(t.values())}let Z=u(()=>Pn(W.value)),Fn=u(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),Q=v(!1);function In(e){Q.value=e,Ut.value+=1}let Ln=v({}),Rn=v([]);function zn(e){Ft(`selectDatapoint`,e),R.value.dialog.show&&(Rn.value=e.datapoints.map(e=>({name:e.name,color:e.color,type:`line`,useArea:!0,smooth:P.value.smooth,series:e.values})),A.value=e,Ln.value=le({...R.value.dialog.xyChart,responsive:!0,chart:{...R.value.dialog.xyChart.chart,grid:{...R.value.dialog.xyChart.chart.grid,labels:{...R.value.dialog.xyChart.chart.grid.labels,xAxisLabels:{...R.value.dialog.xyChart.chart.grid.labels.xAxisLabels,values:I.value.values,autoRotate:{enable:!0,angle:R.value.dialog.xyChart.chart.grid.labels.xAxisLabels.autoRotate.angle},datetimeFormatter:I.value.datetimeFormatter}}},tooltip:{...R.value.dialog.xyChart.chart.tooltip,showTimeLabel:I.value.values.length>0},userOptions:{...R.value.dialog.xyChart.chart.userOptions,buttons:{...R.value.dialog.xyChart.chart.userOptions.buttons,altCopy:M.value.userOptions.buttons.altCopy},callbacks:{...R.value.dialog.xyChart.chart.userOptions.callbacks,altCopy:()=>{}},useCursorPointer:M.value.userOptions.useCursorPointer}}}),Kt.value&&Kt.value.open())}let Bn=v(null);function Vn(e){Bn.value=e}function Hn(){Bn.value=null}let Un=v(!1);function Wn(){Un.value=!Un.value}function Gn(){U.value.showTable=!U.value.showTable}let Kn=u(()=>({body:Y.value.flatMap(e=>e.datapoints.flatMap(t=>({...t,rowName:`${e.name}: ${t.name}`}))).map(e=>[{name:e.rowName,color:e.color},...e.values])})),$=u(()=>{let e=[M.value.table.columnNames.series,...q.value.map(e=>e.text)],t={th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint};return{colNames:[M.value.table.columnNames.series,...q.value.map(e=>e.text)],head:e,body:Kn.value.body,config:t}});function qn(e=null){qe(()=>{let t=[[M.value.table.columnNames.series,...q.map(e=>[e.text])],...Kn.value.body.map((e,t)=>[e[0].name,...e.slice(1)])],n=[[R.value.title.text],[R.value.title.subtitle.text]].concat(t),i=r(n);e?e(i):oe({csvContent:i,title:R.value.title.text||`vue-ui-ridgeline`})})}function Jn(){return Y.value}let Yn=be(T,()=>R.value.title.text),Xn=u(()=>({min:0,max:Tn.value}));je({timeLabelsEls:Jt,timeLabels:q,slicer:Xn,configRef:M,rotationPath:[`style`,`chart`,`xAxis`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`xAxis`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:xn,height:Sn,targetClass:`.vue-ui-ridgeline-x-axis-label`,angle:I.value.autoRotate.angle});let Zn=u(()=>we({config:M,style:R,mutableConfig:U,dialog:Mt,accordion:Dt,isFullscreen:Q,parent:T,maxWidth:800,isCursorPointer:z}));et(()=>U.value.showTable,e=>Ce(e,M,Yt));function Qn(){U.value.showTable=!1,Xt.value&&Xt.value.setTableIconState(!1)}let $n=u(()=>R.value.backgroundColor),er=u(()=>({...R.value.legend,position:`bottom`})),tr=u(()=>R.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Se({svg:H,title:tr,legend:er,legendItems:Z,backgroundColor:$n,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:dn});function or(e){sr(`xy-zoom`,e.dataset,e.config)}async function sr(e=`main-chart`,t=null,n=null){Ft(`copyAlt`,{source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function cr(){j.value=null,Zt.value=!0}function lr(){pr(),Zt.value=!1}function ur(e){if(!H.value||Un.value||document.activeElement!==H.value||!Y.value.length)return;let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,ee=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!ee)return;if(e.preventDefault(),e.stopPropagation(),ee){pr();return}if(a){if(j.value!==null){let e=Y.value[j.value];e&&zn(e);return}k.value&&An(k.value);return}if(t||n){let e=j.value;e=e===null?n?0:Y.value.length-1:dr(e+(n?1:-1)),j.value=e,Bn.value=e;return}if(!J.value.length)return;let te=k.value?.index??null;te=te===null?i?0:J.value.length-1:fr(te+(i?1:-1));let o=J.value[te];o&&On(o)}function dr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function fr(e){let t=J.value.length;return t?(e%t+t)%t:null}function pr(){j.value=null,Bn.value=null,k.value?kn(k.value):k.value=null}let mr=u(()=>({head:$.value.head,body:$.value.body.map(e=>[e[0]?.name??``,...e.slice(1)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable}));return ve({getData:Jn,getImage:Yn,generateImage:dn,generateSvg:ir,generatePdf:un,generateCsv:qn,hideSeries:yn,showSeries:vn,toggleAnnotator:Wn,toggleTable:Gn,toggleFullscreen:In,copyAlt:sr}),(e,t)=>(_(),p(`div`,{ref_key:`ridgelineChart`,ref:T,class:Je(`vue-data-ui-component vue-ui-ridgeline ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),id:`vue-ui-ridgeline_${O.value}`,style:g({fontFamily:M.value.style.fontFamily,width:`100%`,textAlign:`center`,background:R.value.backgroundColor,height:M.value.responsive?`100%`:void 0}),onMouseenter:t[3]||=()=>S(rn)(!0),onMouseleave:t[4]||=()=>S(rn)(!1)},[m(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[m(`p`,null,x(M.value.a11y.translations.keyboardNavigation),1)],8,it),mr.value.body.length?(_(),d(Le,{key:0,uid:O.value,head:mr.value.head,body:mr.value.body,caption:mr.value.caption,notice:mr.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):f(``,!0),N.value.buttons.annotator&&S(H)?(_(),d(S(kt),{key:1,color:R.value.color,backgroundColor:R.value.backgroundColor,active:Un.value,svgRef:S(H),isCursorPointer:z.value,onClose:Wn},He({_:2},[y(S(Ee),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Te)(t,n))),void 0,!0)])}))]),1032,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`])):f(``,!0),b(e.$slots,`userConfig`,{},void 0,!0),fn.value?(_(),p(`div`,{key:2,ref_key:`noTitle`,ref:zt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),R.value.title.text?(_(),p(`div`,{key:3,ref_key:`chartTitle`,ref:It,style:`width:100%;background:transparent;padding-bottom:24px`},[(_(),d(xe,{key:`title_${Bt.value}`,config:{title:{cy:`ridgeline-div-title`,...R.value.title},subtitle:{cy:`ridgeline-div-subtitle`,...R.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),N.value.show&&Pt.value&&(S(an)||S(nn))?(_(),d(S(At),{ref_key:`userOptionsRef`,ref:Xt,key:`user_option_${Ut.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:S(cn),isImaging:S(ln),uid:O.value,hasTooltip:!1,callbacks:N.value.callbacks,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasLabel:!1,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:Q.value,printScale:N.value.print.scale,chartElement:T.value,position:N.value.position,isTooltip:!1,titles:{...N.value.buttonTitles},hasAnnotator:N.value.buttons.annotator,isAnnotation:Un.value,tableDialog:M.value.table.useDialog,style:g({visibility:S(an)?S(nn)?`visible`:`hidden`:`visible`}),isCursorPointer:z.value,onToggleFullscreen:In,onGeneratePdf:S(un),onGenerateCsv:qn,onGenerateImage:S(ar),onGenerateSvg:S(ir),onToggleTable:Gn,onToggleAnnotator:Wn,onCopyAlt:sr},He({_:2},[y(S(De)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Oe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.callbacks.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.printScale.chartElement.position.titles.hasAnnotator.isAnnotation.tableDialog.style.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg`.split(`.`))):f(``,!0),m(`div`,at,[(_(),p(`svg`,{ref_key:`svgRef`,ref:H,xmlns:S(ce),"aria-describedby":`chart-instructions-${O.value}`,class:Je({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${K.value.fullHeight<=0?10:K.value.fullHeight}`,style:g(`max-width:100%;overflow:visible;background:transparent;color:${R.value.color};${M.value.responsive?`height: ${qt.value}px; width: 100%;`:``}`),tabindex:`0`,onFocus:cr,onBlur:lr,onKeydown:ur},[We(S(jt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(cn)||S(ln)||S(nr),isPrintingSvg:S(rr),data:Y.value}},void 0,!0),m(`defs`,null,[(_(!0),p(l,null,y(Z.value,(e,t)=>(_(),d(Fe,{t:`linear`,id:`gradient-${e.id}-${O.value}`,key:`gradient-${e.id}-${O.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128)),(_(!0),p(l,null,y(Y.value,(e,t)=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,(e,t)=>(_(),d(Fe,{t:`linear`,key:`grad${e.id}`,id:`gradient-single-${O.value}-${e.uid}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128))],64))),256))]),(_(!0),p(l,null,y(Y.value,(t,n)=>(_(),p(`g`,{key:`ds-${n}`},[(_(!0),p(l,null,y(t.datapoints,(t,r)=>(_(),p(`g`,{key:t.id},[e.$slots.pattern?(_(),p(`g`,st,[m(`defs`,null,[b(e.$slots,`pattern`,Ke({ref_for:!0},{datapointIndex:n,seriesIndex:r,patternId:`pattern_${O.value}_${t.uid}`}),void 0,!0)])])):f(``,!0),m(`path`,{fill:e.$slots.pattern?`url(#pattern_${O.value}_${t.uid})`:R.value.backgroundColor,stroke:`none`,"stroke-linecap":`round`,d:P.value.smooth?t.smoothPath:t.straightPath,style:g({opacity:P.value.opacity})},null,12,ct),m(`path`,{fill:`none`,stroke:P.value.stroke.useSerieColor?t.color:P.value.stroke.color,"stroke-width":P.value.strokeWidth,d:P.value.smooth?t.smoothPathRidge:t.straightPathRidge,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,lt),m(`path`,{fill:P.value.useGradient?P.value.useCommonColor?`url(#gradient-${t.id}-${O.value})`:`url(#gradient-single-${O.value}-${t.uid})`:t.color,stroke:`none`,d:P.value.smooth?t.smoothPath:t.straightPath,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,ut),R.value.zeroLine.show?(_(),p(`path`,{key:1,stroke:R.value.zeroLine.useSerieColor?t.color:R.value.zeroLine.stroke,"stroke-dasharray":R.value.zeroLine.strokeDasharray,"stroke-width":R.value.zeroLine.strokeWidth,d:t.zeroPath,"stroke-linecap":`round`},null,8,dt)):f(``,!0),P.value.maxPoint.show&&t.plots.length>1?(_(!0),p(l,{key:2},y(t.plots,e=>(_(),p(l,null,[e.isMaxPoint?(_(),p(`line`,{key:0,x1:e.x,y1:e.y,x2:e.x,y2:e.zero,stroke:P.value.maxPoint.adaptStrokeToBackground?S(se)(t.color):P.value.maxPoint.stroke,"stroke-width":P.value.maxPoint.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":P.value.maxPoint.strokeDasharray},null,8,ft)):f(``,!0)],64))),256)):f(``,!0),t.plots.length===1?(_(),p(`circle`,{key:3,cx:t.plots[0].x,cy:t.plots[0].y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?t.color:F.value.dot.fill,style:{pointerEvents:`none`}},null,8,pt)):f(``,!0)]))),128)),m(`text`,{x:t.label.x,y:t.label.y,"text-anchor":`end`,"font-size":L.value.fontSize,"font-weight":L.value.bold?`bold`:`normal`,fill:L.value.color,style:g({cursor:R.value.dialog.show&&z.value?`pointer`:`default`}),"text-decoration":R.value.dialog.show&&(Bn.value===n||A.value&&t.uid===A.value.uid||j.value===n)?`underline`:``,"dominant-baseline":`middle`,onMouseenter:e=>Vn(n),onMouseleave:Hn,onClick:e=>zn(t)},x(t.name),45,mt)]))),128)),I.value.values.length?(_(),p(`g`,{key:0,ref_key:`timeLabelsEls`,ref:Jt},[(_(!0),p(l,null,y(J.value,(t,n)=>b(e.$slots,`time-label`,Ke({ref_for:!0},{show:t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0,fontSize:I.value.fontSize,content:t.label,textAnchor:I.value.rotation>0?`start`:I.value.rotation<0?`end`:`middle`,fill:I.value.color,transform:`translate(${t.selectorX}, ${K.value.top+t.height+I.value.offsetY}), rotate(${I.value.rotation})`,x:t.selectorX,y:K.value.bottom+I.value.offsetY}),()=>[t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0?(_(),p(`g`,ht,[String(t.label).includes(`
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,J as a,N as ee,P as te,S as o,U as ne,X as re,Xt as ie,at as s,i as c,in as ae,nt as oe,r as se,t as ce,tt as le,w as ue,xt as de,yt as fe,zt as pe}from"./lib-rPeBMZrn.js";import{n as me,t as he}from"./BaseScanner-8NdoBs7B.js";import{n as ge,t as _e}from"./useHints-BH9r_0Vd.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ye}from"./resolveChartConfig-CIhClE5R.js";import{t as be}from"./chartImage-DPGnEuYM.js";import{n as xe}from"./Title-BliHuXfT.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{n as Ce,t as we}from"./tableIntegration-CNoJ1CIY.js";import{n as Te,t as Ee}from"./annotationSlots-BRR85CqJ.js";import{n as De,t as Oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-sVoTzet1.js";import{t as je}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Me}from"./Shape-CRe8woTu.js";import{c as Ne}from"./canvas-lib-22VpOI4_.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./Legend-DM0ClX3D.js";import{t as Ve}from"./vue_ui_ridgeline-Di26JtQu.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as He,createTextVNode as Ue,createVNode as We,defineAsyncComponent as h,guardReactiveProps as Ge,mergeProps as Ke,nextTick as qe,normalizeClass as Je,normalizeProps as Ye,normalizeStyle as g,onBeforeUnmount as Xe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as Ze,shallowRef as Qe,toDisplayString as x,toRefs as $e,unref as S,watch as et,watchEffect as tt,withCtx as C}from"vue";var nt=/* @__PURE__ */ e({default:()=>Tt}),rt=[`id`],it=[`id`],at={style:{position:`relative`}},ot=[`xmlns`,`aria-describedby`,`viewBox`],st={key:0},ct=[`fill`,`d`],lt=[`stroke`,`stroke-width`,`d`],ut=[`fill`,`d`],dt=[`stroke`,`stroke-dasharray`,`stroke-width`,`d`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],pt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],mt=[`x`,`y`,`font-size`,`font-weight`,`fill`,`text-decoration`,`onMouseenter`,`onClick`],ht={key:0},gt=[`font-size`,`fill`,`stroke`,`font-weight`,`transform`,`text-anchor`],_t=[`font-size`,`fill`,`font-weight`,`transform`,`text-anchor`,`innerHTML`],vt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],bt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],xt=[`x`,`y`,`stroke`,`text-anchor`,`font-size`,`fill`],St={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ct={key:5,class:`vue-data-ui-watermark`},wt=[`onClick`],Tt=/*#__PURE__*/ ve({__name:`vue-ui-ridgeline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`selectX`,`copyAlt`],setup(e,{expose:ve,emit:nt}){let Tt=h(()=>import(`./vue-ui-xy-6B_K-quN.js`).then(e=>e.n)),Et=h(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Dt=h(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Ot=h(()=>import(`./DataTable-0Vv-aGHD.js`)),kt=h(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),At=h(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),jt=h(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),Mt=h(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_ridgeline:Nt}=t(),w=e,Pt=u({get(){return Array.isArray(B.value)&&B.value.length>0},set(e){return e}}),Ft=nt,T=v(null),It=v(null),Lt=v(null),E=Qe(null),D=Qe(null),Rt=v(null),zt=v(null),Bt=v(0),Vt=v(0),Ht=v(0),O=v(re()),Ut=v(0),Wt=v(0),Gt=v(512),k=v(null),A=v(null),Kt=v(null),qt=v(0),Jt=v(null),Yt=v(null),Xt=v(null),j=v(null),Zt=v(!1);function Qt(){return ye(w.config,Nt,Ve)}let M=v(Qt()),N=u(()=>M.value.userOptions),P=u(()=>M.value.style.chart.areas),F=u(()=>M.value.style.chart.selector),I=u(()=>M.value.style.chart.xAxis.labels),L=u(()=>M.value.style.chart.yAxis.labels),R=u(()=>M.value.style.chart);ge({config:()=>M.value,dataset:()=>w.dataset,component:`VueUiRidgeline`,rules:[_e.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display`,``,`▶️ Use several instances of the component to show related series`]},{test:e=>e.some(e=>e.datapoints.some(e=>e.values.length>200)),message:[`👀 Some series contain > 200 data points, which can affect performance. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values.`,``,`▶️ Filter the time range by adding date inputs in your UI.`]},{test:e=>e.length<6&&e.length>0,message:[`👀 The number of series < 6. Consider:`,``,`▶️ Using VueUiXy instead`]}]});let z=u(()=>M.value.userOptions.useCursorPointer),$t=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,areas:{maxPoint:{show:!1},opacity:.9,stroke:{useSerieColor:!0}},legend:{backgroundColor:`transparent`},padding:{right:-24,left:0},xAxis:{labels:{values:[]}},yAxis:{labels:{fontSize:0}},zeroLine:{show:!1}}}},userConfig:M.value.skeletonConfig??{}})),{loading:en,FINAL_DATASET:B,manualLoading:tn}=me({...$e(w),FINAL_CONFIG:M,prepareConfig:Qt,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,datapoints:[{name:`__`,color:`#999999`,values:[28.639,32.04,41.134,44.525,21.151,2.436,.218,.024,.002,0,0,0]},{name:`_`,color:`#CACACA`,values:[13.253,15.621,23.36,33.698,29.935,10.874,2.364,.561,.107,.02,.006,.004]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[10.851,13.195,21.617,36.556,42.292,21.006,3.398,.223,.013,.001,0,0]},{name:`_`,color:`#CACACA`,values:[3.171,4.115,8.108,18.248,31.641,29.063,12.031,2.742,.504,.102,.032,.021]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[1.731,2.334,5.125,13.626,29.911,38.524,24.168,7.646,1.575,.317,.097,.063]},{name:`_`,color:`#CACACA`,values:[.25,.367,1.026,3.944,13.635,28.891,30.149,15.419,4.714,1.246,.442,.299]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[.034,.054,.194,1.065,5.747,20.735,38.306,32.899,15.318,5.566,2.422,1.76]},{name:`_`,color:`#CACACA`,values:[.001,.002,.009,.095,1.124,8.342,27.115,35.08,21.449,9.093,4.243,3.143]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,.001,.004,.051,.567,3.322,14.215,44.783,40.351,20.377,9.866,7.378]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,.001,.11,4.136,27.498,43.24,29.807,17.345,13.678]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,0,0,0,.025,.598,3.886,10.645,54.479,45.953,30.814,24.55]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,0,0,.007,1.655,26.63,52.017,45.192,39.651]}]}],skeletonConfig:ae({defaultConfig:M.value,userConfig:$t.value})}),V=v(Math.min(P.value.height,P.value.rowHeight)),{userOptionsVisible:nn,setUserOptionsVisibility:rn,keepUserOptionState:an}=Re({config:M.value}),{svgRef:H}=ze({config:R.value.title}),on=u(()=>M.value.debug);function sn(){let e=B.value||[];if(!Array.isArray(e)||e.length===0)s({componentName:`VueUiRidgeline`,type:`dataset`,debug:on.value}),tn.value=!0;else if(e.forEach((e,t)=>{fe({datasetObject:e,requiredAttributes:[`name`,`datapoints`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:e,index:t,debug:on.value})}),Array.isArray(e.datapoints)&&e.datapoints.length&&e.datapoints.forEach((e,n)=>{fe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:`datapoint.${e}`,index:`${t}-${n}`,debug:on.value})})})}),Wt.value=e.length,V.value=Math.min(P.value.height,P.value.rowHeight),pe(w.dataset)||(tn.value=M.value.loading),M.value.responsive){let t=Ne(()=>{let{width:t,height:n}=Pe({chart:T.value,title:R.value.title.text?It.value:null,legend:R.value.legend.show?Lt.value:null,source:Rt.value,noTitle:zt.value,padding:R.value.padding});requestAnimationFrame(()=>{Gt.value=t,V.value=e.length?n/e.length:0,qt.value=n-12})});E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect()),E.value=new ResizeObserver(t),D.value=T.value?.parentNode||null,D.value&&E.value.observe(D.value)}}Xe(()=>{E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect())});let{isPrinting:cn,isImaging:ln,generatePdf:un,generateImage:dn}=Ae({elementId:`vue-ui-ridgeline_${O.value}`,fileName:R.value.title.text||`vue-ui-ridgeline`,options:M.value.userOptions.print}),fn=u(()=>M.value.userOptions.show&&!R.value.title.text),pn=u(()=>ue(M.value.customPalette)),U=v({showTable:M.value.table.show});et(()=>B.value,async e=>{Array.isArray(e)&&e.length&&(nn.value=!M.value.userOptions.showOnChartHover,await qe(),sn(),Bt.value+=1,Ht.value+=1,U.value.showTable=M.value.table.show)},{deep:!0,immediate:!0}),et(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(tn.value=!1)},{deep:!0}),et(()=>en.value,async e=>{e||(await qe(),sn())},{immediate:!0}),et(()=>w.config,()=>{M.value=Qt(B.value||null),nn.value=!M.value.userOptions.showOnChartHover,V.value=Math.min(P.value.height,P.value.rowHeight),U.value.showTable=M.value.table.show,Bt.value+=1,Ht.value+=1},{deep:!0});let mn=u(()=>P.value.height/P.value.rowHeight);function hn(){X.value.length?X.value=[]:Z.value.forEach(e=>{X.value.push(e.id)}),Ft(`selectLegend`,Y.value)}function gn(e){X.value.includes(e)?X.value=X.value.filter(t=>t!==e):X.value.push(e),Ft(`selectLegend`,Y.value)}function _n(e){return Z.value.length?Z.value.find(t=>t.name===e)||(on.value&&console.warn(`VueUiRidgeline - Series name not found "${e}"`),null):(on.value&&console.warn(`VueUiRidgeline - There are no series to show.`),null)}function vn(e){let t=_n(e);t!==null&&X.value.includes(t.id)&&gn(t.id)}function yn(e){let t=_n(e);t!==null&&(X.value.includes(t.id)||gn(t.id))}let W=u(()=>Pt.value?(B.value||[]).map(e=>({...e,labelLen:Nn(e.name,L.value.fontSize),uid:re(),datapoints:e.datapoints.map((e,t)=>{let n=e.color?o(e.color):pn.value[t]||i[t]||i[t%i.length],r=ie(e.name);return{...e,color:n,id:r}})})):[]),bn=u(()=>R.value.padding.top+V.value*(B.value||[]).length+V.value*mn.value+R.value.padding.bottom),G=u(()=>{let e=R.value.padding;return{width:Gt.value,height:bn.value,padding:e}}),xn=u(()=>G.value.width),Sn=u(()=>G.value.height),Cn=v(0),wn=Ne(e=>{Cn.value=e},100);tt(e=>{let t=Jt.value;if(!t)return;let n=new ResizeObserver(e=>{wn(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Xe(()=>{Cn.value=0});let K=u(()=>({fullHeight:G.value.height+Cn.value,top:G.value.padding.top,left:G.value.padding.left,right:G.value.width-G.value.padding.right,bottom:G.value.height-R.value.padding.bottom,width:G.value.width-(G.value.padding.left+G.value.padding.right)})),Tn=u(()=>Math.max(...W.value.flatMap(e=>e.datapoints.map(e=>e.values.length)))),q=v([]),En=0;tt(()=>{let e=++En;(async()=>{let t=await ke({values:I.value.values,maxDatapoints:Tn.value,formatter:I.value.datetimeFormatter,start:0,end:I.value.values.length});e===En&&(q.value=t)})()});let J=u(()=>{let e=Math.max(...W.value.map(e=>e.labelLen)),t=G.value.padding.left+e+16+L.value.offsetX,n=(K.value.width-t)/Tn.value,r=[];for(let e=0;e<Tn.value;e+=1)r.push({selectorX:t+n*e,x:t+n*e-n/2,y:K.value.top,label:I.value.values[e]?q.value[e]?.text??``:``,index:e,width:n,height:bn.value});return r});function Dn(e){return W.value.map(t=>t.datapoints.map(t=>({dp:t,selected:t.values[e.index]})))}function On(e){k.value=e;let t=Dn(e);M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:e.index})}function kn(e){k.value=null;let t=Dn(e);M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:t,seriesIndex:e.index})}function An(e){let t=Dn(e);M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:e.index}),Ft(`selectX`,t)}function jn(e,t){return e.length*t/2+t}function Mn(e,t,n){return e+jn(t,n)>K.value.right}function Nn(e,t,n=`sans-serif`){let r=document.createElement(`canvas`).getContext(`2d`);return r.font=`${typeof t==`number`?`${t}px`:t} ${n}`,r.measureText(e).width}let Y=u(()=>{V.value;let e=Math.max(...W.value.map(e=>e.labelLen)),t=Math.max(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),n=Math.min(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),r=G.value.padding.left+e+16+L.value.offsetX,i=(K.value.width-r)/Tn.value,a=Math.abs(Math.min(n,0)),o=t+a;function ie(e){return isNaN(e/o)?0:e/o}return W.value.map((e,t)=>{let n=V.value*mn.value*(1-ie(a)),o=K.value.top+V.value*t,s=K.value.top+o+n;return{...e,label:{x:r-L.value.fontSize,y:(L.value.centered?s-n/2:s)+L.value.offsetY},datapoints:e.datapoints.map(e=>{let t=e.values.map((t,n)=>{let ee=isNaN(t)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(t)?0:t||0;return{x:r+i*n,y:K.value.top+o+V.value*mn.value*(1-ie(ee+a)),value:t,isMaxPoint:t===Math.max(...e.values),zero:s}}),n=`${ee(t,s,!1,!1)}`,c=`M ${r},${s} ${ne(t)} ${t.at(-1).x},${s}`,ae=`M ${r},${s} ${t.at(-1).x},${s}`,oe=`M ${te(t)}`,se=`M ${ne(t)}`,ce=de(P.value.smooth?oe:se);return{...e,uid:re(),plots:t,smoothPath:n,straightPath:c,zeroPath:ae,pathLength:ce,smoothPathRidge:oe,straightPathRidge:se}}).filter(e=>!X.value.includes(e.id))}})}),X=v([]);function Pn(e){let t=/* @__PURE__ */ new Map;return e.forEach(e=>{e.datapoints.forEach((e,n)=>{let r=ie(e.name);t.has(r)||t.set(r,{id:r,name:e.name,color:e.color,shape:`circle`,segregate:()=>gn(r),isSegregated:X.value.includes(r),opacity:X.value.includes(r)?.5:1})})}),Array.from(t.values())}let Z=u(()=>Pn(W.value)),Fn=u(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),Q=v(!1);function In(e){Q.value=e,Ut.value+=1}let Ln=v({}),Rn=v([]);function zn(e){Ft(`selectDatapoint`,e),R.value.dialog.show&&(Rn.value=e.datapoints.map(e=>({name:e.name,color:e.color,type:`line`,useArea:!0,smooth:P.value.smooth,series:e.values})),A.value=e,Ln.value=le({...R.value.dialog.xyChart,responsive:!0,chart:{...R.value.dialog.xyChart.chart,grid:{...R.value.dialog.xyChart.chart.grid,labels:{...R.value.dialog.xyChart.chart.grid.labels,xAxisLabels:{...R.value.dialog.xyChart.chart.grid.labels.xAxisLabels,values:I.value.values,autoRotate:{enable:!0,angle:R.value.dialog.xyChart.chart.grid.labels.xAxisLabels.autoRotate.angle},datetimeFormatter:I.value.datetimeFormatter}}},tooltip:{...R.value.dialog.xyChart.chart.tooltip,showTimeLabel:I.value.values.length>0},userOptions:{...R.value.dialog.xyChart.chart.userOptions,buttons:{...R.value.dialog.xyChart.chart.userOptions.buttons,altCopy:M.value.userOptions.buttons.altCopy},callbacks:{...R.value.dialog.xyChart.chart.userOptions.callbacks,altCopy:()=>{}},useCursorPointer:M.value.userOptions.useCursorPointer}}}),Kt.value&&Kt.value.open())}let Bn=v(null);function Vn(e){Bn.value=e}function Hn(){Bn.value=null}let Un=v(!1);function Wn(){Un.value=!Un.value}function Gn(){U.value.showTable=!U.value.showTable}let Kn=u(()=>({body:Y.value.flatMap(e=>e.datapoints.flatMap(t=>({...t,rowName:`${e.name}: ${t.name}`}))).map(e=>[{name:e.rowName,color:e.color},...e.values])})),$=u(()=>{let e=[M.value.table.columnNames.series,...q.value.map(e=>e.text)],t={th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint};return{colNames:[M.value.table.columnNames.series,...q.value.map(e=>e.text)],head:e,body:Kn.value.body,config:t}});function qn(e=null){qe(()=>{let t=[[M.value.table.columnNames.series,...q.map(e=>[e.text])],...Kn.value.body.map((e,t)=>[e[0].name,...e.slice(1)])],n=[[R.value.title.text],[R.value.title.subtitle.text]].concat(t),i=r(n);e?e(i):oe({csvContent:i,title:R.value.title.text||`vue-ui-ridgeline`})})}function Jn(){return Y.value}let Yn=be(T,()=>R.value.title.text),Xn=u(()=>({min:0,max:Tn.value}));je({timeLabelsEls:Jt,timeLabels:q,slicer:Xn,configRef:M,rotationPath:[`style`,`chart`,`xAxis`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`xAxis`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:xn,height:Sn,targetClass:`.vue-ui-ridgeline-x-axis-label`,angle:I.value.autoRotate.angle});let Zn=u(()=>we({config:M,style:R,mutableConfig:U,dialog:Mt,accordion:Dt,isFullscreen:Q,parent:T,maxWidth:800,isCursorPointer:z}));et(()=>U.value.showTable,e=>Ce(e,M,Yt));function Qn(){U.value.showTable=!1,Xt.value&&Xt.value.setTableIconState(!1)}let $n=u(()=>R.value.backgroundColor),er=u(()=>({...R.value.legend,position:`bottom`})),tr=u(()=>R.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Se({svg:H,title:tr,legend:er,legendItems:Z,backgroundColor:$n,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:dn});function or(e){sr(`xy-zoom`,e.dataset,e.config)}async function sr(e=`main-chart`,t=null,n=null){Ft(`copyAlt`,{source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function cr(){j.value=null,Zt.value=!0}function lr(){pr(),Zt.value=!1}function ur(e){if(!H.value||Un.value||document.activeElement!==H.value||!Y.value.length)return;let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,ee=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!ee)return;if(e.preventDefault(),e.stopPropagation(),ee){pr();return}if(a){if(j.value!==null){let e=Y.value[j.value];e&&zn(e);return}k.value&&An(k.value);return}if(t||n){let e=j.value;e=e===null?n?0:Y.value.length-1:dr(e+(n?1:-1)),j.value=e,Bn.value=e;return}if(!J.value.length)return;let te=k.value?.index??null;te=te===null?i?0:J.value.length-1:fr(te+(i?1:-1));let o=J.value[te];o&&On(o)}function dr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function fr(e){let t=J.value.length;return t?(e%t+t)%t:null}function pr(){j.value=null,Bn.value=null,k.value?kn(k.value):k.value=null}let mr=u(()=>({head:$.value.head,body:$.value.body.map(e=>[e[0]?.name??``,...e.slice(1)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable}));return ve({getData:Jn,getImage:Yn,generateImage:dn,generateSvg:ir,generatePdf:un,generateCsv:qn,hideSeries:yn,showSeries:vn,toggleAnnotator:Wn,toggleTable:Gn,toggleFullscreen:In,copyAlt:sr}),(e,t)=>(_(),p(`div`,{ref_key:`ridgelineChart`,ref:T,class:Je(`vue-data-ui-component vue-ui-ridgeline ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),id:`vue-ui-ridgeline_${O.value}`,style:g({fontFamily:M.value.style.fontFamily,width:`100%`,textAlign:`center`,background:R.value.backgroundColor,height:M.value.responsive?`100%`:void 0}),onMouseenter:t[3]||=()=>S(rn)(!0),onMouseleave:t[4]||=()=>S(rn)(!1)},[m(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[m(`p`,null,x(M.value.a11y.translations.keyboardNavigation),1)],8,it),mr.value.body.length?(_(),d(Le,{key:0,uid:O.value,head:mr.value.head,body:mr.value.body,caption:mr.value.caption,notice:mr.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):f(``,!0),N.value.buttons.annotator&&S(H)?(_(),d(S(kt),{key:1,color:R.value.color,backgroundColor:R.value.backgroundColor,active:Un.value,svgRef:S(H),isCursorPointer:z.value,onClose:Wn},He({_:2},[y(S(Ee),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Te)(t,n))),void 0,!0)])}))]),1032,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`])):f(``,!0),b(e.$slots,`userConfig`,{},void 0,!0),fn.value?(_(),p(`div`,{key:2,ref_key:`noTitle`,ref:zt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),R.value.title.text?(_(),p(`div`,{key:3,ref_key:`chartTitle`,ref:It,style:`width:100%;background:transparent;padding-bottom:24px`},[(_(),d(xe,{key:`title_${Bt.value}`,config:{title:{cy:`ridgeline-div-title`,...R.value.title},subtitle:{cy:`ridgeline-div-subtitle`,...R.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),N.value.show&&Pt.value&&(S(an)||S(nn))?(_(),d(S(At),{ref_key:`userOptionsRef`,ref:Xt,key:`user_option_${Ut.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:S(cn),isImaging:S(ln),uid:O.value,hasTooltip:!1,callbacks:N.value.callbacks,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasLabel:!1,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:Q.value,printScale:N.value.print.scale,chartElement:T.value,position:N.value.position,isTooltip:!1,titles:{...N.value.buttonTitles},hasAnnotator:N.value.buttons.annotator,isAnnotation:Un.value,tableDialog:M.value.table.useDialog,style:g({visibility:S(an)?S(nn)?`visible`:`hidden`:`visible`}),isCursorPointer:z.value,onToggleFullscreen:In,onGeneratePdf:S(un),onGenerateCsv:qn,onGenerateImage:S(ar),onGenerateSvg:S(ir),onToggleTable:Gn,onToggleAnnotator:Wn,onCopyAlt:sr},He({_:2},[y(S(De)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Oe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.callbacks.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.printScale.chartElement.position.titles.hasAnnotator.isAnnotation.tableDialog.style.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg`.split(`.`))):f(``,!0),m(`div`,at,[(_(),p(`svg`,{ref_key:`svgRef`,ref:H,xmlns:S(ce),"aria-describedby":`chart-instructions-${O.value}`,class:Je({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${K.value.fullHeight<=0?10:K.value.fullHeight}`,style:g(`max-width:100%;overflow:visible;background:transparent;color:${R.value.color};${M.value.responsive?`height: ${qt.value}px; width: 100%;`:``}`),tabindex:`0`,onFocus:cr,onBlur:lr,onKeydown:ur},[We(S(jt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(cn)||S(ln)||S(nr),isPrintingSvg:S(rr),data:Y.value}},void 0,!0),m(`defs`,null,[(_(!0),p(l,null,y(Z.value,(e,t)=>(_(),d(Fe,{t:`linear`,id:`gradient-${e.id}-${O.value}`,key:`gradient-${e.id}-${O.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128)),(_(!0),p(l,null,y(Y.value,(e,t)=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,(e,t)=>(_(),d(Fe,{t:`linear`,key:`grad${e.id}`,id:`gradient-single-${O.value}-${e.uid}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128))],64))),256))]),(_(!0),p(l,null,y(Y.value,(t,n)=>(_(),p(`g`,{key:`ds-${n}`},[(_(!0),p(l,null,y(t.datapoints,(t,r)=>(_(),p(`g`,{key:t.id},[e.$slots.pattern?(_(),p(`g`,st,[m(`defs`,null,[b(e.$slots,`pattern`,Ke({ref_for:!0},{datapointIndex:n,seriesIndex:r,patternId:`pattern_${O.value}_${t.uid}`}),void 0,!0)])])):f(``,!0),m(`path`,{fill:e.$slots.pattern?`url(#pattern_${O.value}_${t.uid})`:R.value.backgroundColor,stroke:`none`,"stroke-linecap":`round`,d:P.value.smooth?t.smoothPath:t.straightPath,style:g({opacity:P.value.opacity})},null,12,ct),m(`path`,{fill:`none`,stroke:P.value.stroke.useSerieColor?t.color:P.value.stroke.color,"stroke-width":P.value.strokeWidth,d:P.value.smooth?t.smoothPathRidge:t.straightPathRidge,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,lt),m(`path`,{fill:P.value.useGradient?P.value.useCommonColor?`url(#gradient-${t.id}-${O.value})`:`url(#gradient-single-${O.value}-${t.uid})`:t.color,stroke:`none`,d:P.value.smooth?t.smoothPath:t.straightPath,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,ut),R.value.zeroLine.show?(_(),p(`path`,{key:1,stroke:R.value.zeroLine.useSerieColor?t.color:R.value.zeroLine.stroke,"stroke-dasharray":R.value.zeroLine.strokeDasharray,"stroke-width":R.value.zeroLine.strokeWidth,d:t.zeroPath,"stroke-linecap":`round`},null,8,dt)):f(``,!0),P.value.maxPoint.show&&t.plots.length>1?(_(!0),p(l,{key:2},y(t.plots,e=>(_(),p(l,null,[e.isMaxPoint?(_(),p(`line`,{key:0,x1:e.x,y1:e.y,x2:e.x,y2:e.zero,stroke:P.value.maxPoint.adaptStrokeToBackground?S(se)(t.color):P.value.maxPoint.stroke,"stroke-width":P.value.maxPoint.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":P.value.maxPoint.strokeDasharray},null,8,ft)):f(``,!0)],64))),256)):f(``,!0),t.plots.length===1?(_(),p(`circle`,{key:3,cx:t.plots[0].x,cy:t.plots[0].y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?t.color:F.value.dot.fill,style:{pointerEvents:`none`}},null,8,pt)):f(``,!0)]))),128)),m(`text`,{x:t.label.x,y:t.label.y,"text-anchor":`end`,"font-size":L.value.fontSize,"font-weight":L.value.bold?`bold`:`normal`,fill:L.value.color,style:g({cursor:R.value.dialog.show&&z.value?`pointer`:`default`}),"text-decoration":R.value.dialog.show&&(Bn.value===n||A.value&&t.uid===A.value.uid||j.value===n)?`underline`:``,"dominant-baseline":`middle`,onMouseenter:e=>Vn(n),onMouseleave:Hn,onClick:e=>zn(t)},x(t.name),45,mt)]))),128)),I.value.values.length?(_(),p(`g`,{key:0,ref_key:`timeLabelsEls`,ref:Jt},[(_(!0),p(l,null,y(J.value,(t,n)=>b(e.$slots,`time-label`,Ke({ref_for:!0},{show:t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0,fontSize:I.value.fontSize,content:t.label,textAnchor:I.value.rotation>0?`start`:I.value.rotation<0?`end`:`middle`,fill:I.value.color,transform:`translate(${t.selectorX}, ${K.value.top+t.height+I.value.offsetY}), rotate(${I.value.rotation})`,x:t.selectorX,y:K.value.bottom+I.value.offsetY}),()=>[t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0?(_(),p(`g`,ht,[String(t.label).includes(`
|
|
2
2
|
`)?(_(),p(`text`,{key:1,class:`vue-ui-ridgeline-x-axis-label`,"font-size":I.value.fontSize,fill:I.value.color,"font-weight":I.value.bold?`bold`:`normal`,transform:`translate(${t.selectorX}, ${K.value.bottom+I.value.offsetY}), rotate(${I.value.rotation})`,"text-anchor":I.value.rotation>0?`start`:R.value.xAxis.labels.rotation<0?`end`:`middle`,style:g({opacity:k.value?k.value.index===n?1:.2:1}),innerHTML:S(a)({content:String(t.label),fontSize:R.value.xAxis.labels.fontSize,fill:R.value.xAxis.labels.color,stroke:R.value.backgroundColor,x:0,y:0})},null,12,_t)):(_(),p(`text`,{key:0,class:`vue-ui-ridgeline-x-axis-label`,"font-size":I.value.fontSize,fill:I.value.color,stroke:R.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":I.value.bold?`bold`:`normal`,transform:`translate(${t.selectorX}, ${K.value.bottom+I.value.offsetY}), rotate(${I.value.rotation})`,"text-anchor":I.value.rotation>0?`start`:R.value.xAxis.labels.rotation<0?`end`:`middle`,style:g({opacity:k.value?k.value.index===n?1:.2:1})},x(t.label),13,gt))])):f(``,!0)],!0)),256))],512)):f(``,!0),m(`g`,null,[(_(!0),p(l,null,y(J.value,(e,t)=>(_(),p(`rect`,{x:e.x,y:e.y,width:e.width<0?.1:e.width,height:e.height<0?.1:e.height,fill:`transparent`,onMouseenter:t=>On(e),onMouseleave:t=>kn(e),onClick:()=>An(e)},null,40,vt))),256)),F.value.show&&k.value?(_(),p(`line`,{key:0,x1:k.value.selectorX,x2:k.value.selectorX,y1:k.value.y,y2:k.value.y+k.value.height-V.value/2,stroke:F.value.stroke,"stroke-width":F.value.strokeWidth,"stroke-dasharray":F.value.strokeDasharray,"stroke-linecap":`round`,style:{pointerEvents:`none`}},null,8,yt)):f(``,!0),k.value||F.value.labels.showLast?(_(!0),p(l,{key:1},y(Y.value,e=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,e=>(_(),p(l,null,[(_(!0),p(l,null,y(e.plots,(t,r)=>(_(),p(l,null,[k.value&&k.value.index===r||!k.value&&r===e.plots.length-1&&R.value.selector.labels.showLast?(_(),p(`circle`,{key:0,cx:t.x,cy:t.y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?e.color:R.value.selector.dot.fill,style:{pointerEvents:`none`}},null,8,bt)):f(``,!0),k.value&&k.value.index===r||!k.value&&r===e.plots.length-1&&R.value.selector.labels.showLast?(_(),p(`text`,{key:1,x:Mn(t.x,S(c)(R.value.selector.labels.formatter,t.value,S(n)({p:M.value.style.chart.xAxis.labels.prefix,v:t.value,s:M.value.style.chart.xAxis.labels.suffix,r:M.value.style.chart.selector.labels.rounding})),R.value.selector.labels.fontSize)?t.x-R.value.selector.labels.fontSize/2:t.x+R.value.selector.labels.fontSize/2,y:t.y,"dominant-baseline":`middle`,stroke:R.value.backgroundColor,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`,"paint-order":`stroke fill`,"text-anchor":Mn(t.x,S(c)(R.value.selector.labels.formatter,t.value,S(n)({p:M.value.style.chart.xAxis.labels.prefix,v:t.value,s:M.value.style.chart.xAxis.labels.suffix,r:M.value.style.chart.selector.labels.rounding})),R.value.selector.labels.fontSize)?`end`:`start`,"font-size":F.value.labels.fontSize,fill:F.value.labels.color,style:{pointerEvents:`none`}},x(S(c)(R.value.selector.labels.formatter,t.value,S(n)({p:R.value.xAxis.labels.prefix,v:t.value,s:R.value.xAxis.labels.suffix,r:R.value.selector.labels.rounding}))),9,xt)):f(``,!0)],64))),256))],64))),256))],64))),256)):f(``,!0)]),b(e.$slots,`svg`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(cn)||S(ln)||S(nr),isPrintingSvg:S(rr),data:Y.value}},void 0,!0)],46,ot)),e.$slots.hint?(_(),p(`div`,St,[b(e.$slots,`hint`,Ye(Ge({hint:M.value.a11y.translations.keyboardNavigation,isVisible:Zt.value})),void 0,!0)])):f(``,!0)]),e.$slots.watermark?(_(),p(`div`,Ct,[b(e.$slots,`watermark`,Ye(Ge({isPrinting:S(cn)||S(ln)||S(nr)||S(rr)})),void 0,!0)])):f(``,!0),m(`div`,{ref_key:`chartLegend`,ref:Lt},[b(e.$slots,`legend`,{legend:Z.value},()=>[R.value.legend.show?(_(),d(Be,{key:`legend_${Ht.value}`,legendSet:Z.value,config:Fn.value,isCursorPointer:z.value,onClickMarker:t[0]||=({legend:e})=>gn(e.id)},He({item:C(({legend:e})=>[S(en)?f(``,!0):(_(),p(`div`,{key:0,style:g(`opacity:${X.value.includes(e.id)?.5:1}`),onClick:t=>e.segregate()},x(e.name),13,wt))]),legendToggle:C(()=>[Z.value.length>2&&R.value.legend.selectAllToggle.show&&!S(en)?(_(),d(Ie,{key:0,backgroundColor:R.value.legend.selectAllToggle.backgroundColor,color:R.value.legend.selectAllToggle.color,fontSize:R.value.legend.fontSize,checked:X.value.length>0,isCursorPointer:z.value,onToggle:hn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):f(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:C(({legend:e,index:t})=>[We(Me,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):f(``,!0)],!0)],512),e.$slots.source?(_(),p(`div`,{key:6,ref_key:`source`,ref:Rt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Pt.value&&N.value.buttons.table?(_(),d(Ze(Zn.value.component),Ke({key:7},Zn.value.props,{ref_key:`tableUnit`,ref:Yt,onClose:Qn}),He({content:C(()=>[(_(),d(S(Ot),{key:`table_${Vt.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:M.value.table.useDialog?``:Zn.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:z.value,onClose:Qn},{th:C(({th:e})=>[m(`div`,null,x(e),1)]),td:C(({td:e})=>[Ue(x(e.name?e.name:S(c)(F.value.labels.formatter,e,S(n)({p:R.value.xAxis.labels.prefix,v:e,s:R.value.xAxis.labels.suffix,r:M.value.table.td.roundingValue}))),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:C(()=>[Ue(x(Zn.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:C(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>qn(N.value.callbacks.csv),style:g({cursor:z.value?`pointer`:`default`})},[We(S(Et),{name:`fileCsv`,stroke:Zn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),R.value.dialog.show?(_(),d(S(Mt),{key:8,ref_key:`dialog`,ref:Kt,onClose:t[2]||=e=>A.value=null,backgroundColor:R.value.dialog.backgroundColor,color:R.value.dialog.color,headerBg:R.value.dialog.header.backgroundColor,headerColor:R.value.dialog.header.color,isFullscreen:Q.value,fullscreenParent:T.value,isCursorPointer:z.value,withPadding:``},{title:C(()=>[Ue(x(A.value.name),1)]),content:C(()=>[A.value?(_(),d(S(Tt),{key:0,config:Ln.value,dataset:Rn.value,onCopyAlt:or},null,8,[`config`,`dataset`])):f(``,!0)]),_:1},8,[`backgroundColor`,`color`,`headerBg`,`headerColor`,`isFullscreen`,`fullscreenParent`,`isCursorPointer`])):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(en)?(_(),d(he,{key:0})):f(``,!0)],!0)],46,rt))}},[[`__scopeId`,`data-v-442bfc30`]]);export{nt as n,Tt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,J as o,Jt as ee,Kt as te,S as ne,X as re,Yt as ie,Zt as ae,at as oe,b as se,i as ce,in as le,nn as ue,nt as de,pt as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{n as ye,t as be}from"./useHints-BH9r_0Vd.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Se}from"./useNestedProp-DnGoh-XS.js";import{t as Ce}from"./useThemeCheck-BKNRbGeC.js";import{t as we}from"./chartImage-DPGnEuYM.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{n as De,t as Oe}from"./tableIntegration-CNoJ1CIY.js";import{n as ke,t as Ae}from"./annotationSlots-BRR85CqJ.js";import{n as je,t as Me}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ne}from"./usePrinter-sVoTzet1.js";import{t as Pe}from"./useTransitions-ChGGrtrv.js";import{t as Fe}from"./Shape-CRe8woTu.js";import{c as Ie}from"./canvas-lib-22VpOI4_.js";import{t as Le}from"./useResponsive-CENUxfEL.js";import{t as Re}from"./DefGrad-DKMq1REY.js";import{t as ze}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./useUserOptionState-CXlFnwPv.js";import{t as He}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ue}from"./labelUtils-CdtU-yB_.js";import{t as We}from"./Legend-DM0ClX3D.js";import{t as Ge}from"./vue_ui_rings-BcDDXHpQ.js";import{Fragment as Ke,Teleport as qe,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Je,createTextVNode as Ye,createVNode as Xe,defineAsyncComponent as f,guardReactiveProps as p,mergeProps as Ze,nextTick as Qe,normalizeClass as m,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as $e,onMounted as et,openBlock as _,ref as v,renderList as tt,renderSlot as y,resolveDynamicComponent as nt,shallowRef as rt,toDisplayString as it,toRefs as at,unref as b,useSlots as ot,watch as st,withCtx as x}from"vue";var ct=/* @__PURE__ */ e({default:()=>kt}),lt=[`id`],ut=[`id`],dt=[`id`],ft={style:{position:`relative`}},pt=[`xmlns`,`viewBox`,`aria-describedby`],mt=[`width`,`height`],ht={key:1},gt=[`stroke`,`cx`,`cy`,`r`,`fill`],_t=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],vt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],yt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],bt=[`x`,`y`,`width`,`height`,`fill`,`rx`],xt=[`cx`,`cy`,`r`,`fill`,`stroke`],St=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],Ct={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},wt={key:5,class:`vue-data-ui-watermark`},Tt=[`id`],Et=[`onClick`],Dt={key:0},Ot={key:1},kt=/*#__PURE__*/ xe({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:xe,emit:ct}){let kt=f(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=f(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=f(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Mt=f(()=>import(`./DataTable-0Vv-aGHD.js`)),Nt=f(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Pt=f(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Ft=f(()=>import(`./PackageVersion-C4ZM3Vf7.js`).then(e=>e.t)),It=f(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_rings:Lt}=t(),{isThemeValid:Rt,warnInvalidTheme:zt}=Ce(),Bt=ot(),S=e,C=v(!1),Vt=s(()=>!!S.dataset&&S.dataset.length),w=v(re()),T=v(!1),Ht=v(``),E=v(null),Ut=v(0),D=v(null),Wt=v(null),Gt=v(null),Kt=v(null),qt=v(null),Jt=v(0),Yt=v(0),Xt=v(0),Zt=v(!1),Qt=v(!1),$t=v(null),en=v(null),O=v(null),tn=v({x:0,y:0}),nn=v(`pointer`),rn=v(!1),k=v(dn()),A=s(()=>k.value.userOptions),j=s(()=>k.value.style.chart.layout.rings),M=s(()=>k.value.style.chart.layout.labels),N=s(()=>k.value.style.chart.tooltip),P=s(()=>k.value.style.chart);ye({config:()=>k.value,dataset:()=>S.dataset,component:`VueUiRings`,rules:[be.singleSeries,be.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:F}=Pe({config:()=>k.value.transitions,dataset:()=>S.dataset}),I=s(()=>k.value.userOptions.useCursorPointer),an=s(()=>le({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:k.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:on,manualLoading:sn}=_e({...at(S),FINAL_CONFIG:k,prepareConfig:dn,skeletonDataset:S.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:le({defaultConfig:k.value,userConfig:an.value})}),{userOptionsVisible:cn,setUserOptionsVisibility:ln,keepUserOptionState:un}=Ve({config:k.value}),{svgRef:R}=He({config:P.value.title});function dn(){let e=Se({userConfig:S.config,defaultConfig:Lt}),t=e.theme;if(!t)return e;if(!Rt.value(e))return zt(e),e;let n=Se({userConfig:Ge[t]||S.config,defaultConfig:e});return{...Se({userConfig:S.config,defaultConfig:n}),customPalette:e.customPalette.length?e.customPalette:ue[e.theme]||a}}let fn=ae(S.config);st(()=>S.config,(e,t)=>{let n=ae(e),r=n!==fn;fn=n;let i=dn();r?(L.value||(k.value=i),cn.value=!k.value.userOptions.showOnChartHover,mn(),Jt.value+=1,Yt.value+=1,Xt.value+=1,U.value.showTable=k.value.table.show,U.value.showTooltip=N.value.show,U.value.showLabels=M.value.dataLabels.show,W.value.width=P.value.size,W.value.height=P.value.size):(k.value.style.chart.tooltip=i.style.chart.tooltip,U.value.showTooltip=k.value.style.chart.tooltip.show)},{deep:!0});let pn=s(()=>{let{markers:e}=M.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:k.value.responsive?i:n/P.value.size*W.value.width,y:0/P.value.size*W.value.height}}),z=s(()=>({x:W.value.width/2+pn.value.x,y:W.value.height/2+pn.value.y}));st(()=>S.dataset,e=>{Array.isArray(e)&&e.length>0&&(sn.value=!1)},{deep:!0});let B=rt(null),V=rt(null);et(()=>{Qt.value=!0,mn()});let H=s(()=>k.value.debug);function mn(){if(ge(S.dataset)?(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0):S.dataset.forEach((e,t)=>{e.values.length||(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0),he({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{oe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:H.value})})}),ge(S.dataset)||(sn.value=k.value.loading),k.value.responsive){let e=Ie(()=>{Zt.value=!0;let{width:e,height:t}=Le({chart:D.value,title:P.value.title.text?Wt.value:null,legend:P.value.legend.show?Gt.value:null,source:Kt.value,noTitle:qt.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t-12,Zt.value=!1})});B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect()),B.value=new ResizeObserver(e),V.value=D.value.parentNode,B.value.observe(V.value)}setTimeout(()=>{C.value=!0},600)}$e(()=>{B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let{isPrinting:hn,isImaging:gn,generatePdf:_n,generateImage:vn}=Ne({elementId:`rings_${w.value}`,fileName:P.value.title.text||`vue-ui-rings`,options:k.value.userOptions.print}),yn=s(()=>k.value.userOptions.show&&!P.value.title.text),bn=s(()=>me(k.value.customPalette)),U=v({showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show});st(k,()=>{U.value={showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show}},{immediate:!0});let W=v({height:P.value.size,width:P.value.size}),xn=s(()=>Math.min(W.value.height,W.value.width)),Sn=ct,G=v([]);function Cn(){G.value.length?G.value=[]:jn.value.forEach(e=>{G.value.push(e.uid)}),wn()}function wn(){Sn(`selectLegend`,J.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Tn(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)}wn()}function En(e){return K.value.length?K.value.find(t=>t.name===e)||(H.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(H.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function Dn(e){let t=En(e);t!==null&&G.value.includes(t.uid)&&Tn(t.uid)}function On(e){let t=En(e);t!==null&&(G.value.includes(t.uid)||Tn(t.uid))}let kn=s(()=>Math.max(...K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e)));function An(e){return e/kn.value}let K=s(()=>on.value.map(({values:e,name:t,color:n=null},r)=>{let i=te(e).reduce((e,t)=>e+t,0);return{name:t,color:n||ne(n)||bn.value[r]||a[r]||a[r%a.length],value:i,proportion:i/on.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),uid:re(),absoluteIndex:r}})),jn=s(()=>K.value.map((e,t)=>{let r=ce(M.value.dataLabels.formatter,e.value,n({p:M.value.dataLabels.prefix,v:e.value,s:M.value.dataLabels.suffix,r:P.value.legend.roundingValue}),{datapoint:e,index:t}),i=isNaN(e.value/q.value)?`-`:n({v:e.value/q.value*100,s:`%`,r:P.value.legend.roundingPercentage}),a=In({showVal:P.value.legend.showValue,showPercentage:P.value.legend.showPercentage,val:r,percentage:G.value.includes(e.uid)?`-%`:i});return{...e,shape:`circle`,opacity:G.value.includes(e.uid)?.5:1,segregate:()=>Tn(e.uid),isSegregated:G.value.includes(e.uid),display:`${e.name}${P.value.legend.showPercentage||P.value.legend.showValue?`: `:``}${a}`}}).toSorted((e,t)=>t.value-e.value)),Mn=s(()=>({cy:`rings-div-legend`,backgroundColor:P.value.legend.backgroundColor,color:P.value.legend.color,fontSize:P.value.legend.fontSize,paddingBottom:12,fontWeight:P.value.legend.bold?`bold`:``})),q=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e).reduce((e,t)=>e+t,0)),J=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({name:e,value:t,color:n=null,uid:r,absoluteIndex:i},o)=>({absoluteIndex:i,uid:r,name:e,color:n||ne(n)||bn.value[o]||a[o]||a[o%a.length],value:t,proportion:An(t),percentage:t/q.value*100,strokeWidth:j.value.strokeWidth*An(t)})).toSorted((e,t)=>t.value-e.value));function Nn(){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=s(()=>xn.value-j.value.strokeWidth*2);function Pn(e,t){k.value.events.datapointClick&&k.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Fn(e,t){E.value=null,T.value=!1,O.value=null,nn.value=`pointer`,k.value.events.datapointLeave&&k.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function In({val:e,percentage:t,showVal:n,showPercentage:r}){let i=M.value.dataLabels;return Ue({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Ln(e){let t=M.value.dataLabels,r=ce(t.formatter,e.value,n({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),i=n({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${In({val:r,percentage:i,showVal:t.showValue,showPercentage:t.showPercentage})}`}function Rn(e){return se(Y.value*e.proportion/2*.9<=0?1e-4:Y.value*e.proportion/2*.9)}function zn(e,t){return t===0?z.value.y:z.value.y+Y.value*J.value[0].proportion/2-Y.value*e.proportion/2-2*(t+1)}function X(e,t){let n=M.value.dataLabels.markers.position===`left`?-(Y.value/2):Y.value/2;return{x:z.value.x+n,y:zn(e,t)-Rn(e)}}let Bn=v(null);function Vn(e,t,r=`pointer`){if(k.value.events.datapointEnter&&k.value.events.datapointEnter({datapoint:e,seriesIndex:t}),G.value.length===S.dataset.length)return;Bn.value={datapoint:e,seriesIndex:t,series:J.value,config:k.value},E.value=t,O.value=t,nn.value=r;let a=J.value[t],o=N.value.customFormat;if(i(o)&&fe(()=>o({seriesIndex:t,datapoint:e,series:J.value,config:k.value})))Ht.value=o({seriesIndex:t,datapoint:e,series:J.value,config:k.value});else{let r=``;r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${N.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,r+=`<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="${a.color}" />${Bt.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${w.value}_${e.absoluteIndex})" />`:``}</svg>`,r+=`<b>${In({showVal:N.value.showValue,showPercentage:N.value.showPercentage,val:`<span>${ce(M.value.dataLabels.formatter,a.value,n({p:M.value.dataLabels.prefix,v:a.value,s:M.value.dataLabels.suffix,r:N.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:n({v:a.value/q.value*100,s:`%`,r:N.value.roundingPercentage})})}</b></div>`,Ht.value=r}T.value=!0}let Z=s(()=>({head:J.value.map(e=>({name:e.name,color:e.color})),body:J.value.map(e=>e.value)})),Q=s(()=>{let e=[`__SUM__`,n({p:M.value.dataLabels.prefix,v:q.value,s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),`100%`],t=Z.value.head.map((e,t)=>[{color:e.color,name:e.name},n({p:M.value.dataLabels.prefix,v:Z.value.body[t],s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),isNaN(Z.value.body[t]/q.value)?`-`:(Z.value.body[t]/q.value*100).toFixed(k.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:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline},td:{backgroundColor:k.value.table.td.backgroundColor,color:k.value.table.td.color,outline:k.value.table.td.outline},breakpoint:k.value.table.responsiveBreakpoint},colNames:[k.value.table.columnNames.series,k.value.table.columnNames.value,k.value.table.columnNames.percentage]}});function Hn(e=null){Qe(()=>{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=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),i=r(n);e?e(i):de({csvContent:i,title:P.value.title.text||`vue-ui-rings`})})}let $=v(!1);function Un(e){$.value=e,Ut.value+=1}function Wn(){U.value.showTable=!U.value.showTable}function Gn(){U.value.showTooltip=!U.value.showTooltip}function Kn(){U.value.showLabels=!U.value.showLabels}let qn=v(!1);function Jn(){qn.value=!qn.value}let Yn=we(D,()=>P.value.title.text),Xn=s(()=>Oe({config:k,style:P,mutableConfig:U,dialog:It,accordion:jt,isFullscreen:$,parent:D,maxWidth:800,isCursorPointer:I}));st(()=>U.value.showTable,e=>De(e,k,$t));function Zn(){U.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let Qn=s(()=>jn.value.map(e=>({...e,name:e.display}))),$n=s(()=>P.value.backgroundColor),er=s(()=>P.value.legend),tr=s(()=>P.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Ee({svg:R,title:tr,legend:er,legendItems:Qn,backgroundColor:$n,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:vn});async function or(){Sn(`copyAlt`,{config:k.value,dataset:J.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function sr(){O.value=null,rn.value=!0}function cr(){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null,rn.value=!1}function lr(e){if(!R.value||qn.value||document.activeElement!==R.value||!J.value.length||G.value.length===S.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){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null;return}if(r){if(O.value===null)return;let e=J.value[O.value];if(!e)return;Pn(e,O.value);return}let a=O.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 o=J.value[a];o&&(ur(a),Vn(o,a,`keyboard`))}function ur(e){if(!Number.isFinite(e)||!R.value)return;let t=J.value[e];if(!t)return;let n=X(t,e),r=R.value.getBoundingClientRect();tn.value={x:r.left+n.x/W.value.width*r.width,y:r.top+n.y/W.value.height*r.height}}let dr=s(()=>({headers:Q.value?.colNames??[],rows:Q.value?.a11yBody??[]}));return xe({getData:Nn,getImage:Yn,generatePdf:_n,generateCsv:Hn,generateImage:vn,generateSvg:ir,hideSeries:On,showSeries:Dn,toggleTable:Wn,toggleTooltip:Gn,toggleAnnotator:Jn,toggleFullscreen:Un,toggleLabels:Kn,copyAlt:or}),(e,t)=>(_(),u(`div`,{ref_key:`ringsChart`,ref:D,class:m(`vue-data-ui-component vue-ui-rings ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${k.value.useCssAnimation?``:`vue-ui-dna`}`),style:g(`font-family:${k.value.style.fontFamily};text-align:center;width:100%;background:${P.value.backgroundColor};${k.value.responsive?`height: 100%`:``}`),id:`rings_${w.value}`,onMouseleave:t[2]||=e=>{E.value=null,T.value=!1,b(ln)(!1)},onMouseenter:t[3]||=()=>b(ln)(!0)},[d(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[d(`p`,null,it(k.value.a11y.translations.keyboardNavigation),1)],8,ut),dr.value?.rows?.length?(_(),c(Be,{key:0,uid:w.value,head:dr.value.headers,body:dr.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):l(``,!0),A.value.buttons.annotator?(_(),c(b(Nt),{key:1,svgRef:b(R),backgroundColor:P.value.backgroundColor,color:P.value.color,active:qn.value,isCursorPointer:I.value,palette:A.value.annotatorPalette,onClose:Jn},Je({_:2},[tt(b(Ae),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(ke)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),yn.value?(_(),u(`div`,{key:2,ref_key:`noTitle`,ref:qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):l(``,!0),P.value.title.text?(_(),u(`div`,{key:3,ref_key:`chartTitle`,ref:Wt,style:`width:100%;background:transparent`},[(_(),c(Te,{key:`title_${Jt.value}`,config:{title:{cy:`rings-div-title`,...P.value.title},subtitle:{cy:`rings-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):l(``,!0),d(`div`,{id:`legend-top-${w.value}`},null,8,dt),A.value.show&&Vt.value&&(b(un)||b(cn))?(_(),c(b(Pt),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Ut.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:b(hn),isImaging:b(gn),uid:w.value,hasTooltip:A.value.buttons.tooltip&&N.value.show,hasPdf:A.value.buttons.pdf,hasXls:A.value.buttons.csv,hasImg:A.value.buttons.img,hasSvg:A.value.buttons.svg,hasTable:A.value.buttons.table,hasFullscreen:A.value.buttons.fullscreen,hasAltCopy:A.value.buttons.altCopy,hasLabel:A.value.buttons.labels,isTooltip:U.value.showTooltip,isFullscreen:$.value,titles:{...A.value.buttonTitles},chartElement:D.value,position:A.value.position,hasAnnotator:A.value.buttons.annotator,isAnnotation:qn.value,callbacks:A.value.callbacks,printScale:A.value.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Un,onGeneratePdf:b(_n),onGenerateCsv:Hn,onGenerateImage:b(ar),onGenerateSvg:b(ir),onToggleTable:Wn,onToggleTooltip:Gn,onToggleAnnotator:Jn,onToggleLabels:Kn,onCopyAlt:or,style:g({visibility:b(un)?b(cn)?`visible`:`hidden`:`visible`})},Je({_:2},[tt(b(je)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(Me)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.hasLabel.isTooltip.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):l(``,!0),d(`div`,ft,[(_(),u(`svg`,{ref_key:`svgRef`,ref:R,xmlns:b(pe),class:m({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,resizing:Zt.value||b(L),"vue-data-ui-no-transition":!b(F)}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:g(`max-width:100%;overflow:hidden;background:transparent;color:${P.value.color}`),"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:sr,onBlur:cr,onKeydown:lr},[Xe(b(Ft)),y(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0),e.$slots[`chart-background`]?(_(),u(`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`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,mt)):l(``,!0),d(`defs`,null,[(_(!0),u(Ke,null,tt(J.value,(e,t)=>(_(),c(Re,{t:`radial`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${w.value}_${t}`,key:`gradient_${w.value}_${t}`,stops:[[`0%`,b(ee)(b(ie)(e.color,.05),100-j.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(_(),u(`g`,ht,[(_(!0),u(Ke,null,tt(J.value,t=>(_(),u(`defs`,null,[y(e.$slots,`pattern`,Ze({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${w.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):l(``,!0),(_(!0),u(Ke,null,tt(J.value,(t,n)=>(_(),u(`g`,{key:`r_${t.uid}`},[d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-opacity":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.underlayerColor},null,14,gt),d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.show?`url(#gradient_${w.value}_${n})`:t.color},null,14,_t),e.$slots.pattern?(_(),u(`circle`,{key:0,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`url(#pattern_${w.value}_${t.absoluteIndex})`},null,14,vt)):l(``,!0),d(`circle`,{stroke:`none`,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`transparent`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n)},null,40,yt),U.value.showLabels?(_(),u(Ke,{key:1},[d(`rect`,{x:M.value.dataLabels.markers.position===`left`?X(t,n).x:z.value.x,y:X(t,n).y-M.value.dataLabels.markers.strokeWidth/2,width:Math.abs(z.value.x-X(t,n).x),height:M.value.dataLabels.markers.strokeWidth,fill:M.value.dataLabels.markers.stroke,rx:M.value.dataLabels.markers.strokeWidth,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,bt),d(`circle`,{cx:X(t,n).x,cy:X(t,n).y,r:M.value.dataLabels.markers.radius,fill:t.color,stroke:P.value.backgroundColor,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,xt),d(`text`,{"text-anchor":M.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,"font-weight":M.value.dataLabels.bold?`bold`:`normal`,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),transform:`translate(${X(t,n).x+(M.value.dataLabels.markers.position===`left`?-M.value.dataLabels.offsetX-14:M.value.dataLabels.offsetX)+6}, ${X(t,n).y+M.value.dataLabels.fontSize/3})`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n),innerHTML:b(o)({content:Ln(t),fontSize:M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,St)],64)):l(``,!0)]))),128)),y(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0)],46,pt)),e.$slots.hint?(_(),u(`div`,Ct,[y(e.$slots,`hint`,h(p({hint:k.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):l(``,!0)]),e.$slots.watermark?(_(),u(`div`,wt,[y(e.$slots,`watermark`,h(p({isPrinting:b(hn)||b(gn)||b(nr)||b(rr)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${w.value}`},null,8,Tt),Qt.value&&(P.value.legend.show||e.$slots.legend)?(_(),c(qe,{key:6,to:P.value.legend.position===`top`?`#legend-top-${w.value}`:`#legend-bottom-${w.value}`},[d(`div`,{ref_key:`chartLegend`,ref:Gt},[y(e.$slots,`legend`,{legend:jn.value},()=>[P.value.legend.show?(_(),c(We,{key:`legend_${Xt.value}`,legendSet:jn.value,config:Mn.value,isCursorPointer:I.value,onClickMarker:t[0]||=({legend:e})=>Tn(e.uid)},Je({item:x(({legend:e,index:t})=>[b(L)?l(``,!0):(_(),u(`div`,{key:0,onClick:t=>Tn(e.uid),style:g(`opacity:${G.value.includes(e.uid)?.5:1}`)},it(e.display),13,Et))]),legendToggle:x(()=>[jn.value.length>2&&P.value.legend.selectAllToggle.show&&!b(L)?(_(),c(ze,{key:0,backgroundColor:P.value.legend.selectAllToggle.backgroundColor,color:P.value.legend.selectAllToggle.color,fontSize:P.value.legend.fontSize,checked:G.value.length>0,isCursorPointer:I.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):l(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:x(({legend:e,index:t})=>[Xe(Fe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${w.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):l(``,!0)],!0)],512)],8,[`to`])):l(``,!0),e.$slots.source?(_(),u(`div`,{key:7,ref_key:`source`,ref:Kt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),Xe(b(kt),{teleportTo:N.value.teleportTo,show:U.value.showTooltip&&T.value&&G.value.length<S.dataset.length,backgroundColor:N.value.backgroundColor,color:N.value.color,borderRadius:N.value.borderRadius,borderColor:N.value.borderColor,borderWidth:N.value.borderWidth,fontSize:N.value.fontSize,backgroundOpacity:N.value.backgroundOpacity,position:N.value.position,offsetX:N.value.offsetX,offsetY:N.value.offsetY,parent:D.value,content:Ht.value,isFullscreen:$.value,isCustom:N.value.customFormat&&typeof N.value.customFormat==`function`,smooth:N.value.smooth,backdropFilter:N.value.backdropFilter,smoothForce:N.value.smoothForce,smoothSnapThreshold:N.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":x(()=>[y(e.$slots,`tooltip-before`,h(p({...Bn.value})),void 0,!0)]),tooltip:x(()=>[y(e.$slots,`tooltip`,h(p({...Bn.value})),void 0,!0)]),"tooltip-after":x(()=>[y(e.$slots,`tooltip-after`,h(p({...Bn.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`]),Vt.value&&A.value.buttons.table?(_(),c(nt(Xn.value.component),Ze({key:8},Xn.value.props,{ref_key:`tableUnit`,ref:$t,onClose:Zn}),Je({content:x(()=>[(_(),c(b(Mt),{key:`table_${Yt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:k.value.table.useDialog?``:Xn.value.title,withCloseButton:!k.value.table.useDialog,isCursorPointer:I.value,onClose:Zn},{th:x(({th:e})=>[e===`__SUM__`?(_(),u(`div`,Dt,[Xe(b(At),{name:`sigma`,stroke:Q.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),u(`div`,Ot,it(e),1))]),td:x(({td:e})=>[Ye(it(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[k.value.table.useDialog?{name:`title`,fn:x(()=>[Ye(it(Xn.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:x(()=>[d(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Hn(A.value.callbacks.csv),style:g({cursor:I.value?`pointer`:`default`})},[Xe(b(At),{name:`fileCsv`,stroke:Xn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[b(L)?(_(),c(ve,{key:0})):l(``,!0)],!0)],46,lt))}},[[`__scopeId`,`data-v-c6f4397f`]]);export{ct as n,kt as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,J as o,Jt as ee,Kt as te,S as ne,X as re,Yt as ie,Zt as ae,at as oe,b as se,i as ce,in as le,nn as ue,nt as de,pt as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{n as ye,t as be}from"./useHints-BH9r_0Vd.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Se}from"./useNestedProp-DnGoh-XS.js";import{t as Ce}from"./useThemeCheck-BKNRbGeC.js";import{t as we}from"./chartImage-DPGnEuYM.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{n as De,t as Oe}from"./tableIntegration-CNoJ1CIY.js";import{n as ke,t as Ae}from"./annotationSlots-BRR85CqJ.js";import{n as je,t as Me}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ne}from"./usePrinter-sVoTzet1.js";import{t as Pe}from"./useTransitions-ChGGrtrv.js";import{t as Fe}from"./Shape-CRe8woTu.js";import{c as Ie}from"./canvas-lib-22VpOI4_.js";import{t as Le}from"./useResponsive-CENUxfEL.js";import{t as Re}from"./DefGrad-DKMq1REY.js";import{t as ze}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./useUserOptionState-CXlFnwPv.js";import{t as He}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ue}from"./labelUtils-CdtU-yB_.js";import{t as We}from"./Legend-DM0ClX3D.js";import{t as Ge}from"./vue_ui_rings-BcDDXHpQ.js";import{Fragment as Ke,Teleport as qe,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Je,createTextVNode as Ye,createVNode as Xe,defineAsyncComponent as f,guardReactiveProps as p,mergeProps as Ze,nextTick as Qe,normalizeClass as m,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as $e,onMounted as et,openBlock as _,ref as v,renderList as tt,renderSlot as y,resolveDynamicComponent as nt,shallowRef as rt,toDisplayString as it,toRefs as at,unref as b,useSlots as ot,watch as st,withCtx as x}from"vue";var ct=/* @__PURE__ */ e({default:()=>kt}),lt=[`id`],ut=[`id`],dt=[`id`],ft={style:{position:`relative`}},pt=[`xmlns`,`viewBox`,`aria-describedby`],mt=[`width`,`height`],ht={key:1},gt=[`stroke`,`cx`,`cy`,`r`,`fill`],_t=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],vt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],yt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],bt=[`x`,`y`,`width`,`height`,`fill`,`rx`],xt=[`cx`,`cy`,`r`,`fill`,`stroke`],St=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],Ct={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},wt={key:5,class:`vue-data-ui-watermark`},Tt=[`id`],Et=[`onClick`],Dt={key:0},Ot={key:1},kt=/*#__PURE__*/ xe({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:xe,emit:ct}){let kt=f(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=f(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=f(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Mt=f(()=>import(`./DataTable-0Vv-aGHD.js`)),Nt=f(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Pt=f(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Ft=f(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),It=f(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_rings:Lt}=t(),{isThemeValid:Rt,warnInvalidTheme:zt}=Ce(),Bt=ot(),S=e,C=v(!1),Vt=s(()=>!!S.dataset&&S.dataset.length),w=v(re()),T=v(!1),Ht=v(``),E=v(null),Ut=v(0),D=v(null),Wt=v(null),Gt=v(null),Kt=v(null),qt=v(null),Jt=v(0),Yt=v(0),Xt=v(0),Zt=v(!1),Qt=v(!1),$t=v(null),en=v(null),O=v(null),tn=v({x:0,y:0}),nn=v(`pointer`),rn=v(!1),k=v(dn()),A=s(()=>k.value.userOptions),j=s(()=>k.value.style.chart.layout.rings),M=s(()=>k.value.style.chart.layout.labels),N=s(()=>k.value.style.chart.tooltip),P=s(()=>k.value.style.chart);ye({config:()=>k.value,dataset:()=>S.dataset,component:`VueUiRings`,rules:[be.singleSeries,be.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:F}=Pe({config:()=>k.value.transitions,dataset:()=>S.dataset}),I=s(()=>k.value.userOptions.useCursorPointer),an=s(()=>le({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:k.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:on,manualLoading:sn}=_e({...at(S),FINAL_CONFIG:k,prepareConfig:dn,skeletonDataset:S.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:le({defaultConfig:k.value,userConfig:an.value})}),{userOptionsVisible:cn,setUserOptionsVisibility:ln,keepUserOptionState:un}=Ve({config:k.value}),{svgRef:R}=He({config:P.value.title});function dn(){let e=Se({userConfig:S.config,defaultConfig:Lt}),t=e.theme;if(!t)return e;if(!Rt.value(e))return zt(e),e;let n=Se({userConfig:Ge[t]||S.config,defaultConfig:e});return{...Se({userConfig:S.config,defaultConfig:n}),customPalette:e.customPalette.length?e.customPalette:ue[e.theme]||a}}let fn=ae(S.config);st(()=>S.config,(e,t)=>{let n=ae(e),r=n!==fn;fn=n;let i=dn();r?(L.value||(k.value=i),cn.value=!k.value.userOptions.showOnChartHover,mn(),Jt.value+=1,Yt.value+=1,Xt.value+=1,U.value.showTable=k.value.table.show,U.value.showTooltip=N.value.show,U.value.showLabels=M.value.dataLabels.show,W.value.width=P.value.size,W.value.height=P.value.size):(k.value.style.chart.tooltip=i.style.chart.tooltip,U.value.showTooltip=k.value.style.chart.tooltip.show)},{deep:!0});let pn=s(()=>{let{markers:e}=M.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:k.value.responsive?i:n/P.value.size*W.value.width,y:0/P.value.size*W.value.height}}),z=s(()=>({x:W.value.width/2+pn.value.x,y:W.value.height/2+pn.value.y}));st(()=>S.dataset,e=>{Array.isArray(e)&&e.length>0&&(sn.value=!1)},{deep:!0});let B=rt(null),V=rt(null);et(()=>{Qt.value=!0,mn()});let H=s(()=>k.value.debug);function mn(){if(ge(S.dataset)?(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0):S.dataset.forEach((e,t)=>{e.values.length||(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0),he({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{oe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:H.value})})}),ge(S.dataset)||(sn.value=k.value.loading),k.value.responsive){let e=Ie(()=>{Zt.value=!0;let{width:e,height:t}=Le({chart:D.value,title:P.value.title.text?Wt.value:null,legend:P.value.legend.show?Gt.value:null,source:Kt.value,noTitle:qt.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t-12,Zt.value=!1})});B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect()),B.value=new ResizeObserver(e),V.value=D.value.parentNode,B.value.observe(V.value)}setTimeout(()=>{C.value=!0},600)}$e(()=>{B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let{isPrinting:hn,isImaging:gn,generatePdf:_n,generateImage:vn}=Ne({elementId:`rings_${w.value}`,fileName:P.value.title.text||`vue-ui-rings`,options:k.value.userOptions.print}),yn=s(()=>k.value.userOptions.show&&!P.value.title.text),bn=s(()=>me(k.value.customPalette)),U=v({showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show});st(k,()=>{U.value={showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show}},{immediate:!0});let W=v({height:P.value.size,width:P.value.size}),xn=s(()=>Math.min(W.value.height,W.value.width)),Sn=ct,G=v([]);function Cn(){G.value.length?G.value=[]:jn.value.forEach(e=>{G.value.push(e.uid)}),wn()}function wn(){Sn(`selectLegend`,J.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Tn(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)}wn()}function En(e){return K.value.length?K.value.find(t=>t.name===e)||(H.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(H.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function Dn(e){let t=En(e);t!==null&&G.value.includes(t.uid)&&Tn(t.uid)}function On(e){let t=En(e);t!==null&&(G.value.includes(t.uid)||Tn(t.uid))}let kn=s(()=>Math.max(...K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e)));function An(e){return e/kn.value}let K=s(()=>on.value.map(({values:e,name:t,color:n=null},r)=>{let i=te(e).reduce((e,t)=>e+t,0);return{name:t,color:n||ne(n)||bn.value[r]||a[r]||a[r%a.length],value:i,proportion:i/on.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),uid:re(),absoluteIndex:r}})),jn=s(()=>K.value.map((e,t)=>{let r=ce(M.value.dataLabels.formatter,e.value,n({p:M.value.dataLabels.prefix,v:e.value,s:M.value.dataLabels.suffix,r:P.value.legend.roundingValue}),{datapoint:e,index:t}),i=isNaN(e.value/q.value)?`-`:n({v:e.value/q.value*100,s:`%`,r:P.value.legend.roundingPercentage}),a=In({showVal:P.value.legend.showValue,showPercentage:P.value.legend.showPercentage,val:r,percentage:G.value.includes(e.uid)?`-%`:i});return{...e,shape:`circle`,opacity:G.value.includes(e.uid)?.5:1,segregate:()=>Tn(e.uid),isSegregated:G.value.includes(e.uid),display:`${e.name}${P.value.legend.showPercentage||P.value.legend.showValue?`: `:``}${a}`}}).toSorted((e,t)=>t.value-e.value)),Mn=s(()=>({cy:`rings-div-legend`,backgroundColor:P.value.legend.backgroundColor,color:P.value.legend.color,fontSize:P.value.legend.fontSize,paddingBottom:12,fontWeight:P.value.legend.bold?`bold`:``})),q=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e).reduce((e,t)=>e+t,0)),J=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({name:e,value:t,color:n=null,uid:r,absoluteIndex:i},o)=>({absoluteIndex:i,uid:r,name:e,color:n||ne(n)||bn.value[o]||a[o]||a[o%a.length],value:t,proportion:An(t),percentage:t/q.value*100,strokeWidth:j.value.strokeWidth*An(t)})).toSorted((e,t)=>t.value-e.value));function Nn(){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=s(()=>xn.value-j.value.strokeWidth*2);function Pn(e,t){k.value.events.datapointClick&&k.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Fn(e,t){E.value=null,T.value=!1,O.value=null,nn.value=`pointer`,k.value.events.datapointLeave&&k.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function In({val:e,percentage:t,showVal:n,showPercentage:r}){let i=M.value.dataLabels;return Ue({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Ln(e){let t=M.value.dataLabels,r=ce(t.formatter,e.value,n({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),i=n({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${In({val:r,percentage:i,showVal:t.showValue,showPercentage:t.showPercentage})}`}function Rn(e){return se(Y.value*e.proportion/2*.9<=0?1e-4:Y.value*e.proportion/2*.9)}function zn(e,t){return t===0?z.value.y:z.value.y+Y.value*J.value[0].proportion/2-Y.value*e.proportion/2-2*(t+1)}function X(e,t){let n=M.value.dataLabels.markers.position===`left`?-(Y.value/2):Y.value/2;return{x:z.value.x+n,y:zn(e,t)-Rn(e)}}let Bn=v(null);function Vn(e,t,r=`pointer`){if(k.value.events.datapointEnter&&k.value.events.datapointEnter({datapoint:e,seriesIndex:t}),G.value.length===S.dataset.length)return;Bn.value={datapoint:e,seriesIndex:t,series:J.value,config:k.value},E.value=t,O.value=t,nn.value=r;let a=J.value[t],o=N.value.customFormat;if(i(o)&&fe(()=>o({seriesIndex:t,datapoint:e,series:J.value,config:k.value})))Ht.value=o({seriesIndex:t,datapoint:e,series:J.value,config:k.value});else{let r=``;r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${N.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,r+=`<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="${a.color}" />${Bt.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${w.value}_${e.absoluteIndex})" />`:``}</svg>`,r+=`<b>${In({showVal:N.value.showValue,showPercentage:N.value.showPercentage,val:`<span>${ce(M.value.dataLabels.formatter,a.value,n({p:M.value.dataLabels.prefix,v:a.value,s:M.value.dataLabels.suffix,r:N.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:n({v:a.value/q.value*100,s:`%`,r:N.value.roundingPercentage})})}</b></div>`,Ht.value=r}T.value=!0}let Z=s(()=>({head:J.value.map(e=>({name:e.name,color:e.color})),body:J.value.map(e=>e.value)})),Q=s(()=>{let e=[`__SUM__`,n({p:M.value.dataLabels.prefix,v:q.value,s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),`100%`],t=Z.value.head.map((e,t)=>[{color:e.color,name:e.name},n({p:M.value.dataLabels.prefix,v:Z.value.body[t],s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),isNaN(Z.value.body[t]/q.value)?`-`:(Z.value.body[t]/q.value*100).toFixed(k.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:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline},td:{backgroundColor:k.value.table.td.backgroundColor,color:k.value.table.td.color,outline:k.value.table.td.outline},breakpoint:k.value.table.responsiveBreakpoint},colNames:[k.value.table.columnNames.series,k.value.table.columnNames.value,k.value.table.columnNames.percentage]}});function Hn(e=null){Qe(()=>{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=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),i=r(n);e?e(i):de({csvContent:i,title:P.value.title.text||`vue-ui-rings`})})}let $=v(!1);function Un(e){$.value=e,Ut.value+=1}function Wn(){U.value.showTable=!U.value.showTable}function Gn(){U.value.showTooltip=!U.value.showTooltip}function Kn(){U.value.showLabels=!U.value.showLabels}let qn=v(!1);function Jn(){qn.value=!qn.value}let Yn=we(D,()=>P.value.title.text),Xn=s(()=>Oe({config:k,style:P,mutableConfig:U,dialog:It,accordion:jt,isFullscreen:$,parent:D,maxWidth:800,isCursorPointer:I}));st(()=>U.value.showTable,e=>De(e,k,$t));function Zn(){U.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let Qn=s(()=>jn.value.map(e=>({...e,name:e.display}))),$n=s(()=>P.value.backgroundColor),er=s(()=>P.value.legend),tr=s(()=>P.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Ee({svg:R,title:tr,legend:er,legendItems:Qn,backgroundColor:$n,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:vn});async function or(){Sn(`copyAlt`,{config:k.value,dataset:J.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function sr(){O.value=null,rn.value=!0}function cr(){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null,rn.value=!1}function lr(e){if(!R.value||qn.value||document.activeElement!==R.value||!J.value.length||G.value.length===S.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){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null;return}if(r){if(O.value===null)return;let e=J.value[O.value];if(!e)return;Pn(e,O.value);return}let a=O.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 o=J.value[a];o&&(ur(a),Vn(o,a,`keyboard`))}function ur(e){if(!Number.isFinite(e)||!R.value)return;let t=J.value[e];if(!t)return;let n=X(t,e),r=R.value.getBoundingClientRect();tn.value={x:r.left+n.x/W.value.width*r.width,y:r.top+n.y/W.value.height*r.height}}let dr=s(()=>({headers:Q.value?.colNames??[],rows:Q.value?.a11yBody??[]}));return xe({getData:Nn,getImage:Yn,generatePdf:_n,generateCsv:Hn,generateImage:vn,generateSvg:ir,hideSeries:On,showSeries:Dn,toggleTable:Wn,toggleTooltip:Gn,toggleAnnotator:Jn,toggleFullscreen:Un,toggleLabels:Kn,copyAlt:or}),(e,t)=>(_(),u(`div`,{ref_key:`ringsChart`,ref:D,class:m(`vue-data-ui-component vue-ui-rings ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${k.value.useCssAnimation?``:`vue-ui-dna`}`),style:g(`font-family:${k.value.style.fontFamily};text-align:center;width:100%;background:${P.value.backgroundColor};${k.value.responsive?`height: 100%`:``}`),id:`rings_${w.value}`,onMouseleave:t[2]||=e=>{E.value=null,T.value=!1,b(ln)(!1)},onMouseenter:t[3]||=()=>b(ln)(!0)},[d(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[d(`p`,null,it(k.value.a11y.translations.keyboardNavigation),1)],8,ut),dr.value?.rows?.length?(_(),c(Be,{key:0,uid:w.value,head:dr.value.headers,body:dr.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):l(``,!0),A.value.buttons.annotator?(_(),c(b(Nt),{key:1,svgRef:b(R),backgroundColor:P.value.backgroundColor,color:P.value.color,active:qn.value,isCursorPointer:I.value,palette:A.value.annotatorPalette,onClose:Jn},Je({_:2},[tt(b(Ae),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(ke)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),yn.value?(_(),u(`div`,{key:2,ref_key:`noTitle`,ref:qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):l(``,!0),P.value.title.text?(_(),u(`div`,{key:3,ref_key:`chartTitle`,ref:Wt,style:`width:100%;background:transparent`},[(_(),c(Te,{key:`title_${Jt.value}`,config:{title:{cy:`rings-div-title`,...P.value.title},subtitle:{cy:`rings-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):l(``,!0),d(`div`,{id:`legend-top-${w.value}`},null,8,dt),A.value.show&&Vt.value&&(b(un)||b(cn))?(_(),c(b(Pt),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Ut.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:b(hn),isImaging:b(gn),uid:w.value,hasTooltip:A.value.buttons.tooltip&&N.value.show,hasPdf:A.value.buttons.pdf,hasXls:A.value.buttons.csv,hasImg:A.value.buttons.img,hasSvg:A.value.buttons.svg,hasTable:A.value.buttons.table,hasFullscreen:A.value.buttons.fullscreen,hasAltCopy:A.value.buttons.altCopy,hasLabel:A.value.buttons.labels,isTooltip:U.value.showTooltip,isFullscreen:$.value,titles:{...A.value.buttonTitles},chartElement:D.value,position:A.value.position,hasAnnotator:A.value.buttons.annotator,isAnnotation:qn.value,callbacks:A.value.callbacks,printScale:A.value.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Un,onGeneratePdf:b(_n),onGenerateCsv:Hn,onGenerateImage:b(ar),onGenerateSvg:b(ir),onToggleTable:Wn,onToggleTooltip:Gn,onToggleAnnotator:Jn,onToggleLabels:Kn,onCopyAlt:or,style:g({visibility:b(un)?b(cn)?`visible`:`hidden`:`visible`})},Je({_:2},[tt(b(je)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(Me)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.hasLabel.isTooltip.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):l(``,!0),d(`div`,ft,[(_(),u(`svg`,{ref_key:`svgRef`,ref:R,xmlns:b(pe),class:m({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,resizing:Zt.value||b(L),"vue-data-ui-no-transition":!b(F)}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:g(`max-width:100%;overflow:hidden;background:transparent;color:${P.value.color}`),"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:sr,onBlur:cr,onKeydown:lr},[Xe(b(Ft)),y(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0),e.$slots[`chart-background`]?(_(),u(`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`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,mt)):l(``,!0),d(`defs`,null,[(_(!0),u(Ke,null,tt(J.value,(e,t)=>(_(),c(Re,{t:`radial`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${w.value}_${t}`,key:`gradient_${w.value}_${t}`,stops:[[`0%`,b(ee)(b(ie)(e.color,.05),100-j.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(_(),u(`g`,ht,[(_(!0),u(Ke,null,tt(J.value,t=>(_(),u(`defs`,null,[y(e.$slots,`pattern`,Ze({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${w.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):l(``,!0),(_(!0),u(Ke,null,tt(J.value,(t,n)=>(_(),u(`g`,{key:`r_${t.uid}`},[d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-opacity":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.underlayerColor},null,14,gt),d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.show?`url(#gradient_${w.value}_${n})`:t.color},null,14,_t),e.$slots.pattern?(_(),u(`circle`,{key:0,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`url(#pattern_${w.value}_${t.absoluteIndex})`},null,14,vt)):l(``,!0),d(`circle`,{stroke:`none`,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`transparent`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n)},null,40,yt),U.value.showLabels?(_(),u(Ke,{key:1},[d(`rect`,{x:M.value.dataLabels.markers.position===`left`?X(t,n).x:z.value.x,y:X(t,n).y-M.value.dataLabels.markers.strokeWidth/2,width:Math.abs(z.value.x-X(t,n).x),height:M.value.dataLabels.markers.strokeWidth,fill:M.value.dataLabels.markers.stroke,rx:M.value.dataLabels.markers.strokeWidth,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,bt),d(`circle`,{cx:X(t,n).x,cy:X(t,n).y,r:M.value.dataLabels.markers.radius,fill:t.color,stroke:P.value.backgroundColor,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,xt),d(`text`,{"text-anchor":M.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,"font-weight":M.value.dataLabels.bold?`bold`:`normal`,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),transform:`translate(${X(t,n).x+(M.value.dataLabels.markers.position===`left`?-M.value.dataLabels.offsetX-14:M.value.dataLabels.offsetX)+6}, ${X(t,n).y+M.value.dataLabels.fontSize/3})`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n),innerHTML:b(o)({content:Ln(t),fontSize:M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,St)],64)):l(``,!0)]))),128)),y(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0)],46,pt)),e.$slots.hint?(_(),u(`div`,Ct,[y(e.$slots,`hint`,h(p({hint:k.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):l(``,!0)]),e.$slots.watermark?(_(),u(`div`,wt,[y(e.$slots,`watermark`,h(p({isPrinting:b(hn)||b(gn)||b(nr)||b(rr)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${w.value}`},null,8,Tt),Qt.value&&(P.value.legend.show||e.$slots.legend)?(_(),c(qe,{key:6,to:P.value.legend.position===`top`?`#legend-top-${w.value}`:`#legend-bottom-${w.value}`},[d(`div`,{ref_key:`chartLegend`,ref:Gt},[y(e.$slots,`legend`,{legend:jn.value},()=>[P.value.legend.show?(_(),c(We,{key:`legend_${Xt.value}`,legendSet:jn.value,config:Mn.value,isCursorPointer:I.value,onClickMarker:t[0]||=({legend:e})=>Tn(e.uid)},Je({item:x(({legend:e,index:t})=>[b(L)?l(``,!0):(_(),u(`div`,{key:0,onClick:t=>Tn(e.uid),style:g(`opacity:${G.value.includes(e.uid)?.5:1}`)},it(e.display),13,Et))]),legendToggle:x(()=>[jn.value.length>2&&P.value.legend.selectAllToggle.show&&!b(L)?(_(),c(ze,{key:0,backgroundColor:P.value.legend.selectAllToggle.backgroundColor,color:P.value.legend.selectAllToggle.color,fontSize:P.value.legend.fontSize,checked:G.value.length>0,isCursorPointer:I.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):l(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:x(({legend:e,index:t})=>[Xe(Fe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${w.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):l(``,!0)],!0)],512)],8,[`to`])):l(``,!0),e.$slots.source?(_(),u(`div`,{key:7,ref_key:`source`,ref:Kt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),Xe(b(kt),{teleportTo:N.value.teleportTo,show:U.value.showTooltip&&T.value&&G.value.length<S.dataset.length,backgroundColor:N.value.backgroundColor,color:N.value.color,borderRadius:N.value.borderRadius,borderColor:N.value.borderColor,borderWidth:N.value.borderWidth,fontSize:N.value.fontSize,backgroundOpacity:N.value.backgroundOpacity,position:N.value.position,offsetX:N.value.offsetX,offsetY:N.value.offsetY,parent:D.value,content:Ht.value,isFullscreen:$.value,isCustom:N.value.customFormat&&typeof N.value.customFormat==`function`,smooth:N.value.smooth,backdropFilter:N.value.backdropFilter,smoothForce:N.value.smoothForce,smoothSnapThreshold:N.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":x(()=>[y(e.$slots,`tooltip-before`,h(p({...Bn.value})),void 0,!0)]),tooltip:x(()=>[y(e.$slots,`tooltip`,h(p({...Bn.value})),void 0,!0)]),"tooltip-after":x(()=>[y(e.$slots,`tooltip-after`,h(p({...Bn.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`]),Vt.value&&A.value.buttons.table?(_(),c(nt(Xn.value.component),Ze({key:8},Xn.value.props,{ref_key:`tableUnit`,ref:$t,onClose:Zn}),Je({content:x(()=>[(_(),c(b(Mt),{key:`table_${Yt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:k.value.table.useDialog?``:Xn.value.title,withCloseButton:!k.value.table.useDialog,isCursorPointer:I.value,onClose:Zn},{th:x(({th:e})=>[e===`__SUM__`?(_(),u(`div`,Dt,[Xe(b(At),{name:`sigma`,stroke:Q.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),u(`div`,Ot,it(e),1))]),td:x(({td:e})=>[Ye(it(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[k.value.table.useDialog?{name:`title`,fn:x(()=>[Ye(it(Xn.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:x(()=>[d(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Hn(A.value.callbacks.csv),style:g({cursor:I.value?`pointer`:`default`})},[Xe(b(At),{name:`fileCsv`,stroke:Xn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[b(L)?(_(),c(ve,{key:0})):l(``,!0)],!0)],46,lt))}},[[`__scopeId`,`data-v-c6f4397f`]]);export{ct as n,kt as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ct as r,D as i,Dt as a,F as o,Ht as s,Jt as c,P as l,Qt as u,S as d,X as f,_ as p,at as m,b as h,i as g,in as ee,jt as te,nt as ne,pt as re,t as ie,tn as ae,v as oe,w as se,yt as ce,zt as le}from"./lib-rPeBMZrn.js";import{n as ue,t as de}from"./BaseScanner-8NdoBs7B.js";import{n as fe,t as pe}from"./useHints-BH9r_0Vd.js";import{t as me}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as he}from"./resolveChartConfig-CIhClE5R.js";import{t as ge}from"./img-D4RQwASc.js";import{n as _e}from"./Title-BliHuXfT.js";import{t as ve}from"./useChartExport-BZts4KFb.js";import{n as ye,t as be}from"./tableIntegration-CNoJ1CIY.js";import{n as xe,t as Se}from"./annotationSlots-BRR85CqJ.js";import{n as Ce,t as we}from"./userOptionsSlots-DYuo-E5m.js";import{t as Te}from"./usePrinter-sVoTzet1.js";import{t as Ee}from"./useTransitions-ChGGrtrv.js";import{t as De}from"./useSvgLabelLayout-D1I8sQUi.js";import{t as Oe}from"./Shape-CRe8woTu.js";import{t as ke}from"./useResponsive-CENUxfEL.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Me}from"./A11yDataTable-DWNlWXzs.js";import{t as Ne}from"./useUserOptionState-CXlFnwPv.js";import{t as Pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Fe}from"./Legend-DM0ClX3D.js";import{t as Ie}from"./vue_ui_scatter-C50uFYQL.js";import{Fragment as _,Teleport as Le,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Re,createTextVNode as ze,createVNode as Be,defineAsyncComponent as Ve,guardReactiveProps as He,mergeProps as Ue,nextTick as We,normalizeClass as Ge,normalizeProps as Ke,normalizeStyle as qe,onBeforeUnmount as Je,onMounted as Ye,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as Xe,shallowRef as Ze,toDisplayString as D,toRefs as Qe,unref as O,watch as $e,withCtx as k}from"vue";var et=/* @__PURE__ */ e({default:()=>wn}),tt=[`id`],nt=[`id`],rt={key:0,class:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`},it=[`id`],at={style:{position:`relative`}},ot=[`xmlns`,`aria-describedby`,`viewBox`],st=[`width`,`height`],ct={key:1},lt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],dt={key:2},ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],pt=[`opacity`],mt=[`stroke`,`stroke-width`,`d`],ht=[`transform`,`font-size`,`fill`,`stroke`],gt={key:4},_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt=[`opacity`],yt=[`d`,`stroke`,`stroke-width`],bt=[`transform`,`font-size`,`fill`,`stroke`],xt={key:6},St=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`,`rx`],Ct=[`x`,`y`,`width`,`height`,`onMouseenter`],wt={key:2,style:{"pointer-events":`none`}},Tt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`],Et=[`x1`,`x2`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Dt=[`x1`,`x2`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Ot=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`rx`],kt=[`x`,`y`,`width`,`height`,`onMouseenter`],At={key:2,style:{"pointer-events":`none`}},jt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`],Mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Nt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Pt={key:0,style:{"pointer-events":`none`}},Ft=[`d`,`stroke`,`stroke-width`],It=[`d`,`stroke`,`stroke-width`],Lt=[`d`,`stroke`,`stroke-width`],Rt=[`d`,`stroke`,`stroke-width`],zt={key:7},Bt=[`points`,`fill`,`stroke-width`,`stroke-dasharray`,`stroke`],Vt={key:0,class:`vue-ui-scatter-datapoint`},Ht=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseover`,`onMouseleave`,`onClick`],Ut={key:1},Wt=[`transform`,`font-size`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Gt=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-opacity`],Kt={key:0,style:{"pointer-events":`none`}},qt=[`x`,`y`,`width`,`height`],Jt={key:0,style:{"pointer-events":`none !important`}},Yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Xt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Zt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],Qt=[`x`,`y`,`font-size`,`fill`,`font-weight`],$t=[`x`,`y`,`font-size`,`fill`],en=[`x`,`y`,`font-size`,`fill`],tn=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],nn=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],rn=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],an=[`id`,`transform`,`font-size`,`font-weight`,`fill`],on=[`font-size`,`fill`,`transform`],sn=[`transform`,`font-size`,`fill`],cn=[`x`,`y`,`font-size`,`fill`],ln=[`x`,`y`,`font-size`,`fill`],un=[`font-size`,`font-weight`,`fill`,`x`,`y`],dn=[`id`],fn=[`x`,`y`,`width`,`height`],pn={key:14,style:{pointerEvents:`none`}},mn=[`x1`,`x2`,`y1`,`y2`,`stroke-dasharray`,`stroke`,`stroke-width`,`clip-path`],hn=[`x`,`y`,`fill`,`font-size`,`font-weight`],gn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_n={key:6,class:`vue-data-ui-watermark`},vn=[`id`],yn=[`onClick`],bn={key:0,style:{width:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`}},xn={viewBox:`0 0 20 20`,height:`20`,width:`20`,style:{overflow:`hidden`,background:`transparent`}},Sn={key:0},Cn=[`innerHTML`],wn=/*#__PURE__*/ me({__name:`vue-ui-scatter`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`,`selectLegend`],setup(e,{expose:me,emit:et}){let wn=Ve(()=>import(`./Tooltip-C1q0Qoh7.js`)),Tn=Ve(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),En=Ve(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Dn=Ve(()=>import(`./DataTable-0Vv-aGHD.js`)),On=Ve(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),kn=Ve(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),An=Ve(()=>import(`./PackageVersion-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ct as r,D as i,Dt as a,F as o,Ht as s,Jt as c,P as l,Qt as u,S as d,X as f,_ as p,at as m,b as h,i as g,in as ee,jt as te,nt as ne,pt as re,t as ie,tn as ae,v as oe,w as se,yt as ce,zt as le}from"./lib-rPeBMZrn.js";import{n as ue,t as de}from"./BaseScanner-8NdoBs7B.js";import{n as fe,t as pe}from"./useHints-BH9r_0Vd.js";import{t as me}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as he}from"./resolveChartConfig-CIhClE5R.js";import{t as ge}from"./img-D4RQwASc.js";import{n as _e}from"./Title-BliHuXfT.js";import{t as ve}from"./useChartExport-BZts4KFb.js";import{n as ye,t as be}from"./tableIntegration-CNoJ1CIY.js";import{n as xe,t as Se}from"./annotationSlots-BRR85CqJ.js";import{n as Ce,t as we}from"./userOptionsSlots-DYuo-E5m.js";import{t as Te}from"./usePrinter-sVoTzet1.js";import{t as Ee}from"./useTransitions-ChGGrtrv.js";import{t as De}from"./useSvgLabelLayout-D1I8sQUi.js";import{t as Oe}from"./Shape-CRe8woTu.js";import{t as ke}from"./useResponsive-CENUxfEL.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Me}from"./A11yDataTable-DWNlWXzs.js";import{t as Ne}from"./useUserOptionState-CXlFnwPv.js";import{t as Pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Fe}from"./Legend-DM0ClX3D.js";import{t as Ie}from"./vue_ui_scatter-C50uFYQL.js";import{Fragment as _,Teleport as Le,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Re,createTextVNode as ze,createVNode as Be,defineAsyncComponent as Ve,guardReactiveProps as He,mergeProps as Ue,nextTick as We,normalizeClass as Ge,normalizeProps as Ke,normalizeStyle as qe,onBeforeUnmount as Je,onMounted as Ye,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as Xe,shallowRef as Ze,toDisplayString as D,toRefs as Qe,unref as O,watch as $e,withCtx as k}from"vue";var et=/* @__PURE__ */ e({default:()=>wn}),tt=[`id`],nt=[`id`],rt={key:0,class:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`},it=[`id`],at={style:{position:`relative`}},ot=[`xmlns`,`aria-describedby`,`viewBox`],st=[`width`,`height`],ct={key:1},lt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],dt={key:2},ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],pt=[`opacity`],mt=[`stroke`,`stroke-width`,`d`],ht=[`transform`,`font-size`,`fill`,`stroke`],gt={key:4},_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt=[`opacity`],yt=[`d`,`stroke`,`stroke-width`],bt=[`transform`,`font-size`,`fill`,`stroke`],xt={key:6},St=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`,`rx`],Ct=[`x`,`y`,`width`,`height`,`onMouseenter`],wt={key:2,style:{"pointer-events":`none`}},Tt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`],Et=[`x1`,`x2`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Dt=[`x1`,`x2`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Ot=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`rx`],kt=[`x`,`y`,`width`,`height`,`onMouseenter`],At={key:2,style:{"pointer-events":`none`}},jt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`],Mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Nt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-dasharray`,`stroke-width`],Pt={key:0,style:{"pointer-events":`none`}},Ft=[`d`,`stroke`,`stroke-width`],It=[`d`,`stroke`,`stroke-width`],Lt=[`d`,`stroke`,`stroke-width`],Rt=[`d`,`stroke`,`stroke-width`],zt={key:7},Bt=[`points`,`fill`,`stroke-width`,`stroke-dasharray`,`stroke`],Vt={key:0,class:`vue-ui-scatter-datapoint`},Ht=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseover`,`onMouseleave`,`onClick`],Ut={key:1},Wt=[`transform`,`font-size`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Gt=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-opacity`],Kt={key:0,style:{"pointer-events":`none`}},qt=[`x`,`y`,`width`,`height`],Jt={key:0,style:{"pointer-events":`none !important`}},Yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Xt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Zt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],Qt=[`x`,`y`,`font-size`,`fill`,`font-weight`],$t=[`x`,`y`,`font-size`,`fill`],en=[`x`,`y`,`font-size`,`fill`],tn=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],nn=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],rn=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],an=[`id`,`transform`,`font-size`,`font-weight`,`fill`],on=[`font-size`,`fill`,`transform`],sn=[`transform`,`font-size`,`fill`],cn=[`x`,`y`,`font-size`,`fill`],ln=[`x`,`y`,`font-size`,`fill`],un=[`font-size`,`font-weight`,`fill`,`x`,`y`],dn=[`id`],fn=[`x`,`y`,`width`,`height`],pn={key:14,style:{pointerEvents:`none`}},mn=[`x1`,`x2`,`y1`,`y2`,`stroke-dasharray`,`stroke`,`stroke-width`,`clip-path`],hn=[`x`,`y`,`fill`,`font-size`,`font-weight`],gn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_n={key:6,class:`vue-data-ui-watermark`},vn=[`id`],yn=[`onClick`],bn={key:0,style:{width:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`}},xn={viewBox:`0 0 20 20`,height:`20`,width:`20`,style:{overflow:`hidden`,background:`transparent`}},Sn={key:0},Cn=[`innerHTML`],wn=/*#__PURE__*/ me({__name:`vue-ui-scatter`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`,`selectLegend`],setup(e,{expose:me,emit:et}){let wn=Ve(()=>import(`./Tooltip-C1q0Qoh7.js`)),Tn=Ve(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),En=Ve(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Dn=Ve(()=>import(`./DataTable-0Vv-aGHD.js`)),On=Ve(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),kn=Ve(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),An=Ve(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),jn=Ve(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_scatter:Mn}=t(),A=e,Nn=et,Pn=v(()=>!!A.dataset&&A.dataset.length),j=w(f()),Fn=w(!1),In=w(``),Ln=w(0),Rn=w(null),zn=w(null),Bn=w(null),Vn=w(null),Hn=w(null),Un=w(0),Wn=w(0),Gn=w(0),M=w([]),Kn=w(!1),qn=w(null),Jn=w(null),Yn=w(null),Xn=w(null),Zn=w(null),Qn=w(null),$n=w(null),er=w(null),tr=w(null),nr=w(null),rr=w(null),ir=w({x:0,y:0}),ar=w(`pointer`),or=w(!1),sr=w(null),N=w(br()),P=v(()=>N.value.userOptions),F=v(()=>N.value.style.layout.dataLabels.xAxis),I=v(()=>N.value.style.layout.dataLabels.yAxis),L=v(()=>N.value.style.layout.marginalBars),R=v(()=>N.value.style.layout.plots),z=v(()=>N.value.style.tooltip),B=v(()=>N.value.style);fe({config:()=>N.value,dataset:()=>A.dataset,component:`VueUiScatter`,rules:[pe.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:cr}=Ee({config:()=>N.value.transitions,dataset:()=>A.dataset}),lr=v(()=>N.value.userOptions.useCursorPointer),ur=v(()=>a(N.value.events?.datapointClick));function dr(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 fr=v(()=>ee({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:pr,FINAL_DATASET:mr,manualLoading:hr}=ue({...Qe(A),FINAL_CONFIG:N,prepareConfig:br,skeletonDataset:A.config?.skeletonDataset??[{name:``,color:`#999999`,values:dr(100,.5,{seed:42})}],skeletonConfig:ee({defaultConfig:N.value,userConfig:fr.value})}),{userOptionsVisible:gr,setUserOptionsVisibility:_r,keepUserOptionState:vr}=Ne({config:N.value}),{svgRef:yr}=Pe({config:B.value.title});function br(){return he(A.config,Mn,Ie)}let xr=u(A.config);$e(()=>A.config,(e,t)=>{let n=u(e),r=n!==xr;xr=n;let i=br();r?(pr.value||(N.value=i),gr.value=!N.value.userOptions.showOnChartHover,Dr(),Un.value+=1,Wn.value+=1,Gn.value+=1,V.value.showTable=N.value.table.show,V.value.showTooltip=z.value.show,Er.value&&N.value.usePerformanceMode&&console.warn(`VueUiScatter : You are using performance mode
|
|
2
2
|
|
|
3
3
|
- downsampling is disabled in this mode, all plots are rendered
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{B as n,Jt as r,M as i,X as ee,t as a}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-BH9r_0Vd.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as re}from"./useNestedProp-DnGoh-XS.js";import{t as ie}from"./DefGrad-DKMq1REY.js";import{n as s}from"./PackageVersion-C4ZM3Vf7.js";import{Fragment as c,computed as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createStaticVNode as p,createVNode as m,normalizeClass as ae,normalizeStyle as h,openBlock as g,ref as _,renderList as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>G}),oe=[`id`],se=[`xmlns`],ce={transform:`translate(300, 300)`},le=[`d`,`fill`,`stroke`],ue=[`xmlns`],x=[`fill`,`stroke`],S=[`fill`,`stroke`],C=[`fill`,`stroke`],w=[`fill`,`stroke`],T=[`fill`,`stroke`],E=[`xmlns`],D=[`stroke`],O=[`stroke`],k=[`stroke`],A=[`fill`,`stroke`],j=[`fill`],M=[`fill`,`stroke`],N=[`fill`],P=[`fill`,`stroke`],F=[`fill`],I=[`fill`,`stroke`],L=[`fill`],R=[`fill`,`stroke`],z=[`fill`],B=[`fill`,`stroke`],V=[`fill`],H=[`xmlns`],U=[`stroke`],de=[`stroke`],fe=[`stroke`],pe=[`stroke`],me=[`stroke`],he=[`stroke`],ge=[`stroke`],_e=[`stroke`],ve=[`stroke`],ye=[`xmlns`],be=[`stroke`,`fill`],xe=[`xmlns`],Se=[`stroke`,`fill`],Ce=[`xmlns`],we=[`fill`],Te=[`fill`],Ee=[`fill`],De=[`fill`],Oe=[`xmlns`],ke=[`stroke`],Ae=[`fill`],je=[`stroke`,`fill`],Me=[`stroke`,`fill`],Ne=[`fill`],Pe=[`stroke`,`fill`],Fe=[`stroke`,`fill`],Ie=[`fill`],Le=[`stroke`,`fill`],Re=[`stroke`,`fill`],ze=[`fill`],Be=[`stroke`,`fill`],Ve=[`stroke`,`fill`],He=[`fill`],Ue=[`stroke`,`fill`],We=[`stroke`,`fill`],Ge=[`xmlns`],Ke=[`stroke`],qe=[`stroke`],Je=[`stroke`,`fill`],Ye=[`stroke`,`fill`],Xe=[`stroke`,`fill`],Ze=[`stroke`,`fill`],Qe=[`stroke`,`fill`],$e=[`stroke`,`fill`],et=[`stroke`,`fill`],tt=[`stroke`,`fill`],nt=[`stroke`,`fill`],rt=[`stroke`,`fill`],it=[`stroke`,`fill`],at=[`stroke`,`fill`],ot=[`stroke`,`fill`],st=[`stroke`,`fill`],ct=[`stroke`,`fill`],lt=[`stroke`,`fill`],ut=[`stroke`,`fill`],dt=[`stroke`,`fill`],ft=[`stroke`,`fill`],pt=[`stroke`,`fill`],mt=[`stroke`,`fill`],ht=[`stroke`,`fill`],gt=[`stroke`,`fill`],_t=[`xmlns`],vt=[`stroke`],yt=[`xmlns`],bt=[`stroke`],xt=[`xmlns`],St=[`stroke`],Ct=[`xmlns`],wt=[`fill`],Tt=[`fill`],Et=[`fill`],Dt=[`fill`],Ot=[`fill`],kt=[`fill`],At=[`fill`],jt=[`fill`],Mt=[`fill`],Nt=[`fill`],Pt=[`fill`],Ft=[`fill`],It=[`xmlns`],Lt=[`stroke`],Rt=[`stroke`],zt=[`stroke`],Bt=[`stroke`],Vt=[`stroke`],Ht=[`stroke`],Ut=[`xmlns`],Wt=[`stroke`],Gt=[`stroke`],Kt=[`stroke`],qt=[`stroke`],Jt=[`stroke`],Yt=[`stroke`],Xt=[`stroke`],Zt=[`stroke`],Qt=[`stroke`],$t=[`xmlns`],en=[`stroke`],tn=[`xmlns`],nn=[`stroke`],rn=[`stroke`],an=[`stroke`],on=[`stroke`],sn=[`stroke`],cn=[`stroke`],ln=[`stroke`],un=[`stroke`],dn=[`stroke`],fn=[`xmlns`],pn=[`x1`,`x2`,`stroke`],mn=[`xmlns`],hn=[`x`,`y`,`width`,`height`,`fill`],gn=[`y`,`width`,`height`,`fill`],_n=[`xmlns`],vn=[`fill`],yn=[`fill`],bn=[`fill`],xn=[`xmlns`],Sn=[`x1`,`x2`,`y1`,`y2`,`stroke`],Cn=[`stroke`],wn=[`fill`],Tn=[`xmlns`],En=[`fill`],Dn=[`fill`],On=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],kn=[`xmlns`],An={key:0},jn=[`stroke`,`stroke-width`],Mn=[`stroke`,`stroke-width`],Nn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Fn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],In=[`x`,`y`,`height`,`width`,`fill`],Ln=[`xmlns`,`viewBox`],Rn=[`x`,`y`,`stroke`,`fill`],zn=[`xmlns`],Bn=[`d`,`stroke`],Vn=[`cx`,`cy`,`r`,`fill`,`stroke`],Hn=[`cx`,`cy`,`r`,`fill`,`stroke`],Un=[`x`,`y`,`width`,`fill`],Wn=[`cx`,`cy`,`fill`],Gn=[`cx`,`cy`,`fill`],Kn=[`stroke`],qn=[`xmlns`],Jn=[`stroke`,`stroke-width`],Yn=[`stroke`,`stroke-width`],Xn=[`stroke`,`stroke-width`],Zn=[`fill`],Qn=[`fill`],$n=[`fill`],er=[`fill`],tr=[`fill`],nr=[`fill`],rr=[`xmlns`],ir={key:0},ar=[`stroke`,`stroke-width`],or=[`stroke`,`stroke-width`],sr=[`stroke`,`stroke-width`],cr={key:1},lr=[`r`,`fill`],ur=[`r`,`fill`],dr=[`xmlns`],fr={key:0},pr=[`stroke`,`stroke-width`],mr=[`stroke`,`stroke-width`],hr=[`fill`,`rx`,`x`,`y`,`width`,`height`],gr=[`xmlns`],_r=[`stroke-width`,`stroke`],vr=[`stroke-width`,`stroke`],yr=[`stroke-width`,`stroke`],br=[`xmlns`],xr=[`stroke`],Sr=[`stroke`],Cr=[`stroke`],wr=[`stroke`],Tr=[`fill`],Er=[`stroke`],Dr=[`xmlns`],Or=[`stroke`,`stroke-width`],kr=[`stroke`,`stroke-width`],Ar=[`fill`,`r`],jr=[`fill`,`r`],Mr=[`fill`,`r`],Nr=[`fill`,`r`],Pr=[`fill`,`r`],Fr=[`fill`,`r`],Ir=[`fill`,`r`],Lr=[`fill`,`r`],Rr=[`fill`,`r`],zr=[`xmlns`],Br=[`d`,`stroke`,`stroke-width`],Vr=[`d`,`stroke`,`stroke-width`],Hr=[`d`,`stroke`,`stroke-width`],Ur=[`d`,`stroke`,`stroke-width`],Wr=[`stroke`,`stroke-width`],Gr=[`stroke`,`stroke-width`],Kr=[`stroke`,`stroke-width`],qr=[`fill`],Jr=[`fill`],Yr=[`xmlns`],Xr=[`x`,`y`,`fill`],Zr=[`x`,`y`,`fill`],Qr=[`x`,`y`,`fill`],$r=[`xmlns`],ei=[`fill`],ti=[`fill`],ni=[`y1`,`y2`,`stroke`,`stroke-width`],ri=[`x1`,`x2`,`stroke`,`stroke-width`],ii=[`xmlns`,`stroke`],ai=[`fill`],oi=[`xmlns`,`stroke`],si=[`xmlns`,`stroke`],ci=[`fill`],li=[`xmlns`,`stroke`],ui=[`xmlns`,`stroke`],di=[`fill`],fi=[`xmlns`,`stroke`],pi=[`xmlns`,`stroke`],mi=[`fill`],hi=[`xmlns`,`stroke`],W=[`xmlns`,`stroke`],gi=[`fill`],_i=[`xmlns`,`stroke`],vi=[`xmlns`],yi=[`points`,`fill`,`stroke`,`stroke-width`],bi=[`xmlns`],xi={key:0},Si=[`stroke`,`stroke-width`],Ci=[`y`,`width`,`fill`,`rx`],G=/*#__PURE__*/ o({__name:`vue-ui-skeleton`,props:{config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_skeleton:o}=t(),b=e,G=_(`vue-ui-skeleton-${ee()}`),K=l(()=>re({userConfig:b.config,defaultConfig:o})),q=l(()=>K.value.style);te({config:()=>K.value,dataset:()=>[],component:`VueUiSkeleton`,rules:[ne.noHint]});let wi=l(()=>K.value.style.animated),J=l(()=>K.value.type),Ti=_([60,50,55,36,40,25,26,12]),Ei=l(()=>i({plot:{x:50,y:50},radius:40,sides:6}).path),Di=l(()=>i({plot:{x:50,y:50},radius:30,sides:6}).path),Oi=l(()=>i({plot:{x:50,y:50},radius:20,sides:6}).path),ki=l(()=>i({plot:{x:50,y:50},radius:10,sides:6}).path),Y=_([{root:{x:70,y:77,r:44,opacity:100},bars:[{x:200,y:37,opacity:100,width:240},{x:200,y:118,opacity:100,width:180},{x:200,y:253,opacity:100,width:80}]},{root:{x:70,y:177,r:32,opacity:70},bars:[{x:200,y:145,opacity:70,width:160},{x:200,y:172,opacity:70,width:140},{x:200,y:199,opacity:70,width:120}]},{root:{x:70,y:257,r:24,opacity:40},bars:[{x:200,y:64,opacity:40,width:220},{x:200,y:91,opacity:40,width:200},{x:200,y:226,opacity:40,width:100}]}]),X=_([{y:200,height:100,bar:50},{y:180,height:100,bar:40},{y:150,height:100,bar:30},{y:120,height:80,bar:50},{y:110,height:60,bar:30},{y:80,height:80,bar:10},{y:50,height:80,bar:40},{y:24,height:40,bar:24},{y:44,height:20,bar:13},{y:32,height:45,bar:19}]),Z=_([[3,2.5],[4,3.1],[8,6],[9.5,6.5],[12,11],[16,15],[18,18.2],[25,24],[24,26],[32,32],[33,32],[32,31],[38,37],[37,38],[42,41],[40,41],[44,45],[38,35],[31,32]]),Q=_([{x:40,y:30},{x:45,y:28},{x:50,y:25},{x:55,y:20},{x:60,y:27},{x:65,y:14},{x:70,y:23},{x:75,y:16},{x:80,y:25},{x:85,y:10},{x:90,y:18},{x:95,y:7},{x:100,y:12},{x:105,y:10},{x:110,y:20},{x:115,y:7},{x:120,y:14},{x:125,y:10},{x:130,y:19},{x:135,y:3},{x:140,y:10},{x:145,y:2},{x:150,y:1}]);function $(e,t=1){let n=29.85;return{x:200+160*Math.cos(n+e*Math.PI/180)*t,y:200+160*Math.sin(n+e*Math.PI/180)*t}}let Ai=l(()=>{let e=[];for(let t=0;t<100;t+=1)e.push({x1:$(360/100*t).x,y1:$(360/100*t).y,x2:$(360/100*t,.9).x,y2:$(360/100*t,.9).y,color:K.value.style.wheel.color});return e}),ji=_([`M1.74 203.99A204 204 0 01-131.29-156.13l15.44 18.36A180 180 0 001.53 179.99Z`,`M-123.33-162.5A204 204 0 01-10.2-203.75L-9-179.78a180 180 0 00-99.82 36.4Z`,`M0-180A180 180 0 01175.19 41.33l23.36 5.51A204 204 0 000-204Z`,`M172.91 50.03A180 180 0 0110.53 179.69l1.4 23.96A204 204 0 00195.96 56.7Z`,`M-166.87-67.49a180 180 0 0151.02-70.28Q0 0 119.83-134.32a180 180 0 0152.13 81.13Q0 0-166.87-67.49Z`,`M-29.99-177.48a180 180 0 0110.73-1.49Q0 0 112.89 140.2A180 180 0 0153.63 171.83Q0 0-29.99-177.48Z`,`M179.71 10.29a180 180 0 01-4.52 31.04Q0 0-40.87-175.3a180 180 0 0110.88-2.18Q0 0 179.71 10.29Z`,`M-19.26-178.97Q0 0-166.87-67.49a180 180 0 00-12.14 86.36Q0 0-9-179.78a180 180 0 00-10.26.81Z`,`M-108.82-143.38Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Z`,`M0-180a180 180 0 01119.83 45.68Q0 0 0-180a180 180 0 01119.83 45.68Q0 0 0-180Z`,`M-148.85 101.22Q0 0-179.01 18.87a180 180 0 0030.16 82.35Q0 0-179.01 18.87a180 180 0 0030.16 82.35Z`,`M1.53 179.99Q0 0 31.73 177.18a180 180 0 0021.9-5.35Q0 0-148.85 101.22A180 180 0 001.53 179.99Z`,`M31.73 177.18a180 180 0 01-21.2 2.51Q0 0 171.96-53.19a180 180 0 017.75 63.48Q0 0 31.73 177.18Z`,`M172.91 50.03Q0 0 112.89 140.2a180 180 0 0060.02-90.17Q0 0 112.89 140.2a180 180 0 0060.02-90.17Z`]);return(e,t)=>(g(),d(`div`,{id:G.value,class:ae({"vue-data-ui-component":!0,"vue-ui-skeleton":!0,"vue-ui-skeleton-animated":wi.value}),style:h(`background:${q.value.backgroundColor};color:${q.value.color};display:flex;align-items:center;justify-content:center;`)},[J.value===`chord`?(g(),d(`svg`,{key:0,xmlns:y(a),width:`100%`,viewBox:`0 0 600 600`,style:h({background:q.value.backgroundColor})},[m(s),f(`g`,ce,[(g(!0),d(c,null,v(ji.value,(e,t)=>(g(),d(`path`,{key:e,d:e,fill:q.value.chord.color,stroke:q.value.backgroundColor,"stroke-width":`2`,style:h({opacity:t>3?.6:1})},null,12,le))),128))])],12,se)):u(``,!0),J.value===`ridgeline`?(g(),d(`svg`,{key:1,xmlns:y(a),width:`100%`,viewBox:`20 0 512 200`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`defs`,null,[m(ie,{t:`linear`,id:`ridgeline-gradient-${G.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,q.value.ridgeline.color,1],[`30%`,q.value.ridgeline.color,.7],[`70%`,q.value.ridgeline.color,.3],[`100%`,q.value.ridgeline.color,.1]]},null,8,[`id`,`stops`])]),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 60c6.18-.6 12.36-1.11 18.55-1.79 6.18-.68 12.37-2.38 18.55-2.4 6.19-.01 12.37 0 18.56-.01 6.18-.02 12.37-5.3 18.55-5.3 6.19 0 12.37 4.95 18.56 4.95 6.18 0 12.37-2.78 18.55-2.78 6.19 0 12.37 1.02 18.56 1.92 6.18.9 12.37 4.58 18.55 4.58s12.37-6.71 18.55-6.71c6.19 0 12.37.89 18.56.89 6.18 0 12.37-4.48 18.55-4.48 6.19 0 12.37 4.79 18.56 4.79 6.18 0 12.37-26.07 18.55-26.07 6.19 0 12.37 9.31 18.56 13.85 6.18 4.54 12.37 13.39 18.55 13.39 6.19 0 12.37-36.14 18.56-36.14 6.18 0 12.36 38.45 18.55 38.45 6.18 0 12.37-11.46 18.55-16.94 6.19-5.48 12.37-15.97 18.56-15.97 6.18 0 12.37 16.4 18.55 16.4 6.19 0 12.37-.12 18.56-.35 6.18-.22 12.37-38.08 18.55-38.08 6.19 0 12.37 24.07 18.56 36.1V60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,x),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 90c6.18-.22 12.36-.35 18.55-.67 6.18-.32 12.37-1.65 18.55-1.65 6.19 0 12.37 1.66 18.56 1.66 6.18 0 12.37-8.76 18.55-8.76 6.19 0 12.37 4.15 18.56 4.15 6.18 0 12.37-8.44 18.55-8.44 6.19 0 12.37 10.87 18.56 10.87 6.18 0 12.37-9.21 18.55-12.16 6.18-2.96 12.37-6.97 18.55-6.97 6.19 0 12.37 9.59 18.56 12.77 6.18 3.18 12.37 7.6 18.55 7.6 6.19 0 12.37-24.44 18.56-24.44 6.18 0 12.37 16.97 18.55 16.97 6.19 0 12.37-20.62 18.56-20.62 6.18 0 12.37 20.37 18.55 20.37 6.19 0 12.37-13.13 18.56-13.13 6.18 0 12.36 13.51 18.55 13.51 6.18 0 12.37-26.41 18.55-26.41 6.19 0 12.37.49 18.56 1.26 6.18.78 12.37 13.82 18.55 13.82 6.19 0 12.37-5.3 18.56-8.3 6.18-3 12.37-9.81 18.55-9.81 6.19 0 12.37 19.82 18.56 29.72V90`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,S),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 120c6.18-.34 12.36-.55 18.55-1.01 6.18-.46 12.37-1.17 18.55-2.15 6.19-.99 12.37-3.7 18.56-4.69 6.18-.98 12.37-2.15 18.55-2.15 6.19 0 12.37.52 18.56 1.2 6.18.68 12.37 6.67 18.55 6.67 6.19 0 12.37-12.15 18.56-12.15 6.18 0 12.37 4.6 18.55 4.6S227.5 99.7 233.68 98.99c6.19-.71 12.37-1.18 18.56-1.18 6.18 0 12.37 17.75 18.55 18.22 6.19.48 12.37.74 18.56.74 6.18 0 12.37-17.09 18.55-17.09 6.19 0 12.37 12.68 18.56 12.68 6.18 0 12.37-.33 18.55-.67 6.19-.34 12.37-.79 18.56-2.06 6.18-1.26 12.36-25.45 18.55-25.45 6.18 0 12.37 10.35 18.55 10.35 6.19 0 12.37-21.07 18.56-21.07 6.18 0 12.37 33.27 18.55 33.27 6.19 0 12.37-26.97 18.56-26.97 6.18 0 12.37 26.97 18.55 27.36 6.19.4 12.37.41 18.56.61V120`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,C),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 150c6.18-.52 12.36-1.57 18.55-1.57 6.18 0 12.37 1.36 18.55 1.36 6.19 0 12.37-1.75 18.56-3.18 6.18-1.43 12.37-6.62 18.55-6.62 6.19 0 12.37 9.98 18.56 9.98 6.18 0 12.37-4.94 18.55-5.64 6.19-.71 12.37-.52 18.56-1.31 6.18-.78 12.37-12.43 18.55-12.43s12.37 18.52 18.55 18.52c6.19 0 12.37-2.49 18.56-2.49 6.18 0 12.37 3.02 18.55 3.02 6.19 0 12.37-29.39 18.56-29.39 6.18 0 12.37 5.56 18.55 8.36 6.19 2.81 12.37 5.14 18.56 8.47 6.18 3.34 12.37 12.25 18.55 12.25 6.19 0 12.37-4.3 18.56-8.78 6.18-4.48 12.36-28.77 18.55-28.77 6.18 0 12.37 1.29 18.55 3.02 6.19 1.72 12.37 18.36 18.56 18.36 6.18 0 12.37-7.68 18.55-12.92 6.19-5.24 12.37-18.51 18.56-20.1 6.18-1.58 12.37-2.7 18.55-2.7 6.19 0 12.37 34.69 18.56 52.04V150`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,w),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 180c6.18-.6 12.36-1.07 18.55-1.81 6.18-.74 12.37-2.86 18.55-2.86 6.19 0 12.37 2.14 18.56 2.14 6.18 0 12.37-7.08 18.55-7.08 6.19 0 12.37 1.08 18.56 2.03 6.18.95 12.37 4.75 18.55 4.75 6.19 0 12.37-2.45 18.56-4.62 6.18-2.17 12.37-10.99 18.55-10.99s12.37 9.58 18.55 9.58c6.19 0 12.37-.25 18.56-.69 6.18-.43 12.37-13.6 18.55-13.6 6.19 0 12.37 17.23 18.56 17.23 6.18 0 12.37-2.5 18.55-5.19 6.19-2.68 12.37-15.45 18.56-18 6.18-2.55 12.37-4.86 18.55-4.86 6.19 0 12.37 18.61 18.56 18.61 6.18 0 12.36-24.22 18.55-26.66 6.18-2.45 12.37-4.25 18.55-4.25 6.19 0 12.37 7.92 18.56 7.92 6.18 0 12.37-1.95 18.55-1.95 6.19 0 12.37 29.69 18.56 29.69 6.18 0 12.37-2.55 18.55-6.14 6.19-3.58 12.37-28.83 18.56-43.25v60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,T)],12,ue)):u(``,!0),J.value===`historyPlot`?(g(),d(`svg`,{key:2,xmlns:y(a),width:`100%`,viewBox:`0 0 612 512`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`line`,{x1:`12`,x2:`12`,y1:`12`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,D),f(`line`,{x1:`12`,x2:`600`,y1:`500`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,O),f(`path`,{d:`M 80,100 300,200 400,150 560,230 360,420 230,320`,fill:`none`,stroke:q.value.historyPlot.color,"stroke-width":`3`},null,8,k),f(`circle`,{cx:`80`,cy:`100`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,A),f(`text`,{x:`80`,y:`108`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 1 `,8,j),f(`circle`,{cx:`300`,cy:`200`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,M),f(`text`,{x:`300`,y:`208`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 2 `,8,N),f(`circle`,{cx:`400`,cy:`150`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,P),f(`text`,{x:`400`,y:`158`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 3 `,8,F),f(`circle`,{cx:`560`,cy:`230`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,I),f(`text`,{x:`560`,y:`238`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 4 `,8,L),f(`circle`,{cx:`360`,cy:`420`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,R),f(`text`,{x:`360`,y:`428`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 5 `,8,z),f(`circle`,{cx:`230`,cy:`320`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,B),f(`text`,{x:`230`,y:`328`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 6 `,8,V)],12,E)):u(``,!0),J.value===`circlePack`?(g(),d(`svg`,{key:3,xmlns:y(a),width:`100%`,viewBox:`0 0 100 100`,style:h(`background:${q.value.backgroundColor}`)},[f(`circle`,{cx:50,cy:50,r:20,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,U),f(`circle`,{cx:80,cy:50,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,de),f(`circle`,{cx:28,cy:30,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,fe),f(`circle`,{cx:25,cy:76,r:16,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,pe),f(`circle`,{cx:60,cy:78.5,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,me),f(`circle`,{cx:64,cy:20,r:13,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,he),f(`circle`,{cx:72,cy:37,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ge),f(`circle`,{cx:25,cy:45,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,_e),f(`circle`,{cx:70,cy:66,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ve)],12,H)):u(``,!0),J.value===`flow`?(g(),d(`svg`,{key:4,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 8l23 4L52 9 75 8v4H52L28 21 5 29ZM5 34l23 1L52 24l23-3v6L52 30 28 44l24-5 23 2v6L52 45 28 52H5Z`,stroke:q.value.flow.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.flow.color},null,8,be)],12,ye)):u(``,!0),J.value===`parallelCoordinatePlot`?(g(),d(`svg`,{key:5,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 10a1 1 0 000 2 1 1 0 000-2m23 5a1 1 0 000 2 1 1 0 000-2M52 8a1 1 0 000 2 1 1 0 000-2m23 3a1 1 0 000 2 1 1 0 000-2M6 11l21 5m2 0L51 9m2 0 21 3M5 50a1 1 0 000-2 1 1 0 000 2M28 39a1 1 0 000 2 1 1 0 000-2m24 6a1 1 0 000 2 1 1 0 000-2m23 0a1 1 0 000 2 1 1 0 000-2M6 49l21-9m2 0 22 6m2 0H74M5 25a1 1 0 000 2 1 1 0 000-2m23 6a1 1 0 000 2 1 1 0 000-2m24-8a1 1 0 000 2 1 1 0 000-2m23-2a1 1 0 000 2 1 1 0 000-2M6 26l21 6m2 0 22-8m2 0 21-2`,stroke:q.value.parallelCoordinatePlot.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.parallelCoordinatePlot.color},null,8,Se)],12,xe)):u(``,!0),J.value===`bullet`?(g(),d(`svg`,{key:6,xmlns:y(a),width:`100%`,viewBox:`0 0 600 96`,style:h(`background:${q.value.backgroundColor}`)},[f(`rect`,{fill:q.value.bullet.color,x:24,y:12,width:300,height:72,style:{opacity:`0.8`}},null,8,we),f(`rect`,{fill:q.value.bullet.color,x:324,y:12,width:150,height:72,style:{opacity:`0.6`}},null,8,Te),f(`rect`,{fill:q.value.bullet.color,x:474,y:12,width:102,height:72,style:{opacity:`0.3`}},null,8,Ee),f(`rect`,{fill:q.value.bullet.color,x:24,y:36,width:490,height:24,style:{opacity:`1`}},null,8,De)],12,Ce)):u(``,!0),J.value===`dumbbell`?(g(),d(`svg`,{key:7,xmlns:y(a),width:`100%`,viewBox:`0 0 100 55`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`line`,{x1:`3`,x2:`3`,y1:`3`,y2:`67`,stroke:q.value.dumbbell.color,"stroke-width":.5,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,ke),f(`path`,{d:`
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{B as n,Jt as r,M as i,X as ee,t as a}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-BH9r_0Vd.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as re}from"./useNestedProp-DnGoh-XS.js";import{t as ie}from"./DefGrad-DKMq1REY.js";import{n as s}from"./PackageVersion-BIhjLNBU.js";import{Fragment as c,computed as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createStaticVNode as p,createVNode as m,normalizeClass as ae,normalizeStyle as h,openBlock as g,ref as _,renderList as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>G}),oe=[`id`],se=[`xmlns`],ce={transform:`translate(300, 300)`},le=[`d`,`fill`,`stroke`],ue=[`xmlns`],x=[`fill`,`stroke`],S=[`fill`,`stroke`],C=[`fill`,`stroke`],w=[`fill`,`stroke`],T=[`fill`,`stroke`],E=[`xmlns`],D=[`stroke`],O=[`stroke`],k=[`stroke`],A=[`fill`,`stroke`],j=[`fill`],M=[`fill`,`stroke`],N=[`fill`],P=[`fill`,`stroke`],F=[`fill`],I=[`fill`,`stroke`],L=[`fill`],R=[`fill`,`stroke`],z=[`fill`],B=[`fill`,`stroke`],V=[`fill`],H=[`xmlns`],U=[`stroke`],de=[`stroke`],fe=[`stroke`],pe=[`stroke`],me=[`stroke`],he=[`stroke`],ge=[`stroke`],_e=[`stroke`],ve=[`stroke`],ye=[`xmlns`],be=[`stroke`,`fill`],xe=[`xmlns`],Se=[`stroke`,`fill`],Ce=[`xmlns`],we=[`fill`],Te=[`fill`],Ee=[`fill`],De=[`fill`],Oe=[`xmlns`],ke=[`stroke`],Ae=[`fill`],je=[`stroke`,`fill`],Me=[`stroke`,`fill`],Ne=[`fill`],Pe=[`stroke`,`fill`],Fe=[`stroke`,`fill`],Ie=[`fill`],Le=[`stroke`,`fill`],Re=[`stroke`,`fill`],ze=[`fill`],Be=[`stroke`,`fill`],Ve=[`stroke`,`fill`],He=[`fill`],Ue=[`stroke`,`fill`],We=[`stroke`,`fill`],Ge=[`xmlns`],Ke=[`stroke`],qe=[`stroke`],Je=[`stroke`,`fill`],Ye=[`stroke`,`fill`],Xe=[`stroke`,`fill`],Ze=[`stroke`,`fill`],Qe=[`stroke`,`fill`],$e=[`stroke`,`fill`],et=[`stroke`,`fill`],tt=[`stroke`,`fill`],nt=[`stroke`,`fill`],rt=[`stroke`,`fill`],it=[`stroke`,`fill`],at=[`stroke`,`fill`],ot=[`stroke`,`fill`],st=[`stroke`,`fill`],ct=[`stroke`,`fill`],lt=[`stroke`,`fill`],ut=[`stroke`,`fill`],dt=[`stroke`,`fill`],ft=[`stroke`,`fill`],pt=[`stroke`,`fill`],mt=[`stroke`,`fill`],ht=[`stroke`,`fill`],gt=[`stroke`,`fill`],_t=[`xmlns`],vt=[`stroke`],yt=[`xmlns`],bt=[`stroke`],xt=[`xmlns`],St=[`stroke`],Ct=[`xmlns`],wt=[`fill`],Tt=[`fill`],Et=[`fill`],Dt=[`fill`],Ot=[`fill`],kt=[`fill`],At=[`fill`],jt=[`fill`],Mt=[`fill`],Nt=[`fill`],Pt=[`fill`],Ft=[`fill`],It=[`xmlns`],Lt=[`stroke`],Rt=[`stroke`],zt=[`stroke`],Bt=[`stroke`],Vt=[`stroke`],Ht=[`stroke`],Ut=[`xmlns`],Wt=[`stroke`],Gt=[`stroke`],Kt=[`stroke`],qt=[`stroke`],Jt=[`stroke`],Yt=[`stroke`],Xt=[`stroke`],Zt=[`stroke`],Qt=[`stroke`],$t=[`xmlns`],en=[`stroke`],tn=[`xmlns`],nn=[`stroke`],rn=[`stroke`],an=[`stroke`],on=[`stroke`],sn=[`stroke`],cn=[`stroke`],ln=[`stroke`],un=[`stroke`],dn=[`stroke`],fn=[`xmlns`],pn=[`x1`,`x2`,`stroke`],mn=[`xmlns`],hn=[`x`,`y`,`width`,`height`,`fill`],gn=[`y`,`width`,`height`,`fill`],_n=[`xmlns`],vn=[`fill`],yn=[`fill`],bn=[`fill`],xn=[`xmlns`],Sn=[`x1`,`x2`,`y1`,`y2`,`stroke`],Cn=[`stroke`],wn=[`fill`],Tn=[`xmlns`],En=[`fill`],Dn=[`fill`],On=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],kn=[`xmlns`],An={key:0},jn=[`stroke`,`stroke-width`],Mn=[`stroke`,`stroke-width`],Nn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Fn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],In=[`x`,`y`,`height`,`width`,`fill`],Ln=[`xmlns`,`viewBox`],Rn=[`x`,`y`,`stroke`,`fill`],zn=[`xmlns`],Bn=[`d`,`stroke`],Vn=[`cx`,`cy`,`r`,`fill`,`stroke`],Hn=[`cx`,`cy`,`r`,`fill`,`stroke`],Un=[`x`,`y`,`width`,`fill`],Wn=[`cx`,`cy`,`fill`],Gn=[`cx`,`cy`,`fill`],Kn=[`stroke`],qn=[`xmlns`],Jn=[`stroke`,`stroke-width`],Yn=[`stroke`,`stroke-width`],Xn=[`stroke`,`stroke-width`],Zn=[`fill`],Qn=[`fill`],$n=[`fill`],er=[`fill`],tr=[`fill`],nr=[`fill`],rr=[`xmlns`],ir={key:0},ar=[`stroke`,`stroke-width`],or=[`stroke`,`stroke-width`],sr=[`stroke`,`stroke-width`],cr={key:1},lr=[`r`,`fill`],ur=[`r`,`fill`],dr=[`xmlns`],fr={key:0},pr=[`stroke`,`stroke-width`],mr=[`stroke`,`stroke-width`],hr=[`fill`,`rx`,`x`,`y`,`width`,`height`],gr=[`xmlns`],_r=[`stroke-width`,`stroke`],vr=[`stroke-width`,`stroke`],yr=[`stroke-width`,`stroke`],br=[`xmlns`],xr=[`stroke`],Sr=[`stroke`],Cr=[`stroke`],wr=[`stroke`],Tr=[`fill`],Er=[`stroke`],Dr=[`xmlns`],Or=[`stroke`,`stroke-width`],kr=[`stroke`,`stroke-width`],Ar=[`fill`,`r`],jr=[`fill`,`r`],Mr=[`fill`,`r`],Nr=[`fill`,`r`],Pr=[`fill`,`r`],Fr=[`fill`,`r`],Ir=[`fill`,`r`],Lr=[`fill`,`r`],Rr=[`fill`,`r`],zr=[`xmlns`],Br=[`d`,`stroke`,`stroke-width`],Vr=[`d`,`stroke`,`stroke-width`],Hr=[`d`,`stroke`,`stroke-width`],Ur=[`d`,`stroke`,`stroke-width`],Wr=[`stroke`,`stroke-width`],Gr=[`stroke`,`stroke-width`],Kr=[`stroke`,`stroke-width`],qr=[`fill`],Jr=[`fill`],Yr=[`xmlns`],Xr=[`x`,`y`,`fill`],Zr=[`x`,`y`,`fill`],Qr=[`x`,`y`,`fill`],$r=[`xmlns`],ei=[`fill`],ti=[`fill`],ni=[`y1`,`y2`,`stroke`,`stroke-width`],ri=[`x1`,`x2`,`stroke`,`stroke-width`],ii=[`xmlns`,`stroke`],ai=[`fill`],oi=[`xmlns`,`stroke`],si=[`xmlns`,`stroke`],ci=[`fill`],li=[`xmlns`,`stroke`],ui=[`xmlns`,`stroke`],di=[`fill`],fi=[`xmlns`,`stroke`],pi=[`xmlns`,`stroke`],mi=[`fill`],hi=[`xmlns`,`stroke`],W=[`xmlns`,`stroke`],gi=[`fill`],_i=[`xmlns`,`stroke`],vi=[`xmlns`],yi=[`points`,`fill`,`stroke`,`stroke-width`],bi=[`xmlns`],xi={key:0},Si=[`stroke`,`stroke-width`],Ci=[`y`,`width`,`fill`,`rx`],G=/*#__PURE__*/ o({__name:`vue-ui-skeleton`,props:{config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_skeleton:o}=t(),b=e,G=_(`vue-ui-skeleton-${ee()}`),K=l(()=>re({userConfig:b.config,defaultConfig:o})),q=l(()=>K.value.style);te({config:()=>K.value,dataset:()=>[],component:`VueUiSkeleton`,rules:[ne.noHint]});let wi=l(()=>K.value.style.animated),J=l(()=>K.value.type),Ti=_([60,50,55,36,40,25,26,12]),Ei=l(()=>i({plot:{x:50,y:50},radius:40,sides:6}).path),Di=l(()=>i({plot:{x:50,y:50},radius:30,sides:6}).path),Oi=l(()=>i({plot:{x:50,y:50},radius:20,sides:6}).path),ki=l(()=>i({plot:{x:50,y:50},radius:10,sides:6}).path),Y=_([{root:{x:70,y:77,r:44,opacity:100},bars:[{x:200,y:37,opacity:100,width:240},{x:200,y:118,opacity:100,width:180},{x:200,y:253,opacity:100,width:80}]},{root:{x:70,y:177,r:32,opacity:70},bars:[{x:200,y:145,opacity:70,width:160},{x:200,y:172,opacity:70,width:140},{x:200,y:199,opacity:70,width:120}]},{root:{x:70,y:257,r:24,opacity:40},bars:[{x:200,y:64,opacity:40,width:220},{x:200,y:91,opacity:40,width:200},{x:200,y:226,opacity:40,width:100}]}]),X=_([{y:200,height:100,bar:50},{y:180,height:100,bar:40},{y:150,height:100,bar:30},{y:120,height:80,bar:50},{y:110,height:60,bar:30},{y:80,height:80,bar:10},{y:50,height:80,bar:40},{y:24,height:40,bar:24},{y:44,height:20,bar:13},{y:32,height:45,bar:19}]),Z=_([[3,2.5],[4,3.1],[8,6],[9.5,6.5],[12,11],[16,15],[18,18.2],[25,24],[24,26],[32,32],[33,32],[32,31],[38,37],[37,38],[42,41],[40,41],[44,45],[38,35],[31,32]]),Q=_([{x:40,y:30},{x:45,y:28},{x:50,y:25},{x:55,y:20},{x:60,y:27},{x:65,y:14},{x:70,y:23},{x:75,y:16},{x:80,y:25},{x:85,y:10},{x:90,y:18},{x:95,y:7},{x:100,y:12},{x:105,y:10},{x:110,y:20},{x:115,y:7},{x:120,y:14},{x:125,y:10},{x:130,y:19},{x:135,y:3},{x:140,y:10},{x:145,y:2},{x:150,y:1}]);function $(e,t=1){let n=29.85;return{x:200+160*Math.cos(n+e*Math.PI/180)*t,y:200+160*Math.sin(n+e*Math.PI/180)*t}}let Ai=l(()=>{let e=[];for(let t=0;t<100;t+=1)e.push({x1:$(360/100*t).x,y1:$(360/100*t).y,x2:$(360/100*t,.9).x,y2:$(360/100*t,.9).y,color:K.value.style.wheel.color});return e}),ji=_([`M1.74 203.99A204 204 0 01-131.29-156.13l15.44 18.36A180 180 0 001.53 179.99Z`,`M-123.33-162.5A204 204 0 01-10.2-203.75L-9-179.78a180 180 0 00-99.82 36.4Z`,`M0-180A180 180 0 01175.19 41.33l23.36 5.51A204 204 0 000-204Z`,`M172.91 50.03A180 180 0 0110.53 179.69l1.4 23.96A204 204 0 00195.96 56.7Z`,`M-166.87-67.49a180 180 0 0151.02-70.28Q0 0 119.83-134.32a180 180 0 0152.13 81.13Q0 0-166.87-67.49Z`,`M-29.99-177.48a180 180 0 0110.73-1.49Q0 0 112.89 140.2A180 180 0 0153.63 171.83Q0 0-29.99-177.48Z`,`M179.71 10.29a180 180 0 01-4.52 31.04Q0 0-40.87-175.3a180 180 0 0110.88-2.18Q0 0 179.71 10.29Z`,`M-19.26-178.97Q0 0-166.87-67.49a180 180 0 00-12.14 86.36Q0 0-9-179.78a180 180 0 00-10.26.81Z`,`M-108.82-143.38Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Z`,`M0-180a180 180 0 01119.83 45.68Q0 0 0-180a180 180 0 01119.83 45.68Q0 0 0-180Z`,`M-148.85 101.22Q0 0-179.01 18.87a180 180 0 0030.16 82.35Q0 0-179.01 18.87a180 180 0 0030.16 82.35Z`,`M1.53 179.99Q0 0 31.73 177.18a180 180 0 0021.9-5.35Q0 0-148.85 101.22A180 180 0 001.53 179.99Z`,`M31.73 177.18a180 180 0 01-21.2 2.51Q0 0 171.96-53.19a180 180 0 017.75 63.48Q0 0 31.73 177.18Z`,`M172.91 50.03Q0 0 112.89 140.2a180 180 0 0060.02-90.17Q0 0 112.89 140.2a180 180 0 0060.02-90.17Z`]);return(e,t)=>(g(),d(`div`,{id:G.value,class:ae({"vue-data-ui-component":!0,"vue-ui-skeleton":!0,"vue-ui-skeleton-animated":wi.value}),style:h(`background:${q.value.backgroundColor};color:${q.value.color};display:flex;align-items:center;justify-content:center;`)},[J.value===`chord`?(g(),d(`svg`,{key:0,xmlns:y(a),width:`100%`,viewBox:`0 0 600 600`,style:h({background:q.value.backgroundColor})},[m(s),f(`g`,ce,[(g(!0),d(c,null,v(ji.value,(e,t)=>(g(),d(`path`,{key:e,d:e,fill:q.value.chord.color,stroke:q.value.backgroundColor,"stroke-width":`2`,style:h({opacity:t>3?.6:1})},null,12,le))),128))])],12,se)):u(``,!0),J.value===`ridgeline`?(g(),d(`svg`,{key:1,xmlns:y(a),width:`100%`,viewBox:`20 0 512 200`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`defs`,null,[m(ie,{t:`linear`,id:`ridgeline-gradient-${G.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,q.value.ridgeline.color,1],[`30%`,q.value.ridgeline.color,.7],[`70%`,q.value.ridgeline.color,.3],[`100%`,q.value.ridgeline.color,.1]]},null,8,[`id`,`stops`])]),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 60c6.18-.6 12.36-1.11 18.55-1.79 6.18-.68 12.37-2.38 18.55-2.4 6.19-.01 12.37 0 18.56-.01 6.18-.02 12.37-5.3 18.55-5.3 6.19 0 12.37 4.95 18.56 4.95 6.18 0 12.37-2.78 18.55-2.78 6.19 0 12.37 1.02 18.56 1.92 6.18.9 12.37 4.58 18.55 4.58s12.37-6.71 18.55-6.71c6.19 0 12.37.89 18.56.89 6.18 0 12.37-4.48 18.55-4.48 6.19 0 12.37 4.79 18.56 4.79 6.18 0 12.37-26.07 18.55-26.07 6.19 0 12.37 9.31 18.56 13.85 6.18 4.54 12.37 13.39 18.55 13.39 6.19 0 12.37-36.14 18.56-36.14 6.18 0 12.36 38.45 18.55 38.45 6.18 0 12.37-11.46 18.55-16.94 6.19-5.48 12.37-15.97 18.56-15.97 6.18 0 12.37 16.4 18.55 16.4 6.19 0 12.37-.12 18.56-.35 6.18-.22 12.37-38.08 18.55-38.08 6.19 0 12.37 24.07 18.56 36.1V60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,x),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 90c6.18-.22 12.36-.35 18.55-.67 6.18-.32 12.37-1.65 18.55-1.65 6.19 0 12.37 1.66 18.56 1.66 6.18 0 12.37-8.76 18.55-8.76 6.19 0 12.37 4.15 18.56 4.15 6.18 0 12.37-8.44 18.55-8.44 6.19 0 12.37 10.87 18.56 10.87 6.18 0 12.37-9.21 18.55-12.16 6.18-2.96 12.37-6.97 18.55-6.97 6.19 0 12.37 9.59 18.56 12.77 6.18 3.18 12.37 7.6 18.55 7.6 6.19 0 12.37-24.44 18.56-24.44 6.18 0 12.37 16.97 18.55 16.97 6.19 0 12.37-20.62 18.56-20.62 6.18 0 12.37 20.37 18.55 20.37 6.19 0 12.37-13.13 18.56-13.13 6.18 0 12.36 13.51 18.55 13.51 6.18 0 12.37-26.41 18.55-26.41 6.19 0 12.37.49 18.56 1.26 6.18.78 12.37 13.82 18.55 13.82 6.19 0 12.37-5.3 18.56-8.3 6.18-3 12.37-9.81 18.55-9.81 6.19 0 12.37 19.82 18.56 29.72V90`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,S),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 120c6.18-.34 12.36-.55 18.55-1.01 6.18-.46 12.37-1.17 18.55-2.15 6.19-.99 12.37-3.7 18.56-4.69 6.18-.98 12.37-2.15 18.55-2.15 6.19 0 12.37.52 18.56 1.2 6.18.68 12.37 6.67 18.55 6.67 6.19 0 12.37-12.15 18.56-12.15 6.18 0 12.37 4.6 18.55 4.6S227.5 99.7 233.68 98.99c6.19-.71 12.37-1.18 18.56-1.18 6.18 0 12.37 17.75 18.55 18.22 6.19.48 12.37.74 18.56.74 6.18 0 12.37-17.09 18.55-17.09 6.19 0 12.37 12.68 18.56 12.68 6.18 0 12.37-.33 18.55-.67 6.19-.34 12.37-.79 18.56-2.06 6.18-1.26 12.36-25.45 18.55-25.45 6.18 0 12.37 10.35 18.55 10.35 6.19 0 12.37-21.07 18.56-21.07 6.18 0 12.37 33.27 18.55 33.27 6.19 0 12.37-26.97 18.56-26.97 6.18 0 12.37 26.97 18.55 27.36 6.19.4 12.37.41 18.56.61V120`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,C),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 150c6.18-.52 12.36-1.57 18.55-1.57 6.18 0 12.37 1.36 18.55 1.36 6.19 0 12.37-1.75 18.56-3.18 6.18-1.43 12.37-6.62 18.55-6.62 6.19 0 12.37 9.98 18.56 9.98 6.18 0 12.37-4.94 18.55-5.64 6.19-.71 12.37-.52 18.56-1.31 6.18-.78 12.37-12.43 18.55-12.43s12.37 18.52 18.55 18.52c6.19 0 12.37-2.49 18.56-2.49 6.18 0 12.37 3.02 18.55 3.02 6.19 0 12.37-29.39 18.56-29.39 6.18 0 12.37 5.56 18.55 8.36 6.19 2.81 12.37 5.14 18.56 8.47 6.18 3.34 12.37 12.25 18.55 12.25 6.19 0 12.37-4.3 18.56-8.78 6.18-4.48 12.36-28.77 18.55-28.77 6.18 0 12.37 1.29 18.55 3.02 6.19 1.72 12.37 18.36 18.56 18.36 6.18 0 12.37-7.68 18.55-12.92 6.19-5.24 12.37-18.51 18.56-20.1 6.18-1.58 12.37-2.7 18.55-2.7 6.19 0 12.37 34.69 18.56 52.04V150`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,w),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 180c6.18-.6 12.36-1.07 18.55-1.81 6.18-.74 12.37-2.86 18.55-2.86 6.19 0 12.37 2.14 18.56 2.14 6.18 0 12.37-7.08 18.55-7.08 6.19 0 12.37 1.08 18.56 2.03 6.18.95 12.37 4.75 18.55 4.75 6.19 0 12.37-2.45 18.56-4.62 6.18-2.17 12.37-10.99 18.55-10.99s12.37 9.58 18.55 9.58c6.19 0 12.37-.25 18.56-.69 6.18-.43 12.37-13.6 18.55-13.6 6.19 0 12.37 17.23 18.56 17.23 6.18 0 12.37-2.5 18.55-5.19 6.19-2.68 12.37-15.45 18.56-18 6.18-2.55 12.37-4.86 18.55-4.86 6.19 0 12.37 18.61 18.56 18.61 6.18 0 12.36-24.22 18.55-26.66 6.18-2.45 12.37-4.25 18.55-4.25 6.19 0 12.37 7.92 18.56 7.92 6.18 0 12.37-1.95 18.55-1.95 6.19 0 12.37 29.69 18.56 29.69 6.18 0 12.37-2.55 18.55-6.14 6.19-3.58 12.37-28.83 18.56-43.25v60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,T)],12,ue)):u(``,!0),J.value===`historyPlot`?(g(),d(`svg`,{key:2,xmlns:y(a),width:`100%`,viewBox:`0 0 612 512`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`line`,{x1:`12`,x2:`12`,y1:`12`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,D),f(`line`,{x1:`12`,x2:`600`,y1:`500`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,O),f(`path`,{d:`M 80,100 300,200 400,150 560,230 360,420 230,320`,fill:`none`,stroke:q.value.historyPlot.color,"stroke-width":`3`},null,8,k),f(`circle`,{cx:`80`,cy:`100`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,A),f(`text`,{x:`80`,y:`108`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 1 `,8,j),f(`circle`,{cx:`300`,cy:`200`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,M),f(`text`,{x:`300`,y:`208`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 2 `,8,N),f(`circle`,{cx:`400`,cy:`150`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,P),f(`text`,{x:`400`,y:`158`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 3 `,8,F),f(`circle`,{cx:`560`,cy:`230`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,I),f(`text`,{x:`560`,y:`238`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 4 `,8,L),f(`circle`,{cx:`360`,cy:`420`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,R),f(`text`,{x:`360`,y:`428`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 5 `,8,z),f(`circle`,{cx:`230`,cy:`320`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,B),f(`text`,{x:`230`,y:`328`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 6 `,8,V)],12,E)):u(``,!0),J.value===`circlePack`?(g(),d(`svg`,{key:3,xmlns:y(a),width:`100%`,viewBox:`0 0 100 100`,style:h(`background:${q.value.backgroundColor}`)},[f(`circle`,{cx:50,cy:50,r:20,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,U),f(`circle`,{cx:80,cy:50,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,de),f(`circle`,{cx:28,cy:30,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,fe),f(`circle`,{cx:25,cy:76,r:16,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,pe),f(`circle`,{cx:60,cy:78.5,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,me),f(`circle`,{cx:64,cy:20,r:13,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,he),f(`circle`,{cx:72,cy:37,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ge),f(`circle`,{cx:25,cy:45,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,_e),f(`circle`,{cx:70,cy:66,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ve)],12,H)):u(``,!0),J.value===`flow`?(g(),d(`svg`,{key:4,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 8l23 4L52 9 75 8v4H52L28 21 5 29ZM5 34l23 1L52 24l23-3v6L52 30 28 44l24-5 23 2v6L52 45 28 52H5Z`,stroke:q.value.flow.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.flow.color},null,8,be)],12,ye)):u(``,!0),J.value===`parallelCoordinatePlot`?(g(),d(`svg`,{key:5,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 10a1 1 0 000 2 1 1 0 000-2m23 5a1 1 0 000 2 1 1 0 000-2M52 8a1 1 0 000 2 1 1 0 000-2m23 3a1 1 0 000 2 1 1 0 000-2M6 11l21 5m2 0L51 9m2 0 21 3M5 50a1 1 0 000-2 1 1 0 000 2M28 39a1 1 0 000 2 1 1 0 000-2m24 6a1 1 0 000 2 1 1 0 000-2m23 0a1 1 0 000 2 1 1 0 000-2M6 49l21-9m2 0 22 6m2 0H74M5 25a1 1 0 000 2 1 1 0 000-2m23 6a1 1 0 000 2 1 1 0 000-2m24-8a1 1 0 000 2 1 1 0 000-2m23-2a1 1 0 000 2 1 1 0 000-2M6 26l21 6m2 0 22-8m2 0 21-2`,stroke:q.value.parallelCoordinatePlot.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.parallelCoordinatePlot.color},null,8,Se)],12,xe)):u(``,!0),J.value===`bullet`?(g(),d(`svg`,{key:6,xmlns:y(a),width:`100%`,viewBox:`0 0 600 96`,style:h(`background:${q.value.backgroundColor}`)},[f(`rect`,{fill:q.value.bullet.color,x:24,y:12,width:300,height:72,style:{opacity:`0.8`}},null,8,we),f(`rect`,{fill:q.value.bullet.color,x:324,y:12,width:150,height:72,style:{opacity:`0.6`}},null,8,Te),f(`rect`,{fill:q.value.bullet.color,x:474,y:12,width:102,height:72,style:{opacity:`0.3`}},null,8,Ee),f(`rect`,{fill:q.value.bullet.color,x:24,y:36,width:490,height:24,style:{opacity:`1`}},null,8,De)],12,Ce)):u(``,!0),J.value===`dumbbell`?(g(),d(`svg`,{key:7,xmlns:y(a),width:`100%`,viewBox:`0 0 100 55`,style:h(`background:${q.value.backgroundColor}`)},[m(s),f(`line`,{x1:`3`,x2:`3`,y1:`3`,y2:`67`,stroke:q.value.dumbbell.color,"stroke-width":.5,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,ke),f(`path`,{d:`
|
|
2
2
|
M 30,11
|
|
3
3
|
C 39,10 39,10
|
|
4
4
|
45,11
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.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{n as oe,t as se}from"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-BH9r_0Vd.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ue}from"./resolveChartConfig-CIhClE5R.js";import{c as de}from"./canvas-lib-22VpOI4_.js";import{t as fe}from"./useResponsive-CENUxfEL.js";import{t as pe}from"./DefGrad-DKMq1REY.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./useFitSvgText-C1QC4P5G.js";import{t as ge}from"./vue_ui_spark_trend-BOM3zo64.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-C4ZM3Vf7.js`).then(e=>e.t)),{vue_ui_spark_trend:Te}=t(),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);ce({config:()=>D.value,dataset:()=>y.dataset,component:`VueUiSparkTrend`,rules:[le.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}=oe({...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 ue(y.config,Te,ge)}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=de(()=>{let{width:e,height:t}=fe({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:$}=he({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(pe,{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(se,{key:0})):u(``,!0)],!0)],12,Ee))}},[[`__scopeId`,`data-v-814f1b0f`]]);export{Te as n,v as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.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{n as oe,t as se}from"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-BH9r_0Vd.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ue}from"./resolveChartConfig-CIhClE5R.js";import{c as de}from"./canvas-lib-22VpOI4_.js";import{t as fe}from"./useResponsive-CENUxfEL.js";import{t as pe}from"./DefGrad-DKMq1REY.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./useFitSvgText-C1QC4P5G.js";import{t as ge}from"./vue_ui_spark_trend-BOM3zo64.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-BIhjLNBU.js`).then(e=>e.t)),{vue_ui_spark_trend:Te}=t(),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);ce({config:()=>D.value,dataset:()=>y.dataset,component:`VueUiSparkTrend`,rules:[le.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}=oe({...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 ue(y.config,Te,ge)}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=de(()=>{let{width:e,height:t}=fe({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:$}=he({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(pe,{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(se,{key:0})):u(``,!0)],!0)],12,Ee))}},[[`__scopeId`,`data-v-814f1b0f`]]);export{Te as n,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.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"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-BH9r_0Vd.js";import{n as ue}from"./resolveChartConfig-CIhClE5R.js";import{t as de}from"./DefGrad-DKMq1REY.js";import{t as l}from"./usePrefersMotion-XLHwega2.js";import{t as u}from"./vue_ui_sparkbar-Bpx7QrFq.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-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.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"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-BH9r_0Vd.js";import{n as ue}from"./resolveChartConfig-CIhClE5R.js";import{t as de}from"./DefGrad-DKMq1REY.js";import{t as l}from"./usePrefersMotion-XLHwega2.js";import{t as u}from"./vue_ui_sparkbar-Bpx7QrFq.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-BIhjLNBU.js`).then(e=>e.t)),{vue_ui_sparkbar:be}=t(),F=l(),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.`)}),ce({config:()=>R.value,dataset:()=>I.dataset,component:`VueUiSparkbar`,rules:[le.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}=oe({...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 ue(I.config,be,u)}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(de,{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(se,{key:3})):p(``,!0)],4))}};export{E as n,P as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.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"./BaseScanner-8NdoBs7B.js";import{n as re,t as ie}from"./useHints-BH9r_0Vd.js";import{t as ae}from"./resolveChartConfig-CIhClE5R.js";import{t as oe}from"./DefGrad-DKMq1REY.js";import{t as se}from"./useChartAccessibility-DOMuYJfm.js";import{t as ce}from"./usePrefersMotion-XLHwega2.js";import{t as le}from"./vue_ui_sparkgauge-D2Hk6bvS.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-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.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"./BaseScanner-8NdoBs7B.js";import{n as re,t as ie}from"./useHints-BH9r_0Vd.js";import{t as ae}from"./resolveChartConfig-CIhClE5R.js";import{t as oe}from"./DefGrad-DKMq1REY.js";import{t as se}from"./useChartAccessibility-DOMuYJfm.js";import{t as ce}from"./usePrefersMotion-XLHwega2.js";import{t as le}from"./vue_ui_sparkgauge-D2Hk6bvS.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-BIhjLNBU.js`).then(e=>e.t)),{vue_ui_sparkgauge:j}=t(),M=ce(),N=b(null),P=e,F=b(i()),I=b(W()),L=d(()=>I.value.style.dataLabel),R=d(()=>I.value.style);re({config:()=>I.value,dataset:()=>P.dataset,component:`VueUiSparkgauge`,rules:[ie.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}=te({...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}=se({config:{text:P.dataset?.title||``}});function W(){return ae(P.config,j,le)}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(oe,{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(ne,{key:0})):p(``,!0)])],4))}};export{T as n,j as t};
|