vue-data-ui 3.27.1-beta.0 → 3.27.1
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/{Arrow-CJeSufxg.js → Arrow-C2W0uGrq.js} +1 -1
- package/dist/{BaseDraggableDialog-T1gEsQid.js → BaseDraggableDialog-D_tuHEjO.js} +1 -1
- package/dist/{BaseIcon-Cz30ODFA.js → BaseIcon-DdIyewwY.js} +1 -1
- package/dist/{BaseLegendToggle-Dn_tNvn4.js → BaseLegendToggle-Bq5FjyuI.js} +1 -1
- package/dist/{BaseZoomControls-xq3tWD3j.js → BaseZoomControls-DoYifY2y.js} +1 -1
- package/dist/{ColorPicker-CUjEw53A.js → ColorPicker-MLwiwxl5.js} +1 -1
- package/dist/{DataTable-DSUA5M9p.js → DataTable-WNecJMcY.js} +1 -1
- package/dist/{HillActions-DdvXld3a.js → HillActions-CHg1AQ3p.js} +1 -1
- package/dist/{Legend-DokTll4u.js → Legend-D8YoT1RJ.js} +1 -1
- package/dist/{NonSvgPenAndPaper-BLzQuIm6.js → NonSvgPenAndPaper-CqtJpZKh.js} +1 -1
- package/dist/{PackageVersion-D6pKL176.js → PackageVersion-CdkxOy58.js} +1 -1
- package/dist/{PenAndPaper-DvJJaeU2.js → PenAndPaper-IMw576MC.js} +1 -1
- package/dist/{Shape-tkp65OcG.js → Shape-Bp9YNtPc.js} +1 -1
- package/dist/SlicerPreview-CNUciSbY.js +1 -0
- package/dist/{SparkTooltip-BlJLvizH.js → SparkTooltip-C5JMcBXT.js} +1 -1
- package/dist/{Title-BRAjxtjG.js → Title-BGYFqulv.js} +1 -1
- package/dist/{Tooltip-BUXB0i6z.js → Tooltip-Cus2-XNQ.js} +1 -1
- package/dist/{UserOptions-D65t74CM.js → UserOptions-DTxMeZv3.js} +1 -1
- package/dist/{chartImage-NwZO-elv.js → chartImage-CIvU_04o.js} +1 -1
- package/dist/components/arrow.js +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-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-icon.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-label.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/{dom-to-png-Cp3WLHmJ.js → dom-to-png-D8t3Bm7s.js} +1 -1
- package/dist/{exposedLib-CMTeSmyW.js → exposedLib-DHtyEc_G.js} +1 -1
- package/dist/{img-8sM3sVWU.js → img-DiT4ivZ5.js} +1 -1
- package/dist/{labelUtils-Djp5nJtN.js → labelUtils-CG3uVXoZ.js} +1 -1
- package/dist/{lib-zDxoqrgo.js → lib-CV_IANZ6.js} +2 -2
- package/dist/package-DE5cU1Rg.js +1 -0
- package/dist/{pdf-Dlv_ks7R.js → pdf-BQSB1V3H.js} +1 -1
- package/dist/{render-common-DOYi0f4Z.js → render-common-BdZ5aRyn.js} +1 -1
- package/dist/{resolveChartConfig-BSo1Oe9n.js → resolveChartConfig-DZg-korK.js} +1 -1
- package/dist/ssr/vue-ui-donut.js +1 -1
- package/dist/ssr/vue-ui-xy.js +1 -1
- package/dist/ssr.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-CT9phgWx.js → useNestedProp-CB186vF2.js} +1 -1
- package/dist/{useObjectBindings-DM3xDKV3.js → useObjectBindings-Dse7YyAf.js} +1 -1
- package/dist/{usePrinter-CnyKPIFM.js → usePrinter-hLW3cv4N.js} +1 -1
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-DyYgLIZN.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DiaiNy-k.js → vue-ui-3d-bar-BZAoyWkc.js} +1 -1
- package/dist/{vue-ui-accordion-Dy5OVFKr.js → vue-ui-accordion-BNvevckx.js} +1 -1
- package/dist/{vue-ui-age-pyramid-OeUr1yxi.js → vue-ui-age-pyramid-DkA6vpU3.js} +1 -1
- package/dist/{vue-ui-annotator-DA_xAFql.js → vue-ui-annotator-DuQME4Hh.js} +1 -1
- package/dist/{vue-ui-bullet-B9lcCTVb.js → vue-ui-bullet-BVs8JX8S.js} +1 -1
- package/dist/{vue-ui-bump-DYajIrva.js → vue-ui-bump-DYdm3EvF.js} +1 -1
- package/dist/{vue-ui-candlestick-CdAZuNxo.js → vue-ui-candlestick-DZgxl4mW.js} +1 -1
- package/dist/{vue-ui-carousel-table-ihGH0LDH.js → vue-ui-carousel-table-BB7DsTUt.js} +1 -1
- package/dist/{vue-ui-chestnut-B2aNXFNO.js → vue-ui-chestnut-Bo1h5rBt.js} +1 -1
- package/dist/{vue-ui-chord-fAckHfOW.js → vue-ui-chord-B6_veyvO.js} +1 -1
- package/dist/{vue-ui-circle-pack-BWHVImkS.js → vue-ui-circle-pack-Bm7e2YNh.js} +1 -1
- package/dist/{vue-ui-cursor-DdXKXmhr.js → vue-ui-cursor-TidZDuSh.js} +1 -1
- package/dist/{vue-ui-dag-a0fNoIcJ.js → vue-ui-dag-BiN_AnLo.js} +1 -1
- package/dist/{vue-ui-dashboard-DkdYMB7n.js → vue-ui-dashboard-zepAVN_W.js} +1 -1
- package/dist/{vue-ui-digits-CL9SuIEI.js → vue-ui-digits-CXKKmfGj.js} +1 -1
- package/dist/{vue-ui-donut-BaEodt-3.js → vue-ui-donut-CKkBtyPK.js} +1 -1
- package/dist/{vue-ui-donut-DaYxdQmP.js → vue-ui-donut-DLDUpjDU.js} +2 -2
- package/dist/{vue-ui-donut-evolution-T8cRXKRQ.js → vue-ui-donut-evolution-BxMTdE5G.js} +1 -1
- package/dist/{vue-ui-dumbbell-B6HJxEZp.js → vue-ui-dumbbell-C8rNwdz0.js} +1 -1
- package/dist/{vue-ui-flow-BlTCVFr3.js → vue-ui-flow-Dru76A2O.js} +1 -1
- package/dist/{vue-ui-funnel-WgLFJadZ.js → vue-ui-funnel-D_u1h5S9.js} +1 -1
- package/dist/{vue-ui-galaxy-B3nuI6E8.js → vue-ui-galaxy-sBEH18Xj.js} +1 -1
- package/dist/{vue-ui-gauge-BwTP65O4.js → vue-ui-gauge-Do3RN8ne.js} +1 -1
- package/dist/{vue-ui-geo-CX3yH18H.js → vue-ui-geo-DDbtx_iJ.js} +1 -1
- package/dist/{vue-ui-gizmo-CNHcBsku.js → vue-ui-gizmo-eic6xLjB.js} +1 -1
- package/dist/{vue-ui-heatmap-CTdeoar7.js → vue-ui-heatmap-DlmJRsM8.js} +1 -1
- package/dist/{vue-ui-hill-DR5k8GWZ.js → vue-ui-hill-C5oiuIXh.js} +1 -1
- package/dist/{vue-ui-history-plot-C-9uH-Uj.js → vue-ui-history-plot-BJjnkWcT.js} +1 -1
- package/dist/{vue-ui-horizontal-bar-qqF7pL7U.js → vue-ui-horizontal-bar-BRDBJEl1.js} +1 -1
- package/dist/{vue-ui-kpi-DVcLXGqG.js → vue-ui-kpi-C-eed3jO.js} +1 -1
- package/dist/{vue-ui-label-D1Aog-zO.js → vue-ui-label-B4pkXBxc.js} +1 -1
- package/dist/{vue-ui-mini-loader-CX0Dx9tT.js → vue-ui-mini-loader-CElmv_iF.js} +1 -1
- package/dist/{vue-ui-molecule-B13qVX71.js → vue-ui-molecule-BeyQWZU9.js} +1 -1
- package/dist/{vue-ui-mood-radar-C1BtB8lg.js → vue-ui-mood-radar-Bh0kHfiZ.js} +1 -1
- package/dist/{vue-ui-nested-donuts-B90yrlJG.js → vue-ui-nested-donuts-FlnJfDaF.js} +1 -1
- package/dist/{vue-ui-onion-UMVO2DE_.js → vue-ui-onion-BjhSpjtW.js} +1 -1
- package/dist/vue-ui-parallel-coordinate-plot-CHV6XDti.js +9 -0
- package/dist/{vue-ui-quadrant-CPG6yAiu.js → vue-ui-quadrant-BaKSTJDv.js} +1 -1
- package/dist/{vue-ui-quick-chart-BTPb-Iz8.js → vue-ui-quick-chart-Nc2mVlle.js} +1 -1
- package/dist/{vue-ui-radar-Hd-pE9ih.js → vue-ui-radar-BzUfkLlC.js} +1 -1
- package/dist/{vue-ui-rating-C_YxQYa_.js → vue-ui-rating-BwWXvbAg.js} +1 -1
- package/dist/{vue-ui-relation-circle-CHYG7ZJl.js → vue-ui-relation-circle-nAZEg-BL.js} +1 -1
- package/dist/{vue-ui-ridgeline-DS1Gvljt.js → vue-ui-ridgeline-DxLZg1E2.js} +1 -1
- package/dist/{vue-ui-rings-B-Hb13Uu.js → vue-ui-rings-BOti0NGb.js} +1 -1
- package/dist/{vue-ui-scatter-BTgvOmuo.js → vue-ui-scatter-CCNMggyo.js} +1 -1
- package/dist/{vue-ui-skeleton-B-Acw3CC.js → vue-ui-skeleton-DI7pcimU.js} +1 -1
- package/dist/{vue-ui-smiley-Ciwqt6ek.js → vue-ui-smiley-D70sJZWl.js} +1 -1
- package/dist/{vue-ui-spark-trend-CYqy6c0S.js → vue-ui-spark-trend-BVtfEalS.js} +1 -1
- package/dist/{vue-ui-sparkbar-CTXIgjmP.js → vue-ui-sparkbar-CdsLI7Ke.js} +1 -1
- package/dist/{vue-ui-sparkgauge-CObOL6s2.js → vue-ui-sparkgauge-wmj5Wnnp.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-ClFyDez-.js → vue-ui-sparkhistogram-D8S_P_P4.js} +1 -1
- package/dist/{vue-ui-sparkline-DP_nYlW8.js → vue-ui-sparkline-BjsJnS_9.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-B2f0ePMg.js → vue-ui-sparkstackbar-ZN8LXzoV.js} +1 -1
- package/dist/{vue-ui-stackbar-nMWHZ-f0.js → vue-ui-stackbar-Dx_EN3pT.js} +1 -1
- package/dist/{vue-ui-stackline-B95y6Zc5.js → vue-ui-stackline-DW-oxJvA.js} +1 -1
- package/dist/{vue-ui-strip-plot-gFNC4r-X.js → vue-ui-strip-plot-D7kjJ3Qh.js} +1 -1
- package/dist/{vue-ui-table-Br2JgD_L.js → vue-ui-table-CaFVLHxE.js} +1 -1
- package/dist/{vue-ui-table-heatmap-Btu2ejF4.js → vue-ui-table-heatmap-Ctf7Rhqo.js} +1 -1
- package/dist/vue-ui-table-sparkline-C0I0cXBS.js +1 -0
- package/dist/{vue-ui-thermometer-C6u1eLfo.js → vue-ui-thermometer-B6og15Al.js} +1 -1
- package/dist/{vue-ui-timer-DLgsfB1U.js → vue-ui-timer-DgXvO2Q7.js} +2 -2
- package/dist/{vue-ui-tiremarks-8B9uE1Bx.js → vue-ui-tiremarks-Dh6fZ454.js} +1 -1
- package/dist/{vue-ui-treemap-C4Mot-Os.js → vue-ui-treemap-7JuvN6P_.js} +1 -1
- package/dist/{vue-ui-waffle-BwcwNpf7.js → vue-ui-waffle-BqvGzfse.js} +1 -1
- package/dist/{vue-ui-wheel-B3OGCXg7.js → vue-ui-wheel-SdwJqKA7.js} +1 -1
- package/dist/{vue-ui-word-cloud-BPIyMBXq.js → vue-ui-word-cloud-1WVV_k12.js} +1 -1
- package/dist/{vue-ui-world-Cp0DeauH.js → vue-ui-world-DjMy_utm.js} +1 -1
- package/dist/{vue-ui-xy-BOE1jvUS.js → vue-ui-xy-DaozHMfg.js} +1 -1
- package/dist/{vue-ui-xy-canvas-CaxxiKSa.js → vue-ui-xy-canvas-CegvS9RR.js} +1 -1
- package/dist/{vue-ui-xy-DSyKSn4L.js → vue-ui-xy-rGHSI1am.js} +3 -3
- package/dist/vue_ui_donut_evolution-CVoh3twl.js +1 -0
- package/dist/vue_ui_quick_chart-BRfcRW6Z.js +1 -0
- package/package.json +1 -1
- package/dist/SlicerPreview-GFRs2EWB.js +0 -1
- package/dist/package-DIR2F6AE.js +0 -1
- package/dist/vue-data-ui-BG41UScx.js +0 -1
- package/dist/vue-ui-parallel-coordinate-plot-C0ofFivm.js +0 -9
- package/dist/vue-ui-table-sparkline-B9mYHAxp.js +0 -1
- package/dist/vue_ui_donut_evolution-nzVwNQYv.js +0 -1
- package/dist/vue_ui_quick_chart-Da1GwklM.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{X as t,kt as n,x as r}from"./lib-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{X as t,kt as n,x as r}from"./lib-CV_IANZ6.js";import{t as i}from"./useConfig-CKdzPrcf.js";import{t as a}from"./useNestedProp-CB186vF2.js";import{t as o}from"./useThemeCheck-BKNRbGeC.js";import{t as s}from"./Shape-Bp9YNtPc.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as l}from"./vue_ui_label-dtPqyFsj.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as ee,getCurrentInstance as te,guardReactiveProps as ne,nextTick as h,normalizeClass as re,normalizeProps as ie,normalizeStyle as ae,onBeforeUnmount as oe,onMounted as se,openBlock as g,ref as _,renderList as ce,renderSlot as le,toDisplayString as ue,unref as de,useTemplateRef as v,watch as fe,withModifiers as pe}from"vue";var me=/* @__PURE__ */ e({default:()=>D}),he=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ge=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],_e=[`id`,`data-position`,`data-overflow`,`data-overlap`,`data-target-x`,`data-target-y`,`data-box-position-x`,`data-box-position-y`,`data-link-length`,`data-box-show`,`data-box-max-width`,`data-box-padding-top`,`data-box-padding-right`,`data-box-padding-bottom`,`data-box-padding-left`,`data-drag-enabled`,`data-drag-handle-position`,`data-drag-handle-size`],ve=[`x`,`y`,`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`],ye=[`x`,`y`,`width`,`height`,`rx`,`aria-label`],be=[`font-size`,`font-weight`,`text-anchor`,`fill`],xe=[`x`,`y`],Se=[`font-size`,`font-weight`,`text-anchor`,`fill`],Ce=[`x`,`y`],we=[`aria-label`],Te=[`x`,`y`,`width`,`height`],Ee=[`x`,`y`,`width`,`height`,`rx`],De=[`d`,`stroke`,`stroke-width`],Oe=[`d`,`stroke`,`stroke-width`,`opacity`],ke=8,y=4,Ae=12,je=24,Me=1,Ne=10,b=`__vueUiLabelLayoutOrder`,Pe=`__vueUiLabelNextLayoutOrder`,x=`__vueUiLabelLayoutRaf`,Fe=`__vueUiLabelSetLayoutRect`,Ie=`__vueUiLabelMeasureElement`,Le=`__vueUiLabelEmitDragEnd`,S=`__vueUiLabelPersistedOffset`,C=`__vueUiLabelDragRequestedOffset`,w=`__vueUiLabelDragging`,Re=`__vueUiLabelDragPriority`,ze=`__vueUiLabelNextDragPriority`,Be=`__vueUiLabelLastLayoutRect`,T=`__vueUiLabelLastLayoutOffset`,E=`__vueUiLabelDisplacedLabels`,D=/*#__PURE__*/ c({__name:`vue-ui-label`,props:{dataset:{type:Object,default(){return{x:null,y:null,position:{x:null,y:null}}}},config:{type:Object,default(){return{}}}},emits:[`dragStart`,`drag`,`dragEnd`,`click`,`mouseenter`,`mouseleave`,`focus`,`blur`],setup(e,{expose:c,emit:me}){let D=e,O=me,{vue_ui_label:Ve}=i(),{isThemeValid:He,warnInvalidTheme:Ue}=o();function We(){let e=a({userConfig:D.config,defaultConfig:Ve}),t={},n=e.theme;return n?He.value(e)?t=a({userConfig:l[n]||D.config,defaultConfig:e}):(Ue(e),t=e):t=e,t}let k=d(()=>We()),Ge=te(),Ke=t(),qe=v(`wrapperRef`),A=v(`labelRef`),Je=v(`contentRef`),Ye=v(`boxRef`),Xe=v(`titleTextRef`),Ze=v(`contentTextRef`),j=_(null),M=_(null),N=_(null),P=_({x:0,y:0}),Qe=_(!1),F=_(!1),$e=_(`pointer`),et=d(()=>k.value.title.fontSize),tt=d(()=>k.value.title.lineHeight),nt=d(()=>k.value.content.fontSize),rt=d(()=>k.value.content.lineHeight),it=d(()=>k.value.title.gap),at=d(()=>k.value.drag.handleWidth),ot=d(()=>k.value.collisionGap),st=null,ct=null,I=null,L={inputType:null,touchId:null,startPointer:null,startOffset:null,lastRequestedOffset:null},lt=d(()=>({x:D.dataset?.x??null,y:D.dataset?.y??null})),R=d(()=>n(lt.value.x)&&n(lt.value.y)),z=d(()=>Number(lt.value.x)),B=d(()=>Number(lt.value.y)),V=d(()=>k.value.link),H=d(()=>k.value.box),ut=d(()=>k.value.drag),U=d(()=>k.value.title.marker),dt=d(()=>k.value.overlap===!0),W=d(()=>ut.value?.enable===!0),ft=d(()=>!!(Ge?.vnode?.props??{}).onClick),pt=d(()=>ft.value),mt=d(()=>[String(k.value.title?.text??``).trim(),String(k.value.content?.text??``).trim()].filter(Boolean).join(`, `)||`Label`),ht=d(()=>`Move ${mt.value}`),gt=`label_${Ke}_drag_instructions`,_t=d(()=>k.value.a11y.translations.keyboardNavigation),vt=d(()=>n(ut.value?.iconSize)?Math.max(0,Number(ut.value.iconSize)):0),yt=d(()=>vt.value*.15),bt=d(()=>{let e=ut.value?.handlePosition;return[`left`,`right`,`top`,`bottom`].includes(e)?e:`left`}),xt=d(()=>{let e=D.dataset?.position;return!e||!n(e.x)||!n(e.y)?null:{x:Number(e.x),y:Number(e.y)}}),St=d(()=>Qe.value?null:xt.value),Ct=d(()=>n(V.value.length)?Math.max(0,Number(V.value.length)):ke),wt=d(()=>Hn(k.value.title.textAlign)),Tt=d(()=>Hn(k.value.content.textAlign)),Et=d(()=>Un(wt.value)),Dt=d(()=>Un(Tt.value)),Ot=d(()=>U.value?.color!==null&&U.value?.color!==void 0&&String(k.value.title.text??``)!==``),kt=d(()=>Ot.value&&n(U.value?.size)?Math.max(0,Number(U.value.size)):0),At=d(()=>kt.value/2),jt=d(()=>U.value?.beforeText!==!1),Mt=d(()=>Ot.value&&kt.value>0?6:0),Nt=d(()=>kt.value>0?kt.value+Mt.value:0),G=d(()=>{let e=H.value.padding??{};return{top:n(e.top)?Math.max(0,Number(e.top)):0,right:n(e.right)?Math.max(0,Number(e.right)):0,bottom:n(e.bottom)?Math.max(0,Number(e.bottom)):0,left:n(e.left)?Math.max(0,Number(e.left)):0}}),Pt=d(()=>n(H.value.borderWidth)?Math.max(0,Number(H.value.borderWidth)):0),Ft=d(()=>n(H.value.borderRadius)?Math.max(0,Number(H.value.borderRadius)):0),K=d(()=>n(H.value.maxWidth)?Math.max(0,Number(H.value.maxWidth)):null),It=d(()=>W.value&&H.value.show?at.value:0),Lt=d(()=>[`left`,`right`].includes(bt.value)),Rt=d(()=>{if(!H.value.show||!n(K.value)||K.value<=0)return null;let e=Lt.value?It.value:0;return Math.max(1,K.value-G.value.left-G.value.right-e)}),zt=d(()=>Rt.value?Math.max(1,Rt.value-Nt.value):null),q=d(()=>{if(!H.value.show||!N.value)return null;let e=Pt.value/2,t=Math.max(0,N.value.width-Pt.value),n=Math.max(0,N.value.height-Pt.value);return{x:N.value.x+e,y:N.value.y+e,width:t,height:n,rx:Math.min(Ft.value,t/2,n/2)}}),Bt=d(()=>{if(!W.value||!q.value)return null;let e=bt.value,t=[`left`,`right`].includes(e),n=Math.min(at.value,Math.max(0,t?q.value.width:q.value.height));if(n<=0||q.value.width<=0||q.value.height<=0)return null;let r=q.value.x,i=q.value.y,a=q.value.width,o=q.value.height,s=``,c=``;if(e===`left`||e===`right`){a=n,r=e===`left`?q.value.x:q.value.x+q.value.width-n;let t=e===`left`?r+n:r,l=r+n/2,u=i+o/2;s=`
|
|
2
2
|
M ${t} ${i}
|
|
3
3
|
V ${i+o}
|
|
4
4
|
`;let d=vt.value,f=yt.value/2,p=Math.max(0,d/2-f),m=d*.14;c=[-.7,0,.7].flatMap(e=>{let t=u+p*e;return[`M ${l-m} ${t} h 0`,`M ${l+m} ${t} h 0`]}).join(` `)}else{o=n,i=e===`top`?q.value.y:q.value.y+q.value.height-n;let t=e===`top`?i+n:i,l=r+a/2,u=i+n/2;s=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./lib-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./lib-CV_IANZ6.js";import{n,t as r}from"./useHints-BH9r_0Vd.js";import{t as i}from"./useConfig-CKdzPrcf.js";import{t as a}from"./useNestedProp-CB186vF2.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,normalizeStyle as d,openBlock as f,ref as p,unref as m,useCssVars as h}from"vue";var g=/* @__PURE__ */ e({default:()=>E}),_=[`xmlns`,`viewBox`],v={key:0},y=[`stroke`],b=[`stroke`],x=[`stroke`],S={key:1},C=[`stroke`],w={key:2},T=[`stroke`],E=/*#__PURE__*/ o({__name:`vue-ui-mini-loader`,props:{config:{type:Object,default(){return{}}}},setup(e){h(e=>({v5fadbcf2:j.value,v488061db:M.value,v2e2d4bba:N.value}));let{vue_ui_mini_loader:o}=i(),g=e,E=s(()=>a({userConfig:g.config,defaultConfig:o}));n({config:()=>E.value,dataset:()=>[],component:`VueUiMiniLoader`,rules:[r.noHint]});let D=p({onion:`-10 -10 84 84`,line:`-10 -10 112 84`,bar:`-10 -10 106 84`}),O=s(()=>({gutter:`stroke:${E.value.line.gutterColor};opacity:${E.value.line.gutterOpacity};`,gutterBlur:`filter:blur(${E.value.line.gutterBlur}px);`})),k=s(()=>({gutter:`stroke:${E.value.bar.gutterColor};opacity:${E.value.bar.gutterOpacity};`,gutterBlur:`filter:blur(${E.value.bar.gutterBlur}px);`})),A=s(()=>({gutter:`stroke:${E.value.onion.gutterColor};opacity:${E.value.onion.gutterOpacity};`,gutterBlur:`filter:blur(${E.value.onion.gutterBlur}px);`})),j=s(()=>`blur(${E.value.onion.trackBlur}px) hue-rotate(${E.value.onion.trackHueRotate}deg)`),M=s(()=>`blur(${E.value.line.trackBlur}px) hue-rotate(${E.value.line.trackHueRotate}deg)`),N=s(()=>`blur(${E.value.bar.trackBlur}px) hue-rotate(${E.value.bar.trackHueRotate}deg)`);return(e,n)=>(f(),l(`svg`,{class:`vue-data-ui-component vue-ui-mini-loader`,xmlns:m(t),viewBox:D.value[E.value.type],style:{background:`transparent`},width:`100%`},[E.value.type===`onion`?(f(),l(`g`,v,[u(`path`,{d:`M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(A.value.gutter+A.value.gutterBlur)},null,4),u(`path`,{d:`M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(A.value.gutter+A.value.gutterBlur)},null,4),u(`path`,{d:`M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(A.value.gutter+A.value.gutterBlur)},null,4),u(`path`,{d:`M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3`,stroke:E.value.onion.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`onion-animated`},null,8,y),u(`path`,{d:`M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13`,stroke:E.value.onion.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`onion-animated`},null,8,b),u(`path`,{d:`M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25`,stroke:E.value.onion.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`onion-animated`},null,8,x)])):c(``,!0),E.value.type===`line`?(f(),l(`g`,S,[u(`path`,{d:`M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(O.value.gutter+O.value.gutterBlur)},null,4),u(`path`,{d:`M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5`,stroke:E.value.line.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`line-animated`},null,8,C)])):c(``,!0),E.value.type===`bar`?(f(),l(`g`,w,[u(`path`,{d:`M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(k.value.gutter+k.value.gutterBlur)},null,4),u(`path`,{d:`M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5`,stroke:E.value.bar.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`bar-animated`},null,8,T)])):c(``,!0)],8,_))}},[[`__scopeId`,`data-v-5266752a`]]);export{g as n,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{D as s,Dt as ee,Ft as c,Ht as te,M as ne,S as re,X as ie,Zt as l,at as ae,et as oe,in as se,nt as ce,pt as le,t as ue,w as de,zt as fe}from"./lib-zDxoqrgo.js";import{n as pe,t as me}from"./useHints-BH9r_0Vd.js";import{t as he}from"./useConfig-CKdzPrcf.js";import{t as ge}from"./usePrinter-CnyKPIFM.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{t as ye}from"./useChartExport-DtPNpc9M.js";import{t as be}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as xe}from"./DefGrad-DKMq1REY.js";import{n as Se}from"./resolveChartConfig-BSo1Oe9n.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./chartImage-NwZO-elv.js";import{t as Ee}from"./vue_ui_molecule-Bw1UW1Na.js";import{t as De}from"./usePanZoom-BdjP5Suc.js";import{Fragment as Oe,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as ke,createTextVNode as Ae,createVNode as h,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as je,nextTick as v,normalizeClass as Me,normalizeProps as y,normalizeStyle as b,onMounted as Ne,openBlock as x,ref as S,renderList as Pe,renderSlot as C,resolveDynamicComponent as Fe,toDisplayString as Ie,toRefs as Le,unref as w,useCssVars as Re,watch as T,withCtx as E}from"vue";var ze=/* @__PURE__ */ e({default:()=>Je}),Be=[`id`],Ve={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},He={key:2,style:`width:100%;background:transparent;`},Ue=[`xmlns`,`viewBox`],We=[`width`,`height`],Ge={key:4,class:`vue-data-ui-watermark`},Ke={key:5,"data-dom-to-png-ignore":``,class:`reset-wrapper`},qe={key:6,ref:`source`,dir:`auto`},Je=/*#__PURE__*/ be({__name:`vue-ui-molecule`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectNode`,`copyAlt`],setup(e,{expose:be,emit:ze}){Re(e=>({v4bfe7676:on.value}));let Je=g(()=>import(`./Title-BRAjxtjG.js`).then(e=>e.t)),Ye=g(()=>import(`./Tooltip-BUXB0i6z.js`)),Xe=g(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),Ze=g(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),Qe=g(()=>import(`./DataTable-DSUA5M9p.js`)),$e=g(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),et=g(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),tt=g(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),nt=g(()=>import(`./RecursiveLinks-CZtG6uWg.js`)),rt=g(()=>import(`./RecursiveLabels-B0d04xSj.js`)),it=g(()=>import(`./RecursiveCircles-BftI1kwF.js`)),at=g(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_molecule:ot}=he(),D=e,st=ze,ct=u(()=>!!D.dataset&&D.dataset.length);Ne(()=>{ut()});let lt=u(()=>M.value.debug);function ut(){fe(D.dataset)&&ae({componentName:`VueUiMolecule`,type:`dataset`,debug:lt.value})}let O=S(ie()),k=S(!1),A=S(``),j=S(null),dt=S(0),ft=S(0),pt=S(0),mt=S(null),ht=S(null),M=S(V()),N=u(()=>M.value.style.chart.tooltip),P=u(()=>M.value.style.chart),F=u(()=>M.value.userOptions);pe({config:()=>M.value,dataset:()=>D.dataset,component:`VueUiMolecule`,rules:[me.emptyArray,{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length===0,message:[`👀 There are no children nodes attached to the root node. Consider:`,``,`▶️ Adding children nodes to the root node.`]},{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length>8,message:[`👀 The number of children nodes > 8, some nodes might overlap. Consider:`,``,`▶️ Grouping data into broader categories.`]}]});let I=u(()=>M.value.userOptions.useCursorPointer),gt=u(()=>se({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#6A6A6A`},links:{stroke:`#6A6A6A80`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:R}=_e({...Le(D),FINAL_CONFIG:M,prepareConfig:V,skeletonDataset:D.config?.skeletonDataset??[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]}]}],skeletonConfig:se({defaultConfig:M.value,userConfig:gt.value})}),{userOptionsVisible:z,setUserOptionsVisibility:_t,keepUserOptionState:vt}=Ce({config:M.value}),{svgRef:B}=we({config:P.value.title});function V(){return Se(D.config,ot,Ee)}let yt=l(D.config);T((e,t)=>D.config,e=>{let t=l(newConfig),n=t!==yt;yt=t;let r=V();if(!n){M.value.style.chart.tooltip=r.style.chart.tooltip,U.value.showTooltip=M.value.style.chart.tooltip.show;return}M.value=r,z.value=!M.value.userOptions.showOnChartHover,ut(),ft.value+=1,pt.value+=1,U.value.showTable=M.value.table.show,U.value.showTooltip=N.value.show,U.value.showZoom=P.value.zoom.show},{deep:!0});let bt=S(0),xt=()=>{bt.value+=1};T([()=>L.value,()=>R.value],async([e])=>{e||(await v(),W.value=Ot(),await v(),xt(),await v(),Jt({x:0,y:0,width:400,height:400}),Kt(!1))},{flush:`post`,deep:!1});let{isPrinting:H,isImaging:St,generatePdf:Ct,generateImage:wt}=ge({elementId:`cluster_${O.value}`,fileName:P.value.title.text||`vue-ui-molecule`,options:M.value.userOptions.print}),Tt=u(()=>M.value.userOptions.show&&!P.value.title.text),Et=u(()=>de(M.value.customPalette)),U=S({showTable:M.value.table.show,showDataLabels:!0,showTooltip:N.value.show,showZoom:P.value.zoom.show});T(M,()=>{U.value={showTable:M.value.table.show,showDataLabels:!0,showTooltip:N.value.show,showZoom:P.value.zoom.show}},{immediate:!0});function Dt(e,t=0){return Array.isArray(e)&&e.length>0&&e[0].nodes?Dt(e[0].nodes,t+1):t}function Ot(){let e=Dt(R.value),t=100,n=t;for(let r=0;r<e;r+=1)t/=1,n+=t;return{height:n,width:n}}let W=S(Ot());function kt(e,t={x:-W.value.width/2.43,y:W.value.height/2},n=W.value.width/1.1,r=24,i=0,a=0,o=`#BBBBBB`,s=0){if(!Array.isArray(e)||e.length===0)return e;let ee=ne({plot:t,radius:n,sides:e.length,rotation:i});return e.forEach((e,t)=>{let c=ee.coordinates[t],ne=e.color?(()=>{let t=re(e.color);return t.startsWith(`#`)?t:`#${t}`})():null,l;ne?l=ne:s===0?l=o:s===1?(l=Et.value[a]||te[a]||o,a+=1):l=o,e.polygonPath={coordinates:[c]},e.circleRadius=r,e.color=l,e.strokeWidth=Math.min(P.value.links.strokeWidth/(s+1),r/2),e.uid=ie(),Array.isArray(e.nodes)&&e.nodes.length&&(e.nodes=kt(e.nodes,c,n/2.9,r/2.2,i+Math.PI*t/e.nodes.length,a,l,s+1))}),e}function At(e){let t=/* @__PURE__ */ new Set;function n(e){e.forEach(e=>{if(!e.color)return;let r=e.color;/^#?[0-9A-F]{6}$/i.test(r)||(r=re(r)),r.startsWith(`#`)||(r=`#${r}`),t.add(r),Array.isArray(e.nodes)&&e.nodes.length&&n(e.nodes)})}n(e);let r={};return Array.from(t).forEach(e=>{let t=e.slice(1);r[e]=`gradient_${t}`}),r}let jt=u(()=>At(G.value)),G=u(()=>kt(oe(R.value))),K=S(null);function Mt(e){K.value={datapoint:e,seriesIndex:-1,series:G.value,config:M.value};let t=N.value.customFormat;if(ee(t)&&le(()=>t({seriesIndex:-1,datapoint:e,series:G.value,config:M.value})))A.value=t({seriesIndex:-1,datapoint:e,series:G.value,config:M.value});else{let t=``;t+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${e.color}">⬤</div><div>${e.name}</div></div>`,e.details&&(t+=`<div style="width:100%;border-top:1px solid ${N.value.borderColor};margin-top: 2px">${e.details}</div>`),A.value=`<div style="font-family:inherit">${t}</div>`}}let q=S(null),J=S(null),Nt=S(null);function Pt(e){Nt.value=q.value,q.value=e,e?M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:-1}):M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:Nt.value||q.value,seriesIndex:-1}),e?(k.value=!0,Mt(e),J.value=e.uid):(k.value=!1,A.value=``,J.value=null)}function Ft(e){let t=[];function n(e){e.forEach(e=>{let r={name:e.name,details:e.details||`-`,ancestor:e.ancestor&&e.ancestor.name||`-`,color:e.color||``};t.push(r),e.nodes&&e.nodes.length>0&&n(e.nodes,e.name)})}return n(e),t}let It=u(()=>Ft(G.value)),Y=u(()=>({head:[M.value.table.translations.nodeName,M.value.table.translations.details,M.value.table.translations.ancestor],body:It.value.map((e,t)=>[{color:e.color,name:e.name},e.details,e.ancestor||``]),config:{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},colNames:[M.value.table.translations.nodeName,M.value.table.translations.details,M.value.table.translations.ancestor]}));function Lt(e=null){v(()=>{let t=Y.value.body.map((e,t)=>[[e[0].name],[e[1]],[e[2]]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[...Y.value.head]]].concat(t),r=s(n);e?e(r):ce({csvContent:r,title:P.value.title.text||`vue-ui-molecule`})})}function Rt(){return G.value}let X=S(!1);function zt(e){X.value=e,dt.value+=1}function Bt(){U.value.showTable=!U.value.showTable}function Vt(){U.value.showDataLabels=!U.value.showDataLabels}function Ht(){U.value.showTooltip=!U.value.showTooltip}function Ut(){U.value.showZoom=!U.value.showZoom}let Z=S(!1);function Wt(){Z.value=!Z.value}let Gt=u(()=>!Z.value&&U.value.showZoom),{viewBox:Q,resetZoom:Kt,isZoom:qt,setInitialViewBox:Jt}=De(B,{x:0,y:0,width:Math.max(10,W.value.width),height:Math.max(10,W.value.height)},P.value.zoom.speed,Gt);function Yt(e){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:-1}),st(`selectNode`,e)}let Xt=Te(j,()=>P.value.title.text),$=u(()=>n({config:M,style:P,mutableConfig:U,dialog:at,accordion:Ze,isFullscreen:X,parent:j,maxWidth:800,isCursorPointer:I}));T(()=>U.value.showTable,e=>t(e,M,mt));function Zt(){U.value.showTable=!1,ht.value&&ht.value.setTableIconState(!1)}let Qt=u(()=>P.value.backgroundColor),$t=u(()=>P.value.title),{isCallbackImaging:en,isCallbackSvg:tn,generateSvg:nn,onGenerateImage:rn}=ye({svg:B,title:$t,legend:null,legendItems:null,backgroundColor:Qt,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:wt});async function an(){if(st(`copyAlt`,{config:M.value,dataset:G.value}),!M.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:G.value}))}let on=u(()=>P.value.color);return be({getData:Rt,getImage:Xt,generatePdf:Ct,generateCsv:Lt,generateImage:wt,generateSvg:nn,toggleTable:Bt,toggleLabels:Vt,toggleTooltip:Ht,toggleAnnotator:Wt,toggleFullscreen:zt,toggleZoom:Ut,copyAlt:an}),(e,t)=>(x(),p(`div`,{ref_key:`moleculeChart`,ref:j,class:Me(`vue-data-ui-component vue-ui-molecule ${X.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:b(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),id:`cluster_${O.value}`,onMouseleave:t[2]||=e=>{q.value=null,J.value=null,w(_t)(!1)},onMouseenter:t[3]||=()=>w(_t)(!0)},[F.value.buttons.annotator&&w(B)?(x(),d(w($e),{key:0,svgRef:w(B),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Z.value,isCursorPointer:I.value,onClose:Wt},ke({_:2},[Pe(w(i),t=>({name:t,fn:E(n=>[C(e.$slots,t,y(_(w(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`])):f(``,!0),Tt.value?(x(),p(`div`,Ve,null,512)):f(``,!0),P.value.title.text?(x(),p(`div`,He,[(x(),d(w(Je),{key:`title_${ft.value}`,config:{title:{cy:`molecule-div-title`,...P.value.title},subtitle:{cy:`molecule-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))])):f(``,!0),F.value.show&&ct.value&&(w(vt)||w(z))?(x(),d(w(et),{ref_key:`userOptionsRef`,ref:ht,key:`user_options_${dt.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:w(H),isImaging:w(St),uid:O.value,hasTooltip:F.value.buttons.tooltip&&N.value.show,hasPdf:F.value.buttons.pdf,hasXls:F.value.buttons.csv,hasImg:F.value.buttons.img,hasSvg:F.value.buttons.svg,hasTable:F.value.buttons.table,hasLabel:F.value.buttons.labels,hasFullscreen:F.value.buttons.fullscreen,hasAltCopy:F.value.buttons.altCopy,isTooltip:U.value.showTooltip,titles:{...F.value.buttonTitles},chartElement:j.value,position:F.value.position,hasAnnotator:F.value.buttons.annotator,isAnnotation:Z.value,callbacks:F.value.callbacks,printScale:F.value.print.scale,tableDialog:M.value.table.useDialog,hasZoom:F.value.buttons.zoom,isZoom:U.value.showZoom,isCursorPointer:I.value,onToggleFullscreen:zt,onGeneratePdf:w(Ct),onGenerateCsv:Lt,onGenerateImage:w(rn),onGenerateSvg:w(nn),onToggleTable:Bt,onToggleLabels:Vt,onToggleTooltip:Ht,onToggleAnnotator:Wt,onToggleZoom:Ut,onCopyAlt:an,style:b({visibility:w(vt)?w(z)?`visible`:`hidden`:`visible`})},ke({_:2},[Pe(w(a)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,y(_(w(o)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasLabel.hasFullscreen.hasAltCopy.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.hasZoom.isZoom.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),(x(),p(`svg`,{ref_key:`svgRef`,ref:B,key:`svg_${bt.value}`,xmlns:w(ue),viewBox:`${w(Q).x} ${w(Q).y} ${w(Q).width} ${w(Q).height}`,class:Me({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),style:b(`overflow: hidden; background:transparent;color:${P.value.color}`)},[h(w(tt)),e.$slots[`chart-background`]?(x(),p(`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`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,We)):f(``,!0),m(`defs`,null,[(x(!0),p(Oe,null,Pe(Object.keys(jt.value),(e,t)=>(x(),d(xe,{t:`radial`,id:`gradient_${e}`,key:`gradient_${e}_${t}`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,w(c)(e,.5),1],[`100%`,e,1]]},null,8,[`id`,`stops`]))),128))]),h(w(nt),{dataset:G.value,color:P.value.links.stroke,backgroundColor:P.value.backgroundColor,useChildColor:P.value.links.useChildColor},null,8,[`dataset`,`color`,`backgroundColor`,`useChildColor`]),h(w(it),{dataset:G.value,hoveredUid:J.value,stroke:P.value.nodes.stroke,strokeHovered:P.value.nodes.strokeHovered,onClick:Yt,onHover:Pt},{node:E(({node:t})=>[C(e.$slots,`node`,y(_({node:t})),void 0,!0)]),"node-svg":E(({nodeSvg:t})=>[C(e.$slots,`node-svg`,y(_({nodeSvg:t})),void 0,!0)]),_:3},8,[`dataset`,`hoveredUid`,`stroke`,`strokeHovered`]),U.value.showDataLabels&&!w(L)?(x(),d(w(rt),{key:1,dataset:G.value,color:P.value.color,hoveredUid:J.value},null,8,[`dataset`,`color`,`hoveredUid`])):f(``,!0),C(e.$slots,`svg`,{svg:{...W.value,drawingArea:{...w(Q)},isPrintingImg:w(H)||w(St)||w(en),isPrintingSvg:w(tn)}},void 0,!0)],14,Ue)),e.$slots.watermark?(x(),p(`div`,Ge,[C(e.$slots,`watermark`,y(_({isPrinting:w(H)||w(St)||w(en)||w(tn)})),void 0,!0)])):f(``,!0),w(qt)?(x(),p(`div`,Ke,[C(e.$slots,`reset-action`,{reset:w(Kt)},()=>[m(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:b({background:P.value.backgroundColor,cursor:I.value?`pointer`:`default`}),onClick:t[0]||=e=>w(Kt)(!0)},[h(w(Xe),{name:`refresh`,stroke:P.value.color},null,8,[`stroke`])],4)],!0)])):f(``,!0),e.$slots.source?(x(),p(`div`,qe,[C(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),h(w(Ye),{teleportTo:N.value.teleportTo,show:U.value.showTooltip&&k.value,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:j.value,content:A.value,isFullscreen:X.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},{"tooltip-before":E(()=>[C(e.$slots,`tooltip-before`,y(_({...K.value})),void 0,!0)]),tooltip:E(()=>[C(e.$slots,`tooltip`,y(_({...K.value})),void 0,!0)]),"tooltip-after":E(()=>[C(e.$slots,`tooltip-after`,y(_({...K.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`]),ct.value&&F.value.buttons.table?(x(),d(Fe($.value.component),je({key:7},$.value.props,{ref_key:`tableUnit`,ref:mt,onClose:Zt}),ke({content:E(()=>[(x(),d(w(Qe),{key:`table_${pt.value}`,colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.value.config,title:M.value.table.useDialog?``:$.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:I.value,onClose:Zt},{th:E(({th:e})=>[m(`div`,null,Ie(e),1)]),td:E(({td:e})=>[Ae(Ie(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:E(()=>[Ae(Ie($.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:E(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Lt(F.value.callbacks.csv),style:b({cursor:I.value?`pointer`:`default`})},[h(w(Xe),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),C(e.$slots,`skeleton`,{},()=>[w(L)?(x(),d(ve,{key:0})):f(``,!0)],!0)],46,Be))}},[[`__scopeId`,`data-v-ca23df82`]]);export{ze as n,Je as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{D as s,Dt as ee,Ft as c,Ht as te,M as ne,S as re,X as ie,Zt as l,at as ae,et as oe,in as se,nt as ce,pt as le,t as ue,w as de,zt as fe}from"./lib-CV_IANZ6.js";import{n as pe,t as me}from"./useHints-BH9r_0Vd.js";import{t as he}from"./useConfig-CKdzPrcf.js";import{t as ge}from"./usePrinter-hLW3cv4N.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{t as ye}from"./useChartExport-DtPNpc9M.js";import{t as be}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as xe}from"./DefGrad-DKMq1REY.js";import{n as Se}from"./resolveChartConfig-DZg-korK.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./chartImage-CIvU_04o.js";import{t as Ee}from"./vue_ui_molecule-Bw1UW1Na.js";import{t as De}from"./usePanZoom-BdjP5Suc.js";import{Fragment as Oe,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as ke,createTextVNode as Ae,createVNode as h,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as je,nextTick as v,normalizeClass as Me,normalizeProps as y,normalizeStyle as b,onMounted as Ne,openBlock as x,ref as S,renderList as Pe,renderSlot as C,resolveDynamicComponent as Fe,toDisplayString as Ie,toRefs as Le,unref as w,useCssVars as Re,watch as T,withCtx as E}from"vue";var ze=/* @__PURE__ */ e({default:()=>Je}),Be=[`id`],Ve={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},He={key:2,style:`width:100%;background:transparent;`},Ue=[`xmlns`,`viewBox`],We=[`width`,`height`],Ge={key:4,class:`vue-data-ui-watermark`},Ke={key:5,"data-dom-to-png-ignore":``,class:`reset-wrapper`},qe={key:6,ref:`source`,dir:`auto`},Je=/*#__PURE__*/ be({__name:`vue-ui-molecule`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectNode`,`copyAlt`],setup(e,{expose:be,emit:ze}){Re(e=>({v4bfe7676:on.value}));let Je=g(()=>import(`./Title-BGYFqulv.js`).then(e=>e.t)),Ye=g(()=>import(`./Tooltip-Cus2-XNQ.js`)),Xe=g(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),Ze=g(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),Qe=g(()=>import(`./DataTable-WNecJMcY.js`)),$e=g(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),et=g(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),tt=g(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),nt=g(()=>import(`./RecursiveLinks-CZtG6uWg.js`)),rt=g(()=>import(`./RecursiveLabels-B0d04xSj.js`)),it=g(()=>import(`./RecursiveCircles-BftI1kwF.js`)),at=g(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_molecule:ot}=he(),D=e,st=ze,ct=u(()=>!!D.dataset&&D.dataset.length);Ne(()=>{ut()});let lt=u(()=>M.value.debug);function ut(){fe(D.dataset)&&ae({componentName:`VueUiMolecule`,type:`dataset`,debug:lt.value})}let O=S(ie()),k=S(!1),A=S(``),j=S(null),dt=S(0),ft=S(0),pt=S(0),mt=S(null),ht=S(null),M=S(V()),N=u(()=>M.value.style.chart.tooltip),P=u(()=>M.value.style.chart),F=u(()=>M.value.userOptions);pe({config:()=>M.value,dataset:()=>D.dataset,component:`VueUiMolecule`,rules:[me.emptyArray,{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length===0,message:[`👀 There are no children nodes attached to the root node. Consider:`,``,`▶️ Adding children nodes to the root node.`]},{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length>8,message:[`👀 The number of children nodes > 8, some nodes might overlap. Consider:`,``,`▶️ Grouping data into broader categories.`]}]});let I=u(()=>M.value.userOptions.useCursorPointer),gt=u(()=>se({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#6A6A6A`},links:{stroke:`#6A6A6A80`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:R}=_e({...Le(D),FINAL_CONFIG:M,prepareConfig:V,skeletonDataset:D.config?.skeletonDataset??[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]}]}],skeletonConfig:se({defaultConfig:M.value,userConfig:gt.value})}),{userOptionsVisible:z,setUserOptionsVisibility:_t,keepUserOptionState:vt}=Ce({config:M.value}),{svgRef:B}=we({config:P.value.title});function V(){return Se(D.config,ot,Ee)}let yt=l(D.config);T((e,t)=>D.config,e=>{let t=l(newConfig),n=t!==yt;yt=t;let r=V();if(!n){M.value.style.chart.tooltip=r.style.chart.tooltip,U.value.showTooltip=M.value.style.chart.tooltip.show;return}M.value=r,z.value=!M.value.userOptions.showOnChartHover,ut(),ft.value+=1,pt.value+=1,U.value.showTable=M.value.table.show,U.value.showTooltip=N.value.show,U.value.showZoom=P.value.zoom.show},{deep:!0});let bt=S(0),xt=()=>{bt.value+=1};T([()=>L.value,()=>R.value],async([e])=>{e||(await v(),W.value=Ot(),await v(),xt(),await v(),Jt({x:0,y:0,width:400,height:400}),Kt(!1))},{flush:`post`,deep:!1});let{isPrinting:H,isImaging:St,generatePdf:Ct,generateImage:wt}=ge({elementId:`cluster_${O.value}`,fileName:P.value.title.text||`vue-ui-molecule`,options:M.value.userOptions.print}),Tt=u(()=>M.value.userOptions.show&&!P.value.title.text),Et=u(()=>de(M.value.customPalette)),U=S({showTable:M.value.table.show,showDataLabels:!0,showTooltip:N.value.show,showZoom:P.value.zoom.show});T(M,()=>{U.value={showTable:M.value.table.show,showDataLabels:!0,showTooltip:N.value.show,showZoom:P.value.zoom.show}},{immediate:!0});function Dt(e,t=0){return Array.isArray(e)&&e.length>0&&e[0].nodes?Dt(e[0].nodes,t+1):t}function Ot(){let e=Dt(R.value),t=100,n=t;for(let r=0;r<e;r+=1)t/=1,n+=t;return{height:n,width:n}}let W=S(Ot());function kt(e,t={x:-W.value.width/2.43,y:W.value.height/2},n=W.value.width/1.1,r=24,i=0,a=0,o=`#BBBBBB`,s=0){if(!Array.isArray(e)||e.length===0)return e;let ee=ne({plot:t,radius:n,sides:e.length,rotation:i});return e.forEach((e,t)=>{let c=ee.coordinates[t],ne=e.color?(()=>{let t=re(e.color);return t.startsWith(`#`)?t:`#${t}`})():null,l;ne?l=ne:s===0?l=o:s===1?(l=Et.value[a]||te[a]||o,a+=1):l=o,e.polygonPath={coordinates:[c]},e.circleRadius=r,e.color=l,e.strokeWidth=Math.min(P.value.links.strokeWidth/(s+1),r/2),e.uid=ie(),Array.isArray(e.nodes)&&e.nodes.length&&(e.nodes=kt(e.nodes,c,n/2.9,r/2.2,i+Math.PI*t/e.nodes.length,a,l,s+1))}),e}function At(e){let t=/* @__PURE__ */ new Set;function n(e){e.forEach(e=>{if(!e.color)return;let r=e.color;/^#?[0-9A-F]{6}$/i.test(r)||(r=re(r)),r.startsWith(`#`)||(r=`#${r}`),t.add(r),Array.isArray(e.nodes)&&e.nodes.length&&n(e.nodes)})}n(e);let r={};return Array.from(t).forEach(e=>{let t=e.slice(1);r[e]=`gradient_${t}`}),r}let jt=u(()=>At(G.value)),G=u(()=>kt(oe(R.value))),K=S(null);function Mt(e){K.value={datapoint:e,seriesIndex:-1,series:G.value,config:M.value};let t=N.value.customFormat;if(ee(t)&&le(()=>t({seriesIndex:-1,datapoint:e,series:G.value,config:M.value})))A.value=t({seriesIndex:-1,datapoint:e,series:G.value,config:M.value});else{let t=``;t+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${e.color}">⬤</div><div>${e.name}</div></div>`,e.details&&(t+=`<div style="width:100%;border-top:1px solid ${N.value.borderColor};margin-top: 2px">${e.details}</div>`),A.value=`<div style="font-family:inherit">${t}</div>`}}let q=S(null),J=S(null),Nt=S(null);function Pt(e){Nt.value=q.value,q.value=e,e?M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:-1}):M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:Nt.value||q.value,seriesIndex:-1}),e?(k.value=!0,Mt(e),J.value=e.uid):(k.value=!1,A.value=``,J.value=null)}function Ft(e){let t=[];function n(e){e.forEach(e=>{let r={name:e.name,details:e.details||`-`,ancestor:e.ancestor&&e.ancestor.name||`-`,color:e.color||``};t.push(r),e.nodes&&e.nodes.length>0&&n(e.nodes,e.name)})}return n(e),t}let It=u(()=>Ft(G.value)),Y=u(()=>({head:[M.value.table.translations.nodeName,M.value.table.translations.details,M.value.table.translations.ancestor],body:It.value.map((e,t)=>[{color:e.color,name:e.name},e.details,e.ancestor||``]),config:{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},colNames:[M.value.table.translations.nodeName,M.value.table.translations.details,M.value.table.translations.ancestor]}));function Lt(e=null){v(()=>{let t=Y.value.body.map((e,t)=>[[e[0].name],[e[1]],[e[2]]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[...Y.value.head]]].concat(t),r=s(n);e?e(r):ce({csvContent:r,title:P.value.title.text||`vue-ui-molecule`})})}function Rt(){return G.value}let X=S(!1);function zt(e){X.value=e,dt.value+=1}function Bt(){U.value.showTable=!U.value.showTable}function Vt(){U.value.showDataLabels=!U.value.showDataLabels}function Ht(){U.value.showTooltip=!U.value.showTooltip}function Ut(){U.value.showZoom=!U.value.showZoom}let Z=S(!1);function Wt(){Z.value=!Z.value}let Gt=u(()=>!Z.value&&U.value.showZoom),{viewBox:Q,resetZoom:Kt,isZoom:qt,setInitialViewBox:Jt}=De(B,{x:0,y:0,width:Math.max(10,W.value.width),height:Math.max(10,W.value.height)},P.value.zoom.speed,Gt);function Yt(e){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:-1}),st(`selectNode`,e)}let Xt=Te(j,()=>P.value.title.text),$=u(()=>n({config:M,style:P,mutableConfig:U,dialog:at,accordion:Ze,isFullscreen:X,parent:j,maxWidth:800,isCursorPointer:I}));T(()=>U.value.showTable,e=>t(e,M,mt));function Zt(){U.value.showTable=!1,ht.value&&ht.value.setTableIconState(!1)}let Qt=u(()=>P.value.backgroundColor),$t=u(()=>P.value.title),{isCallbackImaging:en,isCallbackSvg:tn,generateSvg:nn,onGenerateImage:rn}=ye({svg:B,title:$t,legend:null,legendItems:null,backgroundColor:Qt,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:wt});async function an(){if(st(`copyAlt`,{config:M.value,dataset:G.value}),!M.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:G.value}))}let on=u(()=>P.value.color);return be({getData:Rt,getImage:Xt,generatePdf:Ct,generateCsv:Lt,generateImage:wt,generateSvg:nn,toggleTable:Bt,toggleLabels:Vt,toggleTooltip:Ht,toggleAnnotator:Wt,toggleFullscreen:zt,toggleZoom:Ut,copyAlt:an}),(e,t)=>(x(),p(`div`,{ref_key:`moleculeChart`,ref:j,class:Me(`vue-data-ui-component vue-ui-molecule ${X.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:b(`font-family:${M.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),id:`cluster_${O.value}`,onMouseleave:t[2]||=e=>{q.value=null,J.value=null,w(_t)(!1)},onMouseenter:t[3]||=()=>w(_t)(!0)},[F.value.buttons.annotator&&w(B)?(x(),d(w($e),{key:0,svgRef:w(B),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Z.value,isCursorPointer:I.value,onClose:Wt},ke({_:2},[Pe(w(i),t=>({name:t,fn:E(n=>[C(e.$slots,t,y(_(w(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`])):f(``,!0),Tt.value?(x(),p(`div`,Ve,null,512)):f(``,!0),P.value.title.text?(x(),p(`div`,He,[(x(),d(w(Je),{key:`title_${ft.value}`,config:{title:{cy:`molecule-div-title`,...P.value.title},subtitle:{cy:`molecule-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))])):f(``,!0),F.value.show&&ct.value&&(w(vt)||w(z))?(x(),d(w(et),{ref_key:`userOptionsRef`,ref:ht,key:`user_options_${dt.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:w(H),isImaging:w(St),uid:O.value,hasTooltip:F.value.buttons.tooltip&&N.value.show,hasPdf:F.value.buttons.pdf,hasXls:F.value.buttons.csv,hasImg:F.value.buttons.img,hasSvg:F.value.buttons.svg,hasTable:F.value.buttons.table,hasLabel:F.value.buttons.labels,hasFullscreen:F.value.buttons.fullscreen,hasAltCopy:F.value.buttons.altCopy,isTooltip:U.value.showTooltip,titles:{...F.value.buttonTitles},chartElement:j.value,position:F.value.position,hasAnnotator:F.value.buttons.annotator,isAnnotation:Z.value,callbacks:F.value.callbacks,printScale:F.value.print.scale,tableDialog:M.value.table.useDialog,hasZoom:F.value.buttons.zoom,isZoom:U.value.showZoom,isCursorPointer:I.value,onToggleFullscreen:zt,onGeneratePdf:w(Ct),onGenerateCsv:Lt,onGenerateImage:w(rn),onGenerateSvg:w(nn),onToggleTable:Bt,onToggleLabels:Vt,onToggleTooltip:Ht,onToggleAnnotator:Wt,onToggleZoom:Ut,onCopyAlt:an,style:b({visibility:w(vt)?w(z)?`visible`:`hidden`:`visible`})},ke({_:2},[Pe(w(a)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[C(e.$slots,t,y(_(w(o)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasLabel.hasFullscreen.hasAltCopy.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.hasZoom.isZoom.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),(x(),p(`svg`,{ref_key:`svgRef`,ref:B,key:`svg_${bt.value}`,xmlns:w(ue),viewBox:`${w(Q).x} ${w(Q).y} ${w(Q).width} ${w(Q).height}`,class:Me({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),style:b(`overflow: hidden; background:transparent;color:${P.value.color}`)},[h(w(tt)),e.$slots[`chart-background`]?(x(),p(`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`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,We)):f(``,!0),m(`defs`,null,[(x(!0),p(Oe,null,Pe(Object.keys(jt.value),(e,t)=>(x(),d(xe,{t:`radial`,id:`gradient_${e}`,key:`gradient_${e}_${t}`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,w(c)(e,.5),1],[`100%`,e,1]]},null,8,[`id`,`stops`]))),128))]),h(w(nt),{dataset:G.value,color:P.value.links.stroke,backgroundColor:P.value.backgroundColor,useChildColor:P.value.links.useChildColor},null,8,[`dataset`,`color`,`backgroundColor`,`useChildColor`]),h(w(it),{dataset:G.value,hoveredUid:J.value,stroke:P.value.nodes.stroke,strokeHovered:P.value.nodes.strokeHovered,onClick:Yt,onHover:Pt},{node:E(({node:t})=>[C(e.$slots,`node`,y(_({node:t})),void 0,!0)]),"node-svg":E(({nodeSvg:t})=>[C(e.$slots,`node-svg`,y(_({nodeSvg:t})),void 0,!0)]),_:3},8,[`dataset`,`hoveredUid`,`stroke`,`strokeHovered`]),U.value.showDataLabels&&!w(L)?(x(),d(w(rt),{key:1,dataset:G.value,color:P.value.color,hoveredUid:J.value},null,8,[`dataset`,`color`,`hoveredUid`])):f(``,!0),C(e.$slots,`svg`,{svg:{...W.value,drawingArea:{...w(Q)},isPrintingImg:w(H)||w(St)||w(en),isPrintingSvg:w(tn)}},void 0,!0)],14,Ue)),e.$slots.watermark?(x(),p(`div`,Ge,[C(e.$slots,`watermark`,y(_({isPrinting:w(H)||w(St)||w(en)||w(tn)})),void 0,!0)])):f(``,!0),w(qt)?(x(),p(`div`,Ke,[C(e.$slots,`reset-action`,{reset:w(Kt)},()=>[m(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:b({background:P.value.backgroundColor,cursor:I.value?`pointer`:`default`}),onClick:t[0]||=e=>w(Kt)(!0)},[h(w(Xe),{name:`refresh`,stroke:P.value.color},null,8,[`stroke`])],4)],!0)])):f(``,!0),e.$slots.source?(x(),p(`div`,qe,[C(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),h(w(Ye),{teleportTo:N.value.teleportTo,show:U.value.showTooltip&&k.value,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:j.value,content:A.value,isFullscreen:X.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},{"tooltip-before":E(()=>[C(e.$slots,`tooltip-before`,y(_({...K.value})),void 0,!0)]),tooltip:E(()=>[C(e.$slots,`tooltip`,y(_({...K.value})),void 0,!0)]),"tooltip-after":E(()=>[C(e.$slots,`tooltip-after`,y(_({...K.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`]),ct.value&&F.value.buttons.table?(x(),d(Fe($.value.component),je({key:7},$.value.props,{ref_key:`tableUnit`,ref:mt,onClose:Zt}),ke({content:E(()=>[(x(),d(w(Qe),{key:`table_${pt.value}`,colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.value.config,title:M.value.table.useDialog?``:$.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:I.value,onClose:Zt},{th:E(({th:e})=>[m(`div`,null,Ie(e),1)]),td:E(({td:e})=>[Ae(Ie(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:E(()=>[Ae(Ie($.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:E(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Lt(F.value.callbacks.csv),style:b({cursor:I.value?`pointer`:`default`})},[h(w(Xe),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),C(e.$slots,`skeleton`,{},()=>[w(L)?(x(),d(ve,{key:0})):f(``,!0)],!0)],46,Be))}},[[`__scopeId`,`data-v-ca23df82`]]);export{ze as n,Je as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as ee}from"./userOptionsSlots-DYuo-E5m.js";import{$ as o,D as te,Jt as s,Lt as ne,M as re,X as ie,Yt as ae,at as oe,i as se,in as ce,nt as le,t as ue,zt as de}from"./lib-zDxoqrgo.js";import{n as fe,t as pe}from"./useHints-BH9r_0Vd.js";import{t as me}from"./useConfig-CKdzPrcf.js";import{t as he}from"./usePrinter-CnyKPIFM.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{t as ve}from"./useChartExport-DtPNpc9M.js";import{n as ye}from"./Title-BRAjxtjG.js";import{t as be}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as xe,t as Se}from"./useResponsive-D2CPcpda.js";import{t as Ce}from"./DefGrad-DKMq1REY.js";import{t as we}from"./A11yDataTable-DWNlWXzs.js";import{t as Te}from"./resolveChartConfig-BSo1Oe9n.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./chartImage-NwZO-elv.js";import{t as ke}from"./Legend-DokTll4u.js";import{t as Ae}from"./vue_ui_mood_radar-CXaBdJnv.js";import{Fragment as je,Teleport as Me,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as Ne,createTextVNode as Pe,createVNode as p,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as Fe,nextTick as Ie,normalizeClass as Le,normalizeProps as Re,normalizeStyle as g,onMounted as ze,openBlock as _,ref as v,renderList as Be,renderSlot as y,resolveDynamicComponent as Ve,toDisplayString as b,toRefs as He,unref as x,watch as Ue,withCtx as S}from"vue";var We=/* @__PURE__ */ e({default:()=>C}),Ge=[`id`],Ke=[`id`],qe=[`id`],Je={style:{position:`relative`}},Ye=[`xmlns`,`aria-describedby`,`viewBox`],Xe=[`width`,`height`],Ze=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Qe=[`d`,`stroke`,`stroke-width`],$e=[`transform`],et=[`stroke`],tt=[`aria-label`,`fill`],nt=[`transform`],rt=[`stroke`],it=[`aria-label`,`fill`],at=[`transform`],ot=[`stroke`],st=[`aria-label`,`fill`],ct=[`transform`],lt=[`stroke`],ut=[`aria-label`,`fill`],dt=[`transform`],ft=[`stroke`],pt=[`aria-label`,`fill`],mt=[`d`,`stroke`,`stroke-width`,`fill`],ht=[`x1`,`y1`,`x2`,`y2`,`stroke`],gt=[`cx`,`cy`,`fill`,`stroke`],_t=[`cx`,`cy`,`fill`,`stroke`],vt=[`x`,`y`,`fill`,`font-weight`],yt=[`x`,`y`,`fill`],bt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},xt={key:5,class:`vue-data-ui-watermark`},St=[`id`],Ct=[`onClick`,`onKeydown`],wt={key:0},Tt={key:1},C=/*#__PURE__*/ be({__name:`vue-ui-mood-radar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:be,emit:We}){let C=m(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),Et=m(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),Dt=m(()=>import(`./DataTable-DSUA5M9p.js`)),Ot=m(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),kt=m(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),At=m(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),jt=m(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_mood_radar:Mt}=me(),w=e,Nt=We,T=v(ie()),E=v(null),D=v(null),Pt=v(null),Ft=v(0),It=v(0),Lt=v(0),Rt=v(null),zt=v(null),O=v(null),Bt=v(null),Vt=v(null),Ht=v(!1),Ut=v(null),Wt=v(null),k=v(null),Gt=v(!1),Kt=c(()=>!!w.dataset&&Object.keys(w.dataset).length),A=v(en()),j=c(()=>A.value.userOptions),M=c(()=>A.value.style.chart.layout.smileys),N=c(()=>A.value.style.chart.layout),P=c(()=>A.value.style.chart);fe({config:()=>A.value,dataset:()=>w.dataset,component:`VueUiMoodRadar`,rules:[pe.noHint]});let F=c(()=>A.value.userOptions.useCursorPointer),qt=c(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A`},outerPolygon:{stroke:`#6A6A6A`},dataPolygon:{color:`#6A6A6A`,opacity:30,stroke:`#6A6A6A`},smileys:{colors:{1:`#DBDBDB`,2:`#C4C4C4`,3:`#ADADAD`,4:`#969696`,5:`#808080`}},dataLabel:{color:`transparent`}},legend:{backgroundColor:`transparent`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:Jt,FINAL_DATASET:I}=ge({...He(w),FINAL_CONFIG:A,prepareConfig:en,callback:()=>{Promise.resolve().then(async()=>{await Ie(),R.value.showTable=A.value.table.show})},skeletonDataset:w.config?.skeletonDataset??{1:1,2:1,3:1,4:1,5:1},skeletonConfig:ce({defaultConfig:A.value,userConfig:qt.value})});ze(()=>{Ht.value=!0,Xt()});let Yt=c(()=>A.value.debug);function Xt(){if(de(w.dataset)&&oe({componentName:`VueUiMoodRadar`,type:`dataset`,debug:Yt.value}),A.value.responsive){let e=xe(()=>{let{width:e,height:t}=Se({chart:E.value,title:P.value.title.text?Rt.value:null,legend:P.value.legend.show?zt.value:null,noTitle:Pt.value,source:Vt.value});requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12})});O.value&&(Bt.value&&O.value.unobserve(Bt.value),O.value.disconnect()),O.value=new ResizeObserver(e),Bt.value=E.value.parentNode,O.value.observe(Bt.value)}}let{userOptionsVisible:Zt,setUserOptionsVisibility:Qt,keepUserOptionState:$t}=Ee({config:A.value}),{svgRef:L}=De({config:P.value.title});function en(){return Te(w.config,Mt,Ae)}Ue(()=>w.config,e=>{A.value=en(),Zt.value=!A.value.userOptions.showOnChartHover,Xt(),Ft.value+=1,It.value+=1,Lt.value+=1,R.value.showTable=A.value.table.show},{deep:!0});let{isPrinting:tn,isImaging:nn,generatePdf:rn,generateImage:an}=he({elementId:T.value,fileName:P.value.title.text||`vue-ui-mood-radar`,options:A.value.userOptions.print}),on=c(()=>A.value.userOptions.show&&!P.value.title.text),R=v({showTable:A.value.table.show}),z=v({height:256,width:256}),sn={5:{x:128,y:35},4:{x:218,y:98.5},3:{x:185,y:204},2:{x:70,y:204},1:{x:38.5,y:98.5}},cn=c(()=>{let e={};return pn.value.forEach(t=>{e[t.key]={x:t.x,y:t.y}}),e});function B(e){let t=sn[e],n=cn.value[e]||t;return`translate(${n.x-t.x}, ${n.y-t.y})`}let ln=c(()=>re({plot:{x:z.value.width/2,y:z.value.height/2},radius:Math.min(z.value.height,z.value.width)*.35,sides:5,rotation:11}));function un({centerX:e,centerY:t,apexX:n,apexY:r,proportion:i,key:a,value:ee}){return{x:e+(n-e)*i,y:t+(r-t)*i,key:a,value:ee}}let dn=c(()=>Math.max(...Object.values(I.value).map(e=>isNaN(e)?0:e))),V=c(()=>Object.values(I.value).reduce((e,t)=>(isNaN(e)?0:e)+(isNaN(t)?0:t),0)),H=c(()=>Object.keys(I.value).map((e,t)=>{let n=typeof I.value[e]!=`number`||isNaN(I.value[e])?0:I.value[e];return{index:t,key:e,value:n,proportion:n/V.value,color:M.value.colors[e]}}).map(e=>({...e,onSelect:()=>U(e.key)})).sort((e,t)=>t.key-e.key)),fn=c(()=>H.value.map((e,t)=>({...e,display:`${se(N.value.dataLabel.formatter,e.value,o({p:N.value.dataLabel.prefix,v:e.value,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}))}${Jt.value?``:` (${o({v:e.proportion*100,s:`%`,r:P.value.legend.roundingPercentage})})`}`}))),pn=c(()=>([`1`,`2`,`3`,`4`,`5`].forEach(e=>{[null,void 0].includes(I.value[e])&&oe({componentName:`VueUiMoodRadar`,type:`datasetAttribute`,property:e,debug:Yt.value})}),ln.value.coordinates.map((e,t)=>{let n=un({centerX:z.value.width/2,centerY:z.value.height/2,apexX:e.x,apexY:e.y,proportion:H.value[t].value/dn.value,key:H.value[t].key,value:H.value[t].value});return{...e,plots:n,key:H.value[t].key}}))),mn=c(()=>({cy:`mood-radar-legend`,backgroundColor:P.value.legend.backgroundColor,color:P.value.legend.color,fontSize:P.value.legend.fontSize,paddingBottom:12,fontWeight:P.value.legend.bold?`bold`:``}));function U(e){e===D.value?D.value=null:(D.value=e,K(e))}function W(e){D.value=e;let t=H.value.find(t=>t.key===e);A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:t.index})}function G(e){D.value=null;let t=H.value.find(t=>t.key===e);A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:t.index})}function K(e){let t=H.value.find(t=>t.key===e);A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:t.index})}let q=c(()=>({head:H.value.map(e=>({name:e.key,color:e.color})),body:H.value.map(e=>isNaN(e.value)?0:e.value)}));function hn(e=null){Ie(()=>{let t=q.value.head.map((e,t)=>[[e.name],[q.value.body[t]],[isNaN(q.value.body[t]/V.value)?`-`:q.value.body[t]/V.value*100]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=te(n);e?e(r):le({csvContent:r,title:P.value.title.text||`vue-ui-mood-radar`})})}let J=c(()=>({head:[`__SUM__`,Number(V.value.toFixed(A.value.table.td.roundingValue)).toLocaleString(),`100%`],body:q.value.head.map((e,t)=>[{color:e.color,name:e.name},q.value.body[t].toFixed(A.value.table.td.roundingValue),isNaN(q.value.body[t]/V.value)?`-`:(q.value.body[t]/V.value*100).toFixed(A.value.table.td.roundingPercentage)+`%`]),config:{th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}));function gn(){return H.value}function _n(){R.value.showTable=!R.value.showTable}let Y=v(!1);function vn(e){Y.value=e}let X=v(!1);function yn(){X.value=!X.value}let bn=Oe(E,()=>P.value.title.text),Z=c(()=>n({config:A,style:P,mutableConfig:R,dialog:jt,accordion:Et,isFullscreen:Y,parent:E,maxWidth:800,isCursorPointer:F}));Ue(()=>R.value.showTable,e=>t(e,A,Ut));function xn(){R.value.showTable=!1,Wt.value&&Wt.value.setTableIconState(!1)}let Sn=c(()=>fn.value.map(e=>({...e,name:e.display,shape:`circle`}))),Cn=c(()=>P.value.backgroundColor),wn=c(()=>P.value.legend),Tn=c(()=>P.value.title),{isCallbackImaging:En,isCallbackSvg:Dn,generateSvg:On,onGenerateImage:kn}=ve({svg:L,title:Tn,legend:wn,legendItems:Sn,backgroundColor:Cn,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:an});async function An(){if(Nt(`copyAlt`,{config:A.value,dataset:H.value}),!A.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:H.value}))}let Q=c(()=>H.value.map(e=>String(e.key)));function jn(){Qt(!0)}function Mn(){Qt(!1)}function Nn(e){return H.value.find(t=>String(t.key)===String(e))}function Pn(e,t,n){return se(N.value.dataLabel.formatter,e,o({p:N.value.dataLabel.prefix,v:e,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}),{datapoint:n,seriesIndex:t})}function Fn(e){return o({v:V.value?e/V.value*100:0,s:`%`,r:N.value.dataLabel.roundingPercentage})}function $(e){let t=Nn(e);return t?`${e}, ${Pn(t.value,t.index,t)}, ${Fn(t.value)}`:`${e}`}function In(e){let t=Q.value[e];t&&(k.value=e,D.value=t)}function Ln(){Gt.value=!0}function Rn(){k.value=null,D.value=null,Gt.value=!1}function zn(e){if(!L.value||!Q.value.length||X.value||document.activeElement!==L.value)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){k.value=null,D.value=null;return}if(r){if(k.value===null)return;let e=Q.value[k.value];if(!e)return;U(e);return}let a=k.value;a===null||a<0||a>=Q.value.length?a=n?0:Q.value.length-1:n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)),In(a)}function Bn(e,t){let n=e.key===`Enter`||e.key===` `,r=e.key===`Escape`;if(n||r){if(e.preventDefault(),e.stopPropagation(),r){k.value=null,D.value=null;return}U(String(t))}}let Vn=c(()=>({headers:J.value?.colNames??[],rows:H.value.map(e=>[String(e.key),Pn(e.value,e.index,e),Fn(e.value)])}));return be({getData:gn,getImage:bn,generatePdf:rn,generateCsv:hn,generateImage:an,generateSvg:On,toggleTable:_n,toggleAnnotator:yn,toggleFullscreen:vn,copyAlt:An}),(e,t)=>(_(),d(`div`,{class:Le(`vue-data-ui-component vue-ui-mood-radar ${Y.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`moodRadarChart`,ref:E,id:`${T.value}`,style:g(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:jn,onMouseleave:Mn},[f(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[f(`p`,null,b(A.value.a11y.translations.keyboardNavigation),1)],8,Ke),Vn.value?.rows?.length?(_(),l(we,{key:0,uid:T.value,head:Vn.value.headers,body:Vn.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):u(``,!0),j.value.buttons.annotator?(_(),l(x(Ot),{key:1,svgRef:x(L),backgroundColor:P.value.backgroundColor,color:P.value.color,active:X.value,isCursorPointer:F.value,palette:j.value.annotatorPalette,onClose:yn},Ne({_:2},[Be(x(i),t=>({name:t,fn:S(n=>[y(e.$slots,t,Re(h(x(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):u(``,!0),on.value?(_(),d(`div`,{key:2,ref_key:`noTitle`,ref:Pt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):u(``,!0),P.value.title.text?(_(),d(`div`,{key:3,ref_key:`chartTitle`,ref:Rt,style:`width:100%;background:transparent`},[p(ye,{config:{title:{cy:`mood-radar-title`,...P.value.title},subtitle:{cy:`mood-radar-subtitle`,...P.value.title.subtitle}}},null,8,[`config`])],512)):u(``,!0),f(`div`,{id:`legend-top-${T.value}`},null,8,qe),j.value.show&&Kt.value&&(x($t)||x(Zt))?(_(),l(x(kt),{key:4,ref_key:`userOptionsRef`,ref:Wt,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:x(tn),isImaging:x(nn),uid:T.value,hasPdf:j.value.buttons.pdf,hasXls:j.value.buttons.csv,hasImg:j.value.buttons.img,hasSvg:j.value.buttons.svg,hasTable:j.value.buttons.table,hasFullscreen:j.value.buttons.fullscreen,hasAltCopy:j.value.buttons.altCopy,isFullscreen:Y.value,titles:{...j.value.buttonTitles},chartElement:E.value,position:j.value.position,hasAnnotator:j.value.buttons.annotator,isAnnotation:X.value,callbacks:j.value.callbacks,printScale:j.value.print.scale,tableDialog:A.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:vn,onGeneratePdf:x(rn),onGenerateCsv:hn,onGenerateImage:x(kn),onGenerateSvg:x(On),onToggleTable:_n,onToggleAnnotator:yn,onCopyAlt:An,style:g({visibility:x($t)?x(Zt)?`visible`:`hidden`:`visible`})},Ne({_:2},[Be(x(a)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,Re(h(x(ee)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):u(``,!0),f(`div`,Je,[(_(),d(`svg`,{ref_key:`svgRef`,ref:L,xmlns:x(ue),"aria-describedby":`chart-instructions-${T.value}`,viewBox:`0 0 ${z.value.width} ${z.value.height}`,class:Le({"vue-data-ui-fullscreen--on":Y.value,"vue-data-ui-fulscreen--off":!Y.value}),style:g(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:Ln,onBlur:Rn,onKeydown:zn},[p(x(At)),e.$slots[`chart-background`]?(_(),d(`foreignObject`,{key:0,x:0,y:0,width:z.value.width,height:z.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,Xe)):u(``,!0),f(`defs`,null,[p(Ce,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`mood_radar_gradient_${T.value}`,stops:[[`0%`,x(s)(N.value.dataPolygon.color,N.value.dataPolygon.opacity),1],[`100%`,x(s)(x(ae)(N.value.dataPolygon.color,N.value.dataPolygon.gradient.intensity/100),N.value.dataPolygon.opacity),1]]},null,8,[`id`,`stops`])]),(_(!0),d(je,null,Be(ln.value.coordinates,e=>(_(),d(`line`,{x1:z.value.width/2,y1:z.value.height/2,x2:e.x,y2:e.y,stroke:N.value.grid.stroke,"stroke-width":N.value.grid.strokeWidth},null,8,Ze))),256)),f(`path`,{d:ln.value.path,fill:`none`,stroke:N.value.outerPolygon.stroke,"stroke-width":N.value.outerPolygon.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`},null,8,Qe),f(`g`,{transform:B(`5`)},[f(`path`,{fill:`none`,stroke:M.value.colors[5],"stroke-width":`1`,"stroke-linecap":`round`,d:`M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22`},null,8,et),f(`circle`,{role:`button`,class:`vue-ui-mood-radar-trap`,cx:`128`,cy:`25`,r:`20`,"aria-label":$(`5`),fill:D.value===`5`?x(s)(M.value.colors[5],20):`transparent`,onMouseenter:t[0]||=e=>W(`5`),onMouseleave:t[1]||=e=>G(`5`),onClick:t[2]||=e=>K(`5`)},null,40,tt)],8,$e),f(`g`,{transform:B(`4`)},[f(`path`,{fill:`none`,stroke:M.value.colors[4],"stroke-width":`1`,"stroke-linecap":`round`,d:`M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92`},null,8,rt),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`227`,cy:`95.5`,r:`20`,"aria-label":$(`4`),fill:D.value===`4`?x(s)(M.value.colors[4],20):`transparent`,onMouseenter:t[3]||=e=>W(`4`),onMouseleave:t[4]||=e=>G(`4`),onClick:t[5]||=e=>K(`4`)},null,40,it)],8,nt),f(`g`,{transform:B(`3`)},[f(`path`,{fill:`none`,stroke:M.value.colors[3],"stroke-width":`1`,"stroke-linecap":`round`,d:`M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215`},null,8,ot),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`190`,cy:`213.5`,r:`20`,"aria-label":$(`3`),fill:D.value===`3`?x(s)(M.value.colors[3],20):`transparent`,onMouseenter:t[6]||=e=>W(`3`),onMouseleave:t[7]||=e=>G(`3`),onClick:t[8]||=e=>K(`3`)},null,40,st)],8,at),f(`g`,{transform:B(`2`)},[f(`path`,{fill:`none`,stroke:M.value.colors[2],"stroke-width":`1`,"stroke-linecap":`round`,d:`M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210`},null,8,lt),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`65`,cy:`213.5`,r:`20`,"aria-label":$(`2`),fill:D.value===`2`?x(s)(M.value.colors[2],20):`transparent`,onMouseenter:t[9]||=e=>W(`2`),onMouseleave:t[10]||=e=>G(`2`),onClick:t[11]||=e=>K(`2`)},null,40,ut)],8,ct),f(`g`,{transform:B(`1`)},[f(`path`,{fill:`none`,stroke:M.value.colors[1],"stroke-width":`1`,"stroke-linecap":`round`,d:`M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93`},null,8,ft),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`29`,cy:`95.5`,r:`20`,"aria-label":$(`1`),fill:D.value===`1`?x(s)(M.value.colors[1],20):`transparent`,onMouseenter:t[12]||=e=>W(`1`),onMouseleave:t[13]||=e=>G(`1`),onClick:t[14]||=e=>K(`1`)},null,40,pt)],8,dt),f(`path`,{d:x(ne)(pn.value.map(e=>e.plots)),stroke:N.value.dataPolygon.stroke,"stroke-width":N.value.dataPolygon.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:N.value.dataPolygon.gradient.show?`url(#mood_radar_gradient_${T.value})`:x(s)(N.value.dataPolygon.color,N.value.dataPolygon.opacity)},null,8,mt),(_(!0),d(je,null,Be(pn.value.map(e=>e.plots),(e,t)=>(_(),d(`g`,{class:`vue-ui-mood-radar-trap`,style:g(`opacity:${D.value==e.key?`1`:`0`}`)},[f(`line`,{x1:e.x,y1:e.y,x2:z.value.width/2,y2:z.value.height/2,stroke:M.value.colors[e.key]},null,8,ht),f(`circle`,{cx:e.x,cy:e.y,fill:M.value.colors[e.key],r:`3`,stroke:P.value.backgroundColor,"stroke-width":.5},null,8,gt),f(`circle`,{cx:z.value.width/2,cy:z.value.height/2,fill:M.value.colors[e.key],r:`3`,stroke:P.value.backgroundColor,"stroke-width":.5},null,8,_t),f(`text`,{x:z.value.width/2,y:[`5`,5].includes(e.key)?z.value.height/2*1.13:z.value.height/2*.9375,fill:N.value.dataLabel.color,"font-size":`12`,"text-anchor":`middle`,"font-weight":N.value.dataLabel.bold?`bold`:`normal`},b(x(se)(N.value.dataLabel.formatter,e.value,x(o)({p:N.value.dataLabel.prefix,v:e.value,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}),{datapoint:e,seriesIndex:t})),9,vt),f(`text`,{x:z.value.width/2,y:[`5`,5].includes(e.key)?z.value.height/2*1.273:z.value.height/2*.7968,fill:N.value.dataLabel.color,"font-size":`12`,"text-anchor":`middle`},` (`+b(x(o)({v:e.value/V.value*100,s:`%`,r:N.value.dataLabel.roundingPercentage}))+`) `,9,yt)],4))),256)),y(e.$slots,`svg`,{svg:{...z.value,isPrintingImg:x(tn)||x(nn)||x(En),isPrintingSvg:x(Dn)}},void 0,!0)],46,Ye)),e.$slots.hint?(_(),d(`div`,bt,[y(e.$slots,`hint`,Re(h({hint:A.value.a11y.translations.keyboardNavigation,isVisible:Gt.value})),void 0,!0)])):u(``,!0)]),e.$slots.watermark?(_(),d(`div`,xt,[y(e.$slots,`watermark`,Re(h({isPrinting:x(tn)||x(nn)||x(En)||x(Dn)})),void 0,!0)])):u(``,!0),f(`div`,{id:`legend-bottom-${T.value}`},null,8,St),Ht.value&&(P.value.legend.show||e.$slots.legend)?(_(),l(Me,{key:6,to:P.value.legend.position===`top`?`#legend-top-${T.value}`:`#legend-bottom-${T.value}`},[f(`div`,{ref_key:`chartLegend`,ref:zt},[y(e.$slots,`legend`,{legend:H.value},()=>[P.value.legend.show?(_(),l(ke,{legendSet:fn.value,config:mn.value,key:`legend_${Lt.value}`,isCursorPointer:F.value,style:{display:`flex`,"row-gap":`6px`},onFocusMarker:t[15]||=({legend:e})=>U(e.key)},{item:S(({legend:e,index:t})=>[f(`div`,{role:`button`,onClick:()=>U(e.key),style:{display:`flex`,"flex-direction":`row`,gap:`3px`,"align-items":`center`,margin:`3px 0`},onKeydown:t=>Bn(t,String(e.key))},[e.key==1?(_(),l(x(C),{key:0,strokeWidth:1,name:`moodSad`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==2?(_(),l(x(C),{key:1,strokeWidth:1,name:`moodFlat`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==3?(_(),l(x(C),{key:2,strokeWidth:1,name:`moodNeutral`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==4?(_(),l(x(C),{key:3,strokeWidth:1,name:`smiley`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==5?(_(),l(x(C),{key:4,strokeWidth:1,name:`moodHappy`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),x(Jt)?u(``,!0):(_(),d(`span`,{key:5,style:g({fontWeight:P.value.legend.bold?`bold`:`normal`})},b(e.display),5))],40,Ct)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):u(``,!0)],!0)],512)],8,[`to`])):u(``,!0),e.$slots.source?(_(),d(`div`,{key:7,ref_key:`source`,ref:Vt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),Kt.value&&j.value.buttons.table?(_(),l(Ve(Z.value.component),Fe({key:8},Z.value.props,{ref_key:`tableUnit`,ref:Ut,onClose:xn}),Ne({content:S(()=>[p(x(Dt),{colNames:J.value.colNames,head:J.value.head,body:J.value.body,config:J.value.config,title:A.value.table.useDialog?``:Z.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:F.value,onClose:xn},{th:S(({th:e})=>[e===`__SUM__`?(_(),d(`div`,wt,[p(x(C),{name:`sigma`,stroke:J.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),d(`div`,Tt,b(e),1))]),td:S(({td:e})=>[Pe(b(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Pe(b(Z.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[f(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[16]||=e=>hn(j.value.callbacks.csv),style:g({cursor:F.value?`pointer`:`default`})},[p(x(C),{name:`fileCsv`,stroke:Z.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):u(``,!0),y(e.$slots,`skeleton`,{},()=>[x(Jt)?(_(),l(_e,{key:0})):u(``,!0)],!0)],46,Ge))}},[[`__scopeId`,`data-v-5d5591fd`]]);export{We as n,C as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as ee}from"./userOptionsSlots-DYuo-E5m.js";import{$ as o,D as te,Jt as s,Lt as ne,M as re,X as ie,Yt as ae,at as oe,i as se,in as ce,nt as le,t as ue,zt as de}from"./lib-CV_IANZ6.js";import{n as fe,t as pe}from"./useHints-BH9r_0Vd.js";import{t as me}from"./useConfig-CKdzPrcf.js";import{t as he}from"./usePrinter-hLW3cv4N.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{t as ve}from"./useChartExport-DtPNpc9M.js";import{n as ye}from"./Title-BGYFqulv.js";import{t as be}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as xe,t as Se}from"./useResponsive-D2CPcpda.js";import{t as Ce}from"./DefGrad-DKMq1REY.js";import{t as we}from"./A11yDataTable-DWNlWXzs.js";import{t as Te}from"./resolveChartConfig-DZg-korK.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./chartImage-CIvU_04o.js";import{t as ke}from"./Legend-D8YoT1RJ.js";import{t as Ae}from"./vue_ui_mood_radar-CXaBdJnv.js";import{Fragment as je,Teleport as Me,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as Ne,createTextVNode as Pe,createVNode as p,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as Fe,nextTick as Ie,normalizeClass as Le,normalizeProps as Re,normalizeStyle as g,onMounted as ze,openBlock as _,ref as v,renderList as Be,renderSlot as y,resolveDynamicComponent as Ve,toDisplayString as b,toRefs as He,unref as x,watch as Ue,withCtx as S}from"vue";var We=/* @__PURE__ */ e({default:()=>C}),Ge=[`id`],Ke=[`id`],qe=[`id`],Je={style:{position:`relative`}},Ye=[`xmlns`,`aria-describedby`,`viewBox`],Xe=[`width`,`height`],Ze=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Qe=[`d`,`stroke`,`stroke-width`],$e=[`transform`],et=[`stroke`],tt=[`aria-label`,`fill`],nt=[`transform`],rt=[`stroke`],it=[`aria-label`,`fill`],at=[`transform`],ot=[`stroke`],st=[`aria-label`,`fill`],ct=[`transform`],lt=[`stroke`],ut=[`aria-label`,`fill`],dt=[`transform`],ft=[`stroke`],pt=[`aria-label`,`fill`],mt=[`d`,`stroke`,`stroke-width`,`fill`],ht=[`x1`,`y1`,`x2`,`y2`,`stroke`],gt=[`cx`,`cy`,`fill`,`stroke`],_t=[`cx`,`cy`,`fill`,`stroke`],vt=[`x`,`y`,`fill`,`font-weight`],yt=[`x`,`y`,`fill`],bt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},xt={key:5,class:`vue-data-ui-watermark`},St=[`id`],Ct=[`onClick`,`onKeydown`],wt={key:0},Tt={key:1},C=/*#__PURE__*/ be({__name:`vue-ui-mood-radar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:be,emit:We}){let C=m(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),Et=m(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),Dt=m(()=>import(`./DataTable-WNecJMcY.js`)),Ot=m(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),kt=m(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),At=m(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),jt=m(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_mood_radar:Mt}=me(),w=e,Nt=We,T=v(ie()),E=v(null),D=v(null),Pt=v(null),Ft=v(0),It=v(0),Lt=v(0),Rt=v(null),zt=v(null),O=v(null),Bt=v(null),Vt=v(null),Ht=v(!1),Ut=v(null),Wt=v(null),k=v(null),Gt=v(!1),Kt=c(()=>!!w.dataset&&Object.keys(w.dataset).length),A=v(en()),j=c(()=>A.value.userOptions),M=c(()=>A.value.style.chart.layout.smileys),N=c(()=>A.value.style.chart.layout),P=c(()=>A.value.style.chart);fe({config:()=>A.value,dataset:()=>w.dataset,component:`VueUiMoodRadar`,rules:[pe.noHint]});let F=c(()=>A.value.userOptions.useCursorPointer),qt=c(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A`},outerPolygon:{stroke:`#6A6A6A`},dataPolygon:{color:`#6A6A6A`,opacity:30,stroke:`#6A6A6A`},smileys:{colors:{1:`#DBDBDB`,2:`#C4C4C4`,3:`#ADADAD`,4:`#969696`,5:`#808080`}},dataLabel:{color:`transparent`}},legend:{backgroundColor:`transparent`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:Jt,FINAL_DATASET:I}=ge({...He(w),FINAL_CONFIG:A,prepareConfig:en,callback:()=>{Promise.resolve().then(async()=>{await Ie(),R.value.showTable=A.value.table.show})},skeletonDataset:w.config?.skeletonDataset??{1:1,2:1,3:1,4:1,5:1},skeletonConfig:ce({defaultConfig:A.value,userConfig:qt.value})});ze(()=>{Ht.value=!0,Xt()});let Yt=c(()=>A.value.debug);function Xt(){if(de(w.dataset)&&oe({componentName:`VueUiMoodRadar`,type:`dataset`,debug:Yt.value}),A.value.responsive){let e=xe(()=>{let{width:e,height:t}=Se({chart:E.value,title:P.value.title.text?Rt.value:null,legend:P.value.legend.show?zt.value:null,noTitle:Pt.value,source:Vt.value});requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12})});O.value&&(Bt.value&&O.value.unobserve(Bt.value),O.value.disconnect()),O.value=new ResizeObserver(e),Bt.value=E.value.parentNode,O.value.observe(Bt.value)}}let{userOptionsVisible:Zt,setUserOptionsVisibility:Qt,keepUserOptionState:$t}=Ee({config:A.value}),{svgRef:L}=De({config:P.value.title});function en(){return Te(w.config,Mt,Ae)}Ue(()=>w.config,e=>{A.value=en(),Zt.value=!A.value.userOptions.showOnChartHover,Xt(),Ft.value+=1,It.value+=1,Lt.value+=1,R.value.showTable=A.value.table.show},{deep:!0});let{isPrinting:tn,isImaging:nn,generatePdf:rn,generateImage:an}=he({elementId:T.value,fileName:P.value.title.text||`vue-ui-mood-radar`,options:A.value.userOptions.print}),on=c(()=>A.value.userOptions.show&&!P.value.title.text),R=v({showTable:A.value.table.show}),z=v({height:256,width:256}),sn={5:{x:128,y:35},4:{x:218,y:98.5},3:{x:185,y:204},2:{x:70,y:204},1:{x:38.5,y:98.5}},cn=c(()=>{let e={};return pn.value.forEach(t=>{e[t.key]={x:t.x,y:t.y}}),e});function B(e){let t=sn[e],n=cn.value[e]||t;return`translate(${n.x-t.x}, ${n.y-t.y})`}let ln=c(()=>re({plot:{x:z.value.width/2,y:z.value.height/2},radius:Math.min(z.value.height,z.value.width)*.35,sides:5,rotation:11}));function un({centerX:e,centerY:t,apexX:n,apexY:r,proportion:i,key:a,value:ee}){return{x:e+(n-e)*i,y:t+(r-t)*i,key:a,value:ee}}let dn=c(()=>Math.max(...Object.values(I.value).map(e=>isNaN(e)?0:e))),V=c(()=>Object.values(I.value).reduce((e,t)=>(isNaN(e)?0:e)+(isNaN(t)?0:t),0)),H=c(()=>Object.keys(I.value).map((e,t)=>{let n=typeof I.value[e]!=`number`||isNaN(I.value[e])?0:I.value[e];return{index:t,key:e,value:n,proportion:n/V.value,color:M.value.colors[e]}}).map(e=>({...e,onSelect:()=>U(e.key)})).sort((e,t)=>t.key-e.key)),fn=c(()=>H.value.map((e,t)=>({...e,display:`${se(N.value.dataLabel.formatter,e.value,o({p:N.value.dataLabel.prefix,v:e.value,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}))}${Jt.value?``:` (${o({v:e.proportion*100,s:`%`,r:P.value.legend.roundingPercentage})})`}`}))),pn=c(()=>([`1`,`2`,`3`,`4`,`5`].forEach(e=>{[null,void 0].includes(I.value[e])&&oe({componentName:`VueUiMoodRadar`,type:`datasetAttribute`,property:e,debug:Yt.value})}),ln.value.coordinates.map((e,t)=>{let n=un({centerX:z.value.width/2,centerY:z.value.height/2,apexX:e.x,apexY:e.y,proportion:H.value[t].value/dn.value,key:H.value[t].key,value:H.value[t].value});return{...e,plots:n,key:H.value[t].key}}))),mn=c(()=>({cy:`mood-radar-legend`,backgroundColor:P.value.legend.backgroundColor,color:P.value.legend.color,fontSize:P.value.legend.fontSize,paddingBottom:12,fontWeight:P.value.legend.bold?`bold`:``}));function U(e){e===D.value?D.value=null:(D.value=e,K(e))}function W(e){D.value=e;let t=H.value.find(t=>t.key===e);A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:t.index})}function G(e){D.value=null;let t=H.value.find(t=>t.key===e);A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:t.index})}function K(e){let t=H.value.find(t=>t.key===e);A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:t.index})}let q=c(()=>({head:H.value.map(e=>({name:e.key,color:e.color})),body:H.value.map(e=>isNaN(e.value)?0:e.value)}));function hn(e=null){Ie(()=>{let t=q.value.head.map((e,t)=>[[e.name],[q.value.body[t]],[isNaN(q.value.body[t]/V.value)?`-`:q.value.body[t]/V.value*100]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=te(n);e?e(r):le({csvContent:r,title:P.value.title.text||`vue-ui-mood-radar`})})}let J=c(()=>({head:[`__SUM__`,Number(V.value.toFixed(A.value.table.td.roundingValue)).toLocaleString(),`100%`],body:q.value.head.map((e,t)=>[{color:e.color,name:e.name},q.value.body[t].toFixed(A.value.table.td.roundingValue),isNaN(q.value.body[t]/V.value)?`-`:(q.value.body[t]/V.value*100).toFixed(A.value.table.td.roundingPercentage)+`%`]),config:{th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}));function gn(){return H.value}function _n(){R.value.showTable=!R.value.showTable}let Y=v(!1);function vn(e){Y.value=e}let X=v(!1);function yn(){X.value=!X.value}let bn=Oe(E,()=>P.value.title.text),Z=c(()=>n({config:A,style:P,mutableConfig:R,dialog:jt,accordion:Et,isFullscreen:Y,parent:E,maxWidth:800,isCursorPointer:F}));Ue(()=>R.value.showTable,e=>t(e,A,Ut));function xn(){R.value.showTable=!1,Wt.value&&Wt.value.setTableIconState(!1)}let Sn=c(()=>fn.value.map(e=>({...e,name:e.display,shape:`circle`}))),Cn=c(()=>P.value.backgroundColor),wn=c(()=>P.value.legend),Tn=c(()=>P.value.title),{isCallbackImaging:En,isCallbackSvg:Dn,generateSvg:On,onGenerateImage:kn}=ve({svg:L,title:Tn,legend:wn,legendItems:Sn,backgroundColor:Cn,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:an});async function An(){if(Nt(`copyAlt`,{config:A.value,dataset:H.value}),!A.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:H.value}))}let Q=c(()=>H.value.map(e=>String(e.key)));function jn(){Qt(!0)}function Mn(){Qt(!1)}function Nn(e){return H.value.find(t=>String(t.key)===String(e))}function Pn(e,t,n){return se(N.value.dataLabel.formatter,e,o({p:N.value.dataLabel.prefix,v:e,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}),{datapoint:n,seriesIndex:t})}function Fn(e){return o({v:V.value?e/V.value*100:0,s:`%`,r:N.value.dataLabel.roundingPercentage})}function $(e){let t=Nn(e);return t?`${e}, ${Pn(t.value,t.index,t)}, ${Fn(t.value)}`:`${e}`}function In(e){let t=Q.value[e];t&&(k.value=e,D.value=t)}function Ln(){Gt.value=!0}function Rn(){k.value=null,D.value=null,Gt.value=!1}function zn(e){if(!L.value||!Q.value.length||X.value||document.activeElement!==L.value)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){k.value=null,D.value=null;return}if(r){if(k.value===null)return;let e=Q.value[k.value];if(!e)return;U(e);return}let a=k.value;a===null||a<0||a>=Q.value.length?a=n?0:Q.value.length-1:n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)),In(a)}function Bn(e,t){let n=e.key===`Enter`||e.key===` `,r=e.key===`Escape`;if(n||r){if(e.preventDefault(),e.stopPropagation(),r){k.value=null,D.value=null;return}U(String(t))}}let Vn=c(()=>({headers:J.value?.colNames??[],rows:H.value.map(e=>[String(e.key),Pn(e.value,e.index,e),Fn(e.value)])}));return be({getData:gn,getImage:bn,generatePdf:rn,generateCsv:hn,generateImage:an,generateSvg:On,toggleTable:_n,toggleAnnotator:yn,toggleFullscreen:vn,copyAlt:An}),(e,t)=>(_(),d(`div`,{class:Le(`vue-data-ui-component vue-ui-mood-radar ${Y.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`moodRadarChart`,ref:E,id:`${T.value}`,style:g(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:jn,onMouseleave:Mn},[f(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[f(`p`,null,b(A.value.a11y.translations.keyboardNavigation),1)],8,Ke),Vn.value?.rows?.length?(_(),l(we,{key:0,uid:T.value,head:Vn.value.headers,body:Vn.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):u(``,!0),j.value.buttons.annotator?(_(),l(x(Ot),{key:1,svgRef:x(L),backgroundColor:P.value.backgroundColor,color:P.value.color,active:X.value,isCursorPointer:F.value,palette:j.value.annotatorPalette,onClose:yn},Ne({_:2},[Be(x(i),t=>({name:t,fn:S(n=>[y(e.$slots,t,Re(h(x(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):u(``,!0),on.value?(_(),d(`div`,{key:2,ref_key:`noTitle`,ref:Pt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):u(``,!0),P.value.title.text?(_(),d(`div`,{key:3,ref_key:`chartTitle`,ref:Rt,style:`width:100%;background:transparent`},[p(ye,{config:{title:{cy:`mood-radar-title`,...P.value.title},subtitle:{cy:`mood-radar-subtitle`,...P.value.title.subtitle}}},null,8,[`config`])],512)):u(``,!0),f(`div`,{id:`legend-top-${T.value}`},null,8,qe),j.value.show&&Kt.value&&(x($t)||x(Zt))?(_(),l(x(kt),{key:4,ref_key:`userOptionsRef`,ref:Wt,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:x(tn),isImaging:x(nn),uid:T.value,hasPdf:j.value.buttons.pdf,hasXls:j.value.buttons.csv,hasImg:j.value.buttons.img,hasSvg:j.value.buttons.svg,hasTable:j.value.buttons.table,hasFullscreen:j.value.buttons.fullscreen,hasAltCopy:j.value.buttons.altCopy,isFullscreen:Y.value,titles:{...j.value.buttonTitles},chartElement:E.value,position:j.value.position,hasAnnotator:j.value.buttons.annotator,isAnnotation:X.value,callbacks:j.value.callbacks,printScale:j.value.print.scale,tableDialog:A.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:vn,onGeneratePdf:x(rn),onGenerateCsv:hn,onGenerateImage:x(kn),onGenerateSvg:x(On),onToggleTable:_n,onToggleAnnotator:yn,onCopyAlt:An,style:g({visibility:x($t)?x(Zt)?`visible`:`hidden`:`visible`})},Ne({_:2},[Be(x(a)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,Re(h(x(ee)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):u(``,!0),f(`div`,Je,[(_(),d(`svg`,{ref_key:`svgRef`,ref:L,xmlns:x(ue),"aria-describedby":`chart-instructions-${T.value}`,viewBox:`0 0 ${z.value.width} ${z.value.height}`,class:Le({"vue-data-ui-fullscreen--on":Y.value,"vue-data-ui-fulscreen--off":!Y.value}),style:g(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:Ln,onBlur:Rn,onKeydown:zn},[p(x(At)),e.$slots[`chart-background`]?(_(),d(`foreignObject`,{key:0,x:0,y:0,width:z.value.width,height:z.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,Xe)):u(``,!0),f(`defs`,null,[p(Ce,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`mood_radar_gradient_${T.value}`,stops:[[`0%`,x(s)(N.value.dataPolygon.color,N.value.dataPolygon.opacity),1],[`100%`,x(s)(x(ae)(N.value.dataPolygon.color,N.value.dataPolygon.gradient.intensity/100),N.value.dataPolygon.opacity),1]]},null,8,[`id`,`stops`])]),(_(!0),d(je,null,Be(ln.value.coordinates,e=>(_(),d(`line`,{x1:z.value.width/2,y1:z.value.height/2,x2:e.x,y2:e.y,stroke:N.value.grid.stroke,"stroke-width":N.value.grid.strokeWidth},null,8,Ze))),256)),f(`path`,{d:ln.value.path,fill:`none`,stroke:N.value.outerPolygon.stroke,"stroke-width":N.value.outerPolygon.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`},null,8,Qe),f(`g`,{transform:B(`5`)},[f(`path`,{fill:`none`,stroke:M.value.colors[5],"stroke-width":`1`,"stroke-linecap":`round`,d:`M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22`},null,8,et),f(`circle`,{role:`button`,class:`vue-ui-mood-radar-trap`,cx:`128`,cy:`25`,r:`20`,"aria-label":$(`5`),fill:D.value===`5`?x(s)(M.value.colors[5],20):`transparent`,onMouseenter:t[0]||=e=>W(`5`),onMouseleave:t[1]||=e=>G(`5`),onClick:t[2]||=e=>K(`5`)},null,40,tt)],8,$e),f(`g`,{transform:B(`4`)},[f(`path`,{fill:`none`,stroke:M.value.colors[4],"stroke-width":`1`,"stroke-linecap":`round`,d:`M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92`},null,8,rt),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`227`,cy:`95.5`,r:`20`,"aria-label":$(`4`),fill:D.value===`4`?x(s)(M.value.colors[4],20):`transparent`,onMouseenter:t[3]||=e=>W(`4`),onMouseleave:t[4]||=e=>G(`4`),onClick:t[5]||=e=>K(`4`)},null,40,it)],8,nt),f(`g`,{transform:B(`3`)},[f(`path`,{fill:`none`,stroke:M.value.colors[3],"stroke-width":`1`,"stroke-linecap":`round`,d:`M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215`},null,8,ot),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`190`,cy:`213.5`,r:`20`,"aria-label":$(`3`),fill:D.value===`3`?x(s)(M.value.colors[3],20):`transparent`,onMouseenter:t[6]||=e=>W(`3`),onMouseleave:t[7]||=e=>G(`3`),onClick:t[8]||=e=>K(`3`)},null,40,st)],8,at),f(`g`,{transform:B(`2`)},[f(`path`,{fill:`none`,stroke:M.value.colors[2],"stroke-width":`1`,"stroke-linecap":`round`,d:`M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210`},null,8,lt),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`65`,cy:`213.5`,r:`20`,"aria-label":$(`2`),fill:D.value===`2`?x(s)(M.value.colors[2],20):`transparent`,onMouseenter:t[9]||=e=>W(`2`),onMouseleave:t[10]||=e=>G(`2`),onClick:t[11]||=e=>K(`2`)},null,40,ut)],8,ct),f(`g`,{transform:B(`1`)},[f(`path`,{fill:`none`,stroke:M.value.colors[1],"stroke-width":`1`,"stroke-linecap":`round`,d:`M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93`},null,8,ft),f(`circle`,{class:`vue-ui-mood-radar-trap`,cx:`29`,cy:`95.5`,r:`20`,"aria-label":$(`1`),fill:D.value===`1`?x(s)(M.value.colors[1],20):`transparent`,onMouseenter:t[12]||=e=>W(`1`),onMouseleave:t[13]||=e=>G(`1`),onClick:t[14]||=e=>K(`1`)},null,40,pt)],8,dt),f(`path`,{d:x(ne)(pn.value.map(e=>e.plots)),stroke:N.value.dataPolygon.stroke,"stroke-width":N.value.dataPolygon.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:N.value.dataPolygon.gradient.show?`url(#mood_radar_gradient_${T.value})`:x(s)(N.value.dataPolygon.color,N.value.dataPolygon.opacity)},null,8,mt),(_(!0),d(je,null,Be(pn.value.map(e=>e.plots),(e,t)=>(_(),d(`g`,{class:`vue-ui-mood-radar-trap`,style:g(`opacity:${D.value==e.key?`1`:`0`}`)},[f(`line`,{x1:e.x,y1:e.y,x2:z.value.width/2,y2:z.value.height/2,stroke:M.value.colors[e.key]},null,8,ht),f(`circle`,{cx:e.x,cy:e.y,fill:M.value.colors[e.key],r:`3`,stroke:P.value.backgroundColor,"stroke-width":.5},null,8,gt),f(`circle`,{cx:z.value.width/2,cy:z.value.height/2,fill:M.value.colors[e.key],r:`3`,stroke:P.value.backgroundColor,"stroke-width":.5},null,8,_t),f(`text`,{x:z.value.width/2,y:[`5`,5].includes(e.key)?z.value.height/2*1.13:z.value.height/2*.9375,fill:N.value.dataLabel.color,"font-size":`12`,"text-anchor":`middle`,"font-weight":N.value.dataLabel.bold?`bold`:`normal`},b(x(se)(N.value.dataLabel.formatter,e.value,x(o)({p:N.value.dataLabel.prefix,v:e.value,s:N.value.dataLabel.suffix,r:N.value.dataLabel.roundingValue}),{datapoint:e,seriesIndex:t})),9,vt),f(`text`,{x:z.value.width/2,y:[`5`,5].includes(e.key)?z.value.height/2*1.273:z.value.height/2*.7968,fill:N.value.dataLabel.color,"font-size":`12`,"text-anchor":`middle`},` (`+b(x(o)({v:e.value/V.value*100,s:`%`,r:N.value.dataLabel.roundingPercentage}))+`) `,9,yt)],4))),256)),y(e.$slots,`svg`,{svg:{...z.value,isPrintingImg:x(tn)||x(nn)||x(En),isPrintingSvg:x(Dn)}},void 0,!0)],46,Ye)),e.$slots.hint?(_(),d(`div`,bt,[y(e.$slots,`hint`,Re(h({hint:A.value.a11y.translations.keyboardNavigation,isVisible:Gt.value})),void 0,!0)])):u(``,!0)]),e.$slots.watermark?(_(),d(`div`,xt,[y(e.$slots,`watermark`,Re(h({isPrinting:x(tn)||x(nn)||x(En)||x(Dn)})),void 0,!0)])):u(``,!0),f(`div`,{id:`legend-bottom-${T.value}`},null,8,St),Ht.value&&(P.value.legend.show||e.$slots.legend)?(_(),l(Me,{key:6,to:P.value.legend.position===`top`?`#legend-top-${T.value}`:`#legend-bottom-${T.value}`},[f(`div`,{ref_key:`chartLegend`,ref:zt},[y(e.$slots,`legend`,{legend:H.value},()=>[P.value.legend.show?(_(),l(ke,{legendSet:fn.value,config:mn.value,key:`legend_${Lt.value}`,isCursorPointer:F.value,style:{display:`flex`,"row-gap":`6px`},onFocusMarker:t[15]||=({legend:e})=>U(e.key)},{item:S(({legend:e,index:t})=>[f(`div`,{role:`button`,onClick:()=>U(e.key),style:{display:`flex`,"flex-direction":`row`,gap:`3px`,"align-items":`center`,margin:`3px 0`},onKeydown:t=>Bn(t,String(e.key))},[e.key==1?(_(),l(x(C),{key:0,strokeWidth:1,name:`moodSad`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==2?(_(),l(x(C),{key:1,strokeWidth:1,name:`moodFlat`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==3?(_(),l(x(C),{key:2,strokeWidth:1,name:`moodNeutral`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==4?(_(),l(x(C),{key:3,strokeWidth:1,name:`smiley`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),e.key==5?(_(),l(x(C),{key:4,strokeWidth:1,name:`moodHappy`,stroke:M.value.colors[e.key]},null,8,[`stroke`])):u(``,!0),x(Jt)?u(``,!0):(_(),d(`span`,{key:5,style:g({fontWeight:P.value.legend.bold?`bold`:`normal`})},b(e.display),5))],40,Ct)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):u(``,!0)],!0)],512)],8,[`to`])):u(``,!0),e.$slots.source?(_(),d(`div`,{key:7,ref_key:`source`,ref:Vt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),Kt.value&&j.value.buttons.table?(_(),l(Ve(Z.value.component),Fe({key:8},Z.value.props,{ref_key:`tableUnit`,ref:Ut,onClose:xn}),Ne({content:S(()=>[p(x(Dt),{colNames:J.value.colNames,head:J.value.head,body:J.value.body,config:J.value.config,title:A.value.table.useDialog?``:Z.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:F.value,onClose:xn},{th:S(({th:e})=>[e===`__SUM__`?(_(),d(`div`,wt,[p(x(C),{name:`sigma`,stroke:J.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),d(`div`,Tt,b(e),1))]),td:S(({td:e})=>[Pe(b(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Pe(b(Z.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[f(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[16]||=e=>hn(j.value.callbacks.csv),style:g({cursor:F.value?`pointer`:`default`})},[p(x(C),{name:`fileCsv`,stroke:Z.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):u(``,!0),y(e.$slots,`skeleton`,{},()=>[x(Jt)?(_(),l(_e,{key:0})):u(``,!0)],!0)],46,Ge))}},[[`__scopeId`,`data-v-5d5591fd`]]);export{We as n,C as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as ee,Dt as c,Ht as te,It as ne,Jt as re,Kt as l,S as ie,Ut as ae,X as oe,Zt as se,at as ce,b as le,f as ue,i as de,in as fe,it as pe,n as me,nn as he,nt as ge,p as _e,pt as ve,t as ye,w as be,zt as xe}from"./lib-zDxoqrgo.js";import{n as Se,t as Ce}from"./useHints-BH9r_0Vd.js";import{t as we}from"./useConfig-CKdzPrcf.js";import{t as Te}from"./usePrinter-CnyKPIFM.js";import{n as Ee,t as De}from"./BaseScanner-8NdoBs7B.js";import{t as Oe}from"./useNestedProp-CT9phgWx.js";import{t as ke}from"./useThemeCheck-BKNRbGeC.js";import{t as Ae}from"./useChartExport-DtPNpc9M.js";import{n as je}from"./Title-BRAjxtjG.js";import{t as Me}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as Ne,t as Pe}from"./useResponsive-D2CPcpda.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./BaseLegendToggle-Dn_tNvn4.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"./chartImage-NwZO-elv.js";import{t as Ve}from"./labelUtils-Djp5nJtN.js";import{t as He}from"./Legend-DokTll4u.js";import{t as Ue}from"./vue_ui_nested_donuts-CRtGsJcz.js";import{Fragment as u,Teleport as We,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Ge,createTextVNode as Ke,createVNode as qe,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Je,nextTick as Ye,normalizeClass as Xe,normalizeProps as v,normalizeStyle as Ze,onBeforeUnmount as Qe,onMounted as $e,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as et,shallowRef as tt,toDisplayString as C,toRefs as nt,unref as w,vShow as rt,watch as it,withCtx as T,withDirectives as at}from"vue";var ot=/* @__PURE__ */ e({default:()=>Lt}),st=[`id`],ct=[`id`],lt=[`id`],ut={style:{position:`relative`}},dt=[`xmlns`,`aria-describedby`,`viewBox`],ft=[`width`,`height`],pt=[`id`],mt=[`id`],ht=[`id`],gt=[`flood-color`],_t=[`id`,`d`],vt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],yt=[`d`,`fill`,`stroke`,`stroke-width`],bt={key:1},xt=[`d`,`fill`],St={key:2},Ct=[`font-size`,`font-weight`,`fill`,`dy`],wt=[`href`],Tt=[`x`,`y`,`font-size`,`font-weight`,`fill`],Et={key:3},Dt=[`filter`],Ot=[`opacity`,`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],kt=[`opacity`,`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],At=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseleave`],jt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Mt={key:5,class:`vue-data-ui-watermark`},Nt=[`id`],Pt={key:0,class:`vue-ui-nested-donuts-legend-title`},Ft=[`onClick`],It={style:{display:`flex`,"align-items":`center`}},Lt=/*#__PURE__*/ Me({__name:`vue-ui-nested-donuts`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Me,emit:ot}){let Lt=g(()=>import(`./Tooltip-BUXB0i6z.js`)),Rt=g(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),zt=g(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),Bt=g(()=>import(`./DataTable-DSUA5M9p.js`)),Vt=g(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),Ht=g(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),Ut=g(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),Wt=g(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_nested_donuts:Gt}=we(),{isThemeValid:Kt,warnInvalidTheme:qt}=ke(),E=e,Jt=d({get(){return!!E.dataset&&E.dataset.length},set(e){return e}}),D=b(oe()),Yt=b(!1),Xt=b(``),Zt=b(null),Qt=b(0),O=b(null),$t=b(null),en=b(null),tn=b(null),nn=b(null),rn=b(0),an=b(0),on=b(0),k=b(!0),A=b([]),sn=b([]),cn=b(!1),ln=b(null),un=b(null),j=b(null),dn=b({x:0,y:0}),fn=b(`pointer`),pn=b(!1),M=b(!1);function mn(e){M.value=e,Qt.value+=1}let N=b(Sn()),P=d(()=>N.value.style.chart.layout.labels),F=d(()=>N.value.style.chart.tooltip),I=d(()=>N.value.userOptions),L=d(()=>N.value.style.chart.layout),R=d(()=>N.value.style.chart);Se({config:()=>N.value,dataset:()=>E.dataset,component:`VueUiNestedDonuts`,rules:[Ce.emptyArray,{test:e=>e.some(e=>e.series.length>6),message:[`👀 Some series have > 6 data points. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" data point.`,``,`▶️ Using filters to let users choose a maximum number of data points to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]},{test:e=>e.length===1,message:[`👀 There is only one series in your dataset. Consider:`,``,`▶️ Using VueUiDonut instead.`]},{test:e=>e.length>6,message:[`👀 The number of series in your dataset > 6. Consider:`,``,`▶️ 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 z=d(()=>N.value.userOptions.useCursorPointer),hn={name:``,series:[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}]},gn=d(()=>fe({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:_n,FINAL_DATASET:B,manualLoading:vn}=Ee({...nt(E),FINAL_CONFIG:N,prepareConfig:Sn,callback:()=>{Promise.resolve().then(async()=>{await En()})},skeletonDataset:E.config?.skeletonDataset??[hn,hn],skeletonConfig:fe({defaultConfig:N.value,userConfig:gn.value})}),{userOptionsVisible:yn,setUserOptionsVisibility:bn,keepUserOptionState:xn}=Re({config:N.value}),{svgRef:V}=ze({config:R.value.title});function Sn(){let e=Oe({userConfig:E.config,defaultConfig:Gt}),t={},n=e.theme;if(n){if(!Kt.value(e))qt(e),t=e;else{let r=Oe({userConfig:Ue[n]||E.config,defaultConfig:e});t={...Oe({userConfig:E.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:he[n]||te}}}else t=e;return t}let Cn=se(E.config);it(()=>E.config,(e,t)=>{let n=se(e),r=n!==Cn;Cn=n;let i=Sn();if(!r){N.value.style.chart.tooltip=i.style.chart.tooltip,W.value.showTooltip=N.value.style.chart.tooltip.show;return}_n.value||(N.value=i),yn.value=!N.value.userOptions.showOnChartHover,On(),rn.value+=1,an.value+=1,on.value+=1,W.value.dataLabels.show=P.value.dataLabels.show,W.value.showTable=N.value.table.show,W.value.showTooltip=F.value.show,G.value.width=R.value.width,G.value.height=R.value.height},{deep:!0});let wn=d(()=>{let{top:e,right:t,bottom:n,left:r}=R.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}});function Tn(e,t=1e3,n=50){return new Promise(r=>{let i=e.length;A.value=Array(i).fill(0),sn.value=[];let a=0;e.forEach((e,o)=>{setTimeout(()=>{let n=performance.now();function s(ee){let c=Math.min((ee-n)/t,1),te=e*pe(c);A.value[o]=te,A.value=[...A.value];let ne=[],re=0;E.dataset.forEach((e,t)=>{let n=le(e.series.reduce((e,t)=>e+le(l(t.values).reduce((e,t)=>e+t,0)),0))-le(A.value.slice(re,re+e.series.length).reduce((e,t)=>e+t,0));n>Number.MIN_VALUE&&ne.push({name:`__ghost__`,arcOf:e.name,arcOfId:`${D.value}_${t}`,id:`ghost_${D.value}_${t}`,seriesIndex:-1,datasetIndex:t,color:`transparent`,value:n,fullValue:n,absoluteValues:[],ghost:!0}),re+=e.series.length}),sn.value=ne,c<1?requestAnimationFrame(s):(a+=1,a===i&&r())}requestAnimationFrame(s)},o*n)})})}async function En(){if(N.value.startAnimation?.show){let e=B.value.flatMap(e=>e.series).map(e=>l(e.values).reduce((e,t)=>e+t,0));A.value=e.map(()=>0),k.value=!0,sn.value=B.value.map((e,t)=>{let n=e.series.reduce((e,t)=>e+l(t.values).reduce((e,t)=>e+t,0),0);return{name:`__ghost__`,arcOf:e.name,arcOfId:`${D.value}_${t}`,id:`ghost_${D.value}_${t}`,seriesIndex:-1,datasetIndex:t,color:`transparent`,value:n,fullValue:n,absoluteValues:[],ghost:!0}}),await Ye(),Tn(e,N.value.startAnimation.durationMs,N.value.startAnimation.staggerMs).then(()=>{k.value=!1,sn.value=[]})}else k.value=!1}$e(async()=>{cn.value=!0,On(),await En()});let H=tt(null),Dn=tt(null),U=d(()=>N.value.debug);function On(){if(xe(E.dataset)?(ce({componentName:`VueUiNestedDonuts`,type:`dataset`,debug:U.value}),Jt.value=!1,vn.value=!0):vn.value=N.value.loading,N.value.responsive){let e=Ne(()=>{let{width:e,height:t}=Pe({chart:O.value,title:R.value.title.text?$t.value:null,legend:R.value.legend.show?en.value:null,source:tn.value,noTitle:nn.value,padding:wn.value});requestAnimationFrame(()=>{G.value.width=e,G.value.height=t})});H.value&&(Dn.value&&H.value.unobserve(Dn.value),H.value.disconnect()),H.value=new ResizeObserver(e),Dn.value=O.value.parentNode,H.value.observe(Dn.value)}}Qe(()=>{H.value&&(Dn.value&&H.value.unobserve(Dn.value),H.value.disconnect())});let{isPrinting:kn,isImaging:An,generatePdf:jn,generateImage:Mn}=Te({elementId:`nested_donuts_${D.value}`,fileName:R.value.title.text||`vue-ui-nested-donuts`,options:N.value.userOptions.print}),Nn=d(()=>N.value.userOptions.show&&!R.value.title.text),Pn=d(()=>be(N.value.customPalette)),W=b({dataLabels:{show:P.value.dataLabels.show},showTable:N.value.table.show,showTooltip:F.value.show});it(N,()=>{W.value={dataLabels:{show:P.value.dataLabels.show},showTable:N.value.table.show,showTooltip:F.value.show}},{immediate:!0});let G=b({width:R.value.width,height:R.value.height}),K=ot;function Fn({datapoint:e,index:t,seriesIndex:n}){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:n}),K(`selectDatapoint`,{datapoint:e,index:t})}function In({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=pe}){let o=performance.now();function s(ee){let c=Math.min((ee-o)/n,1),te=a(c);r(e+(t-e)*te,c),c<1?requestAnimationFrame(s):(r(t,1),i&&i())}requestAnimationFrame(s)}let q=b([]),J=d(()=>{_n.value,B.value.forEach((e,t)=>{[null,void 0].includes(e.name)&&ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`name`,index:t,debug:U.value}),[null,void 0].includes(e.series)?ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`series`,index:t,debug:U.value}):e.series.length===0?ce({componentName:`VueUiNestedDonuts`,type:`datasetAttributeEmpty`,property:`series at index ${t}`,debug:U.value}):e.series.forEach((e,t)=>{[null,void 0].includes(e.name)&&ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`name`,index:t,key:`serie`,debug:U.value}),[null,void 0].includes(e.values)&&ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`values`,index:t,key:`serie`,debug:U.value})})});let e=0;return B.value.map((t,n)=>({...t,total:t.series.filter(e=>!q.value.includes(e.id)).map(e=>l(e.values).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),datasetIndex:n,id:`${D.value}_${n}`,series:t.series.map((r,i)=>{let a=l(r.values).reduce((e,t)=>e+t,0);return{name:r.name,arcOf:t.name,arcOfId:`${D.value}_${n}`,id:`${D.value}_${n}_${i}`,seriesIndex:i,datasetIndex:n,color:ie(r.color)||Pn.value[i]||te[i%te.length],value:k.value?A.value[e++]??0:a,absoluteValues:r.values||[]}})}))});it(()=>E.dataset,e=>{Array.isArray(e)&&e.length>0&&(vn.value=!1)},{immediate:!0});let Y=d(()=>Math.min(G.value.height,G.value.width)*(L.value.donut.strokeWidth/512)),X=d(()=>[...J.value].map((e,t)=>{let n=e.series.filter(e=>!q.value.includes(e.id)).map(e=>e.value).reduce((e,t)=>e+t,0);return{...e,total:n,series:e.series.filter(e=>!q.value.includes(e.id)).map(e=>({...e,proportion:e.value/n}))}}));function Ln(e,t,n){let r=0;for(let t=0;t<e.length;t+=1)n.includes(e[t])&&(r+=1);return r<t}let Z=b(X.value);it(()=>X.value,e=>Z.value=e);function Rn(e){let t=e.map(e=>e.id);if(e.some(e=>q.value.includes(e.id))){let e=new Set(t);q.value=q.value.filter(t=>!e.has(t))}else q.value.push(...t);K(`selectLegend`,X.value)}function zn(e){let t=E.dataset.flatMap((e,t)=>e.series.map((e,n)=>({value:l(e.values).reduce((e,t)=>e+t,0),id:`${D.value}_${t}_${n}`,arcOfId:`${D.value}_${t}`}))).find(t=>t.id===e.id);if(!t)return;let n=J.value.flatMap(e=>e.series).find(t=>t.id===e.id)?.value??0,r=Z.value.flatMap(e=>e.series).find(t=>t.id===e.id),i=r?r.value:0,a=J.value.find(e=>e.id===t.arcOfId);if(!a)return;let o=a.series.map(e=>e.id),s=Ln(o,o.length-1,q.value);q.value.includes(e.id)?(q.value=q.value.filter(t=>t!==e.id),N.value.serieToggleAnimation.show?In({from:i,to:n,duration:N.value.serieToggleAnimation.durationMs,onUpdate:t=>{Z.value=Z.value.map(n=>({...n,series:n.series.map(n=>n.id===e.id?{...n,value:t}:n)}))},onDone:()=>{K(`selectLegend`,X.value)}}):(Z.value=Z.value.map(t=>({...t,series:t.series.map(t=>t.id===e.id?{...t,value:n}:t)})),K(`selectLegend`,X.value))):s&&(N.value.serieToggleAnimation.show?In({from:i,to:0,duration:N.value.serieToggleAnimation.durationMs,onUpdate:t=>{Z.value=Z.value.map(n=>({...n,series:n.series.map(n=>n.id===e.id?{...n,value:t}:n)}))},onDone:()=>{q.value.push(e.id),K(`selectLegend`,X.value)}}):(Z.value=Z.value.map(t=>({...t,series:t.series.map(t=>t.id===e.id?{...t,value:0}:t)})),q.value.push(e.id),K(`selectLegend`,X.value)))}function Bn(e){return J.value.length?J.value.flatMap(e=>e.series).filter(t=>t.name===e)||(U.value&&console.warn(`VueUiNestedDonuts - Series name not found "${e}"`),null):(U.value&&console.warn(`VueUiNestedDonuts - There are no series to show.`),null)}function Vn(e){let t=Bn(e);t!==null&&(Array.isArray(t)?t.forEach(e=>{q.value.includes(e.id)&&zn({id:e.id})}):q.value.includes(t.id)&&zn({id:t.id}))}function Hn(e){let t=Bn(e);t!==null&&(Array.isArray(t)?t.forEach(e=>{q.value.includes(e.id)||zn({id:e.id})}):q.value.includes(t.id)||zn({id:t.id}))}let Un=d(()=>Y.value/J.value.length*L.value.donut.spacingRatio),Wn=d(()=>Z.value.map((e,t)=>Y.value-t*Y.value/J.value.length)),Gn=d(()=>Z.value.map((e,t)=>{let n=Math.abs(e.series.map(e=>e.value).reduce((e,t)=>e+t,0))>0,r=Y.value-t*Y.value/Z.value.length,i=k.value?sn.value.find(e=>e.datasetIndex===t):null,a=[...e.series,...i?[i]:[]].map(e=>({...e,value:e.value<1e-11?Number.MIN_VALUE:e.value})),o=ne({series:[{name:`_`,color:L.value.donut.emptyFill,value:1}]},G.value.width/2,G.value.height/2,r,r,1.99999,2,1,360,105.25,Un.value),s=`M ${G.value.width/2},${G.value.height/2+r}
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as ee,Dt as c,Ht as te,It as ne,Jt as re,Kt as l,S as ie,Ut as ae,X as oe,Zt as se,at as ce,b as le,f as ue,i as de,in as fe,it as pe,n as me,nn as he,nt as ge,p as _e,pt as ve,t as ye,w as be,zt as xe}from"./lib-CV_IANZ6.js";import{n as Se,t as Ce}from"./useHints-BH9r_0Vd.js";import{t as we}from"./useConfig-CKdzPrcf.js";import{t as Te}from"./usePrinter-hLW3cv4N.js";import{n as Ee,t as De}from"./BaseScanner-8NdoBs7B.js";import{t as Oe}from"./useNestedProp-CB186vF2.js";import{t as ke}from"./useThemeCheck-BKNRbGeC.js";import{t as Ae}from"./useChartExport-DtPNpc9M.js";import{n as je}from"./Title-BGYFqulv.js";import{t as Me}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as Ne,t as Pe}from"./useResponsive-D2CPcpda.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./BaseLegendToggle-Bq5FjyuI.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"./chartImage-CIvU_04o.js";import{t as Ve}from"./labelUtils-CG3uVXoZ.js";import{t as He}from"./Legend-D8YoT1RJ.js";import{t as Ue}from"./vue_ui_nested_donuts-CRtGsJcz.js";import{Fragment as u,Teleport as We,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Ge,createTextVNode as Ke,createVNode as qe,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as Je,nextTick as Ye,normalizeClass as Xe,normalizeProps as v,normalizeStyle as Ze,onBeforeUnmount as Qe,onMounted as $e,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as et,shallowRef as tt,toDisplayString as C,toRefs as nt,unref as w,vShow as rt,watch as it,withCtx as T,withDirectives as at}from"vue";var ot=/* @__PURE__ */ e({default:()=>Lt}),st=[`id`],ct=[`id`],lt=[`id`],ut={style:{position:`relative`}},dt=[`xmlns`,`aria-describedby`,`viewBox`],ft=[`width`,`height`],pt=[`id`],mt=[`id`],ht=[`id`],gt=[`flood-color`],_t=[`id`,`d`],vt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],yt=[`d`,`fill`,`stroke`,`stroke-width`],bt={key:1},xt=[`d`,`fill`],St={key:2},Ct=[`font-size`,`font-weight`,`fill`,`dy`],wt=[`href`],Tt=[`x`,`y`,`font-size`,`font-weight`,`fill`],Et={key:3},Dt=[`filter`],Ot=[`opacity`,`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],kt=[`opacity`,`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],At=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseleave`],jt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Mt={key:5,class:`vue-data-ui-watermark`},Nt=[`id`],Pt={key:0,class:`vue-ui-nested-donuts-legend-title`},Ft=[`onClick`],It={style:{display:`flex`,"align-items":`center`}},Lt=/*#__PURE__*/ Me({__name:`vue-ui-nested-donuts`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Me,emit:ot}){let Lt=g(()=>import(`./Tooltip-Cus2-XNQ.js`)),Rt=g(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),zt=g(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),Bt=g(()=>import(`./DataTable-WNecJMcY.js`)),Vt=g(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),Ht=g(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),Ut=g(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),Wt=g(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_nested_donuts:Gt}=we(),{isThemeValid:Kt,warnInvalidTheme:qt}=ke(),E=e,Jt=d({get(){return!!E.dataset&&E.dataset.length},set(e){return e}}),D=b(oe()),Yt=b(!1),Xt=b(``),Zt=b(null),Qt=b(0),O=b(null),$t=b(null),en=b(null),tn=b(null),nn=b(null),rn=b(0),an=b(0),on=b(0),k=b(!0),A=b([]),sn=b([]),cn=b(!1),ln=b(null),un=b(null),j=b(null),dn=b({x:0,y:0}),fn=b(`pointer`),pn=b(!1),M=b(!1);function mn(e){M.value=e,Qt.value+=1}let N=b(Sn()),P=d(()=>N.value.style.chart.layout.labels),F=d(()=>N.value.style.chart.tooltip),I=d(()=>N.value.userOptions),L=d(()=>N.value.style.chart.layout),R=d(()=>N.value.style.chart);Se({config:()=>N.value,dataset:()=>E.dataset,component:`VueUiNestedDonuts`,rules:[Ce.emptyArray,{test:e=>e.some(e=>e.series.length>6),message:[`👀 Some series have > 6 data points. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" data point.`,``,`▶️ Using filters to let users choose a maximum number of data points to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]},{test:e=>e.length===1,message:[`👀 There is only one series in your dataset. Consider:`,``,`▶️ Using VueUiDonut instead.`]},{test:e=>e.length>6,message:[`👀 The number of series in your dataset > 6. Consider:`,``,`▶️ 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 z=d(()=>N.value.userOptions.useCursorPointer),hn={name:``,series:[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}]},gn=d(()=>fe({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:_n,FINAL_DATASET:B,manualLoading:vn}=Ee({...nt(E),FINAL_CONFIG:N,prepareConfig:Sn,callback:()=>{Promise.resolve().then(async()=>{await En()})},skeletonDataset:E.config?.skeletonDataset??[hn,hn],skeletonConfig:fe({defaultConfig:N.value,userConfig:gn.value})}),{userOptionsVisible:yn,setUserOptionsVisibility:bn,keepUserOptionState:xn}=Re({config:N.value}),{svgRef:V}=ze({config:R.value.title});function Sn(){let e=Oe({userConfig:E.config,defaultConfig:Gt}),t={},n=e.theme;if(n){if(!Kt.value(e))qt(e),t=e;else{let r=Oe({userConfig:Ue[n]||E.config,defaultConfig:e});t={...Oe({userConfig:E.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:he[n]||te}}}else t=e;return t}let Cn=se(E.config);it(()=>E.config,(e,t)=>{let n=se(e),r=n!==Cn;Cn=n;let i=Sn();if(!r){N.value.style.chart.tooltip=i.style.chart.tooltip,W.value.showTooltip=N.value.style.chart.tooltip.show;return}_n.value||(N.value=i),yn.value=!N.value.userOptions.showOnChartHover,On(),rn.value+=1,an.value+=1,on.value+=1,W.value.dataLabels.show=P.value.dataLabels.show,W.value.showTable=N.value.table.show,W.value.showTooltip=F.value.show,G.value.width=R.value.width,G.value.height=R.value.height},{deep:!0});let wn=d(()=>{let{top:e,right:t,bottom:n,left:r}=R.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}});function Tn(e,t=1e3,n=50){return new Promise(r=>{let i=e.length;A.value=Array(i).fill(0),sn.value=[];let a=0;e.forEach((e,o)=>{setTimeout(()=>{let n=performance.now();function s(ee){let c=Math.min((ee-n)/t,1),te=e*pe(c);A.value[o]=te,A.value=[...A.value];let ne=[],re=0;E.dataset.forEach((e,t)=>{let n=le(e.series.reduce((e,t)=>e+le(l(t.values).reduce((e,t)=>e+t,0)),0))-le(A.value.slice(re,re+e.series.length).reduce((e,t)=>e+t,0));n>Number.MIN_VALUE&&ne.push({name:`__ghost__`,arcOf:e.name,arcOfId:`${D.value}_${t}`,id:`ghost_${D.value}_${t}`,seriesIndex:-1,datasetIndex:t,color:`transparent`,value:n,fullValue:n,absoluteValues:[],ghost:!0}),re+=e.series.length}),sn.value=ne,c<1?requestAnimationFrame(s):(a+=1,a===i&&r())}requestAnimationFrame(s)},o*n)})})}async function En(){if(N.value.startAnimation?.show){let e=B.value.flatMap(e=>e.series).map(e=>l(e.values).reduce((e,t)=>e+t,0));A.value=e.map(()=>0),k.value=!0,sn.value=B.value.map((e,t)=>{let n=e.series.reduce((e,t)=>e+l(t.values).reduce((e,t)=>e+t,0),0);return{name:`__ghost__`,arcOf:e.name,arcOfId:`${D.value}_${t}`,id:`ghost_${D.value}_${t}`,seriesIndex:-1,datasetIndex:t,color:`transparent`,value:n,fullValue:n,absoluteValues:[],ghost:!0}}),await Ye(),Tn(e,N.value.startAnimation.durationMs,N.value.startAnimation.staggerMs).then(()=>{k.value=!1,sn.value=[]})}else k.value=!1}$e(async()=>{cn.value=!0,On(),await En()});let H=tt(null),Dn=tt(null),U=d(()=>N.value.debug);function On(){if(xe(E.dataset)?(ce({componentName:`VueUiNestedDonuts`,type:`dataset`,debug:U.value}),Jt.value=!1,vn.value=!0):vn.value=N.value.loading,N.value.responsive){let e=Ne(()=>{let{width:e,height:t}=Pe({chart:O.value,title:R.value.title.text?$t.value:null,legend:R.value.legend.show?en.value:null,source:tn.value,noTitle:nn.value,padding:wn.value});requestAnimationFrame(()=>{G.value.width=e,G.value.height=t})});H.value&&(Dn.value&&H.value.unobserve(Dn.value),H.value.disconnect()),H.value=new ResizeObserver(e),Dn.value=O.value.parentNode,H.value.observe(Dn.value)}}Qe(()=>{H.value&&(Dn.value&&H.value.unobserve(Dn.value),H.value.disconnect())});let{isPrinting:kn,isImaging:An,generatePdf:jn,generateImage:Mn}=Te({elementId:`nested_donuts_${D.value}`,fileName:R.value.title.text||`vue-ui-nested-donuts`,options:N.value.userOptions.print}),Nn=d(()=>N.value.userOptions.show&&!R.value.title.text),Pn=d(()=>be(N.value.customPalette)),W=b({dataLabels:{show:P.value.dataLabels.show},showTable:N.value.table.show,showTooltip:F.value.show});it(N,()=>{W.value={dataLabels:{show:P.value.dataLabels.show},showTable:N.value.table.show,showTooltip:F.value.show}},{immediate:!0});let G=b({width:R.value.width,height:R.value.height}),K=ot;function Fn({datapoint:e,index:t,seriesIndex:n}){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:n}),K(`selectDatapoint`,{datapoint:e,index:t})}function In({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=pe}){let o=performance.now();function s(ee){let c=Math.min((ee-o)/n,1),te=a(c);r(e+(t-e)*te,c),c<1?requestAnimationFrame(s):(r(t,1),i&&i())}requestAnimationFrame(s)}let q=b([]),J=d(()=>{_n.value,B.value.forEach((e,t)=>{[null,void 0].includes(e.name)&&ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`name`,index:t,debug:U.value}),[null,void 0].includes(e.series)?ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`series`,index:t,debug:U.value}):e.series.length===0?ce({componentName:`VueUiNestedDonuts`,type:`datasetAttributeEmpty`,property:`series at index ${t}`,debug:U.value}):e.series.forEach((e,t)=>{[null,void 0].includes(e.name)&&ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`name`,index:t,key:`serie`,debug:U.value}),[null,void 0].includes(e.values)&&ce({componentName:`VueUiNestedDonuts`,type:`datasetSerieAttribute`,property:`values`,index:t,key:`serie`,debug:U.value})})});let e=0;return B.value.map((t,n)=>({...t,total:t.series.filter(e=>!q.value.includes(e.id)).map(e=>l(e.values).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),datasetIndex:n,id:`${D.value}_${n}`,series:t.series.map((r,i)=>{let a=l(r.values).reduce((e,t)=>e+t,0);return{name:r.name,arcOf:t.name,arcOfId:`${D.value}_${n}`,id:`${D.value}_${n}_${i}`,seriesIndex:i,datasetIndex:n,color:ie(r.color)||Pn.value[i]||te[i%te.length],value:k.value?A.value[e++]??0:a,absoluteValues:r.values||[]}})}))});it(()=>E.dataset,e=>{Array.isArray(e)&&e.length>0&&(vn.value=!1)},{immediate:!0});let Y=d(()=>Math.min(G.value.height,G.value.width)*(L.value.donut.strokeWidth/512)),X=d(()=>[...J.value].map((e,t)=>{let n=e.series.filter(e=>!q.value.includes(e.id)).map(e=>e.value).reduce((e,t)=>e+t,0);return{...e,total:n,series:e.series.filter(e=>!q.value.includes(e.id)).map(e=>({...e,proportion:e.value/n}))}}));function Ln(e,t,n){let r=0;for(let t=0;t<e.length;t+=1)n.includes(e[t])&&(r+=1);return r<t}let Z=b(X.value);it(()=>X.value,e=>Z.value=e);function Rn(e){let t=e.map(e=>e.id);if(e.some(e=>q.value.includes(e.id))){let e=new Set(t);q.value=q.value.filter(t=>!e.has(t))}else q.value.push(...t);K(`selectLegend`,X.value)}function zn(e){let t=E.dataset.flatMap((e,t)=>e.series.map((e,n)=>({value:l(e.values).reduce((e,t)=>e+t,0),id:`${D.value}_${t}_${n}`,arcOfId:`${D.value}_${t}`}))).find(t=>t.id===e.id);if(!t)return;let n=J.value.flatMap(e=>e.series).find(t=>t.id===e.id)?.value??0,r=Z.value.flatMap(e=>e.series).find(t=>t.id===e.id),i=r?r.value:0,a=J.value.find(e=>e.id===t.arcOfId);if(!a)return;let o=a.series.map(e=>e.id),s=Ln(o,o.length-1,q.value);q.value.includes(e.id)?(q.value=q.value.filter(t=>t!==e.id),N.value.serieToggleAnimation.show?In({from:i,to:n,duration:N.value.serieToggleAnimation.durationMs,onUpdate:t=>{Z.value=Z.value.map(n=>({...n,series:n.series.map(n=>n.id===e.id?{...n,value:t}:n)}))},onDone:()=>{K(`selectLegend`,X.value)}}):(Z.value=Z.value.map(t=>({...t,series:t.series.map(t=>t.id===e.id?{...t,value:n}:t)})),K(`selectLegend`,X.value))):s&&(N.value.serieToggleAnimation.show?In({from:i,to:0,duration:N.value.serieToggleAnimation.durationMs,onUpdate:t=>{Z.value=Z.value.map(n=>({...n,series:n.series.map(n=>n.id===e.id?{...n,value:t}:n)}))},onDone:()=>{q.value.push(e.id),K(`selectLegend`,X.value)}}):(Z.value=Z.value.map(t=>({...t,series:t.series.map(t=>t.id===e.id?{...t,value:0}:t)})),q.value.push(e.id),K(`selectLegend`,X.value)))}function Bn(e){return J.value.length?J.value.flatMap(e=>e.series).filter(t=>t.name===e)||(U.value&&console.warn(`VueUiNestedDonuts - Series name not found "${e}"`),null):(U.value&&console.warn(`VueUiNestedDonuts - There are no series to show.`),null)}function Vn(e){let t=Bn(e);t!==null&&(Array.isArray(t)?t.forEach(e=>{q.value.includes(e.id)&&zn({id:e.id})}):q.value.includes(t.id)&&zn({id:t.id}))}function Hn(e){let t=Bn(e);t!==null&&(Array.isArray(t)?t.forEach(e=>{q.value.includes(e.id)||zn({id:e.id})}):q.value.includes(t.id)||zn({id:t.id}))}let Un=d(()=>Y.value/J.value.length*L.value.donut.spacingRatio),Wn=d(()=>Z.value.map((e,t)=>Y.value-t*Y.value/J.value.length)),Gn=d(()=>Z.value.map((e,t)=>{let n=Math.abs(e.series.map(e=>e.value).reduce((e,t)=>e+t,0))>0,r=Y.value-t*Y.value/Z.value.length,i=k.value?sn.value.find(e=>e.datasetIndex===t):null,a=[...e.series,...i?[i]:[]].map(e=>({...e,value:e.value<1e-11?Number.MIN_VALUE:e.value})),o=ne({series:[{name:`_`,color:L.value.donut.emptyFill,value:1}]},G.value.width/2,G.value.height/2,r,r,1.99999,2,1,360,105.25,Un.value),s=`M ${G.value.width/2},${G.value.height/2+r}
|
|
2
2
|
a ${r},${r} 0 1,1 0,${-2*r}
|
|
3
3
|
a ${r},${r} 0 1,1 0,${2*r}`;return{...e,hasData:n,radius:r,skeleton:o,fullCirclePath:s,donut:ne({series:a},G.value.width/2,G.value.height/2,r,r,1.99999,2,1,360,105.25,Un.value)}})),Kn=d(()=>[...J.value].map((e,t)=>{let n=t*Y.value/J.value.length;return{sizeRatio:n,donut:ne({series:[{value:1}]},G.value.width/2,G.value.height/2,Y.value-n,Y.value-n,1.99999,2,1,360,105.25,Y.value/J.value.length*L.value.donut.spacingRatio)[0]}})),qn=b(null),Jn=b(null),Yn=b(null),Xn=b(null);function Zn({datapoint:e,seriesIndex:t}){N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t}),Yt.value=!1,qn.value=null,Zt.value=null,Jn.value=null,Yn.value=null,j.value=null,fn.value=`pointer`}function Qn({val:e,percentage:t,showVal:n,showPercentage:r,config:i}){return Ve({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function $n({datapoint:e,_relativeIndex:t,seriesIndex:n,triggerMode:r=`pointer`}){N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:n}),fn.value=r,j.value=n,qn.value=e.arcOfId,Jn.value=e.id,Yn.value=n,Zt.value=e.id,Xn.value={datapoint:e,seriesIndex:n,series:Z.value,config:N.value};let i=F.value.customFormat;if(c(i)&&ve(()=>i({seriesIndex:n,datapoint:e,series:Z.value,config:N.value})))Xt.value=i({seriesIndex:n,datapoint:e,series:Z.value,config:N.value});else{let t=``;if(F.value.showAllItemsAtIndex&&q.value.length===0){let r=Z.value.map(e=>e.series.find(e=>e.seriesIndex===n));r.forEach((i,a)=>{if(!i)return``;t+=`
|
|
4
4
|
<div style="display:flex; flex-direction: column; justify-content:flex-start; align-items:flex-start;padding:6px 0; ${a<r.length-1?`border-bottom:1px solid ${F.value.borderColor}`:``}">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as ee,Dt as te,Ht as ne,S as re,X as ie,Zt as ae,at as oe,i as se,in as ce,nt as le,pt as ue,t as de,w as fe,zt as pe}from"./lib-zDxoqrgo.js";import{n as me,t as he}from"./useHints-BH9r_0Vd.js";import{t as ge}from"./useConfig-CKdzPrcf.js";import{t as _e}from"./usePrinter-CnyKPIFM.js";import{n as ve,t as ye}from"./BaseScanner-8NdoBs7B.js";import{t as be}from"./useChartExport-DtPNpc9M.js";import{t as xe}from"./useTransitions-DfSHzsdz.js";import{n as Se}from"./Title-BRAjxtjG.js";import{t as Ce}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as we,t as Te}from"./useResponsive-D2CPcpda.js";import{t as Ee}from"./BaseLegendToggle-Dn_tNvn4.js";import{t as De}from"./A11yDataTable-DWNlWXzs.js";import{n as Oe}from"./resolveChartConfig-BSo1Oe9n.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./chartImage-NwZO-elv.js";import{t as Me}from"./labelUtils-Djp5nJtN.js";import{t as Ne}from"./Legend-DokTll4u.js";import{t as Pe}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Fe}from"./vue_ui_onion-C9BedU_-.js";import{Fragment as c,Teleport as Ie,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as Le,createTextVNode as Re,createVNode as ze,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as Be,nextTick as Ve,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onBeforeUnmount as He,onMounted as Ue,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as We,shallowRef as Ge,toDisplayString as Ke,toRefs as qe,unref as C,watch as Je,withCtx as w}from"vue";var Ye=/* @__PURE__ */ e({default:()=>_t}),Xe=[`id`],Ze=[`id`],Qe=[`id`],$e={style:{position:`relative`}},et=[`xmlns`,`aria-describedby`,`viewBox`],tt=[`width`,`height`],nt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`],rt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`],it=[`id`],at=[`stdDeviation`],ot=[`filter`],st=[`cx`,`cy`,`r`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`],ct=[`cx`,`cy`,`r`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`onMouseenter`,`onMouseleave`,`onClick`],lt={key:2},ut=[`onMouseenter`,`onMouseleave`,`onClick`],dt=[`transform`,`font-size`,`fill`,`font-weight`],ft={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},pt={key:5,class:`vue-data-ui-watermark`},mt=[`id`],ht=[`onClick`],gt=[`innerHTML`],_t=/*#__PURE__*/ Ce({__name:`vue-ui-onion`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:Ce,emit:Ye}){let _t=m(()=>import(`./Tooltip-BUXB0i6z.js`)),vt=m(()=>import(`./BaseIcon-Cz30ODFA.js`).then(e=>e.n)),yt=m(()=>import(`./vue-ui-accordion-Dy5OVFKr.js`).then(e=>e.n)),bt=m(()=>import(`./DataTable-DSUA5M9p.js`)),xt=m(()=>import(`./UserOptions-D65t74CM.js`).then(e=>e.n)),St=m(()=>import(`./PenAndPaper-DvJJaeU2.js`).then(e=>e.t)),Ct=m(()=>import(`./PackageVersion-D6pKL176.js`).then(e=>e.t)),wt=m(()=>import(`./BaseDraggableDialog-T1gEsQid.js`).then(e=>e.n)),{vue_ui_onion:Tt}=ge(),T=e,Et=l(()=>!!T.dataset&&T.dataset.length),E=b(ie()),Dt=b(null),Ot=b(0),D=b(!1),kt=b(``),O=b([]),k=b(null),At=b(null),jt=b(null),Mt=b(null),Nt=b(null),Pt=b(0),Ft=b(0),It=b(0),A=b(!1),Lt=b(!1),Rt=b(null),j=b(null),zt=b({x:0,y:0}),Bt=b(`pointer`),Vt=b(!1),M=b(Jt()),N=l(()=>M.value.userOptions),P=l(()=>M.value.style.chart.layout.labels),F=l(()=>M.value.style.chart.layout),I=l(()=>M.value.style.chart.tooltip),L=l(()=>M.value.style.chart);me({config:()=>M.value,dataset:()=>T.dataset,component:`VueUiOnion`,rules:[he.emptyArray,{test:e=>e.length>8,message:[`👀 The number of series is > 8. 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:R}=xe({config:()=>M.value.transitions,dataset:()=>T.dataset}),z=l(()=>M.value.userOptions.useCursorPointer),Ht=l(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{gutter:{color:`#99999950`},labels:{show:!1}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:B,FINAL_DATASET:Ut,manualLoading:Wt}=ve({...qe(T),FINAL_CONFIG:M,prepareConfig:Jt,callback:()=>{Promise.resolve().then(async()=>{await Ve(),bn()})},skeletonDataset:T.config?.skeletonDataset??[{name:`_`,percentage:50,value:1,color:`#DBDBDB`},{name:`_`,percentage:50,value:1,color:`#C4C4C4`},{name:`_`,percentage:50,value:1,color:`#ADADAD`},{name:`_`,percentage:50,value:1,color:`#969696`}],skeletonConfig:ce({defaultConfig:M.value,userConfig:Ht.value})}),{userOptionsVisible:Gt,setUserOptionsVisibility:Kt,keepUserOptionState:qt}=ke({config:M.value}),{svgRef:V}=Ae({config:L.value.title});function Jt(){return Oe(T.config,Tt,Fe)}let Yt=ae(T.config);Je(()=>T.config,(e,t)=>{let n=ae(e),r=n!==Yt;Yt=n;let i=Jt();if(!r){M.value.style.chart.tooltip=i.style.chart.tooltip,H.value.showTooltip=M.value.style.chart.tooltip.show;return}B.value||(M.value=i),Gt.value=!M.value.userOptions.showOnChartHover,pn(),Pt.value+=1,Ft.value+=1,It.value+=1,H.value.showTable=M.value.table.show,H.value.showTooltip=I.value.show},{deep:!0});let{isPrinting:Xt,isImaging:Zt,generatePdf:Qt,generateImage:$t}=_e({elementId:`vue-ui-onion_${E.value}`,fileName:L.value.title.text||`vue-ui-onion`,options:M.value.userOptions.print}),en=l(()=>M.value.userOptions.show&&!L.value.title.text),tn=l(()=>fe(M.value.customPalette)),H=b({showTable:M.value.table.show,showTooltip:I.value.show});Je(M,()=>{H.value={showTable:M.value.table.show,showTooltip:I.value.show}},{immediate:!0});let U=b({height:512,width:512,padding:{top:64,left:64,right:64,bottom:64},minRadius:64}),W=Ge(null),G=Ge(null);Ue(()=>{Lt.value=!0,pn()});let{autoSizeLabels:nn}=Pe({svgRef:V,fontSize:()=>P.value.fontSize,minFontSize:()=>P.value.minFontSize,labelClass:`.vue-ui-onion-label`}),K=null,rn=null,an=0;function on(){K!==null&&(cancelAnimationFrame(K),K=null),rn!==null&&(clearTimeout(rn),rn=null)}function sn(e){return String(e).split(`,`).map(e=>{let t=e.trim(),n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`ms`)?n:n*1e3:0})}function cn(){return typeof window>`u`||!R.value||A.value||B.value||!V.value?0:Array.from(V.value.querySelectorAll(`.vue-ui-onion-label.vue-data-ui-transition`)).reduce((e,t)=>{let n=window.getComputedStyle(t);if(n.transitionProperty===`none`)return e;let r=sn(n.transitionDuration),i=sn(n.transitionDelay),a=Math.max(r.length,i.length),o=Array.from({length:a},(e,t)=>(r[t%r.length]??0)+(i[t%i.length]??0)).reduce((e,t)=>Math.max(e,t),0);return Math.max(e,o)},0)}function ln(){typeof window<`u`&&(K=requestAnimationFrame(()=>{K=null,nn()}))}function un(){if(typeof window>`u`)return;let e=++an;on(),Ve(()=>{e===an&&(K=requestAnimationFrame(()=>{if(K=null,e!==an)return;let t=cn();if(t<=0){ln();return}rn=setTimeout(()=>{rn=null,e===an&&ln()},t+34)}))})}let dn=l(()=>M.value.debug),fn=null;function pn(){if(pe(T.dataset)&&(oe({componentName:`VueUiOnion`,type:`dataset`,debug:dn.value}),Wt.value=!0),pe(T.dataset)||(Wt.value=M.value.loading),M.value.responsive){let e=64/512,t=we(()=>{fn&&clearTimeout(fn),A.value=!0;let{width:t,height:n}=Te({chart:k.value,title:L.value.title.text?At.value:null,legend:L.value.legend.show?jt.value:null,source:Mt.value,noTitle:Nt.value});n-=12,requestAnimationFrame(async()=>{U.value.width=t,U.value.height=n,U.value.padding.top=Math.max(t,n)*e,U.value.padding.right=Math.max(t,n)*e,U.value.padding.bottom=Math.max(t,n)*e,U.value.padding.left=Math.max(t,n)*e,U.value.minRadius=Math.min(t,n)*e,fn=setTimeout(()=>{A.value=!1,un()},0)})});W.value&&(G.value&&W.value.unobserve(G.value),W.value.disconnect()),W.value=new ResizeObserver(t),G.value=k.value.parentNode,W.value.observe(G.value)}un()}He(()=>{an+=1,on(),W.value&&(G.value&&W.value.unobserve(G.value),W.value.disconnect())});let q=l(()=>({top:U.value.padding.top,left:U.value.padding.left,right:U.value.width-U.value.padding.right,bottom:U.value.height-U.value.padding.bottom,centerX:U.value.width/2,centerY:U.value.height/2,width:U.value.width-U.value.padding.right-U.value.padding.left,height:U.value.height-U.value.padding.bottom-U.value.padding.top,minRadius:U.value.minRadius,maxRadius:Math.min(U.value.width,U.value.height)-U.value.padding.top*2})),J=l(()=>(dn.value&&Ut.value.forEach((e,t)=>{[null,void 0].includes(e.name)&&oe({componentName:`VueUiOnion`,type:`datasetSerieAttribute`,property:`name`,index:t}),[void 0].includes(e.percentage)&&oe({componentName:`VueUiOnion`,type:`datasetSerieAttribute`,property:`percentage`,index:t})}),Ut.value.map((e,t)=>{let n=`onion_serie_${t}_${E.value}`;return{...e,percentage:e.percentage||0,targetPercentage:e.percentage||0,color:re(e.color)||tn.value[t]||ne[t],id:n,shape:`circle`,opacity:O.value.includes(n)?.5:1,absoluteIndex:t,segregate:()=>En(n),isSegregated:O.value.includes(n)}}))),mn=l(()=>J.value.map((e,t)=>{let n=L.value.legend.showValue,r=L.value.legend.showPercentage,i=In({showVal:n,showPercentage:r,val:se(P.value.value.formatter,e.value,s({p:e.prefix||``,v:e.value,s:e.suffix||``,r:L.value.legend.roundingValue})),percentage:s({v:e.percentage??0,s:`%`,r:L.value.legend.roundingPercentage}),config:L.value.legend});return{...e,display:`${e.name}${n||r?`: `:``}${i}`}})),hn=b(J.value),gn=l(()=>M.value.useStartAnimation),_n=b(null),vn=l(()=>Math.max(...J.value.map(e=>e.percentage))),yn=b(!1);Je(()=>J.value,bn,{immediate:!0,deep:!0}),Je(()=>T.dataset,e=>{Array.isArray(e)&&e.length>0&&(Wt.value=!1),un()},{deep:!0,flush:`post`});function bn(){if(gn.value&&!yn.value&&!B.value){hn.value=J.value.map(e=>({...e,percentage:0}));let e=0;function t(){e>=vn.value?(cancelAnimationFrame(_n.value),hn.value=J.value,yn.value=!0):(hn.value=J.value.map(t=>({...t,percentage:e<t.targetPercentage?e:t.targetPercentage})),e+=1,requestAnimationFrame(t),yn.value=!0)}t()}else hn.value=J.value}let xn=l(()=>({cy:`onion-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),Sn=l(()=>J.value.filter(e=>!O.value.includes(e.id)).length),Y=l(()=>{let e=Math.min(q.value.width,q.value.height)/2/J.value.length;return{gutter:(e>F.value.maxThickness?F.value.maxThickness:e)*F.value.gutter.width,track:(e>F.value.maxThickness?F.value.maxThickness:e)*F.value.track.width}}),X=l(()=>hn.value.filter(e=>!O.value.includes(e.id)).map((e,t)=>{let n=(q.value.maxRadius-Y.value.track)/Sn.value/2*(1+t),r=q.value.centerY-n;return{percentage:e.percentage||0,...e,labelY:r,radius:n,path:Cn(n,e.percentage||0)}}));function Cn(e,t){let n=2*Math.PI*e,r=n*.75,i=`${r} ${n}`,a=r*(1-t/100);return{bgDashArray:`${r} ${n}`,bgDashOffset:0,dashArray:i,dashOffset:a,fullOffset:0,active:`
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as s,D as ee,Dt as te,Ht as ne,S as re,X as ie,Zt as ae,at as oe,i as se,in as ce,nt as le,pt as ue,t as de,w as fe,zt as pe}from"./lib-CV_IANZ6.js";import{n as me,t as he}from"./useHints-BH9r_0Vd.js";import{t as ge}from"./useConfig-CKdzPrcf.js";import{t as _e}from"./usePrinter-hLW3cv4N.js";import{n as ve,t as ye}from"./BaseScanner-8NdoBs7B.js";import{t as be}from"./useChartExport-DtPNpc9M.js";import{t as xe}from"./useTransitions-DfSHzsdz.js";import{n as Se}from"./Title-BGYFqulv.js";import{t as Ce}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as we,t as Te}from"./useResponsive-D2CPcpda.js";import{t as Ee}from"./BaseLegendToggle-Bq5FjyuI.js";import{t as De}from"./A11yDataTable-DWNlWXzs.js";import{n as Oe}from"./resolveChartConfig-DZg-korK.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./chartImage-CIvU_04o.js";import{t as Me}from"./labelUtils-CG3uVXoZ.js";import{t as Ne}from"./Legend-D8YoT1RJ.js";import{t as Pe}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Fe}from"./vue_ui_onion-C9BedU_-.js";import{Fragment as c,Teleport as Ie,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as Le,createTextVNode as Re,createVNode as ze,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as Be,nextTick as Ve,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onBeforeUnmount as He,onMounted as Ue,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as We,shallowRef as Ge,toDisplayString as Ke,toRefs as qe,unref as C,watch as Je,withCtx as w}from"vue";var Ye=/* @__PURE__ */ e({default:()=>_t}),Xe=[`id`],Ze=[`id`],Qe=[`id`],$e={style:{position:`relative`}},et=[`xmlns`,`aria-describedby`,`viewBox`],tt=[`width`,`height`],nt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`],rt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`],it=[`id`],at=[`stdDeviation`],ot=[`filter`],st=[`cx`,`cy`,`r`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`],ct=[`cx`,`cy`,`r`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`onMouseenter`,`onMouseleave`,`onClick`],lt={key:2},ut=[`onMouseenter`,`onMouseleave`,`onClick`],dt=[`transform`,`font-size`,`fill`,`font-weight`],ft={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},pt={key:5,class:`vue-data-ui-watermark`},mt=[`id`],ht=[`onClick`],gt=[`innerHTML`],_t=/*#__PURE__*/ Ce({__name:`vue-ui-onion`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:Ce,emit:Ye}){let _t=m(()=>import(`./Tooltip-Cus2-XNQ.js`)),vt=m(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),yt=m(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),bt=m(()=>import(`./DataTable-WNecJMcY.js`)),xt=m(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),St=m(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),Ct=m(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),wt=m(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_onion:Tt}=ge(),T=e,Et=l(()=>!!T.dataset&&T.dataset.length),E=b(ie()),Dt=b(null),Ot=b(0),D=b(!1),kt=b(``),O=b([]),k=b(null),At=b(null),jt=b(null),Mt=b(null),Nt=b(null),Pt=b(0),Ft=b(0),It=b(0),A=b(!1),Lt=b(!1),Rt=b(null),j=b(null),zt=b({x:0,y:0}),Bt=b(`pointer`),Vt=b(!1),M=b(Jt()),N=l(()=>M.value.userOptions),P=l(()=>M.value.style.chart.layout.labels),F=l(()=>M.value.style.chart.layout),I=l(()=>M.value.style.chart.tooltip),L=l(()=>M.value.style.chart);me({config:()=>M.value,dataset:()=>T.dataset,component:`VueUiOnion`,rules:[he.emptyArray,{test:e=>e.length>8,message:[`👀 The number of series is > 8. 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:R}=xe({config:()=>M.value.transitions,dataset:()=>T.dataset}),z=l(()=>M.value.userOptions.useCursorPointer),Ht=l(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{gutter:{color:`#99999950`},labels:{show:!1}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:B,FINAL_DATASET:Ut,manualLoading:Wt}=ve({...qe(T),FINAL_CONFIG:M,prepareConfig:Jt,callback:()=>{Promise.resolve().then(async()=>{await Ve(),bn()})},skeletonDataset:T.config?.skeletonDataset??[{name:`_`,percentage:50,value:1,color:`#DBDBDB`},{name:`_`,percentage:50,value:1,color:`#C4C4C4`},{name:`_`,percentage:50,value:1,color:`#ADADAD`},{name:`_`,percentage:50,value:1,color:`#969696`}],skeletonConfig:ce({defaultConfig:M.value,userConfig:Ht.value})}),{userOptionsVisible:Gt,setUserOptionsVisibility:Kt,keepUserOptionState:qt}=ke({config:M.value}),{svgRef:V}=Ae({config:L.value.title});function Jt(){return Oe(T.config,Tt,Fe)}let Yt=ae(T.config);Je(()=>T.config,(e,t)=>{let n=ae(e),r=n!==Yt;Yt=n;let i=Jt();if(!r){M.value.style.chart.tooltip=i.style.chart.tooltip,H.value.showTooltip=M.value.style.chart.tooltip.show;return}B.value||(M.value=i),Gt.value=!M.value.userOptions.showOnChartHover,pn(),Pt.value+=1,Ft.value+=1,It.value+=1,H.value.showTable=M.value.table.show,H.value.showTooltip=I.value.show},{deep:!0});let{isPrinting:Xt,isImaging:Zt,generatePdf:Qt,generateImage:$t}=_e({elementId:`vue-ui-onion_${E.value}`,fileName:L.value.title.text||`vue-ui-onion`,options:M.value.userOptions.print}),en=l(()=>M.value.userOptions.show&&!L.value.title.text),tn=l(()=>fe(M.value.customPalette)),H=b({showTable:M.value.table.show,showTooltip:I.value.show});Je(M,()=>{H.value={showTable:M.value.table.show,showTooltip:I.value.show}},{immediate:!0});let U=b({height:512,width:512,padding:{top:64,left:64,right:64,bottom:64},minRadius:64}),W=Ge(null),G=Ge(null);Ue(()=>{Lt.value=!0,pn()});let{autoSizeLabels:nn}=Pe({svgRef:V,fontSize:()=>P.value.fontSize,minFontSize:()=>P.value.minFontSize,labelClass:`.vue-ui-onion-label`}),K=null,rn=null,an=0;function on(){K!==null&&(cancelAnimationFrame(K),K=null),rn!==null&&(clearTimeout(rn),rn=null)}function sn(e){return String(e).split(`,`).map(e=>{let t=e.trim(),n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`ms`)?n:n*1e3:0})}function cn(){return typeof window>`u`||!R.value||A.value||B.value||!V.value?0:Array.from(V.value.querySelectorAll(`.vue-ui-onion-label.vue-data-ui-transition`)).reduce((e,t)=>{let n=window.getComputedStyle(t);if(n.transitionProperty===`none`)return e;let r=sn(n.transitionDuration),i=sn(n.transitionDelay),a=Math.max(r.length,i.length),o=Array.from({length:a},(e,t)=>(r[t%r.length]??0)+(i[t%i.length]??0)).reduce((e,t)=>Math.max(e,t),0);return Math.max(e,o)},0)}function ln(){typeof window<`u`&&(K=requestAnimationFrame(()=>{K=null,nn()}))}function un(){if(typeof window>`u`)return;let e=++an;on(),Ve(()=>{e===an&&(K=requestAnimationFrame(()=>{if(K=null,e!==an)return;let t=cn();if(t<=0){ln();return}rn=setTimeout(()=>{rn=null,e===an&&ln()},t+34)}))})}let dn=l(()=>M.value.debug),fn=null;function pn(){if(pe(T.dataset)&&(oe({componentName:`VueUiOnion`,type:`dataset`,debug:dn.value}),Wt.value=!0),pe(T.dataset)||(Wt.value=M.value.loading),M.value.responsive){let e=64/512,t=we(()=>{fn&&clearTimeout(fn),A.value=!0;let{width:t,height:n}=Te({chart:k.value,title:L.value.title.text?At.value:null,legend:L.value.legend.show?jt.value:null,source:Mt.value,noTitle:Nt.value});n-=12,requestAnimationFrame(async()=>{U.value.width=t,U.value.height=n,U.value.padding.top=Math.max(t,n)*e,U.value.padding.right=Math.max(t,n)*e,U.value.padding.bottom=Math.max(t,n)*e,U.value.padding.left=Math.max(t,n)*e,U.value.minRadius=Math.min(t,n)*e,fn=setTimeout(()=>{A.value=!1,un()},0)})});W.value&&(G.value&&W.value.unobserve(G.value),W.value.disconnect()),W.value=new ResizeObserver(t),G.value=k.value.parentNode,W.value.observe(G.value)}un()}He(()=>{an+=1,on(),W.value&&(G.value&&W.value.unobserve(G.value),W.value.disconnect())});let q=l(()=>({top:U.value.padding.top,left:U.value.padding.left,right:U.value.width-U.value.padding.right,bottom:U.value.height-U.value.padding.bottom,centerX:U.value.width/2,centerY:U.value.height/2,width:U.value.width-U.value.padding.right-U.value.padding.left,height:U.value.height-U.value.padding.bottom-U.value.padding.top,minRadius:U.value.minRadius,maxRadius:Math.min(U.value.width,U.value.height)-U.value.padding.top*2})),J=l(()=>(dn.value&&Ut.value.forEach((e,t)=>{[null,void 0].includes(e.name)&&oe({componentName:`VueUiOnion`,type:`datasetSerieAttribute`,property:`name`,index:t}),[void 0].includes(e.percentage)&&oe({componentName:`VueUiOnion`,type:`datasetSerieAttribute`,property:`percentage`,index:t})}),Ut.value.map((e,t)=>{let n=`onion_serie_${t}_${E.value}`;return{...e,percentage:e.percentage||0,targetPercentage:e.percentage||0,color:re(e.color)||tn.value[t]||ne[t],id:n,shape:`circle`,opacity:O.value.includes(n)?.5:1,absoluteIndex:t,segregate:()=>En(n),isSegregated:O.value.includes(n)}}))),mn=l(()=>J.value.map((e,t)=>{let n=L.value.legend.showValue,r=L.value.legend.showPercentage,i=In({showVal:n,showPercentage:r,val:se(P.value.value.formatter,e.value,s({p:e.prefix||``,v:e.value,s:e.suffix||``,r:L.value.legend.roundingValue})),percentage:s({v:e.percentage??0,s:`%`,r:L.value.legend.roundingPercentage}),config:L.value.legend});return{...e,display:`${e.name}${n||r?`: `:``}${i}`}})),hn=b(J.value),gn=l(()=>M.value.useStartAnimation),_n=b(null),vn=l(()=>Math.max(...J.value.map(e=>e.percentage))),yn=b(!1);Je(()=>J.value,bn,{immediate:!0,deep:!0}),Je(()=>T.dataset,e=>{Array.isArray(e)&&e.length>0&&(Wt.value=!1),un()},{deep:!0,flush:`post`});function bn(){if(gn.value&&!yn.value&&!B.value){hn.value=J.value.map(e=>({...e,percentage:0}));let e=0;function t(){e>=vn.value?(cancelAnimationFrame(_n.value),hn.value=J.value,yn.value=!0):(hn.value=J.value.map(t=>({...t,percentage:e<t.targetPercentage?e:t.targetPercentage})),e+=1,requestAnimationFrame(t),yn.value=!0)}t()}else hn.value=J.value}let xn=l(()=>({cy:`onion-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),Sn=l(()=>J.value.filter(e=>!O.value.includes(e.id)).length),Y=l(()=>{let e=Math.min(q.value.width,q.value.height)/2/J.value.length;return{gutter:(e>F.value.maxThickness?F.value.maxThickness:e)*F.value.gutter.width,track:(e>F.value.maxThickness?F.value.maxThickness:e)*F.value.track.width}}),X=l(()=>hn.value.filter(e=>!O.value.includes(e.id)).map((e,t)=>{let n=(q.value.maxRadius-Y.value.track)/Sn.value/2*(1+t),r=q.value.centerY-n;return{percentage:e.percentage||0,...e,labelY:r,radius:n,path:Cn(n,e.percentage||0)}}));function Cn(e,t){let n=2*Math.PI*e,r=n*.75,i=`${r} ${n}`,a=r*(1-t/100);return{bgDashArray:`${r} ${n}`,bgDashOffset:0,dashArray:i,dashOffset:a,fullOffset:0,active:`
|
|
2
2
|
M ${q.value.centerX},${q.value.centerY-e}
|
|
3
3
|
A ${e},${e} 0 1 1
|
|
4
4
|
${q.value.centerX+e*Math.cos(Math.PI*3/4)},${q.value.centerY+e*Math.sin(Math.PI*3/4)}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,t as n}from"./tableIntegration-CNoJ1CIY.js";import{n as r,t as i}from"./annotationSlots-BRR85CqJ.js";import{n as a,t as o}from"./userOptionsSlots-DYuo-E5m.js";import{$ as ee,D as te,Dt as ne,Ht as s,J as re,Jt as ie,P as ae,S as oe,U as se,X as ce,Zt as le,_ as ue,at as de,i as fe,in as pe,nt as me,pt as he,rn as ge,t as _e,tn as ve,w as ye,xt as be,yt as xe,zt as Se}from"./lib-CV_IANZ6.js";import{n as Ce,t as we}from"./useHints-BH9r_0Vd.js";import{t as Te}from"./useConfig-CKdzPrcf.js";import{t as Ee}from"./usePrinter-hLW3cv4N.js";import{n as De,t as Oe}from"./BaseScanner-8NdoBs7B.js";import{t as ke}from"./useChartExport-DtPNpc9M.js";import{t as Ae}from"./useTransitions-DfSHzsdz.js";import{t as je}from"./useTimeLabelCollider-XQf_S7-z.js";import{n as Me}from"./Title-BGYFqulv.js";import{t as Ne}from"./Shape-Bp9YNtPc.js";import{t as Pe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{l as Fe,t as Ie}from"./useResponsive-D2CPcpda.js";import{t as Le}from"./BaseLegendToggle-Bq5FjyuI.js";import{t as Re}from"./A11yDataTable-DWNlWXzs.js";import{n as ze}from"./resolveChartConfig-DZg-korK.js";import{t as Be}from"./useUserOptionState-CXlFnwPv.js";import{t as Ve}from"./useChartAccessibility-DOMuYJfm.js";import{t as He}from"./chartImage-CIvU_04o.js";import{t as Ue}from"./Legend-D8YoT1RJ.js";import{t as We}from"./vue_ui_parallel_coordinate_plot-Cs_xXAG5.js";import{Fragment as c,Teleport as Ge,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as Ke,createTextVNode as qe,createVNode as Je,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as Ye,nextTick as Xe,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onBeforeUnmount as Ze,onMounted as Qe,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as $e,shallowRef as et,toDisplayString as C,toRefs as tt,unref as w,watch as nt,watchEffect as rt,withCtx as T}from"vue";var it=/* @__PURE__ */ e({default:()=>kt}),at=[`id`],ot=[`id`],st=[`id`],ct={style:{position:`relative`}},lt=[`xmlns`,`aria-describedby`,`viewBox`],ut=[`x`,`y`,`width`,`height`],dt={style:{"pointer-events":`none`}},ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],pt=[`d`,`stroke`,`stroke-width`],mt={key:0},ht=[`transform`,`fill`,`font-size`,`font-weight`],gt=[`fill`,`font-size`,`font-weight`,`text-anchor`,`transform`],_t=[`fill`,`font-size`,`font-weight`,`text-anchor`,`transform`,`innerHTML`],vt={key:0},yt=[`x`,`y`,`font-size`,`fill`],bt=[`width`,`x`,`y`],xt={style:{width:`100%`}},St=[`d`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],Ct=[`d`,`onMouseenter`,`onMouseleave`,`onClick`],wt=[`transform`,`fill`,`font-weight`,`font-size`,`stroke`,`onMouseenter`,`onMouseleave`,`onClick`],Tt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Et={key:5,class:`vue-data-ui-watermark`},Dt=[`id`],Ot=[`onClick`],kt=/*#__PURE__*/ Pe({__name:`vue-ui-parallel-coordinate-plot`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Pe,emit:it}){let kt=m(()=>import(`./Tooltip-Cus2-XNQ.js`)),At=m(()=>import(`./BaseIcon-DdIyewwY.js`).then(e=>e.n)),jt=m(()=>import(`./vue-ui-accordion-BNvevckx.js`).then(e=>e.n)),Mt=m(()=>import(`./DataTable-WNecJMcY.js`)),Nt=m(()=>import(`./PenAndPaper-IMw576MC.js`).then(e=>e.t)),Pt=m(()=>import(`./UserOptions-DTxMeZv3.js`).then(e=>e.n)),Ft=m(()=>import(`./PackageVersion-CdkxOy58.js`).then(e=>e.t)),It=m(()=>import(`./BaseDraggableDialog-D_tuHEjO.js`).then(e=>e.n)),{vue_ui_parallel_coordinate_plot:Lt}=Te(),E=e,Rt=l({get(){return!!E.dataset&&E.dataset.length},set(e){return e}}),zt=b(0),D=b(null),Bt=b(null),Vt=b(null),Ht=b(null),Ut=b(null),Wt=b(0),Gt=b(0),Kt=b(0),qt=b(!1),Jt=b(null),Yt=b(null),Xt=b(null),O=b(null),Zt=b({x:0,y:0}),Qt=b(`pointer`),$t=b(!1),k=b(ce()),A=b(!1);function en(e){A.value=e,zt.value+=1}let j=b(cn()),M=l(()=>j.value.userOptions),N=l(()=>j.value.style.chart.yAxis.labels),P=l(()=>j.value.style.chart.tooltip),F=l(()=>j.value.style.chart),{transitionEnabled:I}=Ae({config:()=>j.value.transitions,dataset:()=>E.dataset});Ce({config:()=>j.value,dataset:()=>E.dataset,component:`VueUiParallelCoordinatePlot`,rules:[we.emptyArray,{test:e=>e.length>10,message:[`👀 There are > 10 series. Consider:`,``,`▶️ Using filters, to show less series at the same time and make the chart more readable.`]},{test:e=>e.some(e=>(e?.series??[]).some(e=>(e?.values??[]).length>15)),message:[`👀 There are > 15 axes, which can make the chart hard to read. Consider:`,``,`▶️ Using filters, to allow users to select a maximum set of metrics.`]},{test:e=>e.some(e=>e?.series?.length>5),message:[`👀 Some series have > 5 datapoints. Consider:`,``,`▶️ Using filters, to allow users to select a maximum set of metrics.`]}]});let L=l(()=>j.value.userOptions.useCursorPointer),tn=l(()=>pe({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{show:!0,backgroundColor:`transparent`},yAxis:{stroke:`#6A6A6A`,labels:{showAxisNames:!1,axisNames:[],ticks:{color:`#6A6A6A`}}}}}},userConfig:j.value.skeletonConfig??{}})),{loading:R,FINAL_DATASET:nn,manualLoading:rn}=De({...tt(E),FINAL_CONFIG:j,prepareConfig:cn,callback:()=>{Promise.resolve().then(async()=>{await Xe(),G.value.showTable=j.value.table.show})},skeletonDataset:E.config?.skeletonDataset??[{name:``,shape:`circle`,color:`transparent`,series:[{name:``,values:[1,10,100,1e3]}]},{name:``,shape:`circle`,color:`#CACACA`,series:[{name:``,values:[.2,3,50,800]}]},{name:``,shape:`circle`,color:`transparent`,series:[{name:``,values:[0,0,0,0]}]}],skeletonConfig:pe({defaultConfig:j.value,userConfig:tn.value})}),{userOptionsVisible:an,setUserOptionsVisibility:on,keepUserOptionState:sn}=Be({config:j.value}),{svgRef:z}=Ve({config:F.value.title});function cn(){return ze(E.config,Lt,We)}let ln=le(E.config);nt(()=>E.config,(e,t)=>{let n=le(e),r=n!==ln;ln=n;let i=cn();if(!r){j.value.style.chart.tooltip=i.style.chart.tooltip,G.value.showTooltip=j.value.style.chart.tooltip.show;return}R.value||(j.value=i),an.value=!j.value.userOptions.showOnChartHover,dn(),Wt.value+=1,Kt.value+=1,Gt.value+=1,G.value.dataLabels.show=N.value.datapoints.show,G.value.showTable=j.value.table.show,G.value.showTooltip=P.value.show},{deep:!0}),nt(()=>E.dataset,e=>{Array.isArray(e)&&e.length>0&&(rn.value=!1)},{deep:!0});let B=et(null),V=et(null);Qe(()=>{qt.value=!0,dn()});let un=l(()=>j.value.debug);function dn(){if(Se(E.dataset)?(de({componentName:`VueUiParallelCoordinatePlot`,type:`dataset`,debug:un.value}),rn.value=!0):E.dataset.forEach((e,t)=>{xe({datasetObject:e,requiredAttributes:[`name`,`series`]}).forEach(e=>{Rt.value=!1,de({componentName:`VueUiParallelCoordinatePlot`,type:`datasetSerieAttribute`,property:e,index:t,debug:un.value})})}),Se(E.dataset)||(rn.value=j.value.loading),j.value.responsive){let e=Fe(()=>{let{width:e,height:t}=Ie({chart:D.value,title:F.value.title.text?Bt.value:null,legend:F.value.legend.show?Vt.value:null,source:Ht.value,noTitle:Ut.value});requestAnimationFrame(()=>{H.value.width=e,H.value.height=t-12,j.value.responsiveProportionalSizing?(H.value.plotSize=ge({relator:Math.min(e,t),adjuster:600,source:F.value.plots.radius,threshold:2,fallback:2}),H.value.ticksFontSize=ge({relator:Math.min(e,t),adjuster:600,source:N.value.ticks.fontSize,threshold:10,fallback:10}),H.value.datapointFontSize=ge({relator:Math.min(e,t),adjuster:600,source:N.value.datapoints.fontSize,threshold:10,fallback:10}),H.value.axisNameFontSize=ge({relator:Math.min(e,t),adjuster:600,source:N.value.axisNamesFontSize,threshold:12,fallback:12})):(H.value.plotSize=F.value.plots.radius,H.value.ticksFontSize=N.value.ticks.fontSize,H.value.datapointFontSize=N.value.datapoints.fontSize,H.value.axisNameFontSize=N.value.axisNamesFontSize)})});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)}}Ze(()=>{B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let{isPrinting:fn,isImaging:pn,generatePdf:mn,generateImage:hn}=Ee({elementId:`pcp_${k.value}`,fileName:F.value.title.text||`vue-ui-parallel-coordinate-plot`,options:j.value.userOptions.print}),gn=l(()=>j.value.userOptions.show&&!F.value.title.text),H=b({height:F.value.height,width:F.value.width,plotSize:F.value.plots.radius,ticksFontSize:N.value.ticks.fontSize,datapointFontSize:N.value.datapoints.fontSize,axisNameFontSize:N.value.axisNamesFontSize}),_n=l(()=>H.value.width),vn=l(()=>H.value.height),U=b(0),yn=Fe(e=>{U.value=e},100);rt(e=>{let t=Xt.value;if(!t)return;let n=new ResizeObserver(e=>{yn(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())});let W=l(()=>{let{top:e,right:t,bottom:n,left:r}=F.value.padding,i=vn.value,a=_n.value;return{chartHeight:Math.max(.001,i),chartWidth:Math.max(.001,a),height:Math.max(.001,i-e-n-U.value-H.value.datapointFontSize*2),width:Math.max(.001,a-r-t),top:e+U.value+H.value.datapointFontSize,left:r,right:a-t,bottom:i-n-H.value.datapointFontSize}}),bn=l(()=>ye(j.value.customPalette)),G=b({dataLabels:{show:N.value.datapoints.show},showTable:j.value.table.show,showTooltip:P.value.show});nt(j,()=>{G.value={dataLabels:{show:N.value.datapoints.show},showTable:j.value.table.show,showTooltip:P.value.show}},{immediate:!0});let K=b([]);function xn(){K.value.length?K.value=[]:En.value.forEach(e=>{K.value.push(e.id)}),Bn(`selectLegend`,kn.value)}function Sn(e){K.value.includes(e)?K.value=K.value.filter(t=>t!==e):K.value.push(e),Bn(`selectLegend`,kn.value)}let q=l(()=>nn.value.map((e,t)=>{let n=oe(e.color)||bn.value[t]||s[t]||s[t%s.length];return{...e,series:e.series.map(e=>({...e,id:ce(),color:n})),seriesIndex:t,color:n,id:ce(),shape:e.shape||`circle`}}));function Cn(e){return q.value.length?q.value.find(t=>t.name===e)||(un.value&&console.warn(`VueUiParallelCoordinatePlot - Series name not found "${e}"`),null):(un.value&&console.warn(`VueUiParallelCoordinatePlot - There are no series to show.`),null)}function wn(e){let t=Cn(e);t!==null&&K.value.includes(t.id)&&Sn(t.id)}function Tn(e){let t=Cn(e);t!==null&&(K.value.includes(t.id)||Sn(t.id))}let En=l(()=>q.value.map(e=>({...e,opacity:K.value.includes(e.id)?.5:1,segregate:()=>Sn(e.id),isSegregated:K.value.includes(e.id),shape:e.shape||`circle`}))),Dn=l(()=>({cy:`pcp-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),On=l(()=>Math.max(...q.value.filter(e=>!K.value.includes(e.id)).map(e=>Math.max(...e.series.flatMap(e=>e.values.length))))),J=l(()=>W.value.width/On.value),kn=l(()=>q.value.filter(e=>!K.value.includes(e.id))),Y=l(()=>{let e=[];for(let t=0;t<On.value;t+=1){let n=Math.min(...kn.value.flatMap(e=>e.series.map(e=>e.values[t]||0)||0)),r=Math.max(...kn.value.flatMap(e=>e.series.map(e=>e.values[t]||0)||0)),i=r===n?n/4:n,a=r===n?r*2:r,o=ue(i,a,F.value.yAxis.scaleTicks),ee=o.ticks.map((e,n)=>{let r=o.min<0?e+Math.abs(o.min):e-Math.abs(o.min),i=o.min<0?o.max+Math.abs(o.min):o.max-Math.abs(o.min);return{y:W.value.bottom-W.value.height*(r/i),x:W.value.left+J.value*t+J.value/2,value:e}});e.push({scale:o,ticks:ee,name:N.value.axisNames[t]||`Y-${t+1}`})}return e}),X=l(()=>kn.value.map((e,t)=>({...e,series:e.series.map((n,r)=>({...n,datapoints:n.values.map((i,a)=>{let o=Y.value[a].scale.min<0?(i||0)+Math.abs(Y.value[a].scale.min):(i||0)-Math.abs(Y.value[a].scale.min),ee=Y.value[a].scale.min<0?Y.value[a].scale.max+Math.abs(Y.value[a].scale.min):Y.value[a].scale.max-Math.abs(Y.value[a].scale.min);return{name:n.name,seriesName:e.name,axisIndex:a,datapointIndex:r,seriesIndex:t,value:i||0,x:W.value.left+J.value*a+J.value/2,y:W.value.bottom-W.value.height*(o/ee),comment:n.comments&&n.comments[a]||``}})}))})).map(e=>({...e,series:e.series.map(e=>{let t=se(e.datapoints),n=ae(e.datapoints,.12),r=be(F.value.lines.smooth?`M ${n}`:`M ${t}`);return{...e,smoothPath:n,straightPath:t,pathLength:r}})}))),Z=l(()=>X.value.flatMap((e,t)=>e.series.map((n,r)=>({shape:e.shape,serieName:e.name,serie:n,relativeIndex:r,seriesIndex:n.seriesIndex,S:t,key:`${t}_${r}`}))));function An({value:e,index:t,datapoint:n}){return fe(N.value.formatters[t]||null,e,ee({p:N.value.prefixes[t]||``,v:e,s:N.value.suffixes[t]||``,r:N.value.roundings[t]||0}),{datapoint:n,seriesIndex:t})}let Q=b(null),jn=b(null),Mn=b(!1),Nn=b(``);function Pn({shape:e,serie:t,S:n}){j.value.events.datapointLeave&&j.value.events.datapointLeave({datapoint:{...t,shape:e},seriesIndex:n});let r=O.value===null?null:Z.value[O.value];Qt.value===`keyboard`&&r&&r.serie.id===t.id||(Q.value=null,Mn.value=!1)}function Fn(e){if(!z.value||!e?.datapoints?.length)return;let t=e.datapoints[Math.floor(e.datapoints.length/2)];if(!t)return;let n=ve(t.x,t.y,z.value);n&&(Zt.value=n)}function In({shape:e,serieName:t,serie:n,relativeIndex:r,seriesIndex:i,S:a,triggerMode:o=`pointer`}){j.value.events.datapointEnter&&j.value.events.datapointEnter({datapoint:{...n,shape:e},seriesIndex:a}),Qt.value=o,jn.value={config:j.value,datapoint:n,serie:n,relativeIndex:r,seriesIndex:i,series:q.value,scales:Y.value},Mn.value=!0,Q.value=n.id;let te=``,s=P.value.customFormat;ne(s)&&he(()=>s({serie:n,seriesIndex:n.seriesIndex,series:q.value,config:j.value,scales:Y.value}))?Nn.value=s({serie:n,seriesIndex:n.seriesIndex,series:q.value,config:j.value,scales:Y.value}):(te+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${P.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${t?t+` - `:``}${n.name}</div>`,Y.value.map(e=>e.name).forEach((e,t)=>{te+=`
|
|
2
|
+
<div class="vue-ui-tooltip-item" style="text-align:left">
|
|
3
|
+
<span>${e}: </span>
|
|
4
|
+
<span>
|
|
5
|
+
${fe(N.value.formatters[t]||null,n.datapoints[t].value,ee({p:N.value.prefixes[t]||``,v:n.datapoints[t].value,s:N.value.suffixes[t]||``,r:N.value.roundings[t]||``}),{datapoint:n.datapoints[t],seriesIndex:t})}
|
|
6
|
+
</span>
|
|
7
|
+
</div>
|
|
8
|
+
`,F.value.comments.showInTooltip&&n.datapoints[t].comment&&(te+=`<div class="vue-data-ui-tooltip-comment" style="background:${ie(n.color,12.5)}; padding: 6px; margin-bottom: 6px; border-left: 1px solid ${n.color}">${n.datapoints[t].comment}</div>`)}),Nn.value=`<div>${te}</div>`),o===`keyboard`&&Xe(()=>{Fn(n)})}function Ln(){return q.value}let $=l(()=>{let e=[j.value.table.columnNames.series,j.value.table.columnNames.item].concat(Y.value.map(e=>e.name));return{body:X.value.flatMap((e,t)=>e.series.map(t=>[e.name,t.name].concat(t.values))),head:e,config:{th:{backgroundColor:j.value.table.th.backgroundColor,color:j.value.table.th.color,outline:j.value.table.th.outline},td:{backgroundColor:j.value.table.td.backgroundColor,color:j.value.table.td.color,outline:j.value.table.td.outline},breakpoint:j.value.table.responsiveBreakpoint},colNames:[j.value.table.columnNames.series,j.value.table.columnNames.item].concat(Y.value.map(e=>e.name))}}),Rn=l(()=>X.value.length===0?{head:[],body:[],config:{},columnNames:[]}:{head:$.value.head,body:$.value.body});function zn(e=null){let t=[[F.value.title.text],[F.value.title.subtitle.text],[``]],n=Rn.value.head,r=Rn.value.body,i=t.concat([n]).concat(r),a=te(i);e?e(a):me({csvContent:a,title:F.value.title.text||`vue-ui-parallel-coordinate-plot`})}let Bn=it;function Vn({serie:e,shape:t,S:n}){j.value.events.datapointClick&&j.value.events.datapointClick({datapoint:{...e,shape:t},seriesIndex:n}),Bn(`selectDatapoint`,e)}function Hn(){G.value.showTable=!G.value.showTable}function Un(){G.value.dataLabels.show=!G.value.dataLabels.show}function Wn(){G.value.showTooltip=!G.value.showTooltip}let Gn=b(!1);function Kn(){Gn.value=!Gn.value}let qn=He(D,()=>F.value.title.text),Jn=b({start:0,end:1}),Yn=l(()=>Y.value.map(e=>e.name));je({timeLabelsEls:Xt,timeLabels:Yn,slicer:Jn,configRef:j,rotationPath:[`style`,`chart`,`yAxis`,`labels`,`axisNamesRotation`],autoRotatePath:[`style`,`chart`,`yAxis`,`labels`,`axisNamesAutoRotate`,`enable`],isAutoSize:!1,width:_n,height:vn,targetClass:`.vue-ui-parallel-coordinate-plot-x-label`,rotation:N.value.axisNamesAutoRotate.angle});let Xn=l(()=>n({config:j,style:F,mutableConfig:G,dialog:It,accordion:jt,isFullscreen:A,parent:D,maxWidth:800,isCursorPointer:L}));nt(()=>G.value.showTable,e=>t(e,j,Jt));function Zn(){G.value.showTable=!1,Yt.value&&Yt.value.setTableIconState(!1)}let Qn=l(()=>F.value.backgroundColor),$n=l(()=>F.value.legend),er=l(()=>F.value.title),{isCallbackImaging:tr,isCallbackSvg:nr,generateSvg:rr,onGenerateImage:ir}=ke({svg:z,title:er,legend:$n,legendItems:En,backgroundColor:Qn,getSvgCallback:()=>j.value.userOptions.callbacks.svg,generateImage:hn});async function ar(){if(Bn(`copyAlt`,{config:j.value,dataset:X.value}),!j.value.userOptions.callbacks.altCopy){console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");return}await Promise.resolve(j.value.userOptions.callbacks.altCopy({config:j.value,dataset:X.value}))}function or(e){let t=Z.value.length;return t?(e%t+t)%t:null}function sr(){if(O.value!==null){let e=Z.value[O.value];e&&Pn({shape:e.shape,serie:e.serie,S:e.S})}O.value=null,Qt.value=`pointer`,Q.value=null,Mn.value=!1}function cr(){O.value=null,$t.value=!0}function lr(){sr(),$t.value=!1}function ur(e){if(!z.value||Gn.value||document.activeElement!==z.value||!Z.value.length)return;let t=[`ArrowUp`,`ArrowLeft`].includes(e.key),n=[`ArrowDown`,`ArrowRight`].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){sr();return}if(r){if(O.value===null)return;let e=Z.value[O.value];if(!e)return;Vn({serie:e.serie,shape:e.shape,S:e.S});return}let a=O.value;a=a===null?n?0:Z.value.length-1:or(a+(n?1:-1));let o=Z.value[a];o&&(O.value=a,In({shape:o.shape,serieName:o.serieName,serie:o.serie,relativeIndex:o.relativeIndex,seriesIndex:o.seriesIndex,S:o.S,triggerMode:`keyboard`}))}let dr=l(()=>({head:$.value.head,body:$.value.body.map(e=>[e[0]??``,e[1]??``,...e.slice(2)]),caption:j.value.a11y.translations.tableCaption,notice:j.value.a11y.translations.tableAvailable}));return Pe({getData:Ln,getImage:qn,generateCsv:zn,generatePdf:mn,generateImage:hn,generateSvg:rr,hideSeries:Tn,showSeries:wn,toggleTable:Hn,toggleLabels:Un,toggleTooltip:Wn,toggleAnnotator:Kn,toggleFullscreen:en,copyAlt:ar}),(e,t)=>(y(),f(`div`,{ref_key:`pcpChart`,ref:D,class:g(`vue-data-ui-component vue-ui-pcp ${A.value?`vue-data-ui-wrapper-fullscreen`:``} ${j.value.useCssAnimation?``:`vue-ui-dna`}`),style:v(`font-family:${j.value.style.fontFamily};width:100%; text-align:center;background:${F.value.backgroundColor};${j.value.responsive?`height:100%`:``}`),id:`pcp_${k.value}`,onMouseenter:t[2]||=()=>w(on)(!0),onMouseleave:t[3]||=()=>w(on)(!1)},[p(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[p(`p`,null,C(j.value.a11y.translations.keyboardNavigation),1)],8,ot),dr.value.body.length?(y(),u(Re,{key:0,uid:k.value,head:dr.value.head,body:dr.value.body,caption:dr.value.caption,notice:dr.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):d(``,!0),M.value.buttons.annotator?(y(),u(w(Nt),{key:1,svgRef:w(z),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Gn.value,isCursorPointer:L.value,palette:M.value.annotatorPalette,onClose:Kn},Ke({_:2},[x(w(i),t=>({name:t,fn:T(n=>[S(e.$slots,t,_(h(w(r)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),gn.value?(y(),f(`div`,{key:2,ref_key:`noTitle`,ref:Ut,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),F.value.title.text?(y(),f(`div`,{key:3,ref_key:`chartTitle`,ref:Bt,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),u(Me,{key:`title_${Wt.value}`,config:{title:{cy:`pcp-div-title`,...F.value.title},subtitle:{cy:`pcp-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),p(`div`,{id:`legend-top-${k.value}`},null,8,st),M.value.show&&Rt.value&&(w(sn)||w(an))?(y(),u(w(Pt),{ref_key:`userOptionsRef`,ref:Yt,key:`user_options_${zt.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:w(fn),isImaging:w(pn),uid:k.value,hasTooltip:M.value.buttons.tooltip&&P.value.show,hasPdf:M.value.buttons.pdf,hasXls:M.value.buttons.csv,hasImg:M.value.buttons.img,hasSvg:M.value.buttons.svg,hasTable:M.value.buttons.table,hasLabel:M.value.buttons.labels,hasFullscreen:M.value.buttons.fullscreen,hasAltCopy:M.value.buttons.altCopy,isFullscreen:A.value,isTooltip:G.value.showTooltip,titles:{...M.value.buttonTitles},chartElement:D.value,position:M.value.position,hasAnnotator:M.value.buttons.annotator,isAnnotation:Gn.value,callbacks:M.value.callbacks,printScale:M.value.print.scale,tableDialog:j.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:en,onGeneratePdf:w(mn),onGenerateCsv:zn,onGenerateImage:w(ir),onGenerateSvg:w(rr),onToggleTable:Hn,onToggleLabels:Un,onToggleTooltip:Wn,onToggleAnnotator:Kn,onCopyAlt:ar,style:v({visibility:w(sn)?w(an)?`visible`:`hidden`:`visible`})},Ke({_:2},[x(w(a)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,_(h(w(o)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasLabel.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):d(``,!0),p(`div`,ct,[(y(),f(`svg`,{ref_key:`svgRef`,ref:z,xmlns:w(_e),"aria-describedby":`chart-instructions-${k.value}`,class:g({"vue-data-ui-fullscreen--on":A.value,"vue-data-ui-fulscreen--off":!A.value,"vue-data-ui-no-transition":!w(I)}),viewBox:`0 0 ${W.value.chartWidth<=0?10:W.value.chartWidth} ${W.value.chartHeight<=0?10:W.value.chartHeight}`,style:v(`max-width:100%; overflow: visible; background:transparent;color:${F.value.color}`),tabindex:`0`,onFocus:cr,onBlur:lr,onKeydown:ur},[Je(w(Ft)),e.$slots[`chart-background`]?(y(),f(`foreignObject`,{key:0,x:W.value.left,y:W.value.top,width:W.value.width,height:W.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,ut)):d(``,!0),(y(!0),f(c,null,x(Y.value,(e,t)=>(y(),f(`g`,dt,[p(`line`,{x1:W.value.left+J.value*t+J.value/2,x2:W.value.left+J.value*t+J.value/2,y1:W.value.top,y2:W.value.bottom,stroke:F.value.yAxis.stroke,"stroke-width":F.value.yAxis.strokeWidth},null,8,ft),N.value.ticks.show?(y(),f(c,{key:0},[(y(!0),f(c,null,x(e.ticks,(t,n)=>(y(),f(`path`,{class:g({"vue-data-ui-transition":w(I)}),key:`tick_${e.name}_${n}`,d:`M${t.x},${t.y} ${t.x-10},${t.y}`,stroke:F.value.yAxis.stroke,"stroke-width":F.value.yAxis.strokeWidth,style:v(`opacity:${Q.value&&!G.value.showTooltip?.2:1}`)},null,14,pt))),128)),w(R)?d(``,!0):(y(),f(`g`,mt,[(y(!0),f(c,null,x(e.ticks,(n,r)=>(y(),f(`text`,{key:`tl_${e.name}_${r}`,class:g({"vue-data-ui-transition":w(I)}),transform:`translate(${n.x-12+N.value.ticks.offsetX}, ${n.y+N.value.ticks.offsetY+H.value.ticksFontSize/3})`,fill:N.value.ticks.color,"text-anchor":`end`,"font-size":H.value.ticksFontSize,"font-weight":N.value.ticks.bold?`bold`:`normal`,style:v(`opacity:${Q.value&&!G.value.showTooltip?.2:1}`)},C(An({value:n.value,index:t,datapoint:n})),15,ht))),128))]))],64)):d(``,!0)]))),256)),N.value.showAxisNames?(y(),f(`g`,{key:1,ref_key:`xAxisLabels`,ref:Xt},[(y(!0),f(c,null,x(Y.value,(e,t)=>(y(),f(c,null,[String(e.name).includes(`
|
|
9
|
+
`)?(y(),f(`text`,{key:1,class:`vue-ui-parallel-coordinate-plot-x-label`,fill:N.value.axisNamesColor,"font-size":H.value.axisNameFontSize,"font-weight":N.value.axisNamesBold?`bold`:``,"text-anchor":N.value.axisNamesRotation===0?`middle`:N.value.axisNamesRotation<0?`start`:`end`,transform:`translate(${W.value.left+J.value*t+J.value/2}, ${U.value-H.value.axisNameFontSize}), rotate(${N.value.axisNamesRotation})`,innerHTML:w(re)({content:String(e.name),fontSize:H.value.axisNameFontSize,fill:N.value.axisNamesColor,x:0,y:0})},null,8,_t)):(y(),f(`text`,{key:0,class:`vue-ui-parallel-coordinate-plot-x-label`,fill:N.value.axisNamesColor,"font-size":H.value.axisNameFontSize,"font-weight":N.value.axisNamesBold?`bold`:``,"text-anchor":N.value.axisNamesRotation===0?`middle`:N.value.axisNamesRotation<0?`start`:`end`,transform:`translate(${W.value.left+J.value*t+J.value/2}, ${U.value-H.value.axisNameFontSize}), rotate(${N.value.axisNamesRotation})`},C(e.name),9,gt))],64))),256))],512)):d(``,!0),(y(!0),f(c,null,x(X.value,(t,n)=>(y(),f(`g`,null,[(y(!0),f(c,null,x(t.series,(r,i)=>(y(),f(`g`,null,[F.value.plots.show?(y(),f(`g`,vt,[(y(!0),f(c,null,x(r.datapoints,(e,a)=>(y(),u(Ne,{plot:{x:e.x,y:e.y},color:t.color,shape:t.shape,radius:t.shape===`triangle`?H.value.plotSize*1.2:H.value.plotSize,stroke:F.value.backgroundColor,strokeWidth:.5,onMouseenter:e=>In({shape:t.shape,serieName:t.name,serie:r,relativeIndex:i,seriesIndex:r.seriesIndex,S:n,triggerMode:`pointer`}),onMouseleave:e=>Pn({serie:r,shape:t.shape,S:n}),style:v(`opacity:${Q.value?Q.value===r.id?F.value.plots.opacity:.2:F.value.plots.opacity}`),onClick:()=>Vn({serie:r,shape:t.shape,S:n})},null,8,[`plot`,`color`,`shape`,`radius`,`stroke`,`onMouseenter`,`onMouseleave`,`style`,`onClick`]))),256)),G.value.showTooltip?d(``,!0):(y(),f(c,{key:0},[Q.value&&Q.value===r.id&&r.datapoints.length?(y(),f(`text`,{key:0,x:r.datapoints[0].x-H.value.ticksFontSize,y:r.datapoints[0].y+H.value.ticksFontSize/3,"text-anchor":`end`,"font-size":H.value.ticksFontSize,fill:t.color,"font-weight":`bold`},C(r.name),9,yt)):d(``,!0)],64)),F.value.comments.show?(y(!0),f(c,{key:1},x(r.datapoints,n=>(y(),f(`g`,null,[n.comment?(y(),f(`foreignObject`,{key:0,style:{overflow:`visible`},height:`12`,width:F.value.comments.width,x:n.x-F.value.comments.width/2+F.value.comments.offsetX,y:n.y+F.value.comments.offsetY+6},[p(`div`,xt,[S(e.$slots,`plot-comment`,{plot:{...n,color:t.color}},void 0,!0)])],8,bt)):d(``,!0)]))),256)):d(``,!0)])):d(``,!0),p(`path`,{d:`M${F.value.lines.smooth?r.smoothPath:r.straightPath}`,stroke:t.color,"stroke-width":F.value.lines.strokeWidth,fill:`none`,class:g({"vue-ui-pcp-animated vue-data-ui-line-animated":j.value.useCssAnimation,"vue-data-ui-transition":w(I)}),onMouseenter:e=>In({shape:t.shape,serieName:t.name,serie:r,relativeIndex:i,seriesIndex:r.seriesIndex,S:n,triggerMode:`pointer`}),onMouseleave:e=>Pn({serie:r,shape:t.shape,S:n}),onClick:()=>Vn({serie:r,shape:t.shape,S:n}),style:v(`opacity:${Q.value?Q.value===r.id?F.value.lines.opacity:.2:F.value.lines.opacity}; stroke-dasharray:${r.pathLength}; stroke-dashoffset: ${j.value.useCssAnimation?r.pathLength:0}`)},null,46,St),G.value.showTooltip?(y(),f(`path`,{key:1,d:`M${F.value.lines.smooth?r.smoothPath:r.straightPath}`,stroke:`transparent`,"stroke-width":12,fill:`none`,class:g({"vue-ui-pcp-animated vue-data-ui-line-animated":j.value.useCssAnimation,"vue-data-ui-transition":w(I)}),onMouseenter:e=>In({shape:t.shape,serieName:t.name,serie:r,relativeIndex:i,seriesIndex:r.seriesIndex,S:n,triggerMode:`pointer`}),onMouseleave:e=>Pn({serie:r,shape:t.shape,S:n}),onClick:()=>Vn({serie:r,shape:t.shape,S:n}),style:{opacity:`0`}},null,42,Ct)):d(``,!0)]))),256))]))),256)),(y(!0),f(c,null,x(X.value,(e,t)=>(y(),f(`g`,null,[(y(!0),f(c,null,x(e.series,(n,r)=>(y(),f(`g`,null,[!w(R)&&(G.value.dataLabels.show||Q.value&&Q.value===n.id)?(y(!0),f(c,{key:0},x(n.datapoints,(i,a)=>(y(),f(`text`,{key:`pl_${n.id}_${a}`,transform:`translate(${i.x+12+N.value.datapoints.offsetX}, ${i.y+N.value.datapoints.offsetY+H.value.datapointFontSize/3})`,fill:N.value.datapoints.useSerieColor?e.color:N.value.datapoints.color,"text-anchor":`start`,"font-weight":N.value.datapoints.bold?`bold`:`normal`,class:g({"vue-ui-pcp-plot-label":!0,"vue-data-ui-transition":w(I)}),"font-size":H.value.datapointFontSize,stroke:F.value.backgroundColor,"stroke-width":3,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,onMouseenter:i=>In({shape:e.shape,serieName:e.name,serie:n,relativeIndex:r,seriesIndex:n.seriesIndex,S:t,triggerMode:`pointer`}),onMouseleave:r=>Pn({serie:n,shape:e.shape,S:t}),onClick:()=>Vn({serie:n,shape:e.shape,S:t}),style:v(`opacity:${Q.value?Q.value===n.id?1:.2:1}`)},C(An({value:i.value,index:a,datapoint:i})),47,wt))),128)):d(``,!0)]))),256))]))),256)),S(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:w(fn)||w(pn)||w(tr),isPrintingSvg:w(nr)}},void 0,!0)],46,lt)),e.$slots.hint?(y(),f(`div`,Tt,[S(e.$slots,`hint`,_(h({hint:j.value.a11y.translations.keyboardNavigation,isVisible:$t.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(y(),f(`div`,Et,[S(e.$slots,`watermark`,_(h({isPrinting:w(fn)||w(pn)||w(tr)||w(nr)})),void 0,!0)])):d(``,!0),p(`div`,{id:`legend-bottom-${k.value}`},null,8,Dt),qt.value&&(F.value.legend.show||e.$slots.legend)?(y(),u(Ge,{key:6,to:F.value.legend.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[p(`div`,{ref_key:`chartLegend`,ref:Vt},[S(e.$slots,`legend`,{legend:En.value},()=>[F.value.legend.show&&Rt.value?(y(),u(Ue,{key:`legend_${Gt.value}`,legendSet:En.value,config:Dn.value,isCursorPointer:L.value,onClickMarker:t[0]||=({legend:e})=>{Sn(e.id)}},{item:T(({legend:e,index:t})=>[p(`div`,{onClick:t=>e.segregate(),style:v(`opacity:${K.value.includes(e.id)?.5:1}`)},C(e.name),13,Ot)]),legendToggle:T(()=>[En.value.length>2&&F.value.legend.selectAllToggle.show&&!w(R)?(y(),u(Le,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:K.value.length>0,isCursorPointer:L.value,onToggle:xn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):d(``,!0)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):d(``,!0)],!0)],512)],8,[`to`])):d(``,!0),e.$slots.source?(y(),f(`div`,{key:7,ref_key:`source`,ref:Ht,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),Je(w(kt),{teleportTo:P.value.teleportTo,show:G.value.showTooltip&&Mn.value,backgroundColor:P.value.backgroundColor,color:P.value.color,fontSize:P.value.fontSize,borderRadius:P.value.borderRadius,borderColor:P.value.borderColor,borderWidth:P.value.borderWidth,backgroundOpacity:P.value.backgroundOpacity,position:P.value.position,offsetX:P.value.offsetX,offsetY:P.value.offsetY,parent:D.value,content:Nn.value,isFullscreen:A.value,isCustom:w(ne)(P.value.customFormat),smooth:P.value.smooth,backdropFilter:P.value.backdropFilter,smoothForce:P.value.smoothForce,smoothSnapThreshold:P.value.smoothSnapThreshold,isA11yMode:Qt.value===`keyboard`,a11yPosition:Zt.value},{"tooltip-before":T(()=>[S(e.$slots,`tooltip-before`,_(h({...jn.value})),void 0,!0)]),tooltip:T(()=>[S(e.$slots,`tooltip`,_(h({...jn.value})),void 0,!0)]),"tooltip-after":T(()=>[S(e.$slots,`tooltip-after`,_(h({...jn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Rt.value&&M.value.buttons.table?(y(),u($e(Xn.value.component),Ye({key:8},Xn.value.props,{ref_key:`tableUnit`,ref:Jt,onClose:Zn}),Ke({content:T(()=>[(y(),u(w(Mt),{key:`table_${Kt.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:j.value.table.useDialog?``:Xn.value.title,withCloseButton:!j.value.table.useDialog,isCursorPointer:L.value,onClose:Zn},{th:T(({th:e})=>[p(`div`,null,C(e),1)]),td:T(({td:e})=>[qe(C(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[j.value.table.useDialog?{name:`title`,fn:T(()=>[qe(C(Xn.value.title),1)]),key:`0`}:void 0,j.value.table.useDialog?{name:`actions`,fn:T(()=>[p(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>zn(M.value.callbacks.csv),style:v({cursor:L.value?`pointer`:`default`})},[Je(w(At),{name:`fileCsv`,stroke:Xn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):d(``,!0),S(e.$slots,`skeleton`,{},()=>[w(R)?(y(),u(Oe,{key:0})):d(``,!0)],!0)],46,at))}},[[`__scopeId`,`data-v-edffa80b`]]);export{it as n,kt as t};
|