vue-data-ui 3.28.12 → 3.29.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/BaseScanner-m6QR9rwD.js +1 -0
- package/dist/{PackageVersion-PdpqwkYX.js → PackageVersion-BbZ3wNGs.js} +1 -1
- package/dist/SlicerPreview-Ks9FNVzh.js +1 -0
- package/dist/{StackChartTable-D-31a1zL.js → StackChartTable-rTC6w378.js} +1 -1
- package/dist/Tooltip-B432XpvC.js +1 -0
- package/dist/{XyAnalysisOptions-DmKfwSu6.js → XyAnalysisOptions-BpjGs_2b.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-label.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/package-BsppqqRX.js +1 -0
- package/dist/{render-common-C9aE_Va1.js → render-common-Bc3-uPjM.js} +1 -1
- package/dist/ssr/vue-ui-donut.js +1 -1
- package/dist/ssr/vue-ui-xy.js +1 -1
- package/dist/ssr.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +75 -9
- package/dist/useAnimationFrame-D8gcRfnW.js +1 -0
- package/dist/useConfig-CBXrYhMI.js +1 -0
- package/dist/useLoading-BwiplGDB.js +1 -0
- package/dist/{useObjectBindings-D789Dz63.js → useObjectBindings-DDUobNFp.js} +1 -1
- package/dist/usePanZoom-CTGk8aJt.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-CMig_4IZ.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-BXDDF5Hq.js +10 -0
- package/dist/{vue-ui-accordion-DxGxf-Rm.js → vue-ui-accordion-CV2dxsXB.js} +1 -1
- package/dist/vue-ui-age-pyramid-BDoFrY4Y.js +1 -0
- package/dist/vue-ui-annotator-DBItXQjx.js +259 -0
- package/dist/vue-ui-bullet-iOGIwd8G.js +11 -0
- package/dist/vue-ui-bump-CYYE7AYx.js +8 -0
- package/dist/vue-ui-candlestick-fQbKxfp6.js +22 -0
- package/dist/vue-ui-carousel-table-DUUhomv3.js +1 -0
- package/dist/vue-ui-chestnut-D7bO1IIi.js +1 -0
- package/dist/vue-ui-chord-Cwg9Vjnn.js +9 -0
- package/dist/vue-ui-circle-pack-C18kRERE.js +13 -0
- package/dist/vue-ui-cursor-BxBeDqnb.js +1 -0
- package/dist/vue-ui-dag-BMBSp7ua.js +7 -0
- package/dist/vue-ui-dashboard-wDPL7yQw.js +1 -0
- package/dist/vue-ui-digits-CVpi-dBr.js +1 -0
- package/dist/vue-ui-donut-BJumteL7.js +23 -0
- package/dist/{vue-ui-donut-BqnLIKwZ.js → vue-ui-donut-D5LOpVST.js} +1 -1
- package/dist/vue-ui-donut-evolution-DNY_zpSw.js +2 -0
- package/dist/vue-ui-dumbbell-CT22NxlP.js +9 -0
- package/dist/vue-ui-flow-ihpQN8B4.js +3 -0
- package/dist/vue-ui-funnel-CydmxKNq.js +1 -0
- package/dist/vue-ui-galaxy-CDdpiwLH.js +1 -0
- package/dist/vue-ui-gauge-Cu6cz42H.js +1 -0
- package/dist/vue-ui-geo-DAtuaLrb.js +1 -0
- package/dist/vue-ui-gizmo-C-MEb9P1.js +1 -0
- package/dist/{vue-ui-graph-CBkbFJIA.js → vue-ui-graph-CyySb2SE.js} +2 -2
- package/dist/vue-ui-heatmap-CcWLxTbW.js +1 -0
- package/dist/{vue-ui-hill-8c-9u8eg.js → vue-ui-hill-mvdRA1RD.js} +1 -1
- package/dist/vue-ui-history-plot-AL9z3mC6.js +2 -0
- package/dist/vue-ui-horizontal-bar-D2IV9phG.js +4 -0
- package/dist/vue-ui-kpi-ZCJekvYX.js +1 -0
- package/dist/{vue-ui-label-CBrMoFDG.js → vue-ui-label-CAMjkZc2.js} +1 -1
- package/dist/{vue-ui-mini-loader-PsWZLMLF.js → vue-ui-mini-loader-B15gWQp1.js} +1 -1
- package/dist/vue-ui-molecule-H88Xsomv.js +1 -0
- package/dist/vue-ui-mood-radar-De_2I7pq.js +1 -0
- package/dist/vue-ui-nested-donuts-DGWgyIoR.js +19 -0
- package/dist/vue-ui-onion-QidVWMud.js +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-DFw19TpK.js +9 -0
- package/dist/vue-ui-quadrant-CeMOzfdY.js +2 -0
- package/dist/vue-ui-quick-chart-Tyt1WdUW.js +9 -0
- package/dist/vue-ui-radar-C4U7ohC4.js +1 -0
- package/dist/{vue-ui-rating-D0QvpD3V.js → vue-ui-rating-BbHvfFsG.js} +1 -1
- package/dist/vue-ui-relation-circle-zoBhpcTB.js +1 -0
- package/dist/vue-ui-ridgeline-C9ECt2cC.js +2 -0
- package/dist/vue-ui-rings-kYvvKGXk.js +1 -0
- package/dist/vue-ui-scatter-Bs5NhtfK.js +9 -0
- package/dist/{vue-ui-skeleton-CZMyXM-1.js → vue-ui-skeleton-BSM40fOT.js} +2 -2
- package/dist/{vue-ui-smiley-C00q-teB.js → vue-ui-smiley-BvkpUjyE.js} +1 -1
- package/dist/vue-ui-spark-trend-DmJHx3aj.js +1 -0
- package/dist/vue-ui-sparkbar-6wKyKgYy.js +1 -0
- package/dist/vue-ui-sparkgauge-BnZZ2zhe.js +1 -0
- package/dist/vue-ui-sparkhistogram-C9cyazhH.js +1 -0
- package/dist/vue-ui-sparkline-a1e4A-Gl.js +1 -0
- package/dist/vue-ui-sparkstackbar-BTEpVODr.js +1 -0
- package/dist/vue-ui-stackbar-BplckX2c.js +29 -0
- package/dist/vue-ui-stackline-1KSn7Lw-.js +17 -0
- package/dist/vue-ui-strip-plot-ZCX50Scf.js +2 -0
- package/dist/vue-ui-table-BRwwKG0f.js +14 -0
- package/dist/vue-ui-table-heatmap-2csQOE2c.js +1 -0
- package/dist/{vue-ui-table-sparkline-39sKOqcp.js → vue-ui-table-sparkline-VLptltwn.js} +1 -1
- package/dist/vue-ui-thermometer-DUocWNhm.js +1 -0
- package/dist/vue-ui-timer-DfFRykEz.js +65 -0
- package/dist/vue-ui-tiremarks-BBtWpWBE.js +1 -0
- package/dist/vue-ui-treemap-Bz1FshtF.js +1 -0
- package/dist/vue-ui-waffle-C7SVznJl.js +1 -0
- package/dist/vue-ui-wheel-BaZ08ojL.js +1 -0
- package/dist/vue-ui-word-cloud-BOUVu-F2.js +4 -0
- package/dist/vue-ui-world-E2JfHzRD.js +19 -0
- package/dist/vue-ui-xy-CGuTzofF.js +27 -0
- package/dist/vue-ui-xy-CmQ5D8Rm.js +31 -0
- package/dist/{vue-ui-xy-canvas-CRSisgSA.js → vue-ui-xy-canvas-FULC8M7D.js} +2 -2
- package/dist/vue_ui_stackline-CBl7ydff.js +1 -0
- package/dist/xyScaleTicks-DMX-D9Wd.js +1 -0
- package/dist/xyScales-Cb-Z9Qso.js +1 -0
- package/package.json +3 -3
- package/dist/BaseScanner-8NdoBs7B.js +0 -1
- package/dist/SlicerPreview-0m9E7Zh_.js +0 -1
- package/dist/Tooltip-C1q0Qoh7.js +0 -1
- package/dist/package-DWjs4THo.js +0 -1
- package/dist/useConfig-_JwRfIqE.js +0 -1
- package/dist/usePanZoom-CE6Ofyy8.js +0 -1
- package/dist/vue-data-ui-Da3HK_wb.js +0 -1
- package/dist/vue-ui-3d-bar-D1XfKXhp.js +0 -19
- package/dist/vue-ui-age-pyramid-CJqqtEIh.js +0 -1
- package/dist/vue-ui-annotator-D31LD4-s.js +0 -331
- package/dist/vue-ui-bullet-CxyL5Bdm.js +0 -34
- package/dist/vue-ui-bump-BWWMzAN_.js +0 -8
- package/dist/vue-ui-candlestick-CQXdyPEt.js +0 -22
- package/dist/vue-ui-carousel-table-DwsfnL_l.js +0 -1
- package/dist/vue-ui-chestnut-DV7XKL7g.js +0 -1
- package/dist/vue-ui-chord-DRNn_E6i.js +0 -21
- package/dist/vue-ui-circle-pack-BcA9ZxZS.js +0 -13
- package/dist/vue-ui-cursor-DSgVvP1L.js +0 -1
- package/dist/vue-ui-dag-CWpyU7AJ.js +0 -9
- package/dist/vue-ui-dashboard-Dh_Zi8oG.js +0 -1
- package/dist/vue-ui-digits-Cy3Y6qro.js +0 -42
- package/dist/vue-ui-donut-DasGeYdl.js +0 -47
- package/dist/vue-ui-donut-evolution-Bw7ilDYR.js +0 -2
- package/dist/vue-ui-dumbbell-BPvvKhag.js +0 -9
- package/dist/vue-ui-flow-XI5Y3qdk.js +0 -3
- package/dist/vue-ui-funnel-DqoQogQE.js +0 -1
- package/dist/vue-ui-galaxy-NRaBIHpn.js +0 -1
- package/dist/vue-ui-gauge-DX4SBIKS.js +0 -1
- package/dist/vue-ui-geo-C3e4J_kw.js +0 -1
- package/dist/vue-ui-gizmo-C9ls2b4h.js +0 -1
- package/dist/vue-ui-heatmap-D6KP1N8f.js +0 -1
- package/dist/vue-ui-history-plot-CowxWkEd.js +0 -2
- package/dist/vue-ui-horizontal-bar-CVP5jBNJ.js +0 -4
- package/dist/vue-ui-kpi-D1MUlURM.js +0 -1
- package/dist/vue-ui-molecule-BRB54XBD.js +0 -1
- package/dist/vue-ui-mood-radar-CkHJdUyF.js +0 -1
- package/dist/vue-ui-nested-donuts-C-7VZO11.js +0 -19
- package/dist/vue-ui-onion-erpKpDKg.js +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-BDg0pRkN.js +0 -9
- package/dist/vue-ui-quadrant-CUdNxC6W.js +0 -2
- package/dist/vue-ui-quick-chart-DE5Zwioe.js +0 -16
- package/dist/vue-ui-radar-6y6er9ND.js +0 -1
- package/dist/vue-ui-relation-circle-CjnG9G7s.js +0 -1
- package/dist/vue-ui-ridgeline-B4qi2Ajl.js +0 -2
- package/dist/vue-ui-rings-EYfCkNB6.js +0 -1
- package/dist/vue-ui-scatter-Tw-5uRac.js +0 -9
- package/dist/vue-ui-spark-trend-Cmj4aWcQ.js +0 -1
- package/dist/vue-ui-sparkbar-Crq1Vui3.js +0 -1
- package/dist/vue-ui-sparkgauge-CN_9yenn.js +0 -1
- package/dist/vue-ui-sparkhistogram-CK7JmyCw.js +0 -1
- package/dist/vue-ui-sparkline-2_RlGrAT.js +0 -1
- package/dist/vue-ui-sparkstackbar-Dwdn2_9q.js +0 -1
- package/dist/vue-ui-stackbar-BVmQJn2b.js +0 -29
- package/dist/vue-ui-stackline-nvhui30B.js +0 -39
- package/dist/vue-ui-strip-plot-Dig2RljR.js +0 -2
- package/dist/vue-ui-table-_qSw3iGd.js +0 -14
- package/dist/vue-ui-table-heatmap-BwoRcqFD.js +0 -1
- package/dist/vue-ui-thermometer-CoVrrzHW.js +0 -1
- package/dist/vue-ui-timer-DoR5PqOa.js +0 -64
- package/dist/vue-ui-tiremarks-9tPPNGiq.js +0 -1
- package/dist/vue-ui-treemap-D3mZkT4P.js +0 -1
- package/dist/vue-ui-waffle-D2GfM_Se.js +0 -1
- package/dist/vue-ui-wheel-CYBaqHm6.js +0 -1
- package/dist/vue-ui-word-cloud-ClGL6iKL.js +0 -4
- package/dist/vue-ui-world-Dm7LSNB2.js +0 -19
- package/dist/vue-ui-xy-2VCMSzeE.js +0 -27
- package/dist/vue-ui-xy-DUlJcC9R.js +0 -31
- package/dist/vue_ui_stackline-B6ylXHBJ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-DnGoh-XS.js";import{Jt as n,X as r,t as ee}from"./lib-rPeBMZrn.js";import{t as i}from"./useConfig-CBXrYhMI.js";import{n as a}from"./PackageVersion-BbZ3wNGs.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Teleport as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createVNode as te,nextTick as ne,normalizeClass as p,normalizeStyle as re,onBeforeUnmount as m,onMounted as h,openBlock as g,ref as _,toDisplayString as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>F}),x=[`xmlns`,`height`,`width`],ie={id:`follower`,fy:`30%`,fx:`30%`},ae=[`stop-color`,`stop-opacity`],oe=[`r`,`fill`,`stroke`,`stroke-width`,`stroke-dasharray`],se=[`r`],ce={key:2,class:`wave`},le=[`id`],ue=[`id`],de=[`filter`,`stroke`],S={key:3,class:`crosshair`},C=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],w=[`x1`,`stroke`,`stroke-width`,`stroke-dasharray`],T=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],E=[`y1`,`stroke`,`stroke-width`,`stroke-dasharray`],D=[`cy`,`r`,`fill`],O=[`cy`,`r`,`fill`],k=[`cx`,`r`,`fill`],A=[`cx`,`r`,`fill`],j={key:5,class:`coordinates`},M=[`x`,`y`,`font-size`,`fill`],N=[`transform`],P=[`font-size`,`fill`],F=/*#__PURE__*/ o({__name:`vue-ui-cursor`,props:{config:{type:Object,default:{}}},setup(e){let{vue_ui_cursor:o}=i(),b=e,F=_(r()),I=c(()=>t({userConfig:b.config,defaultConfig:o})),L=_({x:-100,y:-100}),R=c(()=>Math.round(I.value.centerCircleRadius)),z=c(()=>Math.round(I.value.coordinatesOffset));function B({clientX:e,clientY:t,...n}){L.value.x=e-R.value,L.value.y=t-R.value}function V(e){L.value.x=e.targetTouches[0].clientX-R.value,L.value.y=e.targetTouches[0].clientY-R.value}let H=_(!0);function U(e){H.value=e}let W=_(!1),G=!1,K=()=>U(!0),q=()=>U(!1),J=_(null);function Y(){W.value=!1,J.value&&clearTimeout(J.value),ne(()=>{G||(W.value=!0,J.value=setTimeout(()=>{W.value=!1},1e3))})}let X=_(null),Z=_(null);function Q(){return I.value.parentId?document.getElementById(I.value.parentId):document.getElementsByTagName(`div`)[0]||null}function $(e){e&&(e.addEventListener(`mousemove`,B),e.addEventListener(`touchmove`,V),e.addEventListener(`mouseleave`,q),e.addEventListener(`mouseenter`,K),e.addEventListener(`click`,Y))}function fe(e){e&&(e.removeEventListener(`mousemove`,B),e.removeEventListener(`touchmove`,V),e.removeEventListener(`mouseleave`,q),e.removeEventListener(`mouseenter`,K),e.removeEventListener(`click`,Y))}return h(()=>{let e=Q();if(e){X.value=e,$(e);return}if(!I.value.parentId)return;let t=new MutationObserver(()=>{let e=Q();e&&(X.value=e,$(e),t.disconnect(),Z.value=null)});t.observe(document.body,{childList:!0,subtree:!0}),Z.value=t}),m(()=>{G=!0,clearTimeout(J.value),Z.value&&=(Z.value.disconnect(),null),X.value&&=(fe(X.value),null)}),(e,t)=>(g(),l(s,{to:`body`},[H.value?(g(),d(`svg`,{key:0,"data-dom-to-png-ignore":``,xmlns:y(ee),style:re(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${L.value.y}px; left:${L.value.x}px;`),viewBox:`0 0 100 100`,height:R.value*2,width:R.value*2},[te(a),f(`defs`,null,[f(`radialGradient`,ie,[f(`stop`,{offset:`10%`,"stop-color":I.value.bubbleEffectColor,"stop-opacity":I.value.bubbleEffectOpacity},null,8,ae),t[0]||=f(`stop`,{offset:`95%`,"stop-color":`transparent`},null,-1)])]),I.value.showCenterCircle?(g(),d(`circle`,{key:0,cx:50,cy:50,r:R.value,fill:y(n)(I.value.centerCircleColor,I.value.centerCircleOpacity*100),stroke:I.value.centerCircleStroke,"stroke-width":I.value.centerCircleStrokeWidth,"stroke-dasharray":I.value.centerCircleDasharray},null,8,oe)):u(``,!0),I.value.bubbleEffect?(g(),d(`circle`,{key:1,cx:50,cy:50,r:R.value,fill:`url(#follower)`,stroke:`none`},null,8,se)):u(``,!0),I.value.useWaveOnClick?(g(),d(`g`,ce,[f(`defs`,null,[f(`filter`,{id:`blur_${F.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[f(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:4,id:`blur_std_${F.value}`},null,8,ue),t[1]||=f(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,le)]),W.value?(g(),d(`circle`,{key:0,class:p({"circle-wave":W.value}),cx:50,cy:50,r:50,filter:`url(#blur_${F.value})`,stroke:I.value.centerCircleStroke,fill:`none`,"stroke-width":`3`},null,10,de)):u(``,!0)])):u(``,!0),I.value.showCrosshair?(g(),d(`g`,S,[f(`line`,{x1:-R.value+50,x2:-5e3,y1:50,y2:50,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,C),f(`line`,{x1:50+R.value,x2:5e3,y1:50,y2:50,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,w),f(`line`,{x1:50,x2:50,y1:-R.value+50,y2:-5e3,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,T),f(`line`,{x1:50,x2:50,y1:R.value+50,y2:5e3,stroke:I.value.crosshairStroke,"stroke-width":I.value.crosshairStrokeWidth,"stroke-dasharray":I.value.crosshairDasharray,"stroke-linecap":`round`},null,8,E)])):u(``,!0),I.value.showIntersectCircles?(g(),d(`g`,{key:4,class:p({"rotating-circles":I.value.isLoading})},[f(`circle`,{cx:50,cy:R.value+50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,D),f(`circle`,{cx:50,cy:-R.value+50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,O),f(`circle`,{cx:-R.value+50,cy:50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,k),f(`circle`,{cx:R.value+50,cy:50,r:I.value.intersectCirclesRadius,fill:I.value.intersectCirclesFill},null,8,A)],2)):u(``,!0),I.value.showCoordinates?(g(),d(`g`,j,[f(`text`,{"text-anchor":`end`,x:-R.value+50-I.value.coordinatesFontSize/2+z.value,y:50-I.value.coordinatesFontSize/2+z.value,"font-size":I.value.coordinatesFontSize,fill:I.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},"font-family":`Arial`},v(L.value.x.toFixed(0)),9,M),f(`g`,{transform:`translate(${50-I.value.coordinatesFontSize/2+z.value}, ${-R.value+50-I.value.coordinatesFontSize/2+z.value})`},[f(`text`,{"text-anchor":`start`,"font-size":I.value.coordinatesFontSize,fill:I.value.coordinatesColor,style:{"font-variant-numeric":`tabular-nums`},transform:`rotate(-90)`,"font-family":`Arial`},v(L.value.y.toFixed(0)),9,P)],8,N)])):u(``,!0)],12,x)):u(``,!0)]))}},[[`__scopeId`,`data-v-5e16ad76`]]);export{b as n,F as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s}from"./annotationViewport-X8fvs7pz.js";import{t as c}from"./resolveChartConfig-0IvbmIE_.js";import{Pt as l,S as u,St as d,X as f,Y as p,at as m,in as h,rt as g,t as ee,tn as te,zt as ne}from"./lib-rPeBMZrn.js";import{t as re}from"./usePanZoom-CTGk8aJt.js";import{n as ie,t as ae}from"./useHints-C-TwxM0Y.js";import{t as oe}from"./useConfig-CBXrYhMI.js";import{t as se}from"./usePrinter-DVf3YcG5.js";import{t as ce}from"./useChartExport-BZts4KFb.js";import{t as le}from"./useUserOptionState-CXlFnwPv.js";import{t as ue}from"./useChartAccessibility-DOMuYJfm.js";import{t as de}from"./useResponsive-CENUxfEL.js";import{t as fe}from"./img-D4RQwASc.js";import{n as pe}from"./Title-BliHuXfT.js";import{t as me}from"./vue_ui_dag-B-4OxeQQ.js";import{t as he}from"./BaseScanner-m6QR9rwD.js";import{t as ge}from"./A11yDataTable-DWNlWXzs.js";import{t as _e}from"./BaseZoomControls-D4i_j6vc.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as ye,Teleport as be,Transition as xe,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as Se,createTextVNode as Ce,createVNode as we,defineAsyncComponent as Te,guardReactiveProps as Ee,mergeProps as De,nextTick as Oe,normalizeClass as ke,normalizeProps as Ae,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as S,ref as C,renderList as Pe,renderSlot as w,toDisplayString as Fe,unref as T,watch as E,watchEffect as Ie,withCtx as Le,withModifiers as Re}from"vue";var ze=`\0`,Be=`\0`,Ve=``,D=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>void 0;_defaultEdgeLabelFn=()=>void 0;_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,`directed`)||e.directed,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[Be]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){let e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){let e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){let n=arguments,r=this;return e.forEach(e=>{n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Be,this._children[e]={},this._children[Be][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){let t=this;if(Object.hasOwn(this._nodes,e)){let n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=Be;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==Be)return t}}children(e=Be){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else if(e===Be)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());let n=this;Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});let r={};function i(e){let a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){let n=this,r=arguments;return e.reduce((e,i)=>(r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i)),this}setEdge(){let e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);let o=k(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);let s=Ue(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,He(this._preds[t],e),He(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){let r=arguments.length===1?We(this._isDirected,arguments[0]):k(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],O(this._preds[t],e),O(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){let n=this._in[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.v===t):e}}outEdges(e,t){let n=this._out[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.w===t):e}}nodeEdges(e,t){let n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};function He(e,t){e[t]?e[t]++:e[t]=1}function O(e,t){--e[t]||delete e[t]}function k(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+Ve+a+Ve+(r===void 0?ze:r)}function Ue(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function We(e,t){return k(e,t.v,t.w,t.name)}var Ge=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ke(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ke(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,qe)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Ke(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function qe(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Je=()=>1;function A(e,t){if(e.nodeCount()<=1)return[];let n=M(e,t||Je);return Ye(n.graph,n.buckets,n.zeroIndex).flatMap(t=>e.outEdges(t.v,t.w))}function Ye(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)j(e,t,n,o);for(;o=i.dequeue();)j(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i].dequeue(),o){r=r.concat(j(e,t,n,o,!0));break}}}return r}function j(e,t,n,r,i){let a=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Xe(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=e.node(r.w);a.in-=i,Xe(t,n,a)}),e.removeNode(r.v),a}function M(e,t){let n=new D,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});let a=Ze(i+r+3).map(()=>new Ge),o=r+1;return n.nodes().forEach(e=>{Xe(a,o,n.node(e))}),{graph:n,buckets:a,zeroIndex:o}}function Xe(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Ze(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Qe(e,t,n,r){let i=r;for(;e.hasNode(i);)i=ct(r);return n.dummy=t,e.setNode(i,n),i}function N(e){let t=new D().setGraph(e.graph());return e.nodes().forEach(n=>{t.setNode(n,e.node(n))}),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function $e(e){let t=new D({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function P(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return ut(e.nodes(),t)}function F(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return ut(e.nodes(),t)}function et(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function I(e){let t=lt(z(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function L(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=R(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function tt(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=R(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>{e.node(t).rank+=i})})}function nt(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Qe(e,`border`,i,t)}var rt=65535;function it(e,t=rt){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}function R(e,t){if(t.length>rt){let n=it(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function z(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return R(Math.max,t)}function at(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function ot(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function st(e,t){return t()}var B=0;function ct(e){let t=++B;return e+String(t)}function lt(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function V(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function H(e,t){let n=t;if(typeof t==`string`){let e=t;n=t=>t[e]}return Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function ut(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var dt={addBorderNode:nt,addDummyNode:Qe,applyWithChunking:R,asNonCompoundGraph:$e,buildLayerMatrix:I,intersectRect:et,mapValues:H,maxRank:z,normalizeRanks:L,notime:st,partition:at,pick:V,predecessorWeights:F,range:lt,removeEmptyRanks:tt,simplify:N,successorWeights:P,time:ot,uniqueId:ct,zipObject:ut};function ft(e){(e.graph().acyclicer===`greedy`?A(e,t(e)):pt(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ct(`rev`))});function t(e){return t=>e.edge(t).weight}}function U(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function pt(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function W(e){e.graph().dummyChains=[],e.edges().forEach(t=>mt(e,t))}function mt(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Qe(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ht(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel;e.setEdge(n.edgeObj,r);let i;for(;n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function gt(e){function t(n){let r=e.node(n);if(r&&Object.prototype.hasOwnProperty.call(r,`rank`))return r.rank;let i=e.outEdges(n)||[];if(!i.length)return r&&(r.rank=0),0;let a=i.map(n=>e.node(n.w)?t(n.w)-e.edge(n).minlen:1/0),o=R(Math.min,a);return o===1/0&&(o=0),r&&(r.rank=o),o}(e.sources()||[]).forEach(t)}function G(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function _t(e){vt(e);let t=new D;e.nodes().forEach(e=>{t.setNode(e,{})});let n=e.nodes();if(!n.length)return t;let r=n[0],i=/* @__PURE__ */ new Set([r]);for(;i.size<n.length;){let r=yt(e,i);if(!r){let e=n.find(e=>!i.has(e));i.add(e),t.setNode(e,{});continue}let{edgeObject:a,delta:o,attachFrom:s,attachTo:c}=r;bt(e,i,s,o),t.setEdge(a.v,a.w,{}),i.add(c)}return t}function vt(e){e.nodes().forEach(t=>{let n=e.node(t)||{};Object.prototype.hasOwnProperty.call(n,`rank`)||(n.rank=0,e.setNode(t,n))})}function yt(e,t){let n=null;return e.edges().forEach(r=>{let i=t.has(r.v);if(i===t.has(r.w))return;let a=G(e,r),o=Math.abs(a);if(!n||o<n.absoluteSlack){let e=i?r.v:r.w,t=i?r.w:r.v;n={edgeObject:r,delta:i?a:-a,attachFrom:e,attachTo:t,absoluteSlack:o}}}),n}function bt(e,t,n,r){r&&e.nodes().forEach(n=>{if(!t.has(n)){let t=e.node(n);t.rank+=r}})}function K(e){let t=N(e);return gt(t),t.nodes().forEach(n=>{let r=t.node(n),i=e.node(n)||{};i.rank=r.rank,e.setNode(n,i)}),e}function xt(e,t){}function St(e,t){}function Ct(e,t,n){return 0}function wt(e){return null}function Tt(e,t){return null}K.initLowLimValues=xt,K.initCutValues=St,K.calcCutValue=Ct,K.leaveEdge=wt,K.enterEdge=Tt;var Et=gt;function Dt(e){let t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:At(e);break;case`tight-tree`:kt(e);break;case`longest-path`:Ot(e);break;case`none`:break;default:At(e)}}var Ot=Et;function kt(e){Et(e),_t(e)}function At(e){K(e)}function jt(e){let t=Nt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Mt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0,d=n;for(;d!==i.w;){if(r=e.node(d),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(d,l),d=e.successors(d)[0]}})}function Mt(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Nt(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children().forEach(r),t}function Pt(e){let t=dt.addDummyNode(e,`root`,{},`_root`),n=It(e),r=Object.values(n),i=dt.applyWithChunking(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>{e.edge(t).minlen*=a});let o=q(e)+1;e.children().forEach(r=>{Ft(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Ft(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=dt.addBorderNode(e,`_bt`),l=dt.addBorderNode(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Ft(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function It(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function q(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Lt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}function Rt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)J(e,`borderLeft`,`_bl`,n,i,t),J(e,`borderRight`,`_br`,n,i,t)}}e.children().forEach(t)}function J(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Qe(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function zt(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Vt(e)}function Bt(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Ht(e),(t===`lr`||t===`rl`)&&(Wt(e),Vt(e))}function Vt(e){e.nodes().forEach(t=>{Y(e.node(t))}),e.edges().forEach(t=>{Y(e.edge(t))})}function Y(e){let t=e.width;e.width=e.height,e.height=t}function Ht(e){e.nodes().forEach(t=>{Ut(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Ut),Object.hasOwn(n,`y`)&&Ut(n)})}function Ut(e){e.y=-e.y}function Wt(e){e.nodes().forEach(t=>{Gt(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Gt),Object.hasOwn(n,`x`)&&Gt(n)})}function Gt(e){let t=e.x;e.x=e.y,e.y=t}var Kt={adjust:zt,undo:Bt};function qt(e){let t={},n=e.nodes().filter(t=>e.children(t).length===0),r=n.map(t=>e.node(t).rank),i=lt(R(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n),e.successors(n).forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function X(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Jt(e,t[r-1],t[r]);return n}function Jt(e,t,n){let r=ut(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Yt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}})}function Xt(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Zt(Object.values(n).filter(e=>!e.indegree))}function Zt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Qt(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>V(e,[`vs`,`i`,`barycenter`,`weight`]))}function Qt(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Z(e,t){let n=at(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(en(!!t)),c=$t(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=$t(a,i,c)});let l={vs:a.flat(!0)};return s&&(l.barycenter=o/s,l.weight=s),l}function $t(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function en(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function tn(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=Yt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=tn(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&rn(t,i)}});let u=Xt(l,n);nn(u,c);let d=Z(u,r);if(o&&(d.vs=[o,d.vs,s].flat(!0),e.predecessors(o).length)){let t=e.node(e.predecessors(o)[0]),n=e.node(e.predecessors(s)[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d}function nn(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function rn(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function an(e,t,n,r){r||=e.nodes();let i=on(e),a=new D({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(a.setNode(r),a.setParent(r,s||i),e[n](r).forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i?i.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),a}function on(e){let t;for(;e.hasNode(t=ct(`_root`)););return t}function sn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function cn(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,cn);return}let n=z(e),r=ln(e,lt(1,n+1),`inEdges`),i=ln(e,lt(n-1,-1,-1),`outEdges`),a=qt(e);if(dn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){un(t%2==0?r:i,t%4>=2,c),a=I(e);let l=X(e,a);l<o?(o=l,n=0,s=structuredClone(a)):l===o&&(s=structuredClone(a))}dn(e,s)}function ln(e,t,n){let r=/* @__PURE__ */ new Map;function i(e,t){r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(t=>an(e,t,n,r.get(t)||[]))}function un(e,t,n){let r=new D;e.forEach(e=>{n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=tn(e,i,r,t);a.vs.forEach((t,n)=>{e.node(t).order=n}),sn(e,r,a.vs)})}function dn(e,t){Object.values(t).forEach(t=>{t.forEach((t,n)=>{e.node(t).order=n})})}function Q(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=pn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&mn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function fn(e,t){let n={};function r(t,r,i,a,o){let s;lt(r,i).forEach(r=>{s=t[r],e.node(s).dummy&&e.predecessors(s).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&mn(n,t,s)})})}function i(t,n){let i=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function pn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function mn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function hn(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function gn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let c=Math.floor(r),l=Math.ceil(r);c<=l;++c){let r=s[c];a[e]===e&&t<o[r]&&!hn(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function _n(e,t,n,r,i){let a={},o=vn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>{a[e]=a[n[e]]}),a}function vn(e,t,n,r){let i=new e.constructor,a=e.graph(),o=Cn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(i.setNode(a),r){let s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function yn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=wn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function bn(e,t){let n=Object.values(t),r=R(Math.min,n),i=R(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(s===t)return;let c=Object.values(s),l=r-R(Math.min,c);a!==`l`&&(l=i-R(Math.max,c)),l&&(s=H(s,e=>e+l),e[o]=s)})})}function xn(e,t){return H(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];let i=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(i[1]+i[2])/2})}function Sn(e){let t=I(e),n=Object.assign(Q(e,t),fn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{let o=i;t===`r`&&(o=o.map(e=>Object.values(e).reverse()));let s=(a===`u`?e.predecessors:e.successors).bind(e),c=gn(e,o,n,s),l=_n(e,o,c.root,c.align,t===`r`);t===`r`&&(l=H(l,e=>-e)),r[a+t]=l})}),bn(r,yn(e,r)),xn(r,e.graph().align)}function Cn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function wn(e,t){return e.node(t).width}function Tn(e){let t=$e(e);En(t);let n=Sn(t);Object.entries(n).forEach(([t,n])=>{e.node(t).x=n})}function En(e){let t=I(e),n=e.graph().ranksep,r=0;t.forEach(t=>{let i=t.reduce((t,n)=>{let r=e.node(n).height;return t>r?t:r},0);t.forEach(t=>{e.node(t).y=r+i/2}),r+=i+n})}function Dn(e,t={}){let n=t.debugTiming?ot:st;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Ln(e));return n(` runLayout`,()=>On(r,n,t)),n(` updateInputGraph`,()=>$(e,r)),r})}function On(e,t,n){t(` makeSpaceForEdgeLabels`,()=>Rn(e)),t(` removeSelfEdges`,()=>Jn(e)),t(` acyclic`,()=>ft(e)),t(` nestingGraph.run`,()=>Pt(e)),t(` rank`,()=>Dt($e(e))),t(` injectEdgeLabelProxies`,()=>zn(e)),t(` removeEmptyRanks`,()=>tt(e)),t(` nestingGraph.cleanup`,()=>Lt(e)),t(` normalizeRanks`,()=>L(e)),t(` assignRankMinMax`,()=>Bn(e)),t(` removeEdgeLabelProxies`,()=>Vn(e)),t(` normalize.run`,()=>W(e)),t(` parentDummyChains`,()=>jt(e)),t(` addBorderSegments`,()=>Rt(e)),t(` order`,()=>cn(e,n)),t(` insertSelfEdges`,()=>Yn(e)),t(` adjustCoordinateSystem`,()=>Kt.adjust(e)),t(` position`,()=>Tn(e)),t(` positionSelfEdges`,()=>Xn(e)),t(` removeBorderNodes`,()=>qn(e)),t(` normalize.undo`,()=>ht(e)),t(` fixupEdgeLabelCoords`,()=>Gn(e)),t(` undoCoordinateSystem`,()=>Kt.undo(e)),t(` translateGraph`,()=>Hn(e)),t(` assignNodeIntersects`,()=>Wn(e)),t(` reversePoints`,()=>Kn(e)),t(` acyclic.undo`,()=>U(e))}function $(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)});let n=t.graph(),r=e.graph();r.width=n.width,r.height=n.height}var kn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],An={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},jn=[`acyclicer`,`ranker`,`rankdir`,`align`],Mn=[`width`,`height`,`rank`],Nn={width:0,height:0},Pn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Fn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},In=[`labelpos`,`arrowshape`];function Ln(e){let t=Qn(e.graph()),n={...An,...Zn(t,kn),...V(t,jn)},r=new D({multigraph:!0,compound:!0});return r.setGraph(n),e.nodes().forEach(t=>{let n=Zn(Qn(e.node(t)),Mn);Object.keys(Nn).forEach(e=>{n[e]===void 0&&(n[e]=Nn[e])}),r.setNode(t,n),r.setParent(t,e.parent(t))}),e.edges().forEach(t=>{let n=Qn(e.edge(t));r.setEdge(t,{...Fn,...Zn(n,Pn),...V(n,In)})}),r}function Rn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function zn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Qe(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Bn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Vn(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function Hn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Un(e,t,n){if(!n||!t)return e;let r=t.x-e.x,i=t.y-e.y,a=Math.sqrt(r*r+i*i);if(!a||a<=n)return e;let o=n/a;return{x:e.x+r*o,y:e.y+i*o}}function Wn(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;!n.points||!n.points.length?(n.points=[],a=i,o=r):(a=n.points[0],o=n.points[n.points.length-1]);let s=et(r,a),c=et(i,o),l=n.points.length?n.points[0]:a,u=n.points.length?n.points[n.points.length-1]:o,d=n.arrowshape,f=d===`normal`||d===`vee`,p=!!n.reversed,m=s,h=c;f&&(p?m=Un(s,l,4):h=Un(c,u,4)),n.points.unshift(m),n.points.push(h)})}function Gn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Kn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function qn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Jn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Yn(e){I(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{Qe(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Xn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Zn(e,t){return H(V(e,t),Number)}function Qn(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=e;typeof r==`string`&&(r=r.toLowerCase()),t[r]=n}),t}var $n={rankDirection:`TB`,nodeSeparation:50,rankSeparation:50,edgeSeparation:10,align:void 0,nodeWidth:100,nodeHeight:40,curvedEdges:!1,padding:20,arrowShape:`normal`,arrowSize:10};function er(e){return e.length?e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `):``}function tr(e){if(!e.length)return``;if(e.length===1){let t=e[0];return`M ${t.x} ${t.y}`}if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let[t]=e,n=`M ${t.x} ${t.y}`;for(let t=1;t<e.length-1;t+=1){let r=e[t],i=e[t+1],a=r.x,o=r.y,s=(r.x+i.x)/2,c=(r.y+i.y)/2;n+=` Q ${a} ${o} ${s} ${c}`}let r=e[e.length-1];return n+=` L ${r.x} ${r.y}`,n}function nr(e){let{nodes:t,edges:n,configuration:r}=e,i=C(null),a=C(null),o=`dag-arrow-${f()}`;function s(e,t,n){a.value=null,i.value=null;let r={...$n,...n},s=new D({multigraph:!0,compound:!0});s.setGraph({rankdir:r.rankDirection,nodesep:r.nodeSeparation,ranksep:r.rankSeparation,edgesep:r.edgeSeparation,align:r.align}),e.forEach(e=>{s.setNode(e.id,{label:e.label,width:e.width??r.nodeWidth,height:e.height??r.nodeHeight})}),t.forEach(e=>{s.setEdge(e.from,e.to,{weight:e.weight??1,minlen:e.minLength??1,arrowShape:r.arrowShape??`normal`})}),Dn(s);let c=e.map(e=>{let t=s.node(e.id);return{id:e.id,label:e.label,x:t.x,y:t.y,width:t.width,height:t.height,original:e}}),l=s.edges().map(e=>{let n=s.edge(e),i=n.points||[];if(!i.length)return null;let a=r.curvedEdges?tr(i):er(i),c=r.arrowShape===`undirected`?null:`url(#${o})`,l=t.find(t=>t?.from===e.v&&t?.to===e.w);return{id:`${o}-${Array.from(JSON.stringify([e.v,e.w]),e=>e.codePointAt(0).toString(16)).join(`_`)}`,from:e.v,to:e.w,points:i,pathData:a,markerEnd:c,original:{...l,...n}}}).filter(Boolean),u=r.padding;if(!c.length){i.value={nodes:[],edges:l,viewBox:`0 0 0 0`,arrowShape:r.arrowShape,arrowSize:r.arrowSize};return}let f=c.flatMap(e=>[e.x-e.width/2,e.x+e.width/2]),p=c.flatMap(e=>[e.y-e.height/2,e.y+e.height/2]),m=Math.min(...f)-u,h=Math.max(...f)+u,g=Math.min(...p)-u,ee=Math.max(...p)+u;i.value={nodes:c,edges:l.map(e=>({...e,midpoint:e.pathData?d(e.pathData):{x:0,y:0}})),viewBox:`${m} ${g} ${h-m} ${ee-g}`,arrowShape:r.arrowShape,arrowSize:r.arrowSize}}return Ie(()=>{try{s(T(t)||[],T(n)||[],T(r)||{})}catch(e){console.error(`[useDag] layout error:`,e),a.value=e,i.value=null}}),{layoutData:i,lastError:a,arrowMarkerIdentifier:o,recomputeLayout:()=>{s(T(t)||[],T(n)||[],T(r)||{})}}}var rr=/* @__PURE__ */ e({default:()=>Ir}),ir=[`id`],ar=[`id`],or={key:1,class:`dag-chart-error`},sr={style:{position:`relative`}},cr=[`viewBox`,`xmlns`,`aria-describedby`],lr={key:0},ur=[`id`,`width`,`height`],dr=[`cx`,`cy`,`r`,`fill`],fr=[`x`,`y`,`width`,`height`,`fill`],pr={key:2},mr=[`id`,`markerWidth`,`markerHeight`,`refX`,`refY`],hr=[`d`,`fill`,`stroke`],gr={class:`vue-ui-dag-edges`},_r=[`data-a11y-midpoint-id`,`aria-label`,`onMouseenter`],vr={class:`vue-ui-dag-nodes`},yr=[`onClick`,`onMouseenter`,`onMouseleave`],br=[`data-a11y-node-id`,`aria-label`],xr=[`x`,`y`,`width`,`height`],Sr={class:`vue-ui-dag-edges`},Cr=[`d`,`stroke-width`,`marker-end`],wr={class:`vue-ui-dag-node-labels`},Tr=[`onClick`,`onMouseenter`,`onMouseleave`],Er=[`x`,`y`,`font-size`,`fill`,`font-weight`],Dr=[`x`,`y`,`font-size`,`fill`,`font-weight`,`innerHTML`],Or={key:1},kr={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ar={key:6,class:`vue-data-ui-watermark`},jr=[`data-position`],Mr={key:0},Nr=[`data-position`],Pr={key:0},Fr=1.5,Ir=/*#__PURE__*/ ve({__name:`vue-ui-dag`,props:{dataset:{type:Object,default(){return{nodes:[],edges:[]}}},config:{type:Object,default(){return{}}}},emits:[`onNodeClick`,`onMidpointEnter`,`onMidpointLeave`,`copyAlt`,`rotate`],setup(e,{expose:d,emit:ve}){let Ie=Te(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),ze=Te(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Be=Te(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),{vue_ui_dag:Ve}=oe(),D=e,He=ve,O=C(null),k=C(f()),Ue=C(null),We=C(null),Ge=C(null),Ke=C(0),qe=C(0),Je=null,A=null,Ye=!1,j=C(null),M=C(null),Xe=C(!1),Ze=_(yt),Qe=_(()=>{let e=D.dataset;if(!Array.isArray(e?.nodes)||!e.nodes.length||e.edges!=null&&!Array.isArray(e.edges))return!1;let t=/* @__PURE__ */ new Set;for(let n of e.nodes){if(n?.id==null||![`string`,`number`].includes(typeof n.id)||typeof n.id==`number`&&!Number.isFinite(n.id)||t.has(String(n.id)))return!1;t.add(String(n.id))}return(e.edges||[]).every(e=>e&&e.from!=null&&e.to!=null&&t.has(String(e.from))&&t.has(String(e.to)))}),N=_(()=>!!Ze.value.loading||!Qe.value),$e=_(()=>h({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#CCCCCC`,backgroundColor:`#DDDDDD50`},edges:{stroke:`#CCCCCC`},midpoints:{stroke:`#CCCCCC`,fill:`#CCCCCC`}}}},userConfig:Ze.value.skeletonConfig??{}})),P=_(()=>N.value?h({defaultConfig:Ze.value,userConfig:$e.value}):Ze.value),F=_(()=>P.value.style.chart.nodes),et=_(()=>P.value.style.chart.edges),I=_(()=>P.value.style.chart.midpoints),L=_(()=>P.value.style.chart),tt=_(()=>P.value.userOptions.useCursorPointer),nt=C(P.value.style.chart.width),rt=C(P.value.style.chart.height),it=C({x:0,y:0}),R=C(null),z=_(()=>Rt.value.get(R.value)??null),at=C(null),ot=C({left:`0px`,top:`0px`}),st=C(`top`),B=C(!1),ct=C({x:0,y:0}),lt=C({x:0,y:0}),V=C(null),H=_(()=>J(V.value)),ut=C(null),dt=C({left:`0px`,top:`0px`}),ft=C(`top`),U=C(!1),pt=C(!1),{svgRef:W}=ue({config:L.value.title}),{userOptionsVisible:mt,setUserOptionsVisibility:ht,keepUserOptionState:gt}=le({config:P.value}),G=C(P.value.style.chart.layout.rankDirection),_t={nodes:[{id:`A`,label:``},{id:`B`,label:``},{id:`C`,label:``}],edges:[{from:`A`,to:`B`},{from:`A`,to:`C`}]},vt=_(()=>N.value?D.config?.skeletonDataset??_t:D.dataset);ie({config:()=>P.value,dataset:()=>D.dataset,component:`VueUiDag`,rules:[ae.noHint]});function yt(){return c(D.config,Ve,me)}let bt=_(()=>Ze.value.debug);E([()=>D.dataset,bt],([e,t])=>{t&&(ne(e)&&m({componentName:`VueUiDag`,type:`dataset`}),!Array.isArray(e?.nodes)||!e.nodes.length?m({componentName:`VueUiDag`,type:`datasetAttributeEmpty`,property:`nodes`,index:0}):Qe.value||console.warn(`VueUiDag: provide unique node IDs and an edges array whose endpoints reference existing nodes.`))},{deep:!0,immediate:!0}),Ne(yn),E(()=>D.config,()=>{mt.value=!P.value.userOptions.showOnChartHover,Ke.value+=1},{deep:!0}),E(()=>Ze.value.style.chart.layout.rankDirection,e=>{G.value=e}),E(()=>Ze.value.style.chart.zoom.active,e=>{Bt.value=e}),E(()=>P.value.responsive,yn,{flush:`post`}),E(L,()=>{P.value.responsive?vn():(nt.value=L.value.width,rt.value=L.value.height)},{deep:!0,flush:`post`});let{isPrinting:K,isImaging:xt,generatePdf:St,generateImage:Ct}=se({elementId:`dag_${k.value}`,fileName:L.value.title.text||`vue-ui-dag`,options:P.value.userOptions.print}),wt=_(()=>L.value.backgroundColor),Tt=_(()=>L.value.title),{isCallbackImaging:Et,isCallbackSvg:Dt,generateSvg:Ot,onGenerateImage:kt}=ce({svg:W,title:Tt,legend:null,legendItems:null,backgroundColor:wt,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:Ct});function At(){ht(!0)}function jt(){ht(!1)}function Mt({tooltipRef:e,isVisibleRef:t,anchorRef:n,styleRef:r,placementRef:i,offsetRef:a,margin:o=24}){return function(){let s=e.value;if(!s||!t.value)return;let c=s.getBoundingClientRect(),l=window.innerWidth,u=window.innerHeight,d=n.value.x,f=n.value.y,p=a?.value?.x??0,m=a?.value?.y??0,h=f-m-c.height-o,g=d-c.width/2,ee=`top`;if(h<o){let e=f+m+o;e+c.height<=u-o?(h=e,ee=`bottom`):(h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=`center`)}g<o&&(g=o),g+c.width>l-o&&(g=l-c.width-o);let te=g<=o,ne=g+c.width>=l-o;if((te||ne)&&ee!==`center`){let e,t,n=d-p-o;l-(d+p)-o>=n?(e=`right`,t=d+p+o):(e=`left`,t=d-p-o-c.width),t>=o&&t+c.width<=l-o&&(g=t,h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=e)}i.value=ee,r.value={left:`${g}px`,top:`${h}px`}}}function Nt(e,t){return e&&JSON.stringify(e)===JSON.stringify(t)?e:t}let{layoutData:Pt,lastError:Ft,arrowMarkerIdentifier:It}=nr({nodes:_(e=>Nt(e,(vt.value.nodes||[]).map(e=>({id:e.id,width:e.width,height:e.height})))),edges:_(e=>Nt(e,(vt.value.edges||[]).map(e=>({from:e.from,to:e.to,...e.weight===void 0?{}:{weight:e.weight},...e.minLength===void 0?{}:{minLength:e.minLength}})))),configuration:_(e=>Nt(e,{...L.value.layout,rankDirection:G.value}))}),q=_(()=>{if(!Pt.value)return null;let e=new Map((vt.value.nodes||[]).map(e=>[String(e.id),e])),t=/* @__PURE__ */ new Map;for(let e of vt.value.edges||[]){let n=JSON.stringify([String(e.from),String(e.to)]);t.has(n)||t.set(n,e)}return{...Pt.value,nodes:Pt.value.nodes.map(t=>{let n=e.get(String(t.id))??t.original;return{...t,label:n.label,original:{...n,backgroundColor:n.backgroundColor?u(n.backgroundColor):F.value.backgroundColor,color:n.color?u(n.color):F.value.labels.color}}}),edges:Pt.value.edges.map(e=>({...e,original:{...t.get(JSON.stringify([e.from,e.to])),...e.original}}))}}),Lt=_(()=>new Map((q.value?.nodes||[]).map(e=>[String(e.id),e]))),Rt=_(()=>new Map((q.value?.edges||[]).map(e=>[e.id,e])));function J(e){return e==null?null:Lt.value.get(String(e))??null}let zt=_(()=>{let e=nt.value,t=rt.value,n=Number(e),r=Number(t),i=Number.isFinite(n)&&n>0,a=Number.isFinite(r)&&r>0;return!i&&!a?null:{width:i?n:null,height:a?r:null}}),Bt=C(L.value.zoom.active),Vt=_(()=>Bt.value&&!pt.value),{viewBox:Y,resetZoom:Ht,setInitialViewBox:Ut,scale:Wt,zoomByFactor:Gt}=re(W,{x:0,y:0,width:100,height:100},1,Vt,()=>{X(),pn(),Q()}),Kt=null,qt=0;function X(){qt+=1,Kt!==null&&cancelAnimationFrame(Kt),Kt=null}function Jt(e=!1){X(),Ht(e)}async function Yt(e,{smooth:t=!0,duration:n=300,zoomReset:r=!1,zoom:i=null}={}){let a=J(e);if(Ye||!a)return!1;let o=Y.value;if(!o)return!1;let s={x:Number(o.x),y:Number(o.y),width:Number(o.width),height:Number(o.height)},c=Wt.value,u=s.width,d=s.height,f=c;if(Number.isFinite(i)&&i>0||r){Jt(!1);let e=Y.value,t=Number.isFinite(i)&&i>0?i/100:1;u=Number(e.width)/t,d=Number(e.height)/t,f=t,Y.value={...s},Wt.value=c}let p=Number(a.x),m=Number(a.y);if(!Number.isFinite(s.x)||!Number.isFinite(s.y)||!Number.isFinite(s.width)||!Number.isFinite(s.height)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(p)||!Number.isFinite(m))return!1;let h={x:p-u/2,y:m-d/2,width:u,height:d};X();let ee=qt;if(B.value=!1,!t||!Number.isFinite(n)||n<=0)return Y.value=h,Wt.value=f,!0;let te=performance.now();function ne(e){if(Ye||ee!==qt)return;let t=Math.min((e-te)/n,1),r=g(t);Y.value={x:l(s.x,h.x,r),y:l(s.y,h.y,r),width:l(s.width,h.width,r),height:l(s.height,h.height,r)},Wt.value=l(c,f,r),t<1?Kt=requestAnimationFrame(ne):(Y.value=h,Wt.value=f,Kt=null)}return Kt=requestAnimationFrame(ne),!0}E(Pt,X);function Xt(){Bt.value=!Bt.value}function Zt(){let e=q.value&&q.value.viewBox;if(!e)return;let t=String(e).split(` `).map(Number);if(t.length!==4)return;let[n,r,i,a]=t;if(!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;let o=i,s=a,c=n,l=r,u=zt.value;u&&(u.width!==null&&(o=u.width),u.height!==null&&(s=u.height),c=n-(o-i)/2,l=r-(s-a)/2),Ut({x:c,y:l,width:o,height:s},{overwriteCurrentIfNotZoomed:!0})}E(()=>q.value&&q.value.viewBox,()=>{Zt()},{immediate:!0}),E(()=>zt.value,()=>{Zt()});let Qt=_(()=>{let e=Y.value;return e?`${e.x} ${e.y} ${e.width} ${e.height}`:`0 0 0 0`}),Z=C(!1),$t=C({width:0,height:0});E([W,Z,()=>L.value.backgroundPattern.show],([e,t,n],r,i)=>{if(!e||!t||!n)return;let a=()=>{let{width:t,height:n}=e.getBoundingClientRect();(t!==$t.value.width||n!==$t.value.height)&&($t.value={width:t,height:n})};a();let o=new ResizeObserver(a);o.observe(e),i(()=>o.disconnect())},{flush:`post`});let en=_(()=>{let e=Y.value;if(!e||!Z.value)return e;let{width:t,height:n}=$t.value;if(!(t>0&&n>0&&e.width>0&&e.height>0))return e;let r=Math.min(t/e.width,n/e.height),i=t/r,a=n/r;return{x:e.x-(i-e.width)/2,y:e.y-(a-e.height)/2,width:i,height:a}});function tn(e){Z.value=e,qe.value+=1}function nn(){pt.value=!pt.value}function rn(){X(),Gt(Fr,!0)}function an(){X(),Gt(1/Fr,!0)}let on=[`TB`,`RL`,`BT`,`LR`];function sn(){G.value=on[(on.indexOf(G.value)+1)%on.length],Jt(),He(`rotate`,G.value)}let cn=Mt({tooltipRef:at,isVisibleRef:U,anchorRef:it,styleRef:ot,placementRef:st}),ln=Mt({tooltipRef:ut,isVisibleRef:B,anchorRef:ct,styleRef:dt,placementRef:ft,offsetRef:lt}),un=C(null);async function dn(e){He(`onMidpointEnter`,e),e?.midpoint&&W.value&&(R.value=e.id,U.value=!0,I.value.selectedEdge.animated===!0&&(un.value=e.id),await Oe(),mn())}function Q(){U.value=!1,R.value=null,He(`onMidpointLeave`),I.value.selectedEdge.animated===!0&&(un.value=null)}async function fn(e){He(`onNodeClick`,e),F.value.tooltip.showOnClick&&W.value&&(V.value=e.id,B.value=!0,await Oe(),mn())}function pn(){B.value=!1,V.value=null}function mn(){if(Ye)return;let e=W.value;if(e){if(U.value&&z.value?.midpoint){let t=z.value.midpoint,n=te(t.x,t.y,e);n&&(it.value=n),cn()}if(B.value&&H.value){let t=H.value,n=te(t.x,t.y,e);n&&(ct.value=n);let r=e.getScreenCTM?.();r&&(lt.value={x:t.width*Math.hypot(r.a,r.b||0)/2,y:t.height*Math.hypot(r.c||0,r.d)/2}),ln()}}}E([q,Y,N],()=>{B.value&&(N.value||!F.value.tooltip.showOnClick||V.value!=null&&!H.value)&&pn(),U.value&&(N.value||!I.value.show||R.value!=null&&!z.value)&&Q(),j.value!=null&&!qn.value.some(e=>e.id===j.value&&e.type===M.value)&&$n(),mn()},{deep:!0,flush:`post`});function hn(e){if(!(B.value||U.value))return;let t=ut.value;if(t&&t.contains(e.target))return;let n=at.value;if(n&&n.contains(e.target))return;let r=W.value;if(r&&r.contains(e.target)){let t=e.target.closest(`.vue-ui-dag-node`),n=e.target.closest(`.vue-ui-dag-edge-midpoint`);if(t||n)return}pn(),Q(),Xe.value||$n()}function gn(e){e.key===`Escape`&&(B.value&&pn(),U.value&&Q())}Ne(()=>{document.addEventListener(`mousedown`,hn),document.addEventListener(`keydown`,gn),window.addEventListener(`scroll`,mn,!0),window.addEventListener(`resize`,mn)}),Me(()=>{Ye=!0,document.removeEventListener(`mousedown`,hn),document.removeEventListener(`keydown`,gn),window.removeEventListener(`scroll`,mn,!0),window.removeEventListener(`resize`,mn),Je?.disconnect(),A!==null&&cancelAnimationFrame(A),X(),clearTimeout(kn)});function _n(){if(A=null,Ye||!P.value.responsive||!O.value?.parentNode)return;let{width:e,height:t}=de({chart:O.value,title:L.value.title.text?Ue.value:null,legend:L.value.controls.show?Ge.value?.$el:null,source:We.value});nt.value=Math.max(.1,e),rt.value=Math.max(.1,t-12)}function vn(){!Ye&&P.value.responsive&&A===null&&(A=requestAnimationFrame(_n))}function yn(){Je?.disconnect(),Je=null,A!==null&&cancelAnimationFrame(A),A=null,Ye||(P.value.responsive?O.value?.parentNode&&(Je=new ResizeObserver(vn),Je.observe(O.value.parentNode),vn()):(nt.value=L.value.width,rt.value=L.value.height))}function bn(e,{direction:t=-1,dasharray:n}={}){if(!e||typeof e.getTotalLength!=`function`)return bt.value&&console.warn(`VueUiDag @getIdealDashoffsetDelta: invalid path element`,e),0;let r=e.getTotalLength(),i=String(n??``).trim().split(/[\s,]+/).map(e=>Number.parseFloat(e)).filter(Number.isFinite),a=i.reduce((e,t)=>e+t,0)*(i.length%2?2:1);return t*(a>0&&Number.isFinite(a)?Math.max(1,Math.round(r/a))*a:r)}let xn=C(/* @__PURE__ */ new Map),Sn=C(/* @__PURE__ */ new Map);function Cn(e){return function(t){t?xn.value.set(e,t):xn.value.delete(e)}}function wn(){Sn.value.forEach(e=>{try{e.cancel()}catch{}}),Sn.value.clear()}function Tn(){if(wn(),Ye)return;let e=q.value?.edges??[];if(!e.length)return;let t=et.value.animations,n=Number(t.referenceDistance)>0?Number(t.referenceDistance):24;e.forEach(e=>{let r=Fn.value.get(e.id)?.animated,i=xn.value.get(e.id);if(!i||typeof i.animate!=`function`)return;if(!r){i.style.strokeDasharray=`0`,i.style.strokeDashoffset=`0`;return}let a=e?.original?.dasharray??t.dasharray;i.style.strokeDasharray=String(a),i.style.strokeDashoffset=`0`;let o=![void 0,null].includes(e?.original?.animationDirection),s=![void 0,null].includes(t.animationDirection),c=bn(i,{direction:o?Number(e.original.animationDirection):s?Number(t.animationDirection):-1,dasharray:String(a)}),l=e?.original?.animationDurationMs??t.animationDurationMs??1e3,u=Number(l),d=Number.isFinite(u)&&u>0?n/u:n/1e3,f=Math.max(1,Math.round(Math.abs(c)/Math.max(1e-9,d))),p=i.animate([{strokeDashoffset:0},{strokeDashoffset:c}],{duration:f,iterations:1/0,easing:`linear`});Sn.value.set(e.id,p)})}Me(()=>{wn()});async function En({scale:e=2}={}){if(!O.value)return;let{width:t,height:n}=O.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await fe({domElement:O.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:L.value.title.text??`vue-ui-dag`,width:t,height:n,aspectRatio:r}}let Dn=_(()=>{let e=Number(L.value.layout.nodeHeight);return Number.isFinite(e)&&e>0?e/L.value.backgroundPattern.spacingRatio:12}),On=_(()=>Dn.value*(L.value.backgroundPattern.dotRadiusRatio/100)),$=C(null),kn=null,An=0;function jn(e){kn&&=(clearTimeout(kn),null),$.value!==e&&($.value=e)}function Mn(e){un.value=null,jn(e)}async function Nn(e){$.value=null,await dn(e)}function Pn(e){let t=++An;kn&&clearTimeout(kn),kn=setTimeout(()=>{t===An&&$.value===e&&($.value=null)},20)}let Fn=_(()=>new Map((q.value?.edges||[]).map(e=>{let t=$.value!=null&&String(e.from)===String($.value),n=$.value!=null&&String(e.to)===String($.value),r=un.value===e.id||z.value?.id===e.id||M.value===`midpoint`&&j.value===e.id,i=e.original.color??et.value.stroke;return r&&I.value.selectedEdge.stroke!=null?i=I.value.selectedEdge.stroke:t&&F.value.selected.downstreamEdges.stroke!=null?i=F.value.selected.downstreamEdges.stroke:n&&F.value.selected.upstreamEdges.stroke!=null&&(i=F.value.selected.upstreamEdges.stroke),[e.id,{stroke:i,active:r,width:et.value.strokeWidth*(r||t?2:1),animated:!!e.original.animated||r&&I.value.selectedEdge.animated===!0||t&&F.value.selected.downstreamEdges.animated===!0||n&&F.value.selected.upstreamEdges.animated===!0}]})));E([Fn,()=>et.value.animations,()=>q.value?.edges],Tn,{deep:!0,flush:`post`}),Ne(Tn);function In(e){let t=Fn.value.get(e.id);return{d:e.pathData,fill:`none`,stroke:t.stroke,"stroke-width":t.width,"stroke-linecap":`round`,"stroke-linejoin":`round`}}function Ln(e){return M.value===`node`&&j.value===e}function Rn(e){let t=$.value===e.id,n=M.value===`node`&&j.value===e.id,r=t||n,i=r&&F.value.selected.backgroundColor!=null?F.value.selected.backgroundColor:e.original.backgroundColor,a=r&&F.value.selected.stroke!=null?F.value.selected.stroke:F.value.stroke,o=r&&F.value.selected.strokeWidth!=null?F.value.selected.strokeWidth:F.value.strokeWidth;return{x:e.x-e.width/2,y:e.y-e.height/2,width:e.width,height:e.height,rx:F.value.borderRadius,fill:i,stroke:a,"stroke-width":o}}function zn(e){let t=Fn.value.get(e.id),n=M.value===`midpoint`&&j.value===e.id;return{cx:e.midpoint?.x,cy:e.midpoint?.y,r:I.value.radius,fill:n?I.value.selectedEdge.stroke??I.value.fill:I.value.fill,stroke:t.stroke,"stroke-width":t.width}}function Bn(e){return Fn.value.get(e.id).stroke}let Vn=_(()=>{let e=q.value?.arrowSize||0;return q.value?.arrowShape===`normal`?`M 0 0 L ${e} ${e/2} L 0 ${e} Z`:`M 0 0 L ${e} ${e/2} L 0 ${e} L ${e/3} ${e/2} Z`});function Hn(e){return`${It}-${String(e).replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function Un(){return q.value}async function Wn(){He(`copyAlt`,{config:P.value,dataset:vt.value}),P.value.userOptions.callbacks.altCopy?await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:vt.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Gn=_(()=>(q.value?.nodes??[]).map(e=>({id:e.id,type:`node`,x:e.x,y:e.y,label:e.label??e.id,raw:e}))),Kn=_(()=>I.value.show?(q.value?.edges??[]).filter(e=>e?.midpoint).map(e=>({id:e.id,type:`midpoint`,x:e.midpoint.x,y:e.midpoint.y,label:`${J(e.from)?.label??e.from} → ${J(e.to)?.label??e.to}`,raw:e})):[]),qn=_(()=>[...Gn.value,...Kn.value].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)),Jn=_(()=>{let e=q.value?.nodes??[],t=q.value?.edges??[],n=[P.value.a11y?.translations?.node??`Node`,P.value.a11y?.translations?.parents??`Parents`,P.value.a11y?.translations?.children??`Children`],r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map;for(let e of t){let t=String(e.from),n=String(e.to);r.has(n)||r.set(n,[]),i.has(t)||i.set(t,[]),r.get(n).push(J(e.from)?.label??e.from),i.get(t).push(J(e.to)?.label??e.to)}return{headers:n,rows:e.map(e=>[e.label??e.id,r.get(String(e.id))?.join(`, `)||`—`,i.get(String(e.id))?.join(`, `)||`—`])}});function Yn(e){return`${e.type}:${e.id}`}function Xn(){return j.value==null||M.value==null?null:qn.value.find(e=>e.id===j.value&&e.type===M.value)??null}async function Zn(e){e&&(e.type===`node`?Q():e.type===`midpoint`&&(pn(),await dn(e.raw)))}function Qn(e){e&&(j.value=e.id,M.value=e.type,e.type===`node`?(jn(e.id),un.value=null):e.type===`midpoint`&&($.value=null,un.value=e.id))}function $n(){j.value=null,M.value=null,B.value||($.value=null),U.value||(un.value=null)}function er(){Xe.value=!0,$n()}function tr(){Xe.value=!1,pn(),Q(),$n()}function rr(e,t,n){let r=t.x-e.x,i=t.y-e.y;return n===`right`&&r<=0||n===`left`&&r>=0||n===`down`&&i<=0||n===`up`&&i>=0?1/0:n===`right`||n===`left`?Math.abs(r)*1e3+Math.abs(i):Math.abs(i)*1e3+Math.abs(r)}function Ir(e,t){let n=qn.value.filter(t=>Yn(t)!==Yn(e));if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=rr(e,n,t);a<i&&(i=a,r=n)}),r||(t===`right`||t===`down`?qn.value[0]??null:qn.value[qn.value.length-1]??null)}async function Lr(e){e&&e.type===`node`&&(Q(),await fn(e.raw))}async function Rr(e){if(!W.value||pt.value||document.activeElement!==W.value||!qn.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){pn(),Q(),$n();return}let s=Xn();if(a){if(!s)return;s.type===`node`&&await Lr(s);return}if(!s){let e=qn.value[0];if(!e)return;Qn(e),await Zn(e);return}let c=null;n?c=Ir(s,`right`):t?c=Ir(s,`left`):i?c=Ir(s,`down`):r&&(c=Ir(s,`up`)),c&&(pn(),Q(),Qn(c),await Zn(c))}d({getData:Un,getImage:En,generatePdf:St,generateSvg:Ot,generateImage:Ct,toggleAnnotator:nn,toggleFullscreen:tn,zoomIn:rn,zoomOut:an,resetZoom:Jt,switchDirection:sn,copyAlt:Wn,focusOnNode:Yt});let zr=_(()=>s(P.value.userOptions?.annotator?.followZoom,Y.value));return(e,s)=>(S(),b(`div`,{class:ke(`vue-data-ui-component vue-ui-dag ${Z.value?`vue-data-ui-wrapper-fullscreen`:``} ${P.value.responsive?`vue-ui-dag-responsive`:``}`),id:`dag_${k.value}`,ref_key:`dagChart`,ref:O,style:je({fontFamily:P.value.style.fontFamily,backgroundColor:L.value.backgroundColor,padding:`0.5rem`}),onMouseenter:At,onMouseleave:jt},[x(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[x(`p`,null,Fe(P.value.a11y.translations.keyboardNavigation),1)],8,ar),P.value.a11y.includeTable&&Jn.value?.rows?.length?(S(),v(ge,{key:0,uid:k.value,head:Jn.value.headers,body:Jn.value.rows,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):y(``,!0),T(Ft)?(S(),b(`div`,or,Fe(String(T(Ft))),1)):y(``,!0),P.value.userOptions.buttons.annotator?(S(),v(T(Ie),De({key:2},T(a)(P.value.userOptions.annotator),{svgRef:T(W),followZoom:P.value.userOptions?.annotator?.followZoom,annotationViewport:zr.value,backgroundColor:L.value.backgroundColor,color:L.value.color,active:pt.value,isCursorPointer:tt.value,palette:P.value.userOptions.annotatorPalette,onClose:nn}),Se({_:2},[Pe(T(o),t=>({name:t,fn:Le(n=>[w(e.$slots,t,Ae(Ee(T(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):y(``,!0),P.value.userOptions.show&&Qe.value&&(T(gt)||T(mt))?(S(),v(T(ze),De({key:`user_option_${qe.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isPrinting:T(K),isImaging:T(xt),uid:k.value,hasTooltip:!1,hasTable:!1,hasXls:!1,hasLabel:!1,isFullscreen:Z.value,chartElement:O.value},T(n)(P.value.userOptions,`pdf img svg fullscreen altCopy annotator zoom`),{isAnnotation:pt.value,isZoom:Vt.value,isCursorPointer:tt.value,onToggleFullscreen:tn,onGeneratePdf:T(St),onGenerateImage:T(kt),onGenerateSvg:T(Ot),onToggleAnnotator:nn,onToggleZoom:Xt,onCopyAlt:Wn,style:{visibility:T(gt)?T(mt)?`visible`:`hidden`:`visible`}}),Se({_:2},[Pe(T(t)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Le(n=>[w(e.$slots,t,Ae(Ee(T(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):y(``,!0),L.value.title.text?(S(),b(`div`,{key:4,ref_key:`chartTitle`,ref:Ue,style:`width:100%;background:transparent;`},[(S(),v(pe,{key:`title_${Ke.value}`,config:{title:{cy:`dag-title`,...L.value.title},subtitle:{cy:`dag-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):y(``,!0),L.value.controls.position===`top`&&!N.value&&L.value.controls.show?(S(),v(_e,{key:5,ref_key:`zoomControls`,ref:Ge,config:P.value,scale:T(Wt),isFullscreen:Z.value,withDirection:``,onZoomIn:rn,onZoomOut:an,onResetZoom:s[0]||=()=>Jt(!0),onSwitchDirection:sn},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),x(`div`,sr,[q.value?(S(),b(`svg`,{key:0,ref_key:`svgRef`,ref:W,class:ke({"vue-ui-dag-svg":!0,"vue-data-ui-loading":N.value}),viewBox:Qt.value,xmlns:T(ee),style:je({backgroundColor:L.value.backgroundColor,height:`100%`,width:`100%`}),tabindex:`0`,"aria-describedby":`chart-instructions-${k.value}`,onMousedown:X,onTouchstart:X,onFocus:er,onBlur:tr,onKeydown:Rr},[we(T(Be)),w(e.$slots,`svg-underlayer`,{svg:{drawingArea:T(Y),data:q.value,orientation:G.value,isPrintingImg:T(K)||T(xt)||T(Et),isPrintingSvg:T(Dt)}},void 0,!0),L.value.backgroundPattern.show?(S(),b(`defs`,lr,[x(`pattern`,{id:`dag_bg_pattern_${k.value}`,patternUnits:`userSpaceOnUse`,width:Dn.value,height:Dn.value},[w(e.$slots,`background-pattern`,Ae(Ee({x:Dn.value/2,y:Dn.value/2,color:L.value.backgroundPattern.dotColor})),()=>[x(`circle`,{cx:Dn.value/2,cy:Dn.value/2,r:On.value,fill:L.value.backgroundPattern.dotColor},null,8,dr)],!0)],8,ur)])):y(``,!0),L.value.backgroundPattern.show?(S(),b(`rect`,{key:1,x:en.value?.x??0,y:en.value?.y??0,width:en.value?.width??0,height:en.value?.height??0,fill:`url(#dag_bg_pattern_${k.value})`,style:je({pointerEvents:`none`,opacity:L.value.backgroundPattern.opacity})},null,12,fr)):y(``,!0),q.value.arrowShape===`undirected`?y(``,!0):(S(),b(`defs`,pr,[(S(!0),b(ye,null,Pe(q.value.edges,e=>(S(),b(`marker`,{key:`marker_${e.id}`,id:Hn(e.id),markerWidth:q.value.arrowSize,markerHeight:q.value.arrowSize,refX:q.value.arrowSize-3,refY:q.value.arrowSize/2,orient:`auto`,markerUnits:`strokeWidth`},[x(`path`,{d:Vn.value,fill:Bn(e),stroke:Bn(e),"stroke-width":`0`,style:{transition:`stroke 0.2s ease-in-out,
|
|
2
|
+
fill 0.2s ease-in-out,
|
|
3
|
+
stroke-width 0.2s ease-in-out`}},null,8,hr)],8,mr))),128))])),x(`g`,gr,[(S(!0),b(ye,null,Pe(q.value.edges,e=>(S(),b(ye,{key:e.id},[x(`path`,De({"data-cy-edge":``,ref_for:!0,ref:Cn(e.id)},{ref_for:!0},In(e),{style:{"pointer-events":`none`,transition:`stroke-width 0.2s ease-in-out,
|
|
4
|
+
stroke 0.2s ease-in-out`}}),null,16),I.value.show?(S(),b(`circle`,De({key:0,"data-cy-midpoint":``,class:`vue-ui-dag-edge-midpoint`,"data-a11y-midpoint-id":e.id},{ref_for:!0},zn(e),{"aria-label":`${J(e.from)?.label??e.from} to ${J(e.to)?.label??e.to}`,style:{transition:`stroke-width 0.2s ease-in-out,
|
|
5
|
+
stroke 0.2s ease-in-out,
|
|
6
|
+
fill 0.2s ease-in-out`},onMouseenter:t=>Nn(e),onMouseleave:Q}),null,16,_r)):y(``,!0)],64))),128))]),x(`g`,vr,[(S(!0),b(ye,null,Pe(q.value.nodes,t=>(S(),b(`g`,{key:t.id,class:`vue-ui-dag-node`,onClick:Re(e=>F.value.tooltip.showOnClick&&fn(t),[`stop`]),onMouseenter:e=>Mn(t.id),onMouseleave:e=>Pn(t.id)},[e.$slots.node?y(``,!0):(S(),b(`rect`,De({key:0,"data-cy-node":``},{ref_for:!0},Rn(t),{"data-a11y-node-id":t.id,"aria-label":`${t.label??t.id}`,style:{cursor:F.value.tooltip.showOnClick&&tt.value?`pointer`:`default`,transition:`stroke 0.2s ease-in-out, stroke-width 0.2s ease-in-out, fill 0.2s ease-in-out`}}),null,16,br)),e.$slots.node?(S(),b(`foreignObject`,{key:1,x:t.x-t.width/2,y:t.y-t.height/2,width:t.width,height:t.height,style:{overflow:`visible`}},[w(e.$slots,`node`,De({ref_for:!0},{node:t,orientation:G.value}),void 0,!0)],8,xr)):y(``,!0)],40,yr))),128))]),x(`g`,Sr,[(S(!0),b(ye,null,Pe(q.value.edges,e=>(S(),b(`path`,{key:e.id,d:e.pathData,fill:`none`,stroke:`transparent`,"stroke-width":et.value.strokeWidth*(e.from===$.value||e.id===z.value?.id?1.3:1),"stroke-linecap":`round`,"stroke-linejoin":`round`,"marker-end":q.value.arrowShape===`undirected`?null:`url(#${Hn(e.id)})`,style:{"pointer-events":`none`,transition:`stroke-width 0.2s ease-in-out,
|
|
7
|
+
stroke 0.2s ease-in-out`}},null,8,Cr))),128))]),x(`g`,wr,[(S(!0),b(ye,null,Pe(q.value.nodes,t=>(S(),b(`g`,{key:t.id,onClick:Re(e=>F.value.tooltip.showOnClick&&fn(t),[`stop`]),onMouseenter:e=>jn(t.id),onMouseleave:e=>Pn(t.id)},[e.$slots[`free-node-label`]?y(``,!0):(S(),b(ye,{key:0},[e.$slots[`node-label`]?(S(),b(`text`,{key:0,x:t.x,y:t.y+F.value.labels.fontSize/3,"text-anchor":`middle`,"font-size":F.value.labels.fontSize,fill:$.value===t.id&&F.value.selected.labelColor!=null?F.value.selected.labelColor:t.original.color,"font-weight":F.value.labels.bold?`bold`:`normal`,style:{transition:`fill 0.2s ease-in-out`}},[w(e.$slots,`node-label`,De({ref_for:!0},{node:t,orientation:G.value}),()=>[Ce(Fe(t.label),1)],!0)],8,Er)):!e.$slots[`free-node-label`]&&!e.$slots.node?(S(),b(`text`,{key:1,"data-cy-node-label":``,x:t.x,y:t.y+F.value.labels.fontSize/3,"text-anchor":`middle`,"font-size":F.value.labels.fontSize,fill:($.value===t.id||Ln(t.id))&&F.value.selected.labelColor!=null?F.value.selected.labelColor:t.original.color,"font-weight":F.value.labels.bold?`bold`:`normal`,style:{transition:`fill 0.2s ease-in-out`},innerHTML:T(p)({content:t.label,fontSize:F.value.labels.fontSize,fontWeight:L.value.nodes.labels.bold?`bold`:`normal`,fill:($.value===t.id||Ln(t.id))&&F.value.selected.labelColor!=null?F.value.selected.labelColor:t.original.color,x:t.x,y:t.y,autoOffset:!0})},null,8,Dr)):y(``,!0)],64)),e.$slots[`free-node-label`]?(S(),b(`g`,Or,[w(e.$slots,`free-node-label`,De({ref_for:!0},{node:t,layoutData:q.value,orientation:G.value}),void 0,!0)])):y(``,!0)],40,Tr))),128))]),w(e.$slots,`svg`,{svg:{drawingArea:T(Y),data:q.value,orientation:G.value,isPrintingImg:T(K)||T(xt)||T(Et),isPrintingSvg:T(Dt)}},void 0,!0)],46,cr)):y(``,!0),e.$slots.hint?(S(),b(`div`,kr,[w(e.$slots,`hint`,Ae(Ee({hint:P.value.a11y.translations.keyboardNavigation,isVisible:Xe.value})),void 0,!0)])):y(``,!0)]),e.$slots.watermark?(S(),b(`div`,Ar,[w(e.$slots,`watermark`,Ae(Ee({isPrinting:T(K)||T(xt)||T(Et)||T(Dt)})),void 0,!0)])):y(``,!0),we(xe,{name:`fade`},{default:Le(()=>[U.value?(S(),v(be,{key:0,to:Z.value?O.value:`body`},[x(`div`,{"data-cy-tooltip-midpoint":``,ref_key:`tooltipRef`,ref:at,class:`vue-ui-dag-tooltip`,style:je({...ot.value,maxWidth:I.value.tooltip.maxWidth,"--vue-data-ui-dag-tooltip-background":I.value.tooltip.backgroundColor,"--vue-data-ui-dag-tooltip-color":I.value.tooltip.color}),"data-position":st.value},[w(e.$slots,`tooltip-midpoint`,Ae(Ee({edge:z.value,layoutData:q.value})),()=>[z.value?(S(),b(`div`,Mr,Fe(J(z.value.from)?.label??z.value.from)+` → `+Fe(J(z.value.to)?.label??z.value.to),1)):y(``,!0)],!0)],12,jr)],8,[`to`])):y(``,!0)]),_:3}),we(xe,{name:`fade`},{default:Le(()=>[B.value?(S(),v(be,{key:0,to:Z.value?O.value:`body`},[x(`div`,{"data-cy-tooltip-node":``,ref_key:`nodeTooltipRef`,ref:ut,class:`vue-ui-dag-node-tooltip`,style:je({maxWidth:F.value.tooltip.maxWidth,left:dt.value.left,top:dt.value.top,"--vue-data-ui-dag-node-tooltip-background":F.value.tooltip.backgroundColor,"--vue-data-ui-dag-node-tooltip-color":F.value.tooltip.color}),"data-position":ft.value},[w(e.$slots,`tooltip-node`,Ae(Ee({node:H.value,layoutData:q.value})),()=>[H.value?(S(),b(`div`,Pr,Fe(H.value.label),1)):y(``,!0)],!0)],12,Nr)],8,[`to`])):y(``,!0)]),_:3}),L.value.controls.position===`bottom`&&!N.value&&L.value.controls.show?(S(),v(_e,{key:7,ref_key:`zoomControls`,ref:Ge,config:P.value,scale:T(Wt),isFullscreen:Z.value,withDirection:``,onZoomIn:rn,onZoomOut:an,onResetZoom:s[1]||=()=>Jt(!0),onSwitchDirection:sn},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),e.$slots.source?(S(),b(`div`,{key:8,ref_key:`source`,ref:We,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):y(``,!0),w(e.$slots,`skeleton`,{},()=>[N.value?(S(),v(he,{key:0})):y(``,!0)],!0)],46,ir))}},[[`__scopeId`,`data-v-745d7374`]]);export{rr as n,Ir as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{n as c,t as l}from"./useHints-C-TwxM0Y.js";import{t as ee}from"./useConfig-CBXrYhMI.js";import{X as te}from"./lib-rPeBMZrn.js";import{t as ne}from"./usePrinter-DVf3YcG5.js";import{t as re}from"./UserOptions-K1N7zQRx.js";import{n as ie}from"./PenAndPaper-BV5ODysA.js";import{t as u}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as d,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as ae,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as y,normalizeClass as b,normalizeProps as oe,normalizeStyle as x,onBeforeUnmount as se,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as ce,shallowReactive as le,shallowRef as E,toRaw as ue,unref as D,useCssVars as de,watch as O,withCtx as fe,withModifiers as pe}from"vue";var me=/* @__PURE__ */ e({default:()=>k}),he=[`id`],ge=[`onPointerdown`],_e=[`onPointerdown`],k=/*#__PURE__*/ u({__name:`vue-ui-dashboard`,props:{dataset:{type:Array,default:()=>[]},config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:u,emit:me}){de(e=>({v1f8a1d55:je.value,v4502d4a5:Me.value}));let k={VueDataUi:_(()=>import(`./vue-data-ui-CMig_4IZ.js`).then(e=>e.n)),VueUi3dBar:_(()=>import(`./vue-ui-3d-bar-BXDDF5Hq.js`).then(e=>e.n)),VueUiAccordion:_(()=>import(`./vue-ui-accordion-CV2dxsXB.js`).then(e=>e.n)),VueUiAgePyramid:_(()=>import(`./vue-ui-age-pyramid-BDoFrY4Y.js`).then(e=>e.n)),VueUiAnnotator:_(()=>import(`./vue-ui-annotator-DBItXQjx.js`).then(e=>e.n)),VueUiCandlestick:_(()=>import(`./vue-ui-candlestick-fQbKxfp6.js`).then(e=>e.n)),VueUiChestnut:_(()=>import(`./vue-ui-chestnut-D7bO1IIi.js`).then(e=>e.n)),VueUiDigits:_(()=>import(`./vue-ui-digits-CVpi-dBr.js`).then(e=>e.n)),VueUiDonut:_(()=>import(`./vue-ui-donut-BJumteL7.js`).then(e=>e.n)),VueUiDonutEvolution:_(()=>import(`./vue-ui-donut-evolution-DNY_zpSw.js`).then(e=>e.n)),VueUiDumbbell:_(()=>import(`./vue-ui-dumbbell-CT22NxlP.js`).then(e=>e.n)),VueUiFlow:_(()=>import(`./vue-ui-flow-ihpQN8B4.js`).then(e=>e.n)),VueUiGalaxy:_(()=>import(`./vue-ui-galaxy-CDdpiwLH.js`).then(e=>e.n)),VueUiGauge:_(()=>import(`./vue-ui-gauge-Cu6cz42H.js`).then(e=>e.n)),VueUiHeatmap:_(()=>import(`./vue-ui-heatmap-CcWLxTbW.js`).then(e=>e.n)),VueUiKpi:_(()=>import(`./vue-ui-kpi-ZCJekvYX.js`).then(e=>e.n)),VueUiMiniLoader:_(()=>import(`./vue-ui-mini-loader-B15gWQp1.js`).then(e=>e.n)),VueUiMolecule:_(()=>import(`./vue-ui-molecule-H88Xsomv.js`).then(e=>e.n)),VueUiMoodRadar:_(()=>import(`./vue-ui-mood-radar-De_2I7pq.js`).then(e=>e.n)),VueUiNestedDonuts:_(()=>import(`./vue-ui-nested-donuts-DGWgyIoR.js`).then(e=>e.n)),VueUiOnion:_(()=>import(`./vue-ui-onion-QidVWMud.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:_(()=>import(`./vue-ui-parallel-coordinate-plot-DFw19TpK.js`).then(e=>e.n)),VueUiQuadrant:_(()=>import(`./vue-ui-quadrant-CeMOzfdY.js`).then(e=>e.n)),VueUiQuickChart:_(()=>import(`./vue-ui-quick-chart-Tyt1WdUW.js`).then(e=>e.n)),VueUiRadar:_(()=>import(`./vue-ui-radar-C4U7ohC4.js`).then(e=>e.n)),VueUiRating:_(()=>import(`./vue-ui-rating-BbHvfFsG.js`).then(e=>e.n)),VueUiRelationCircle:_(()=>import(`./vue-ui-relation-circle-zoBhpcTB.js`).then(e=>e.n)),VueUiRings:_(()=>import(`./vue-ui-rings-kYvvKGXk.js`).then(e=>e.n)),VueUiScatter:_(()=>import(`./vue-ui-scatter-Bs5NhtfK.js`).then(e=>e.n)),VueUiSkeleton:_(()=>import(`./vue-ui-skeleton-BSM40fOT.js`).then(e=>e.n)),VueUiSmiley:_(()=>import(`./vue-ui-smiley-BvkpUjyE.js`).then(e=>e.n)),VueUiSparkHistogram:_(()=>import(`./vue-ui-sparkhistogram-C9cyazhH.js`).then(e=>e.n)),VueUiSparkStackbar:_(()=>import(`./vue-ui-sparkstackbar-BTEpVODr.js`).then(e=>e.n)),VueUiSparkTrend:_(()=>import(`./vue-ui-spark-trend-DmJHx3aj.js`).then(e=>e.n)),VueUiSparkbar:_(()=>import(`./vue-ui-sparkbar-6wKyKgYy.js`).then(e=>e.n)),VueUiSparkgauge:_(()=>import(`./vue-ui-sparkgauge-BnZZ2zhe.js`).then(e=>e.n)),VueUiSparkline:_(()=>import(`./vue-ui-sparkline-a1e4A-Gl.js`).then(e=>e.n)),VueUiStripPlot:_(()=>import(`./vue-ui-strip-plot-ZCX50Scf.js`).then(e=>e.n)),VueUiTable:_(()=>import(`./vue-ui-table-BRwwKG0f.js`).then(e=>e.n)),VueUiTableHeatmap:_(()=>import(`./vue-ui-table-heatmap-2csQOE2c.js`).then(e=>e.n)),VueUiTableSparkline:_(()=>import(`./vue-ui-table-sparkline-VLptltwn.js`).then(e=>e.n)),VueUiThermometer:_(()=>import(`./vue-ui-thermometer-DUocWNhm.js`).then(e=>e.n)),VueUiTimer:_(()=>import(`./vue-ui-timer-DfFRykEz.js`).then(e=>e.n)),VueUiTiremarks:_(()=>import(`./vue-ui-tiremarks-BBtWpWBE.js`).then(e=>e.n)),VueUiTreemap:_(()=>import(`./vue-ui-treemap-Bz1FshtF.js`).then(e=>e.n)),VueUiVerticalBar:_(()=>import(`./vue-ui-horizontal-bar-D2IV9phG.js`).then(e=>e.n)),VueUiHorizontalBar:_(()=>import(`./vue-ui-horizontal-bar-D2IV9phG.js`).then(e=>e.n)),VueUiWaffle:_(()=>import(`./vue-ui-waffle-C7SVznJl.js`).then(e=>e.n)),VueUiWheel:_(()=>import(`./vue-ui-wheel-BaZ08ojL.js`).then(e=>e.n)),VueUiWordCloud:_(()=>import(`./vue-ui-word-cloud-BOUVu-F2.js`).then(e=>e.n)),VueUiXy:_(()=>import(`./vue-ui-xy-CGuTzofF.js`).then(e=>e.n)),VueUiXyCanvas:_(()=>import(`./vue-ui-xy-canvas-FULC8M7D.js`).then(e=>e.n)),VueUiCarouselTable:_(()=>import(`./vue-ui-carousel-table-DUUhomv3.js`).then(e=>e.n)),VueUiGizmo:_(()=>import(`./vue-ui-gizmo-C-MEb9P1.js`).then(e=>e.n)),VueUiStackbar:_(()=>import(`./vue-ui-stackbar-BplckX2c.js`).then(e=>e.n)),VueUiStackline:_(()=>import(`./vue-ui-stackline-1KSn7Lw-.js`).then(e=>e.n)),VueUiBullet:_(()=>import(`./vue-ui-bullet-iOGIwd8G.js`).then(e=>e.n)),VueUiFunnel:_(()=>import(`./vue-ui-funnel-CydmxKNq.js`).then(e=>e.n)),VueUiHistoryPlot:_(()=>import(`./vue-ui-history-plot-AL9z3mC6.js`).then(e=>e.n)),VueUiCirclePack:_(()=>import(`./vue-ui-circle-pack-C18kRERE.js`).then(e=>e.n)),VueUiWorld:_(()=>import(`./vue-ui-world-E2JfHzRD.js`).then(e=>e.n)),VueUiChord:_(()=>import(`./vue-ui-chord-Cwg9Vjnn.js`).then(e=>e.n)),VueUiRidgeline:_(()=>import(`./vue-ui-ridgeline-C9ECt2cC.js`).then(e=>e.n)),VueUiDag:_(()=>import(`./vue-ui-dag-BMBSp7ua.js`).then(e=>e.n))},{vue_ui_dashboard:ve}=ee(),ye=C(null),A=C(null),j=e,M=f(()=>s({userConfig:j.config,defaultConfig:ve}));c({config:()=>M.value,dataset:()=>j.dataset,component:`VueUiDashboard`,rules:[l.noHint]});let N=f(()=>M.value.userOptions.useCursorPointer),P=C(te()),F=C(M.value.locked);function be(){F.value=!F.value}O(()=>M.value.locked,e=>{F.value=e});let xe=[`left`,`top`,`width`,`height`];function I(e){return Object.fromEntries(xe.map(t=>[t,e[t]]))}function L(e,t){return xe.every(n=>Object.is(e[n],t[n]))}let R=Symbol(`dashboard-item`);function Se(e,t,n=Symbol()){let r={...e,index:t};return Object.defineProperty(r,R,{value:n}),le(r)}let z=E((j.dataset||[]).map((e,t)=>Se(e,t))),B=new Map(z.value.map(e=>[e[R],I(e)]));O(()=>j.dataset,e=>{let t=/* @__PURE__ */ new Map;for(let e of z.value)t.has(e.id)||t.set(e.id,[]),t.get(e.id).push(e);let n=/* @__PURE__ */ new Map,r=!1;z.value=(e||[]).map((e,i)=>{let a=t.get(e.id)?.shift(),o=a?.[R]??Symbol(),s=I(e),c=B.get(o),l=!c||!L(c,s);return n.set(o,s),U.value?.key===o&&l&&(r=!0),Se({...e,...a&&!l?I(a):s},i,o)}),B=n,U.value&&(r||!z.value.some(e=>e[R]===U.value.key))&&Y(!1)},{deep:!0});let V=f(()=>z.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?k[e.component]:ue(e.component)}))),H=C(null),U=E(null),W=f(()=>U.value?z.value.findIndex(e=>e[R]===U.value.key):null),G=me,Ce=[`top-left`,`top-right`,`bottom-left`,`bottom-right`],K=(e,t,n)=>Math.max(t,Math.min(n,e));function we(e){let t=K(Number.isFinite(e.width)?e.width:1,1,100),n=K(Number.isFinite(e.height)?e.height:1,1,100);return{width:t,height:n,left:K(Number.isFinite(e.left)?e.left:0,0,100-t),top:K(Number.isFinite(e.top)?e.top:0,0,100-n)}}function Te(e){return!!e?.closest?.(`input, button, select, textarea, a, [contenteditable]:not([contenteditable="false"]), [role="slider"], .range-handle, [data-dashboard-no-drag]`)}function q(e,t,n=null){if(U.value||F.value||Q.value||t.isPrimary===!1||t.button!=null&&t.button!==0||!n&&Te(t.target))return;let r=z.value[e],i=H.value?.getBoundingClientRect();if(!r||!(i?.width>0&&i.height>0)||!Number.isFinite(t.clientX)||!Number.isFinite(t.clientY))return;let a=I(r),o=we(r);Object.assign(r,o),U.value={key:r[R],direction:n,pointerId:t.pointerId,capture:t.currentTarget,x:t.clientX,y:t.clientY,boardWidth:i.width,boardHeight:i.height,initial:o,before:a},t.preventDefault?.(),t.stopPropagation?.();try{t.currentTarget?.setPointerCapture?.(t.pointerId)}catch{}document.addEventListener(`pointermove`,J,{passive:!1}),document.addEventListener(`pointerup`,Ee),document.addEventListener(`pointercancel`,X)}function J(e){let t=U.value;if(!t||t.pointerId!=null&&e.pointerId!==t.pointerId||!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let n=z.value.find(e=>e[R]===t.key);if(!n){Y(!1);return}e.preventDefault?.();let r=(e.clientX-t.x)/t.boardWidth*100,i=(e.clientY-t.y)/t.boardHeight*100,a=t.initial;if(!t.direction){n.left=K(a.left+r,0,100-a.width),n.top=K(a.top+i,0,100-a.height);return}let o=a.left,s=a.top,c=a.left+a.width,l=a.top+a.height;t.direction.includes(`left`)?o=K(a.left+r,0,c-1):c=K(c+r,o+1,100),t.direction.includes(`top`)?s=K(a.top+i,0,l-1):l=K(l+i,s+1,100),Object.assign(n,{left:o,top:s,width:c-o,height:l-s})}function Y(e=!0){let t=U.value;if(!t)return;U.value=null,document.removeEventListener(`pointermove`,J),document.removeEventListener(`pointerup`,Ee),document.removeEventListener(`pointercancel`,X);try{t.capture?.releasePointerCapture?.(t.pointerId)}catch{}let n=z.value.find(e=>e[R]===t.key);if(!e||!n||L(t.before,I(n)))return;let r=t.initial;if(!t.direction)n.left=K(Math.round(n.left),0,100-n.width),n.top=K(Math.round(n.top),0,100-n.height);else{let e=r.left+r.width,i=r.top+r.height;t.direction.includes(`left`)?(n.left=K(Math.round(n.left),0,e-1),n.width=e-n.left):n.width=K(Math.round(n.left+n.width),n.left+1,100)-n.left,t.direction.includes(`top`)?(n.top=K(Math.round(n.top),0,i-1),n.height=i-n.top):n.height=K(Math.round(n.top+n.height),n.top+1,100)-n.top}L(t.before,I(n))||G(`change`,z.value)}function Ee(e){!U.value||U.value.pointerId!=null&&e.pointerId!==U.value.pointerId||(J(e),Y())}function X(e){(U.value?.pointerId==null||e?.pointerId==null||e.pointerId===U.value.pointerId)&&Y()}O(F,e=>{e&&Y()},{flush:`sync`}),se(()=>Y(!1));let{isPrinting:De,isImaging:Oe,generatePdf:ke,generateImage:Ae}=ne({elementId:`vue-ui-dashboard_${P.value}`,fileName:M.value.userOptions.print.filename||`dashboard`,options:{...M.value.userOptions.print,aspectRatio:M.value.style.board.aspectRatio}}),je=f(()=>M.value.style.item.borderColor),Me=f(()=>M.value.style.resizeHandles.backgroundColor),Ne=f(()=>M.value.style.board.aspectRatio),Pe=f(()=>M.value.style.board.backgroundColor),Fe=f(()=>M.value.style.board.border);function Ie(){return z.value}let Z=C(!1),Le=f(()=>!M.value.userOptions.showOnChartHover||Z.value),Re=f(()=>M.value.userOptions.keepStateOnChartLeave),ze=f(()=>(M.value.allowPrint||M.value.userOptions.show)&&[`pdf`,`img`,`annotator`,`altCopy`].some(e=>M.value.userOptions.buttons[e])),Q=C(!1);function $(){Q.value=!Q.value}O(Q,e=>{e&&Y()},{flush:`sync`});async function Be(){G(`copyAlt`,{config:M.value,dataset:V.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:V.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return u({generatePdf:ke,getItemsPositions:Ie,toggleLock:be,copyAlt:Be}),(e,s)=>(S(),h(`div`,{id:`vue-ui-dashboard_${P.value}`,onMouseenter:s[0]||=e=>Z.value=!0,onMouseleave:s[1]||=e=>Z.value=!1,ref_key:`dashboardRef`,ref:ye,style:{position:`relative`},class:`vue-data-ui-component`},[g(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:H,style:x(`outline:${Fe.value}; background:${Pe.value}; aspect-ratio:${Ne.value};${Q.value?`pointer-events:none`:``}`)},[g(`div`,{class:`vue-ui-dashboard-grid-container`,style:x(`background:${M.value.style.board.backgroundColor}`)},[s[2]||=g(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(S(!0),h(d,null,w(V.value,(t,n)=>(S(),h(`div`,{key:z.value[n][D(R)],class:b({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":F.value}),style:x({width:`${t.width}%`,height:`${t.height}%`,left:`${t.left}%`,top:`${t.top}%`,cursor:`move`,boxShadow:W.value===n?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:W.value===n?V.value.length+1:t.index,backgroundColor:M.value.style.item.backgroundColor}),onPointerdown:e=>q(n,e),onLostpointercapture:X},[F.value?m(``,!0):(S(),h(d,{key:0},w(Ce,e=>g(`div`,{key:e,class:b(`vue-ui-dashboard-resize-handle vue-ui-dashboard-${e}`),onPointerdown:pe(t=>q(n,t,e),[`stop`])},null,42,_e)),64)),T(e.$slots,`top`,{item:t,index:n},void 0,!0),t.resolvedComponent?(S(),p(ce(t.resolvedComponent),y({key:1,ref_for:!0},t.props),null,16)):T(e.$slots,`content`,{item:t,index:n,left:t.left,top:t.top,height:t.height,width:t.width},void 0,!0,2),T(e.$slots,`bottom`,{item:t,index:n},void 0,!0)],46,ge))),128))],4)],4),(S(),h(`svg`,{style:x({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:V.value.length+1}),ref_key:`svgRef`,ref:A},null,4)),M.value.userOptions.buttons.annotator&&H.value&&A.value?(S(),p(ie,y({key:0},D(a)(M.value.userOptions.annotator),{color:M.value.style.board.color,backgroundColor:M.value.style.board.backgroundColor,active:Q.value,svgRef:A.value,isCursorPointer:N.value,onClose:$,style:{zIndex:V.value.length+1},palette:M.value.userOptions.annotatorPalette}),ae({_:2},[w(D(o),t=>({name:t,fn:fe(n=>[T(e.$slots,t,oe(v(D(i)(t,n))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):m(``,!0),ze.value&&(Re.value||Le.value)?(S(),p(re,y({key:1,backgroundColor:M.value.style.board.backgroundColor,color:M.value.style.board.color,isPrinting:D(De),isImaging:D(Oe),uid:P.value},D(n)(M.value.userOptions,`pdf img altCopy annotator`),{hasTooltip:!1,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,chartElement:H.value,isAnnotation:Q.value,isCursorPointer:N.value,onGeneratePdf:D(ke),onGenerateImage:D(Ae),onToggleAnnotator:$,onCopyAlt:Be,style:{visibility:Re.value?Le.value?`visible`:`hidden`:`visible`,zIndex:V.value.length+1}}),ae({_:2},[w(D(t)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:fe(n=>[T(e.$slots,t,oe(v(D(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):m(``,!0)],40,he))}},[[`__scopeId`,`data-v-d54ac99e`]]);export{me as n,k as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-DnGoh-XS.js";import{X as n,t as r}from"./lib-rPeBMZrn.js";import{n as i,t as a}from"./useHints-C-TwxM0Y.js";import{t as o}from"./useConfig-CBXrYhMI.js";import{n as s}from"./PackageVersion-BbZ3wNGs.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createVNode as h,normalizeStyle as g,openBlock as _,renderList as v,toDisplayString as y,unref as b}from"vue";var x={key:0},S=[`d`,`fill`],C={key:1},w=[`cx`,`cy`,`r`,`fill`],T=26,E=2,D=-2,O=28,k=2,A=32,j=30,M=60,N=-8,P=2,F={__name:`Digit`,props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:`#e1e5e8`},color:{type:String,default:`#000000`},x:{type:Number,default:0},y:{type:Number,default:0},thickness:{type:Number,default:1}},setup(e){let t=e,n={0:`1111110`,1:`0110000`,2:`1101101`,3:`1111001`,4:`0110011`,5:`1011011`,6:`1011111`,7:`1110000`,8:`1111111`,9:`1111011`,"-":`0000001`,X:`0000000`},r=u(()=>E*(t.thickness||1)),i=u(()=>Object.hasOwn(n,t.quanta)?n[t.quanta]:n.X);function a(e,t,n,r=!1){return r?`M ${e} ${t} L ${e+n} ${t-n} L ${e+T-n} ${t-n} L ${e+T} ${t} L ${e+T-n} ${t+n} L ${e+n} ${t+n} Z`:`M ${e+n} ${t-n} L ${e} ${t} L ${e+n} ${t+n} L ${e+T-n} ${t+n} L ${e+T} ${t} L ${e+T-n} ${t-n} L ${e+n} ${t-n}`}function o(e,t,n,r=!1){let i=r?-1:1,a=e-i*n,o=e+i*n;return`M ${a} ${t+T-n} L ${a} ${t+n} L ${e} ${t} L ${o} ${t+n} L ${o} ${t+T-n} L ${e} ${t+T} L ${a} ${t+T-n}`}let s=u(()=>{let{x:e,y:n}=t,i=r.value;return[{name:`a`,d:a(e,n,i,!0)},{name:`b`,d:o(e+O,n+k,i)},{name:`c`,d:o(e+O,n+A,i)},{name:`d`,d:a(e,n+M,i)},{name:`e`,d:o(e+D,n+A,i,!0)},{name:`f`,d:o(e+D,n+k,i,!0)},{name:`g`,d:a(e,n+j,i)}]});return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,x,[(_(!0),p(l,null,v(s.value,(t,n)=>(_(),p(`path`,{key:t.name,d:t.d,fill:i.value[n]===`1`?e.color:e.backgroundColor,stroke:`none`},null,8,S))),128))])),e.quanta==`.`?(_(),p(`g`,C,[m(`circle`,{cx:e.x+N,cy:e.y+M,r:P+r.value/2,fill:e.color},null,8,w)])):f(``,!0)],64))}},I=/* @__PURE__ */ e({default:()=>z}),L=[`id`],R=[`xmlns`,`viewBox`,`aria-describedby`],z=/*#__PURE__*/ c({__name:`vue-ui-digits`,props:{dataset:{type:Number,default:0},config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_digits:c}=o(),f=e,x=u(()=>t({userConfig:f.config,defaultConfig:c}));i({config:()=>x.value,dataset:()=>f.dataset,component:`VueUiDigits`,rules:[a.noHint]});let S=u(()=>{let e=Number.isFinite(f.dataset)?f.dataset:0,t=String(e);if(!t.includes(`e`))return t;let[n,r]=t.split(`e`),i=e<0?`-`:``,[a,o=``]=n.replace(`-`,``).split(`.`),s=a+o,c=a.length+Number(r);return c<=0?`${i}0.${`0`.repeat(-c)}${s}`:c>=s.length?i+s.padEnd(c,`0`):`${i}${s.slice(0,c)}.${s.slice(c)}`}),C=u(()=>{let e=10;return[...S.value].map(t=>{let n={x:e,y:10,quanta:t};return e+=t===`.`?2:44,n})}),w=u(()=>C.value.at(-1).x+36),T=n();return(e,t)=>(_(),p(l,null,[m(`div`,{class:`sr-only`,id:`digit-${b(T)}`},y(S.value),9,L),(_(),p(`svg`,{class:`vue-data-ui-component vue-ui-digits`,xmlns:b(r),viewBox:`0 0 ${w.value} 80`,style:g({background:x.value.backgroundColor,height:x.value.height||void 0,width:x.value.width||void 0}),"aria-describedby":`digit-${b(T)}`},[h(s),(_(!0),p(l,null,v(C.value,e=>(_(),d(F,{x:e.x,y:e.y,quanta:e.quanta,color:x.value.digits.color,backgroundColor:x.value.digits.skeletonColor,thickness:x.value.digits.thickness},null,8,[`x`,`y`,`quanta`,`color`,`backgroundColor`,`thickness`]))),256))],12,R))],64))}},[[`__scopeId`,`data-v-c88c2736`]]);export{I as n,z as t};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as l}from"./chartImage-DPGnEuYM.js";import{$ as u,Bt as ee,D as te,Dt as ne,Ht as d,It as re,Jt as ie,S as f,X as p,Y as ae,Yt as oe,Zt as se,at as ce,b as le,dt as ue,f as m,h as de,i as h,in as fe,it as pe,j as me,nn as he,nt as ge,p as g,s as _e,t as ve,ut as ye,w as be,yt as xe,zt as Se}from"./lib-rPeBMZrn.js";import{n as Ce,t as we}from"./labelUtils-CdtU-yB_.js";import{c as Te}from"./canvas-lib-22VpOI4_.js";import{n as Ee,t as De}from"./useHints-C-TwxM0Y.js";import{t as Oe}from"./useConfig-CBXrYhMI.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{t as Ae}from"./useLoading-BwiplGDB.js";import{t as je}from"./useResponsive-CENUxfEL.js";import{t as Me}from"./useNestedProp-DnGoh-XS.js";import{t as Ne}from"./useThemeCheck-BKNRbGeC.js";import{t as Pe}from"./useChartExport-BZts4KFb.js";import{t as Fe}from"./useUserOptionState-CXlFnwPv.js";import{t as Ie}from"./useChartAccessibility-DOMuYJfm.js";import{t as Le}from"./Shape-CRe8woTu.js";import{n as Re}from"./Title-BliHuXfT.js";import{t as ze}from"./vue_ui_donut-B2W2nyAS.js";import{t as Be}from"./Legend-W9YVYVX-.js";import{t as Ve}from"./BaseScanner-m6QR9rwD.js";import{t as He}from"./A11yDataTable-DWNlWXzs.js";import{t as Ue}from"./BaseLegendToggle-VzX69MCo.js";import{t as We}from"./DefGrad-DKMq1REY.js";import{t as Ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,Teleport as Ke,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as qe,createTextVNode as Je,createVNode as Ye,defineAsyncComponent as Xe,guardReactiveProps as Ze,mergeProps as Qe,nextTick as $e,normalizeClass as et,normalizeProps as tt,normalizeStyle as C,onBeforeUnmount as nt,onMounted as rt,openBlock as w,ref as T,renderList as E,renderSlot as D,resolveDynamicComponent as it,shallowRef as at,toDisplayString as O,toRefs as ot,unref as k,useSlots as st,vShow as ct,watch as lt,withCtx as A,withDirectives as ut}from"vue";function dt(e){let{FINAL_CONFIG:t,noGhostDonut:n,svg:r,padding:i,labels_inline_fontSize:a,minSize:o,findArcMidpoint:s,calcMarkerOffsetX:c,calcMarkerOffsetY:l,animatingIndex:u,segregated:ee,isSmallArc:te}=e;return{smallArcLayoutsClassic:v(()=>{if(t.value.type!==`classic`)return{};let e={},ne=n.value||[];if(!ne.length)return e;let d=r.value.width/2,re=r.value.height/2,ie=i.value.top+16,f=r.value.height-i.value.bottom-16,p=a.value,ae=p/3,oe=p*1.5,se=d-(o.value+6),ce=d+(o.value+6),le=!!t.value.style.chart.layout.curvedMarkers;function ue({midX:e,midY:t,bandX:n,bandY:r}){if(!le)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let i=n<d?-1:1,a=n-e,o=r-t,s=Math.sqrt(a*a+o*o)||1,c=e-d,l=t-re,u=Math.sqrt(c*c+l*l)||1,ee=c/u,te=l/u,ne=u+9;function ie({x:e,y:t}){let n=e-d,r=t-re,i=Math.sqrt(n*n+r*r)||1;if(i>=ne)return{x:e,y:t};let a=ne/i;return{x:d+n*a,y:re+r*a}}if(s<56){let i=a/s,c=-(o/s),l=i,u=(e+n)*.5,ne=(t+r)*.5,f=u+c,p=ne+l,ae=(f-d)*(f-d)+(p-re)*(p-re),oe=u-c,se=ne-l;(oe-d)*(oe-d)+(se-re)*(se-re)>ae&&(c=-c,l=-l);let ce=.78,le=e+a*ce,ue=t+o*ce,m=Math.max(0,Math.min(1,(s-18)/44)),de=m*m*(3-2*m),h=2.5+de*4,fe=1+de*2.5;h*=.9;let pe=ie({x:le+c*h+ee*fe,y:ue+l*h+te*fe});return`M ${e} ${t} Q ${pe.x} ${pe.y} ${n} ${r}`}let f=s*.34;f<20&&(f=20),f>46&&(f=46);let p=s*.46;p<22&&(p=22),p>70&&(p=70);let ae={x:e+ee*f,y:t+te*f},oe=d+i*Math.max(Math.abs(n-d),ne),se={x:n-i*Math.min(p,Math.abs(oe-n)*.75),y:r},ce=ie(ae),ue=ie(se);return`M ${e} ${t} C ${ce.x} ${ce.y} ${ue.x} ${ue.y} ${n} ${r}`}function m(e){let t=String(e??``).split(/\n/g),n=Math.max(0,t.length-1)*(p*1.2);return oe+n}function de({arc:e,index:t}){let{x:n,y:r}=s(e.path);return{arc:e,index:t,midX:n,midY:r,inlineMarkerX:c(e).x,inlineMarkerY:l(e)-3.5,labelHeight:m(e.name)}}function h(e){let{arc:t}=e,n=t.seriesIndex??0;return u.value===n||ee.value.includes(n)?!1:te(t,n)}function fe(e){let t=e.inlineMarkerY<re,n=e.inlineMarkerX<d;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function pe(e,t){t.startsWith(`T`)?e.sort((e,t)=>e.inlineMarkerY-t.inlineMarkerY||e.index-t.index):e.sort((e,t)=>t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function me({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+ae,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function he({candidateList:t,side:n,bandMarkerX:r,startY:i,direction:a}){let o=i;t.forEach(t=>{let{index:i,midX:s,midY:c,labelHeight:l}=t,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let ee=u,te=ue({midX:s,midY:c,bandX:r,bandY:ee});e[i]=me({side:n,markerX:r,markerY:ee,labelY:u,connectorPath:te})})}let ge=ne.map((e,t)=>de({arc:e,index:t})).filter(h),g={TL:[],TR:[],BL:[],BR:[]};return ge.forEach(e=>{g[fe(e)].push(e)}),Object.keys(g).forEach(e=>{pe(g[e],e)}),he({candidateList:g.TL,side:`left`,bandMarkerX:se,startY:ie,direction:`down`}),he({candidateList:g.TR,side:`right`,bandMarkerX:ce,startY:ie,direction:`down`}),g.BL.length>1&&he({candidateList:g.BL,side:`left`,bandMarkerX:se,startY:f,direction:`up`}),g.BR.length>1&&he({candidateList:g.BR,side:`right`,bandMarkerX:ce,startY:f,direction:`up`}),e})}}var ft=/* @__PURE__ */ e({default:()=>Dn}),pt=[`id`],mt=[`id`],ht=[`id`],gt={style:{position:`relative`}},_t=[`xmlns`,`aria-describedby`,`viewBox`],vt=[`width`,`height`],yt={key:1},bt={key:2},xt=[`id`],St=[`id`],Ct=[`id`],wt=[`flood-color`],Tt=[`id`],Et=[`flood-color`],Dt=[`d`,`stroke`,`filter`],Ot=[`d`,`stroke`,`filter`],kt=[`cx`,`cy`,`r`,`fill`,`filter`],At={key:6},jt=[`stroke`,`d`],Mt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Nt={key:0},Pt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Ft={key:0},It=[`stroke`,`d`],Lt={key:0},Rt=[`d`,`stroke`,`stroke-width`,`filter`],zt={key:1},Bt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Vt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Ht={key:1},Ut=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Wt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Gt={key:0},Kt=[`d`,`fill`,`stroke`,`stroke-width`],qt=[`cx`,`cy`,`r`,`stroke`],Jt=[`cx`,`cy`,`r`,`fill`],Yt=[`cx`,`cy`,`r`],Xt={key:0},Zt=[`d`,`stroke`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Qt={key:1},$t=[`cx`,`cy`,`r`],en=[`x`,`y`,`fill`,`font-size`],tn=[`x`,`y`,`fill`,`font-size`],nn=[`x`,`y`,`fill`,`font-size`],rn=[`x`,`y`,`fill`,`font-size`],an=[`filter`,`opacity`],on={key:0},sn=[`x`,`y`],cn={key:1},ln=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],un=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],dn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],fn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],pn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],mn=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],hn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],gn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],_n={key:2},vn=[`x`,`y`,`width`],yn=[`x`,`y`,`width`],bn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},xn={key:5,class:`vue-data-ui-watermark`},Sn=[`id`],Cn=[`onClick`],wn={key:8,class:`vue-ui-donut-hollow`},Tn={key:0},En={key:1},Dn=/*#__PURE__*/ Ge({__name:`vue-ui-donut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Ge,emit:ft}){let Dn=Xe(()=>import(`./Tooltip-B432XpvC.js`)),On=Xe(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),kn=Xe(()=>import(`./vue-ui-accordion-CV2dxsXB.js`).then(e=>e.n)),An=Xe(()=>import(`./DataTable-KeuZB1JM.js`)),jn=Xe(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Mn=Xe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Nn=Xe(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),Pn=Xe(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_donut:Fn}=Oe(),{isThemeValid:In,warnInvalidTheme:Ln}=Ne(),Rn=st(),j=e,zn=v(()=>!!j.dataset?.length),Bn=at(null),Vn=T(null),Hn=T(null),Un=T(null),Wn=at(null),Gn=at(null),Kn=at(null),qn=at(null),Jn=at(null),Yn=at(null),Xn=T(0),Zn=T(0),Qn=T(0),$n=T(!1),er=T(null),tr=T(null),nr=T(null),rr=T({x:0,y:0}),ir=T(`pointer`),ar=T(!1),or=v(()=>P.value.style.chart.layout.labels.percentage.fontSize),sr=v(()=>P.value.style.chart.layout.labels.name.fontSize),cr=v(()=>P.value.style.chart.layout.labels.dataLabels.smallArcClusterFontSize),lr=null,ur=()=>{P.value.autoSize&&lr===null&&(lr=requestAnimationFrame(()=>{lr=null;let e=P.value,t=Vn.value,n=z.value;if(!e.autoSize||!t||!n)return;let[r,i,a,o]=n.getAttribute(`viewBox`).split(` `).map(Number),s={x:r,y:i,width:a,height:o};[{selector:`.vue-data-ui-datalabel-value`,baseSize:F.value.percentage.fontSize,minSize:F.value.percentage.minFontSize},{selector:`.vue-data-ui-datalabel-name`,baseSize:F.value.name.fontSize,minSize:F.value.name.minFontSize},{selector:`.vue-data-ui-datalabel-inline`,baseSize:F.value.dataLabels.smallArcClusterFontSize,minSize:F.value.name.minFontSize}].forEach(({selector:e,baseSize:n,minSize:r})=>{t.querySelectorAll(e).forEach(e=>{_e({el:e,bounds:s,currentFontSize:n,minFontSize:r,attempts:200,padding:1})})})}))};rt(async()=>{$n.value=!0,pr(),ur()});let dr;rt(()=>{Bn.value&&(dr=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){ur();break}}}),dr.observe(Bn.value.parentElement))}),nt(()=>{dr?.disconnect(),cancelAnimationFrame(lr),cancelAnimationFrame(Dr),qr+=1,Kn.value&&(qn.value&&Kn.value.unobserve(qn.value),Kn.value.disconnect())});let fr=v(()=>P.value.debug);function pr(){if(Se(j.dataset)?(ce({componentName:`VueUiDonut`,type:`dataset`,debug:fr.value}),Cr.value=!0):(j.dataset.forEach((e,t)=>{xe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{ce({componentName:`VueUiDonut`,type:`datasetSerieAttribute`,property:e,index:t,debug:fr.value}),Cr.value=!0})}),fr.value&&j.dataset.forEach((e,t)=>{e.name&&e.name!==``||ce({componentName:`VueUiDonut`,type:`datasetAttributeEmpty`,property:`name`,index:t})})),Se(j.dataset)||(Cr.value=P.value.loading),P.value.responsive){let e=Te(()=>{let{width:e,height:t}=je({chart:Bn.value,title:P.value.style.chart.title.text?Wn.value:null,legend:P.value.style.chart.legend.show?Gn.value:null,source:Jn.value,noTitle:Yn.value,padding:P.value.autoSize?void 0:Fr.value});requestAnimationFrame(()=>{V.value.width=e,V.value.height=t,ur()})});Kn.value&&(qn.value&&Kn.value.unobserve(qn.value),Kn.value.disconnect()),Kn.value=new ResizeObserver(e),qn.value=Bn.value.parentNode,Kn.value.observe(qn.value)}}let M=T(p()),mr=T(!1),hr=T(``),N=T(null),gr=T(0);function _r(){let e=Me({userConfig:j.config,defaultConfig:Fn}),t={},n=e.theme;if(!n)t=e;else if(!In.value(e))Ln(e),t=e;else{let r=Me({userConfig:ze[n]||j.config,defaultConfig:e});t={...Me({userConfig:j.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:he[n]||d}}return t}let P=T(_r()),F=v(()=>P.value.style.chart.layout.labels),I=v(()=>P.value.style.chart.layout.donut),vr=v(()=>P.value.style.chart.layout),L=v(()=>P.value.style.chart);Ee({config:()=>P.value,dataset:()=>j.dataset,component:`VueUiDonut`,rules:[De.singleSeries,De.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let yr=v(()=>P.value.userOptions.useCursorPointer),br=v(()=>fe({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1},hollow:{average:{show:!1},total:{show:!1}},value:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:P.value.skeletonConfig??{}})),{loading:xr,FINAL_DATASET:Sr,manualLoading:Cr,skeletonDataset:wr}=Ae({...ot(j),FINAL_CONFIG:P,prepareConfig:_r,skeletonDataset:j.config?.skeletonDataset??[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}],skeletonConfig:fe({defaultConfig:P.value,userConfig:br.value})}),R=T(!0),Tr=T(0),Er=T(!1),Dr=null;function Or(e=1e3){return new Promise(t=>{let n=performance.now();function r(i){let a=i-n,o=Math.min(a/e,1),s=pe(o);Tr.value=s,o<1?Dr=requestAnimationFrame(r):(Tr.value=1,Dr=null,t())}Dr!==null&&cancelAnimationFrame(Dr),Tr.value=0,Dr=requestAnimationFrame(r)})}lt(()=>xr.value,async e=>{if(e||Er.value)return;let t=Sr.value===wr,n=P.value.startAnimation?.show;!t&&n?(Er.value=!0,await Or(P.value.startAnimation.durationMs||1e3)):Tr.value=1,R.value=!1},{immediate:!0});let{userOptionsVisible:kr,setUserOptionsVisibility:Ar,keepUserOptionState:jr}=Fe({config:P.value}),{svgRef:z}=Ie({config:L.value.title});function Mr(){Ar(!0)}function Nr(){Ar(!1)}let Pr=se(j.config);lt(()=>j.config,(e,t)=>{let n=se(e),r=n!==Pr;Pr=n;let i=_r();r?(xr.value||(P.value=i),kr.value=!P.value.userOptions.showOnChartHover,pr(),Xn.value+=1,Zn.value+=1,Qn.value+=1,B.value.dataLabels.show=F.value.dataLabels.show,B.value.showTable=P.value.table.show,B.value.showTooltip=L.value.tooltip.show,V.value.height=L.value.height,V.value.width=L.value.width):(P.value.style.chart.tooltip=i.style.chart.tooltip,B.value.showTooltip=P.value.style.chart.tooltip.show)},{deep:!0});let Fr=v(()=>{let{top:e,right:t,bottom:n,left:r}=L.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}}),{isPrinting:Ir,isImaging:Lr,generatePdf:Rr,generateImage:zr}=ke({elementId:`donut__${M.value}`,fileName:L.value.title.text||`vue-ui-donut`,options:P.value.userOptions.print}),Br=v(()=>P.value.userOptions.show&&!L.value.title.text),Vr=v(()=>be(P.value.customPalette)),B=T({dataLabels:{show:F.value.dataLabels.show},showTable:P.value.table.show,showTooltip:L.value.tooltip.show});lt(P,()=>{B.value={dataLabels:{show:F.value.dataLabels.show},showTable:P.value.table.show,showTooltip:L.value.tooltip.show}},{immediate:!0});let V=T({height:L.value.height,width:L.value.width}),Hr=v(()=>{if(P.value.pie)return W.value;let e=I.value.strokeWidth/512,t=Math.min(V.value.width,V.value.height)*e,n=t>W.value?W.value:t;return Math.max(n,12*(1+e))}),Ur=ft,Wr=v(()=>Sr.value.map((e,t)=>({...e,sourceIndex:t,value:e.values.reduce((e,t)=>e+t,0)}))),H=v(()=>[...Wr.value].sort((e,t)=>P.value.sorted?e.ghost&&!t.ghost?1:t.ghost&&!e.ghost?-1:t.value-e.value:0).map((e,t)=>({name:e.name,sourceIndex:e.sourceIndex,color:f(e.color)||Vr.value[t]||d[t]||d[t%d.length],value:le(e.value),absoluteValues:e.values,comment:e.comment||``,patternIndex:t,seriesIndex:t,ghost:!1,pattern:`pattern_${M.value}_${t}`})));lt(()=>j.dataset,e=>{Array.isArray(e)&&e.length>0&&(Cr.value=!1)},{immediate:!0});let U=T([]),Gr=T(null),Kr=v(()=>Gr.value!==null),qr=0,Jr=null,Yr=at(H.value);lt(()=>H.value,(e,t)=>{let n=Jr!==null,r=new Set(U.value.map(e=>t[e]?.sourceIndex));Jr&&(Jr.hidden?r.add(Jr.sourceIndex):r.delete(Jr.sourceIndex)),qr+=1,Jr=null,Gr.value=null,U.value=e.flatMap((e,t)=>r.has(e.sourceIndex)?[t]:[]),Yr.value=e.map(e=>r.has(e.sourceIndex)?{...e,value:0}:e),n&&Zr(),ur()});function Xr(){return H.value.map(e=>({name:e.name,color:e.color,value:e.value}))}function Zr(){Ur(`selectLegend`,ai.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Qr({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=pe}){let o=performance.now(),s=qr;function c(l){if(s!==qr)return;let u=Math.min((l-o)/n,1),ee=a(u);r(e+(t-e)*ee,u),u<1?requestAnimationFrame(c):(r(t,1),i&&i())}requestAnimationFrame(c)}function $r(){U.value.length?U.value=[]:oi.value.forEach((e,t)=>{U.value.push(t)}),Zr()}function ei(e){let t=H.value[e],n=Yr.value[e],r=U.value.includes(e);if(!r&&U.value.length>=H.value.length-1)return;r&&(U.value=U.value.filter(t=>t!==e));let i=r?t.value:0;function a(t){Yr.value=Yr.value.map((n,r)=>e===r?{...n,value:t}:n)}function o(){r||U.value.push(e),a(i),Zr()}P.value.serieToggleAnimation.show&&P.value.type===`classic`?(Jr={sourceIndex:t.sourceIndex,hidden:!r},Gr.value=e,Qr({from:n.value,to:i,duration:P.value.serieToggleAnimation.durationMs,onUpdate:e=>{a(e),ur()},onDone:()=>{o(),Jr=null,r||ur(),Gr.value=null}})):(o(),r&&ur())}function ti(e){return H.value.length?H.value.find(t=>t.name===e)||(fr.value&&console.warn(`VueUiDonut - Series name not found "${e}"`),null):(fr.value&&console.warn(`VueUiDonut - There are no series to show.`),null)}function ni(e){let t=ti(e);t!==null&&U.value.includes(t.seriesIndex)&&ei(t.seriesIndex)}function ri(e){let t=ti(e);t!==null&&(U.value.includes(t.seriesIndex)||ei(t.seriesIndex))}let ii=v(()=>mi(Wr.value)),ai=v(()=>{if(R.value&&!xr.value){let e=Tr.value,t=H.value.map(t=>({...t,value:t.value*e,color:t.color,ghost:!1})),n=ii.value*(1-e);return n>0&&t.push({name:`__ghost__`,value:n,color:`transparent`,ghost:!0}),t}return Yr.value.map((e,t)=>({...e,seriesIndex:t})).filter((e,t)=>!U.value.includes(t))}),oi=v(()=>H.value.map(e=>{let t=e.value,n=t/ii.value;return{name:e.name,color:e.color,value:t,shape:`circle`,patternIndex:e.patternIndex,proportion:n}}).map((e,t)=>{let n=h(F.value.value.formatter,e.value,u({p:F.value.dataLabels.prefix,v:e.value,s:F.value.dataLabels.suffix,r:L.value.legend.roundingValue}),{datapoint:e,index:t}),r=h(F.value.percentage.formatter,_i(e),u({v:_i(e),s:`%`,r:L.value.legend.roundingPercentage})),i=Pi({val:n,percentage:U.value.includes(t)?`${Ni(e.proportion*100)}%`:r,showVal:L.value.legend.showValue,showPercentage:L.value.legend.showPercentage,config:L.value.legend});return{...e,opacity:U.value.includes(t)?.5:1,segregate:()=>!Kr.value&&ei(t),isSegregated:U.value.includes(t),display:`${e.name}${L.value.legend.showPercentage||L.value.legend.showValue?`: `:``}${i}`}})),si=v(()=>({cy:`donut-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`:``})),W=v(()=>{let e=I.value.radiusRatio,t=Math.max(.1,Math.min(.50001,e)),n=Math.min(V.value.width*t,V.value.height*t);return Math.max(12,n)}),G=v(()=>re({series:ai.value},V.value.width/2,V.value.height/2,W.value,W.value,1.99999,2,1,360,105.25,Hr.value)),ci=v(()=>Math.abs(Z.value)>0),li=v(()=>re({series:[{value:1,color:I.value.emptyFill,name:`_`,seriesIndex:0,patternIndex:-1,ghost:!1,absoluteValues:[1]}]},V.value.width/2,V.value.height/2,W.value,W.value,1.99999,2,1,360,105.25,Hr.value)),K=v(()=>G.value.filter(e=>!e.ghost)),q=v(()=>{let e=Math.max(...ai.value.map(e=>e.value)),t=ai.value.map(t=>t.value/e);return me({series:t,center:{x:V.value.width/2,y:V.value.height/2},maxRadius:Math.min(V.value.width,V.value.height)/3,hasGhost:R.value})});function ui(e){return e.x>V.value.width/2+6?`start`:e.x<V.value.width/2-6?`end`:`middle`}let J=v(()=>q.value.map(e=>{let t=t=>ee({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:t,centerX:V.value.width/2,centerY:V.value.height/2});return{anchor:ui(e.middlePoint),marker:t(24),label:t(42)}}));function di(e){return e.middlePoint.y>V.value.height/2?ee({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:100,centerX:V.value.width/2,centerY:V.value.height/2}).y:ee({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:0,centerX:V.value.width/2,centerY:V.value.height/2}).y-100}function Y(e){return e.proportion*100>F.value.dataLabels.hideUnderValue}function fi(e,t){let n=F.value.dataLabels.hideUnderValue,r=F.value.dataLabels.smallArcClusterThreshold,i=(hi.value[t]??e.proportion??0)*100;return i>n&&i<=r}let{smallArcLayoutsClassic:X}=dt({FINAL_CONFIG:P,noGhostDonut:K,svg:V,padding:Fr,labels_inline_fontSize:cr,minSize:W,findArcMidpoint:ye,calcMarkerOffsetX:m,calcMarkerOffsetY:g,animatingIndex:Gr,segregated:U,isSmallArc:fi});function pi(e,t){let n=e.value/mi(t);return isNaN(n)?0:h(F.value.percentage.formatter,n*100,u({v:n*100,s:`%`,r:F.value.percentage.rounding}),{datapoint:e})}function mi(e){return e.reduce((e,t)=>e+t.value,0)}let Z=v(()=>mi(ai.value)),hi=v(()=>{let e=mi(H.value);return e<=0?[]:H.value.map(t=>t.value/e)}),gi=v(()=>Z.value/ai.value.length);function _i(e){return Kr.value?e.proportion*100:e.value/Z.value*100}let vi=T(null),yi=T(!1);function bi({datapoint:e,seriesIndex:t}){P.value.events.datapointLeave&&P.value.events.datapointLeave({datapoint:e,seriesIndex:t}),mr.value=!1,N.value=null,nr.value=null,ir.value=`pointer`}function Q({datapoint:e,relativeIndex:t,seriesIndex:n,show:r=!1,triggerMode:i=`pointer`}){P.value.events.datapointEnter&&P.value.events.datapointEnter({datapoint:e,seriesIndex:n}),ir.value=i,nr.value=t,vi.value={datapoint:e,seriesIndex:n,config:P.value,series:H.value},mr.value=r,N.value=t;let a=``,o=L.value.tooltip.customFormat;if(yi.value=!1,ne(o))try{let t=o({seriesIndex:n,datapoint:e,series:H.value,config:P.value});typeof t==`string`&&(hr.value=t,yi.value=!0)}catch{console.warn(`Custom format cannot be applied.`),yi.value=!1}yi.value||(a+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${L.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,a+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${e.color}"/>${Rn.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${M.value}_${n})"/>`:``}</svg>`,a+=`<b>${Pi({showVal:L.value.tooltip.showValue,showPercentage:L.value.tooltip.showPercentage,val:`<span>${h(F.value.value.formatter,e.value,u({p:F.value.dataLabels.prefix,v:e.value,s:F.value.dataLabels.suffix,r:L.value.tooltip.roundingValue}),{datapoint:e,relativeIndex:t,seriesIndex:n})}</span>`,percentage:h(F.value.percentage.formatter,e.proportion*100,u({v:e.proportion*100,s:`%`,r:L.value.tooltip.roundingPercentage}),{datapoint:e,relativeIndex:t,seriesIndex:n}),config:L.value.tooltip})}</b></div>`,L.value.comments.showInTooltip&&e.comment&&(a+=`<div class="vue-data-ui-tooltip-comment" style="background:${ie(e.color,12.5)}; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${e.color}">${e.comment}</div>`),hr.value=`<div>${a}</div>`)}function xi(e,t){let n=X.value[t];if(n)return{textAnchor:n.textAnchor,x:n.labelX,y:n.labelY};let r=m(e,!0,12);return{textAnchor:r.anchor,x:r.x,y:g(e)}}function Si(e,{x:t,fontSize:n,className:r,normalWeight:i}){return String(e.name??``).split(/\n/g).map((e,a)=>`
|
|
2
|
+
<tspan
|
|
3
|
+
class="${r}"
|
|
4
|
+
${a?`x="${t}" dy="${n*1.2}"`:``}
|
|
5
|
+
fill="${F.value.name.color}"
|
|
6
|
+
font-size="${n}px"
|
|
7
|
+
style="font-weight:${F.value.name.bold?`bold`:i}"
|
|
8
|
+
>${e}</tspan>
|
|
9
|
+
`).join(``)}function Ci(e,t,n){let{textAnchor:r,x:i}=xi(e,t),a=Fi(e),o=`
|
|
10
|
+
<tspan
|
|
11
|
+
class="vue-data-ui-datalabel-inline"
|
|
12
|
+
fill="${F.value.percentage.color}"
|
|
13
|
+
font-size="${n?cr.value:or.value}px"
|
|
14
|
+
style="font-weight:${F.value.percentage.bold?`bold`:``}"
|
|
15
|
+
>${a}</tspan>
|
|
16
|
+
`,s=Si(e,{x:i,fontSize:n?cr.value:sr.value,className:n?`vue-data-ui-datalabel-inline`:`vue-data-ui-datalabel-name`,normalWeight:``});return r===`end`?`${F.value.name.show?s:``}${o}`:`${o}${F.value.name.show?s:``}`}function wi(e,t){let{anchor:n,label:{x:r}}=J.value[t],i=Fi(e),a=`
|
|
17
|
+
<tspan
|
|
18
|
+
class="vue-data-ui-datalabel-value"
|
|
19
|
+
fill="${F.value.percentage.color}"
|
|
20
|
+
font-size="${or.value}px"
|
|
21
|
+
style="font-weight:${F.value.percentage.bold?`bold`:`normal`}"
|
|
22
|
+
>${i}</tspan>
|
|
23
|
+
`,o=Si(e,{x:r,fontSize:sr.value,className:`vue-data-ui-datalabel-name`,normalWeight:`normal`});return n===`end`?`${F.value.name.show?o:``}${a}`:`${a}${F.value.name.show?o:``}`}function Ti(e){return P.value.useBlurOnHover&&![null,void 0].includes(N.value)&&N.value!==e?`url(#blur_${M.value})`:``}function Ei(e){if(!Kr.value||Gr.value===null||e.seriesIndex!==Gr.value)return 1;let t=(e.proportion??0)*100,n=F.value.dataLabels.hideUnderValue,r=F.value.dataLabels.smallArcClusterThreshold+2,i=n;return t>=r?1:t<=i?0:(t-i)/(r-i)}let Di=v(()=>({head:ai.value.map(e=>({name:e.name,color:e.color})),body:ai.value.map(e=>e.value)}));function Oi(e=null){$e(()=>{let t=Di.value.head.map((e,t)=>[[e.name],[Di.value.body[t]],[isNaN(Di.value.body[t]/Z.value)?`-`:Di.value.body[t]/Z.value*100]]),n=[[L.value.title.text],[L.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=te(n);e?e(r):ge({csvContent:r,title:L.value.title.text||`vue-ui-donut`})})}let ki=v(()=>{let e=[`__SUM__`,u({p:F.value.dataLabels.prefix,v:Z.value,s:F.value.dataLabels.suffix,r:P.value.table.td.roundingValue}),`100%`],t=Di.value.head.map((e,t)=>[{color:e.color,name:e.name||`-`},Di.value.body[t],isNaN(Di.value.body[t]/Z.value)?`-`:(Di.value.body[t]/Z.value*100).toFixed(P.value.table.td.roundingPercentage)+`%`]),n=t.map(e=>e.map((e,t)=>t===0?e.name:e)),r={th:{backgroundColor:P.value.table.th.backgroundColor,color:P.value.table.th.color,outline:P.value.table.th.outline},td:{backgroundColor:P.value.table.td.backgroundColor,color:P.value.table.td.color,outline:P.value.table.td.outline},breakpoint:P.value.table.responsiveBreakpoint};return{colNames:[P.value.table.columnNames.series,P.value.table.columnNames.value,P.value.table.columnNames.percentage],head:e,body:t,a11yBody:n,config:r}}),Ai=T(!1);function ji(e){Ai.value=e,gr.value+=1}let Mi=v(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent));function Ni(e){return Ce({num:e,rounding:L.value.legend.roundingPercentage})}function Pi({val:e,percentage:t,showVal:n,showPercentage:r,config:i}){return we({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Fi(e){return Pi({val:h(F.value.value.formatter,e.value,u({p:F.value.dataLabels.prefix,v:e.value,s:F.value.dataLabels.suffix,r:F.value.value.rounding}),{datapoint:e}),percentage:pi(e,K.value),showVal:F.value.value.show,showPercentage:F.value.percentage.show,config:F.value.dataLabels})}function $(e,t){P.value.events.datapointClick&&P.value.events.datapointClick({datapoint:e,seriesIndex:e.seriesIndex}),Ur(`selectDatapoint`,{datapoint:e,index:t})}function Ii(){B.value.showTable=!B.value.showTable}function Li(){B.value.dataLabels.show=!B.value.dataLabels.show}function Ri(){B.value.showTooltip=!B.value.showTooltip}let zi=T(!1);function Bi(){zi.value=!zi.value}let Vi=l(Bn,()=>L.value.title.text);function Hi(){if(!Vn.value)return;let{x:e,y:t,width:n,height:r}=Vn.value.getBBox();z.value&&z.value.setAttribute(`viewBox`,`${e} ${t} ${n+Math.min(0,e)} ${r+Math.min(0,t)}`)}let Ui=v(()=>c({config:P,style:L,mutableConfig:B,dialog:Pn,accordion:kn,isFullscreen:Ai,parent:Bn,maxWidth:500,isCursorPointer:yr}));lt(()=>B.value.showTable,e=>s(e,P,er));function Wi(){B.value.showTable=!1,tr.value&&tr.value.setTableIconState(!1)}let Gi=v(()=>oi.value.map(e=>({...e,name:e.display}))),Ki=v(()=>L.value.backgroundColor),qi=v(()=>L.value.legend),Ji=v(()=>L.value.title),{isCallbackImaging:Yi,isCallbackSvg:Xi,generateSvg:Zi,onGenerateImage:Qi}=Pe({svg:z,title:Ji,legend:qi,legendItems:Gi,backgroundColor:Ki,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:zr});async function $i(){Ur(`copyAlt`,{config:P.value,dataset:Yr.value}),P.value.userOptions.callbacks.altCopy?await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:Yr.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ea(){nr.value=null,ar.value=!0}function ta(){nr.value=null,ir.value=`pointer`,mr.value=!1,N.value=null,ar.value=!1}function na(e){if(!z.value||zi.value||document.activeElement!==z.value||!K.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){nr.value=null,ir.value=`pointer`,mr.value=!1,N.value=null;return}if(r){if(nr.value===null)return;let e=K.value[nr.value];if(!e)return;$(e,nr.value);return}let a=nr.value,o=N.value,s=a!==null&&a>=0&&a<K.value.length,c=o!==null&&o>=0&&o<K.value.length;s?n?(a+=1,a>=K.value.length&&(a=0)):t&&(--a,a<0&&(a=K.value.length-1)):c?(a=n?o+1:o-1,a>=K.value.length&&(a=0),a<0&&(a=K.value.length-1)):a=n?0:K.value.length-1;let l=K.value[a];l&&(nr.value=a,ra(a),Q({datapoint:l,relativeIndex:a,seriesIndex:l.seriesIndex,show:!0,triggerMode:`keyboard`}))}function ra(e){if(!Number.isFinite(e)||!z.value)return;let t=V.value.width/2,n=V.value.height/2;if(P.value.type===`classic`){let r=K.value[e];if(!r?.arcSlice)return;let i=ye(r.arcSlice);if(!i)return;t=i.x,n=i.y}else{let r=q.value[e]?.middlePoint;if(!r)return;t=r.x,n=r.y}let r=z.value.getBoundingClientRect();rr.value={x:r.left+t/V.value.width*r.width,y:r.top+n/V.value.height*r.height}}let ia=v(()=>({headers:ki.value?.colNames??[],rows:ki.value?.a11yBody??[]}));return Ge({autoSize:Hi,getData:Xr,getImage:Vi,generatePdf:Rr,generateCsv:Oi,generateImage:zr,generateSvg:Zi,hideSeries:ri,showSeries:ni,toggleTable:Ii,toggleLabels:Li,toggleTooltip:Ri,toggleAnnotator:Bi,toggleFullscreen:ji,copyAlt:$i}),(s,c)=>(w(),x(`div`,{ref_key:`donutChart`,ref:Bn,class:et(`vue-data-ui-component vue-ui-donut ${Ai.value?`vue-data-ui-wrapper-fullscreen`:``} ${P.value.useCssAnimation?``:`vue-ui-dna`}`),style:C(`font-family:${P.value.style.fontFamily};width:100%; ${P.value.responsive?`height:100%;`:``} text-align:center;background:${L.value.backgroundColor}`),id:`donut__${M.value}`,onMouseenter:Mr,onMouseleave:Nr},[S(`div`,{id:`chart-instructions-${M.value}`,class:`sr-only`},[S(`p`,null,O(P.value.a11y.translations.keyboardNavigation),1)],8,mt),P.value.a11y.includeTable&&ia.value?.rows?.length?(w(),y(He,{key:0,uid:M.value,head:ia.value.headers,body:ia.value.rows,notice:P.value.a11y.translations.tableAvailable,caption:P.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):b(``,!0),P.value.userOptions.buttons.annotator&&k(z)?(w(),y(k(jn),Qe({key:1},k(a)(P.value.userOptions.annotator),{color:L.value.color,backgroundColor:L.value.backgroundColor,active:zi.value,svgRef:k(z),isCursorPointer:yr.value,palette:P.value.userOptions.annotatorPalette,onClose:Bi}),qe({_:2},[E(k(o),e=>({name:e,fn:A(t=>[D(s.$slots,e,tt(Ze(k(i)(e,t))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`palette`])):b(``,!0),D(s.$slots,`userConfig`,{},void 0,!0),Br.value?(w(),x(`div`,{key:2,ref_key:`noTitle`,ref:Yn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):b(``,!0),L.value.title.text?(w(),x(`div`,{key:3,ref_key:`chartTitle`,ref:Wn,style:`width:100%;background:transparent;padding-bottom:24px`},[(w(),y(Re,{key:`title_${Xn.value}`,config:{title:{cy:`donut-div-title`,...L.value.title},subtitle:{cy:`donut-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):b(``,!0),S(`div`,{id:`legend-top-${M.value}`},null,8,ht),P.value.userOptions.show&&zn.value&&(k(jr)||k(kr))?(w(),y(k(Mn),Qe({ref_key:`userOptionsRef`,ref:tr,key:`user_option_${gr.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isPrinting:k(Ir),isImaging:k(Lr),uid:M.value,hasTooltip:L.value.tooltip.show&&P.value.userOptions.buttons.tooltip,isFullscreen:Ai.value,chartElement:Bn.value},k(n)(P.value.userOptions,`pdf csv img svg labels table fullscreen altCopy annotator`),{isTooltip:B.value.showTooltip,isAnnotation:zi.value,tableDialog:P.value.table.useDialog,isCursorPointer:yr.value,onToggleFullscreen:ji,onGeneratePdf:k(Rr),onGenerateCsv:Oi,onGenerateImage:k(Qi),onGenerateSvg:k(Zi),onToggleTable:Ii,onToggleLabels:Li,onToggleTooltip:Ri,onToggleAnnotator:Bi,onCopyAlt:$i,style:{visibility:k(jr)?k(kr)?`visible`:`hidden`:`visible`}}),qe({_:2},[E(k(t)(s.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:A(t=>[D(s.$slots,e,tt(Ze(k(r)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`chartElement`,`isTooltip`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):b(``,!0),S(`div`,gt,[(w(),x(`svg`,{ref_key:`svgRef`,ref:z,xmlns:k(ve),"aria-describedby":`chart-instructions-${M.value}`,class:et({"vue-data-ui-fullscreen--on":Ai.value,"vue-data-ui-fulscreen--off":!Ai.value,"vue-data-ui-svg":!0}),viewBox:`0 0 ${V.value.width<=0?10:V.value.width} ${V.value.height<=0?10:V.value.height}`,style:C(`max-width:100%; overflow: visible; background:transparent;color:${L.value.color};${Fr.value.css}`),tabindex:`0`,onFocus:ea,onBlur:ta,onKeydown:na},[S(`g`,{ref_key:`G`,ref:Vn,class:`vue-data-ui-g`},[Ye(k(Nn)),D(s.$slots,`svg-underlayer`,{svg:{...V.value,datapoints:G.value,isPrintingImg:k(Ir)||k(Lr)||k(Yi),isPrintingSvg:k(Xi)}},void 0,!0),s.$slots[`chart-background`]?(w(),x(`foreignObject`,{key:0,x:0,y:0,width:V.value.width<=0?10:V.value.width,height:V.value.height<=0?10:V.value.height,style:{pointerEvents:`none`}},[D(s.$slots,`chart-background`,{},void 0,!0)],8,vt)):b(``,!0),P.value.type===`classic`&&!isNaN(Hr.value/W.value)?(w(),x(`defs`,yt,[L.value.useGradient?(w(),y(We,{key:0,t:`radial`,id:`gradient_${M.value}`,stops:[[`0%`,k(ie)(L.value.backgroundColor,0),0],[`${(1-Hr.value/W.value)*100}%`,k(ie)(`#FFFFFF`,0),0],[`${(1-Hr.value/W.value/2)*100}%`,k(ie)(`#FFFFFF`,L.value.gradientIntensity),1],[`100%`,k(ie)(L.value.backgroundColor,0),0]]},null,8,[`id`,`stops`])):b(``,!0)])):b(``,!0),P.value.type===`polar`?(w(),x(`defs`,bt,[(w(!0),x(_,null,E(q.value,(e,t)=>(w(),y(We,{t:`radial`,id:`polar_gradient_${t}_${M.value}`,key:`pg_${t}_${M.value}`,cx:(isNaN(e.middlePoint.x/V.value.width*100)?0:e.middlePoint.x/V.value.width*100)+`%`,cy:(isNaN(e.middlePoint.y/V.value.height*100)?0:e.middlePoint.y/V.value.height*100)+`%`,r:`62%`,stops:[[`0%`,k(oe)(G.value[t].color,.05),L.value.gradientIntensity/100],[`100%`,G.value[t].color,1]]},null,8,[`id`,`cx`,`cy`,`stops`]))),128))])):b(``,!0),S(`defs`,null,[S(`filter`,{id:`blur_${M.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[S(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:2,id:`blur_std_${M.value}`},null,8,St),c[5]||=S(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)],8,xt),S(`filter`,{id:`shadow_${M.value}`,"color-interpolation-filters":`sRGB`},[S(`feDropShadow`,{dx:`0`,dy:`0`,stdDeviation:`10`,"flood-opacity":`0.5`,"flood-color":I.value.shadowColor},null,8,wt)],8,Ct),S(`filter`,{id:`drop_shadow_${M.value}`,"color-interpolation-filters":`sRGB`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[S(`feDropShadow`,{dx:`0`,dy:`0`,stdDeviation:`3`,"flood-opacity":`1`,"flood-color":I.value.shadowColor},null,8,Et)],8,Tt)]),P.value.type===`classic`?(w(!0),x(_,{key:3},E(G.value.filter(e=>!e.ghost),(e,t)=>(w(),x(`g`,null,[Y(e)&&B.value.dataLabels.show?(w(),x(`path`,{key:0,d:k(X)[t]?.connectorPath||k(de)(e,{x:V.value.width/2,y:V.value.height/2},16,16,!1,!1,Hr.value,12,vr.value.curvedMarkers),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,filter:Ti(t)},null,8,Dt)):b(``,!0)]))),256)):b(``,!0),P.value.type===`polar`?(w(!0),x(_,{key:4},E(G.value.filter(e=>!e.ghost),(e,t)=>(w(),x(`g`,null,[Y(e)&&B.value.dataLabels.show?(w(),x(`path`,{key:0,d:`M ${J.value[t].marker.x},${J.value[t].marker.y} ${q.value[t].middlePoint.x},${q.value[t].middlePoint.y}`,stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,filter:Ti(t),style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`})},null,12,Ot)):b(``,!0)]))),256)):b(``,!0),P.value.type===`classic`&&I.value.useShadow?(w(),x(`circle`,{key:5,cx:V.value.width/2,cy:V.value.height/2,r:W.value<=0?10:W.value,fill:L.value.backgroundColor,filter:`url(#shadow_${M.value})`},null,8,kt)):b(``,!0),s.$slots.pattern?(w(),x(`g`,At,[(w(!0),x(_,null,E(e.dataset,(e,t)=>(w(),x(`defs`,{key:`pattern-${e.patternIndex}`},[D(s.$slots,`pattern`,Qe({ref_for:!0},{seriesIndex:t,patternId:`pattern_${M.value}_${t}`}),void 0,!0)]))),128))])):b(``,!0),Z.value&&P.value.type===`classic`?(w(),x(_,{key:7},[(w(!0),x(_,null,E(K.value,(e,t)=>(w(),x(`path`,{stroke:L.value.backgroundColor,d:e.arcSlice,fill:`#FFFFFF`},null,8,jt))),256)),(w(!0),x(_,null,E(K.value,(e,t)=>(w(),x(`path`,{class:`vue-ui-donut-arc-path`,d:e.arcSlice,fill:e.color,stroke:I.value.borderColorAuto?L.value.backgroundColor:I.value.borderColor,"stroke-width":I.value.borderWidth,filter:Ti(t)},null,8,Mt))),256)),s.$slots.pattern?(w(),x(`g`,Nt,[(w(!0),x(_,null,E(K.value,(e,t)=>(w(),x(`path`,{class:`vue-ui-donut-arc-path`,d:e.arcSlice,fill:`url(#${e.pattern})`,stroke:I.value.borderColorAuto?L.value.backgroundColor:I.value.borderColor,"stroke-width":I.value.borderWidth,filter:Ti(t)},null,8,Pt))),256))])):b(``,!0)],64)):b(``,!0),Z.value&&P.value.type===`polar`?(w(),x(_,{key:8},[G.value.length>1?(w(),x(`g`,Ft,[(w(!0),x(_,null,E(K.value,(e,t)=>(w(),x(`path`,{stroke:I.value.borderColorAuto?L.value.backgroundColor:I.value.borderColor,d:q.value[t].path,fill:`#FFFFFF`,style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`})},null,12,It))),256)),I.value.useShadow?(w(),x(`g`,Lt,[(w(!0),x(_,null,E(K.value,(e,t)=>(w(),x(`path`,{class:`vue-ui-donut-arc-path`,d:q.value[t].path,fill:`transparent`,stroke:I.value.borderColorAuto?L.value.backgroundColor:vr.value.donut.borderColor,"stroke-width":I.value.borderWidth,filter:`url(#drop_shadow_${M.value})`,style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`})},null,12,Rt))),256))])):b(``,!0),s.$slots.pattern?(w(),x(`g`,zt,[(w(!0),x(_,null,E(K.value,(e,t)=>(w(),x(`path`,{class:`vue-ui-donut-arc-path`,d:q.value[t].path,fill:`url(#${e.pattern})`,stroke:I.value.borderColorAuto?L.value.backgroundColor:vr.value.donut.borderColor,"stroke-width":I.value.borderWidth,filter:Ti(t),style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`,transformOrigin:`center`})},null,12,Bt))),256))])):b(``,!0),(w(!0),x(_,null,E(K.value,(e,t)=>(w(),x(`path`,{class:`vue-ui-donut-arc-path`,d:q.value[t].path,fill:L.value.useGradient?`url(#polar_gradient_${t}_${M.value})`:e.color,stroke:I.value.borderColorAuto?L.value.backgroundColor:I.value.borderColor,"stroke-width":I.value.borderWidth,filter:Ti(t),style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`})},null,12,Vt))),256))])):(w(),x(`g`,Ht,[s.$slots.pattern?(w(),x(`circle`,{key:0,cx:V.value.width/2,cy:V.value.height/2,r:W.value,fill:`url(#pattern_${M.value}_${G.value[0].patternIndex})`,stroke:L.value.backgroundColor,"stroke-width":I.value.borderWidth},null,8,Ut)):b(``,!0),S(`circle`,{cx:V.value.width/2,cy:V.value.height/2,r:W.value,fill:L.value.useGradient?`url(#polar_gradient_0_${M.value})`:G.value[0].color,stroke:L.value.backgroundColor,"stroke-width":I.value.borderWidth},null,8,Wt)]))],64)):(w(),x(_,{key:9},[P.value.type===`classic`&&!ci.value?(w(),x(`g`,Gt,[(w(!0),x(_,null,E(li.value,(e,t)=>(w(),x(`path`,{class:`vue-ui-donut-arc-path`,d:e.arcSlice,fill:e.color,stroke:L.value.backgroundColor,"stroke-width":I.value.borderWidth},null,8,Kt))),256))])):b(``,!0),S(`circle`,{cx:V.value.width/2,cy:V.value.height/2,r:W.value<=0?10:W.value,fill:`transparent`,stroke:L.value.backgroundColor},null,8,qt)],64)),L.value.useGradient&&P.value.type===`classic`?(w(),x(`circle`,{key:10,cx:V.value.width/2,cy:V.value.height/2,r:W.value<=0?10:W.value,fill:`url(#gradient_${M.value})`},null,8,Jt)):b(``,!0),S(`circle`,{ref_key:`circle_hollow`,ref:Un,style:{pointerEvents:`none`},fill:`none`,cx:V.value.width/2,cy:V.value.height/2,r:Math.max(.1,Hr.value*1.7)},null,8,Yt),Z.value?(w(),x(_,{key:11},[G.value.length>1||P.value.type===`classic`?(w(),x(`g`,Xt,[(w(!0),x(_,null,E(G.value.filter(e=>!e.ghost),(e,t)=>(w(),x(`path`,{d:P.value.type===`classic`?e.arcSlice:q.value[t].path,stroke:I.value.borderColorAuto?L.value.backgroundColor:I.value.borderColor,fill:N.value===t?I.value.selectedColor:`transparent`,onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex}),onClick:n=>$(e,t)},null,40,Zt))),256))])):(w(),x(`g`,Qt,[S(`circle`,{cx:V.value.width/2,cy:V.value.height/2,r:W.value,fill:`transparent`,onMouseenter:c[0]||=e=>Q({datapoint:G.value[0],relativeIndex:0,seriesIndex:G.value[0].seriesIndex,show:!0}),onMouseleave:c[1]||=e=>bi({datapoint:G.value[0],seriesIndex:G.value[0].seriesIndex}),onClick:c[2]||=e=>$(G.value[0],0)},null,40,$t)]))],64)):b(``,!0),P.value.type===`classic`?(w(),x(`g`,{key:12,ref_key:`G_hollow`,ref:Hn,class:`vue-data-ui-donut-hollow-labels`},[F.value.hollow.total.show?(w(),x(`text`,{key:0,"text-anchor":`middle`,x:V.value.width/2,y:V.value.height/2-(F.value.hollow.average.show?F.value.hollow.total.fontSize:0)+F.value.hollow.total.offsetY,fill:F.value.hollow.total.color,"font-size":F.value.hollow.total.fontSize,style:C(`font-weight:${F.value.hollow.total.bold?`bold`:``}`)},O(F.value.hollow.total.text),13,en)):b(``,!0),F.value.hollow.total.show?(w(),x(`text`,{key:1,"text-anchor":`middle`,x:V.value.width/2,y:V.value.height/2+F.value.hollow.total.fontSize-(F.value.hollow.average.show?F.value.hollow.total.fontSize:0)+F.value.hollow.total.value.offsetY,fill:F.value.hollow.total.value.color,"font-size":F.value.hollow.total.value.fontSize,style:C(`font-weight:${F.value.hollow.total.value.bold?`bold`:``}`)},O(k(h)(F.value.hollow.total.value.formatter,Z.value,k(u)({p:F.value.hollow.total.value.prefix,v:Z.value,s:F.value.hollow.total.value.suffix}))),13,tn)):b(``,!0),F.value.hollow.average.show?(w(),x(`text`,{key:2,"text-anchor":`middle`,x:V.value.width/2,y:V.value.height/2+(F.value.hollow.total.show?F.value.hollow.average.fontSize:0)+F.value.hollow.average.offsetY,fill:F.value.hollow.average.color,"font-size":F.value.hollow.average.fontSize,style:C(`font-weight:${F.value.hollow.average.bold?`bold`:``}`)},O(F.value.hollow.average.text),13,nn)):b(``,!0),F.value.hollow.average.show?(w(),x(`text`,{key:3,"text-anchor":`middle`,x:V.value.width/2,y:V.value.height/2+(F.value.hollow.total.show?F.value.hollow.average.fontSize:0)+F.value.hollow.average.fontSize+F.value.hollow.average.value.offsetY,fill:F.value.hollow.average.value.color,"font-size":F.value.hollow.average.value.fontSize,style:C(`font-weight:${F.value.hollow.average.value.bold?`bold`:``}`)},O(Kr.value||R.value?`--`:k(h)(F.value.hollow.average.value.formatter,k(ue)(gi.value),k(u)({p:F.value.hollow.average.value.prefix,v:k(ue)(gi.value),s:F.value.hollow.average.value.suffix,r:F.value.hollow.average.value.rounding}))),13,rn)):b(``,!0)],512)):b(``,!0),(w(!0),x(_,null,E(K.value.filter(e=>!e.ghost),(e,t)=>(w(),x(`g`,{filter:Ti(t),key:e.seriesIndex,opacity:Ei(e)},[F.value.dataLabels.useLabelSlots?(w(),x(`g`,on,[(w(),x(`foreignObject`,{x:k(m)(e,!0).anchor===`end`?k(m)(e).x-120:k(m)(e,!0).anchor===`middle`?k(m)(e).x-60:k(m)(e).x,y:k(g)(e)-(Mi.value?20:0),width:`120`,height:`60`,style:{overflow:`visible`}},[S(`div`,null,[D(s.$slots,`dataLabel`,Qe({ref_for:!0},{datapoint:e,isBlur:!P.value.useBlurOnHover||[null,void 0].includes(N.value)||N.value===t,isSafari:Mi.value,isVisible:Y(e)&&B.value.dataLabels.show,textAlign:k(m)(e,!0,16,!0).anchor,flexAlign:k(m)(e,!0,16).anchor,percentage:pi(e,K.value)}),void 0,!0)])],8,sn))])):(w(),x(`g`,cn,[P.value.type===`classic`?(w(),x(_,{key:0},[Y(e)&&B.value.dataLabels.show?(w(),x(`circle`,{key:0,cx:k(X)[t]?.markerX??k(m)(e).x,cy:k(X)[t]?.markerY??k(g)(e)-3.5,fill:e.color,stroke:L.value.backgroundColor,"stroke-width":1,r:3,filter:!P.value.useBlurOnHover||[null,void 0].includes(N.value)||N.value===t?``:`url(#blur_${M.value})`,onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex})},null,40,ln)):b(``,!0),F.value.dataLabels.oneLine||k(X)[t]?ut((w(),x(`text`,{key:1,class:`vue-data-ui-datalabel-inline`,"text-anchor":k(X)[t]?.textAnchor||k(m)(e,!0,12).anchor,x:k(X)[t]?.labelX??k(m)(e,!0,12).x,y:k(X)[t]?.labelY??k(g)(e),onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex}),innerHTML:Ci(e,t,!!k(X)[t])},null,40,un)),[[ct,Y(e)&&B.value.dataLabels.show]]):(w(),x(_,{key:2},[ut(S(`text`,{class:`vue-data-ui-datalabel-value`,"text-anchor":k(X)[t]?.textAnchor||k(m)(e,!0,12).anchor,x:k(X)[t]?.labelX??k(m)(e,!0,12).x,y:k(X)[t]?.labelY??k(g)(e),fill:F.value.percentage.color,"font-size":or.value+`px`,style:C(`font-weight:${F.value.percentage.bold?`bold`:``}`),onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex})},O(Fi(e)),45,dn),[[ct,Y(e)&&B.value.dataLabels.show]]),ut(S(`text`,{class:`vue-data-ui-datalabel-name`,"text-anchor":k(X)[t]?.textAnchor||k(m)(e).anchor,x:k(X)[t]?.labelX??k(m)(e,!0,12).x,y:(k(X)[t]?.labelY??k(g)(e))+sr.value*1.2,fill:F.value.name.color,"font-size":sr.value+`px`,style:C(`font-weight:${F.value.name.bold?`bold`:``}`),onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex}),innerHTML:k(ae)({content:e.name,fontSize:sr.value,fill:F.value.name.color,x:k(X)[t]?.labelX??k(m)(e,!0,12).x,y:(k(X)[t]?.labelY??k(g)(e))+sr.value})},null,44,fn),[[ct,Y(e,!0,12)&&B.value.dataLabels.show&&F.value.name.show]])],64))],64)):b(``,!0),P.value.type===`polar`?(w(),x(_,{key:1},[Y(e)&&B.value.dataLabels.show?(w(),x(`circle`,{key:0,cx:J.value[t].marker.x,cy:J.value[t].marker.y,fill:e.color,stroke:L.value.backgroundColor,"stroke-width":1,r:3,filter:!P.value.useBlurOnHover||[null,void 0].includes(N.value)||N.value===t?``:`url(#blur_${M.value})`,onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex}),style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`})},null,44,pn)):b(``,!0),F.value.dataLabels.oneLine?ut((w(),x(`text`,{key:1,class:`vue-data-ui-datalabel-inline`,"text-anchor":J.value[t].anchor,x:J.value[t].label.x,y:J.value[t].label.y,style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`}),onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex}),innerHTML:wi(e,t)},null,44,mn)),[[ct,Y(e)&&B.value.dataLabels.show]]):(w(),x(_,{key:2},[Y(e)&&B.value.dataLabels.show?(w(),x(`text`,{key:0,class:`vue-data-ui-datalabel-value`,"text-anchor":J.value[t].anchor,x:J.value[t].label.x,y:J.value[t].label.y,fill:F.value.percentage.color,"font-size":or.value,style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`,fontWeight:F.value.percentage.bold?`bold`:`normal`}),onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex})},O(Fi(e)),45,hn)):b(``,!0),Y(e,!0,12)&&B.value.dataLabels.show&&F.value.name.show?(w(),x(`text`,{key:1,class:`vue-data-ui-datalabel-name`,"text-anchor":J.value[t].anchor,x:J.value[t].label.x,y:J.value[t].label.y+sr.value*1.2,fill:F.value.name.color,"font-size":sr.value,style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`,fontWeight:F.value.name.bold?`bold`:`normal`}),onClick:n=>$(e,t),onMouseenter:n=>Q({datapoint:e,relativeIndex:t,seriesIndex:e.seriesIndex,show:!0}),onMouseleave:t=>bi({datapoint:e,seriesIndex:e.seriesIndex}),innerHTML:k(ae)({content:e.name,fontSize:sr.value,fill:F.value.name.color,x:J.value[t].label.x,y:J.value[t].label.y+sr.value*1.2})},null,44,gn)):b(``,!0)],64))],64)):b(``,!0)])),B.value.dataLabels.show&&L.value.comments.show&&e.comment?(w(),x(`g`,_n,[Y(e)&&P.value.type===`classic`?(w(),x(`foreignObject`,{key:0,x:L.value.comments.offsetX+(k(m)(e,!0).anchor===`end`?k(m)(e).x-L.value.comments.width:k(m)(e,!0).anchor===`middle`?k(m)(e).x-L.value.comments.width/2:k(m)(e).x),y:k(g)(e)+24+L.value.comments.offsetY,width:L.value.comments.width,height:`200`,style:{overflow:`visible`,"pointer-events":`none`}},[S(`div`,null,[D(s.$slots,`plot-comment`,{plot:{...e,textAlign:k(m)(e,!0,16,!0).anchor,flexAlign:k(m)(e,!0,16).anchor,isFirstLoad:R.value}},void 0,!0)])],8,vn)):b(``,!0),Y(e)&&P.value.type===`polar`?(w(),x(`foreignObject`,{key:1,x:L.value.comments.offsetX+(J.value[t].anchor===`end`?J.value[t].label.x-L.value.comments.width:J.value[t].anchor===`middle`?J.value[t].label.x-L.value.comments.width/2:J.value[t].label.x),y:di(q.value[t])+L.value.comments.offsetY,width:L.value.comments.width,height:`200`,style:C({transition:R.value||!P.value.serieToggleAnimation.show?`none`:`all ${P.value.serieToggleAnimation.durationMs}ms ease-in-out`,overflow:`visible`,pointerEvents:`none`})},[S(`div`,null,[D(s.$slots,`plot-comment`,{plot:{...e,textAlign:J.value[t].anchor,flexAlign:J.value[t].anchor,isFirstLoad:R.value}},void 0,!0)])],12,yn)):b(``,!0)])):b(``,!0)],8,an))),128)),D(s.$slots,`svg`,{svg:{...V.value,datapoints:G.value,isPrintingImg:k(Ir)||k(Lr)||k(Yi),isPrintingSvg:k(Xi)}},void 0,!0)],512)],46,_t)),s.$slots.hint?(w(),x(`div`,bn,[D(s.$slots,`hint`,tt(Ze({hint:P.value.a11y.translations.keyboardNavigation,isVisible:ar.value})),void 0,!0)])):b(``,!0)]),s.$slots.watermark?(w(),x(`div`,xn,[D(s.$slots,`watermark`,tt(Ze({isPrinting:k(Ir)||k(Lr)||k(Yi)||k(Xi)})),void 0,!0)])):b(``,!0),S(`div`,{id:`legend-bottom-${M.value}`},null,8,Sn),$n.value&&(L.value.legend.show||s.$slots.legend)?(w(),y(Ke,{key:6,to:L.value.legend.position===`top`?`#legend-top-${M.value}`:`#legend-bottom-${M.value}`},[S(`div`,{ref_key:`chartLegend`,ref:Gn},[D(s.$slots,`legend`,{legend:oi.value},()=>[L.value.legend.show?(w(),y(Be,{key:`legend_${Qn.value}`,legendSet:oi.value,config:si.value,onClickMarker:c[3]||=({i:e})=>ei(e),isCursorPointer:yr.value},qe({item:A(({legend:e,index:t})=>[S(`div`,{style:C(`opacity:${U.value.includes(t)?.5:1}`),onClick:t=>e.segregate()},O(e.display),13,Cn)]),legendToggle:A(()=>[oi.value.length>2&&L.value.legend.selectAllToggle.show&&!k(xr)?(w(),y(Ue,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:U.value.length>0,isCursorPointer:yr.value,onToggle:$r},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):b(``,!0)]),_:2},[s.$slots.pattern?{name:`legend-pattern`,fn:A(({legend:e,index:t})=>[Ye(Le,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${M.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):b(``,!0)],!0)],512)],8,[`to`])):b(``,!0),s.$slots.source?(w(),x(`div`,{key:7,ref_key:`source`,ref:Jn,dir:`auto`},[D(s.$slots,`source`,{},void 0,!0)],512)):b(``,!0),s.$slots.hollow?(w(),x(`div`,wn,[D(s.$slots,`hollow`,tt(Ze({total:Z.value,average:gi.value,dataset:H.value,...V.value})),void 0,!0)])):b(``,!0),Ye(k(Dn),{teleportTo:L.value.tooltip.teleportTo,show:B.value.showTooltip&&mr.value,backgroundColor:L.value.tooltip.backgroundColor,color:L.value.tooltip.color,fontSize:L.value.tooltip.fontSize,borderRadius:L.value.tooltip.borderRadius,borderColor:L.value.tooltip.borderColor,borderWidth:L.value.tooltip.borderWidth,backgroundOpacity:L.value.tooltip.backgroundOpacity,position:L.value.tooltip.position,offsetX:L.value.tooltip.offsetX,offsetY:L.value.tooltip.offsetY,parent:Bn.value,content:hr.value,isCustom:yi.value,isFullscreen:Ai.value,smooth:L.value.tooltip.smooth,backdropFilter:L.value.tooltip.backdropFilter,smoothForce:L.value.tooltip.smoothForce,smoothSnapThreshold:L.value.tooltip.smoothSnapThreshold,isA11yMode:ir.value===`keyboard`,a11yPosition:rr.value},{"tooltip-before":A(()=>[D(s.$slots,`tooltip-before`,tt(Ze({...vi.value})),void 0,!0)]),tooltip:A(()=>[D(s.$slots,`tooltip`,tt(Ze({...vi.value})),void 0,!0)]),"tooltip-after":A(()=>[D(s.$slots,`tooltip-after`,tt(Ze({...vi.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isCustom`,`isFullscreen`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),zn.value&&P.value.userOptions.buttons.table?(w(),y(it(Ui.value.component),Qe({key:9},Ui.value.props,{ref_key:`tableUnit`,ref:er,onClose:Wi}),qe({content:A(()=>[(w(),y(k(An),{key:`table_${Zn.value}`,colNames:ki.value.colNames,head:ki.value.head,body:ki.value.body,config:ki.value.config,title:P.value.table.useDialog?``:Ui.value.title,withCloseButton:!P.value.table.useDialog,isCursorPointer:yr.value,onClose:Wi},{th:A(({th:e})=>[e===`__SUM__`?(w(),x(`div`,Tn,[Ye(k(On),{name:`sigma`,stroke:ki.value.config.th.color,size:16},null,8,[`stroke`])])):(w(),x(`div`,En,O(e),1))]),td:A(({td:e})=>[Je(O(e.name?e.name:isNaN(Number(e))?e.includes(`%`)?e:k(h)(F.value.percentage.formatter,e,k(u)({v:e,s:`%`,r:F.value.percentage.rounding})):k(h)(F.value.value.formatter,e,k(u)({p:F.value.dataLabels.prefix,v:e,s:F.value.dataLabels.suffix,r:F.value.value.rounding}))),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[P.value.table.useDialog?{name:`title`,fn:A(()=>[Je(O(Ui.value.title),1)]),key:`0`}:void 0,P.value.table.useDialog?{name:`actions`,fn:A(()=>[S(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:c[4]||=e=>Oi(P.value.userOptions.callbacks.csv),style:C({cursor:yr.value?`pointer`:`default`})},[Ye(k(On),{name:`fileCsv`,stroke:Ui.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):b(``,!0),D(s.$slots,`skeleton`,{},()=>[k(xr)?(w(),y(Ve,{key:0})):b(``,!0)],!0)],46,pt))}},[[`__scopeId`,`data-v-a9a86c8e`]]);export{ft as n,Dn as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,Bt as t,Ht as n,It as r,Jt as i,S as a,X as o,Y as s,Yt as c,b as l,f as u,i as d,in as f,j as p,nn as m,p as h,st as g,t as _}from"./lib-rPeBMZrn.js";import{t as v}from"./useConfig-_JwRfIqE.js";import{t as y}from"./vue_ui_donut-B2W2nyAS.js";import{_ as b,a as x,c as S,d as C,g as w,i as T,l as E,n as D,o as O,p as k,r as A,s as ee,t as te,u as j,v as M}from"./render-common-C9aE_Va1.js";var{vue_ui_donut:ne}=v();function re({config:e={}}={}){let t=e??{},r=f({userConfig:t,defaultConfig:ne}),i=r.theme;if(!i)return{...r,customPalette:r.customPalette?.length?r.customPalette:n};let a=f({userConfig:y[i]||{},defaultConfig:r}),o=f({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:m[i]||n}}function N(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function P(e,t,n){return String(t).split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)??n}function ie(e){return typeof e!=`object`||!e?0:Array.isArray(e.values)?e.values.reduce((e,t)=>e+N(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+N(t,0),0):N(e.value??e.y??0,0)}function ae(e,t){return String(e?.name??e?.label??`Serie ${t+1}`)}function oe(e=[],t){let r=Array.isArray(t.customPalette)?t.customPalette:n;return(Array.isArray(e)?e:[]).map((e,t)=>({source:e,sourceIndex:t,value:ie(e)})).filter(e=>Number.isFinite(e.value)).sort((e,n)=>t.sorted?e.source?.ghost&&!n.source?.ghost?1:n.source?.ghost&&!e.source?.ghost?-1:n.value-e.value:0).map((e,t)=>{let n=e.source,i=e.value,o=(n?.color?a(n.color):``)||r[t%r.length];return{...n,id:n?.id??`donut_serie_${t}`,name:ae(n,t),value:i,absoluteValue:Math.abs(i),absoluteValues:Array.isArray(n?.values)?n.values:[i],color:o,index:t,sourceIndex:e.sourceIndex,patternIndex:n?.patternIndex??t,seriesIndex:n?.seriesIndex??t,ghost:!!n?.ghost}}).filter(e=>Number.isFinite(e.absoluteValue))}function se(e){return e.reduce((e,t)=>e+t.absoluteValue,0)}function ce({series:e,total:t,startAngle:n=-90}){let r=n;return e.map(e=>{let n=t?e.absoluteValue/t:0,i=n*360,a=r,o=r+i;return r=o,{...e,ratio:n,percentage:n*100,startAngle:a,endAngle:o,midAngle:a+i/2}})}function le({dataset:e=[],config:t={},width:n=512,height:r=512,additionalSvgContent:i=``,svgTitle:a=``}={}){let o=re({config:t}),s=oe(e,o),c=se(s),l={top:N(P(o,`chart.padding.top`,24),24),right:N(P(o,`chart.padding.right`,24),24),bottom:N(P(o,`chart.padding.bottom`,24),24),left:N(P(o,`chart.padding.left`,24),24)},u={top:l.top,left:l.left,right:n-l.right,bottom:r-l.bottom};u.width=Math.max(1,u.right-u.left),u.height=Math.max(1,u.bottom-u.top);let d={x:u.left+u.width/2,y:u.top+u.height/2},f=Math.max(1,Math.min(u.width,u.height)/2),p=N(P(o,`chart.donut.radius`,f),f),m=N(P(o,`chart.donut.holeRatio`,.5),.5);return{width:n,height:r,dataset:e,config:o,drawingArea:u,center:d,radius:p,innerRadius:Math.max(0,Math.min(p-1,p*m)),total:c,series:ce({series:s,total:c,startAngle:N(P(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=o();function F(){return ue}function I(e){return O(x(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return b(e?.value??e?.absoluteValue??0,0)}function L(e){return w(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:O(e.color,`#000000`),name:String(e.name??`Serie ${t+1}`),seriesIndex:e.seriesIndex??e.index??t,patternIndex:e.patternIndex??e.index??t})).filter(e=>Number.isFinite(e.value))}function R(e){return e.reduce((e,t)=>e+Math.abs(b(t.value,0)),0)}function fe(e){let t=x(e,`title`,{}),n=k(t,`subtitle`,{});if(!t.text)return 0;let r=b(t.fontSize,20),i=n.show!==!1&&n.text?b(n.fontSize,14):0;return b(t.paddingTop,12)+r+(i?i+12:0)+b(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=x(n,`legend`,{}),a=b(i.fontSize,12),o=b(i.markerSize,10),s=b(i.itemGap,24),c=b(i.rowGap,8),l=b(i.padding,8),u=b(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Be(e,t),r=D(n,a),i=o+u+r,c=m+i+(p.length?s:0);p.length&&c>d&&(f.push({items:p,width:m}),p=[],m=0),p.push({serie:t,label:n,itemWidth:i}),m+=i+(p.length>1?s:0)}),p.length&&f.push({items:p,width:m}),{rows:f,fontSize:a,markerSize:o,itemGap:s,labelGap:u,rowGap:c,padding:l,height:f.length*Math.max(o,a)+Math.max(0,f.length-1)*c+l*2}}function z(e,t){return!x(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function B(e){return!!T(e,`pie`,x(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=z(e,t),s=x(n,`legend.show`,!0),c=x(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=b(x(n,`padding.top`,24),24),f=b(x(n,`padding.right`,24),24),p=b(x(n,`padding.bottom`,24),24),m=b(x(n,`padding.left`,24),24),h={top:d+a+l,right:r-f,bottom:i-p-u,left:m};h.width=Math.max(1,h.right-h.left),h.height=Math.max(1,h.bottom-h.top);let g=a?b(T(n,`title.chartOffsetY`,24),24):0,_=Math.max(1,h.height-g),v={x:h.left+h.width/2,y:h.top+g/2+_/2},y=b(x(n,`layout.donut.radiusRatio`,.35),.35),S=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*S),w=x(n,`layout.donut.radius`,null),E=w==null?C:Math.min(C,b(w,C)),D=b(x(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(E*D*2,E),12*(1+D)),k=x(n,`layout.donut.thickness`,x(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(E-1,k==null?O:b(k,O)));return{...e,drawingArea:h,center:v,radius:E,thickness:A,innerRadius:B(n)?0:Math.max(0,E-A)}}function he(e,t){let n=b(x(e.config,`layout.donut.rotation`,105.25),105.25);return r({series:t},e.center.x,e.center.y,e.radius,e.radius,1.99999,2,1,360,n,B(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:O(e.color,t[n]?.color),value:b(e.value,0),name:String(e.name??t[n]?.name??`Serie ${n+1}`),patternIndex:e.patternIndex??t[n]?.patternIndex??n,seriesIndex:e.seriesIndex??t[n]?.seriesIndex??n}))}function ge(e,t){let n=Math.max(1,...t.map(e=>Math.abs(b(e.value,0)))),r=t.map(e=>Math.abs(b(e.value,0))/n);return p({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function V(e){return`gradient_${F()}`}function H(e,t){return`polar_gradient_${t}_${F()}`}function _e(e){return T(e.config,`type`,`classic`)!==`classic`||!x(e.config,`useGradient`,!1)?``:C(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${V(e)})`})}function U(e){return`drop_shadow_${F()}`}function ve(e){let{config:t,width:n}=e,r=x(t,`title`,{}),i=k(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?b(r.paddingLeft,12):a===`right`?n-b(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=b(r.fontSize,20),l=b(i.fontSize,14),u=b(r.paddingTop,12)+c,d=[M(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:O(r.color,A(t))})];return i.text&&d.push(M(i.text,{"data-cy":`donut-div-subtitle`,x:o,y:u+l+4,"font-size":l,"font-weight":i.bold?`700`:`400`,"text-anchor":s,fill:O(i.color||r.color,A(t))})),j(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],a=!!x(n,`useGradient`,!1),o=!!x(n,`layout.donut.useShadow`,!1);if(a){let a=T(n,`type`,`classic`),o=b(x(n,`gradientIntensity`,30),30);if(a===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=B(n)?1:e.thickness/e.radius;r.push(j(`radialGradient`,{id:V(e)},[C(`stop`,{offset:`0%`,"stop-color":i(I(n),0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t)*100}%`,"stop-color":i(`#FFFFFF`,0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":i(`#FFFFFF`,o)}),C(`stop`,{offset:`100%`,"stop-color":i(I(n),0),"stop-opacity":0})].join(``)))}a===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(j(`radialGradient`,{id:H(e,n),cx:`${l(i.middlePoint.x/e.width*100)}%`,cy:`${l(i.middlePoint.y/e.height*100)}%`,r:`62%`},[C(`stop`,{offset:`0%`,"stop-color":c(t.color,.05),"stop-opacity":o/100}),C(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=O(x(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=b(x(n,`layout.donut.shadowOpacity`,.2),.2),a=b(x(n,`layout.donut.shadowBlur`,6),6),o=b(x(n,`layout.donut.shadowOffsetY`,3),3);r.push(j(`filter`,{id:U(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[C(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?j(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return x(e.config,`useGradient`,!1)?`url(#${H(e,n)})`:t.color}function W(e){let{config:t}=e;return x(t,`layout.donut.borderColorAuto`,!0)?I(t):O(x(t,`layout.donut.borderColor`,I(t)),I(t))}function G(e){return x(e.config,`layout.donut.useShadow`,!1)?`url(#${U(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=W(e),r=b(x(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{b(t.proportion,0)<=0||(i.push(C(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:I(e.config)})),i.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${a}`,d:t.arcSlice,fill:be(e,t,a),stroke:n,"stroke-width":r,filter:G(e)})))}),j(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=W(e),i=b(x(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(C(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${o}`,d:s.path,fill:xe(e,t,o),stroke:r,"stroke-width":i,filter:G(e)})))}),j(`g`,{"data-layer":`polar-slices`},a.join(``))}function K(t,n,r=`layout.labels.value.rounding`){let{config:i}=t,a=x(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=e({p:o.prefix??``,v:n.value,s:o.suffix??``,r:b(x(i,r,s.rounding??0),s.rounding??0)});return d(s.formatter,n.value,c,{datapoint:n})}function q(t,n){let{config:r}=t,i=x(r,`layout.labels.percentage`,{}),a=b(n.proportion,0)*100,o=e({v:a,s:`%`,r:b(i.rounding,0)});return d(i.formatter,a,o,{datapoint:n})}function J(e,t){let n=x(e.config,`layout.labels`,{}),r=!!n.name?.show,i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0);return{name:r?String(t.name??``):``,value:i?K(e,t):``,percentage:a?q(e,t):``}}function we(e,t){let{value:n,percentage:r}=J(e,t);return r&&n?`${r} (${n})`:r||n||``}function Y(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?K(e,t):``,s=a?q(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function X(e,t){let n=x(e.config,`layout.labels`,{}).dataLabels??{};if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=b(n.hideUnderValue,0);return b(t.proportion,0)*100>r}function Te(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r=b(n.smallArcClusterThreshold,0),i=b(n.hideUnderValue,0),a=b(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Z(e){return!!x(e.config,`layout.curvedMarkers`,x(e.config,`layout.donut.curvedMarkers`,!1))}function Q(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=b(n.smallArcClusterFontSize??n.fontSize,10),s=o/3,c=o*1.5,d=e.drawingArea.top+16,f=e.drawingArea.bottom-16,p=i-(e.radius+6),m=i+(e.radius+6),g=Z(e);function _(e){return{x:l(e.center?.endX??e.endX),y:l(e.center?.endY??e.endY)}}function v({midX:e,midY:t,bandX:n,bandY:r}){if(!g)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let o=n<i?-1:1,s=n-e,c=r-t,l=Math.sqrt(s*s+c*c)||1,u=e-i,d=t-a,f=Math.sqrt(u*u+d*d)||1,p=u/f,m=d/f,h=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=h)return{x:e,y:t};let s=h/o;return{x:i+n*s,y:a+r*s}}if(l<56){let o=s/l,u=-(c/l),d=o,f=(e+n)*.5,h=(t+r)*.5,g=(f+u-i)**2+(h+d-a)**2;(f-u-i)**2+(h-d-a)**2>g&&(u=-u,d=-d);let v=Math.max(0,Math.min(1,(l-18)/44)),y=v*v*(3-2*v),b=e+s*.78,x=t+c*.78,S=_({x:b+u*(2.5+y*4)*.9+p*(1+y*2.5),y:x+d*(2.5+y*4)*.9+m*(1+y*2.5)});return`M ${e} ${t} Q ${S.x} ${S.y} ${n} ${r}`}let v=l*.34;v<20&&(v=20),v>46&&(v=46);let y=l*.46;y<22&&(y=22),y>70&&(y=70);let b=_({x:e+p*v,y:t+m*v}),x=i+o*Math.max(Math.abs(n-i),h),S=_({x:n-o*Math.min(y,Math.abs(x-n)*.75),y:r});return`M ${e} ${t} C ${b.x} ${b.y} ${S.x} ${S.y} ${n} ${r}`}function y(e){let t=String(e??``).split(/\n/g);return c+Math.max(0,t.length-1)*o*1.2}function S({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:u(e).x,inlineMarkerY:h(e)-3.5,labelHeight:y(e.name)}}function C(e){let t=e.inlineMarkerY<a,n=e.inlineMarkerX<i;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function w(e,t){let n=t.startsWith(`T`);e.sort((e,t)=>n?e.inlineMarkerY-t.inlineMarkerY||e.index-t.index:t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function T({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+s,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function E({candidateList:e,side:t,bandMarkerX:n,startY:i,direction:a}){let o=i;e.forEach(e=>{let{index:i,midX:s,midY:c,labelHeight:l}=e,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let d=u,f=v({midX:s,midY:c,bandX:n,bandY:d});r[i]=T({side:t,markerX:n,markerY:d,labelY:u,connectorPath:f})})}let D={TL:[],TR:[],BL:[],BR:[]};return t.map((e,t)=>S({arc:e,index:t})).filter(({arc:t})=>X(e,t)&&Te(e,t)).forEach(e=>{D[C(e)].push(e)}),Object.keys(D).forEach(e=>{w(D[e],e)}),E({candidateList:D.TL,side:`left`,bandMarkerX:p,startY:d,direction:`down`}),E({candidateList:D.TR,side:`right`,bandMarkerX:m,startY:d,direction:`down`}),D.BL.length>1&&E({candidateList:D.BL,side:`left`,bandMarkerX:p,startY:f,direction:`up`}),D.BR.length>1&&E({candidateList:D.BR,side:`right`,bandMarkerX:m,startY:f,direction:`up`}),r}function Ee({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=x(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??u(t,!0,12).x,l=r?.labelY??h(t),d=r?.textAnchor??u(t,!0,12).anchor,{name:f}=J(e,t),p=we(e,t),m=String(f).split(/\n/g),_=f?m.map((t,n)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:O(s.color,A(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},g(t+(n===m.length-1?` `:``)))).join(``):``,v=p?j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},g(p)):``;return j(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":d},`${_}${v}`)}function De(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!T(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=b(r.fontSize??n.value?.fontSize??12,12);O(r.color??n.value?.color??A(e.config),A(e.config)),r.bold??n.value?.bold;let a=b(r.offset,16),o=Q(e,t),s=[];return t.forEach((t,n)=>{if(!X(e,t))return;let c=o[n];Y(e,t),c?s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:b(r.smallArcClusterFontSize,i)})):s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:u(t,!1,a+i/2).x,labelY:h(t,a,a),textAnchor:u(t).anchor},fontSize:i}))}),s.length?j(`g`,{"data-layer":`data-labels`},s.join(``)):``}function Oe(e,n,r=42){return t({initX:n.middlePoint.x,initY:n.middlePoint.y,offset:r,centerX:e.center.x,centerY:e.center.y})}function ke(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function Ae(e,t,n,r){let i=x(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=b(a.fontSize,i.dataLabels?.fontSize??12),c=b(o.fontSize,i.dataLabels?.fontSize??12),l=j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(a.color,A(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},g(String(Y(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:O(o.color,A(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},g(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function je(e,t,n){let r=x(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},c=r.name??{};if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=b(a.fontSize,i.fontSize??12),d=b(c.fontSize,i.fontSize??12),f=O(o.color,A(e.config)),p=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!X(e,t))return;let a=Oe(e,i,42),m=ke(e,a);l?p.push(j(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":m},Ae(e,t,a.x,m))):(p.push(j(`text`,{"data-cy":`polar-label-value`,class:`vue-data-ui-datalabel-value`,x:a.x,y:a.y,"font-size":u,"font-weight":o.bold?`700`:`400`,"text-anchor":m,fill:f},te({content:Y(e,t),x:a.x,fontSize:u,fill:f,textAnchor:m}))),c.show&&p.push(j(`text`,{"data-cy":`polar-label-name`,class:`vue-data-ui-datalabel-name`,x:a.x,y:a.y+d*1.2,"font-size":d,"font-weight":c.bold?`700`:`400`,"text-anchor":m,fill:O(c.color,A(e.config))},s({content:g(String(t.name??``)),fontSize:d,fill:O(c.color,A(e.config)),x:a.x}))))}),p.length?j(`g`,{"data-layer":`polar-data-labels`},p.join(``)):``}function Me(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=x(e.config,`layout.labels.dataLabels`,{}),i=b(r.offset,16),a=b(r.markerFlatLength,12),o=Z(e),s=u(t).x,c=h(t,i,i)-4,l=s+(t.center.endX>t.cx?-a:a),d=`${s},${c}`,f=`${l},${c}`,p=`${t.center.endX},${t.center.endY}`;return o?`M${d} Q${f} ${p}`:`M${d} ${f} ${p}`}function Ne(e,t){let n=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Q(e,t),i=[];return t.forEach((t,a)=>{if(!X(e,t))return;let o=r[a],s=Me(e,t,o);s&&(i.push(C(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":b(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(C(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??u(t).x,cy:o?.markerY??h(t)-3.5,r:b(n.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1})))}),i.length?j(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Pe(e,n,r){let i=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return n.forEach((n,o)=>{let s=r[o];if(!s?.middlePoint||!X(e,n))return;let c=t({initX:s.middlePoint.x,initY:s.middlePoint.y,offset:24,centerX:e.center.x,centerY:e.center.y});a.push(C(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:n.color,"stroke-width":b(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(C(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:b(i.markerRadius,3),fill:n.color,stroke:I(e.config),"stroke-width":1}))}),a.length?j(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:M(e,{"text-anchor":`middle`,...t})}function Fe(t,n,r){if(T(t.config,`type`,`classic`)!==`classic`||B(t.config)||!n)return``;let i=x(t.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=b(a.fontSize,14),i=!!o.show,c=t.center.y-(i?r:0)+b(a.offsetY,0),l=a.value??{},u=b(l.fontSize,r),f=d(l.formatter,n,e({p:l.prefix??``,v:n,s:l.suffix??``,r:b(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:t.center.x,y:c,fill:O(a.color,A(t.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(f,{"data-cy":`hollow-total-value`,x:t.center.x,y:t.center.y+r-(i?r:0)+b(l.offsetY,0),fill:O(l.color,O(a.color,A(t.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=b(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},f=b(u.fontSize,i),p=d(u.formatter,l,e({p:u.prefix??``,v:l,s:u.suffix??``,r:b(u.rounding,0)}),{average:l});s.push($(o.text??``,{"data-cy":`hollow-average-name`,x:t.center.x,y:t.center.y+(c?i:0)+b(o.offsetY,0),fill:O(o.color,A(t.config)),"font-size":i,"font-weight":o.bold?`700`:`400`})),s.push($(p,{"data-cy":`hollow-average-value`,x:t.center.x,y:t.center.y+(c?i:0)+i+b(u.offsetY,0),fill:O(u.color,O(o.color,A(t.config))),"font-size":f,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?j(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Ie(t,n){let{config:r,center:i}=t,a=x(r,`layout.donut.labels.total`,x(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=x(r,`layout.labels.dataLabels`,{}),s=b(a.fontSize,20),c=O(a.color,A(r)),l=d(a.formatter,n,e({p:o.prefix??``,v:n,s:o.suffix??``,r:b(a.rounding,0)}),{total:n});return M(l,{"data-cy":`donut-total`,x:i.x,y:i.y+s/3,"font-size":s,"font-weight":a.bold?`700`:`400`,"text-anchor":`middle`,fill:c})}function Le(e,t){let n=R(L(e));return n?b(t.value,0)/n*100:0}function Re(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=e({p:a.prefix??``,v:n.value,s:a.suffix??``,r:b(r.roundingValue,o.rounding??0)});return d(o.formatter,n.value,s,{datapoint:n,serie:n})}function ze(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}).percentage??{},a=Le(t,n),o=e({v:a,s:`%`,r:b(r.roundingPercentage,i.rounding??0)});return d(i.formatter,a,o,{datapoint:n,serie:n})}function Be(e,t){let n=x(e.config,`legend`,{}),r=[],i=n.showPercentage?ze(e,t):``,a=n.showValue?Re(e,t):``,o=i&&n.usePercentageParens?`(${i})`:i,s=a&&n.useValueParens?`(${a})`:a;return n.showValueFirst?(s&&r.push(s),o&&r.push(o)):(o&&r.push(o),s&&r.push(s)),`${t.name}${r.length?`: ${r.join(` `)}`:``}`}function Ve(e,t){let n=x(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=z(e,t),i=O(n.color,A(e.config)),a=n.position||`bottom`,o=Math.max(r.markerSize,r.fontSize),s=a===`top`?r.padding+o:e.height-r.height+r.padding+o,c=[];return r.rows.forEach((t,a)=>{let l=r.padding+(e.width-r.padding*2)/2-t.width/2,u=s+a*(o+r.rowGap);t.items.forEach(({serie:e,label:t,itemWidth:a})=>{c.push(C(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(M(t,{x:l+r.markerSize+r.labelGap,y:u+2,"font-size":r.fontSize,"font-weight":n.bold?`700`:`400`,"dominant-baseline":`middle`,fill:i,opacity:e.opacity??1})),l+=a+r.itemGap})}),j(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function He(e){return j(`g`,{"data-layer":`no-data`},[C(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:O(x(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function Ue(e,t){let n=e.additionalSvgContent;return typeof n==`function`?n({width:e.width,height:e.height,drawingArea:e.drawingArea,center:e.center,radius:e.radius,thickness:e.thickness,innerRadius:e.innerRadius,config:e.config,series:t.map(e=>({...e}))})??``:n??``}function We(e,t,n){let r=`${T(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${l(n)}.`;return j(`title`,{},g(r))}async function Ge(e){let t=e.config,n=b(e.width,x(t,`width`,512)),r=b(e.height,x(t,`height`,512)),i=L(e),a=R(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=T(t,`type`,`classic`),u=a>0&&s.some(e=>b(e.proportion,0)>0);return`
|
|
1
|
+
import{$ as e,Bt as t,Ht as n,It as r,Jt as i,S as a,X as o,Y as s,Yt as c,b as l,f as u,i as d,in as f,j as p,nn as m,p as h,st as g,t as _}from"./lib-rPeBMZrn.js";import{t as v}from"./useConfig-CBXrYhMI.js";import{t as y}from"./vue_ui_donut-B2W2nyAS.js";import{_ as b,a as x,c as S,d as C,g as w,i as T,l as E,n as D,o as O,p as k,r as A,s as ee,t as te,u as j,v as M}from"./render-common-Bc3-uPjM.js";var{vue_ui_donut:ne}=v();function re({config:e={}}={}){let t=e??{},r=f({userConfig:t,defaultConfig:ne}),i=r.theme;if(!i)return{...r,customPalette:r.customPalette?.length?r.customPalette:n};let a=f({userConfig:y[i]||{},defaultConfig:r}),o=f({userConfig:t,defaultConfig:a});return{...o,customPalette:o.customPalette?.length?o.customPalette:m[i]||n}}function N(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function P(e,t,n){return String(t).split(`.`).reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)??n}function ie(e){return typeof e!=`object`||!e?0:Array.isArray(e.values)?e.values.reduce((e,t)=>e+N(t,0),0):Array.isArray(e.series)?e.series.reduce((e,t)=>e+N(t,0),0):N(e.value??e.y??0,0)}function ae(e,t){return String(e?.name??e?.label??`Serie ${t+1}`)}function oe(e=[],t){let r=Array.isArray(t.customPalette)?t.customPalette:n;return(Array.isArray(e)?e:[]).map((e,t)=>({source:e,sourceIndex:t,value:ie(e)})).filter(e=>Number.isFinite(e.value)).sort((e,n)=>t.sorted?e.source?.ghost&&!n.source?.ghost?1:n.source?.ghost&&!e.source?.ghost?-1:n.value-e.value:0).map((e,t)=>{let n=e.source,i=e.value,o=(n?.color?a(n.color):``)||r[t%r.length];return{...n,id:n?.id??`donut_serie_${t}`,name:ae(n,t),value:i,absoluteValue:Math.abs(i),absoluteValues:Array.isArray(n?.values)?n.values:[i],color:o,index:t,sourceIndex:e.sourceIndex,patternIndex:n?.patternIndex??t,seriesIndex:n?.seriesIndex??t,ghost:!!n?.ghost}}).filter(e=>Number.isFinite(e.absoluteValue))}function se(e){return e.reduce((e,t)=>e+t.absoluteValue,0)}function ce({series:e,total:t,startAngle:n=-90}){let r=n;return e.map(e=>{let n=t?e.absoluteValue/t:0,i=n*360,a=r,o=r+i;return r=o,{...e,ratio:n,percentage:n*100,startAngle:a,endAngle:o,midAngle:a+i/2}})}function le({dataset:e=[],config:t={},width:n=512,height:r=512,additionalSvgContent:i=``,svgTitle:a=``}={}){let o=re({config:t}),s=oe(e,o),c=se(s),l={top:N(P(o,`chart.padding.top`,24),24),right:N(P(o,`chart.padding.right`,24),24),bottom:N(P(o,`chart.padding.bottom`,24),24),left:N(P(o,`chart.padding.left`,24),24)},u={top:l.top,left:l.left,right:n-l.right,bottom:r-l.bottom};u.width=Math.max(1,u.right-u.left),u.height=Math.max(1,u.bottom-u.top);let d={x:u.left+u.width/2,y:u.top+u.height/2},f=Math.max(1,Math.min(u.width,u.height)/2),p=N(P(o,`chart.donut.radius`,f),f),m=N(P(o,`chart.donut.holeRatio`,.5),.5);return{width:n,height:r,dataset:e,config:o,drawingArea:u,center:d,radius:p,innerRadius:Math.max(0,Math.min(p-1,p*m)),total:c,series:ce({series:s,total:c,startAngle:N(P(o,`chart.donut.startAngle`,-90),-90)}),additionalSvgContent:i,svgTitle:a}}var ue=o();function F(){return ue}function I(e){return O(x(e,`backgroundColor`,`#FFFFFF`),`#FFFFFF`)}function de(e){return b(e?.value??e?.absoluteValue??0,0)}function L(e){return w(e.series).filter(e=>!e?.ghost).map((e,t)=>({...e,value:Math.abs(de(e)),color:O(e.color,`#000000`),name:String(e.name??`Serie ${t+1}`),seriesIndex:e.seriesIndex??e.index??t,patternIndex:e.patternIndex??e.index??t})).filter(e=>Number.isFinite(e.value))}function R(e){return e.reduce((e,t)=>e+Math.abs(b(t.value,0)),0)}function fe(e){let t=x(e,`title`,{}),n=k(t,`subtitle`,{});if(!t.text)return 0;let r=b(t.fontSize,20),i=n.show!==!1&&n.text?b(n.fontSize,14):0;return b(t.paddingTop,12)+r+(i?i+12:0)+b(t.paddingBottom,36)}function pe({state:e,series:t}){let{config:n,width:r}=e,i=x(n,`legend`,{}),a=b(i.fontSize,12),o=b(i.markerSize,10),s=b(i.itemGap,24),c=b(i.rowGap,8),l=b(i.padding,8),u=b(i.labelGap,8),d=Math.max(1,r-l*2),f=[],p=[],m=0;return t.forEach(t=>{let n=Be(e,t),r=D(n,a),i=o+u+r,c=m+i+(p.length?s:0);p.length&&c>d&&(f.push({items:p,width:m}),p=[],m=0),p.push({serie:t,label:n,itemWidth:i}),m+=i+(p.length>1?s:0)}),p.length&&f.push({items:p,width:m}),{rows:f,fontSize:a,markerSize:o,itemGap:s,labelGap:u,rowGap:c,padding:l,height:f.length*Math.max(o,a)+Math.max(0,f.length-1)*c+l*2}}function z(e,t){return!x(e.config,`legend.show`,!0)||!t.length?{rows:[],height:0,padding:0,fontSize:12,markerSize:10,rowGap:0}:pe({state:e,series:t})}function B(e){return!!T(e,`pie`,x(e,`pie`,!1))}function me(e,t){let{config:n,width:r,height:i}=e,a=fe(n),o=z(e,t),s=x(n,`legend.show`,!0),c=x(n,`legend.position`,`bottom`),l=s&&c===`top`?o.height:0,u=s&&c!==`top`?o.height:0,d=b(x(n,`padding.top`,24),24),f=b(x(n,`padding.right`,24),24),p=b(x(n,`padding.bottom`,24),24),m=b(x(n,`padding.left`,24),24),h={top:d+a+l,right:r-f,bottom:i-p-u,left:m};h.width=Math.max(1,h.right-h.left),h.height=Math.max(1,h.bottom-h.top);let g=a?b(T(n,`title.chartOffsetY`,24),24):0,_=Math.max(1,h.height-g),v={x:h.left+h.width/2,y:h.top+g/2+_/2},y=b(x(n,`layout.donut.radiusRatio`,.35),.35),S=Math.max(.1,Math.min(.50001,y)),C=Math.max(12,Math.min(h.width,_)*S),w=x(n,`layout.donut.radius`,null),E=w==null?C:Math.min(C,b(w,C)),D=b(x(n,`layout.donut.strokeWidth`,64),64)/300,O=Math.max(Math.min(E*D*2,E),12*(1+D)),k=x(n,`layout.donut.thickness`,x(n,`layout.donut.size`,O)),A=Math.max(0,Math.min(E-1,k==null?O:b(k,O)));return{...e,drawingArea:h,center:v,radius:E,thickness:A,innerRadius:B(n)?0:Math.max(0,E-A)}}function he(e,t){let n=b(x(e.config,`layout.donut.rotation`,105.25),105.25);return r({series:t},e.center.x,e.center.y,e.radius,e.radius,1.99999,2,1,360,n,B(e.config)?e.radius:e.thickness).map((e,n)=>({...e,index:n,color:O(e.color,t[n]?.color),value:b(e.value,0),name:String(e.name??t[n]?.name??`Serie ${n+1}`),patternIndex:e.patternIndex??t[n]?.patternIndex??n,seriesIndex:e.seriesIndex??t[n]?.seriesIndex??n}))}function ge(e,t){let n=Math.max(1,...t.map(e=>Math.abs(b(e.value,0)))),r=t.map(e=>Math.abs(b(e.value,0))/n);return p({series:r,center:e.center,maxRadius:Math.min(e.drawingArea.width,e.drawingArea.height)/3,hasGhost:!1})}function V(e){return`gradient_${F()}`}function H(e,t){return`polar_gradient_${t}_${F()}`}function _e(e){return T(e.config,`type`,`classic`)!==`classic`||!x(e.config,`useGradient`,!1)?``:C(`circle`,{"data-cy":`donut-gradient-hollow`,cx:e.center.x,cy:e.center.y,r:e.radius<=0?10:e.radius,fill:`url(#${V(e)})`})}function U(e){return`drop_shadow_${F()}`}function ve(e){let{config:t,width:n}=e,r=x(t,`title`,{}),i=k(r,`subtitle`,{});if(!r.text)return``;let a=r.textAlign||`center`,o=a===`left`?b(r.paddingLeft,12):a===`right`?n-b(r.paddingRight,12):n/2,s=a===`left`?`start`:a===`right`?`end`:`middle`,c=b(r.fontSize,20),l=b(i.fontSize,14),u=b(r.paddingTop,12)+c,d=[M(r.text,{"data-cy":`donut-div-title`,x:o,y:u,"font-size":c,"font-weight":r.bold?`700`:`400`,"text-anchor":s,fill:O(r.color,A(t))})];return i.text&&d.push(M(i.text,{"data-cy":`donut-div-subtitle`,x:o,y:u+l+4,"font-size":l,"font-weight":i.bold?`700`:`400`,"text-anchor":s,fill:O(i.color||r.color,A(t))})),j(`g`,{"data-layer":`title`},d.join(``))}function ye(e,t){let{config:n}=e,r=[],a=!!x(n,`useGradient`,!1),o=!!x(n,`layout.donut.useShadow`,!1);if(a){let a=T(n,`type`,`classic`),o=b(x(n,`gradientIntensity`,30),30);if(a===`classic`&&Number.isFinite(e.thickness/e.radius)){let t=B(n)?1:e.thickness/e.radius;r.push(j(`radialGradient`,{id:V(e)},[C(`stop`,{offset:`0%`,"stop-color":i(I(n),0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t)*100}%`,"stop-color":i(`#FFFFFF`,0),"stop-opacity":0}),C(`stop`,{offset:`${(1-t/2)*100}%`,"stop-color":i(`#FFFFFF`,o)}),C(`stop`,{offset:`100%`,"stop-color":i(I(n),0),"stop-opacity":0})].join(``)))}a===`polar`&&t.forEach((t,n)=>{let i=e.polarAreas?.[n];i?.middlePoint&&r.push(j(`radialGradient`,{id:H(e,n),cx:`${l(i.middlePoint.x/e.width*100)}%`,cy:`${l(i.middlePoint.y/e.height*100)}%`,r:`62%`},[C(`stop`,{offset:`0%`,"stop-color":c(t.color,.05),"stop-opacity":o/100}),C(`stop`,{offset:`100%`,"stop-color":t.color})].join(``)))})}if(o){let t=O(x(n,`layout.donut.shadowColor`,`#000000`),`#000000`),i=b(x(n,`layout.donut.shadowOpacity`,.2),.2),a=b(x(n,`layout.donut.shadowBlur`,6),6),o=b(x(n,`layout.donut.shadowOffsetY`,3),3);r.push(j(`filter`,{id:U(e),x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[C(`feDropShadow`,{dx:0,dy:o,stdDeviation:a,"flood-color":t,"flood-opacity":i})].join(``)))}return r.length?j(`defs`,{"data-layer":`definitions`},r.join(``)):``}function be(e,t){return t.color}function xe(e,t,n){return x(e.config,`useGradient`,!1)?`url(#${H(e,n)})`:t.color}function W(e){let{config:t}=e;return x(t,`layout.donut.borderColorAuto`,!0)?I(t):O(x(t,`layout.donut.borderColor`,I(t)),I(t))}function G(e){return x(e.config,`layout.donut.useShadow`,!1)?`url(#${U(e)})`:void 0}function Se(e,t){if(!t.length)return``;let n=W(e),r=b(x(e.config,`layout.donut.borderWidth`,1),1),i=[];return t.forEach((t,a)=>{b(t.proportion,0)<=0||(i.push(C(`path`,{"data-cy":`donut-arc-underlay-${a}`,d:t.arcSlice,fill:`#FFFFFF`,stroke:I(e.config)})),i.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${a}`,d:t.arcSlice,fill:be(e,t,a),stroke:n,"stroke-width":r,filter:G(e)})))}),j(`g`,{"data-layer":`classic-slices`},i.join(``))}function Ce(e,t,n){if(!t.length)return``;let r=W(e),i=b(x(e.config,`layout.donut.borderWidth`,1),1),a=[];return t.forEach((t,o)=>{let s=n[o];s?.path&&(a.push(C(`path`,{"data-cy":`polar-arc-underlay-${o}`,d:s.path,fill:`#FFFFFF`,stroke:r})),a.push(C(`path`,{class:`vue-ui-donut-arc-path`,"data-cy":`donut-arc-${o}`,d:s.path,fill:xe(e,t,o),stroke:r,"stroke-width":i,filter:G(e)})))}),j(`g`,{"data-layer":`polar-slices`},a.join(``))}function K(t,n,r=`layout.labels.value.rounding`){let{config:i}=t,a=x(i,`layout.labels`,{}),o=a.dataLabels??{},s=a.value??{},c=e({p:o.prefix??``,v:n.value,s:o.suffix??``,r:b(x(i,r,s.rounding??0),s.rounding??0)});return d(s.formatter,n.value,c,{datapoint:n})}function q(t,n){let{config:r}=t,i=x(r,`layout.labels.percentage`,{}),a=b(n.proportion,0)*100,o=e({v:a,s:`%`,r:b(i.rounding,0)});return d(i.formatter,a,o,{datapoint:n})}function J(e,t){let n=x(e.config,`layout.labels`,{}),r=!!n.name?.show,i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0);return{name:r?String(t.name??``):``,value:i?K(e,t):``,percentage:a?q(e,t):``}}function we(e,t){let{value:n,percentage:r}=J(e,t);return r&&n?`${r} (${n})`:r||n||``}function Y(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{},i=!!(n.value?.show??!0),a=!!(n.percentage?.show??!0),o=i?K(e,t):``,s=a?q(e,t):``;return o&&s?r.valuePercentageRatio===`percentageFirst`?`${s}\n${o}`:`${o}\n${s}`:o||s||``}function X(e,t){let n=x(e.config,`layout.labels`,{}).dataLabels??{};if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return!1;let r=b(n.hideUnderValue,0);return b(t.proportion,0)*100>r}function Te(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r=b(n.smallArcClusterThreshold,0),i=b(n.hideUnderValue,0),a=b(t.proportion,0)*100;return a>i&&r>0&&a<=r}function Z(e){return!!x(e.config,`layout.curvedMarkers`,x(e.config,`layout.donut.curvedMarkers`,!1))}function Q(e,t){let n=x(e.config,`layout.labels.dataLabels`,{}),r={},i=e.center.x,a=e.center.y,o=b(n.smallArcClusterFontSize??n.fontSize,10),s=o/3,c=o*1.5,d=e.drawingArea.top+16,f=e.drawingArea.bottom-16,p=i-(e.radius+6),m=i+(e.radius+6),g=Z(e);function _(e){return{x:l(e.center?.endX??e.endX),y:l(e.center?.endY??e.endY)}}function v({midX:e,midY:t,bandX:n,bandY:r}){if(!g)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let o=n<i?-1:1,s=n-e,c=r-t,l=Math.sqrt(s*s+c*c)||1,u=e-i,d=t-a,f=Math.sqrt(u*u+d*d)||1,p=u/f,m=d/f,h=f+9;function _({x:e,y:t}){let n=e-i,r=t-a,o=Math.sqrt(n*n+r*r)||1;if(o>=h)return{x:e,y:t};let s=h/o;return{x:i+n*s,y:a+r*s}}if(l<56){let o=s/l,u=-(c/l),d=o,f=(e+n)*.5,h=(t+r)*.5,g=(f+u-i)**2+(h+d-a)**2;(f-u-i)**2+(h-d-a)**2>g&&(u=-u,d=-d);let v=Math.max(0,Math.min(1,(l-18)/44)),y=v*v*(3-2*v),b=e+s*.78,x=t+c*.78,S=_({x:b+u*(2.5+y*4)*.9+p*(1+y*2.5),y:x+d*(2.5+y*4)*.9+m*(1+y*2.5)});return`M ${e} ${t} Q ${S.x} ${S.y} ${n} ${r}`}let v=l*.34;v<20&&(v=20),v>46&&(v=46);let y=l*.46;y<22&&(y=22),y>70&&(y=70);let b=_({x:e+p*v,y:t+m*v}),x=i+o*Math.max(Math.abs(n-i),h),S=_({x:n-o*Math.min(y,Math.abs(x-n)*.75),y:r});return`M ${e} ${t} C ${b.x} ${b.y} ${S.x} ${S.y} ${n} ${r}`}function y(e){let t=String(e??``).split(/\n/g);return c+Math.max(0,t.length-1)*o*1.2}function S({arc:e,index:t}){let n=_(e);return{arc:e,index:t,midX:n.x,midY:n.y,inlineMarkerX:u(e).x,inlineMarkerY:h(e)-3.5,labelHeight:y(e.name)}}function C(e){let t=e.inlineMarkerY<a,n=e.inlineMarkerX<i;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function w(e,t){let n=t.startsWith(`T`);e.sort((e,t)=>n?e.inlineMarkerY-t.inlineMarkerY||e.index-t.index:t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function T({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+s,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function E({candidateList:e,side:t,bandMarkerX:n,startY:i,direction:a}){let o=i;e.forEach(e=>{let{index:i,midX:s,midY:c,labelHeight:l}=e,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let d=u,f=v({midX:s,midY:c,bandX:n,bandY:d});r[i]=T({side:t,markerX:n,markerY:d,labelY:u,connectorPath:f})})}let D={TL:[],TR:[],BL:[],BR:[]};return t.map((e,t)=>S({arc:e,index:t})).filter(({arc:t})=>X(e,t)&&Te(e,t)).forEach(e=>{D[C(e)].push(e)}),Object.keys(D).forEach(e=>{w(D[e],e)}),E({candidateList:D.TL,side:`left`,bandMarkerX:p,startY:d,direction:`down`}),E({candidateList:D.TR,side:`right`,bandMarkerX:m,startY:d,direction:`down`}),D.BL.length>1&&E({candidateList:D.BL,side:`left`,bandMarkerX:p,startY:f,direction:`up`}),D.BR.length>1&&E({candidateList:D.BR,side:`right`,bandMarkerX:m,startY:f,direction:`up`}),r}function Ee({state:e,arc:t,arcIndex:n,smallArcLayout:r,fontSize:i}){let a=x(e.config,`layout.labels`,{}),o=a.percentage??{},s=a.name??{},c=r?.labelX??u(t,!0,12).x,l=r?.labelY??h(t),d=r?.textAnchor??u(t,!0,12).anchor,{name:f}=J(e,t),p=we(e,t),m=String(f).split(/\n/g),_=f?m.map((t,n)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:n===0?void 0:c,dy:n===0?void 0:i*1.2,fill:O(s.color,A(e.config)),"font-size":i,"font-weight":s.bold?`700`:`400`},g(t+(n===m.length-1?` `:``)))).join(``):``,v=p?j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(o.color,A(e.config)),"font-size":i,"font-weight":o.bold?`700`:`400`},g(p)):``;return j(`text`,{"data-cy":`donut-label-inline-${n}`,class:`vue-data-ui-datalabel-inline`,x:c,y:l,"text-anchor":d},`${_}${v}`)}function De(e,t){let n=x(e.config,`layout.labels`,{}),r=n.dataLabels??{};if(!T(e.config,`dataLabels.show`,r.show??!0)||!r.show)return``;let i=b(r.fontSize??n.value?.fontSize??12,12);O(r.color??n.value?.color??A(e.config),A(e.config)),r.bold??n.value?.bold;let a=b(r.offset,16),o=Q(e,t),s=[];return t.forEach((t,n)=>{if(!X(e,t))return;let c=o[n];Y(e,t),c?s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:c,fontSize:b(r.smallArcClusterFontSize,i)})):s.push(Ee({state:e,arc:t,arcIndex:n,smallArcLayout:{labelX:u(t,!1,a+i/2).x,labelY:h(t,a,a),textAnchor:u(t).anchor},fontSize:i}))}),s.length?j(`g`,{"data-layer":`data-labels`},s.join(``)):``}function Oe(e,n,r=42){return t({initX:n.middlePoint.x,initY:n.middlePoint.y,offset:r,centerX:e.center.x,centerY:e.center.y})}function ke(e,t){return t.x<e.center.x?`end`:t.x>e.center.x?`start`:`middle`}function Ae(e,t,n,r){let i=x(e.config,`layout.labels`,{}),a=i.percentage??{},o=i.name??{},s=b(a.fontSize,i.dataLabels?.fontSize??12),c=b(o.fontSize,i.dataLabels?.fontSize??12),l=j(`tspan`,{class:`vue-data-ui-datalabel-value`,fill:O(a.color,A(e.config)),"font-size":s,"font-weight":a.bold?`700`:`400`},g(String(Y(e,t).replace(/\n/g,` / `)))),u=o.show?String(t.name??``).split(/\n/g).map((t,r)=>j(`tspan`,{class:`vue-data-ui-datalabel-name`,x:r===0?void 0:n,dy:r===0?void 0:c*1.2,fill:O(o.color,A(e.config)),"font-size":c,"font-weight":o.bold?`700`:`400`},g(t))).join(``):``;return r===`end`?`${u}${l}`:`${l}${u}`}function je(e,t,n){let r=x(e.config,`layout.labels`,{}),i=r.dataLabels??{},a=r.value??{},o=r.percentage??{},c=r.name??{};if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let l=!!i.oneLine,u=b(a.fontSize,i.fontSize??12),d=b(c.fontSize,i.fontSize??12),f=O(o.color,A(e.config)),p=[];return t.forEach((t,r)=>{let i=n[r];if(!i||!X(e,t))return;let a=Oe(e,i,42),m=ke(e,a);l?p.push(j(`text`,{"data-cy":`polar-label-inline`,class:`vue-data-ui-datalabel-inline`,x:a.x,y:a.y,"text-anchor":m},Ae(e,t,a.x,m))):(p.push(j(`text`,{"data-cy":`polar-label-value`,class:`vue-data-ui-datalabel-value`,x:a.x,y:a.y,"font-size":u,"font-weight":o.bold?`700`:`400`,"text-anchor":m,fill:f},te({content:Y(e,t),x:a.x,fontSize:u,fill:f,textAnchor:m}))),c.show&&p.push(j(`text`,{"data-cy":`polar-label-name`,class:`vue-data-ui-datalabel-name`,x:a.x,y:a.y+d*1.2,"font-size":d,"font-weight":c.bold?`700`:`400`,"text-anchor":m,fill:O(c.color,A(e.config))},s({content:g(String(t.name??``)),fontSize:d,fill:O(c.color,A(e.config)),x:a.x}))))}),p.length?j(`g`,{"data-layer":`polar-data-labels`},p.join(``)):``}function Me(e,t,n=null){if(n?.connectorPath)return n.connectorPath;let r=x(e.config,`layout.labels.dataLabels`,{}),i=b(r.offset,16),a=b(r.markerFlatLength,12),o=Z(e),s=u(t).x,c=h(t,i,i)-4,l=s+(t.center.endX>t.cx?-a:a),d=`${s},${c}`,f=`${l},${c}`,p=`${t.center.endX},${t.center.endY}`;return o?`M${d} Q${f} ${p}`:`M${d} ${f} ${p}`}function Ne(e,t){let n=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,n.show??!0)||!n.show)return``;let r=Q(e,t),i=[];return t.forEach((t,a)=>{if(!X(e,t))return;let o=r[a],s=Me(e,t,o);s&&(i.push(C(`path`,{"data-cy":`donut-marker-${a}`,d:s,stroke:t.color,"stroke-width":b(n.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),i.push(C(`circle`,{"data-cy":`donut-label-marker-${a}`,cx:o?.markerX??u(t).x,cy:o?.markerY??h(t)-3.5,r:b(n.markerRadius,3),fill:t.color,stroke:I(e.config),"stroke-width":1})))}),i.length?j(`g`,{"data-layer":`label-markers`},i.join(``)):``}function Pe(e,n,r){let i=x(e.config,`layout.labels.dataLabels`,{});if(!T(e.config,`dataLabels.show`,i.show??!0)||!i.show)return``;let a=[];return n.forEach((n,o)=>{let s=r[o];if(!s?.middlePoint||!X(e,n))return;let c=t({initX:s.middlePoint.x,initY:s.middlePoint.y,offset:24,centerX:e.center.x,centerY:e.center.y});a.push(C(`path`,{"data-cy":`polar-marker-${o}`,d:`M ${c.x},${c.y} ${s.middlePoint.x},${s.middlePoint.y}`,stroke:n.color,"stroke-width":b(i.markerStrokeWidth,1),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`})),a.push(C(`circle`,{"data-cy":`polar-label-marker-${o}`,cx:c.x,cy:c.y,r:b(i.markerRadius,3),fill:n.color,stroke:I(e.config),"stroke-width":1}))}),a.length?j(`g`,{"data-layer":`polar-label-markers`},a.join(``)):``}function $(e,t){return e==null||e===``?``:M(e,{"text-anchor":`middle`,...t})}function Fe(t,n,r){if(T(t.config,`type`,`classic`)!==`classic`||B(t.config)||!n)return``;let i=x(t.config,`layout.labels.hollow`,{}),a=i.total??{},o=i.average??{},s=[];if(a.show){let r=b(a.fontSize,14),i=!!o.show,c=t.center.y-(i?r:0)+b(a.offsetY,0),l=a.value??{},u=b(l.fontSize,r),f=d(l.formatter,n,e({p:l.prefix??``,v:n,s:l.suffix??``,r:b(l.rounding,0)}),{total:n});s.push($(a.text??``,{"data-cy":`hollow-total-name`,x:t.center.x,y:c,fill:O(a.color,A(t.config)),"font-size":r,"font-weight":a.bold?`700`:`400`})),s.push($(f,{"data-cy":`hollow-total-value`,x:t.center.x,y:t.center.y+r-(i?r:0)+b(l.offsetY,0),fill:O(l.color,O(a.color,A(t.config))),"font-size":u,"font-weight":l.bold?`700`:`400`}))}if(o.show){let i=b(o.fontSize,14),c=!!a.show,l=n/Math.max(1,r.length),u=o.value??{},f=b(u.fontSize,i),p=d(u.formatter,l,e({p:u.prefix??``,v:l,s:u.suffix??``,r:b(u.rounding,0)}),{average:l});s.push($(o.text??``,{"data-cy":`hollow-average-name`,x:t.center.x,y:t.center.y+(c?i:0)+b(o.offsetY,0),fill:O(o.color,A(t.config)),"font-size":i,"font-weight":o.bold?`700`:`400`})),s.push($(p,{"data-cy":`hollow-average-value`,x:t.center.x,y:t.center.y+(c?i:0)+i+b(u.offsetY,0),fill:O(u.color,O(o.color,A(t.config))),"font-size":f,"font-weight":u.bold?`700`:`400`}))}return s.filter(Boolean).length?j(`g`,{class:`vue-data-ui-donut-hollow-labels`,"data-layer":`hollow-labels`},s.join(``)):``}function Ie(t,n){let{config:r,center:i}=t,a=x(r,`layout.donut.labels.total`,x(r,`layout.labels.total`,{}));if(!a.show||!Number.isFinite(n)||n<=0)return``;let o=x(r,`layout.labels.dataLabels`,{}),s=b(a.fontSize,20),c=O(a.color,A(r)),l=d(a.formatter,n,e({p:o.prefix??``,v:n,s:o.suffix??``,r:b(a.rounding,0)}),{total:n});return M(l,{"data-cy":`donut-total`,x:i.x,y:i.y+s/3,"font-size":s,"font-weight":a.bold?`700`:`400`,"text-anchor":`middle`,fill:c})}function Le(e,t){let n=R(L(e));return n?b(t.value,0)/n*100:0}function Re(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}),a=i.dataLabels??{},o=i.value??{},s=e({p:a.prefix??``,v:n.value,s:a.suffix??``,r:b(r.roundingValue,o.rounding??0)});return d(o.formatter,n.value,s,{datapoint:n,serie:n})}function ze(t,n){let r=x(t.config,`legend`,{}),i=x(t.config,`layout.labels`,{}).percentage??{},a=Le(t,n),o=e({v:a,s:`%`,r:b(r.roundingPercentage,i.rounding??0)});return d(i.formatter,a,o,{datapoint:n,serie:n})}function Be(e,t){let n=x(e.config,`legend`,{}),r=[],i=n.showPercentage?ze(e,t):``,a=n.showValue?Re(e,t):``,o=i&&n.usePercentageParens?`(${i})`:i,s=a&&n.useValueParens?`(${a})`:a;return n.showValueFirst?(s&&r.push(s),o&&r.push(o)):(o&&r.push(o),s&&r.push(s)),`${t.name}${r.length?`: ${r.join(` `)}`:``}`}function Ve(e,t){let n=x(e.config,`legend`,{});if(!n.show||!t.length)return``;let r=z(e,t),i=O(n.color,A(e.config)),a=n.position||`bottom`,o=Math.max(r.markerSize,r.fontSize),s=a===`top`?r.padding+o:e.height-r.height+r.padding+o,c=[];return r.rows.forEach((t,a)=>{let l=r.padding+(e.width-r.padding*2)/2-t.width/2,u=s+a*(o+r.rowGap);t.items.forEach(({serie:e,label:t,itemWidth:a})=>{c.push(C(`circle`,{cx:l+r.markerSize/2,cy:u,r:r.markerSize/2,fill:e.color,opacity:e.opacity??1})),c.push(M(t,{x:l+r.markerSize+r.labelGap,y:u+2,"font-size":r.fontSize,"font-weight":n.bold?`700`:`400`,"dominant-baseline":`middle`,fill:i,opacity:e.opacity??1})),l+=a+r.itemGap})}),j(`g`,{"data-layer":`legend`,"data-cy":`donut-div-legend`},c.join(``))}function He(e){return j(`g`,{"data-layer":`no-data`},[C(`circle`,{cx:e.center.x,cy:e.center.y,r:Math.max(1,e.radius),fill:O(x(e.config,`layout.donut.emptyFill`,`#E1E5E8`),`#E1E5E8`),opacity:.4})].join(``))}function Ue(e,t){let n=e.additionalSvgContent;return typeof n==`function`?n({width:e.width,height:e.height,drawingArea:e.drawingArea,center:e.center,radius:e.radius,thickness:e.thickness,innerRadius:e.innerRadius,config:e.config,series:t.map(e=>({...e}))})??``:n??``}function We(e,t,n){let r=`${T(e.config,`title.text`,`Donut chart`)||e.svgTitle||`Donut chart`}. ${t.length} series. Total ${l(n)}.`;return j(`title`,{},g(r))}async function Ge(e){let t=e.config,n=b(e.width,x(t,`width`,512)),r=b(e.height,x(t,`height`,512)),i=L(e),a=R(i),o=me({...e,width:n,height:r},i),s=he(o,i),c=ge(o,i),l=T(t,`type`,`classic`),u=a>0&&s.some(e=>b(e.proportion,0)>0);return`
|
|
2
2
|
<svg
|
|
3
3
|
xmlns="${_}"
|
|
4
4
|
width="100%"
|