vue-data-ui 3.28.11 → 3.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseScanner-m6QR9rwD.js +1 -0
- package/dist/{PackageVersion-ksOit8fp.js → PackageVersion-B9qiUJPH.js} +1 -1
- package/dist/SlicerPreview-Ks9FNVzh.js +1 -0
- package/dist/Tooltip-B432XpvC.js +1 -0
- package/dist/{XyAnalysisOptions-CUtj1x2f.js → XyAnalysisOptions-DKCLKOkA.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-label.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/package-GInOA5jS.js +1 -0
- package/dist/{render-common-CPA2hfDW.js → render-common-DF3B4DW7.js} +1 -1
- package/dist/ssr/vue-ui-donut.js +1 -1
- package/dist/ssr/vue-ui-xy.js +1 -1
- package/dist/ssr.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +56 -9
- package/dist/useAnimationFrame-D8gcRfnW.js +1 -0
- package/dist/useConfig-9oDGTWWG.js +1 -0
- package/dist/useLoading-BwiplGDB.js +1 -0
- package/dist/{useObjectBindings-D789Dz63.js → useObjectBindings-DlxSTJOa.js} +1 -1
- package/dist/usePanZoom-CTGk8aJt.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-Bx6exT7_.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-DkehT0SI.js +10 -0
- package/dist/{vue-ui-accordion-DxGxf-Rm.js → vue-ui-accordion-CnAwFOgA.js} +1 -1
- package/dist/vue-ui-age-pyramid-DXEyySR3.js +1 -0
- package/dist/vue-ui-annotator-DqrdF7bH.js +259 -0
- package/dist/vue-ui-bullet-BNgmEm8g.js +11 -0
- package/dist/vue-ui-bump-nFpAoRy7.js +8 -0
- package/dist/vue-ui-candlestick-DvBj3KWq.js +22 -0
- package/dist/vue-ui-carousel-table-ChEpsK7w.js +1 -0
- package/dist/vue-ui-chestnut-C-_fkI6E.js +1 -0
- package/dist/vue-ui-chord-WqXXM4Qs.js +9 -0
- package/dist/vue-ui-circle-pack-Bti7Wq1h.js +13 -0
- package/dist/vue-ui-cursor-C_zzn7Ua.js +1 -0
- package/dist/vue-ui-dag-BevQ37Gp.js +7 -0
- package/dist/vue-ui-dashboard-ruhBa6cl.js +1 -0
- package/dist/vue-ui-digits-B9ksORds.js +1 -0
- package/dist/{vue-ui-donut-iyVVIGoJ.js → vue-ui-donut-DhrhMru7.js} +1 -1
- package/dist/vue-ui-donut-SbqIxWeM.js +23 -0
- package/dist/vue-ui-donut-evolution-BkuALrYS.js +2 -0
- package/dist/vue-ui-dumbbell-SOI5CdGX.js +9 -0
- package/dist/vue-ui-flow-DqVrfXJo.js +3 -0
- package/dist/vue-ui-funnel-Byx_0z_B.js +1 -0
- package/dist/vue-ui-galaxy-BYbvOTrG.js +1 -0
- package/dist/vue-ui-gauge-3_cwmDni.js +1 -0
- package/dist/vue-ui-geo-HaNxzfYO.js +1 -0
- package/dist/vue-ui-gizmo-C38WKy7L.js +1 -0
- package/dist/{vue-ui-graph-C4kfE4G8.js → vue-ui-graph-Dp5FNReE.js} +2 -2
- package/dist/vue-ui-heatmap-DM0tteNh.js +1 -0
- package/dist/{vue-ui-hill-3GVfKQmi.js → vue-ui-hill-Dr6Du4gm.js} +1 -1
- package/dist/vue-ui-history-plot-C7iVkeuY.js +2 -0
- package/dist/vue-ui-horizontal-bar-BP2tt9hA.js +4 -0
- package/dist/vue-ui-kpi-8BL_aylw.js +1 -0
- package/dist/{vue-ui-label-CBrMoFDG.js → vue-ui-label-D9tcQ8rR.js} +1 -1
- package/dist/{vue-ui-mini-loader-PsWZLMLF.js → vue-ui-mini-loader-D5-HI4Wi.js} +1 -1
- package/dist/vue-ui-molecule-Bg1GqvBM.js +1 -0
- package/dist/vue-ui-mood-radar-DIiMInOP.js +1 -0
- package/dist/vue-ui-nested-donuts-BCyX7Z7n.js +19 -0
- package/dist/vue-ui-onion-EkxCuuTI.js +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-CE80aawg.js +9 -0
- package/dist/vue-ui-quadrant-DJIuGrF9.js +2 -0
- package/dist/vue-ui-quick-chart-BBsBw9K3.js +9 -0
- package/dist/vue-ui-radar-BMYyMdOg.js +1 -0
- package/dist/{vue-ui-rating-D0QvpD3V.js → vue-ui-rating--jhcSeor.js} +1 -1
- package/dist/vue-ui-relation-circle-BLeJaQJH.js +1 -0
- package/dist/vue-ui-ridgeline-w92zZqP2.js +2 -0
- package/dist/vue-ui-rings-DUEitXix.js +1 -0
- package/dist/vue-ui-scatter-D1XzJLsA.js +9 -0
- package/dist/{vue-ui-skeleton-BLyh-ESb.js → vue-ui-skeleton-Bpwe9ox7.js} +2 -2
- package/dist/{vue-ui-smiley-C00q-teB.js → vue-ui-smiley-AEw3JB0L.js} +1 -1
- package/dist/vue-ui-spark-trend-B3TKtyLN.js +1 -0
- package/dist/vue-ui-sparkbar-CjLLQ0Ja.js +1 -0
- package/dist/vue-ui-sparkgauge-9g7UUVWq.js +1 -0
- package/dist/vue-ui-sparkhistogram-B_rUkfjQ.js +1 -0
- package/dist/vue-ui-sparkline-BJj8LCeA.js +1 -0
- package/dist/vue-ui-sparkstackbar-B5rGYUUe.js +1 -0
- package/dist/vue-ui-stackbar-k0mVr3qM.js +29 -0
- package/dist/vue-ui-stackline-D1sDzsaB.js +17 -0
- package/dist/vue-ui-strip-plot-bZisAUWl.js +2 -0
- package/dist/vue-ui-table-YFjpQD5z.js +14 -0
- package/dist/vue-ui-table-heatmap-Bl_rGqXv.js +1 -0
- package/dist/{vue-ui-table-sparkline-itq8yRCe.js → vue-ui-table-sparkline-D-FHk6aF.js} +1 -1
- package/dist/vue-ui-thermometer-1gRm4qfW.js +1 -0
- package/dist/vue-ui-timer-Urv_5Bq7.js +65 -0
- package/dist/vue-ui-tiremarks-CUCnVEGx.js +1 -0
- package/dist/vue-ui-treemap-NgjoCq7g.js +1 -0
- package/dist/vue-ui-waffle-Cy9bR4eg.js +1 -0
- package/dist/vue-ui-wheel-DdwADpJ9.js +1 -0
- package/dist/vue-ui-word-cloud-I1lrCi6H.js +4 -0
- package/dist/vue-ui-world-CFZoRY_U.js +19 -0
- package/dist/vue-ui-xy-BjZ7rM8l.js +27 -0
- package/dist/vue-ui-xy-BqivEt9H.js +31 -0
- package/dist/{vue-ui-xy-canvas-CRSisgSA.js → vue-ui-xy-canvas-DGniRsGt.js} +2 -2
- package/dist/xyScaleTicks-DMX-D9Wd.js +1 -0
- package/dist/xyScales-Cb-Z9Qso.js +1 -0
- package/package.json +3 -3
- package/dist/BaseScanner-8NdoBs7B.js +0 -1
- package/dist/SlicerPreview-0m9E7Zh_.js +0 -1
- package/dist/Tooltip-C1q0Qoh7.js +0 -1
- package/dist/package-vXTjpYqq.js +0 -1
- package/dist/useConfig-_JwRfIqE.js +0 -1
- package/dist/usePanZoom-CE6Ofyy8.js +0 -1
- package/dist/vue-data-ui-0NKIVNqt.js +0 -1
- package/dist/vue-ui-3d-bar-Cs-_W1Av.js +0 -19
- package/dist/vue-ui-age-pyramid-cWWVFoCj.js +0 -1
- package/dist/vue-ui-annotator-D31LD4-s.js +0 -331
- package/dist/vue-ui-bullet-CMQzoLKs.js +0 -34
- package/dist/vue-ui-bump-SSu5eVbF.js +0 -8
- package/dist/vue-ui-candlestick-Cm9jS3n7.js +0 -22
- package/dist/vue-ui-carousel-table-D-F54W90.js +0 -1
- package/dist/vue-ui-chestnut-DNe1s8TT.js +0 -1
- package/dist/vue-ui-chord-DGzpBpuI.js +0 -21
- package/dist/vue-ui-circle-pack--iJQtXys.js +0 -13
- package/dist/vue-ui-cursor-B7DJRSGD.js +0 -1
- package/dist/vue-ui-dag-tsM65e_V.js +0 -9
- package/dist/vue-ui-dashboard-CC7IhQZu.js +0 -1
- package/dist/vue-ui-digits-hv2QeC-H.js +0 -42
- package/dist/vue-ui-donut-B9WXaiPn.js +0 -47
- package/dist/vue-ui-donut-evolution-Wz_-FYab.js +0 -2
- package/dist/vue-ui-dumbbell-p3Q2LkBV.js +0 -9
- package/dist/vue-ui-flow-BCH8YU8H.js +0 -3
- package/dist/vue-ui-funnel-DdrBD9oX.js +0 -1
- package/dist/vue-ui-galaxy-DYKEOEL-.js +0 -1
- package/dist/vue-ui-gauge-CPgvR_YB.js +0 -1
- package/dist/vue-ui-geo-DhJ3Wr_5.js +0 -1
- package/dist/vue-ui-gizmo-BTy4Vr1e.js +0 -1
- package/dist/vue-ui-heatmap-lti43RhW.js +0 -1
- package/dist/vue-ui-history-plot-DMTPygZA.js +0 -2
- package/dist/vue-ui-horizontal-bar-DwWo0CvX.js +0 -4
- package/dist/vue-ui-kpi-BTMK37Ix.js +0 -1
- package/dist/vue-ui-molecule-rbDnRA7c.js +0 -1
- package/dist/vue-ui-mood-radar-8s1jnO3P.js +0 -1
- package/dist/vue-ui-nested-donuts-8bY4HvC-.js +0 -19
- package/dist/vue-ui-onion-CgLNDFrZ.js +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-ms14eLus.js +0 -9
- package/dist/vue-ui-quadrant-6GgQZ8fW.js +0 -2
- package/dist/vue-ui-quick-chart-CzRbFXIS.js +0 -16
- package/dist/vue-ui-radar-BxsD2JBj.js +0 -1
- package/dist/vue-ui-relation-circle-BFPAlaWQ.js +0 -1
- package/dist/vue-ui-ridgeline-G2m7eFWe.js +0 -2
- package/dist/vue-ui-rings-l_BLWL48.js +0 -1
- package/dist/vue-ui-scatter-C4hXe3DM.js +0 -9
- package/dist/vue-ui-spark-trend-D0hz9kNt.js +0 -1
- package/dist/vue-ui-sparkbar-Dweyr8h-.js +0 -1
- package/dist/vue-ui-sparkgauge-DQfCXKFj.js +0 -1
- package/dist/vue-ui-sparkhistogram-DOfAu86W.js +0 -1
- package/dist/vue-ui-sparkline-DuX09S8A.js +0 -1
- package/dist/vue-ui-sparkstackbar-vXOpiyrI.js +0 -1
- package/dist/vue-ui-stackbar-DsrwNY0p.js +0 -29
- package/dist/vue-ui-stackline-e7EYZet7.js +0 -39
- package/dist/vue-ui-strip-plot-2DxzeUXU.js +0 -2
- package/dist/vue-ui-table-B344jLaG.js +0 -14
- package/dist/vue-ui-table-heatmap-BwoRcqFD.js +0 -1
- package/dist/vue-ui-thermometer-BSRjS7l3.js +0 -1
- package/dist/vue-ui-timer-DM-urc2D.js +0 -64
- package/dist/vue-ui-tiremarks-CbIOAO3F.js +0 -1
- package/dist/vue-ui-treemap-Cgal4H5O.js +0 -1
- package/dist/vue-ui-waffle-BZFI7JLd.js +0 -1
- package/dist/vue-ui-wheel-DdKm_Vd8.js +0 -1
- package/dist/vue-ui-word-cloud-D40vUb5e.js +0 -4
- package/dist/vue-ui-world-BseI3A0C.js +0 -19
- package/dist/vue-ui-xy-Bl-DUFcf.js +0 -27
- package/dist/vue-ui-xy-DNVd3FPA.js +0 -31
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as ee}from"./annotationSlots-OLiW25XN.js";import{t as o}from"./chartImage-DPGnEuYM.js";import{t as te}from"./resolveChartConfig-0IvbmIE_.js";import{$ as ne,Ft as re,S as ie,X as ae,_ as oe,at as se,i as ce,in as le,t as ue,yt as de,zt as fe}from"./lib-rPeBMZrn.js";import{n as pe}from"./useHints-C-TwxM0Y.js";import{t as me}from"./useConfig-9oDGTWWG.js";import{t as he}from"./usePrinter-DVf3YcG5.js";import{t as ge}from"./usePrefersMotion-XLHwega2.js";import{t as _e}from"./useResponsive-CENUxfEL.js";import{t as ve}from"./useChartExport-BZts4KFb.js";import{t as ye}from"./useUserOptionState-CXlFnwPv.js";import{t as be}from"./useChartAccessibility-DOMuYJfm.js";import{t as xe}from"./vue_ui_bullet-Biewiy1l.js";import{t as Se}from"./Legend-W9YVYVX-.js";import{n as Ce}from"./Title-BliHuXfT.js";import{t as we}from"./BaseScanner-m6QR9rwD.js";import{t as Te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as Ee,Teleport as De,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Oe,createVNode as ke,defineAsyncComponent as f,guardReactiveProps as p,mergeProps as m,normalizeClass as Ae,normalizeProps as h,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as g,ref as _,renderList as v,renderSlot as y,toDisplayString as b,unref as x,watch as S,withCtx as C}from"vue";var Pe=/* @__PURE__ */ e({default:()=>et}),Fe=[`id`],Ie={key:1,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Le=[`id`],Re=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],ze=[`id`],Be=[`id`],Ve=[`width`,`height`],He={key:1},Ue=[`x`,`y`,`height`,`width`,`fill`,`stroke`],We=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`],Ge=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ke={key:3},qe=[`x`,`y`,`fill`,`font-size`,`font-weight`],Je={key:4},Ye=[`x1`,`x2`,`y1`,`y2`,`stroke`],Xe={key:4,class:`vue-data-ui-watermark`},Ze=[`id`],Qe={key:0,class:`vue-ui-bullet-legend-item`,dir:`auto`},$e={style:{"margin-right":`2px`}},et=/*#__PURE__*/ Te({__name:`vue-ui-bullet`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:Te,emit:Pe}){let et=f(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),tt=f(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),nt=f(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),{vue_ui_bullet:rt}=me(),w=e,it=Pe,T=_(null),at=_(null),ot=_(null),st=_(null),ct=_(!1),lt=ge(),E=s(mt),ut=s(()=>{let e=w.dataset;return Number.isFinite(e?.value)&&Array.isArray(e?.segments)&&e.segments.length>0&&e.segments.every(e=>typeof e==`object`&&!!e&&`name`in e&&Number.isFinite(e.from)&&Number.isFinite(e.to))}),D=s(()=>!!E.value.loading||!ut.value),dt=s(()=>le({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,segments:{dataLabels:{show:!1},ticks:{stroke:`#8A8A8A`}},valueBar:{label:{show:!1}}}}},userConfig:E.value.skeletonConfig??{}})),O=s(()=>D.value?le({defaultConfig:E.value,userConfig:dt.value}):E.value),ft=s(()=>E.value.debug),k=s(()=>O.value.style.chart.target),A=s(()=>O.value.style.chart.segments),j=s(()=>O.value.style.chart),M=s(()=>O.value.userOptions),N=s(()=>Array.isArray(F.value?.segments)&&F.value.segments.length>0),pt=s(()=>j.value.padding);S([()=>w.dataset,ft],([e,t])=>{if(!t)return;if(fe(e)){se({componentName:`VueUiBullet`,type:`dataset`});return}let n=e.segments;if(!Array.isArray(n)||!n.length){let e=!n||Array.isArray(n)&&!n.length?`is empty`:`must be an array of objects`;console.warn(`VueUiBullet: dataset segments ${e}. Provide segments with this datastructure:\n
|
|
2
|
+
segments: [
|
|
3
|
+
{
|
|
4
|
+
name: string;
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
},
|
|
9
|
+
{...}
|
|
10
|
+
]
|
|
11
|
+
`)}else n.forEach((e,t)=>{let n=e&&typeof e==`object`?e:{},r=de({datasetObject:n,requiredAttributes:[`name`,`from`,`to`]});r.forEach(e=>se({componentName:`VueUiBullet segment`,type:`datasetSerieAttribute`,property:e,index:t}));for(let e of[`from`,`to`])!r.includes(e)&&!Number.isFinite(n[e])&&console.warn(`VueUiBullet segment at index ${t}: ${e} must be a finite number.`)}),Number.isFinite(e.value)||console.warn(`VueUiBullet: dataset value must be a finite number.`)},{immediate:!0,deep:!0}),Ne(()=>{ct.value=!0,Ct()});let P=_(ae());function mt(){return te(w.config,rt,xe)}pe({config:()=>O.value,dataset:()=>w.dataset,component:`VueUiBullet`,rules:[{test:e=>e?.segments&&e?.segments.length>8,message:[`👀 The number of target segments is > 8, which can make the chart hard to read and a large legend. Consider:`,``,`▶️ Using broader segments.`]}]});let ht=s(()=>O.value.userOptions.useCursorPointer),gt={value:100,target:100,segments:[{name:``,from:0,to:33,color:`#AAAAAA`},{name:``,from:33,to:66,color:`#BABABA`},{name:``,from:66,to:100,color:`#CACACA`}]},F=s(()=>D.value?w.config?.skeletonDataset??gt:w.dataset),{userOptionsVisible:I,setUserOptionsVisibility:_t,keepUserOptionState:vt}=ye({config:O.value}),{svgRef:L}=be({config:j.value.title}),R=_({width:j.value.width,height:j.value.height}),yt=s(()=>R.value.width),bt=s(()=>R.value.height),z=null,B=null,V=!1;function xt(){if(B=null,V||!O.value.responsive||!T.value?.parentNode)return;let{width:e,height:t}=_e({chart:T.value,title:j.value.title.text?at.value:null,legend:j.value.legend.show?ot.value:null,source:st.value,padding:pt.value});R.value={width:e,height:t-(j.value.legend.show?24:12)}}function St(){!V&&O.value.responsive&&B===null&&(B=requestAnimationFrame(xt))}function Ct(){z?.disconnect(),z=null,B!==null&&cancelAnimationFrame(B),B=null,V||(O.value.responsive&&T.value?.parentNode?(z=new ResizeObserver(St),z.observe(T.value.parentNode),St()):R.value={width:j.value.width,height:j.value.height})}S(()=>O.value.responsive,Ct,{flush:`post`}),S(j,()=>{O.value.responsive?St():R.value={width:j.value.width,height:j.value.height}},{deep:!0,flush:`post`}),S(()=>w.config,()=>{I.value=!M.value.showOnChartHover},{deep:!0});let H=s(()=>{let e=bt.value,t=yt.value,n=j.value.padding.left,r=t-j.value.padding.right,i=j.value.padding.top,a=e-j.value.padding.bottom;return{height:Math.max(.001,e),width:Math.max(.001,t),left:n,right:r,top:i,bottom:a,chartWidth:Math.max(.001,r-n),chartHeight:Math.max(.001,a-i)}}),wt=s(()=>{if(!N.value)return[];let e=[];for(let t=0;t<F.value.segments.length;t+=1)e.push(re(A.value.baseColor,t/F.value.segments.length));return e}),Tt=s(()=>N.value?{min:Math.min(...F.value.segments.map(e=>e.from)),max:Math.max(...F.value.segments.map(e=>e.to))}:{min:0,max:1}),U=s(()=>{let{min:e,max:t}=Tt.value;!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(t-e)||e>t?(e=0,t=1):e===t&&(e=Math.min(0,e),t=Math.max(0,t)||1);let n=Number(A.value.ticks.divisions);return oe(e,t,Number.isFinite(n)?Math.max(2,Math.min(1e3,Math.floor(n))):10)}),Et=s(()=>Math.min(0,U.value.min)),Dt=s(()=>U.value.max-Et.value||1);function W(e){return H.value.left+(e-Et.value)/Dt.value*H.value.chartWidth}let G=_(j.value.animation.show&&!D.value?Tt.value.min:F.value.value||0),K=null,Ot=0;function kt(){Ot+=1,K!==null&&cancelAnimationFrame(K),K=null}S([()=>F.value?.value,()=>j.value.animation.show,()=>j.value.animation.animationFrames,D,lt],([e,t,n])=>{kt();let r=Number.isFinite(e)?e:0;if(V)return;if(!t||D.value||lt.value||!Number.isFinite(n)||n<=0){G.value=r;return}let i=G.value,a=Math.ceil(n),ee=Ot,o=0;function te(){V||ee!==Ot||(K=null,o+=1,G.value=o>=a?r:i+(r-i)*o/a,o<a&&G.value!==r&&(K=requestAnimationFrame(te)))}te()},{immediate:!0});let At=s(()=>({scale:U.value,ticks:U.value.ticks.map(e=>({value:e,y:H.value.bottom+A.value.dataLabels.fontSize+3+A.value.dataLabels.offsetY,x:W(e)})),chunks:(N.value?F.value.segments:[]).map((e,t)=>({...e,color:e.color?ie(e.color):wt.value[t],x:W(e.from),y:H.value.top,height:H.value.chartHeight,width:H.value.chartWidth*Math.abs(e.to-e.from)/Dt.value}))})),q=s(()=>Number.isFinite(F.value?.target)),jt=s(()=>({x:W(q.value?F.value.target:0)-k.value.width/2})),J=s(()=>({...At.value,target:jt.value,value:{width:Math.max(0,W(G.value)-H.value.left)}})),Mt=s(()=>({x:jt.value.x,y:H.value.top+(H.value.chartHeight-H.value.chartHeight*k.value.heightRatio)/2,height:H.value.chartHeight*k.value.heightRatio,width:k.value.width,rx:k.value.rounded?k.value.width/2:0,fill:k.value.color,stroke:k.value.stroke,"stroke-width":k.value.strokeWidth}));function Y(e){let{formatter:t,prefix:n,suffix:r,rounding:i}=A.value.dataLabels;return ce(t,e,ne({p:n,v:e,s:r,r:i}))}let Nt=s(()=>Y(G.value)),Pt=s(()=>U.value.ticks.map(e=>Y(e))),Ft=s(()=>(N.value?F.value.segments:[]).map(e=>`${Y(e.from)} — ${Y(e.to)}`));Me(()=>{V=!0,kt(),B!==null&&cancelAnimationFrame(B),z?.disconnect()});let It=s(()=>At.value.chunks.map((e,t)=>({...e,shape:`square`,value:Ft.value[t],display:`${e.name}: ${Ft.value[t]}`}))),Lt=s(()=>({cy:`bullet-div-legend`,backgroundColor:`transparent`,color:j.value.legend.color,fontSize:j.value.legend.fontSize,paddingBottom:6,fontWeight:j.value.legend.bold?`bold`:``})),{isPrinting:X,isImaging:Z,generatePdf:Rt,generateImage:zt}=he({elementId:`bullet_${P.value}`,fileName:j.value.title.text||`vue-ui-bullet`,options:O.value.userOptions.print}),Bt=s(()=>O.value.userOptions.show&&!j.value.title.text),Q=_(!1);function Vt(e){Q.value=e}function Ht(){return J.value}let $=_(!1);function Ut(){$.value=!$.value}let Wt=o(T,()=>j.value.title.text),Gt=s(()=>It.value.map(e=>({...e,name:e.display}))),Kt=s(()=>j.value.backgroundColor),qt=s(()=>j.value.legend),Jt=s(()=>j.value.title),{isCallbackImaging:Yt,isCallbackSvg:Xt,generateSvg:Zt,onGenerateImage:Qt}=ve({svg:L,title:Jt,legend:qt,legendItems:Gt,backgroundColor:Kt,getSvgCallback:()=>O.value.userOptions.callbacks.svg,generateImage:zt});async function $t(){it(`copyAlt`,{config:O.value,dataset:F.value}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:F.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return Te({getData:Ht,getImage:Wt,generatePdf:Rt,generateImage:zt,generateSvg:Zt,toggleAnnotator:Ut,toggleFullscreen:Vt,copyAlt:$t}),(e,o)=>(g(),u(`div`,{ref_key:`bulletChart`,ref:T,class:Ae(`vue-data-ui-component vue-ui-bullet ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:je(`font-family:${O.value.style.fontFamily};width:100%;background:${j.value.backgroundColor};${O.value.responsive?`height:100%`:``}`),id:`bullet_${P.value}`,onMouseenter:o[0]||=()=>x(_t)(!0),onMouseleave:o[1]||=()=>x(_t)(!1)},[M.value.buttons.annotator?(g(),c(x(tt),m({key:0},x(a)(M.value.annotator),{svgRef:x(L),backgroundColor:j.value.backgroundColor,color:j.value.color,active:$.value,isCursorPointer:ht.value,palette:M.value.annotatorPalette,onClose:Ut}),Oe({_:2},[v(x(ee),t=>({name:t,fn:C(n=>[y(e.$slots,t,h(p(x(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),Bt.value?(g(),u(`div`,Ie)):l(``,!0),j.value.title.text?(g(),u(`div`,{key:2,ref_key:`chartTitle`,ref:at,style:`width:100%;background:transparent;`},[ke(Ce,{lineHeight:`1.3rem`,config:{title:{cy:`bullet-div-title`,...j.value.title},subtitle:{cy:`bullet-div-subtitle`,...j.value.title.subtitle}}},null,8,[`config`])],512)):l(``,!0),d(`div`,{id:`legend-top-${P.value}`},null,8,Le),M.value.show&&ut.value&&(x(vt)||x(I))?(g(),c(x(nt),m({key:3,backgroundColor:j.value.backgroundColor,color:j.value.color,isPrinting:x(X),isImaging:x(Z),uid:P.value,hasTooltip:!1,hasXls:!1,hasTable:!1,hasLabel:!1,isFullscreen:Q.value,chartElement:T.value},x(n)(M.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:$.value,isCursorPointer:ht.value,onToggleFullscreen:Vt,onGeneratePdf:x(Rt),onGenerateImage:x(Qt),onGenerateSvg:x(Zt),onToggleAnnotator:Ut,onCopyAlt:$t,style:{visibility:x(vt)?x(I)?`visible`:`hidden`:`visible`}}),Oe({_:2},[v(x(t)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[y(e.$slots,t,h(p(x(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):l(``,!0),(g(),u(`svg`,{ref_key:`svgRef`,ref:L,xmlns:x(ue),class:Ae({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value,"vue-ui-bullet-svg":!0}),viewBox:`0 0 ${H.value.width} ${H.value.height}`,style:je(`width: 100%; overflow: visible; background:transparent;color:${j.value.color}`),"aria-labelledby":`bullet-svg-title-${P.value}`,"aria-describedby":`bullet-svg-desc-${P.value}`},[ke(x(et)),y(e.$slots,`svg-underlayer`,{svg:{...H.value,isPrintingImg:x(X)||x(Z)||x(Yt),isPrintingSvg:x(Xt)}},void 0,!0),d(`title`,{id:`bullet-svg-title-${P.value}`},b(j.value.title.text||`Bullet chart`),9,ze),d(`desc`,{id:`bullet-svg-desc-${P.value}`},` Value: `+b(G.value)+`, Target: `+b(q.value?F.value.target:`-`),9,Be),e.$slots[`chart-background`]?(g(),u(`foreignObject`,{key:0,x:0,y:0,width:H.value.width,height:H.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,Ve)):l(``,!0),N.value?(g(),u(`g`,He,[(g(!0),u(Ee,null,v(J.value.chunks,e=>(g(),u(`rect`,{x:e.x,y:e.y,height:e.height,width:e.width,fill:e.color,"stroke-width":1,stroke:j.value.backgroundColor,style:{transition:`x 0.3s ease-in-out, width 0.3s ease-in-out`}},null,8,Ue))),256)),!k.value.onTop&&k.value.show&&q.value?(g(),u(`rect`,h(m({key:0},Mt.value)),null,16)):l(``,!0),d(`rect`,{x:H.value.left,y:H.value.top+(H.value.chartHeight-H.value.chartHeight*j.value.valueBar.heightRatio)/2,height:H.value.chartHeight*j.value.valueBar.heightRatio,width:J.value.value.width,fill:j.value.valueBar.color,stroke:j.value.valueBar.stroke,"stroke-width":j.value.valueBar.strokeWidth},null,8,We),j.value.valueBar.label.show?(g(),u(`text`,{key:1,x:H.value.left+J.value.value.width,y:H.value.top-6+j.value.valueBar.label.offsetY,"font-size":j.value.valueBar.label.fontSize,"font-weight":j.value.valueBar.label.bold?`bold`:`normal`,fill:j.value.valueBar.label.color,"text-anchor":`middle`},b(Nt.value),9,Ge)):l(``,!0),k.value.onTop&&k.value.show&&q.value?(g(),u(`rect`,m({key:2},Mt.value,{style:{transition:`x 0.3s ease-in-out`}}),null,16)):l(``,!0),A.value.dataLabels.show?(g(),u(`g`,Ke,[(g(!0),u(Ee,null,v(J.value.ticks,(e,t)=>(g(),u(`text`,{x:e.x,y:e.y,"text-anchor":`middle`,fill:A.value.dataLabels.color,"font-size":A.value.dataLabels.fontSize+`px`,"font-weight":A.value.dataLabels.bold?`bold`:`normal`},b(Pt.value[t]),9,qe))),256))])):l(``,!0),A.value.dataLabels.show&&A.value.ticks.show?(g(),u(`g`,Je,[(g(!0),u(Ee,null,v(J.value.ticks,e=>(g(),u(`line`,{x1:e.x,x2:e.x,y1:H.value.bottom,y2:H.value.bottom+3,stroke:A.value.ticks.stroke,"stroke-width":1,"stroke-linecap":`round`},null,8,Ye))),256))])):l(``,!0)])):l(``,!0),y(e.$slots,`svg`,{svg:{...H.value,isPrintingImg:x(X)||x(Z)||x(Yt),isPrintingSvg:x(Xt)}},void 0,!0)],14,Re)),e.$slots.watermark?(g(),u(`div`,Xe,[y(e.$slots,`watermark`,h(p({isPrinting:x(X)||x(Z)||x(Yt)||x(Xt)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${P.value}`},null,8,Ze),ct.value&&(j.value.legend.show||e.$slots.legend)?(g(),c(De,{key:5,to:j.value.legend.position===`top`?`#legend-top-${P.value}`:`#legend-bottom-${P.value}`},[d(`div`,{ref_key:`chartLegend`,ref:ot},[y(e.$slots,`legend`,{legend:It.value},()=>[j.value.legend.show?(g(),c(Se,{key:0,clickable:!1,legendSet:It.value,config:Lt.value},{item:C(({legend:e})=>[D.value?l(``,!0):(g(),u(`div`,Qe,[d(`span`,$e,b(e.name)+`:`,1),d(`span`,null,b(e.value),1)]))]),_:1},8,[`legendSet`,`config`])):l(``,!0)],!0)],512)],8,[`to`])):l(``,!0),e.$slots.source?(g(),u(`div`,{key:6,ref_key:`source`,ref:st,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[D.value?(g(),c(we,{key:0})):l(``,!0)],!0)],46,Fe))}},[[`__scopeId`,`data-v-1adea5f1`]]);export{Pe as n,et as t};
|
|
@@ -0,0 +1,8 @@
|
|
|
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 ee}from"./tableIntegration-CNoJ1CIY.js";import{t as c}from"./chartImage-DPGnEuYM.js";import{$ as l,D as te,Ht as ne,J as re,P as ie,S as ae,U as oe,X as se,at as ce,c as le,i as ue,in as de,nt as fe,r as pe,t as me,w as he,yt as ge,zt as _e}from"./lib-rPeBMZrn.js";import{n as ve,t as ye}from"./useHints-C-TwxM0Y.js";import{t as be}from"./useConfig-9oDGTWWG.js";import{t as xe}from"./useSvgLabelLayout-42Kats14.js";import{t as Se}from"./useLoading-BwiplGDB.js";import{t as Ce}from"./usePrinter-DVf3YcG5.js";import{n as we}from"./resolveChartConfig-0IvbmIE_.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./useTimeLabels-Das5O74F.js";import{t as De}from"./useChartExport-BZts4KFb.js";import{t as Oe}from"./useUserOptionState-CXlFnwPv.js";import{t as ke}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ae}from"./useTimeLabelCollider-BTybMUFi.js";import{t as je}from"./vue_ui_bump-DZoGcET0.js";import{n as Me}from"./Title-BliHuXfT.js";import{t as Ne}from"./BaseScanner-m6QR9rwD.js";import{t as Pe}from"./A11yDataTable-DWNlWXzs.js";import{t as Fe}from"./BaseDraggableDialog-DVstuNhT.js";import{t as Ie}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Le,createTextVNode as Re,createVNode as ze,defineAsyncComponent as g,guardReactiveProps as Be,mergeProps as _,normalizeClass as Ve,normalizeProps as He,normalizeStyle as v,onBeforeUnmount as Ue,onMounted as We,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ge,shallowRef as Ke,toDisplayString as C,toHandlers as qe,toRefs as Je,unref as w,watch as T,watchEffect as Ye,withCtx as E}from"vue";var Xe=/* @__PURE__ */ e({default:()=>mt}),Ze=[`id`],Qe=[`id`],$e={style:{position:`relative`}},et=[`xmlns`,`aria-describedby`,`viewBox`],tt=[`x`,`y`,`width`,`height`],nt=[`d`,`stroke`,`stroke-width`,`onMouseenter`],rt=[`d`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],it=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],at=[`x`,`y`,`fill`,`font-size`],ot=[`x`,`y`,`fill`,`font-size`],st=[`x`,`y`,`fill`,`font-size`,`font-weight`,`text-anchor`,`innerHTML`,`onMouseenter`,`onMouseleave`,`onClick`],ct={key:0},lt={key:1},ut=[`text-anchor`,`font-size`,`font-weight`,`fill`,`stroke`,`transform`],dt=[`text-anchor`,`font-size`,`fill`,`transform`,`innerHTML`],ft={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},pt={key:5,class:`vue-data-ui-watermark`},mt=/*#__PURE__*/ Ie({__name:`vue-ui-bump`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:Ie,emit:Xe}){let mt=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),ht=g(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),gt=g(()=>import(`./DataTable-KeuZB1JM.js`)),_t=g(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),vt=g(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),yt=g(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),{vue_ui_bump:bt}=be(),D=e,xt=Xe,St=d(()=>!!D.dataset?.length),O=b(null),k=b(se()),Ct=b(0),wt=b(null),Tt=b(null),Et=b(null),Dt=b(!1),Ot=b(0),kt=b(0),At=b(null),jt=b(null),A=b(null),Mt=b(null),Nt=b(null),Pt=b(null),j=b(null),M=d(()=>{let e=Y.value.findIndex(e=>e.id===j.value);return e<0?null:e}),Ft=b(!1),N=b(Vt()),P=d(()=>N.value.style.chart.layout.plots),F=d(()=>N.value.style.chart.layout),I=d(()=>N.value.style.chart),L=d(()=>N.value.userOptions);ve({config:()=>N.value,dataset:()=>D.dataset,component:`VueUiBump`,rules:[ye.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display`,``,`▶️ Use several instances of the component to show related series`]},{test:e=>e.length===1,message:[`👀 There is only 1 series in your dataset. Consider:`,``,`▶️ Using a line chart, with VueUiXy.`]},{test:e=>e.some(e=>(e?.values?.length||0)>31),message:[`👀 Some series contain > 31 data points, which can make the chart hard to read. Consider:`,``,`▶️ Use filters to show less data points at a time.`,``,`▶️ Use larger time scales, or aggregated values.`]}]});let R=d(()=>N.value.userOptions.useCursorPointer),It=d(()=>de({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{timeLabels:{show:!1},lines:{coatingColor:`#4A4A4A`},plots:{stroke:`#4A4A4A`,labels:{show:!1,displayedValue:`rank`}},nameLabels:{useSerieColor:!0}}}}},userConfig:N.value.skeletonConfig??{}})),{loading:z,FINAL_DATASET:Lt,manualLoading:Rt}=Se({...Je(D),FINAL_CONFIG:N,prepareConfig:Vt,skeletonDataset:D.config?.skeletonDataset??[{name:`————`,values:[1,1,1,2,2,2,3,3,2,2],color:`#4A4A4A`},{name:`————`,values:[2,2,2,1,3,3,2,2,3,3],color:`#6A6A6A`},{name:`————`,values:[3,3,3,3,1,1,1,1,1,1],color:`#8A8A8A`}],skeletonConfig:de({defaultConfig:N.value,userConfig:It.value})}),zt=b(!1),Bt=0;We(sn);function Vt(){return we(D.config,bt,je)}let{userOptionsVisible:Ht,setUserOptionsVisibility:Ut,keepUserOptionState:Wt}=Oe({config:N.value}),{svgRef:B}=ke({config:I.value.title});function Gt(){Ut(!0)}function Kt(){Ut(!1)}let V=b({showTable:N.value.table.show});T(N,()=>{V.value={showTable:N.value.table.show}},{immediate:!0}),T(()=>D.config,e=>{z.value||(N.value=Vt()),Ht.value=!N.value.userOptions.showOnChartHover,an(),Ot.value+=1,kt.value+=1,V.value.showTable=N.value.table.show},{deep:!0});let{isPrinting:qt,isImaging:Jt,generatePdf:Yt,generateImage:Xt}=Ce({elementId:`bump_${k.value}`,fileName:I.value.title.text||`vue-ui-bump`,options:N.value.userOptions.print}),Zt=d(()=>N.value.userOptions.show&&!I.value.title.text),H=b({width:I.value.width,height:I.value.height}),Qt=d(()=>({left:I.value.width?I.value.padding.left/I.value.width:0,right:I.value.width?I.value.padding.right/I.value.width:0})),$t=d(()=>he(N.value.customPalette)),en=Ke(null),tn=null,nn=!1,rn=d(()=>N.value.debug);function an(){let e=!1;_e(D.dataset)&&ce({componentName:`VueUiBump`,type:`dataset`,debug:rn.value});for(let[t,n]of(Array.isArray(D.dataset)?D.dataset:[]).entries())if(!n||typeof n!=`object`)e=!0;else{for(let r of ge({datasetObject:n,requiredAttributes:[`name`,`values`]}))e=!0,ce({componentName:`VueUiBump`,type:`datasetSerieAttribute`,property:r,index:t,debug:rn.value});Array.isArray(n.values)||(e=!0)}Rt.value=e}function on(){tn=null,cancelAnimationFrame(Bt),en.value?.disconnect(),en.value=null}function sn(){if(on(),!N.value.responsive){H.value={width:I.value.width,height:I.value.height};return}let e=O.value?.parentNode;if(!e)return;let t=()=>{cancelAnimationFrame(Bt),Bt=requestAnimationFrame(()=>{if(nn)return;let{width:e,height:t}=Te({chart:O.value,noTitle:Tt.value,title:I.value.title.text?wt.value:null,legend:null,slicer:null,source:Et.value});H.value={width:e,height:t-12},zt.value=!0})};tn=t,en.value=new ResizeObserver(t),en.value.observe(e),t()}Ue(()=>{nn=!0,Tn++,on()});let cn=d(()=>{let e=/* @__PURE__ */ new Set;return Lt.value.map((t,n)=>{let r=t||{},i=r.id??`bump_${k.value}_${n}`,a=e.has(i)?`bump_duplicate_${k.value}_${n}`:i;e.add(a);let o=ae(r.color)||$t.value[n]||ne[n]||ne[n%ne.length];return{...r,absoluteIndex:n,id:a,values:Array.isArray(r.values)?r.values:[],color:o}})}),U=d(()=>Math.max(0,...Lt.value.map(e=>e?.values?.length||0))),ln=d(()=>un(Lt.value));function un(e){let t=e.map(()=>Array(U.value).fill(null));for(let n=0;n<U.value;n+=1){let r=e.map((e,r)=>({seriesIndex:r,value:e?.values?.[n],previousPosition:n>0&&Number.isFinite(t[r][n-1])?t[r][n-1]:r})).filter(e=>Number.isFinite(e.value));r.sort((e,t)=>t.value===e.value?e.previousPosition-t.previousPosition||e.seriesIndex-t.seriesIndex:t.value-e.value);for(let e=0;e<r.length;e+=1){let i=r[e];t[i.seriesIndex][n]=e}}return t}let{metrics:dn,ready:fn,settling:pn,update:mn}=xe({svgRef:B,canMeasure:()=>(!N.value.responsive||zt.value)&&(!F.value.timeLabels.show||wn.value),initialMetrics:{left:0,right:0,bottom:0},measure:e=>F.value.timeLabels.autoRotate.enable&&Fn()?null:{left:e(Mt.value).width,right:e(Nt.value).width,bottom:e(Pt.value).height}}),hn=d(()=>F.value.timeLabels.show&&En.value.length?dn.value.bottom+Math.abs(F.value.timeLabels.offsetY)+F.value.timeLabels.fontSize*.3:0),W=d(()=>{let{height:e,width:t}=H.value,{right:n,left:r}=Qt.value,i=dn.value.left,a=dn.value.right,o=I.value.padding.top,s=t-t*n-a,ee=t*r+i,c=t-t*n-t*r-i-a,l=e-o-I.value.padding.bottom-hn.value,te=o+l,ne=o+l,re=Math.max(0,e);return{chartHeight:ne,chartWidth:Math.max(0,t),top:o,right:Math.max(0,s),bottom:Math.max(0,te),left:Math.max(0,ee),width:Math.max(0,c),height:Math.max(0,l),unitH:cn.value.length?Math.max(0,l)/cn.value.length:0,unitW:U.value?Math.max(0,c)/U.value:0,svgHeight:re}}),gn=d(()=>Lt.value.map(e=>Array.from({length:U.value},(t,n)=>ue(P.value.labels.formatter,e?.values?.[n],l({p:P.value.labels.prefix,v:e?.values?.[n],s:P.value.labels.suffix,r:P.value.labels.rounding}))))),G=d(()=>!St.value&&!z.value?[]:cn.value.map((e,t)=>({...e,positions:ln.value[t]})).map(e=>{let t=e.positions.map((t,n)=>{let r=gn.value[e.absoluteIndex][n];return{name:e.name,id:e.id,x:W.value.left+n*W.value.unitW+W.value.unitW/2,y:t==null?null:W.value.top+t*W.value.unitH+W.value.unitH/2,value:e.values[n],displayValue:r,rank:t==null?null:t+1,color:e.color,labelColor:P.value.labels.color===`auto`?pe(e.color):ae(P.value.labels.color)??pe(e.color)}}),n=t.filter(e=>Number.isFinite(e.value)),r=F.value.lines.smooth?ie(n):oe(n);return{...e,coordinates:t,path:r}})),_n=d(()=>new Map(G.value.map(e=>[e.id,e.coordinates.filter(e=>Number.isFinite(e.value))]))),vn=d(()=>G.value.filter(e=>K(e).length));function K(e){return _n.value.get(e.id)||[]}function yn(e,t){let n={...e,pointIndex:t.coordinates.indexOf(e)};return{mouseenter:()=>Zn(n,t),mouseleave:()=>Qn(n,t),click:()=>$n(n,t)}}function q(e){return A.value==null||A.value===e.id?1:.1}function bn(e,t,n,r){let i=e.toSorted((e,t)=>e.y-t.y);for(let e=1;e<i.length;e+=1){let n=i[e-1],r=i[e];r.y<n.y+t&&(r.y=n.y+t)}let a=i.length-1;if(a>=0&&i[a].y>r){i[a].y=r;for(let e=a-1;e>=0;--e){let n=i[e+1],r=i[e];r.y>n.y-t&&(r.y=n.y-t)}}if(i.length&&i[0].y<n){let e=n-i[0].y;for(let t=0;t<i.length;t+=1)i[t].y+=e}return i}let xn=d(()=>{let e=[],t=[];G.value.forEach(n=>{let r=K(n);if(!r.length)return;e.push({...r[0]});let i=r[r.length-1];t.push({...i})});let n=F.value.nameLabels.fontSize,r=n*1.4,i=W.value.top+n,a=W.value.bottom-n,o=bn(t,r,i,a);return{left:bn(e,r,i,a),right:o}}),Sn=[{key:`left`,anchor:`end`,sign:-1,setRef:e=>{Mt.value=e}},{key:`right`,anchor:`start`,sign:1,setRef:e=>{Nt.value=e}}];function Cn(e){let t=P.value.labels.fontSize*.4,n=String(e.displayValue),r=n.length*(P.value.labels.fontSize*(n.length===1?1:.6)),i=P.value.labels.fontSize,a=r+t*2,o=i+t*2,s=e.x-a/2,ee=e.y-o/2,c=P.value.strokeWidth;return{x:s-c/2,y:ee-c/2,width:a+c,height:o+c,fill:e.color,stroke:P.value.stroke,"stroke-width":c,rx:o/2}}let J=b([]),wn=b(!1),Tn=0;Ye(()=>{let e=++Tn,t=F.value.timeLabels,n=t.values,r=t.datetimeFormatter,i=U.value;i?(async()=>{let t=await Ee({values:Array.isArray(n)?n:[],maxDatapoints:i,formatter:r,start:0,end:i});!nn&&e===Tn&&(J.value=t,wn.value=!0)})():(J.value=[],wn.value=!0)});let En=d(()=>{let e=F.value.timeLabels;if(!Array.isArray(e.values)||!e.values.length)return[];let t=J.value.map(e=>e?.text??``);return le(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Math.max(1,Number(e.modulo)||1),t,t,0,null,U.value)}),Dn=d(()=>H.value.width),On=d(()=>H.value.height),kn=d(()=>({start:0,end:U.value})),Y=d(()=>[...vn.value].map(e=>{let t=[...e.coordinates].filter(e=>Number.isFinite(e.value)).at(-1);return{...e,navigationRank:t?.rank??1/0}}).sort((e,t)=>e.navigationRank-t.navigationRank));function An(){j.value=null,Ft.value=!0}function jn(){Nn(),Ft.value=!1}function Mn(e,t){let n=Y.value.length;return n?e===null||e<0||e>=n?0:t===`previous`?(e-1+n)%n:(e+1)%n:null}function Nn(){if(M.value!==null){let e=Y.value[M.value];e&&Qn(e,e)}j.value=null,A.value=null}function Pn(e){if(!B.value||Z.value||document.activeElement!==B.value||!Y.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){Nn();return}if(r){if(M.value===null)return;let e=Y.value[M.value];if(!e)return;$n(e,e);return}let a=M.value;a===null?a=0:t?a=Mn(a,`previous`):n&&(a=Mn(a,`next`));let o=Y.value[a];o&&(j.value=o.id,Zn(o,o))}let X=d(()=>({head:$.value.head,body:Un.value,caption:N.value.a11y.translations.tableCaption,notice:N.value.a11y.translations.tableAvailable})),{detectTimeLabelCollisionNow:Fn}=Ae({timeLabelsEls:Pt,timeLabels:J,slicer:kn,configRef:N,rotationPath:[`style`,`chart`,`layout`,`timeLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`layout`,`timeLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:Dn,height:On,rotation:F.value.timeLabels.autoRotate.angle,resizeDebounceMs:0}),Z=b(!1);function In(){Z.value=!Z.value}function Ln(e){Dt.value=e,Ct.value+=1}function Rn(){V.value.showTable=!V.value.showTable}T(()=>V.value.showTable,e=>s(e,N,At));function zn(){V.value.showTable=!1,jt.value&&jt.value.setTableIconState(!1)}function Bn(){return G.value}function Vn(e=null){let t=[[I.value.title.text],[I.value.title.subtitle.text],[``]],n=Hn.value,r=G.value.map(e=>[e.name,...e.coordinates.map(e=>Number.isFinite(e.value)?`${e.displayValue}`:`-`)]),i=G.value.map(e=>[e.name,...e.coordinates.map(e=>e.rank==null?`-`:`${e.rank}`)]),a=t.concat([[N.value.table.columnNames.values]]).concat([n]).concat(r).concat([[``],[N.value.table.columnNames.ranking],[n]]).concat(i),o=te(a);e?e(o):fe({csvContent:o,title:I.value.title.text||`vue-ui-bump`})}let Q=d(()=>ee({config:N,style:I,mutableConfig:V,dialog:Fe,accordion:ht,isFullscreen:Dt,parent:O,maxWidth:800,isCursorPointer:R})),Hn=d(()=>[``,...Array.from({length:U.value},(e,t)=>J.value[t]?.text??String(t))]),Un=d(()=>G.value.map(e=>[e.name,...e.coordinates.map(e=>Number.isFinite(e.value)?`${e.displayValue} (${e.rank})`:`-`)])),$=d(()=>({head:Hn.value,body:Un.value,config:{th:{backgroundColor:N.value.table.th.backgroundColor,color:N.value.table.th.color,outline:N.value.table.th.outline},td:{backgroundColor:N.value.table.td.backgroundColor,color:N.value.table.td.color,outline:N.value.table.td.outline},breakpoint:N.value.table.responsiveBreakpoint},colNames:[N.value.table.columnNames.series]})),Wn=d(()=>I.value.backgroundColor),Gn=d(()=>I.value.title),{isCallbackImaging:Kn,isCallbackSvg:qn,generateSvg:Jn,onGenerateImage:Yn}=De({svg:B,title:Gn,legend:null,legendItems:null,backgroundColor:Wn,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Xt}),Xn=c(O,()=>I.value.title.text);function Zn(e,t){A.value=t.id,N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:e?.pointIndex??null})}function Qn(e,t){A.value=null,N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:e?.pointIndex??null})}function $n(e,t){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:e?.pointIndex??null})}async function er(){xt(`copyAlt`,{config:N.value,dataset:G.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return T(()=>D.dataset,an,{deep:!0,immediate:!0}),T([()=>N.value.responsive,()=>I.value.width,()=>I.value.height],sn,{flush:`post`}),T(I,()=>tn?.(),{flush:`post`}),T(z,e=>{e&&(A.value=null,j.value=null)}),T(vn,e=>{A.value!=null&&!e.some(e=>e.id===A.value)&&(A.value=null),j.value!=null&&!e.some(e=>e.id===j.value)&&(j.value=null)}),Ie({getData:Bn,getImage:Xn,generatePdf:Yt,generateCsv:Vn,generateImage:Xt,generateSvg:Jn,toggleTable:Rn,toggleAnnotator:In,toggleFullscreen:Ln,copyAlt:er}),T(()=>[H.value.width,H.value.height,F.value,J.value,wn.value,Mt.value,Nt.value,Pt.value,D.dataset,zt.value,N.value.style.fontFamily],mn,{flush:`post`,deep:!0}),(e,s)=>(y(),m(`div`,{id:`bump_${k.value}`,ref_key:`bumpChart`,ref:O,class:Ve({"vue-data-ui-component":!0,"vue-ui-bump":!0,"vue-data-ui-wrapper-fullscreen":Dt.value}),style:v(`background:${I.value.backgroundColor};color:${I.value.color};font-family:${N.value.style.fontFamily}; position: relative; ${N.value.responsive?`height: 100%`:``}`),onMouseenter:Gt,onMouseleave:Kt},[h(`p`,{id:`chart-instructions-${k.value}`,class:`sr-only`},C(N.value.a11y.translations.keyboardNavigation),9,Qe),N.value.a11y.includeTable&&X.value.body.length?(y(),f(Pe,{key:0,uid:k.value,head:X.value.head,body:X.value.body,caption:X.value.caption,notice:X.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):p(``,!0),L.value.buttons.annotator?(y(),f(w(_t),_({key:1},w(a)(L.value.annotator),{svgRef:w(B),backgroundColor:I.value.backgroundColor,color:I.value.color,active:Z.value,isCursorPointer:R.value,palette:L.value.annotatorPalette,onClose:In}),Le({_:2},[x(w(o),t=>({name:t,fn:E(n=>[S(e.$slots,t,He(Be(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),Zt.value?(y(),m(`div`,{key:2,ref_key:`noTitle`,ref:Tt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),I.value.title.text?(y(),m(`div`,{key:3,ref_key:`chartTitle`,ref:wt,style:`width:100%;background:transparent;`},[(y(),f(Me,{key:`title_${Ot.value}`,config:{title:{cy:`bump-title`,...I.value.title},subtitle:{cy:`bump-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),L.value.show&&St.value&&(w(Wt)||w(Ht))?(y(),f(w(vt),_({ref_key:`userOptionsRef`,ref:jt,key:`user_option_${Ct.value}`,backgroundColor:I.value.backgroundColor,color:I.value.color,isPrinting:w(qt),isImaging:w(Jt),uid:k.value,hasTooltip:!1,hasLabel:!1,isFullscreen:Dt.value,chartElement:O.value},w(n)(L.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Z.value,tableDialog:N.value.table.useDialog,isCursorPointer:R.value,onToggleFullscreen:Ln,onGeneratePdf:w(Yt),onGenerateCsv:Vn,onGenerateImage:w(Yn),onGenerateSvg:w(Jn),onToggleTable:Rn,onToggleAnnotator:In,onCopyAlt:er,style:{visibility:w(Wt)?w(Ht)?`visible`:`hidden`:`visible`}}),Le({_:2},[x(w(t)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[S(e.$slots,t,He(Be(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),h(`div`,$e,[(y(),m(`svg`,{ref_key:`svgRef`,ref:B,xmlns:w(me),"aria-describedby":`chart-instructions-${k.value}`,viewBox:`0 0 ${W.value.chartWidth<=0?10:W.value.chartWidth} ${W.value.svgHeight<=0?10:W.value.svgHeight}`,class:Ve({"vue-data-ui-loading":w(z),"no-transition":!N.value.useCssAnimation}),style:v(`max-width:100%;overflow:visible;background:transparent;color:${I.value.color};visibility:${w(fn)?`visible`:`hidden`}`),role:`img`,"aria-live":`polite`,preserveAspectRatio:`xMidYMid`,tabindex:`0`,onFocus:An,onBlur:jn,onKeydown:Pn},[ze(w(yt)),S(e.$slots,`svg-underlayer`,{svg:{drawingArea:W.value,data:G.value,isPrintingImg:w(qt)||w(Jt)||w(Kn),isPrintingSvg:w(qn)}},void 0,!0),e.$slots[`chart-background`]?(y(),m(`foreignObject`,{key:0,x:W.value.left,y:W.value.top,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,tt)):p(``,!0),(y(!0),m(u,null,x(vn.value,e=>(y(),m(u,null,[h(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:F.value.lines.coatingColor,"stroke-width":F.value.lines.strokeWidth+2,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:v({opacity:q(e)}),onMouseenter:t=>A.value=e.id,onMouseleave:s[0]||=e=>A.value=null},null,44,nt),h(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:e.color,"stroke-width":F.value.lines.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:v({opacity:q(e)}),onMouseenter:t=>Zn(e,e),onMouseleave:t=>Qn(e,e),onClick:t=>$n(e,e)},null,44,rt)],64))),256)),(y(!0),m(u,null,x(vn.value,e=>(y(),m(u,null,[P.value.labels.displayedValue===`rank`?(y(!0),m(u,{key:0},x(K(e),t=>(y(),m(`circle`,_({class:`transition-opacity`,cx:t.x,cy:t.y,r:P.value.radius,fill:e.color,stroke:P.value.stroke,"stroke-width":P.value.strokeWidth,style:{opacity:q(e)}},qe(yn(t,e),!0)),null,16,it))),256)):p(``,!0),P.value.labels.show&&P.value.labels.displayedValue===`rank`?(y(!0),m(u,{key:1},x(K(e),t=>(y(),m(`text`,{class:`transition-opacity`,x:t.x,y:t.y+P.value.labels.fontSize/3,fill:t.labelColor,"font-size":P.value.labels.fontSize,"text-anchor":`middle`,style:v({userSelect:`none`,pointerEvents:`none`,opacity:q(e)})},C(t.rank),13,at))),256)):p(``,!0),P.value.labels.displayedValue===`value`?(y(!0),m(u,{key:2},x(K(e),t=>(y(),m(u,null,[Number.isFinite(t.value)?(y(),m(`rect`,_({key:0,class:`transition-opacity`},{ref_for:!0},Cn(t),{style:{opacity:q(e)}},qe(yn(t,e),!0)),null,16)):p(``,!0),Number.isFinite(t.value)&&P.value.labels.show?(y(),m(`text`,{key:1,class:`transition-opacity`,x:t.x,y:t.y+P.value.labels.fontSize/3,fill:t.labelColor,"font-size":P.value.labels.fontSize,"text-anchor":`middle`,style:v({userSelect:`none`,pointerEvents:`none`,opacity:q(e)})},C(t.displayValue),13,ot)):p(``,!0)],64))),256)):p(``,!0)],64))),256)),(y(),m(u,null,x(Sn,e=>(y(),m(u,{key:e.key},[F.value.nameLabels[`${e.key}Labels`].show?(y(),m(`g`,{key:0,ref_for:!0,ref:e.setRef},[(y(!0),m(u,null,x(xn.value[e.key],t=>(y(),m(`text`,{class:`transition-opacity`,key:t.id,x:W.value[e.key],y:t.y+F.value.nameLabels.fontSize/3,fill:F.value.nameLabels.useSerieColor?t.color:F.value.nameLabels.color,"font-size":F.value.nameLabels.fontSize,"font-weight":F.value.nameLabels.bold?`bold`:`normal`,"text-anchor":e.anchor,innerHTML:w(re)({content:t.name,fontSize:F.value.nameLabels.fontSize,fill:F.value.nameLabels.useSerieColor?t.color:F.value.nameLabels.color,x:W.value[e.key]+e.sign*F.value.nameLabels.offsetX,y:t.y+F.value.nameLabels.fontSize/3,translateY:!0}),style:v({opacity:q(t)}),onMouseenter:e=>Zn(t,t),onMouseleave:e=>Qn(t,t),onClick:e=>$n(t,t)},null,44,st))),128))],512)):p(``,!0)],64))),64)),F.value.timeLabels.show?(y(),m(`g`,{key:1,ref_key:`timeLabelsEls`,ref:Pt},[e.$slots[`time-label`]?(y(),m(`g`,ct,[(y(!0),m(u,null,x(En.value,(t,n)=>(y(),m(`g`,null,[S(e.$slots,`time-label`,_({ref_for:!0},{x:W.value.unitW*n+W.value.unitW/2+W.value.left,y:W.value.chartHeight+F.value.timeLabels.offsetY,fontSize:F.value.timeLabels.fontSize,fill:F.value.timeLabels.color,transform:`translate(${W.value.unitW*n+W.value.unitW/2+W.value.left}, ${W.value.chartHeight+F.value.timeLabels.offsetY}), rotate(${F.value.timeLabels.rotation})`,absoluteIndex:t.absoluteIndex,content:t.text,textAnchor:F.value.timeLabels.rotation>0?`start`:I.value.layout.timeLabels.rotation<0?`end`:`middle`,show:!0}),void 0,!0)]))),256))])):(y(),m(`g`,lt,[(y(!0),m(u,null,x(En.value,(e,t)=>(y(),m(`g`,null,[String(e.text).includes(`
|
|
2
|
+
`)?(y(),m(`text`,{key:t+`-multi`,"text-anchor":F.value.timeLabels.rotation>0?`start`:F.value.timeLabels.rotation<0?`end`:`middle`,"font-size":F.value.timeLabels.fontSize,fill:F.value.timeLabels.color,transform:`
|
|
3
|
+
translate(
|
|
4
|
+
${W.value.unitW*t+W.value.unitW/2+W.value.left},
|
|
5
|
+
${W.value.chartHeight+F.value.timeLabels.fontSize*1.3+F.value.timeLabels.offsetY}
|
|
6
|
+
),
|
|
7
|
+
rotate(${F.value.timeLabels.rotation})
|
|
8
|
+
`,innerHTML:w(re)({content:String(e.text),fontSize:F.value.timeLabels.fontSize,fill:I.value.layout.timeLabels.color,stroke:I.value.backgroundColor,x:0,y:0})},null,8,dt)):(y(),m(`text`,{class:`vue-data-ui-time-label`,key:t,"text-anchor":F.value.timeLabels.rotation>0?`start`:F.value.timeLabels.rotation<0?`end`:`middle`,"font-size":F.value.timeLabels.fontSize,"font-weight":F.value.timeLabels.bold?`bold`:`normal`,fill:F.value.timeLabels.color,stroke:I.value.backgroundColor,"stroke-width":`3`,"stroke-linejoin":`round`,"stroke-linecap":`round`,"paint-order":`stroke fill`,transform:`translate(${W.value.unitW*t+W.value.unitW/2+W.value.left}, ${W.value.chartHeight+F.value.timeLabels.offsetY}), rotate(${F.value.timeLabels.rotation})`},C(e.text),9,ut))]))),256))]))],512)):p(``,!0),S(e.$slots,`svg`,{svg:{drawingArea:W.value,data:G.value,isPrintingImg:w(qt)||w(Jt)||w(Kn),isPrintingSvg:w(qn)}},void 0,!0)],46,et)),e.$slots.hint?(y(),m(`div`,ft,[S(e.$slots,`hint`,He(Be({hint:N.value.a11y.translations.keyboardNavigation,isVisible:Ft.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(y(),m(`div`,pt,[S(e.$slots,`watermark`,He(Be({isPrinting:w(qt)||w(Jt)||w(Kn)||w(qn)})),void 0,!0)])):p(``,!0),St.value&&L.value.buttons.table?(y(),f(Ge(Q.value.component),_({key:6},Q.value.props,{ref_key:`tableUnit`,ref:At,onClose:zn}),Le({content:E(()=>[ze(w(gt),{colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:N.value.table.useDialog?``:Q.value.title,withCloseButton:!N.value.table.useDialog,isCursorPointer:R.value,onClose:zn},{th:E(({th:e})=>[h(`div`,null,C(e),1)]),td:E(({td:e})=>[Re(C(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[N.value.table.useDialog?{name:`title`,fn:E(()=>[Re(C(Q.value.title),1)]),key:`0`}:void 0,N.value.table.useDialog?{name:`actions`,fn:E(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[1]||=e=>Vn(L.value.callbacks.csv),style:v({cursor:R.value?`pointer`:`default`})},[ze(w(mt),{name:`fileCsv`,stroke:Q.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),e.$slots.source?(y(),m(`div`,{key:7,ref_key:`source`,ref:Et,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[w(z)?(y(),f(Ne,{key:0})):p(``,!0)],!0)],46,Ze))}},[[`__scopeId`,`data-v-d2d05051`]]);export{Xe as n,mt as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
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"./annotationViewport-X8fvs7pz.js";import{n as ee,t as c}from"./tableIntegration-CNoJ1CIY.js";import{$ as te,D as ne,Dt as re,Jt as ie,Qt as ae,X as oe,Yt as se,_ as ce,_t as le,at as ue,b as l,c as de,gt as fe,in as pe,nt as me,rn as he,t as ge,wt as _e,zt as ve}from"./lib-rPeBMZrn.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./useConfig-9oDGTWWG.js";import{t as Se}from"./useSvgLabelLayout-42Kats14.js";import{n as Ce,r as we,t as Te}from"./useTimeLabels-Das5O74F.js";import{t as Ee}from"./usePrinter-DVf3YcG5.js";import{t as De}from"./useLoading-BwiplGDB.js";import{t as Oe}from"./useNestedProp-DnGoh-XS.js";import{t as ke}from"./useResponsive-CENUxfEL.js";import{t as Ae}from"./useThemeCheck-BKNRbGeC.js";import{t as je}from"./useChartExport-BZts4KFb.js";import{t as Me}from"./useTransitions-ChGGrtrv.js";import{t as Ne}from"./useUserOptionState-CXlFnwPv.js";import{t as Pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Fe}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ie}from"./img-D4RQwASc.js";import{n as Le}from"./Title-BliHuXfT.js";import{t as Re}from"./vue_ui_candlestick-DpPpEElM.js";import{t as ze}from"./BaseScanner-m6QR9rwD.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./SlicerPreview-Ks9FNVzh.js";import{t as He}from"./DefGrad-DKMq1REY.js";import{t as Ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as u,computed as d,createBlock as We,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ge,createTextVNode as Ke,createVNode as qe,defineAsyncComponent as h,guardReactiveProps as g,mergeProps as Je,nextTick as Ye,normalizeClass as _,normalizeProps as Xe,normalizeStyle as Ze,onBeforeUnmount as Qe,onMounted as $e,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as et,shallowRef as tt,toDisplayString as nt,toRefs as rt,unref as S,watch as it,watchEffect as at,withCtx as C}from"vue";var ot=/* @__PURE__ */ e({default:()=>Vt}),st=[`id`],ct=[`id`],lt={style:{position:`relative`}},ut=[`xmlns`,`aria-describedby`,`viewBox`],dt=[`x`,`y`,`width`,`height`],ft={key:1},pt={key:0},mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],St=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],Ct=[`x`,`y`,`width`,`height`,`fill`,`rx`],wt={key:0},Tt=[`cx`,`cy`,`r`,`fill`],Et=[`cx`,`cy`,`r`,`fill`],Dt={key:1},Ot=[`x`,`y`,`width`,`height`,`rx`,`fill`],kt=[`x`,`y`,`width`,`height`,`fill`,`rx`],At=[`fill`,`rx`],jt=[`fill`,`rx`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`],Nt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Pt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Ft=[`data-start`,`data-end`],It={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Lt={key:5,class:`vue-data-ui-watermark`},Rt=[`d`,`stroke`],zt=[`d`,`stroke`,`stroke-width`],Bt=[`innerHTML`],Vt=/*#__PURE__*/ Ue({__name:`vue-ui-candlestick`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},selectedXIndex:{type:Number,default:void 0},zoomState:{type:Object,default:null}},emits:[`selectX`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:Ue,emit:ot}){let Vt=h(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ht=h(()=>import(`./Tooltip-B432XpvC.js`)),Ut=h(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),Wt=h(()=>import(`./DataTable-KeuZB1JM.js`)),Gt=h(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Kt=h(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),qt=h(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),Jt=h(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_candlestick:Yt}=xe(),{isThemeValid:Xt,warnInvalidTheme:Zt}=Ae(),w=e,T=ot,Qt=d(()=>!!w.dataset&&w.dataset.length),E=y(!1),$t=y(!1),en=0,tn=null,nn=!1,rn=null,D=y(oe()),an=y(!1),on=y(``),O=y(void 0),sn=y(0),k=y(null),cn=y(null),ln=y(null),un=y(null),dn=y(null),fn=y(null),pn=y(0),mn=y(0),hn=y(0),gn=y(null),_n=y(null),vn=y(null),yn=y(null),bn=y(null),A=y(null),xn=y({x:0,y:0}),Sn=y(`pointer`),Cn=y(!1),j=y(Nn()),M=d(()=>j.value.style.layout.candle),N=d(()=>j.value.style.layout.grid),P=d(()=>j.value.style.layout),F=d(()=>j.value.style),I=d(()=>j.value.userOptions);ye({config:()=>j.value,dataset:()=>w.dataset,component:`VueUiCandlestick`,rules:[be.emptyArray,{test:e=>e.length>200,message:[`👀 Dataset has > 200 points, which can cause performance issues. Consider:`,``,`▶️ Adding date inputs to constraint the dataset into a specific timeframe`,``,`▶️ Aggregate the data to larger time series to reduce the number of datapoints.`]}]});let{transitionEnabled:wn}=Me({config:()=>j.value.transitions,dataset:()=>w.dataset}),Tn=d(()=>j.value.userOptions.useCursorPointer),En=d(()=>pe({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{backgroundColor:`#99999930`,layout:{candle:{colors:{bearish:`#BABABA`,bullish:`#CACACA`}},grid:{stroke:`#6A6A6A`,verticalLines:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A`},yAxis:{dataLabels:{show:!1},scale:{min:null,max:null}}},wick:{stroke:`#6A6A6A`,extremity:{color:`#6A6A6A`}}},tooltip:{show:!1},zoom:{show:!1,startIndex:null,endIndex:null}}},userConfig:j.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:R,manualLoading:Dn}=De({...rt(w),FINAL_CONFIG:j,prepareConfig:Nn,callback:()=>{Promise.resolve().then(async()=>{await oi()})},skeletonDataset:w.config?.skeletonDataset??[[17040672e5,10,20,2,10,30],[17067456e5,10,30,5,20,50],[17092512e5,20,50,10,30,80],[17119296e5,30,80,20,50,130],[17145216e5,50,130,30,100,210],[17172e8,80,210,50,150,340],[1719792e6,130,340,80,280,550],[17224704e5,210,550,130,450,890],[17251488e5,340,890,210,750,1440],[17277408e5,550,1440,340,1230,2330],[17304192e5,890,2330,550,1950,3770],[17330112e5,1440,3770,890,3200,5100]],skeletonConfig:pe({defaultConfig:j.value,userConfig:En.value})}),{userOptionsVisible:On,setUserOptionsVisibility:kn,keepUserOptionState:An}=Ne({config:j.value}),{svgRef:z}=Pe({config:F.value.title});function jn(){kn(!0)}function Mn(){kn(!1),T(`selectX`,{seriesIndex:null,datapoint:null}),O.value=null}function Nn(){let e=Oe({userConfig:w.config,defaultConfig:Yt});w.config&&_e(w.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!w.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let t=e.theme;if(!t)return e;if(!Xt.value(e))return Zt(e),e;let n=Oe({userConfig:Re[t]||w.config,defaultConfig:e});return Oe({userConfig:w.config,defaultConfig:n})}let Pn=ae(w.config);it(()=>w.config,(e,t)=>{let n=ae(e),r=n!==Pn;Pn=n;let i=Nn();r?(L.value||(j.value=i),On.value=!j.value.userOptions.showOnChartHover,zn(),pn.value+=1,hn.value+=1,mn.value+=1,V.value.showTable=j.value.table.show,V.value.showTooltip=F.value.tooltip.show,pr()):(j.value.style.tooltip=i.style.tooltip,V.value.showTooltip=j.value.style.tooltip.show)},{deep:!0}),it(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(Dn.value=!1),ni()},{deep:!0});let B=y({height:F.value.height,width:F.value.width,xAxisFontSize:N.value.xAxis.dataLabels.fontSize,yAxisFontSize:N.value.yAxis.dataLabels.fontSize}),Fn=tt(null),In=tt(null);$e(()=>{zn()});let Ln=d(()=>j.value.debug);function Rn(){clearTimeout(tn),tn=setTimeout(()=>{E.value=!0},10)}function zn(){nn||(ve(w.dataset)&&(ue({componentName:`VueUiCandlestick`,type:`dataset`,debug:Ln.value}),Dn.value=!0),ve(w.dataset)||(Dn.value=j.value.loading),Rn(),j.value.responsive&&(Fn.value&&(In.value&&Fn.value.unobserve(In.value),Fn.value.disconnect()),Fn.value=new ResizeObserver(()=>{E.value=!1;let{width:e,height:t}=ke({chart:k.value,title:F.value.title.text?cn.value:null,slicer:F.value.zoom.show&&W.value>6?un.value.$el:null,legend:ln.value,source:dn.value,noTitle:fn.value});cancelAnimationFrame(en),en=requestAnimationFrame(()=>{B.value.width=e,B.value.height=t-12,$t.value=!0,j.value.responsiveProportionalSizing?(B.value.xAxisFontSize=he({relator:Math.min(e,t),adjuster:F.value.width,source:N.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),B.value.yAxisFontSize=he({relator:Math.min(e,t),adjuster:F.value.width,source:N.value.yAxis.dataLabels.fontSize,threshold:6,fallback:6})):(B.value.xAxisFontSize=N.value.xAxis.dataLabels.fontSize,B.value.yAxisFontSize=N.value.yAxis.dataLabels.fontSize),Rn()})}),In.value=k.value.parentNode,Fn.value.observe(In.value)),oi())}Qe(()=>{nn=!0,clearTimeout(tn),clearTimeout(rn),cancelAnimationFrame(en),Fn.value&&(In.value&&Fn.value.unobserve(In.value),Fn.value.disconnect())});let{isPrinting:Bn,isImaging:Vn,generatePdf:Hn,generateImage:Un}=Ee({elementId:`vue-ui-candlestick_${D.value}`,fileName:F.value.title.text||`vue-ui-candlestick`,options:j.value.userOptions.print}),Wn=d(()=>j.value.userOptions.show&&!F.value.title.text),V=y({showTable:j.value.table.show,showTooltip:F.value.tooltip.show}),{metrics:Gn,ready:Kn,settling:H,update:qn}=Se({svgRef:z,canMeasure:()=>(!j.value.responsive||$t.value)&&(!N.value.xAxis.dataLabels.show||Mr.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:gn.value?e(gn.value).textWidth:N.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(_n.value).height})}),Jn=d(()=>_n.value?Gn.value.timeLabelsHeight+B.value.xAxisFontSize:0),Yn=d(()=>N.value.yAxis.position===`right`);function Xn(){let e=Gn.value.scaleLabelsWidth,t=e+13;return{left:Yn.value?0:t,right:Yn.value?t:0,scaleLabelsWidth:e,crosshair:13}}let U=d(()=>{let{top:e,right:t,bottom:n,left:r}=P.value.padding,i=Xn();return{top:e+12,right:B.value.width-t-i.right,left:r+i.left,bottom:B.value.height-n-Jn.value,width:B.value.width-r-t-i.left-i.right,height:B.value.height-e-n-Jn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,crosshair:i.crosshair}}),Zn=d(()=>{let{left:e,top:t,width:n,height:r}=U.value,i=G.value.start,a=G.value.end-i,o=n/a,s=K.value.start-i,ee=K.value.end-i,c=Math.max(0,Math.min(a,s)),te=Math.max(0,Math.min(a,ee));return{x:e+c*o,y:t,width:(te-c)*o,height:r,fill:F.value.zoom.preview.fill,stroke:F.value.zoom.preview.stroke,"stroke-width":F.value.zoom.preview.strokeWidth,"stroke-dasharray":F.value.zoom.preview.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{pointerEvents:`none`,transition:`none !important`,animation:`none !important`}}}),W=d(()=>R.value.length),G=y({start:0,end:W.value}),K=y({start:0,end:W.value}),Qn=y(!1),$n=y(!1),er=y(null),q=y(null),J=y(null),tr=y(!1),nr=y({time:0,x:0,y:0,pointerType:null}),rr=d(()=>F.value.zoom?.dragToZoom),Y=d(()=>rr.value.show&&Qt.value&&ii.value&&W.value>1&&!L.value),ir=null,ar={},or=d(()=>F.value.zoom.preview.enable&&(K.value.start!==G.value.start||K.value.end!==G.value.end));function sr(e,t){K.value[e]=t}function cr(e,t=G.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function lr(e){let t=cr(e);t&&T(`update:zoomState`,t)}function ur(){ir&&=(cancelAnimationFrame(ir),null),ar={}}function dr(e){let t=cr(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(G.value.start)||r!==Number(G.value.end))&&(ur(),G.value={start:n,end:r},K.value={start:n,end:r},pr()),{start:Number(G.value.start),end:Number(G.value.end)}}function fr(e){let t=dr(e);return t?(T(`update:zoomState`,t),t):null}function pr(){let e=Math.max(0,Math.min(G.value.start??0,W.value-1)),t=Math.max(e+1,Math.min(G.value.end??W.value,W.value));(!Number.isFinite(e)||!Number.isFinite(t)||t<=e)&&(e=0,t=W.value),G.value.start=e,G.value.end=t,K.value.start=e,K.value.end=t,un.value&&un.value.setRangeValues(e,t)}let mr=d(()=>R.value.map((e,t)=>({...e,absoluteIndex:t}))),hr=d(()=>mr.value.slice(G.value.start,G.value.end)),gr=d(()=>(Ln.value&&R.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&ue({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&ue({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&ue({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&ue({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&ue({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&ue({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),_r.value.slice(G.value.start,G.value.end))),_r=d(()=>mr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]}))),X=d(()=>U.value.width/hr.value.length),vr=d(()=>{let e={o:-1/0,h:-1/0,l:-1/0},t={o:1/0,h:1/0,l:1/0},n=-1/0,r=1/0;for(let i of gr.value)e.o=Math.max(e.o,i.open),e.h=Math.max(e.h,i.high),e.l=Math.max(e.l,i.low),t.o=Math.min(t.o,i.open),t.h=Math.min(t.h,i.high),t.l=Math.min(t.l,i.low),n=Math.max(n,i.volume),r=Math.min(r,i.volume);return e.c=e.l,t.c=t.l,{max:e,min:t,volumeMax:n,volumeMin:r}}),yr=d(()=>({max:N.value.yAxis.scale.max===null?vr.value.max.h:N.value.yAxis.scale.max,min:N.value.yAxis.scale.min===null?0:N.value.yAxis.scale.min})),Z=d(()=>ce(yr.value.min,yr.value.max,N.value.yAxis.dataLabels.steps));function br(e,t,n=null,r=null){return{...e,x:l(U.value.left+t*X.value+X.value/2),y:l(U.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*U.value.height),value:l(e),isMax:e===n,isMin:e===r}}let Q=d(()=>{let{max:e,min:t,volumeMax:n,volumeMin:r}=vr.value;return gr.value.map((i,a)=>{let o=br(i.open,a,e.o,t.o),s=br(i.high,a,e.h,t.h),ee=br(i.low,a,e.l,t.l),c=br(i.close,a,e.c,t.c),te=i.close>i.open,ne=i.volume===n,re=i.volume===r;return{period:i.period,open:o,high:s,low:ee,close:c,volume:i.volume,isBullish:te,absoluteIndex:i.absoluteIndex,isMaxVolume:ne,isMinVolume:re}})}),xr=d(()=>Q.value.map(e=>({x:e.open.x-X.value/2+X.value*(1-M.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*M.value.widthRatio<=0?1e-4:X.value*M.value.widthRatio}))),Sr=d(()=>P.value.wick.extremity.size===`auto`?X.value*M.value.widthRatio:P.value.wick.extremity.size),Cr=d(()=>P.value.wick.extremity.size===`auto`?X.value/20:P.value.wick.extremity.size),wr=d(()=>{let e=-1/0;for(let t of R.value)e=Math.max(e,t[2]);return e});function Tr({item:e,index:t,minimapH:n,unitW:r,min:i,max:a}){return{...e,x:l(t*r),y:l((1-(e-i)/(a-i))*n),value:l(e)}}let Er=d(()=>{let e=_r.value,t=N.value.yAxis.scale.min??0,n=N.value.yAxis.scale.max??wr.value,r,i,a;return({minimapH:o,unitW:s})=>(a&&r===o&&i===s||(r=o,i=s,a=e.map((e,r)=>{let i=Tr({item:e.open,index:r,minimapH:o,unitW:s,min:t,max:n}),a=Tr({item:e.high,index:r,minimapH:o,unitW:s,min:t,max:n}),ee=Tr({item:e.low,index:r,minimapH:o,unitW:s,min:t,max:n}),c=Tr({item:e.close,index:r,minimapH:o,unitW:s,min:t,max:n}),te=e.close>e.open;return{period:e.period,open:i,high:a,low:ee,close:c,volume:e.volume,isBullish:te,absoluteIndex:e.absoluteIndex}})),a)}),Dr=d(()=>F.value.zoom.minimap.show?[{name:``,series:R.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function Or(e){return l((e-Z.value.min)/(Z.value.max-Z.value.min))}let kr=d(()=>Z.value.ticks.map(e=>({y:U.value.bottom-U.value.height*Or(e),value:l(e)}))),Ar=d(()=>gr.value.map(e=>e.period)),jr=d(()=>R.value.map(e=>e[0])),$=y([]),Mr=y(!1),Nr=y([]),Pr=0;at(()=>{let e=++Pr;(async()=>{let t=await Te({values:jr.value,maxDatapoints:R.value.length,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:G.value.start,end:G.value.end});e===Pr&&($.value=t,Mr.value=!0)})()});let Fr=0;at(()=>{let e=++Fr;(async()=>{let t=await Te({values:jr.value,maxDatapoints:R.value.length,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:0,end:W.value});e===Fr&&(Nr.value=t)})()});let Ir=y({months:[],shortMonths:[],days:[],shortDays:[]}),Lr=0;at(()=>{let e=++Lr,t=N.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await we(t.locale).catch(()=>we(`en`));e===Lr&&(Ir.value=n.data)})()});let Rr=d(()=>{let e=N.value.xAxis.dataLabels.datetimeFormatter,t=Ce({useUTC:e.useUTC,locale:Ir.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=jr.value[e];return r==null?``:t.formatDate(new Date(r),n)}}),zr=d(()=>jr.value.map((e,t)=>({text:Rr.value(t,F.value.tooltip.timeFormat),absoluteIndex:t}))),Br=d(()=>jr.value.map((e,t)=>({text:Rr.value(t,F.value.zoom.timeFormat),absoluteIndex:t}))),Vr=d(()=>($.value||[]).map(e=>e?.text??``)),Hr=d(()=>(Nr.value||[]).map(e=>e?.text??``)),Ur=d(()=>{let e=Math.max(1,Math.floor(Number(N.value.xAxis.dataLabels.modulo)||1)),t=Vr.value,n=Hr.value,r=G.value.start??0,i=r>0||t.length<n.length;return fe({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),Wr=d(()=>{let e=N.value.xAxis.dataLabels,t=G.value.start??0,n=O.value,r=W.value,i=Vr.value,a=Hr.value,o=de(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Ur.value,i,a,t,n,r);if(!e.showFirstAndLast||e.showOnlyFirstAndLast||!o.length)return o;let s=o.length-1;return o.map((e,t)=>t!==0&&t!==s?e:{...e,text:i[t]??``})}),Gr=d(()=>N.value.xAxis.dataLabels.datetimeFormatter.enable?{start:$.value.find(e=>e.absoluteIndex===G.value.start)?.text??``,end:$.value.find(e=>e.absoluteIndex===G.value.end-1)?.text??``}:{start:R.value[G.value.start]?R.value[G.value.start][0]:R.value[0][0],end:R.value[G.value.end-1]?R.value[G.value.end-1][0]:R.value.at(-1)[0]}),Kr=[`open`,`high`,`low`,`close`];function qr(e,t){return Kr.map(n=>te({p:t.prefix,v:e[n].value,s:t.suffix,r:t.roundingValue}))}let Jr=y(null);function Yr(e,t){j.value.events.datapointClick&&j.value.events.datapointClick({datapoint:t,seriesIndex:e+G.value.start})}function Xr(e,t){j.value.events.datapointLeave&&j.value.events.datapointLeave({datapoint:t,seriesIndex:e+G.value.start}),O.value=void 0,an.value=!1,A.value=null,Sn.value=`pointer`}it([()=>w.selectedXIndex,()=>G.value.start,()=>G.value.end],([e])=>{if([null,void 0].includes(w.selectedXIndex)){O.value=null;return}let t=e-G.value.start;t<0||e>=G.value.end?O.value=null:O.value=t??null},{immediate:!0});function Zr(e,t,n=`pointer`){j.value.events.datapointEnter&&j.value.events.datapointEnter({datapoint:t,seriesIndex:e+G.value.start}),O.value=e,A.value=e,Sn.value=n,Jr.value={datapoint:t,seriesIndex:e,series:Q.value,config:j.value},Ki({seriesIndex:e,datapoint:t});let r=F.value.tooltip.customFormat,i=re(r)?r({seriesIndex:e,datapoint:t,series:Q.value,config:j.value}):null;if(typeof i==`string`)on.value=i;else if(F.value.tooltip.show){let n=``,{period:r,volume:i,isBullish:a}=Q.value[e],{period:o,open:s,high:ee,low:c,close:te,volume:ne}=j.value.translations,re=N.value.xAxis.dataLabels.datetimeFormatter.enable?F.value.tooltip.useDefaultTimeFormat?$.value[e].text:zr.value[e+G.value.start].text:r;n+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${M.value.borderRadius*3}" stroke="${M.value.stroke}" stroke-width="${M.value.strokeWidth}"
|
|
2
|
+
fill="${M.value.gradient.show?a?`url(#bullish_gradient_${D.value})`:`url(#bearish_gradient_${D.value})`:a?M.value.colors.bullish:M.value.colors.bearish}"/></svg>${re}</div>`,n+=`${ne} : <b>${isNaN(i)?`-`:Number(i.toFixed(F.value.tooltip.roundingValue)).toLocaleString()}</b>`,n+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${F.value.tooltip.borderColor}">`;let[ie,ae,oe,se]=qr(Q.value[e],F.value.tooltip);F.value.tooltip.showChart?n+=`<div style="width:100%;display:flex;align-items:center;justify-content:center;">
|
|
3
|
+
<svg viewBox="0 0 100 100" width="100px" style="background: transparent; overflow: visible">
|
|
4
|
+
<g>
|
|
5
|
+
<line x1="50" x2="50" y1="20" y2="80" stroke="${t.isBullish?M.value.colors.bullish:M.value.colors.bearish}" stroke-width="2" stroke-linecap="round" />
|
|
6
|
+
${t.isBullish?`
|
|
7
|
+
<line x1="45" x2="50" y1="65" y2="65" stroke="${M.value.colors.bullish}" stroke-width="1.5" stroke-linecap="round" />
|
|
8
|
+
<line x1="50" x2="55" y1="35" y2="35" stroke="${M.value.colors.bullish}" stroke-width="1.5" stroke-linecap="round" />
|
|
9
|
+
<text x="38" y="70" text-anchor="end" fill="${F.value.tooltip.color}">${ie}</text>
|
|
10
|
+
<text x="62" y="40" text-anchor="start" fill="${F.value.tooltip.color}">${se}</text>
|
|
11
|
+
`:`
|
|
12
|
+
<line x1="45" x2="50" y1="35" y2="35" stroke="${M.value.colors.bearish}" stroke-width="1.5" stroke-linecap="round" />
|
|
13
|
+
<line x1="50" x2="55" y1="65" y2="65" stroke="${M.value.colors.bearish}" stroke-width="1.5" stroke-linecap="round" />
|
|
14
|
+
<text x="40" y="40" text-anchor="end" fill="${F.value.tooltip.color}">${ie}</text>
|
|
15
|
+
<text x="60" y="70" text-anchor="start" fill="${F.value.tooltip.color}">${se}</text>
|
|
16
|
+
`}
|
|
17
|
+
<text x="50" y="13" text-anchor="middle" fill="${F.value.tooltip.color}">${ae}</text>
|
|
18
|
+
<text x="50" y="97" text-anchor="middle" fill="${F.value.tooltip.color}">${oe}</text>
|
|
19
|
+
<g>
|
|
20
|
+
</svg>
|
|
21
|
+
<div>
|
|
22
|
+
`:(n+=`<div>${s}: <b>${ie}</b></div>`,n+=`<div>${ee}: <b>${ae}</b></div>`,n+=`<div>${c}: <b>${oe}</b></div>`,n+=`<div>${te}: <b>${se}</b></div>`),n+=`</div>`,on.value=`<div style="text-align:right">${n}</div>`}an.value=!0}let Qr=0,$r=/* @__PURE__ */ new Map;function ei(){Qr+=1;for(let[e,t]of $r)cancelAnimationFrame(e),t(!1);$r.clear()}function ti(){return new Promise(e=>{let t=requestAnimationFrame(()=>{$r.delete(t),e(!0)});$r.set(t,e)})}Qe(()=>{ei(),ur(),Ii()});async function ni({force:e=!1,publish:t=!1}={}){if(nn)return;ei();let n=Qr,r=!e;if(oi(r),await Ye(),n===Qr){for(let e=0;e<3;e+=1)if(!await ti()||n!==Qr)return;oi(r),t&&(lr({start:Number(G.value.start),end:Number(G.value.end)}),T(`zoomReset`))}}let ri=y(!1),ii=y(!1),ai=y(!1);it([()=>w.zoomState,ii],([e,t])=>{t&&e&&dr(e)},{deep:!0,immediate:!0});function oi(e=!0){if(!(nn||ri.value)){ri.value=!0;try{let{startIndex:t,endIndex:n}=F.value.zoom,r=W.value,i=t??0,a=n==null?r:Math.min(si(n+1,i),r);ai.value=!0,G.value.start=i,G.value.end=a,K.value.start=i,K.value.end=a,pr(),ii.value=!0,e&&w.zoomState&&dr(w.zoomState)}finally{queueMicrotask(()=>{ai.value=!1}),ri.value=!1}}}function si(e,t=G.value.start){let n=W.value,r=Number(t);return e>n?n:e<0||e<=r?Math.min(r+1,n):e}function ci(e=null){Ye(()=>{let t=[j.value.translations.period,j.value.translations.open,j.value.translations.high,j.value.translations.low,j.value.translations.last,j.value.translations.volume],n=Q.value.map((e,t)=>[N.value.xAxis.dataLabels.datetimeFormatter.enable?$.value[t].text:e.period,e.open.value,e.high.value,e.low.value,e.close.value,e.volume]),r=[[F.value.title.text],[F.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),i=ne(r);e?e(i):me({csvContent:i,title:F.value.title.text||`vue-ui-candlestick`})})}let li=d(()=>{let e=[],t=[];Q.value.forEach((n,r)=>{let i=N.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[r]?.text??``:n.period,a=qr(n,j.value.table.td),o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" rx="${M.value.borderRadius*3}" fill="${M.value.gradient.show?n.isBullish?`url(#bullish_gradient_${D.value})`:`url(#bearish_gradient_${D.value})`:n.isBullish?M.value.colors.bullish:M.value.colors.bearish}"/></svg>`;e.push([`${o} ${i}`,...a,`${isNaN(n.volume)?`-`:n.volume.toLocaleString()}`]),t.push([i,...a,`${isNaN(n.volume)?`-`:n.volume}`])});let n={th:{backgroundColor:j.value.table.th.backgroundColor,color:j.value.table.th.color,outline:j.value.table.th.outline},td:{backgroundColor:j.value.table.td.backgroundColor,color:j.value.table.td.color,outline:j.value.table.td.outline},breakpoint:j.value.table.responsiveBreakpoint},r=[j.value.translations.period,j.value.translations.open,j.value.translations.high,j.value.translations.low,j.value.translations.last,j.value.translations.volume];return{head:r,body:e,bodyA11y:t,config:n,colNames:r}}),ui=y(!1);function di(e){ui.value=e,sn.value+=1}function fi(){V.value.showTable=!V.value.showTable}function pi(){V.value.showTooltip=!V.value.showTooltip}let mi=y(!1);function hi(){mi.value=!mi.value}async function gi({scale:e=2}={}){if(!k.value)return;let{imageUri:t,base64:n}=await Ie({domElement:k.value,base64:!0,img:!0,scale:e}),r=k.value.getBoundingClientRect(),i={width:r.width,height:r.height,aspectRatio:r.height?r.width/r.height:0},a=await le(t,e)??i;return{imageUri:t,base64:n,title:F.value.title.text,...a}}let _i=d(()=>B.value.width),vi=d(()=>B.value.height);Fe({timeLabelsEls:_n,timeLabels:$,slicer:G,configRef:j,rotationPath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`rotation`],autoRotatePath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`autoRotate`,`enable`],isAutoSize:!1,rotation:N.value.xAxis.dataLabels.autoRotate.angle,width:_i,height:vi}),it(j,()=>{V.value={showTable:j.value.table.show,showTooltip:F.value.tooltip.show}},{immediate:!0});let yi=d(()=>c({config:j,style:F,mutableConfig:V,dialog:Jt,accordion:Ut,isFullscreen:ui,parent:k,maxWidth:800,isCursorPointer:Tn}));it(()=>V.value.showTable,e=>ee(e,j,vn));function bi(){V.value.showTable=!1,yn.value&&yn.value.setTableIconState(!1)}let xi=d(()=>F.value.backgroundColor),Si=d(()=>F.value.title),{isCallbackImaging:Ci,isCallbackSvg:wi,generateSvg:Ti,onGenerateImage:Ei}=je({svg:z,title:Si,legend:null,legendItems:null,backgroundColor:xi,getSvgCallback:()=>j.value.userOptions.callbacks.svg,generateImage:Un});function Di(e){bn.value=e}function Oi(e){ar={...ar,...e},ir&&cancelAnimationFrame(ir),ir=requestAnimationFrame(()=>{let e={...G.value,...ar};ar={},ir=null,G.value=e,K.value={...e},pr(),lr({start:Number(G.value.start),end:Number(G.value.end)})})}function ki(e){if(ri.value||ai.value)return;let t=Number(e);Number.isFinite(t)&&(T(`zoomStart`,{index:t,isZoom:t!==0}),t!==G.value.start&&Oi({start:t}))}function Ai(e){if(ri.value||ai.value)return;let t=ar.start===void 0?G.value.start:ar.start,n=si(Number(e),t);Number.isFinite(n)&&(T(`zoomEnd`,{index:n,isZoom:n!==W.value}),(n!==G.value.end||ar.start!==void 0)&&Oi({end:n}))}function ji(e){let t=z.value;if(!t)return null;if(t.createSVGPoint&&t.getScreenCTM){let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(r){let e=n.matrixTransform(r.inverse());return{x:e.x,y:e.y}}}let n=t.getBoundingClientRect(),r=t.viewBox?.baseVal||{x:0,y:0,width:n.width,height:n.height},i=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(i)||i<=0)return null;let a=r.width*i,o=r.height*i,s=(n.width-a)/2,ee=(n.height-o)/2;return{x:(e.clientX-n.left-s)/i+r.x,y:(e.clientY-n.top-ee)/i+r.y}}let Mi=d(()=>!Qn.value||er.value==null||q.value==null?null:{x:Math.min(er.value,q.value),y:U.value.top,width:Math.abs(q.value-er.value),height:U.value.height}),Ni=d(()=>ii.value?Number(G.value.start)!==0||Number(G.value.end)!==Number(W.value):!1);function Pi(e){return Math.min(Math.max(e,U.value.left),U.value.right)}function Fi(){O.value=void 0,A.value=null,Sn.value=`pointer`,an.value=!1,bn.value=null}function Ii(e){let t=e?.pointerId==null?J.value:e.pointerId;t!=null&&z.value?.hasPointerCapture?.(t)&&z.value.releasePointerCapture(t),Qn.value=!1,er.value=null,q.value=null,J.value=null}function Li(){tr.value=!0,clearTimeout(rn),rn=setTimeout(()=>{tr.value=!1},0)}function Ri(e){tr.value&&(tr.value=!1,e.preventDefault(),e.stopPropagation())}function zi(e){if(!Y.value||!Ni.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=nr.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?(nr.value={time:0,x:0,y:0,pointerType:null},Li(),Ii(e),ni({force:!0,publish:!0}),!0):(nr.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function Bi(e){let t=Number(G.value.end)-Number(G.value.start);if(t<=0||!Number.isFinite(X.value)||X.value<=0)return null;let n=Math.floor((Pi(e)-U.value.left)/X.value);return Math.max(0,Math.min(t-1,n))}function Vi(e,t){let n=Bi(e),r=Bi(t);if(n==null||r==null)return null;let i=Math.min(n,r),a=Math.max(n,r);return a<=i?null:{start:Number(G.value.start)+i,end:Number(G.value.start)+a+1}}function Hi(e){let t=fr(e);return t?(T(`zoomStart`,{index:t.start,isZoom:t.start!==0}),T(`zoomEnd`,{index:t.end,isZoom:t.end!==W.value}),t):null}function Ui(e){if(!Y.value||mi.value||e.button!==void 0&&e.button!==0||J.value!=null&&e.pointerId!==J.value)return;let t=ji(e);if(!t)return;let{left:n,right:r,top:i,bottom:a}=U.value;if(t.x<n||t.x>r||t.y<i||t.y>a||Number(G.value.end)-Number(G.value.start)<=1)return;$n.value=!0,z.value?.focus?.({preventScroll:!0}),Fi();let o=Pi(t.x);J.value=e.pointerId,Qn.value=!0,er.value=o,q.value=o}function Wi(e){if(!Y.value||!Qn.value||J.value!=null&&e.pointerId!==J.value)return;let t=ji(e);t&&(q.value=Pi(t.x),Fi(),er.value!=null&&Math.abs(q.value-er.value)>=2&&!z.value?.hasPointerCapture?.(e.pointerId)&&z.value?.setPointerCapture?.(e.pointerId))}function Gi(e){if(!Y.value||!Qn.value||J.value!=null&&e.pointerId!==J.value)return;let t=ji(e);t&&(q.value=Pi(t.x));let n=er.value,r=q.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,U.value.width*.01)){if(zi(e))return;Ii(e);return}let i=Vi(Math.min(n,r),Math.max(n,r));i?(Ii(e),Hi(i)&&(nr.value={time:0,x:0,y:0,pointerType:null},Fi(),Li())):Ii(e)}function Ki({seriesIndex:e,datapoint:t}){let n=G.value.start+e;T(`selectX`,{dataset:t,index:n,indexLabel:``})}async function qi(){T(`copyAlt`,{config:j.value,dataset:Q.value}),j.value.userOptions.callbacks.altCopy?await Promise.resolve(j.value.userOptions.callbacks.altCopy({config:j.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Ji(){A.value=null,Cn.value=!0}function Yi(){$n.value=!1,A.value=null,Sn.value=`pointer`,an.value=!1,O.value=void 0,Cn.value=!1}function Xi(e){if(!z.value||mi.value||document.activeElement!==z.value||($n.value=!1,!Q.value.length))return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){if(Y.value&&(Ni.value||Qn.value)){Ii(),ni({force:!0,publish:!0});return}A.value=null,Sn.value=`pointer`,an.value=!1,O.value=void 0;return}if(r){if(A.value===null)return;let e=Q.value[A.value];if(!e)return;Yr(A.value,e);return}let a=A.value,o=O.value,s=a!==null&&a>=0&&a<Q.value.length,ee=o!=null&&o>=0&&o<Q.value.length;s?n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)):ee?(a=n?o+1:o-1,a>=Q.value.length&&(a=0),a<0&&(a=Q.value.length-1)):a=n?0:Q.value.length-1;let c=Q.value[a];c&&(Zi(a),Zr(a,c,`keyboard`))}function Zi(e){if(!Number.isFinite(e)||!z.value)return;let t=U.value.left+X.value*e+X.value/2,n=U.value.top+U.value.height/2,r=z.value.getBoundingClientRect();xn.value={x:r.left+t/B.value.width*r.width,y:r.top+n/B.value.height*r.height}}let Qi=d(()=>({headers:li.value?.colNames??[],rows:li.value?.bodyA11y??[]}));Ue({getImage:gi,generatePdf:Hn,generateCsv:ci,generateImage:Un,generateSvg:Ti,toggleTable:fi,toggleTooltip:pi,toggleAnnotator:hi,toggleFullscreen:di,copyAlt:qi,resetZoom:()=>ni({force:!0,publish:!0}),setZoomState:fr}),it(()=>[B.value,N.value,j.value.style.fontFamily,w.dataset,G.value.start,G.value.end,$.value,Mr.value,$t.value,gn.value,_n.value],qn,{flush:`post`,deep:!0});let $i=d(()=>s({enabled:I.value?.annotator?.followZoom,area:U.value,range:G.value,ticks:kr.value}));return(e,s)=>(v(),p(`div`,{ref_key:`candlestickChart`,ref:k,class:_(`vue-data-ui-component vue-ui-candlestick ${ui.value?`vue-data-ui-wrapper-fullscreen`:``} ${j.value.useCssAnimation?``:`vue-ui-dna`}`),style:Ze(`position:relative;font-family:${F.value.fontFamily}; text-align:center;background:${F.value.backgroundColor}; ${j.value.responsive?`height: 100%`:``}`),id:`vue-ui-candlestick_${D.value}`,onMouseenter:jn,onMouseleave:Mn},[m(`div`,{id:`chart-instructions-${D.value}`,class:`sr-only`},[m(`p`,null,nt(j.value.a11y.translations.keyboardNavigation),1)],8,ct),j.value.a11y.includeTable&&Qi.value?.rows?.length?(v(),We(Be,{key:0,uid:D.value,head:Qi.value.headers,body:Qi.value.rows,notice:j.value.a11y.translations.tableAvailable,caption:j.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),I.value.buttons.annotator?(v(),We(S(Gt),Je({key:1},S(a)(I.value.annotator),{svgRef:S(z),followZoom:I.value?.annotator?.followZoom,annotationViewport:$i.value,backgroundColor:F.value.backgroundColor,color:F.value.color,active:mi.value,isCursorPointer:Tn.value,palette:I.value.annotatorPalette,onClose:hi}),Ge({_:2},[b(S(o),t=>({name:t,fn:C(n=>[x(e.$slots,t,Xe(g(S(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),Wn.value?(v(),p(`div`,{key:2,ref_key:`noTitle`,ref:fn,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),F.value.title.text?(v(),p(`div`,{key:3,ref_key:`chartTitle`,ref:cn,style:`width:100%;background:transparent`},[(v(),We(Le,{key:`title_${hn.value}`,config:{title:{cy:`candlestick-div-title`,...F.value.title},subtitle:{cy:`candlestick-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),I.value.show&&Qt.value&&(S(An)||S(On))?(v(),We(S(Kt),Je({ref_key:`userOptionsRef`,ref:yn,key:`user_options_${sn.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isImaging:S(Vn),isPrinting:S(Bn),uid:D.value,hasTooltip:I.value.buttons.tooltip&&F.value.tooltip.show,isFullscreen:ui.value,isTooltip:V.value.showTooltip,chartElement:k.value},S(n)(I.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:mi.value,tableDialog:j.value.table.useDialog,isCursorPointer:Tn.value,onToggleFullscreen:di,onGeneratePdf:S(Hn),onGenerateCsv:ci,onGenerateImage:S(Ei),onGenerateSvg:S(Ti),onToggleTable:fi,onToggleTooltip:pi,onToggleAnnotator:hi,onCopyAlt:qi,style:{visibility:S(An)?S(On)?`visible`:`hidden`:`visible`}}),Ge({_:2},[b(S(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[x(e.$slots,t,Xe(g(S(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),m(`div`,lt,[(v(),p(`svg`,{ref_key:`svgRef`,ref:z,xmlns:S(ge),"aria-describedby":`chart-instructions-${D.value}`,class:_({"vue-data-ui-fullscreen--on":ui.value,"vue-data-ui-fulscreen--off":!ui.value,"vue-data-ui-no-transition":!S(wn)||S(H),"vue-ui-candlestick-chart-zoom-pointer-focus":Y.value&&$n.value}),viewBox:`0 0 ${B.value.width<=0?10:B.value.width} ${B.value.height<=0?10:B.value.height}`,style:Ze({maxWidth:`100%`,visibility:S(Kn)?`visible`:`hidden`,overflow:`visible`,background:`transparent`,color:F.value.color,cursor:Y.value?Qn.value?`col-resize`:`crosshair`:void 0,touchAction:Y.value?`pan-y`:void 0,userSelect:Y.value?`none`:void 0}),tabindex:`0`,onFocus:Ji,onBlur:Yi,onKeydown:Xi,onPointerdown:Ui,onPointermove:Wi,onPointerup:Gi,onPointercancel:Ii,onClickCapture:Ri},[qe(S(qt)),x(e.$slots,`svg-underlayer`,{svg:{...B.value,data:Q.value,drawingArea:U.value,isPrintingImg:S(Bn)||S(Vn)||S(Ci),isPrintingSvg:S(wi)}},void 0,!0),e.$slots[`chart-background`]?(v(),p(`foreignObject`,{key:0,x:U.value.left,y:U.value.top,width:Math.max(.1,U.value.width),height:Math.max(.1,U.value.height),style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,dt)):f(``,!0),Q.value.length>0?(v(),p(`g`,ft,[m(`defs`,null,[qe(He,{t:`linear`,id:`bearish_gradient_${D.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,M.value.colors.bearish,1],[`50%`,S(se)(M.value.colors.bearish,.02),.87],[`100%`,S(se)(M.value.colors.bearish,.05),.4]]},null,8,[`id`,`stops`]),qe(He,{t:`linear`,id:`bullish_gradient_${D.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,M.value.colors.bullish,1],[`50%`,S(se)(M.value.colors.bullish,.02),.87],[`100%`,S(se)(M.value.colors.bullish,.05),.4]]},null,8,[`id`,`stops`])]),N.value.show?(v(),p(`g`,pt,[m(`line`,{x1:Yn.value?U.value.right:U.value.left,x2:Yn.value?U.value.right:U.value.left,y1:U.value.top,y2:U.value.bottom,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,mt),m(`line`,{x1:U.value.left,x2:U.value.right,y1:U.value.bottom,y2:U.value.bottom,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,ht),N.value.horizontalLines.show?(v(!0),p(u,{key:0},b(kr.value,e=>(v(),p(`line`,{x1:U.value.left,x2:U.value.right,y1:e.y,y2:e.y,stroke:N.value.horizontalLines.stroke,"stroke-width":N.value.horizontalLines.strokeWidth,"stroke-dasharray":N.value.horizontalLines.strokeDasharray,"stroke-linecap":`round`},null,8,gt))),256)):f(``,!0),N.value.verticalLines.show?(v(!0),p(u,{key:1},b(Wr.value,(e,t)=>(v(),p(`g`,null,[e.text?(v(),p(`line`,{key:0,x1:U.value.left+X.value*t+X.value/2,x2:U.value.left+X.value*t+X.value/2,y1:U.value.top,y2:U.value.bottom,stroke:N.value.verticalLines.stroke,"stroke-width":N.value.verticalLines.strokeWidth,"stroke-dasharray":N.value.verticalLines.strokeDasharray,"stroke-linecap":`round`},null,8,_t)):f(``,!0)]))),256)):f(``,!0),N.value.xAxis.ticks.show?(v(!0),p(u,{key:2},b(Wr.value,(e,t)=>(v(),p(`g`,null,[e.text?(v(),p(`line`,{key:0,x1:U.value.left+X.value*t+X.value/2,x2:U.value.left+X.value*t+X.value/2,y1:U.value.bottom,y2:U.value.bottom+3,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,vt)):f(``,!0)]))),256)):f(``,!0)])):f(``,!0),N.value.yAxis.dataLabels.show?(v(),p(`g`,{key:1,ref_key:`scaleLabels`,ref:gn},[(v(!0),p(u,null,b(kr.value,(e,t)=>(v(),p(`g`,{key:`sl_${t}`},[e.value>=Z.value.min&&e.value<=Z.value.max?(v(),p(`line`,{key:0,x1:Yn.value?U.value.right:U.value.left,x2:Yn.value?U.value.right+5:U.value.left-5,y1:e.y,y2:e.y,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linecap":`round`},null,8,yt)):f(``,!0),e.value>=Z.value.min&&e.value<=Z.value.max?(v(),p(`text`,{key:1,class:_({"vue-data-ui-transition":S(wn)&&!S(H)}),transform:`translate(${Yn.value?U.value.right+8+N.value.yAxis.dataLabels.offsetX:U.value.left-8+N.value.yAxis.dataLabels.offsetX}, ${e.y+B.value.yAxisFontSize/3})`,"text-anchor":Yn.value?`start`:`end`,"font-size":B.value.yAxisFontSize,fill:N.value.yAxis.dataLabels.color,"font-weight":N.value.yAxis.dataLabels.bold?`bold`:`normal`},nt(S(te)({p:N.value.yAxis.dataLabels.prefix,v:e.value,s:N.value.yAxis.dataLabels.suffix,r:N.value.yAxis.dataLabels.roundingValue})),11,bt)):f(``,!0)]))),128))],512)):f(``,!0),N.value.xAxis.dataLabels.show&&!N.value.xAxis.dataLabels.datetimeFormatter.enable?(v(),p(`g`,{key:2,ref_key:`timeLabelsEls`,ref:_n},[(v(!0),p(u,null,b(Ar.value,(e,t)=>(v(),p(`g`,null,[m(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${U.value.left+X.value*t+X.value/2}, ${U.value.bottom+B.value.xAxisFontSize*1.5}), rotate(${N.value.xAxis.dataLabels.rotation})`,"text-anchor":N.value.xAxis.dataLabels.rotation>0?`start`:N.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":B.value.xAxisFontSize,fill:N.value.xAxis.dataLabels.color,"font-weight":N.value.xAxis.dataLabels.bold?`bold`:`normal`},nt(e),9,xt)]))),256))],512)):f(``,!0),N.value.xAxis.dataLabels.show&&N.value.xAxis.dataLabels.datetimeFormatter.enable?(v(),p(`g`,{key:3,ref_key:`timeLabelsEls`,ref:_n},[(v(!0),p(u,null,b(Wr.value,(e,t)=>(v(),p(`g`,null,[m(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${U.value.left+X.value*t+X.value/2}, ${U.value.bottom+B.value.xAxisFontSize*1.5}), rotate(${N.value.xAxis.dataLabels.rotation})`,"text-anchor":N.value.xAxis.dataLabels.rotation>0?`start`:N.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":B.value.xAxisFontSize,fill:N.value.xAxis.dataLabels.color,stroke:F.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":N.value.xAxis.dataLabels.bold?`bold`:`normal`},nt(e?.text??``),9,St)]))),256))],512)):f(``,!0),j.value.type===`candlestick`?(v(),p(u,{key:4},[m(`g`,null,[(v(!0),p(u,null,b(Q.value,(e,t)=>(v(),p(`g`,null,[m(`rect`,{x:e.open.x-P.value.wick.strokeWidth/2,y:e.high.y,width:P.value.wick.strokeWidth,height:Math.abs(e.high.y-e.low.y),fill:P.value.wick.stroke,stroke:`none`,rx:P.value.wick.strokeWidth/2,class:_({"vue-data-ui-transition":E.value&&!S(L)&&!S(H)})},null,10,Ct),P.value.wick.extremity.shape===`circle`?(v(),p(`g`,wt,[m(`circle`,{cx:e.high.x,cy:e.high.y,r:Cr.value,fill:P.value.wick.extremity.color,class:_({"vue-data-ui-transition":E.value&&!S(L)&&!S(H)})},null,10,Tt),m(`circle`,{cx:e.low.x,cy:e.low.y,r:Cr.value,fill:P.value.wick.extremity.color,class:_({"vue-data-ui-transition":E.value&&!S(L)&&!S(H)})},null,10,Et)])):f(``,!0),P.value.wick.extremity.shape===`line`?(v(),p(`g`,Dt,[m(`rect`,{x:e.high.x-Sr.value/2,y:e.high.y-P.value.wick.strokeWidth/2,width:Math.abs(e.high.x-Sr.value/2-(e.high.x+Sr.value/2)),height:P.value.wick.strokeWidth,rx:P.value.wick.strokeWidth/2,fill:P.value.wick.extremity.color,stroke:`none`,class:_({"vue-data-ui-transition":E.value&&!S(L)&&!S(H)})},null,10,Ot),m(`rect`,{x:e.low.x-Sr.value/2,y:e.low.y-P.value.wick.strokeWidth/2,width:Math.abs(e.low.x-Sr.value/2-(e.low.x+Sr.value/2)),height:P.value.wick.strokeWidth,fill:P.value.wick.extremity.color,stroke:`none`,rx:P.value.wick.strokeWidth/2,class:_({"vue-data-ui-transition":E.value&&!S(L)&&!S(H)})},null,10,kt)])):f(``,!0)]))),256))]),m(`g`,null,[(v(!0),p(u,null,b(Q.value,(e,t)=>(v(),p(`rect`,Je({ref_for:!0},xr.value[t],{fill:M.value.gradient.underlayer,rx:M.value.borderRadius,stroke:`none`,class:{"vue-data-ui-transition":E.value&&!S(L)&&!S(H)}}),null,16,At))),256)),(v(!0),p(u,null,b(Q.value,(e,t)=>(v(),p(`rect`,Je({ref_for:!0},xr.value[t],{fill:e.isBullish?M.value.gradient.show?`url(#bullish_gradient_${D.value})`:M.value.colors.bullish:M.value.gradient.show?`url(#bearish_gradient_${D.value})`:M.value.colors.bearish,rx:M.value.borderRadius,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:{"vue-data-ui-transition":E.value&&!S(L)&&!S(H)}}),null,16,jt))),256))])],64)):f(``,!0),j.value.type===`ohlc`?(v(!0),p(u,{key:5},b(Q.value,(e,t)=>(v(),p(`g`,{key:`ohlc_${e.absoluteIndex}`},[m(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y} M${e.open.x-Math.min(6,X.value/3)},${e.open.y} ${e.open.x},${e.open.y} M${e.close.x},${e.close.y} ${e.close.x+Math.min(6,X.value/3)},${e.close.y}`,stroke:e.isBullish?M.value.colors.bullish:M.value.colors.bearish,"stroke-width":1,class:_({"vue-data-ui-transition":S(wn)&&!S(H)}),"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,Mt)]))),128)):f(``,!0),m(`g`,null,[(v(!0),p(u,null,b(Q.value,(e,t)=>(v(),p(`rect`,{x:U.value.left+t*X.value,y:U.value.top,height:U.value.height<=0?1e-4:U.value.height,width:X.value<=0?1e-4:X.value,fill:O.value===t||bn.value===t?S(ie)(P.value.selector.color,P.value.selector.opacity):`transparent`,onMouseover:()=>Zr(t,e,`pointer`),onMouseleave:()=>Xr(t,e),onClick:()=>Yr(t,e)},null,40,Nt))),256))])])):f(``,!0),Mi.value?(v(),p(`rect`,{key:2,x:Mi.value.x,y:Mi.value.y,width:Mi.value.width,height:Mi.value.height,fill:rr.value.selection.fill,"fill-opacity":rr.value.selection.fillOpacity,stroke:rr.value.selection.stroke,"stroke-opacity":rr.value.selection.strokeOpacity,"stroke-width":rr.value.selection.strokeWidth,"stroke-dasharray":rr.value.selection.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`},null,8,Pt)):f(``,!0),or.value?(v(),p(`rect`,Je({key:3},Zn.value,{"data-start":G.value.start,"data-end":G.value.end}),null,16,Ft)):f(``,!0),x(e.$slots,`svg`,{svg:{...B.value,data:Q.value,drawingArea:U.value,isPrintingImg:S(Bn)||S(Vn)||S(Ci),isPrintingSvg:S(wi)}},void 0,!0)],46,ut)),e.$slots.hint?(v(),p(`div`,It,[x(e.$slots,`hint`,Xe(g({hint:j.value.a11y.translations.keyboardNavigation,isVisible:Cn.value})),void 0,!0)])):f(``,!0)]),e.$slots.watermark?(v(),p(`div`,Lt,[x(e.$slots,`watermark`,Xe(g({isPrinting:S(Bn)||S(Vn)||S(Ci)||S(wi)})),void 0,!0)])):f(``,!0),F.value.zoom.show&&W.value>6&&Qt.value&&ii.value?(v(),We(Ve,{key:6,ref_key:`chartSlicer`,ref:un,"data-dom-to-png-ignore-layout":``,allMinimaps:Dr.value,background:F.value.zoom.color,borderColor:F.value.backgroundColor,customFormat:F.value.zoom.customFormat,cutNullValues:!1,enableRangeHandles:F.value.zoom.enableRangeHandles,enableSelectionDrag:F.value.zoom.enableSelectionDrag,end:G.value.end,focusOnDrag:F.value.zoom.focusOnDrag,focusRangeRatio:F.value.zoom.focusRangeRatio,fontSize:F.value.zoom.fontSize,immediate:!F.value.zoom.preview.enable,inputColor:F.value.zoom.color,isPreview:or.value,labelLeft:Gr.value.start||``,labelRight:Gr.value.end||``,max:W.value,min:0,minimap:F.value.zoom.minimap.show?S(R).map(e=>e[2]):[],minimapCompact:F.value.zoom.minimap.compact,minimapFrameColor:F.value.zoom.minimap.frameColor,minimapIndicatorColor:F.value.zoom.minimap.indicatorColor,minimapMerged:!1,minimapSelectedColor:F.value.zoom.minimap.selectedColor,minimapSelectedColorOpacity:F.value.zoom.minimap.selectedColorOpacity,minimapSelectedIndex:O.value,minimapSelectionRadius:1,preciseLabels:Br.value,refreshEndPoint:F.value.zoom.endIndex===null?W.value:F.value.zoom.endIndex+1,refreshStartPoint:F.value.zoom.startIndex===null?0:F.value.zoom.startIndex,selectColor:F.value.zoom.highlightColor,selectedSeries:S(R),smoothMinimap:!1,start:G.value.start,textColor:F.value.color,timeLabels:Nr.value,usePreciseLabels:N.value.xAxis.dataLabels.datetimeFormatter.enable&&!F.value.zoom.useDefaultFormat,useResetSlot:F.value.zoom.useResetSlot,valueEnd:G.value.end,valueStart:G.value.start,verticalHandles:F.value.zoom.minimap.verticalHandles,minScale:N.value.yAxis.scale.min,maxScale:N.value.yAxis.scale.max,maxWidth:F.value.zoom.maxWidth,minimapLeftInsetRatio:B.value.width>0&&F.value.zoom.autoFit?U.value.left/B.value.width:null,minimapRightInsetRatio:B.value.width>0&&F.value.zoom.autoFit?(B.value.width-U.value.right)/B.value.width:null,additionalMinimapHeight:F.value.zoom.minimap.additionalHeight,handleType:F.value.zoom.minimap.handleType,handleIconColor:F.value.zoom.minimap.handleIconColor,handleBorderWidth:F.value.zoom.minimap.handleBorderWidth,handleBorderColor:F.value.zoom.minimap.handleBorderColor,handleFill:F.value.zoom.minimap.handleFill,handleWidth:F.value.zoom.minimap.handleWidth,"onUpdate:end":Ai,"onUpdate:start":ki,onTrapMouse:Di,onReset:s[0]||=()=>ni({force:!0,publish:!0}),onFutureEnd:s[1]||=e=>sr(`end`,e),onFutureStart:s[2]||=e=>sr(`start`,e)},{"reset-action":C(({reset:t})=>[x(e.$slots,`reset-action`,Xe(g({reset:t})),void 0,!0)]),slotMap:C(({height:e,unitW:t})=>[(v(!0),p(u,null,b(Er.value({minimapH:e,unitW:t}),(e,n)=>(v(),p(`g`,null,[m(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y}`,stroke:e.isBullish?M.value.colors.bullish:M.value.colors.bearish,"stroke-width":1,style:Ze({opacity:n>=K.value.start&&n<=K.value.end?1:.6})},null,12,Rt),m(`path`,{d:`M ${e.open.x},${e.open.y} ${e.close.x},${e.close.y}`,stroke:e.isBullish?M.value.colors.bullish:M.value.colors.bearish,"stroke-width":Math.min(6,t/1.5),style:Ze({opacity:n>=K.value.start&&n<=K.value.end?1:.6})},null,12,zt)]))),256))]),_:3},8,/* @__PURE__ */ `allMinimaps.background.borderColor.customFormat.enableRangeHandles.enableSelectionDrag.end.focusOnDrag.focusRangeRatio.fontSize.immediate.inputColor.isPreview.labelLeft.labelRight.max.minimap.minimapCompact.minimapFrameColor.minimapIndicatorColor.minimapSelectedColor.minimapSelectedColorOpacity.minimapSelectedIndex.preciseLabels.refreshEndPoint.refreshStartPoint.selectColor.selectedSeries.start.textColor.timeLabels.usePreciseLabels.useResetSlot.valueEnd.valueStart.verticalHandles.minScale.maxScale.maxWidth.minimapLeftInsetRatio.minimapRightInsetRatio.additionalMinimapHeight.handleType.handleIconColor.handleBorderWidth.handleBorderColor.handleFill.handleWidth`.split(`.`))):f(``,!0),m(`div`,{ref_key:`chartLegend`,ref:ln},[x(e.$slots,`legend`,{legend:Q.value},void 0,!0)],512),e.$slots.source?(v(),p(`div`,{key:7,ref_key:`source`,ref:dn,dir:`auto`},[x(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),qe(S(Ht),{teleportTo:F.value.tooltip.teleportTo,show:V.value.showTooltip&&an.value,backgroundColor:F.value.tooltip.backgroundColor,color:F.value.tooltip.color,borderRadius:F.value.tooltip.borderRadius,borderColor:F.value.tooltip.borderColor,borderWidth:F.value.tooltip.borderWidth,fontSize:F.value.tooltip.fontSize,backgroundOpacity:F.value.tooltip.backgroundOpacity,position:F.value.tooltip.position,offsetX:F.value.tooltip.offsetX,offsetY:F.value.tooltip.offsetY,parent:k.value,content:on.value,isFullscreen:ui.value,isCustom:F.value.tooltip.customFormat&&typeof F.value.tooltip.customFormat==`function`,smooth:F.value.tooltip.smooth,backdropFilter:F.value.tooltip.backdropFilter,smoothForce:F.value.tooltip.smoothForce,smoothSnapThreshold:F.value.tooltip.smoothSnapThreshold,isA11yMode:Sn.value===`keyboard`,a11yPosition:xn.value},{"tooltip-before":C(()=>[x(e.$slots,`tooltip-before`,Xe(g({...Jr.value})),void 0,!0)]),tooltip:C(()=>[x(e.$slots,`tooltip`,Xe(g({...Jr.value})),void 0,!0)]),"tooltip-after":C(()=>[x(e.$slots,`tooltip-after`,Xe(g({...Jr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Qt.value&&I.value.buttons.table?(v(),We(et(yi.value.component),Je({key:8},yi.value.props,{ref_key:`tableUnit`,ref:vn,onClose:bi}),Ge({content:C(()=>[(v(),We(S(Wt),{key:`table_${mn.value}`,colNames:li.value.colNames,head:li.value.head,body:li.value.body,config:li.value.config,title:j.value.table.useDialog?``:yi.value.title,withCloseButton:!j.value.table.useDialog,isCursorPointer:Tn.value,onClose:bi},{th:C(({th:e})=>[Ke(nt(e),1)]),td:C(({td:e})=>[m(`div`,{innerHTML:e},null,8,Bt)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[j.value.table.useDialog?{name:`title`,fn:C(()=>[Ke(nt(yi.value.title),1)]),key:`0`}:void 0,j.value.table.useDialog?{name:`actions`,fn:C(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[3]||=e=>ci(I.value.callbacks.csv),style:Ze({cursor:Tn.value?`pointer`:`default`})},[qe(S(Vt),{name:`fileCsv`,stroke:yi.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),x(e.$slots,`skeleton`,{},()=>[S(L)?(v(),We(ze,{key:0})):f(``,!0)],!0)],46,st))}},[[`__scopeId`,`data-v-37e79378`]]);export{ot as n,Vt 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{D as i,Jt as ee,X as a,at as o,nt as te,zt as s}from"./lib-rPeBMZrn.js";import{n as ne,t as re}from"./useHints-C-TwxM0Y.js";import{t as ie}from"./useConfig-9oDGTWWG.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{t as oe}from"./useNestedProp-DnGoh-XS.js";import{t as se}from"./useUserOptionState-CXlFnwPv.js";import{t as ce}from"./usePrefersMotion-XLHwega2.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createBlock as ue,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as de,createTextVNode as p,defineAsyncComponent as fe,guardReactiveProps as pe,mergeProps as m,nextTick as me,normalizeClass as he,normalizeProps as ge,normalizeStyle as h,onBeforeUnmount as _e,onMounted as g,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,unref as S,useSlots as ve,watch as C,withCtx as ye}from"vue";var be=/* @__PURE__ */ e({default:()=>w}),xe=[`id`],Se=[`aria-labelledby`],Ce=[`id`],we=[`height`],Te=[`id`],Ee=[`data-cell`,`aria-label`,`height`],De={key:2,dir:`auto`},w=/*#__PURE__*/ le({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:le,emit:be}){let w=fe(()=>import(`./vue-ui-skeleton-Bpwe9ox7.js`).then(e=>e.n)),Oe=fe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),{vue_ui_carousel_table:ke}=ie(),Ae=ce(),T=e,je=be,E=v(a()),Me=v(!1),D=l(()=>Array.isArray(T.dataset?.head)&&T.dataset.head.length>0&&Array.isArray(T.dataset?.body)&&T.dataset.body.length>0&&T.dataset.body.every(Array.isArray)),Ne=ve();g(()=>{Fe()});let O=l(()=>oe({userConfig:T.config,defaultConfig:ke})),Pe=l(()=>({...O.value.userOptions,buttons:{...O.value.userOptions.buttons,animation:O.value.userOptions.buttons.animation&&!Ae.value}})),k=l(()=>O.value.debug);g(()=>{Ne[`chart-background`]&&k.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Fe(){s(T.dataset)?o({componentName:`VueUiCarouselTable`,type:`dataset`,debug:k.value}):((!T.dataset.head||s(T.dataset.head))&&o({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:k.value}),(!T.dataset.body||s(T.dataset.body))&&o({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:k.value}))}ne({config:()=>O.value,dataset:()=>T.dataset,component:`VueUiCarouselTable`,rules:[re.noHint]});let Ie=l(()=>O.value.userOptions.useCursorPointer),{userOptionsVisible:A,setUserOptionsVisibility:j,keepUserOptionState:Le}=se({config:O.value});C(()=>T.config,()=>{A.value=!O.value.userOptions.showOnChartHover},{deep:!0}),C(()=>T.dataset,Fe,{deep:!0});let{isPrinting:Re,isImaging:ze,generatePdf:Be,generateImage:Ve}=ae({elementId:`carousel-table_${E.value}`,fileName:O.value.caption.text||`vue-ui-carousel-table`,options:O.value.userOptions.print}),M=v({showAnimation:O.value.animation.use}),N=v(null),He=v(null),Ue=v(null),We=v(null),P=v(0),F=v(0),I=v(!1),L=v(null),R=v([]),z=v(0),Ge=l(()=>R.value.length?Math.max(...R.value)+P.value+F.value:0),Ke=l(()=>T.dataset.body?O.value.tbody.tr.visible<=T.dataset.body.length?O.value.tbody.tr.visible:T.dataset.body.length:0),qe=l(()=>(O.value.tbody.tr.height+O.value.tbody.tr.td.padding.top+O.value.tbody.tr.td.padding.bottom+O.value.tbody.tr.border.size*2)*Ke.value+P.value+F.value),B=v(0),V=null,H=null,U=null,W=null,G=!1,K=v(!1),q=v(!1),J=v(!1),Y=l(()=>K.value||J.value||q.value&&O.value.animation.pauseOnHover||!M.value.showAnimation||Ae.value||!D.value),Je=v(0);function Ye(e){Me.value=e,Je.value+=1}function X(){V!==null&&cancelAnimationFrame(V),V=null,H=null}function Z(){!G&&!Y.value&&N.value&&R.value.length&&V===null&&(V=requestAnimationFrame(Xe))}function Xe(e){if(V=null,G||Y.value||!N.value||!R.value.length)return;let t=H===null?0:e-H,n=N.value,r=Number(O.value.animation.speedMs);!Number.isFinite(r)||r<=0||(O.value.animation.type===`scroll`?(H===null&&(H=e),t>=r&&(n.scrollTop+n.clientHeight>=n.scrollHeight||z.value>=R.value.length?(B.value=0,z.value=0):B.value+=R.value[z.value++],n.scrollTo({top:B.value,behavior:`smooth`}),H=e)):(B.value+=r/4e3*t*60/1e3,B.value>=n.scrollHeight-n.clientHeight&&(B.value=0),n.scrollTo({top:B.value,behavior:`auto`}),H=e),Z())}function Ze(){K.value=!0,X()}function Qe(){K.value=!1,Z()}function $e(){J.value=!0,X(),clearTimeout(U)}function et(){clearTimeout(U),U=setTimeout(()=>{J.value=!1},1e3)}function tt(){let e=N.value?.querySelector(`thead`);if(!e||!L.value)return;let t=e.getBoundingClientRect().bottom;for(let e of L.value.querySelectorAll(`tr`))e.style.visibility=e.getBoundingClientRect().top<t?`hidden`:`visible`}function Q(){G||(X(),P.value=Ue.value?.getBoundingClientRect().height||0,F.value=We.value?.getBoundingClientRect().height||0,R.value=Array.from(L.value?.querySelectorAll(`tr`)||[],e=>e.getBoundingClientRect().height),B.value=0,z.value=0,N.value?.scrollTo({top:0,behavior:`auto`}),tt(),Z())}C(Y,()=>{X(),Z()},{flush:`sync`}),C(()=>O.value.animation.use,e=>{M.value.showAnimation=e}),C([()=>T.dataset,O],Q,{deep:!0,flush:`post`}),C(()=>O.value.animation.speedMs,()=>{X(),Z()}),g(()=>{Q(),W=new ResizeObserver(e=>{if(!G){for(let t of e)I.value=t.contentRect.width<O.value.responsiveBreakpoint;me(Q)}}),N.value&&W.observe(N.value)}),_e(()=>{G=!0,X(),clearTimeout(U),W?.disconnect()});function nt(){Be()}function rt(){M.value.showAnimation=!M.value.showAnimation}function it(e=null){me(()=>{let t=[[O.value.caption.text],T.dataset?.head||[],...T.dataset?.body||[]],n=i(t);e?e(n):te({csvContent:n,title:O.value.caption.text||`vue-ui-carousel-table`})})}async function $(){je(`copyAlt`,{config:O.value,dataset:T.dataset}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:T.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return le({pauseAnimation:Ze,resumeAnimation:Qe,toggleAnimation:rt,generateCsv:it,generatePdf:nt,generateImage:Ve,copyAlt:$}),(i,a)=>(_(),d(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:He,onMouseenter:a[5]||=()=>S(j)(!0),onMouseleave:a[6]||=()=>S(j)(!1)},[f(`div`,{ref_key:`tableContainer`,ref:N,id:`carousel-table_${E.value}`,style:h({height:S(Re)||S(ze)?`auto`:`${Math.max(qe.value,Ge.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:O.value.style.fontFamily}),class:he({"vue-ui-responsive":I.value,"is-playing":O.value.scrollbar.hide||!Y.value&&O.value.scrollbar.showOnlyOnHover}),onMouseenter:a[0]||=e=>q.value=!0,onMouseleave:a[1]||=e=>q.value=!1,onTouchstart:a[2]||=e=>$e(),onTouchend:a[3]||=e=>et(),onTouchcancel:a[4]||=e=>et(),onScroll:tt},[D.value?(_(),d(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${E.value}`,style:h({...O.value.style,border:`${O.value.border.size}px solid ${O.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:O.value.tbody.backgroundColor})},[f(`caption`,{ref_key:`caption`,ref:Ue,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${E.value}`,style:h({...O.value.caption.style,fontFamily:`inherit`,position:`sticky`,top:0,zIndex:2,paddingTop:O.value.caption.padding.top+`px`,paddingRight:O.value.caption.padding.right+`px`,paddingBottom:O.value.caption.padding.bottom+`px`,paddingLeft:O.value.caption.padding.left+`px`,boxShadow:I.value?O.value.thead.tr.style.boxShadow:`none`,minHeight:`36px`,display:i.$slots.caption||O.value.caption.text||O.value.userOptions.show?``:`none`})},[p(x(O.value.caption.text&&!i.$slots.caption?O.value.caption.text:``)+` `,1),b(i.$slots,`caption`,{},void 0,!0)],12,Ce),f(`thead`,{role:`rowgroup`,style:h({...O.value.thead.style,position:`sticky`,top:`${i.$slots.caption||O.value.caption.text||O.value.userOptions.show?P.value:0}px`,zIndex:1})},[f(`tr`,{ref_key:`tableRow`,ref:We,role:`row`,style:h({...O.value.thead.tr.style,border:O.value.thead.tr.border.size?`${O.value.thead.tr.border.size}px solid ${O.value.thead.tr.border.color}`:`none`,boxShadow:I.value?`none`:O.value.thead.tr.style.boxShadow}),height:`${O.value.thead.tr.height}px`},[(_(!0),d(c,null,y(e.dataset.head,(e,t)=>(_(),d(`th`,{role:`cell`,key:`th_${t}`,id:`col-${t}`,scope:`col`,style:h({...O.value.thead.tr.th.style,border:O.value.thead.tr.th.border.size?`${O.value.thead.tr.th.border.size}px solid ${O.value.thead.tr.th.border.color}`:`none`,paddingTop:O.value.thead.tr.th.padding.top+`px`,paddingRight:O.value.thead.tr.th.padding.right+`px`,paddingBottom:O.value.thead.tr.th.padding.bottom+`px`,paddingLeft:O.value.thead.tr.th.padding.left+`px`})},[p(x(i.$slots.th?``:e)+` `,1),b(i.$slots,`th`,m({ref_for:!0},{th:e,colIndex:t}),void 0,!0)],12,Te))),128))],12,we)],4),e.dataset.body&&e.dataset.head?(_(),d(`tbody`,{key:0,ref_key:`tbody`,ref:L,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(_(!0),d(c,null,y(e.dataset.body,(t,n)=>(_(),d(`tr`,{style:h({...O.value.tbody.tr.style,border:`${O.value.tbody.tr.border.size}px solid ${O.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(_(!0),d(c,null,y(t,(t,r)=>(_(),d(`td`,{role:`cell`,"data-cell":e.dataset.head[r]||``,"aria-label":`${e.dataset.head[r]}: ${t}`,style:h({...O.value.tbody.tr.td.style,border:`${O.value.tbody.tr.td.border.size}px solid ${O.value.tbody.tr.td.border.color}`,backgroundColor:S(ee)(O.value.tbody.tr.td.style.backgroundColor,n%2==0&&O.value.tbody.tr.td.alternateColor?O.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:O.value.tbody.tr.td.padding.top+`px`,paddingRight:O.value.tbody.tr.td.padding.right+`px`,paddingBottom:O.value.tbody.tr.td.padding.bottom+`px`,paddingLeft:O.value.tbody.tr.td.padding.left+`px`,verticalAlign:`middle`}),height:`${O.value.tbody.tr.height}px`},[p(x(i.$slots.td?``:t)+` `,1),b(i.$slots,`td`,m({ref_for:!0},{td:t,rowIndex:n,colIndex:r}),void 0,!0)],12,Ee))),256))],4))),256))],512)):u(``,!0)],12,Se)):u(``,!0)],46,xe),D.value?u(``,!0):(_(),ue(S(w),{key:0,config:{type:`table`}})),O.value.userOptions.show&&D.value&&(S(Le)||S(A))?(_(),ue(S(Oe),m({key:`user_option_${Je.value}`,backgroundColor:O.value.style.backgroundColor,color:O.value.style.color,isPrinting:S(Re),isImaging:S(ze),uid:E.value,hasTooltip:!1,hasTable:!1,hasLabel:!1,isAnimation:!M.value.showAnimation,isFullscreen:Me.value,chartElement:He.value},S(n)(Pe.value,`pdf csv img fullscreen altCopy animation`),{zIndex:3,offsetX:12,isCursorPointer:Ie.value,onGeneratePdf:nt,onGenerateCsv:it,onGenerateImage:S(Ve),onToggleAnimation:rt,onToggleFullscreen:Ye,onCopyAlt:$,style:{visibility:S(Le)?S(A)?`visible`:`hidden`:`visible`}}),de({_:2},[y(S(t)(i.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:ye(t=>[b(i.$slots,e,ge(pe(S(r)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isAnimation`,`isFullscreen`,`chartElement`,`isCursorPointer`,`onGenerateImage`,`style`])):u(``,!0),i.$slots.source?(_(),d(`div`,De,[b(i.$slots,`source`,{},void 0,!0)])):u(``,!0)],544))}},[[`__scopeId`,`data-v-ccc86015`]]);export{be as n,w 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 ee}from"./tableIntegration-CNoJ1CIY.js";import{n as te}from"./resolveChartConfig-0IvbmIE_.js";import{$ as s,D as ne,Ht as re,It as ie,Jt as c,S as ae,X as oe,Yt as se,at as ce,f as le,h as ue,i as l,in as de,nt as fe,p as pe,r as me,t as he,w as ge,yt as _e,zt as ve}from"./lib-rPeBMZrn.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./useConfig-9oDGTWWG.js";import{t as Se}from"./useLoading-BwiplGDB.js";import{t as Ce}from"./usePrinter-DVf3YcG5.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useTableResponsive-uSz_qZOB.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./chartImage-DPGnEuYM.js";import{t as ke}from"./vue_ui_chestnut-BKcntsvv.js";import{t as Ae}from"./BaseScanner-m6QR9rwD.js";import{t as je}from"./A11yDataTable-DWNlWXzs.js";import{t as Me}from"./DefGrad-DKMq1REY.js";import{t as Ne}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as u,computed as d,createBlock as Pe,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Fe,createTextVNode as Ie,createVNode as h,defineAsyncComponent as Le,guardReactiveProps as Re,mergeProps as ze,nextTick as Be,normalizeClass as g,normalizeProps as Ve,normalizeStyle as _,onBeforeUnmount as He,onMounted as Ue,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as We,toDisplayString as S,toRefs as Ge,unref as C,useCssVars as Ke,watch as qe,withCtx as Je,withKeys as Ye}from"vue";var Xe=/* @__PURE__ */ e({default:()=>sn}),Ze=[`id`],Qe=[`id`],$e={"aria-live":`polite`,class:`sr-only`},et={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},tt={style:{position:`relative`}},nt=[`xmlns`,`aria-describedby`,`viewBox`],rt=[`width`,`height`],it={key:1},at=[`fill`,`font-weight`,`font-size`,`x`,`y`],ot=[`fill`,`font-weight`,`font-size`,`x`,`y`],st={key:2},ct=[`x`,`y`,`font-size`,`font-weight`,`fill`],lt=[`x`,`y`,`font-size`,`font-weight`,`fill`],ut=[`d`,`stroke`,`fill`],dt=[`cx`,`cy`,`r`,`fill`],ft=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],pt={key:3},mt=[`x`,`y`,`font-size`,`fill`,`onClick`],ht={key:0},gt=[`x`,`y`,`fill`,`font-size`,`font-weight`],_t=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],vt=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],yt={key:4},bt=[`x`,`y`,`fill`,`font-size`,`onClick`],xt=[`d`,`stroke`],St=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],Ct={key:5},wt=[`x`,`y`,`font-size`,`font-weight`,`fill`],Tt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Et=[`y`,`height`,`width`],Dt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Ot={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},kt={viewBox:`0 0 20 20`,height:`16`,width:`16`},At=[`fill`],jt={key:7},Mt=[`y`,`height`,`width`],Nt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Pt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Ft={viewBox:`0 0 20 20`,height:`16`,width:`16`},It=[`fill`],Lt=[`cx`,`cy`,`fill`],Rt=[`d`,`stroke`],zt=[`cx`,`cy`,`fill`],Bt=[`d`,`stroke`],Vt=[`cx`,`cy`,`fill`],Ht=[`cx`,`cy`,`fill`],Ut=[`x`,`y`,`fill`,`font-size`,`font-weight`],Wt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Jt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Yt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Xt=[`x`,`y`,`font-size`,`fill`],Zt=[`x`,`y`,`font-size`,`fill`],Qt=[`x`,`y`,`font-size`,`fill`],$t={key:4,class:`vue-data-ui-watermark`},en={key:5,ref:`source`,dir:`auto`},tn={class:`vue-ui-data-table`},nn={key:0},rn=[`data-cell`],an={class:`vue-ui-chestnut-table-cell`},on={key:0},sn=/*#__PURE__*/ Ne({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:Ne,emit:Xe}){Ke(e=>({v3fd2ee81:Fn.value}));let sn=Le(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),cn=Le(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),ln=Le(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),un=Le(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),dn=Le(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),fn=Le(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_chestnut:pn}=xe(),w=e,mn=d(()=>!!w.dataset&&w.dataset.length),T=y(oe()),hn=y(null),gn=y(0),_n=y(null),vn=y(null),yn=y(!1),E=y(!1),D=y(``),O=y({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0}),k=y(Dn()),A=d(()=>k.value.style.chart.layout.roots),j=d(()=>k.value.style.chart.layout.branches),M=d(()=>k.value.style.chart.layout.nuts),N=d(()=>k.value.style.chart.layout),P=d(()=>k.value.style.chart);ye({config:()=>k.value,dataset:()=>w.dataset,component:`VueUiChestnut`,rules:[be.emptyArray,{test:e=>e.some(e=>e?.branches&&e.branches.length>10),message:[`👀 Some root has > 10 branches, which can make the chart heavy. Consider:`,``,`▶️ Grouping some branches in broader categories.`]},{test:e=>e.some(e=>e?.branches&&e.branches.some(e=>e?.breakdown&&e?.breakdown.length>6)),message:[`👀 Some donuts have > 6 series. Consider:`,``,`▶️ Grouping small values into an "Other" category.`]}]});let F=d(()=>k.value.userOptions.useCursorPointer),bn=d(()=>de({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grandTotal:{show:!1},roots:{stroke:`#6A6A6A`,labels:{show:!1}},verticalSeparator:{stroke:`transparent`},branches:{stroke:`#6A6A6A`,underlayerColor:`#6A6A6A90`,labels:{show:!1,dataLabels:{show:!1}}}}}}},userConfig:k.value.skeletonConfig??{}})),{loading:xn,FINAL_DATASET:Sn}=Se({...Ge(w),FINAL_CONFIG:k,prepareConfig:Dn,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,color:`#969696`,branches:[{name:`_`,value:32,breakdown:[{name:`_`,value:16,color:`#CACACA`},{name:`_`,value:16,color:`#6A6A6A`}]},{name:`_`,value:16,breakdown:[{name:`_`,value:8,color:`#CACACA`},{name:`_`,value:8,color:`#6A6A6A`}]},{name:`_`,value:8,breakdown:[{name:`_`,value:4,color:`#CACACA`},{name:`_`,value:4,color:`#6A6A6A`}]},{name:`_`,value:4,breakdown:[{name:`_`,value:2,color:`#CACACA`},{name:`_`,value:2,color:`#6A6A6A`}]}]},{name:`_`,color:`#C4C4C4`,branches:[{name:`_`,value:24,breakdown:[{name:`_`,value:12,color:`#CACACA`},{name:`_`,value:12,color:`#6A6A6A`}]},{name:`_`,value:12,breakdown:[{name:`_`,value:6,color:`#CACACA`},{name:`_`,value:6,color:`#6A6A6A`}]},{name:`_`,value:6,breakdown:[{name:`_`,value:3,color:`#CACACA`},{name:`_`,value:3,color:`#6A6A6A`}]},{name:`_`,value:2,breakdown:[{name:`_`,value:1,color:`#CACACA`},{name:`_`,value:1,color:`#6A6A6A`}]}]}],skeletonConfig:de({defaultConfig:k.value,userConfig:bn.value})}),{userOptionsVisible:Cn,setUserOptionsVisibility:wn,keepUserOptionState:Tn}=Ee({config:k.value}),{svgRef:En}=De({config:N.value.title});function Dn(){return te(w.config,pn,ke)}qe(()=>w.config,e=>{k.value=Dn(),Cn.value=!k.value.userOptions.showOnChartHover,I.value.showTable=k.value.table.show,dr()},{deep:!0});let{isPrinting:On,isImaging:kn,generatePdf:An,generateImage:jn}=Ce({elementId:`vue-ui-chestnut_${T.value}`,fileName:N.value.title.text||`vue-ui-chestnut`,options:k.value.userOptions.print}),Mn=d(()=>k.value.userOptions.show),Nn=d(()=>ge(k.value.customPalette)),I=y({showTable:k.value.table.show});qe(k,()=>{I.value={showTable:k.value.table.show}},{immediate:!0});let Pn=y(null),Fn=d(()=>k.value.table.td.outline),In=d(()=>k.value.table.responsiveBreakpoint),Ln={gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,branchSize:32,branchStart:128},L=d(()=>({...Ln,height:Vn.value*(Ln.branchSize+Ln.gap)+Ln.padding.top+Ln.padding.bottom})),R=d(()=>({left:L.value.padding.left,top:L.value.padding.top,right:L.value.width-L.value.padding.right,bottom:L.value.height-L.value.padding.bottom,width:L.value.width-(L.value.padding.left+L.value.padding.right),height:L.value.height-(L.value.padding.top+L.value.padding.bottom),seedX:L.value.padding.left+64}));function z(e,t){return t===0?0:e/t}let B=d(()=>Sn.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),Rn=d(()=>k.value.debug),V=d(()=>(Rn.value&&Sn.value.forEach((e,t)=>{_e({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{ce({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{_e({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{ce({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{_e({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{ce({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),Sn.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0),r=ae(e.color)||Nn.value[t]||re[t]||re[t%re.length];return{...e,color:r,id:e.id||`root_${t}_${T.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((i,a)=>({...i,rootName:e.name,rootIndex:t,color:r,value:i.value>=0?i.value:0,id:i.id||`branch_${t}_${a}_${T.value}`,proportionToRoot:z(i.value,n),type:`branch`,breakdown:(i.breakdown||[]).map((r,o)=>({table:{rootName:e.name,rootValue:n,rootToTotal:z(n,B.value),branchName:i.name,branchValue:i.value,branchToTotal:z(i.value,B.value),branchToRoot:z(i.value,n),nutName:r.name,nutValue:r.value,nutToTotal:z(r.value,B.value),nutToRoot:z(r.value,n),nutToBranch:z(r.value,i.value)},...r,type:`nut`,branchName:i.name,rootName:e.name,branchTotal:i.value>=0?i.value:0,proportionToBranch:z(r.value,i.value),proportionToRoot:z(r.value,n),proportionToTree:z(r.value,B.value),rootIndex:t,id:r.id||`nut_${t}_${a}_${o}_${T.value}`,color:ae(r.color)||Nn.value[o]||re[o]||re[o%re.length],value:r.value>=0?r.value:0}))}))}})));function zn(){return V.value}let Bn=Xe,Vn=d(()=>V.value.flatMap(e=>e.branches).length),Hn=d(()=>Math.max(...V.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),Un=d(()=>Math.max(...V.value.flatMap(e=>e.branches.map(e=>e.value)))),Wn=d(()=>256+L.value.padding.left),Gn=d(()=>[...V.value].sort((e,t)=>t.total-e.total)),H=d(()=>Gn.value.map((e,t)=>{let n=R.value.height/V.value.length/2,r=z(e.total,Hn.value)*(n>64?64:n);return{...e,x:R.value.seedX,y:R.value.top+R.value.height/V.value.length*(t+1)-(R.value.height/V.value.length/2+L.value.gap/2),r:r<L.value.branchSize/2?L.value.branchSize/2:r}})),Kn=d(()=>j.value.widthRatio<=0?.1:j.value.widthRatio>1.8?1.8:j.value.widthRatio),qn=d(()=>H.value.flatMap(e=>e.branches)),U=d(()=>[...qn.value].sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*L.value.branchSize+R.value.top+t*L.value.gap,y2:t*L.value.branchSize+L.value.branchSize,x1:Wn.value,x2:384*z(e.value,Un.value)*Kn.value+Wn.value}))),Jn=d(()=>H.value.map(e=>U.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Yn=d(()=>H.value.map((e,t)=>Jn.value[t].map(e=>(e.breakdown||[]).map((t,n)=>({...t,nutIndex:n,rootIndex:e.rootIndex,branchId:e.id,branchName:e.name,branchValue:e.value,rootName:e.rootName}))))),Xn=d(()=>new Map(H.value.map(e=>[e.rootIndex,e])));function Zn(e){let{x:t,y:n,r}=Xn.value.get(e.rootIndex);return{x:t,y:n,r}}let Qn=d(()=>new Map(U.value.map(e=>[e.id,ie({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+L.value.branchSize/2,L.value.branchSize/3,L.value.branchSize/3)]))),W=y(null),$n=d(()=>W.value?ie({series:W.value.breakdown,base:1},W.value.x2+24+M.value.offsetX,W.value.y1+L.value.branchSize/2,80,80):null),er=0,tr=!1,G=y(null),K=y(null);function nr(){er+=1,W.value=null,G.value=null,K.value=null}function rr(e,t){return e.type===`root`?e.rootIndex===t.rootIndex:e.type===`branch`?e.id===t.id:e.type===`nut`&&e.branchName===t.name&&e.rootIndex===t.rootIndex}function q(){nr(),Gr(),E.value=!1}function ir(e,t){let n=H.value.findIndex(t=>t.rootIndex===e.rootIndex),r=(Jn.value[n]||[]).findIndex(t=>t.id===e.id);n!==-1&&(O.value.rootIndex=n),r!==-1&&(O.value.branchIndex=r),O.value.level=t,O.value.nutIndex=0}function ar(e,t){return t?e.type===`root`?e.id===t.id:[`branch`,`nut`].includes(e.type)&&e.rootIndex===t.rootIndex:!1}function J(e){let t=W.value??G.value;if(t)return rr(e,t);if(K.value)return ar(e,K.value);if(!yn.value||!E.value)return!0;let n=O.value.level;return n===`root`?ar(e,Ur.value):e.type===`root`?!!Ur.value&&e.rootIndex===Ur.value.rootIndex:e.type===`branch`?!!Q.value&&e.id===Q.value.id:n===`nut`&&Q.value?rr(e,Q.value):!1}function or(e){nr(),ir(e,`nut`);let t=er;Be(()=>{tr||t!==er||(W.value=e,G.value=e,Bn(`selectNut`,e.breakdown),$())})}function Y(){er+=1,W.value=null,Bn(`selectNut`,null)}function sr(e){ir(e,`branch`),G.value&&G.value.id===e.id?(G.value=null,nr(),Bn(`selectBranch`,null),$()):(nr(),G.value=e,Bn(`selectBranch`,e),$())}function cr(e){let t=H.value.findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),O.value.level=`root`,O.value.branchIndex=0,O.value.nutIndex=0,K.value&&K.value.id===e.id?(nr(),Bn(`selectRoot`,null),$()):(nr(),K.value=e,Bn(`selectRoot`,e),$())}function lr(){return R.value.bottom-(W.value.y1+180)<0?0:R.value.bottom}let X=d(()=>new Map(($n.value||[]).map(e=>[e,{normal:le(e),selected:le(e,!0),y:pe(e)}])));function ur(e){return e.proportion*100>M.value.selected.labels.dataLabels.hideUnderValue}Ue(()=>{dr()});function dr(){ve(w.dataset)&&ce({componentName:`VueUiChestnut`,type:`dataset`,debug:Rn.value})}let fr=[{key:`rootName`,group:`root`},{key:`rootValue`,group:`root`,numeric:!0},{key:`rootToTotal`,group:`root`,percentage:!0},{key:`branchName`,group:`branch`},{key:`branchValue`,group:`branch`,numeric:!0},{key:`branchToRoot`,group:`branch`,percentage:!0},{key:`branchToTotal`,group:`branch`,percentage:!0},{key:`nutName`},{key:`nutValue`,numeric:!0},{key:`nutToBranch`,percentage:!0},{key:`nutToRoot`,percentage:!0},{key:`nutToTotal`,percentage:!0}],pr=d(()=>Gn.value.flatMap(e=>e.branches.flatMap((t,n)=>t.breakdown.map(t=>({data:t.table,rootIndex:e.rootIndex,branchIndex:n}))))),Z=d(()=>({head:fr.map(e=>k.value.table.th.translations[e.key]),body:pr.value.map(e=>e.data)}));function mr(e,t){if(!t||e===0)return!1;let n=pr.value[e-1],r=pr.value[e];return n.rootIndex===r.rootIndex&&(t===`root`||n.branchIndex===r.branchIndex)}function hr(e,t){let n=e[t.key];return t.percentage?`${(n*100).toFixed(k.value.table.td.roundingPercentage)}%`:t.numeric?n.toFixed(k.value.table.td.roundingValue):n}let gr=d(()=>Z.value.body.map((e,t)=>fr.map(n=>mr(t,n.group)?``:hr(e,n))));function _r(e=null){Be(()=>{let t=[[N.value.title.text],[N.value.title.subtitle.text],[``],[`Grand total`,B.value],[``]],n=Z.value.head,r=Z.value.body.map((e,t)=>fr.map(n=>mr(t,n.group)?``:e[n.key])),i=t.concat([n]).concat(r),a=ne(i);e?e(a):fe({csvContent:a,title:N.value.title.text||`vue-ui-chestnut`})})}let vr=y(!1);function yr(e){vr.value=e,gn.value+=1}function br(){I.value.showTable=!I.value.showTable}let xr=y(!1);function Sr(){xr.value=!xr.value}let Cr=Oe(hn,()=>N.value.title.text);function wr(e){let t=Zn(e),n=e.x1,r=e.y1,i=L.value.branchSize,a=t.x+t.r/2,o=t.y;return[`M ${n},${r}`,`C ${n-20},${r} ${n-20},${r} ${a},${o}`,`C ${a},${o} ${n-20},${r+i} ${n},${r+i}`,`Z`].join(` `)}let Tr=d(()=>new Map(U.value.map(e=>[e.id,wr(e)])));function Er(e){return Tr.value.get(e.id)}let Dr=d(()=>ee({config:k,style:P,mutableConfig:I,dialog:fn,accordion:cn,isFullscreen:vr,parent:hn,maxWidth:800,titleStyle:N,isCursorPointer:F}));qe(()=>I.value.showTable,async e=>{k.value.table.show||(e&&k.value.table.useDialog&&_n.value?(await Be(),_n.value.open()):_n.value&&`close`in _n.value&&_n.value.close())});let{isResponsive:Or}=Te(Pn,In);function kr(){I.value.showTable=!1,vn.value&&vn.value.setTableIconState(!1)}let Ar=d(()=>Gn.value.map((e,t)=>({...e,display:`${e.name}: ${l(A.value.labels.formatter,e.total,s({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),{datapoint:e})} (${s({v:z(e.total,B.value)*100,s:`%`,r:N.value.legend.roundingPercentage})})`}))),jr=d(()=>Ar.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),Mr=d(()=>P.value.backgroundColor),Nr=d(()=>({...N.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Pr=d(()=>N.value.title),{isCallbackImaging:Fr,isCallbackSvg:Ir,generateSvg:Lr,onGenerateImage:Rr}=we({svg:En,title:Pr,legend:Nr,legendItems:jr,backgroundColor:Mr,titleEmbedded:!0,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:jn});async function zr(){Bn(`copyAlt`,{config:k.value,dataset:V.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:V.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Br(e){if(!e)return``;let t=s({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),n=s({v:z(e.total,B.value)*100,s:`%`,r:N.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${n} of total.`}function Vr(e){if(!e)return``;let t=s({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),n=s({v:e.proportionToRoot*100,s:`%`,r:N.value.legend.roundingPercentage});return`Branch ${e.name}. Root ${e.rootName}. Value ${t}. ${n} of root ${e.rootName}.`}function Hr(e){if(!e)return``;let t=s({p:N.value.legend.prefix,v:e.value,s:N.value.legend.suffix,r:M.value.selected.roundingValue}),n=s({v:e.proportionToBranch*100,s:`%`,r:M.value.selected.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${n} of branch ${e.branchName}.`}let Ur=d(()=>H.value[O.value.rootIndex]||null),Q=d(()=>(Jn.value[O.value.rootIndex]||[])[O.value.branchIndex]||null),Wr=d(()=>((Yn.value[O.value.rootIndex]||[])[O.value.branchIndex]||[])[O.value.nutIndex]||null);function $(){O.value.level===`root`?D.value=Br(Ur.value):O.value.level===`branch`?D.value=Vr(Q.value):O.value.level===`nut`&&(D.value=Hr(Wr.value))}function Gr(){O.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0},D.value=``}function Kr(){let e=Jn.value[O.value.rootIndex]||[];e.length?(O.value.branchIndex>=e.length&&(O.value.branchIndex=0),O.value.branchIndex<0&&(O.value.branchIndex=e.length-1)):O.value.branchIndex=0}function qr(){let e=(Yn.value[O.value.rootIndex]||[])[O.value.branchIndex]||[];e.length?(O.value.nutIndex>=e.length&&(O.value.nutIndex=0),O.value.nutIndex<0&&(O.value.nutIndex=e.length-1)):O.value.nutIndex=0}function Jr(e){if(O.value.level===`root`){let t=H.value.length;if(!t)return;O.value.rootIndex+=e,O.value.rootIndex>=t&&(O.value.rootIndex=0),O.value.rootIndex<0&&(O.value.rootIndex=t-1),O.value.branchIndex=0,O.value.nutIndex=0,$()}else O.value.level===`branch`?(O.value.branchIndex+=e,Kr(),O.value.nutIndex=0,$()):O.value.level===`nut`&&(O.value.nutIndex+=e,qr(),$())}function Yr(e){if(e>0){if(O.value.level===`root`){if(!(Jn.value[O.value.rootIndex]||[]).length)return;O.value.level=`branch`,O.value.branchIndex=0,O.value.nutIndex=0,$();return}if(O.value.level===`branch`){if(!((Yn.value[O.value.rootIndex]||[])[O.value.branchIndex]||[]).length)return;O.value.level=`nut`,O.value.nutIndex=0,Q.value?or(Q.value):$();return}}else O.value.level===`nut`?(Y(),G.value=null,O.value.level=`branch`,O.value.nutIndex=0,$()):O.value.level===`branch`&&(G.value=null,K.value=null,O.value.level=`root`,O.value.nutIndex=0,$())}function Xr(){O.value.level===`root`&&Ur.value?(cr(Ur.value),D.value=`${Br(Ur.value)} selected.`):O.value.level===`branch`&&Q.value?(sr(Q.value),D.value=`${Vr(Q.value)} selected.`):O.value.level===`nut`&&Q.value&&Wr.value&&(or(Q.value),D.value=`${Hr(Wr.value)} details opened.`)}function Zr(){yn.value=!0,E.value=!1}function Qr(){yn.value=!1,E.value=!1,D.value=``,K.value||G.value||W.value||Gr()}function $r(e){let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;(t||n||r||i||a||o)&&(e.preventDefault(),e.stopPropagation(),yn.value||=!0,o?(nr(),Gr(),E.value=!1):((t||n||r||i)&&(E.value=!0),t?Jr(-1):n?Jr(1):r?Yr(-1):i?Yr(1):a&&Xr()))}qe([H,U],([e,t],[n,r])=>{er+=1;let i=O.value,a=n[i.rootIndex],o=r.filter(e=>e.rootIndex===a?.rootIndex)[i.branchIndex],ee=o?.breakdown[i.nutIndex],te=(e,t)=>t?e.find(e=>e.id===t.id)??null:null;K.value=te(e,K.value),G.value=te(t,G.value),W.value=te(t,W.value);let s=e.findIndex(e=>e.id===a?.id);i.rootIndex=Math.max(0,s);let ne=Jn.value[i.rootIndex]||[];i.branchIndex=Math.max(0,ne.findIndex(e=>e.id===o?.id));let re=ne[i.branchIndex]?.breakdown||[];i.nutIndex=Math.max(0,re.findIndex(e=>e.id===ee?.id)),E.value&&$()}),He(()=>{tr=!0,er+=1});let ei=d(()=>({headers:Z.value.head,rows:Z.value.body.map(e=>fr.map(t=>t.percentage?s({v:e[t.key]*100,s:`%`,r:k.value.table.td.roundingPercentage}):e[t.key]))}));return Ne({getData:zn,getImage:Cr,generatePdf:An,generateCsv:_r,generateImage:jn,generateSvg:Lr,toggleTable:br,toggleAnnotator:Sr,toggleFullscreen:yr,copyAlt:zr}),(e,ee)=>(v(),p(`div`,{class:g(`vue-data-ui-component vue-ui-chestnut ${vr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:hn,id:`vue-ui-chestnut_${T.value}`,style:_(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:ee[1]||=()=>C(wn)(!0),onMouseleave:ee[2]||=()=>C(wn)(!1)},[m(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[m(`p`,null,S(k.value.a11y.translations.keyboardNavigation),1)],8,Qe),m(`div`,$e,S(D.value),1),k.value.a11y.includeTable&&ei.value?.rows?.length?(v(),Pe(je,{key:0,uid:T.value,head:ei.value.headers,body:ei.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),k.value.userOptions.buttons.annotator?(v(),Pe(C(ln),ze({key:1},C(a)(k.value.userOptions.annotator),{svgRef:C(En),backgroundColor:P.value.backgroundColor,color:P.value.color,active:xr.value,isCursorPointer:F.value,palette:k.value.userOptions.annotatorPalette,onClose:Sr}),Fe({_:2},[b(C(o),t=>({name:t,fn:Je(n=>[x(e.$slots,t,Ve(Re(C(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),Mn.value?(v(),p(`div`,et,null,512)):f(``,!0),k.value.userOptions.show&&mn.value&&(C(Tn)||C(Cn))?(v(),Pe(C(un),ze({ref_key:`userOptionsRef`,ref:vn,key:`user_options_${gn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:C(kn),isPrinting:C(On),uid:T.value,isFullscreen:vr.value,chartElement:hn.value},C(n)(k.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:xr.value,tableDialog:k.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:yr,onGeneratePdf:C(An),onGenerateCsv:_r,onGenerateImage:C(Rr),onGenerateSvg:C(Lr),onToggleTable:br,onToggleAnnotator:Sr,onCopyAlt:zr,style:{visibility:C(Tn)?C(Cn)?`visible`:`hidden`:`visible`}}),Fe({_:2},[b(C(t)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Je(n=>[x(e.$slots,t,Ve(Re(C(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),m(`div`,tt,[L.value.height>0?(v(),p(`svg`,{key:0,ref_key:`svgRef`,ref:En,xmlns:C(he),"aria-describedby":`chart-instructions-${T.value}`,class:g({"vue-data-ui-fullscreen--on":vr.value,"vue-data-ui-fulscreen--off":!vr.value}),viewBox:`0 0 ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.value.height}`,style:_(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:Zr,onBlur:Qr,onKeydown:$r},[h(C(dn)),x(e.$slots,`svg-underlayer`,{svg:{...L.value,isPrintingImg:C(On)||C(kn)||C(Fr),isPrintingSvg:C(Ir)}},void 0,!0),e.$slots[`chart-background`]?(v(),p(`foreignObject`,{key:0,x:0,y:0,width:L.value.width<=0?10:L.value.width,height:L.value.height<=0?10:L.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,rt)):f(``,!0),W.value?f(``,!0):(v(),p(`g`,it,[N.value.title.text?(v(),p(`text`,{key:0,"text-anchor":`middle`,fill:N.value.title.color,"font-weight":N.value.title.bold?`bold`:`normal`,"font-size":N.value.title.fontSize,x:L.value.width/2,y:12+N.value.title.fontSize+N.value.title.offsetY,onClick:q},S(N.value.title.text),9,at)):f(``,!0),N.value.title.subtitle.text?(v(),p(`text`,{key:1,"text-anchor":`middle`,fill:N.value.title.subtitle.color,"font-weight":N.value.title.subtitle.bold?`bold`:`normal`,"font-size":N.value.title.subtitle.fontSize,x:L.value.width/2,y:48+N.value.title.subtitle.fontSize+N.value.title.subtitle.offsetY,onClick:q},S(N.value.title.subtitle.text),9,ot)):f(``,!0)])),m(`defs`,null,[(v(!0),p(u,null,b(V.value,(e,t)=>(v(),Pe(Me,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${T.value}_${e.rootIndex}`,key:`root_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,C(c)(C(se)(e.color,.05),100-A.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(v(!0),p(u,null,b(V.value,e=>(v(),Pe(Me,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${T.value}_${e.rootIndex}`,key:`branch_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,C(c)(C(se)(e.color,.02),100-j.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),h(Me,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${T.value}`,stops:[[`0%`,C(c)(`#FFFFFF`,0),0],[`80%`,C(c)(`#FFFFFF`,M.value.selected.gradientIntensity),1],[`100%`,C(c)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(Me,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${T.value}`,stops:[[`0%`,C(c)(`#FFFFFF`,0),0],[`80%`,C(c)(`#FFFFFF`,M.value.gradientIntensity),1],[`100%`,C(c)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(Me,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${T.value}`,stops:[[`0%`,C(c)(P.value.backgroundColor,100),1],[`80%`,C(c)(P.value.backgroundColor,60),1],[`100%`,C(c)(P.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),N.value.grandTotal.show?(v(),p(`g`,st,[m(`text`,{x:R.value.seedX,y:32+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:q},S(N.value.grandTotal.text),9,ct),m(`text`,{x:R.value.seedX,y:38+N.value.grandTotal.fontSize+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:q},S(C(l)(N.value.grandTotal.formatter,B.value,C(s)({p:N.value.grandTotal.prefix,v:B.value,s:N.value.grandTotal.suffix,r:N.value.grandTotal.roundingValue}))),9,lt)])):f(``,!0),(v(!0),p(u,null,b(U.value,e=>(v(),p(`g`,null,[m(`defs`,null,[h(Me,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,C(c)(e.color,N.value.links.opacity),1]]},null,8,[`id`,`stops`])]),m(`path`,{d:Er(e),stroke:C(c)(e.color,N.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:_(`opacity:${+!!J(e)}`),onClick:q},null,12,ut)]))),256)),(v(!0),p(u,null,b(H.value,e=>(v(),p(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:A.value.underlayerColor,stroke:`none`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${J(e)?1:.05}`)},null,12,dt))),256)),(v(!0),p(u,null,b(H.value,(e,t)=>(v(),p(`circle`,{"aria-label":Br(e),cx:e.x,cy:e.y,r:e.r,fill:A.value.useGradient?`url(#root_gradient_${T.value}_${e.rootIndex})`:e.color,stroke:A.value.stroke,"stroke-width":A.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${J(e)?1:.05}`),onClick:t=>cr(e)},null,12,ft))),256)),A.value.labels.show?(v(),p(`g`,pt,[(v(!0),p(u,null,b(H.value,(e,t)=>(v(),p(`text`,{x:e.x,y:e.y+A.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":A.value.labels.fontSize,fill:A.value.labels.adaptColorToBackground?C(me)(e.color):A.value.labels.color,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${J(e)?1:.05}`),onClick:t=>cr(e)},S(C(l)(A.value.labels.formatter,e.total,C(s)({p:A.value.labels.prefix,v:e.total,s:A.value.labels.suffix,r:A.value.labels.roundingValue}),{datapoint:e})),13,mt))),256)),(v(!0),p(u,null,b(H.value,e=>(v(),p(`g`,null,[W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex||K.value&&e.rootIndex===K.value.rootIndex?(v(),p(`g`,ht,[m(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:A.value.labels.name.color,"font-size":A.value.labels.name.fontSize,"font-weight":A.value.labels.name.bold?`bold`:`normal`,onClick:q},S(e.name),9,gt)])):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(u,null,b(U.value,e=>(v(),p(`rect`,{x:e.x1,y:e.y1,height:L.value.branchSize,width:e.x2-e.x1,fill:j.value.underlayerColor,rx:j.value.borderRadius,stroke:`none`,style:_(`opacity:${J(e)?1:.05}`),onClick:t=>sr(e)},null,12,_t))),256)),(v(!0),p(u,null,b(U.value,(e,t)=>(v(),p(`rect`,{"aria-label":Vr(e),x:e.x1,y:e.y1,height:L.value.branchSize,width:e.x2-e.x1,fill:j.value.useGradient?`url(#branch_gradient_${T.value}_${e.rootIndex})`:e.color,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${J(e)?1:.05}`),onClick:t=>sr(e)},null,12,vt))),256)),j.value.labels.dataLabels.show?(v(),p(`g`,yt,[(v(!0),p(u,null,b(U.value,e=>(v(),p(`g`,null,[e.proportionToRoot*100>j.value.labels.dataLabels.hideUnderValue?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+L.value.branchSize/1.5,"text-anchor":`start`,fill:C(me)(e.color),"font-size":j.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${J(e)?1:.05}`),onClick:t=>sr(e)},S(C(l)(j.value.labels.dataLabels.formatter,e.value,C(s)({p:N.value.branches.labels.dataLabels.prefix,v:e.value,s:N.value.branches.labels.dataLabels.suffix,r:N.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,bt)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(u,null,b(U.value,(e,t)=>(v(),p(`g`,null,[(v(!0),p(u,null,b(Qn.value.get(e.id),(t,n)=>(v(),p(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:_(`opacity:${J(e)?1:.1}`)},null,12,xt))),256)),m(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:M.value.useGradient?`url(#nut_${T.value})`:`transparent`,cx:e.x2+24+M.value.offsetX,cy:e.y1+L.value.branchSize/2,r:L.value.branchSize/2+2,onClick:t=>or(e),style:_(`cursor:${F.value?`pointer`:`default`};opacity:${J(e)?1:.1}`)},null,12,St)]))),256)),j.value.labels.show&&!G.value?(v(),p(`g`,Ct,[(v(!0),p(u,null,b(U.value,e=>(v(),p(`text`,{x:e.x2+L.value.branchSize+24+M.value.offsetX,y:e.y1+L.value.branchSize/2+5,"font-size":j.value.labels.fontSize,"font-weight":j.value.labels.bold?`bold`:`normal`,fill:j.value.labels.color,"text-anchor":`start`,style:_(`opacity:${J(e)?1:.1}`)},S(e.name),13,wt))),256))])):f(``,!0),m(`line`,{x1:256+L.value.padding.left,x2:256+L.value.padding.left,y1:R.value.top,y2:R.value.bottom,stroke:N.value.verticalSeparator.stroke,"stroke-width":N.value.verticalSeparator.strokeWidth},null,8,Tt),!W.value&&!G.value?(v(),p(`foreignObject`,{key:6,x:0,y:R.value.bottom,height:L.value.height-R.value.bottom,width:L.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:q},[m(`div`,Dt,[m(`div`,Ot,[(v(!0),p(u,null,b(H.value,e=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,kt,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,At)])),C(xn)?f(``,!0):(v(),p(u,{key:0},[m(`span`,null,S(e.name)+`:`,1),m(`b`,null,S(C(l)(N.value.roots.labels.formatter,e.total,C(s)({p:P.value.layout.legend.prefix,v:e.total,s:P.value.layout.legend.suffix,r:P.value.layout.legend.roundingValue}),{datapoint:e})),1),Ie(` (`+S(C(s)({v:z(e.total,B.value)*100,s:`%`,r:N.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,Et)):f(``,!0),W.value&&$n.value?(v(),p(`g`,jt,[(v(),p(`foreignObject`,{x:0,y:lr(),height:L.value.height-R.value.bottom,width:L.value.width,style:{overflow:`visible`},onClick:q},[m(`div`,Nt,[m(`b`,null,S(W.value.name),1),m(`div`,Pt,[(v(!0),p(u,null,b(W.value.breakdown,(e,t)=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Ft,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,It)])),m(`span`,null,[Ie(S(e.name)+`: `,1),m(`b`,null,S(N.value.legend.prefix)+` `+S(e.value.toFixed(P.value.layout.nuts.selected.roundingValue))+` `+S(N.value.legend.suffix),1),Ie(` (`+S((e.proportionToBranch*100).toFixed(N.value.nuts.selected.roundingPercentage))+`%)`,1)])],4))),256))])])],8,Mt)),m(`circle`,{cx:W.value.x2+24+M.value.offsetX,cy:W.value.y1+L.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${T.value})`,onClick:Y,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt),(v(!0),p(u,null,b($n.value,e=>(v(),p(`g`,null,[ur(e)?(v(),p(`path`,{key:0,d:C(ue)(e,{x:W.value.x2+24+M.value.offsetX,y:W.value.y1+L.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt)):f(``,!0)]))),256)),m(`circle`,{cx:W.value.x2+24+M.value.offsetX,cy:W.value.y1+L.value.branchSize/2,r:118,fill:P.value.backgroundColor,onClick:Y,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt),(v(!0),p(u,null,b($n.value,e=>(v(),p(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:Y,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Bt))),256)),m(`circle`,{cx:W.value.x2+24+M.value.offsetX,cy:W.value.y1+L.value.branchSize/2,r:110,fill:`url(#nutpick_${T.value})`,onClick:Y,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Vt),m(`circle`,{cx:W.value.x2+24+M.value.offsetX,cy:W.value.y1+L.value.branchSize/2,r:64,fill:P.value.backgroundColor,onClick:Y,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Ht),m(`text`,{x:W.value.x2+24+M.value.offsetX,y:W.value.y1+8,fill:M.value.selected.labels.core.total.color,"font-size":M.value.selected.labels.core.total.fontSize,"font-weight":M.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:Y,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(k.value.translations.total),11,Ut),m(`text`,{x:W.value.x2+24+M.value.offsetX,y:W.value.y1+36,fill:M.value.selected.labels.core.value.color,"font-size":M.value.selected.labels.core.value.fontSize,"font-weight":M.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:Y,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(l)(M.value.selected.labels.dataLabels.formatter,W.value.value,C(s)({p:M.value.selected.labels.core.value.prefix,v:W.value.value,s:M.value.selected.labels.core.value.suffix,r:M.value.selected.roundingValue}),{datapoint:W.value})),11,Wt),(v(!0),p(u,null,b($n.value,(e,t)=>(v(),p(`g`,null,[ur(e)?(v(),p(`text`,{key:0,x:X.value.get(e).normal.x,"text-anchor":X.value.get(e).normal.anchor,y:X.value.get(e).y-M.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":M.value.selected.labels.dataLabels.fontSize/2,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Gt)):f(``,!0),ur(e)?(v(),p(`text`,{key:1,x:X.value.get(e).selected.x,"text-anchor":X.value.get(e).selected.anchor,y:X.value.get(e).y,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(W.value.breakdown[t].name),15,Kt)):f(``,!0)]))),256)),(v(!0),p(u,null,b($n.value,(e,t)=>(v(),p(`g`,null,[ur(e)?(v(),p(`text`,{key:0,x:X.value.get(e).selected.x,"text-anchor":X.value.get(e).normal.anchor,y:X.value.get(e).y+M.value.selected.labels.dataLabels.fontSize,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(s)({v:z(W.value.breakdown[t].value,W.value.value)*100,s:`%`,r:M.value.selected.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(W.value.breakdown[t].branchName)+` `+S(C(l)(M.value.selected.labels.dataLabels.formatter,W.value.breakdown[t].value,C(s)({p:M.value.selected.labels.dataLabels.prefix,v:W.value.breakdown[t].value,s:M.value.selected.labels.dataLabels.suffix,r:M.value.selected.roundingValue}),{datapoint:$n.value,seriesIndex:t})),15,qt)):f(``,!0),ur(e)?(v(),p(`text`,{key:1,x:X.value.get(e).selected.x,"text-anchor":X.value.get(e).normal.anchor,y:X.value.get(e).y+M.value.selected.labels.dataLabels.fontSize*2,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(s)({v:W.value.breakdown[t].proportionToRoot*100,s:`%`,r:M.value.selected.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(W.value.breakdown[t].rootName),15,Jt)):f(``,!0),ur(e)?(v(),p(`text`,{key:2,x:X.value.get(e).selected.x,"text-anchor":X.value.get(e).normal.anchor,y:X.value.get(e).y+M.value.selected.labels.dataLabels.fontSize*3,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(s)({v:W.value.breakdown[t].proportionToTree*100,s:`%`,r:M.value.selected.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),15,Yt)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(u,null,b(U.value,e=>(v(),p(`g`,null,[G.value&&G.value.id===e.id&&!W.value?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+L.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:q},S(e.name)+`: `+S(C(l)(j.value.labels.dataLabels.formatter,e.value,C(s)({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,Xt)):f(``,!0),G.value&&G.value.id===e.id&&!W.value?(v(),p(`text`,{key:1,x:e.x1+6,y:e.y1+L.value.branchSize+48,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:q},S(C(s)({v:e.proportionToRoot*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(e.rootName),9,Zt)):f(``,!0),G.value&&G.value.id===e.id&&!W.value?(v(),p(`text`,{key:2,x:e.x1+6,y:e.y1+L.value.branchSize+72,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:q},S(C(s)({v:z(e.value,B.value)*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),9,Qt)):f(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...L.value,isPrintingImg:C(On)||C(kn)||C(Fr),isPrintingSvg:C(Ir)}},void 0,!0)],46,nt)):f(``,!0)]),e.$slots.watermark?(v(),p(`div`,$t,[x(e.$slots,`watermark`,Ve(Re({isPrinting:C(On)||C(kn)||C(Fr)||C(Ir)})),void 0,!0)])):f(``,!0),x(e.$slots,`legend`,{legend:V.value},void 0,!0),e.$slots.source?(v(),p(`div`,en,[x(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),mn.value&&k.value.userOptions.buttons.table?(v(),Pe(We(Dr.value.component),ze({key:6},Dr.value.props,{ref_key:`tableUnit`,ref:_n,onClose:kr}),Fe({content:Je(()=>[m(`div`,{ref_key:`tableContainer`,ref:Pn,class:`vue-ui-chestnut-table`,style:_(`${k.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[m(`div`,{style:_(`${k.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[k.value.table.useDialog?f(``,!0):(v(),p(`div`,{key:0,role:`button`,tabindex:`0`,style:_(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${F.value?`pointer`:`default`}; background:${k.value.table.th.backgroundColor};`),onClick:kr,onKeypress:Ye(kr,[`enter`])},[h(C(sn),{name:`close`,stroke:k.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),m(`div`,{style:{width:`100%`},class:g({"vue-ui-responsive":C(Or)})},[m(`table`,tn,[k.value.table.useDialog?f(``,!0):(v(),p(`caption`,{key:0,style:_({backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Ie(S(N.value.title.text)+` `,1),N.value.title.subtitle.text?(v(),p(`span`,nn,S(N.value.title.subtitle.text),1)):f(``,!0)],4)),m(`thead`,null,[m(`tr`,{role:`row`,style:_(`background:${k.value.table.th.backgroundColor};color:${k.value.table.th.color}`)},[(v(!0),p(u,null,b(Z.value.head,e=>(v(),p(`th`,{style:_(`outline:${k.value.table.th.outline}`)},S(e),5))),256))],4)]),m(`tbody`,null,[(v(!0),p(u,null,b(Z.value.body,(e,t)=>(v(),p(`tr`,{class:g({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:_(`background:${k.value.table.td.backgroundColor};color:${k.value.table.td.color}`)},[(v(),p(u,null,b(fr,(e,n)=>m(`td`,{key:e.key,class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Z.value.head[n]},[m(`div`,an,[e.group?(v(),p(`span`,on,S(gr.value[t][n]),1)):(v(),p(u,{key:1},[Ie(S(gr.value[t][n]),1)],64))])],12,rn)),64))],6))),256))])])],2)],4)],4)]),_:2},[k.value.table.useDialog?{name:`title`,fn:Je(()=>[Ie(S(Dr.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:Je(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:ee[0]||=e=>_r(k.value.userOptions.callbacks.csv)},[h(C(sn),{name:`fileCsv`,stroke:Dr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):f(``,!0),x(e.$slots,`skeleton`,{},()=>[C(xn)?(v(),Pe(Ae,{key:0})):f(``,!0)],!0)],46,Ze))}},[[`__scopeId`,`data-v-5ac0ed98`]]);export{Xe as n,sn as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
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 ee}from"./chartImage-DPGnEuYM.js";import{n as te}from"./resolveChartConfig-0IvbmIE_.js";import{$ as l,D as ne,Ht as re,S as ie,X as ae,Y as oe,at as se,i as ce,in as le,nt as ue,r as de,sn as fe,t as pe,w as me}from"./lib-rPeBMZrn.js";import{n as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./useConfig-9oDGTWWG.js";import{t as _e}from"./useLoading-BwiplGDB.js";import{t as ve}from"./usePrinter-DVf3YcG5.js";import{t as ye}from"./useResponsive-CENUxfEL.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{t as xe}from"./useUserOptionState-CXlFnwPv.js";import{t as Se}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ce}from"./Shape-CRe8woTu.js";import{n as we}from"./Title-BliHuXfT.js";import{t as Te}from"./vue_ui_chord-Crjq1pgV.js";import{t as Ee}from"./Legend-W9YVYVX-.js";import{t as De}from"./BaseScanner-m6QR9rwD.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as u,Teleport as Ae,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as je,createTextVNode as Me,createVNode as Ne,defineAsyncComponent as g,guardReactiveProps as Pe,mergeProps as Fe,nextTick as Ie,normalizeClass as _,normalizeProps as Le,normalizeStyle as v,onBeforeUnmount as Re,onMounted as ze,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Be,shallowRef as Ve,toDisplayString as C,toRefs as He,unref as w,watch as T,withCtx as E,withModifiers as Ue}from"vue";var We=/* @__PURE__ */ e({default:()=>St}),Ge=[`id`],Ke=[`id`],qe=[`id`],Je=[`xmlns`,`viewBox`,`aria-describedby`],Ye=[`width`,`height`],Xe={key:1},Ze=[`id`,`d`],Qe={key:2},$e=[`transform`],et=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],tt=[`d`,`fill`,`stroke`,`stroke-width`],nt=[`d`,`fill`],rt=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onClick`,`onMouseleave`],it=[`d`,`fill`,`stroke`,`stroke-width`],at=[`d`,`fill`,`stroke`,`stroke-width`],ot=[`d`,`fill`,`stroke`,`stroke-width`],st={key:0},ct=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],lt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ut=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`fill`],dt=[`transform`,`fill`,`text-anchor`,`font-size`,`font-weight`],ft={key:1},pt=[`font-size`,`font-weight`,`fill`],mt=[`href`],ht=[`transform`,`text-anchor`,`font-size`,`font-weight`,`fill`,`innerHTML`],gt={key:5,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_t={key:6,class:`vue-data-ui-watermark`},vt=[`id`],yt=[`onClick`],bt={key:9,"data-dom-to-png-ignore":``,class:`reset-wrapper`},xt={style:{"text-align":`right`,width:`100%`}},St=/*#__PURE__*/ ke({__name:`vue-ui-chord`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`selectLegend`,`selectGroup`,`selectRibbon`,`copyAlt`],setup(e,{expose:ke,emit:We}){let St=g(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),Ct=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),wt=g(()=>import(`./DataTable-KeuZB1JM.js`)),Tt=g(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),Et=g(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Dt=g(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ot=g(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_chord:kt}=ge(),D=e,At=We;function jt(e){let t=e?.matrix;return Array.isArray(t)&&t.length>=2&&t.every(e=>Array.isArray(e)&&e.length===t.length)}let Mt=d(()=>jt(D.dataset)),O=b(ae()),k=b(null),A=b(null),j=d(()=>Y.value.groups.find(e=>e.id===k.value)??null),M=d(()=>vr.value.find(e=>e.id===A.value)??null),N=b(null),Nt=b(0),P=b(null),Pt=b(null),Ft=b(null),It=b(null),Lt=b(null),Rt=b(0),zt=b(0),Bt=b(0),Vt=b(!1),Ht=Ve(null),Ut=null,F=null,Wt=!1,Gt=b(!1),Kt=b(null),qt=b(null),I=b(`group`),L=b(null),R=d(()=>{if(L.value==null)return null;let e=(I.value===`group`?$.value.groups:$.value.ribbons).findIndex(e=>e.item.id===L.value);return e<0?null:e}),Jt=b(!1),z=b(sn()),B=d(()=>z.value.style.chart.arcs),V=d(()=>z.value.style.chart.ribbons),H=d(()=>z.value.style.chart);he({config:()=>z.value,dataset:()=>D.dataset,component:`VueUiChord`,rules:[{test:e=>e.matrix&&e.matrix.length>12,message:[`👀 The number of groups > 12, the chart might become hard to read. Consider:`,``,`▶️ Using broader groups to reduce their number.`]}]});let U=d(()=>z.value.userOptions.useCursorPointer),Yt=d(()=>le({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},arcs:{stroke:`#6A6A6A`,labels:{show:!1}},ribbons:{stroke:`#6A6A6A`,underlayerOpacity:0,labels:{show:!1}}}}},userConfig:z.value.skeletonConfig??{}})),{loading:Xt,FINAL_DATASET:Zt,manualLoading:Qt}=_e({...He(D),FINAL_CONFIG:z,prepareConfig:sn,skeletonDataset:D.config?.skeletonDataset??{matrix:[[12e3,6e3,9e3,3e3],[2e3,1e4,2e3,6001],[8e3,1600,8e3,8001],[1e3,1e3,1e3,7001]],labels:[],colors:[`#DBDBDB`,`#C4C4C4`,`#ADADAD`,`#969696`]},skeletonConfig:le({defaultConfig:z.value,userConfig:Yt.value})}),{userOptionsVisible:$t,setUserOptionsVisibility:en,keepUserOptionState:tn}=xe({config:z.value}),{svgRef:W}=Se({config:H.value.title}),{isPrinting:nn,isImaging:rn,generatePdf:an,generateImage:on}=ve({elementId:`chord_${O.value}`,fileName:H.value.title.text||`vue-ui-chord`,options:z.value.userOptions.print}),G=b({showTable:z.value.table.show});function sn(){return te(D.config,kt,Te)}T(()=>D.config,e=>{Xt.value||(z.value=sn()),$t.value=!z.value.userOptions.showOnChartHover,Rt.value+=1,zt.value+=1,Bt.value+=1,G.value.showTable=z.value.table.show},{deep:!0});let cn=d(()=>z.value.debug);function ln(){Qt.value=!Mt.value,!Mt.value&&cn.value&&se({componentName:`VueUiChord`,type:`dataset`,debug:!0})}function un(){Ut=null,Ht.value?.disconnect(),Ht.value=null,F!==null&&cancelAnimationFrame(F),F=null}function dn(){P.value&&(P.value.style.width=`100%`,P.value.style.height=``),W.value&&(W.value.style.height=``)}function fn(){un(),dn();let e=P.value?.parentNode;if(!z.value.responsive||!e)return;let t=()=>{F!==null&&cancelAnimationFrame(F),F=requestAnimationFrame(()=>{if(F=null,Wt||!P.value||!W.value)return;let{width:e,height:t,heightTitle:n,heightLegend:r,heightSource:i,heightNoTitle:a}=ye({chart:P.value,title:H.value.title.text?Pt.value:null,legend:H.value.legend.show?Ft.value:null,source:It.value,noTitle:Lt.value});dn(),e>=t&&(P.value.style.height=`100%`,W.value.style.height=`calc(100% - ${n+r+i+a}px)`)})};Ut=t,Ht.value=new ResizeObserver(t),Ht.value.observe(e),t()}let pn=null;ze(()=>{Gt.value=!0,fn(),pn=setTimeout(()=>{Wt||(Vt.value=!0)},500)});let K=b({height:600,width:600}),mn=d(()=>z.value.userOptions.show&&!H.value.title.text),hn=d(()=>me(z.value.customPalette)),q=d(()=>({inner:K.value.width*.3*B.value.innerRadiusRatio,outer:K.value.width*.34*B.value.outerRadiusRatio})),gn=d(()=>B.value.padAngle/100),J=d(()=>{let e=Zt.value,t=jt(e)?e.matrix.map(e=>e.map(e=>typeof e==`number`&&Number.isFinite(e)?Math.max(0,e):0)):[];return{matrix:t,labels:t.map((t,n)=>e.labels?.[n]??String(n)),colors:t.map((t,n)=>ie(e.colors?.[n])||hn.value[n]||re[n%re.length])}});function _n(e,t){let n=e.length,r=q.value.inner,i=Array(n).fill(0),a=0;for(let t=0;t<n;t+=1)for(let r=0;r<n;r+=1)i[t]+=e[t][r],a+=e[t][r];t=n?Math.min(2*Math.PI/n,Math.max(0,Number(t)||0)):0;let o=a>0?(2*Math.PI-t*n)/a:0,s=[],c=0;for(let e=0;e<n;e+=1){let n=c,r=n+i[e]*o;s.push({index:e,pattern:`pattern_${O.value}_${e}`,startAngle:n,endAngle:r,name:J.value.labels[e],id:`chord_group_${O.value}_${e}`,color:J.value.colors[e],proportion:a?i[e]/a:0}),c=r+t}let ee=[],te=Array.from({length:n},()=>[]);for(let t=0;t<n;t+=1){let n=e[t].map((e,t)=>({j:t,v:e}));n.sort((e,t)=>t.v-e.v);let i=s[t].startAngle;for(let{j:e,v:a}of n){let n=i,c=n+a*o,l={index:t,subIndex:e,pattern:`pattern_${O.value}_${t}`,startAngle:n,endAngle:c,value:a,groupName:J.value.labels[t],groupId:s[t].id,groupColor:J.value.colors[t],midAngle:(n+c)/2,midBaseX:Math.cos((n+c)/2-Math.PI/2)*r,midBaseY:Math.sin((n+c)/2-Math.PI/2)*r};ee.push(l),te[t][e]=l,i=c}}let l=[];for(let e of ee){let t=te[e.subIndex][e.index];l.push({source:e,target:t,id:`chord_ribbon_${O.value}_${e.index}_${e.subIndex}`})}return{groups:s,chords:l}}let Y=d(()=>{let e=_n(J.value.matrix,gn.value);return e.chords.sort((e,t)=>Math.max(t.source.value,t.target.value)-Math.max(e.source.value,e.target.value)),e}),vn=d(()=>{let e=q.value.outer+V.value.labels.offset+12,t=V.value.labels.fontSize*.6,n=N.value??j.value?.id;return(M.value?[M.value]:n?Y.value.chords.filter(e=>e.source.groupId===n&&e.source.value):[]).flatMap(n=>{let r=[];return n.source.value&&r.push([`src`,n.source]),n.target?.value&&n.target.value!==n.source.value&&r.push([`tgt`,n.target]),r.map(([r,i])=>({id:`${n.id}-${r}`,theta:i.midAngle,w:String(i.value).length*t/e,midBaseX:i.midBaseX,midBaseY:i.midBaseY,groupColor:i.groupColor,value:i.value}))})}),yn=d(()=>{let e=vn.value.map(e=>({...e})).sort((e,t)=>e.theta-t.theta);if(!e.length)return e;let t=V.value.labels.minSeparationDeg*Math.PI/180,n=!0,r=0;for(;n&&r++<10;){n=!1;for(let r=1;r<e.length;r+=1){let i=e[r-1],a=e[r],o=i.theta+i.w+t;a.theta<o&&(a.theta=o,n=!0)}let r=e[0],i=e[e.length-1],a=i.theta+i.w+t-2*Math.PI;r.theta<a&&(r.theta=a,n=!0)}return e});function bn(e,t,n,r){let i=e-Math.PI/2,a=t-Math.PI/2,o=Math.cos(i)*n,s=Math.sin(i)*n,c=Math.cos(a)*n,ee=Math.sin(a)*n,te=Math.cos(a)*r,l=Math.sin(a)*r,ne=Math.cos(i)*r,re=Math.sin(i)*r,ie=+(t-e>Math.PI);return`M${o},${s} A${n},${n} 0 ${ie} 1 ${c},${ee} L${te},${l} A${r},${r} 0 ${ie} 0 ${ne},${re} Z`}function xn(e,t){let n=q.value.inner,r=e.startAngle-Math.PI/2,i=e.endAngle-Math.PI/2,a=t.startAngle-Math.PI/2,o=t.endAngle-Math.PI/2,s=Math.cos(r)*n,c=Math.sin(r)*n,ee=Math.cos(i)*n,te=Math.sin(i)*n,l=Math.cos(a)*n,ne=Math.sin(a)*n,re=Math.cos(o)*n,ie=Math.sin(o)*n;return`M${s},${c}A${n},${n} 0 ${+(e.endAngle-e.startAngle>Math.PI)} 1 ${ee},${te}Q0,0 ${l},${ne}A${n},${n} 0 ${+(t.endAngle-t.startAngle>Math.PI)} 1 ${re},${ie}Q0,0 ${s},${c}Z`}let Sn=d(()=>X.value*Math.PI/180);function Cn(e){return(e.startAngle+e.endAngle)/2}function wn(e){return((Cn(e)+Sn.value)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}function Tn(e){let t=e+Sn.value;return t=(t%(2*Math.PI)+2*Math.PI)%(2*Math.PI),t>Math.PI?`end`:`start`}function En(e){let t=e-Math.PI/2;return`translate(${Math.cos(t)*(q.value.outer+B.value.labels.offset+24)},${Math.sin(t)*(q.value.outer+B.value.labels.offset+24)})`}function Dn(e,t,n){let r=e-Math.PI/2,i=t-Math.PI/2,a=Math.cos(r)*n,o=Math.sin(r)*n,s=Math.cos(i)*n,c=Math.sin(i)*n;return`M${a},${o} A${n},${n} 0 ${+(t-e>Math.PI)} 1 ${s},${c}`}let X=b(z.value.initialRotation),On=b(!1),kn=0,An=0;function jn(e){let t=W.value.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i=e.clientX??e.touches[0].clientX,a=e.clientY??e.touches[0].clientY;return Math.atan2(a-r,i-n)}function Mn(e){z.value.enableRotation&&!Gn.value&&(Zn(),e.preventDefault(),On.value=!0,kn=X.value,An=jn(e))}function Nn(e){if(!On.value||!z.value.enableRotation||Gn.value)return;let t=jn(e);X.value=kn+(t-An)*180/Math.PI}function Z(){On.value=!1}function Pn(e){return ce(V.value.labels.formatter,e,l({p:V.value.labels.prefix,v:e,s:V.value.labels.suffix,r:V.value.labels.rounding}))}ze(()=>{window.addEventListener(`mousemove`,Nn),window.addEventListener(`mouseup`,Z),window.addEventListener(`touchmove`,Nn,{passive:!1}),window.addEventListener(`touchend`,Z),window.addEventListener(`touchcancel`,Z)}),Re(()=>{window.removeEventListener(`mousemove`,Nn),window.removeEventListener(`mouseup`,Z),window.removeEventListener(`touchmove`,Nn),window.removeEventListener(`touchend`,Z),window.removeEventListener(`touchcancel`,Z),Wt=!0,clearTimeout(pn),un(),Zn()});let Fn=b(!1);function In(e){Fn.value=e,Nt.value+=1}function Ln(e,t){z.value.events.datapointEnter&&z.value.events.datapointEnter({datapoint:e,seriesIndex:t}),N.value||(k.value=e.id,A.value=null)}function Rn(e,t){k.value=null,z.value.events.datapointLeave&&z.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function zn(e,t){At(`selectGroup`,e),z.value.events.datapointClick&&z.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Bn(e,t){z.value.events.datapointEnter&&z.value.events.datapointEnter({datapoint:e,seriesIndex:t}),N.value||(A.value=e.id)}function Vn(e,t){A.value=null,z.value.events.datapointLeave&&z.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Hn(e,t){At(`selectRibbon`,e),z.value.events.datapointClick&&z.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Un(e){return!N.value&&!j.value&&!M.value?.8:(N.value?N.value===e.source.groupId:j.value?j.value.id===e.source.groupId:M.value?.id===e.id)?1:.1}function Wn(e){return!N.value&&!j.value&&!M.value||(N.value?N.value===e.id:j.value?j.value.id===e.id:[M.value?.source.groupId,M.value?.target.groupId].includes(e.id))?1:.3}let Gn=b(!1);function Kn(){Gn.value=!Gn.value}function qn(){G.value.showTable=!G.value.showTable}function Jn(){return Y.value}let Yn=b(null),Xn=0;function Zn(){Xn++,Yn.value!=null&&cancelAnimationFrame(Yn.value),Yn.value=null}function Qn(){let e=z.value.initialRotation;Zn();let t=Xn,n=()=>{Wt||t!==Xn||(X.value+=(e-X.value)*.05,Math.abs(X.value-e)<.1?(X.value=e,Yn.value=null):Yn.value=requestAnimationFrame(n))};Yn.value=requestAnimationFrame(n)}function $n(e){Cr(),e===N.value?(N.value=null,At(`selectLegend`,null)):(N.value=e,At(`selectLegend`,Y.value.groups.find(t=>t.id===e)))}let er=d(()=>Y.value.groups.map((e,t)=>({name:e.name,color:e.color,shape:`circle`,patternIndex:t,pattern:`pattern_${O.value}_${t}`,id:e.id,select:()=>$n(e.id),opacity:N.value?N.value===e.id?1:.3:1}))),tr=d(()=>({cy:`chord-div-legend`,backgroundColor:H.value.legend.backgroundColor,color:H.value.legend.color,fontSize:H.value.legend.fontSize,paddingBottom:12,fontWeight:H.value.legend.bold?`bold`:``})),Q=d(()=>({head:Y.value.groups.map((e,t)=>({name:e.name??String(t),color:e.color})),body:J.value.matrix})),nr=d(()=>{let e=[{name:``,color:null},...Q.value.head];return{colNames:e,head:e,body:Q.value.body.map((e,t)=>[Q.value.head[t],...Q.value.body[t]]),config:{th:{backgroundColor:z.value.table.th.backgroundColor,color:z.value.table.th.color,outline:z.value.table.th.outline},td:{backgroundColor:z.value.table.td.backgroundColor,color:z.value.table.td.color,outline:z.value.table.td.outline},breakpoint:z.value.table.responsiveBreakpoint}}});function rr(e=null){Ie(()=>{let t=J.value.matrix.map((e,t)=>[Q.value.head[t].name,...e]),n=[[H.value.title.text],[H.value.title.subtitle.text],[``,...Q.value.head.map(e=>e.name)]].concat(t),r=ne(n);e?e(r):ue({csvContent:r,title:H.value.title.text||`vue-ui-chord`})})}let ir=ee(P,()=>H.value.title.text);function ar(e,t){return`${J.value.labels[t]}${B.value.labels.showPercentage?l({p:` (`,v:isNaN(e.proportion)?0:e.proportion*100,s:`%)`,r:B.value.labels.roundingPercentage}):``}`}let or=d(()=>c({config:z,style:H,mutableConfig:G,dialog:Ot,accordion:St,isFullscreen:Fn,parent:P,maxWidth:800,isCursorPointer:U}));T(()=>G.value.showTable,e=>s(e,z,Kt));function sr(){G.value.showTable=!1,qt.value&&qt.value.setTableIconState(!1)}let cr=d(()=>H.value.backgroundColor),lr=d(()=>H.value.legend),ur=d(()=>H.value.title),{isCallbackImaging:dr,isCallbackSvg:fr,generateSvg:pr,onGenerateImage:mr}=be({svg:W,title:ur,legend:lr,legendItems:er,backgroundColor:cr,getSvgCallback:()=>z.value.userOptions.callbacks.svg,generateImage:on});async function hr(){At(`copyAlt`,{config:z.value,dataset:J.value}),z.value.userOptions.callbacks.altCopy?await Promise.resolve(z.value.userOptions.callbacks.altCopy({config:z.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let gr=d(()=>new Map(Y.value.groups.map(e=>[e.id,bn(e.startAngle,e.endAngle,q.value.outer,q.value.inner)])));function _r(e,t=!1){let{source:n,target:r,id:i,path:a,color:o}=e;return t?{source:n,target:r,id:i,path:a,color:o}:{source:n,target:r,id:i,color:o}}let vr=d(()=>Y.value.chords.map(e=>({...e,path:xn(e.source,e.target),color:J.value.colors[e.source.index]}))),yr=d(()=>vr.value.filter(e=>k.value?e.source.groupId===k.value:!N.value||e.source.groupId===N.value).map((e,t)=>({...e,renderIndex:t})).filter(e=>e.source.value)),$=d(()=>({groups:Y.value.groups.map((e,t)=>({type:`group`,index:t,item:e})),ribbons:yr.value.map((e,t)=>({type:`ribbon`,index:t,item:_r(e,!0)}))})),br=d(()=>({headers:[``,...Q.value.head.map(e=>e.name)],rows:Q.value.body.map((e,t)=>[Q.value.head[t]?.name??`${t}`,...e.map(e=>Pn(e))])}));function xr(e){let t=$.value.groups[e];t&&(N.value=null,I.value=`group`,L.value=t.item.id,A.value=null,k.value=t.item.id)}function Sr(e){let t=$.value.ribbons[e];t&&(N.value=null,I.value=`ribbon`,L.value=t.item.id,k.value=null,A.value=t.item.id)}function Cr(){L.value=null,I.value=`group`,k.value=null,A.value=null}function wr(){Jt.value=!0,I.value=`group`,L.value=null}function Tr(){Jt.value=!1,Cr()}function Er(e){if(!W.value||Gn.value||document.activeElement!==W.value)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){Cr();return}if(r){I.value=`group`,$.value.groups.length&&xr(R.value===null?0:Math.min(R.value,$.value.groups.length-1));return}if(i){if(!$.value.ribbons.length)return;I.value=`ribbon`,Sr(R.value===null?0:Math.min(R.value,$.value.ribbons.length-1));return}if(a){if(I.value===`group`){let e=$.value.groups[R.value];e&&zn(e.item,e.index)}else{let e=$.value.ribbons[R.value];e&&Hn(e.item,e.index)}return}let s=I.value===`group`?$.value.groups:$.value.ribbons;if(!s.length)return;let c=R.value;c===null||c<0||c>=s.length?c=n?0:s.length-1:n?(c+=1,c>=s.length&&(c=0)):t&&(--c,c<0&&(c=s.length-1)),I.value===`group`?xr(c):Sr(c)}return T(()=>D.dataset,ln,{deep:!0,immediate:!0}),T(z,()=>{G.value.showTable=z.value.table.show}),T(()=>z.value.responsive,fn,{flush:`post`}),T(H,()=>Ut?.(),{flush:`post`}),T(()=>z.value.initialRotation,e=>{Zn(),X.value=e}),T(()=>z.value.enableRotation,e=>{e||Z()}),T(Xt,e=>{e&&(N.value=null,Cr())}),T(Y,e=>{e.groups.some(e=>e.id===k.value)||(k.value=null),e.groups.some(e=>e.id===N.value)||(N.value=null),e.chords.some(e=>e.id===A.value)||(A.value=null),(I.value===`group`?e.groups:e.chords).some(e=>e.id===L.value)||(L.value=null)}),ke({getData:Jn,getImage:ir,generateCsv:rr,generateImage:on,generateSvg:pr,generatePdf:an,toggleAnnotator:Kn,toggleTable:qn,toggleFullscreen:In,copyAlt:hr}),(e,s)=>(y(),m(`div`,{ref_key:`chordChart`,ref:P,class:_({"vue-data-ui-component":!0,"vue-ui-chord":!0,"vue-data-ui-wrapper-fullscreen":Fn.value,"vue-data-ui-responsive":z.value.responsive}),style:v(`font-family:${z.value.style.fontFamily};width:100%; text-align:center;background:${H.value.backgroundColor}`),id:`chord_${O.value}`,onMouseenter:s[2]||=()=>w(en)(!0),onMouseleave:s[3]||=()=>w(en)(!1)},[h(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[h(`p`,null,C(z.value.a11y.translations.keyboardNavigation),1)],8,Ke),z.value.a11y.includeTable&&br.value?.rows?.length?(y(),f(Oe,{key:0,uid:O.value,head:br.value.headers,body:br.value.rows,notice:z.value.a11y.translations.tableAvailable,caption:z.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),z.value.userOptions.buttons.annotator&&w(W)?(y(),f(w(Et),Fe({key:1},w(a)(z.value.userOptions.annotator),{color:H.value.color,backgroundColor:H.value.backgroundColor,active:Gn.value,svgRef:w(W),isCursorPointer:U.value,palette:z.value.userOptions.annotatorPalette,onClose:Kn}),je({_:2},[x(w(o),t=>({name:t,fn:E(n=>[S(e.$slots,t,Le(Pe(w(i)(t,n))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`palette`])):p(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),mn.value?(y(),m(`div`,{key:2,ref_key:`noTitle`,ref:Lt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),H.value.title.text?(y(),m(`div`,{key:3,ref_key:`chartTitle`,ref:Pt,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),f(we,{key:`title_${Rt.value}`,config:{title:{cy:`chord-div-title`,...H.value.title},subtitle:{cy:`chord-div-subtitle`,...H.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),h(`div`,{id:`legend-top-${O.value}`},null,8,qe),z.value.userOptions.show&&Mt.value&&(w(tn)||w($t))?(y(),f(w(Dt),Fe({ref_key:`userOptionsRef`,ref:qt,key:`user_option_${Nt.value}`,backgroundColor:H.value.backgroundColor,color:H.value.color,isPrinting:w(nn),isImaging:w(rn),uid:O.value,hasTooltip:!1,hasLabel:!1,isFullscreen:Fn.value,chartElement:P.value},w(n)(z.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Gn.value,tableDialog:z.value.table.useDialog,isCursorPointer:U.value,onToggleFullscreen:In,onGeneratePdf:w(an),onGenerateCsv:rr,onGenerateImage:w(mr),onGenerateSvg:w(pr),onToggleTable:qn,onToggleAnnotator:Kn,onCopyAlt:hr,style:{visibility:w(tn)?w($t)?`visible`:`hidden`:`visible`}}),je({_:2},[x(w(t)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[S(e.$slots,t,Le(Pe(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),(y(),m(`svg`,{xmlns:w(pe),ref_key:`svgRef`,ref:W,viewBox:`0 0 ${K.value.width} ${K.value.height}`,"aria-describedby":`chart-instructions-${O.value}`,tabindex:`0`,preserveAspectRatio:`xMidYMid meet`,style:{overflow:`visible`},class:_({"vue-ui-chord-rotating":On.value,"vue-ui-chord-idle":!On.value}),onMousedown:Ue(Mn,[`prevent`]),onTouchstart:Ue(Mn,[`prevent`]),onFocus:wr,onBlur:Tr,onKeydown:Er},[Ne(w(Tt)),S(e.$slots,`svg-underlayer`,{svg:{height:600,width:600,isPrintingImg:w(nn)||w(rn)||w(dr),isPrintingSvg:w(fr)}},void 0,!0),e.$slots[`chart-background`]?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:K.value.width<=0?10:K.value.width,height:K.value.height<=0?10:K.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,Ye)):p(``,!0),B.value.labels.curved?(y(),m(`defs`,Xe,[(y(!0),m(u,null,x(Y.value.groups,(e,t)=>(y(),m(`path`,{key:`labelPath-${t}`,id:`labelPath-${t}_${O.value}`,d:Dn(e.startAngle,e.endAngle,(q.value.inner+q.value.outer)/2+B.value.labels.offset),fill:`none`},null,8,Ze))),128))])):p(``,!0),e.$slots.pattern?(y(),m(`g`,Qe,[(y(!0),m(u,null,x(Y.value.groups,(t,n)=>(y(),m(`defs`,null,[S(e.$slots,`pattern`,Fe({ref_for:!0},{seriesIndex:t.index,patternId:`pattern_${O.value}_${n}`}),void 0,!0)]))),256))])):p(``,!0),h(`g`,{transform:`translate(${K.value.width/2}, ${K.value.height/2}) rotate(${X.value})`},[(y(!0),m(u,null,x(Y.value.groups,(t,n)=>(y(),m(`g`,null,[(y(),m(`path`,{class:_({"vue-ui-chord-arc":!0,"vue-ui-chord-arc-animated":z.value.useCssAnimation&&!Vt.value}),key:`arc-${n}`,d:gr.value.get(t.id),fill:J.value.colors[n],stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Wn(t)}),onMouseenter:e=>Ln(t,n),onMouseleave:e=>Rn(t,n),onClick:e=>zn(t,n)},null,46,et)),e.$slots.pattern?(y(),m(`path`,{class:_({"vue-ui-chord-arc":!0,"vue-ui-chord-arc-animated":z.value.useCssAnimation&&!Vt.value}),key:`pattern-arc-${n}`,d:gr.value.get(t.id),fill:`url(#${t.pattern})`,stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Wn(t),pointerEvents:`none`})},null,14,tt)):p(``,!0)]))),256)),h(`g`,null,[(y(!0),m(u,null,x(yr.value,(t,n)=>(y(),m(u,{key:`ribbon-${t.id}`},[t.source.value?(y(),m(`path`,{key:0,class:_({"vue-ui-chord-ribbon":!0}),d:t.path,fill:H.value.backgroundColor,style:v({opacity:V.value.underlayerOpacity})},null,12,nt)):p(``,!0),t.source.value?(y(),m(`path`,{key:1,class:_({"vue-ui-chord-ribbon":!0}),d:t.path,fill:J.value.colors[t.source.index],stroke:V.value.stroke,"stroke-width":V.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Un(t)}),onMouseenter:e=>Bn(_r(t,!0),t.renderIndex),onClick:e=>Hn(_r(t),t.renderIndex),onMouseleave:e=>Vn(_r(t),t.renderIndex)},null,44,rt)):p(``,!0),t.source.value&&e.$slots.pattern?(y(),m(`path`,{key:2,class:_({"vue-ui-chord-ribbon":!0}),d:t.path,fill:`url(#pattern_${O.value}_${t.source.index})`,stroke:V.value.stroke,"stroke-width":V.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Un(t),pointerEvents:`none`})},null,12,it)):p(``,!0)],64))),128)),M.value?(y(),m(`path`,{key:0,d:M.value.path,fill:M.value.color,stroke:V.value.stroke,"stroke-width":V.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:_({"vue-ui-chord-ribbon":!0}),style:{pointerEvents:`none`}},null,8,at)):p(``,!0),M.value&&e.$slots.pattern?(y(),m(`path`,{key:1,d:M.value.path,fill:`url(#${M.value.source.pattern})`,stroke:V.value.stroke,"stroke-width":V.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:_({"vue-ui-chord-ribbon":!0}),style:{pointerEvents:`none`}},null,8,ot)):p(``,!0)]),(j.value||M.value||N.value)&&V.value.labels.show?(y(),m(`g`,st,[(y(!0),m(u,null,x(yn.value,e=>(y(),m(u,{key:e.id},[h(`line`,{x1:e.midBaseX,y1:e.midBaseY,x2:Math.cos(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+12),y2:Math.sin(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+12),stroke:H.value.backgroundColor,"stroke-width":V.value.labels.connector.strokeWidth*3,"pointer-events":`none`},null,8,ct),h(`line`,{x1:e.midBaseX,y1:e.midBaseY,x2:Math.cos(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+12),y2:Math.sin(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+12),stroke:V.value.labels.connector.stroke,"stroke-width":V.value.labels.connector.strokeWidth,"pointer-events":`none`},null,8,lt),V.value.labels.marker.show?(y(),m(`circle`,{key:0,cx:Math.cos(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+12),cy:Math.sin(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+12),r:V.value.labels.marker.radius,stroke:V.value.labels.marker.stroke,"stroke-width":V.value.labels.marker.strokeWidth,fill:e.groupColor,"pointer-events":`none`},null,8,ut)):p(``,!0),h(`text`,{transform:`
|
|
2
|
+
translate(
|
|
3
|
+
${Math.cos(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+24)},
|
|
4
|
+
${Math.sin(e.theta-Math.PI/2)*(q.value.outer+V.value.labels.offset+24)}
|
|
5
|
+
) rotate(${-X.value})
|
|
6
|
+
`,fill:V.value.labels.useSerieColor?e.groupColor:V.value.labels.color,"text-anchor":Tn(e.theta),"font-size":V.value.labels.fontSize,"font-weight":V.value.labels.bold?`bold`:`normal`,dy:`.35em`,"pointer-events":`none`},C(Pn(e.value)),9,dt)],64))),128))])):p(``,!0),B.value.labels.show?(y(),m(`g`,ft,[B.value.labels.curved?(y(!0),m(u,{key:0},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-curved`,key:`curved-label-${t}`,"font-size":B.value.labels.fontSize,"font-weight":B.value.labels.bold?`bold`:`normal`,fill:B.value.labels.adaptColorToBackground?w(de)(J.value.colors[t]):B.value.labels.color},[h(`textPath`,{href:`#labelPath-${t}_${O.value}`,startOffset:`50%`,"text-anchor":`middle`},C(ar(e,t)),9,mt)],8,pt))),128)):!j.value&&!M.value&&!N.value?(y(!0),m(u,{key:1},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-straight`,key:`label-${t}`,transform:`
|
|
7
|
+
${En((e.startAngle+e.endAngle)/2)}
|
|
8
|
+
rotate(${-X.value})
|
|
9
|
+
`,dy:`.35em`,"text-anchor":wn(e)>Math.PI?`end`:`start`,"font-size":B.value.labels.fontSize,"font-weight":B.value.labels.bold?`bold`:`normal`,fill:B.value.labels.color,innerHTML:w(oe)({content:w(fe)(ar(e,t)),fontSize:B.value.labels.fontSize,fill:B.value.labels.color,x:0,y:0})},null,8,ht))),128)):p(``,!0)])):p(``,!0)],8,$e),S(e.$slots,`svg`,{svg:{height:600,width:600,isPrintingImg:w(nn)||w(rn)||w(dr),isPrintingSvg:w(fr)}},void 0,!0)],42,Je)),e.$slots.hint?(y(),m(`div`,gt,[S(e.$slots,`hint`,Le(Pe({hint:z.value.a11y.translations.keyboardNavigation,isVisible:Jt.value})),void 0,!0)])):p(``,!0),e.$slots.watermark?(y(),m(`div`,_t,[S(e.$slots,`watermark`,Le(Pe({isPrinting:w(nn)||w(rn)||w(dr)||w(fr)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${O.value}`},null,8,vt),Gt.value&&(H.value.legend.show||e.$slots.legend)?(y(),f(Ae,{key:7,to:H.value.legend.position===`top`?`#legend-top-${O.value}`:`#legend-bottom-${O.value}`},[h(`div`,{ref_key:`chartLegend`,ref:Ft},[S(e.$slots,`legend`,{legend:er.value},()=>[H.value.legend.show?(y(),f(Ee,{key:`legend_${Bt.value}`,legendSet:er.value,config:tr.value,isCursorPointer:U.value,onClickMarker:s[0]||=({legend:e})=>$n(e.id)},je({item:E(({legend:e})=>[h(`div`,{style:v({opacity:N.value?N.value===e.id?1:.3:1}),onClick:t=>e.select()},C(e.name),13,yt)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:E(({legend:e,index:t})=>[Ne(Ce,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:8,ref_key:`source`,ref:It,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),X.value===z.value.initialRotation?p(``,!0):(y(),m(`div`,bt,[S(e.$slots,`reset-action`,{reset:Qn},()=>[h(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:v({background:H.value.backgroundColor,cursor:U.value?`pointer`:`default`}),onClick:Qn},[Ne(w(Ct),{name:`refresh`,stroke:H.value.color},null,8,[`stroke`])],4)],!0)])),Mt.value&&z.value.userOptions.buttons.table?(y(),f(Be(or.value.component),Fe({key:10},or.value.props,{ref_key:`tableUnit`,ref:Kt,onClose:sr}),je({content:E(()=>[(y(),f(w(wt),{key:`table_${zt.value}`,colNames:nr.value.colNames,head:nr.value.head,body:nr.value.body,config:nr.value.config,title:z.value.table.useDialog?``:or.value.title,withCloseButton:!z.value.table.useDialog,isCursorPointer:U.value,onClose:sr},{th:E(({th:e})=>[Me(C(e.name),1)]),td:E(({td:e})=>[h(`div`,xt,C(e.name?e.name:Pn(e)),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[z.value.table.useDialog?{name:`title`,fn:E(()=>[Me(C(or.value.title),1)]),key:`0`}:void 0,z.value.table.useDialog?{name:`actions`,fn:E(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[1]||=e=>rr(z.value.userOptions.callbacks.csv),style:v({cursor:U.value?`pointer`:`default`})},[Ne(w(Ct),{name:`fileCsv`,stroke:or.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[w(Xt)?(y(),f(De,{key:0})):p(``,!0)],!0)],46,Ge))}},[[`__scopeId`,`data-v-86c9538b`]]);export{We as n,St as t};
|
|
@@ -0,0 +1,13 @@
|
|
|
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{n as c,t as l}from"./tableIntegration-CNoJ1CIY.js";import{t as u}from"./chartImage-DPGnEuYM.js";import{n as d}from"./resolveChartConfig-0IvbmIE_.js";import{$ as f,D as p,Dt as m,Ft as h,Ht as g,Q as ee,S as te,X as ne,Zt as re,at as ie,i as ae,in as oe,nn as se,nt as ce,q as le,r as ue,t as de,tn as fe,w as pe,zt as me}from"./lib-rPeBMZrn.js";import{n as he,t as ge}from"./useHints-C-TwxM0Y.js";import{t as _e}from"./useConfig-9oDGTWWG.js";import{t as ve}from"./usePrinter-DVf3YcG5.js";import{t as ye}from"./useLoading-BwiplGDB.js";import{t as be}from"./useResponsive-CENUxfEL.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{t as Se}from"./useTransitions-ChGGrtrv.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./vue_ui_circle_pack-DarCZyF2.js";import{t as De}from"./BaseScanner-m6QR9rwD.js";import{t as Oe}from"./usePanZoom-CTGk8aJt.js";import{t as ke}from"./A11yDataTable-DWNlWXzs.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Me,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as C,guardReactiveProps as w,mergeProps as T,nextTick as Fe,normalizeClass as E,normalizeProps as D,normalizeStyle as Ie,onBeforeUnmount as Le,onMounted as Re,openBlock as O,ref as k,renderList as A,renderSlot as j,resolveDynamicComponent as ze,shallowRef as Be,toDisplayString as M,toRefs as Ve,unref as N,useCssVars as He,watch as P,withCtx as F}from"vue";function Ue(e,t=0){let n=e.reduce((e,{x:n,r})=>Math.min(e,n-r-t),1/0),r=e.reduce((e,{x:n,r})=>Math.max(e,n+r+t),-1/0),i=e.reduce((e,{y:n,r})=>Math.min(e,n-r-t),1/0),a=e.reduce((e,{y:n,r})=>Math.max(e,n+r+t),-1/0);return[n,i,r-n,a-i]}function We(e,t,n){let r=e._,i=e.next._,a=r.r+i.r,o=(r.x*i.r+i.x*r.r)/a,s=(r.y*i.r+i.y*r.r)/a;return Math.max(Math.abs(o*n),Math.abs(s*t))}function Ge(e,t,n){let r=We,i=e.length;if(!i)return e;e.sort((e,t)=>t.r-e.r);let a,o,s;if(a=e[0],a.x=0,a.y=0,!(i>1))return e;if(o=e[1],a.x=-o.r,o.x=a.r,o.y=0,!(i>2))return Je(e,n,t),e;Ke(o,a,s=e[2]),a=new tt(a),o=new tt(o),s=new tt(s),a.next=s.previous=o,o.next=a.previous=s,s.next=o.previous=a;packLoop:for(let c=3;c<i;++c){Ke(a._,o._,s=e[c]),s=new tt(s);let i=o.next,l=a.previous,u=o._.r,d=a._.r;do if(u<=d){if(qe(i._,s._)){o=i,a.next=o,o.previous=a,--c;continue packLoop}u+=i._.r,i=i.next}else{if(qe(l._,s._)){a=l,a.next=o,o.previous=a,--c;continue packLoop}d+=l._.r,l=l.previous}while(i!==l.next);s.previous=a,s.next=o,a.next=o.previous=o=s;let f=a,p=r(a,n,t),m=a.next;for(;m!==o;){let e=r(m,n,t);e<p&&(f=m,p=e),m=m.next}a=f,o=a.next}return Je(e,n,t),Ze(e,n,t),e}function Ke(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;if(a){let o=(t.r+n.r)**2,s=(e.r+n.r)**2;if(o>s){let t=(a+s-o)/(2*a),c=Math.sqrt(Math.max(0,s/a-t*t));n.x=e.x-t*r-c*i,n.y=e.y-t*i+c*r}else{let e=(a+o-s)/(2*a),c=Math.sqrt(Math.max(0,o/a-e*e));n.x=t.x+e*r-c*i,n.y=t.y+e*i+c*r}}else n.x=t.x+n.r,n.y=t.y}function qe(e,t){let n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Je(e,t,n){if(e.length<4)return;let r=e[0].r,i=e.findIndex(e=>e.r<r*.6),a=i===-1?Math.min(e.length,12):i,o=e.slice(0,Math.max(3,a));for(let t=0;t<80;t+=1){let t=!1;for(let n=0;n<o.length;n+=1){let r=o[n],i=.06*(1-n/Math.max(1,o.length)),a=r.x*(1-i),s=r.y*(1-i);Ye(r,a,s,e,n)&&(r.x=a,r.y=s,t=!0)}if(Xe(o),!t)break}let s=o.reduce((e,t)=>e+t.x,0)/o.length,c=o.reduce((e,t)=>e+t.y,0)/o.length;for(let t of e)t.x-=s,t.y-=c}function Ye(e,t,n,r){let i=e.x,a=e.y;e.x=t,e.y=n;for(let t of r)if(t!==e&&qe(e,t))return e.x=i,e.y=a,!1;return e.x=i,e.y=a,!0}function Xe(e){for(let t=0;t<6;t+=1){let t=!1;for(let n=0;n<e.length-1;n+=1)for(let r=n+1;r<e.length;r+=1){let i=e[n],a=e[r],o=a.x-i.x,s=a.y-i.y,c=Math.sqrt(o*o+s*s)||1e-6,l=i.r+a.r;if(c<l){let e=(l-c)/2,n=o/c,r=s/c;i.x-=n*e,i.y-=r*e,a.x+=n*e,a.y+=r*e,t=!0}}if(!t)break}}function Ze(e,t,n){if(e.length<6)return;let r=e[0].r,i=e.findIndex(e=>e.r<=r*.45);if(i!==-1)for(let r=i;r<e.length;r+=1){let i=e[r],a=Qe(i,e.slice(0,r),t,n);a&&(i.x=a.x,i.y=a.y)}}function Qe(e,t,n,r){if(t.length<2)return null;let i=null,a=1/0;for(let o=0;o<t.length-1;o+=1)for(let s=o+1;s<t.length;s+=1){let c=t[o],l=t[s],u=$e(c,l,e.r);for(let o of u){if(!o)continue;let s={...e,x:o.x,y:o.y};if(!I(s,t))continue;let c=et(s,t,n,r);c<a&&(a=c,i=o)}}return i}function $e(e,t,n){let r=e.r+n,i=t.r+n,a=t.x-e.x,o=t.y-e.y,s=a*a+o*o,c=Math.sqrt(s);if(!c||c>r+i||c<Math.abs(r-i))return[];let l=(r*r-i*i+s)/(2*c),u=r*r-l*l;if(u<0)return[];let d=Math.sqrt(u),f=a/c,p=o/c,m=e.x+l*f,h=e.y+l*p,g=-p*d,ee=f*d;return[{x:m+g,y:h+ee},{x:m-g,y:h-ee}]}function I(e,t){for(let n of t)if(qe(n,e))return!1;return!0}function et(e,t,n,r){let i=e.x/Math.max(1,n),a=e.y/Math.max(1,r),o=i*i+a*a,s=[];for(let n of t){let t=e.x-n.x,r=e.y-n.y,i=Math.sqrt(t*t+r*r)-(e.r+n.r);s.push(i)}s.sort((e,t)=>e-t);let c=s[0]??0,l=s[1]??c,u=s[2]??l;return c*8+l*4+u*2+o*e.r*12}var tt=class{constructor(e){this._=e,this.next=null,this.previous=null}},nt=/* @__PURE__ */ e({default:()=>L}),rt=[`id`],it=[`id`],at=[`xmlns`,`aria-describedby`,`viewBox`],ot=[`x`,`y`,`width`,`height`],st={key:0},ct=[`stroke`,`stroke-width`,`fill`,`rx`,`onMouseenter`,`onMouseout`,`onClick`],lt=[`stroke`,`stroke-width`,`fill`,`rx`],ut=[`fill`,`rx`],dt=[`transform`,`font-size`,`fill`,`font-weight`],ft=[`transform`,`font-size`,`fill`,`font-weight`],pt={key:1,style:{pointerEvents:`none`}},mt=[`stroke`,`stroke-width`,`stroke-dasharray`,`opacity`,`d`],ht=[`x`,`y`,`width`,`height`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`,`filter`],gt=[`fill`,`x`,`y`,`rx`,`width`,`height`],_t=[`transform`,`font-size`,`fill`,`font-family`],vt=[`dy`],yt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:5,class:`vue-data-ui-watermark`},xt={key:6,"data-dom-to-png-ignore":``,class:`reset-wrapper`},St={style:{display:`flex`,"align-items":`center`}},L=/*#__PURE__*/ je({__name:`vue-ui-circle-pack`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:je,emit:We}){He(e=>({e7eebbb2:Or.value}));let Ke=C(()=>import(`./Tooltip-B432XpvC.js`)),qe=C(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Je=C(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),Ye=C(()=>import(`./DataTable-KeuZB1JM.js`)),Xe=C(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ze=C(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Qe=C(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),$e=C(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),I=e,et=We,{vue_ui_circle_pack:tt}=_e(),nt=v(()=>!!I.dataset&&I.dataset.length),L=k(ne()),R=k(null),Ct=k(null),wt=k(null),Tt=k(0),Et=k(0),Dt=k(0),Ot=k(null),kt=k(null),At=k(null),jt=k(!1),Mt=k(``),z=k(null),B=v(()=>rn.value.get(z.value)??null),V=k(null),Nt=k({x:0,y:0}),H=k(`pointer`),Pt=k(!1),U=k(Ht()),W=v(()=>U.value.style.chart.circles.labels),G=v(()=>U.value.style.chart.circles),K=v(()=>U.value.style.chart);he({config:()=>U.value,dataset:()=>I.dataset,component:`VueUiCirclePack`,rules:[ge.emptyArray,{test:e=>e.length===1&&(!e[0].children||e[0]?.children.length===0),message:[`👀 The dataset only has a single series. Consider:`,``,`▶️ Using a value display instead of a chart component, or using VueUiKpi.`]},{test:e=>e.length===1&&e[0]?.children&&e[0]?.children.length<6,message:[`👀 The number of datapoints is probably too low for this type of chart. Consider:`,``,`▶️ Using VueUiDonut or VueUiWaffle instead.`]}]});let{transitionEnabled:q}=Se({config:()=>U.value.transitions,dataset:()=>I.dataset}),Ft=v(()=>U.value.userOptions.useCursorPointer),It=v(()=>oe({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,circles:{stroke:`#6A6A6A`,labels:{name:{show:!1},value:{show:!1}}}}}},userConfig:U.value.skeletonConfig??{}})),{loading:Lt,FINAL_DATASET:Rt}=ye({...Ve(I),FINAL_CONFIG:U,prepareConfig:Ht,skeletonDataset:I.config?.skeletonDataset??[{name:`_`,value:13,color:`#F2F2F2`},{name:`_`,value:8,color:`#DBDBDB`},{name:`_`,value:5,color:`#ADADAD`},{name:`_`,value:3,color:`#969696`},{name:`_`,value:2,color:`#808080`},{name:`_`,value:1,color:`#696969`}],skeletonConfig:oe({defaultConfig:U.value,userConfig:It.value})}),{svgRef:J}=we({config:K.value.title}),{userOptionsVisible:zt,setUserOptionsVisibility:Bt,keepUserOptionState:Vt}=Ce({config:U.value});function Ht(){return d(I.config,tt,Ee)}let Ut=re(I.config);P(()=>I.config,(e,t)=>{let n=re(e),r=n!==Ut;Ut=n;let i=Ht();r?(Lt.value||(U.value=i),zt.value=!U.value.userOptions.showOnChartHover,Tt.value+=1,Et.value+=1,Y.value.showTable=U.value.table.show,Y.value.showTooltip=K.value.tooltip.show,Y.value.showZoom=K.value.zoom?.show??!1):(U.value.style.chart.tooltip=i.style.chart.tooltip,Y.value.showTooltip=U.value.style.chart.tooltip.show)},{deep:!0});let{isPrinting:Wt,isImaging:Gt,generatePdf:Kt,generateImage:qt}=ve({elementId:`vue-ui-circle-pack_${L.value}`,fileName:K.value.title.text||`vue-ui-circle-pack`,options:U.value.userOptions.print}),Jt=v(()=>U.value.userOptions.show&&!K.value.title.text),Y=k({showTable:U.value.table.show,showTooltip:K.value.tooltip.show,showZoom:K.value.zoom?.show??!1});P(U,()=>{Y.value={showTable:U.value.table.show,showTooltip:K.value.tooltip.show,showZoom:K.value.zoom?.show??!1}},{immediate:!0});let X=k({h:10,w:10}),Yt=k({x:0,y:0,width:100,height:100}),Xt=v(()=>U.value.debug),Zt=v(()=>{let e=U.value.style?.chart||{};return e.dimensions&&Number.isFinite(e.dimensions.width)&&e.dimensions.width>0?e.dimensions.width:Number.isFinite(e.width)&&e.width>0?e.width:300}),Qt=v(()=>{let e=U.value.style?.chart||{};return e.dimensions&&Number.isFinite(e.dimensions.height)&&e.dimensions.height>0?e.dimensions.height:Number.isFinite(e.height)&&e.height>0?e.height:300}),$t=k([]),en=null,tn=v(()=>{let e=/* @__PURE__ */ new Map;function t(n){for(let r of n)e.set(r.id,r),t(r.children)}return t(bn.value),e});function nn(e){let t=tn.value.get(e.id)||e;return{...e,...t,...Object.hasOwn(e,`x`)?{x:e.x,y:e.y}:{},r:e.r,children:(e.children||[]).map(nn)}}let Z=v(()=>$t.value.map(nn)),rn=v(()=>new Map(Z.value.map(e=>[e.id,e]))),an=Be(null),Q=null,on=null,sn=!1;function cn(e,t,n,r=t/2,i=n/2,a=1){let o=Ge(e.map(e=>({...e})),n,t);if(!o.length)return[];let[s,c,l,u]=Ue(o,1),d=Math.min(l?t/l:1,u?n/u:1)*a;return o.map(e=>({...e,x:(e.x-s)*d+r-l*d/2,y:(e.y-c)*d+i-u*d/2,r:e.r*d}))}function ln(){let e={x:0,y:0,width:X.value.w,height:X.value.h},t=Z.value.length?er(e):e;Yt.value={...t},Vn(t)}function un(e,t){en=Ar.value,X.value={w:e,h:t},$t.value=pn(cn(bn.value,e,t)),ln()}let dn=v(()=>{let e=se[U.value.theme||`default`]||g;return yn.value.length?yn.value:e.length?e:g});function fn(e,t=null,n=0,r=[]){if(!Array.isArray(e))return[];let i=/* @__PURE__ */ new Map;return e.map((e,a)=>{if(!e||typeof e!=`object`)return null;let o=[...r,a],s=e.id==null?`circle_pack_${L.value}_${o.join(`_`)}`:`${t?.id??`circle_pack_${L.value}`}_id_${Array.from(String(e.id),e=>e.codePointAt(0).toString(16)).join(`_`)}`,c=i.get(s)||0;i.set(s,c+1);let l=c?`${s}_duplicate_${c}`:s,u=o.reduce((e,t,n)=>e+t+n,0),d=te(e.color||t?.color)||dn.value[u%dn.value.length],f=fn(e.children,{id:l,name:e.name,color:d,rootId:t?.rootId??l},n+1,o),p=Number(e.value),m=Number.isFinite(p)&&p>0?p:f.reduce((e,t)=>e+t.value,0);return!Number.isFinite(m)||m<=0?null:{...e,value:m,r:m,id:l,color:d,depth:n,parentId:t?.id??null,parentName:t?.name??null,rootId:t?.rootId??l,hasChildren:f.length>0,childCount:f.length,leafCount:f.length?f.reduce((e,t)=>e+t.leafCount,0):1,hierarchyPath:o,children:f}}).filter(Boolean)}function pn(e){let t=[];for(let n of e){let e=n.r*2,r=n.children?.length&&e?cn(n.children,e,e,n.x,n.y,.9):[];t.push({...n,children:r},...pn(r))}return t}function mn(e,t){return!e||!t||!Array.isArray(e.hierarchyPath)||!Array.isArray(t.hierarchyPath)||e.hierarchyPath.length<=t.hierarchyPath.length?!1:t.hierarchyPath.every((t,n)=>e.hierarchyPath[n]===t)}function hn(e){return e.hasChildren?W.value.parents.show:W.value.children.show}function gn(){on=null,Q!==null&&cancelAnimationFrame(Q),Q=null,an.value?.disconnect(),an.value=null,J.value?.removeAttribute(`width`),J.value?.removeAttribute(`height`)}function _n(){gn();let e=R.value?.parentNode||R.value;if(!U.value.responsive||!e)return;let t=()=>{Q!==null&&cancelAnimationFrame(Q),Q=requestAnimationFrame(()=>{if(Q=null,sn)return;let{width:e,height:t}=be({chart:R.value,title:K.value.title.text?Ct.value:null,legend:null,source:Ot.value,noTitle:wt.value});!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0||(J.value?.setAttribute(`width`,e),J.value?.setAttribute(`height`,t),(e!==X.value.w||t!==X.value.h||en!==Ar.value)&&un(e,t))})};on=t,an.value=new ResizeObserver(t),an.value.observe(e),t()}function vn(){me(I.dataset)&&ie({componentName:`VueUiCirclePack`,type:`dataset`,debug:Xt.value}),U.value.responsive?_n():(gn(),un(Zt.value,Qt.value))}Re(vn),Le(()=>{sn=!0,gn()});let yn=v(()=>pe(U.value.customPalette)),bn=v(()=>fn(Rt.value)),xn=v(()=>Z.value.length?Math.max(...Z.value.map(e=>e.r)):0);function Sn(e,t){return xn.value?t/xn.value*e:0}function Cn(e,t){U.value.events.datapointLeave&&U.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(H.value!==`keyboard`||B.value?.id!==e?.id)&&(jt.value=!1,z.value=null,V.value=null,H.value=`pointer`)}function wn(e,t){et(`selectDatapoint`,e),U.value.events.datapointClick&&U.value.events.datapointClick({datapoint:e,seriesIndex:t})}let Tn=k(null),En=k(!1);function Dn(e,t,n=`pointer`,r=!0){z.value=e.id,V.value=t,H.value=n,r&&U.value.events.datapointEnter&&U.value.events.datapointEnter({datapoint:e,seriesIndex:t}),Tn.value={datapoint:e,seriesIndex:t,config:U.value,series:Z.value},jt.value=!0;let i=K.value.tooltip.customFormat;if(En.value=!1,m(i))try{let n=i({seriesIndex:t,datapoint:e,series:Z.value,config:U.value});typeof n==`string`&&(Mt.value=n,En.value=!0)}catch{console.warn(`Custom format cannot be applied.`),En.value=!1}if(!En.value){let t=``;t+=`
|
|
2
|
+
<div style="display:flex;align-items:center;gap:4px;">
|
|
3
|
+
<svg viewBox="0 0 10 10" height="${K.value.tooltip.fontSize}" width="${K.value.tooltip.fontSize}">
|
|
4
|
+
<circle
|
|
5
|
+
cx="5"
|
|
6
|
+
cy="5"
|
|
7
|
+
r="5"
|
|
8
|
+
fill="${G.value.gradient.show?`url(#${e.id})`:e.color}"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
|
11
|
+
<span>${e.name}: <b>${An(e)}</b></span>
|
|
12
|
+
</div>
|
|
13
|
+
`,Mt.value=t}}function On(e){return ae(W.value.value.formatter,e.value,f({p:W.value.value.prefix,v:e.value,s:W.value.value.suffix,r:W.value.value.rounding}))}let kn=v(()=>new Map(Z.value.map(e=>{let t=On(e),n=String(t).length||1;return[e.id,{label:t,fontSize:Math.min(e.r/2.5,e.r/n*(n===1?1:2))}]})));function An(e){return kn.value.get(e.id)?.label??On(e)}function jn(e){return kn.value.get(e?.id)?.fontSize??0}function Mn(e){let t=W.value.name.color;return!t||t===`auto`?ue(e.color):t}function Nn(e){return{x:e.x-e.r,y:e.y-e.r,width:e.r*2,height:e.r*2}}let Pn=k(!1);function Fn(e){Pn.value=e,Dt.value+=1}let In=k(!1);function Ln(){In.value=!In.value}let Rn=v(()=>!In.value&&Y.value.showZoom),{viewBox:$,resetZoom:zn,isZoom:Bn,setInitialViewBox:Vn}=Oe(J,{x:0,y:0,width:Math.max(10,X.value.w),height:Math.max(10,X.value.h)},()=>K.value.zoom?.speed??1,Rn);function Hn(e,t,n=0){return!(e.x+e.width+n<t.x||t.x+t.width+n<e.x||e.y+e.height+n<t.y||t.y+t.height+n<e.y)}function Un(e,t,n=0){let r=Math.min(Math.max(t.x,e.x-n),e.x+e.width+n),i=Math.min(Math.max(t.y,e.y-n),e.y+e.height+n),a=t.x-r,o=t.y-i;return a*a+o*o<=t.r*t.r}function Wn(e,t,n=1){let r=Math.max(4*n,Math.min(t.width,t.height)*.01);return{...e,x:Math.min(Math.max(e.x,t.x+r),t.x+t.width-e.width-r),y:Math.min(Math.max(e.y,t.y+r),t.y+t.height-e.height-r)}}function Gn(e){let t=[e.name];return W.value.value.show&&t.push(An(e)),t.filter(Boolean)}let Kn={right:[1,0],left:[-1,0],top:[0,-1],bottom:[0,1],topRight:[1,-1],topLeft:[-1,-1],bottomRight:[1,1],bottomLeft:[-1,1]};function qn(e,t,n,r,i){let[a,o]=Kn[r],s=e.r*(a&&o?.7:1),c=e.x+a*s,l=e.y+o*s;return{x:c+a*i-(a<0?t:a===0?t/2:0),y:l+o*i-(o<0?n:o===0?n/2:0),anchorX:c,anchorY:l}}function Jn(e,t){let n=[],r=t.get(e.parentId);for(;r;)n.push(r),r=t.get(r.parentId);return n}function Yn(e,t,n,r,i,a){let o=t||e,[s,c]=Kn[i],l=s&&c?a*.6:0,u=s?o.x+s*o.r+s*a-(s<0?n:0):e.x-n/2,d=c?o.y+c*o.r+c*a-(c<0?r:0)+c*l:e.y-r/2,f=Math.atan2(d+r/2-e.y,u+n/2-e.x);return{x:u,y:d,anchorX:e.x+Math.cos(f)*e.r,anchorY:e.y+Math.sin(f)*e.r}}let Xn=v(()=>Z.value.filter(e=>e.hasChildren&&e.name).toSorted((e,t)=>t.r-e.r).map(e=>{let t=Jn(e,rn.value),n=Gn(e);return{circle:e,outermostAncestor:t.at(-1),lines:n,longestLine:n.reduce((e,t)=>Math.max(e,String(t).length),0)}}));function Zn(e,t={}){let{clamp:n=!0,scale:r=1}=t;if(!Z.value.length||!X.value.w||!X.value.h||!K.value.parentTooltips.show)return[];let i=Math.max(8,K.value.parentTooltips.fontSizeRatio*10)*r,a=i*1.25,o=i*.75,s=i*.55,c=Math.max(8*r,Math.min(e.width,e.height)*.025),l=Math.max(2*r,Math.min(e.width,e.height)*.006),u=Object.keys(Kn),d=[];return Xn.value.forEach(({circle:t,outermostAncestor:f,lines:p,longestLine:m})=>{let h=Math.max(i*5,m*i*.62+o*2),g=p.length*a+s*2,ee=f?u.map(e=>Yn(t,f,h,g,e,c)):[],te=u.map(e=>qn(t,h,g,e,c)),ne=[...ee,...te].map(t=>{let i=n?Wn({x:t.x,y:t.y,width:h,height:g},e,r):{x:t.x,y:t.y,width:h,height:g};return{...i,anchorX:t.anchorX,anchorY:t.anchorY,lineX:i.x+i.width/2,lineY:i.y+i.height/2}}).find(e=>!d.some(t=>Hn(e,t,l))&&!Z.value.some(t=>Un(e,t,l)));ne&&d.push({...ne,datapoint:t,id:`parent_tooltip_${t.id}`,color:t.color,lines:p,fontSize:i,lineHeight:a,paddingX:o,paddingY:s,scale:r})}),d}function Qn(e){let t=Yt.value;if(!t.width||!t.height||!e.width||!e.height)return 1;let n=Math.min(e.width/t.width,e.height/t.height);return Number.isFinite(n)&&n>0?n:1}let $n=v(()=>Zn($.value,{clamp:!0,scale:Qn($.value)}));function er(e){let t=Zn(e,{clamp:!1});if(!t.length)return e;let n=Math.min(e.x,...t.map(e=>e.x)),r=Math.min(e.y,...t.map(e=>e.y)),i=Math.max(e.x+e.width,...t.map(e=>e.x+e.width)),a=Math.max(e.y+e.height,...t.map(e=>e.y+e.height)),o=Math.max(8,Math.min(e.width,e.height)*.025);return{x:n-o,y:r-o,width:i-n+o*2,height:a-r+o*2}}function tr(e){let t=[];function n(e,r=0,i=``){e.forEach(e=>{t.push({name:e.name,value:e.value,color:e.color,parentName:i,depth:r}),Array.isArray(e.children)&&e.children.length&&n(e.children,r+1,e.name)})}return n(e),t}let nr=v(()=>tr(bn.value)),rr=v(()=>nr.value.map(e=>({...e,name:`${`- `.repeat(e.depth)}${e.name}`})));function ir(e=null){Fe(()=>{let t=rr.value.map(e=>[[e.name],[e.parentName||``],[e.depth],[e.value]]),n=[[K.value.title.text],[K.value.title.subtitle.text],[[U.value.table.columnNames.datapoint],[U.value.table.columnNames.parent],[U.value.table.columnNames.depth],[U.value.table.columnNames.value]]].concat(t),r=p(n);e?e(r):ce({csvContent:r,title:K.value.title.text||`vue-ui-circle-pack`})})}let ar=v(()=>{let e=[U.value.table.columnNames.datapoint,U.value.table.columnNames.parent,U.value.table.columnNames.depth,U.value.table.columnNames.value];return{colNames:e,head:e,body:nr.value.map(e=>{let t=f({p:W.value.value.prefix,v:e.value,s:W.value.value.suffix,r:W.value.value.rounding});return[{color:e.color,name:`${` `.repeat(e.depth)}${e.name}`},e.parentName??``,e.depth??0,t]}),config:{th:{backgroundColor:U.value.table.th.backgroundColor,color:U.value.table.th.color,outline:U.value.table.th.outline},td:{backgroundColor:U.value.table.td.backgroundColor,color:U.value.table.td.color,outline:U.value.table.td.outline},breakpoint:U.value.table.responsiveBreakpoint}}});function or(){Y.value.showTable=!Y.value.showTable}function sr(){Y.value.showTooltip=!Y.value.showTooltip}function cr(){Y.value.showZoom=!Y.value.showZoom}function lr(){return bn.value}let ur=u(R,()=>K.value.title.text),dr=v(()=>l({config:U,style:K,mutableConfig:Y,dialog:$e,accordion:Je,isFullscreen:Pn,parent:R,maxWidth:500,isCursorPointer:Ft}));P(()=>Y.value.showTable,e=>c(e,U,kt));function fr(){Y.value.showTable=!1,At.value&&At.value.setTableIconState(!1)}let pr=v(()=>K.value.backgroundColor),mr=v(()=>K.value.title),{isCallbackImaging:hr,isCallbackSvg:gr,generateSvg:_r,onGenerateImage:vr}=xe({svg:J,title:mr,legend:null,legendItems:null,backgroundColor:pr,getSvgCallback:()=>U.value.userOptions.callbacks.svg,generateImage:qt});async function yr(){et(`copyAlt`,{config:U.value,dataset:bn.value,flattenedDataset:Z.value}),U.value.userOptions.callbacks.altCopy?await Promise.resolve(U.value.userOptions.callbacks.altCopy({config:U.value,dataset:bn.value,flattenedDataset:Z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function br(e){if(!Number.isFinite(e)||!J.value)return;let t=Z.value[e];if(!t)return;let n=fe(t.x,t.y,J.value);n&&(Nt.value=n)}function xr(){z.value=null,V.value=null,H.value=`pointer`,jt.value=!1}function Sr(){if(V.value!==null){let e=Z.value[V.value];e&&Cn(e,V.value)}V.value=null,H.value=`pointer`,jt.value=!1,z.value=null}function Cr(){V.value=null,Pt.value=!0}function wr(){Sr(),Pt.value=!1}function Tr(e,t){let n=Z.value.length;return n?e===null||e<0||e>=n?t===`next`?0:n-1:t===`previous`?(e-1+n)%n:(e+1)%n:null}function Er(e){if(!J.value||In.value||document.activeElement!==J.value||!Z.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){Sr();return}if(r){if(V.value===null)return;let e=Z.value[V.value];if(!e)return;wn(e,V.value);return}let a=V.value;a===null||a<0||a>=Z.value.length?a=n?0:Z.value.length-1:n?a=Tr(a,`next`):t&&(a=Tr(a,`previous`));let o=Z.value[a];o&&(V.value=a,br(a),Dn(o,a,`keyboard`))}let Dr=v(()=>({headers:ar.value?.colNames??[],rows:ar.value?.body?.map(e=>[e[0]?.name??``,...e.slice(1)])??[]})),Or=v(()=>K.value.color);function kr(e){return e.map(({id:e,r:t,children:n})=>({id:e,r:t,children:kr(n)}))}let Ar=v(()=>JSON.stringify(kr(bn.value)));P([Ar,Zt,Qt],()=>{U.value.responsive?on?.():un(Zt.value,Qt.value)},{flush:`post`}),P(()=>U.value.responsive,vn,{flush:`post`}),P([K,()=>U.value.style.fontFamily],()=>on?.(),{flush:`post`}),P([Z,()=>K.value.parentTooltips,W],ln,{deep:!0,flush:`post`}),P(Lt,e=>{e&&xr()}),P(Z,e=>{if(!z.value)return;let t=e.findIndex(e=>e.id===z.value);t<0?(z.value=null,V.value=null,jt.value=!1):(H.value===`keyboard`&&br(t),Dn(e[t],t,H.value,!1))}),je({getData:lr,getImage:ur,generateCsv:ir,generatePdf:Kt,generateImage:qt,generateSvg:_r,toggleTable:or,toggleAnnotator:Ln,toggleFullscreen:Fn,copyAlt:yr,toggleZoom:cr,resetZoom:zn});let jr=v(()=>s(U.value.userOptions?.annotator?.followZoom,$.value));return(e,s)=>(O(),x(`div`,{id:`vue-ui-circle-pack_${L.value}`,class:E(`vue-data-ui-component vue-ui-circle-pack ${Pn.value?`vue-data-ui-wrapper-fullscreen`:``} ${N(Lt)?`loading`:``}`),ref_key:`circlePackChart`,ref:R,style:Ie(`font-family:${U.value.style.fontFamily};text-align:center;background:${K.value.backgroundColor};`),onMouseenter:s[2]||=()=>N(Bt)(!0),onMouseleave:s[3]||=()=>N(Bt)(!1)},[S(`div`,{id:`chart-instructions-${L.value}`,class:`sr-only`},[S(`p`,null,M(U.value.a11y.translations.keyboardNavigation),1)],8,it),U.value.a11y.includeTable&&Dr.value?.rows?.length?(O(),y(ke,{key:0,uid:L.value,head:Dr.value.headers,body:Dr.value.rows,notice:U.value.a11y.translations.tableAvailable,caption:U.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):b(``,!0),U.value.userOptions.buttons.annotator?(O(),y(N(Ze),T({key:1},N(a)(U.value.userOptions.annotator),{svgRef:N(J),followZoom:U.value.userOptions?.annotator?.followZoom,annotationViewport:jr.value,backgroundColor:K.value.backgroundColor,color:K.value.color,active:In.value,isCursorPointer:Ft.value,palette:U.value.userOptions.annotatorPalette,onClose:Ln}),Me({_:2},[A(N(o),t=>({name:t,fn:F(n=>[j(e.$slots,t,D(w(N(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):b(``,!0),j(e.$slots,`userConfig`,{},void 0,!0),Jt.value?(O(),x(`div`,{key:2,ref_key:`noTitle`,ref:wt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):b(``,!0),K.value.title.text?(O(),x(`div`,{key:3,ref_key:`chartTitle`,ref:Ct,style:`width:100%;background:transparent;padding-bottom:12px`},[(O(),y(Te,{key:`title_${Tt.value}`,config:{title:{cy:`donut-div-title`,...K.value.title},subtitle:{cy:`donut-div-subtitle`,...K.value.title.subtitle}}},null,8,[`config`]))],512)):b(``,!0),U.value.userOptions.show&&nt.value&&(N(Vt)||N(zt))?(O(),y(N(Xe),T({ref_key:`userOptionsRef`,ref:At,key:`user_option_${Dt.value}`,backgroundColor:K.value.backgroundColor,color:K.value.color,isPrinting:N(Wt),isImaging:N(Gt),uid:L.value,hasTooltip:U.value.userOptions.buttons.tooltip,isTooltip:Y.value.showTooltip,hasLabel:!1,isFullscreen:Pn.value,chartElement:R.value},N(n)(U.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator zoom`),{isAnnotation:In.value,tableDialog:U.value.table.useDialog,isCursorPointer:Ft.value,isZoom:Y.value.showZoom,onToggleFullscreen:Fn,onGeneratePdf:N(Kt),onGenerateCsv:ir,onGenerateImage:N(vr),onGenerateSvg:N(_r),onToggleTable:or,onToggleTooltip:sr,onToggleAnnotator:Ln,onToggleZoom:cr,onCopyAlt:yr,style:{visibility:N(Vt)?N(zt)?`visible`:`hidden`:`visible`}}),Me({_:2},[A(N(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:F(n=>[j(e.$slots,t,D(w(N(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`isZoom`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):b(``,!0),S(`div`,{class:E({"vue-ui-circle-pack-svg-container":!0,"not-responsive":!U.value.responsive})},[(O(),x(`svg`,{ref_key:`svgRef`,ref:J,xmlns:N(de),"aria-describedby":`chart-instructions-${L.value}`,viewBox:`${N($).x} ${N($).y} ${N($).width} ${N($).height}`,preserveAspectRatio:`xMidYMid meet`,class:E({"vue-data-ui-fullscreen--on":Pn.value,"vue-data-ui-fulscreen--off":!Pn.value,"not-responsive":!U.value.responsive,"vue-data-ui-no-transition":!N(q)}),style:Ie(`display:block;${U.value.responsive?`width:100%;height:auto`:`height:100%;`};overflow:${Y.value.showZoom?`hidden`:`visible`};background:transparent;color:${K.value.color};background:${K.value.backgroundColor};`),tabindex:`0`,onFocus:Cr,onBlur:wr,onKeydown:Er},[Pe(N(Qe)),j(e.$slots,`svg-underlayer`,{svg:{drawingArea:{...N($)},width:X.value.w,height:X.value.h,isPrintingImg:N(Wt)||N(Gt)||N(hr),isPrintingSvg:N(gr)}},void 0,!0),e.$slots[`chart-background`]?(O(),x(`foreignObject`,{key:0,x:N($).x,y:N($).y,width:X.value.w,height:X.value.h,style:{pointerEvents:`none`}},[j(e.$slots,`chart-background`,{},void 0,!0)],8,ot)):b(``,!0),(O(!0),x(_,null,A(Z.value,(t,n)=>(O(),x(_,{key:t.id},[S(`defs`,null,[Pe(Ae,{t:`radial`,id:t.id,fy:`30%`,stops:[[`10%`,N(h)(t.color,G.value.gradient.intensity/100),1],[`90%`,N(ee)(t.color,.1),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),e.$slots.pattern?(O(),x(`g`,st,[S(`defs`,null,[j(e.$slots,`pattern`,T({ref_for:!0},{...t,patternId:`pattern_${L.value}_${t.id}`}),void 0,!0)])])):b(``,!0),S(`rect`,T({class:{"vue-data-ui-transition":N(q)}},{ref_for:!0},Nn(t),{stroke:G.value.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":G.value.strokeWidth*(xn.value||1)/100,fill:G.value.gradient.show?`url(#${t.id})`:t.color,rx:t.r,onMouseenter:e=>Dn(t,n,`pointer`),onMouseout:e=>Cn(t,n),onClick:e=>wn(t,n)}),null,16,ct),e.$slots.pattern?(O(),x(`rect`,T({key:1,class:{"vue-data-ui-transition":N(q)}},{ref_for:!0},Nn(t),{stroke:G.value.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":G.value.strokeWidth*(xn.value||1)/100,fill:`url(#pattern_${L.value}_${t.id})`,rx:t.r,style:{pointerEvents:`none`}}),null,16,lt)):b(``,!0)],64))),128)),(O(!0),x(_,null,A(Z.value,(e,t)=>(O(),x(_,{key:e.id},[e.hasChildren?b(``,!0):(O(),x(`rect`,T({key:0,class:{"vue-data-ui-transition":N(q)}},{ref_for:!0},Nn(e),{stroke:`none`,fill:B.value&&B.value.id===e.id?G.value.gradient.show?`url(#${e.id})`:e.color:`transparent`,rx:e.r,style:{filter:B.value&&B.value.id===e.id?`drop-shadow(0px 0px 6px ${G.value.selectedShadowColor})`:`none`,opacity:+!!B.value,pointerEvents:`none`}}),null,16,ut))],64))),128)),(O(!0),x(_,null,A(Z.value,(t,n)=>(O(),x(_,{key:`cl_${t.id}`},[e.$slots[`data-label`]&&hn(t)?j(e.$slots,`data-label`,T({ref_for:!0},{...t,createTSpans:N(le),fontSize:{name:t.r/3*W.value.name.fontSizeRatio,value:jn(t)*W.value.value.fontSizeRatio},color:Mn(t)}),void 0,!0,0):(O(),x(_,{key:1},[W.value.name.show&&t.name&&hn(t)?(O(),x(`text`,{key:0,style:{pointerEvents:`none`},class:E({"vue-data-ui-transition":N(q)}),transform:`translate(${t.x}, ${t.y+Sn(t.r,W.value.name.offsetY)-t.r/10})`,"font-size":t.r/3*W.value.name.fontSizeRatio,fill:Mn(t),"font-weight":W.value.name.bold?`bold`:`normal`,"text-anchor":`middle`},M(t.name),11,dt)):b(``,!0),W.value.value.show&&hn(t)?(O(),x(`text`,{key:1,class:E({"vue-data-ui-transition":N(q)}),style:{pointerEvents:`none`,transition:`opacity 0.2s ease-in-out`},transform:`translate(${t.x}, ${t.y+Sn(t.r,W.value.value.offsetY)+t.r/2.5})`,"font-size":jn(t)*W.value.value.fontSizeRatio,fill:W.value.value.color===`auto`?N(ue)(t.color):W.value.value.color,"font-weight":W.value.value.bold?`bold`:`normal`,"text-anchor":`middle`},M(An(t)),11,ft)):b(``,!0)],64)),j(e.$slots,`circle`,T({ref_for:!0},{...t,showLabel:hn(t),isSelected:B.value?.id===t.id,isDescendantOfSelected:mn(t,B.value),uid:`${n}_${L.value}`}),void 0,!0)],64))),128)),$n.value.length&&K.value.parentTooltips.show?(O(),x(`g`,pt,[(O(!0),x(_,null,A($n.value,t=>(O(),x(`g`,{key:`tltp_${t.id}`},[S(`path`,{class:E({"vue-data-ui-transition":N(q)}),stroke:K.value.parentTooltips.link.useSerieColor?t.color:K.value.parentTooltips.link.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":K.value.parentTooltips.link.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":K.value.parentTooltips.link.strokeDasharray,opacity:K.value.parentTooltips.link.opacity,d:`M${t.anchorX}, ${t.anchorY} ${t.lineX}, ${t.lineY}`},null,10,mt),S(`rect`,{class:E({"vue-data-ui-transition":N(q)}),x:t.x,y:t.y,width:t.width,height:t.height,rx:Math.max(3*t.scale,t.fontSize/2.5)*K.value.parentTooltips.borderRadiusRatio,ry:Math.max(3*t.scale,t.fontSize/2.5)*K.value.parentTooltips.borderRadiusRatio,fill:K.value.parentTooltips.backgroundColor,stroke:K.value.parentTooltips.useSerieColor?t.color:K.value.parentTooltips.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":K.value.parentTooltips.strokeWidth,filter:K.value.parentTooltips.filter},null,10,ht),j(e.$slots,`parent-tooltip`,T({ref_for:!0},{...t}),()=>[S(`rect`,{class:E({"vue-data-ui-transition":N(q)}),fill:t.color,x:t.x+t.paddingX*1.3-t.fontSize*.35,y:t.y+t.paddingY+t.lineHeight/2-t.fontSize*.35,rx:t.fontSize*.35,width:t.fontSize*.7,height:t.fontSize*.7},null,10,gt),S(`text`,{class:E({"vue-data-ui-transition":N(q)}),transform:`translate(${t.x+t.paddingX+t.fontSize}, ${t.y+t.paddingY+t.fontSize})`,"font-size":t.fontSize,fill:K.value.parentTooltips.color,"font-family":U.value.style.fontFamily,"text-anchor":`start`},[(O(!0),x(_,null,A(t.lines,(e,n)=>(O(),x(`tspan`,{key:`${t.id}_${n}`,x:0,dy:n===0?0:t.lineHeight},M(e),9,vt))),128))],10,_t)],!0)]))),128))])):b(``,!0),j(e.$slots,`svg`,{svg:{drawingArea:{...N($)},width:X.value.w,height:X.value.h,isPrintingImg:N(Wt)||N(Gt)||N(hr),isPrintingSvg:N(gr)}},void 0,!0)],46,at)),e.$slots.hint?(O(),x(`div`,yt,[j(e.$slots,`hint`,D(w({hint:U.value.a11y.translations.keyboardNavigation,isVisible:Pt.value})),void 0,!0)])):b(``,!0)],2),e.$slots.watermark?(O(),x(`div`,bt,[j(e.$slots,`watermark`,D(w({isPrinting:N(Wt)||N(Gt)||N(hr)||N(gr)})),void 0,!0)])):b(``,!0),N(Bn)?(O(),x(`div`,xt,[j(e.$slots,`reset-action`,{reset:N(zn)},()=>[S(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:Ie({background:K.value.backgroundColor,cursor:Ft.value?`pointer`:`default`}),onClick:s[0]||=e=>N(zn)(!0)},[Pe(N(qe),{name:`refresh`,stroke:K.value.color},null,8,[`stroke`])],4)],!0)])):b(``,!0),e.$slots.source?(O(),x(`div`,{key:7,ref_key:`source`,ref:Ot,dir:`auto`},[j(e.$slots,`source`,{},void 0,!0)],512)):b(``,!0),Pe(N(Ke),{teleportTo:K.value.tooltip.teleportTo,show:Y.value.showTooltip&&jt.value,backgroundColor:K.value.tooltip.backgroundColor,color:K.value.tooltip.color,fontSize:K.value.tooltip.fontSize,borderRadius:K.value.tooltip.borderRadius,borderColor:K.value.tooltip.borderColor,borderWidth:K.value.tooltip.borderWidth,backgroundOpacity:K.value.tooltip.backgroundOpacity,position:K.value.tooltip.position,offsetX:K.value.tooltip.offsetX,offsetY:K.value.tooltip.offsetY,parent:R.value,content:Mt.value,isCustom:En.value,isFullscreen:Pn.value,smooth:K.value.tooltip.smooth,backdropFilter:K.value.tooltip.backdropFilter,smoothForce:K.value.tooltip.smoothForce,smoothSnapThreshold:K.value.tooltip.smoothSnapThreshold,isA11yMode:H.value===`keyboard`,a11yPosition:Nt.value},{"tooltip-before":F(()=>[j(e.$slots,`tooltip-before`,D(w({...Tn.value})),void 0,!0)]),tooltip:F(()=>[j(e.$slots,`tooltip`,D(w({...Tn.value})),void 0,!0)]),"tooltip-after":F(()=>[j(e.$slots,`tooltip-after`,D(w({...Tn.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`]),nt.value&&U.value.userOptions.buttons.table?(O(),y(ze(dr.value.component),T({key:8},dr.value.props,{ref_key:`tableUnit`,ref:kt,onClose:fr}),Me({content:F(()=>[(O(),y(N(Ye),{key:`table_${Et.value}`,colNames:ar.value.colNames,head:ar.value.head,body:ar.value.body,config:ar.value.config,title:U.value.table.useDialog?``:dr.value.title,withCloseButton:!U.value.table.useDialog,isCursorPointer:Ft.value,onClose:fr},{th:F(({th:e})=>[S(`div`,St,M(e),1)]),td:F(({td:e})=>[Ne(M(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[U.value.table.useDialog?{name:`title`,fn:F(()=>[Ne(M(dr.value.title),1)]),key:`0`}:void 0,U.value.table.useDialog?{name:`actions`,fn:F(()=>[S(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[1]||=e=>ir(U.value.userOptions.callbacks.csv),style:Ie({cursor:Ft.value?`pointer`:`default`})},[Pe(N(qe),{name:`fileCsv`,stroke:dr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):b(``,!0),j(e.$slots,`skeleton`,{},()=>[N(Lt)?(O(),y(De,{key:0})):b(``,!0)],!0)],46,rt))}},[[`__scopeId`,`data-v-3b63dd6c`]]);export{nt as n,L as t};
|