vue-data-ui 3.28.11 → 3.28.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PackageVersion-ksOit8fp.js → PackageVersion-PdpqwkYX.js} +1 -1
- package/dist/{XyAnalysisOptions-CUtj1x2f.js → XyAnalysisOptions-DmKfwSu6.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/package-DWjs4THo.js +1 -0
- package/dist/{render-common-CPA2hfDW.js → render-common-C9aE_Va1.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/vue-data-ui-Da3HK_wb.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-Cs-_W1Av.js → vue-ui-3d-bar-D1XfKXhp.js} +1 -1
- package/dist/{vue-ui-age-pyramid-cWWVFoCj.js → vue-ui-age-pyramid-CJqqtEIh.js} +1 -1
- package/dist/{vue-ui-bullet-CMQzoLKs.js → vue-ui-bullet-CxyL5Bdm.js} +1 -1
- package/dist/{vue-ui-bump-SSu5eVbF.js → vue-ui-bump-BWWMzAN_.js} +1 -1
- package/dist/{vue-ui-candlestick-Cm9jS3n7.js → vue-ui-candlestick-CQXdyPEt.js} +1 -1
- package/dist/{vue-ui-carousel-table-D-F54W90.js → vue-ui-carousel-table-DwsfnL_l.js} +1 -1
- package/dist/{vue-ui-chestnut-DNe1s8TT.js → vue-ui-chestnut-DV7XKL7g.js} +1 -1
- package/dist/{vue-ui-chord-DGzpBpuI.js → vue-ui-chord-DRNn_E6i.js} +1 -1
- package/dist/{vue-ui-circle-pack--iJQtXys.js → vue-ui-circle-pack-BcA9ZxZS.js} +1 -1
- package/dist/{vue-ui-cursor-B7DJRSGD.js → vue-ui-cursor-DSgVvP1L.js} +1 -1
- package/dist/{vue-ui-dag-tsM65e_V.js → vue-ui-dag-CWpyU7AJ.js} +1 -1
- package/dist/{vue-ui-dashboard-CC7IhQZu.js → vue-ui-dashboard-Dh_Zi8oG.js} +1 -1
- package/dist/{vue-ui-digits-hv2QeC-H.js → vue-ui-digits-Cy3Y6qro.js} +1 -1
- package/dist/{vue-ui-donut-iyVVIGoJ.js → vue-ui-donut-BqnLIKwZ.js} +1 -1
- package/dist/vue-ui-donut-DasGeYdl.js +47 -0
- package/dist/{vue-ui-donut-evolution-Wz_-FYab.js → vue-ui-donut-evolution-Bw7ilDYR.js} +1 -1
- package/dist/{vue-ui-dumbbell-p3Q2LkBV.js → vue-ui-dumbbell-BPvvKhag.js} +1 -1
- package/dist/{vue-ui-flow-BCH8YU8H.js → vue-ui-flow-XI5Y3qdk.js} +1 -1
- package/dist/{vue-ui-funnel-DdrBD9oX.js → vue-ui-funnel-DqoQogQE.js} +1 -1
- package/dist/{vue-ui-galaxy-DYKEOEL-.js → vue-ui-galaxy-NRaBIHpn.js} +1 -1
- package/dist/{vue-ui-gauge-CPgvR_YB.js → vue-ui-gauge-DX4SBIKS.js} +1 -1
- package/dist/{vue-ui-geo-DhJ3Wr_5.js → vue-ui-geo-C3e4J_kw.js} +1 -1
- package/dist/{vue-ui-gizmo-BTy4Vr1e.js → vue-ui-gizmo-C9ls2b4h.js} +1 -1
- package/dist/{vue-ui-graph-C4kfE4G8.js → vue-ui-graph-CBkbFJIA.js} +1 -1
- package/dist/{vue-ui-heatmap-lti43RhW.js → vue-ui-heatmap-D6KP1N8f.js} +1 -1
- package/dist/{vue-ui-hill-3GVfKQmi.js → vue-ui-hill-8c-9u8eg.js} +1 -1
- package/dist/{vue-ui-history-plot-DMTPygZA.js → vue-ui-history-plot-CowxWkEd.js} +1 -1
- package/dist/{vue-ui-horizontal-bar-DwWo0CvX.js → vue-ui-horizontal-bar-CVP5jBNJ.js} +1 -1
- package/dist/{vue-ui-kpi-BTMK37Ix.js → vue-ui-kpi-D1MUlURM.js} +1 -1
- package/dist/{vue-ui-molecule-rbDnRA7c.js → vue-ui-molecule-BRB54XBD.js} +1 -1
- package/dist/{vue-ui-mood-radar-8s1jnO3P.js → vue-ui-mood-radar-CkHJdUyF.js} +1 -1
- package/dist/{vue-ui-nested-donuts-8bY4HvC-.js → vue-ui-nested-donuts-C-7VZO11.js} +1 -1
- package/dist/{vue-ui-onion-CgLNDFrZ.js → vue-ui-onion-erpKpDKg.js} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-ms14eLus.js → vue-ui-parallel-coordinate-plot-BDg0pRkN.js} +1 -1
- package/dist/{vue-ui-quadrant-6GgQZ8fW.js → vue-ui-quadrant-CUdNxC6W.js} +1 -1
- package/dist/{vue-ui-quick-chart-CzRbFXIS.js → vue-ui-quick-chart-DE5Zwioe.js} +1 -1
- package/dist/{vue-ui-radar-BxsD2JBj.js → vue-ui-radar-6y6er9ND.js} +1 -1
- package/dist/{vue-ui-relation-circle-BFPAlaWQ.js → vue-ui-relation-circle-CjnG9G7s.js} +1 -1
- package/dist/{vue-ui-ridgeline-G2m7eFWe.js → vue-ui-ridgeline-B4qi2Ajl.js} +1 -1
- package/dist/{vue-ui-rings-l_BLWL48.js → vue-ui-rings-EYfCkNB6.js} +1 -1
- package/dist/{vue-ui-scatter-C4hXe3DM.js → vue-ui-scatter-Tw-5uRac.js} +1 -1
- package/dist/{vue-ui-skeleton-BLyh-ESb.js → vue-ui-skeleton-CZMyXM-1.js} +1 -1
- package/dist/{vue-ui-spark-trend-D0hz9kNt.js → vue-ui-spark-trend-Cmj4aWcQ.js} +1 -1
- package/dist/{vue-ui-sparkbar-Dweyr8h-.js → vue-ui-sparkbar-Crq1Vui3.js} +1 -1
- package/dist/{vue-ui-sparkgauge-DQfCXKFj.js → vue-ui-sparkgauge-CN_9yenn.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-DOfAu86W.js → vue-ui-sparkhistogram-CK7JmyCw.js} +1 -1
- package/dist/{vue-ui-sparkline-DuX09S8A.js → vue-ui-sparkline-2_RlGrAT.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-vXOpiyrI.js → vue-ui-sparkstackbar-Dwdn2_9q.js} +1 -1
- package/dist/{vue-ui-stackbar-DsrwNY0p.js → vue-ui-stackbar-BVmQJn2b.js} +1 -1
- package/dist/{vue-ui-stackline-e7EYZet7.js → vue-ui-stackline-nvhui30B.js} +1 -1
- package/dist/{vue-ui-strip-plot-2DxzeUXU.js → vue-ui-strip-plot-Dig2RljR.js} +1 -1
- package/dist/{vue-ui-table-B344jLaG.js → vue-ui-table-_qSw3iGd.js} +1 -1
- package/dist/{vue-ui-table-sparkline-itq8yRCe.js → vue-ui-table-sparkline-39sKOqcp.js} +1 -1
- package/dist/{vue-ui-thermometer-BSRjS7l3.js → vue-ui-thermometer-CoVrrzHW.js} +1 -1
- package/dist/{vue-ui-timer-DM-urc2D.js → vue-ui-timer-DoR5PqOa.js} +1 -1
- package/dist/{vue-ui-tiremarks-CbIOAO3F.js → vue-ui-tiremarks-9tPPNGiq.js} +1 -1
- package/dist/{vue-ui-treemap-Cgal4H5O.js → vue-ui-treemap-D3mZkT4P.js} +1 -1
- package/dist/{vue-ui-waffle-BZFI7JLd.js → vue-ui-waffle-D2GfM_Se.js} +1 -1
- package/dist/{vue-ui-wheel-DdKm_Vd8.js → vue-ui-wheel-CYBaqHm6.js} +1 -1
- package/dist/{vue-ui-word-cloud-D40vUb5e.js → vue-ui-word-cloud-ClGL6iKL.js} +1 -1
- package/dist/{vue-ui-world-BseI3A0C.js → vue-ui-world-Dm7LSNB2.js} +1 -1
- package/dist/{vue-ui-xy-Bl-DUFcf.js → vue-ui-xy-2VCMSzeE.js} +2 -2
- package/dist/{vue-ui-xy-DNVd3FPA.js → vue-ui-xy-DUlJcC9R.js} +1 -1
- package/package.json +1 -1
- package/dist/package-vXTjpYqq.js +0 -1
- package/dist/vue-data-ui-0NKIVNqt.js +0 -1
- package/dist/vue-ui-donut-B9WXaiPn.js +0 -47
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./BaseIcon-CoY0vuL3.js";import{computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createSlots as s,createTextVNode as c,defineAsyncComponent as l,guardReactiveProps as u,mergeProps as d,normalizeProps as f,normalizeStyle as p,onMounted as m,openBlock as h,ref as g,renderList as _,renderSlot as v,resolveDynamicComponent as y,toDisplayString as b,useAttrs as x,watch as S,withCtx as C}from"vue";var w=/* @__PURE__ */ e({default:()=>E}),T={style:{width:`36px`}},E=/*@__PURE__*/ Object.assign({inheritAttrs:!1},{__name:`vue-data-ui`,props:{component:{type:String},dataset:{type:[Object,Array,Number,String]},config:{type:Object}},setup(e,{expose:w}){let E=e,D=x(),O={VueUiGraph:l(()=>import(`./vue-ui-graph-CBkbFJIA.js`).then(e=>e.n)),VueUi3dBar:l(()=>import(`./vue-ui-3d-bar-D1XfKXhp.js`).then(e=>e.n)),VueUiAgePyramid:l(()=>import(`./vue-ui-age-pyramid-CJqqtEIh.js`).then(e=>e.n)),VueUiAnnotator:l(()=>import(`./vue-ui-annotator-D31LD4-s.js`).then(e=>e.n)),VueUiCandlestick:l(()=>import(`./vue-ui-candlestick-CQXdyPEt.js`).then(e=>e.n)),VueUiChestnut:l(()=>import(`./vue-ui-chestnut-DV7XKL7g.js`).then(e=>e.n)),VueUiDashboard:l(()=>import(`./vue-ui-dashboard-Dh_Zi8oG.js`).then(e=>e.n)),VueUiDigits:l(()=>import(`./vue-ui-digits-Cy3Y6qro.js`).then(e=>e.n)),VueUiDonut:l(()=>import(`./vue-ui-donut-DasGeYdl.js`).then(e=>e.n)),VueUiDonutEvolution:l(()=>import(`./vue-ui-donut-evolution-Bw7ilDYR.js`).then(e=>e.n)),VueUiGalaxy:l(()=>import(`./vue-ui-galaxy-NRaBIHpn.js`).then(e=>e.n)),VueUiGauge:l(()=>import(`./vue-ui-gauge-DX4SBIKS.js`).then(e=>e.n)),VueUiHeatmap:l(()=>import(`./vue-ui-heatmap-D6KP1N8f.js`).then(e=>e.n)),VueUiKpi:l(()=>import(`./vue-ui-kpi-D1MUlURM.js`).then(e=>e.n)),VueUiMiniLoader:l(()=>import(`./vue-ui-mini-loader-PsWZLMLF.js`).then(e=>e.n)),VueUiMolecule:l(()=>import(`./vue-ui-molecule-BRB54XBD.js`).then(e=>e.n)),VueUiMoodRadar:l(()=>import(`./vue-ui-mood-radar-CkHJdUyF.js`).then(e=>e.n)),VueUiNestedDonuts:l(()=>import(`./vue-ui-nested-donuts-C-7VZO11.js`).then(e=>e.n)),VueUiOnion:l(()=>import(`./vue-ui-onion-erpKpDKg.js`).then(e=>e.n)),VueUiQuadrant:l(()=>import(`./vue-ui-quadrant-CUdNxC6W.js`).then(e=>e.n)),VueUiRadar:l(()=>import(`./vue-ui-radar-6y6er9ND.js`).then(e=>e.n)),VueUiRating:l(()=>import(`./vue-ui-rating-D0QvpD3V.js`).then(e=>e.n)),VueUiRelationCircle:l(()=>import(`./vue-ui-relation-circle-CjnG9G7s.js`).then(e=>e.n)),VueUiRings:l(()=>import(`./vue-ui-rings-EYfCkNB6.js`).then(e=>e.n)),VueUiScatter:l(()=>import(`./vue-ui-scatter-Tw-5uRac.js`).then(e=>e.n)),VueUiSkeleton:l(()=>import(`./vue-ui-skeleton-CZMyXM-1.js`).then(e=>e.n)),VueUiSmiley:l(()=>import(`./vue-ui-smiley-C00q-teB.js`).then(e=>e.n)),VueUiSparkbar:l(()=>import(`./vue-ui-sparkbar-Crq1Vui3.js`).then(e=>e.n)),VueUiSparkgauge:l(()=>import(`./vue-ui-sparkgauge-CN_9yenn.js`).then(e=>e.n)),VueUiSparkHistogram:l(()=>import(`./vue-ui-sparkhistogram-CK7JmyCw.js`).then(e=>e.n)),VueUiSparkline:l(()=>import(`./vue-ui-sparkline-2_RlGrAT.js`).then(e=>e.n)),VueUiSparkStackbar:l(()=>import(`./vue-ui-sparkstackbar-Dwdn2_9q.js`).then(e=>e.n)),VueUiTable:l(()=>import(`./vue-ui-table-_qSw3iGd.js`).then(e=>e.n)),VueUiTableSparkline:l(()=>import(`./vue-ui-table-sparkline-39sKOqcp.js`).then(e=>e.n)),VueUiThermometer:l(()=>import(`./vue-ui-thermometer-CoVrrzHW.js`).then(e=>e.n)),VueUiTiremarks:l(()=>import(`./vue-ui-tiremarks-9tPPNGiq.js`).then(e=>e.n)),VueUiTreemap:l(()=>import(`./vue-ui-treemap-D3mZkT4P.js`).then(e=>e.n)),VueUiVerticalBar:l(()=>import(`./vue-ui-horizontal-bar-CVP5jBNJ.js`).then(e=>e.n)),VueUiHorizontalBar:l(()=>import(`./vue-ui-horizontal-bar-CVP5jBNJ.js`).then(e=>e.n)),VueUiWaffle:l(()=>import(`./vue-ui-waffle-D2GfM_Se.js`).then(e=>e.n)),VueUiWheel:l(()=>import(`./vue-ui-wheel-CYBaqHm6.js`).then(e=>e.n)),VueUiXy:l(()=>import(`./vue-ui-xy-2VCMSzeE.js`).then(e=>e.n)),VueUiTableHeatmap:l(()=>import(`./vue-ui-table-heatmap-BwoRcqFD.js`).then(e=>e.n)),VueUiAccordion:l(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),VueUiQuickChart:l(()=>import(`./vue-ui-quick-chart-DE5Zwioe.js`).then(e=>e.n)),VueUiCursor:l(()=>import(`./vue-ui-cursor-DSgVvP1L.js`).then(e=>e.n)),VueUiSparkTrend:l(()=>import(`./vue-ui-spark-trend-Cmj4aWcQ.js`).then(e=>e.n)),VueUiStripPlot:l(()=>import(`./vue-ui-strip-plot-Dig2RljR.js`).then(e=>e.n)),VueUiDumbbell:l(()=>import(`./vue-ui-dumbbell-BPvvKhag.js`).then(e=>e.n)),VueUiWordCloud:l(()=>import(`./vue-ui-word-cloud-ClGL6iKL.js`).then(e=>e.n)),VueUiXyCanvas:l(()=>import(`./vue-ui-xy-canvas-CRSisgSA.js`).then(e=>e.n)),VueUiFlow:l(()=>import(`./vue-ui-flow-XI5Y3qdk.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:l(()=>import(`./vue-ui-parallel-coordinate-plot-BDg0pRkN.js`).then(e=>e.n)),VueUiTimer:l(()=>import(`./vue-ui-timer-DoR5PqOa.js`).then(e=>e.n)),VueUiCarouselTable:l(()=>import(`./vue-ui-carousel-table-DwsfnL_l.js`).then(e=>e.n)),VueUiGizmo:l(()=>import(`./vue-ui-gizmo-C9ls2b4h.js`).then(e=>e.n)),VueUiStackbar:l(()=>import(`./vue-ui-stackbar-BVmQJn2b.js`).then(e=>e.n)),VueUiStackline:l(()=>import(`./vue-ui-stackline-nvhui30B.js`).then(e=>e.n)),VueUiBullet:l(()=>import(`./vue-ui-bullet-CxyL5Bdm.js`).then(e=>e.n)),VueUiFunnel:l(()=>import(`./vue-ui-funnel-DqoQogQE.js`).then(e=>e.n)),VueUiHistoryPlot:l(()=>import(`./vue-ui-history-plot-CowxWkEd.js`).then(e=>e.n)),VueUiCirclePack:l(()=>import(`./vue-ui-circle-pack-BcA9ZxZS.js`).then(e=>e.n)),VueUiWorld:l(()=>import(`./vue-ui-world-Dm7LSNB2.js`).then(e=>e.n)),VueUiRidgeline:l(()=>import(`./vue-ui-ridgeline-B4qi2Ajl.js`).then(e=>e.n)),VueUiChord:l(()=>import(`./vue-ui-chord-DRNn_E6i.js`).then(e=>e.n)),VueUiDag:l(()=>import(`./vue-ui-dag-CWpyU7AJ.js`).then(e=>e.n)),VueUiGeo:l(()=>import(`./vue-ui-geo-C3e4J_kw.js`).then(e=>e.n)),VueUiBump:l(()=>import(`./vue-ui-bump-BWWMzAN_.js`).then(e=>e.n)),VueUiHill:l(()=>import(`./vue-ui-hill-8c-9u8eg.js`).then(e=>e.n)),VueUiLabel:l(()=>import(`./vue-ui-label-CBrMoFDG.js`).then(e=>e.n))},k=/* @__PURE__ */ new Set([`VueUiMiniLoader`,`VueUiSkeleton`,`VueUiAccordion`,`VueUiCursor`,`VueUiTimer`]),A=/* @__PURE__ */ `fitToView.focusNode.resetLayout.autoSize.cancel.close.copyAlt.focusLocation.generateCsv.generateImage.generatePdf.generateSvg.getItemsPositions.hideSeries.lap.pause.pauseAnimation.recalculateHeight.reset.resetZoom.restart.restoreOrder.resumeAnimation.save.selectGroup.selectNode.selectRibbon.setZoomState.shoot.showSeries.start.switchOrientation.toggleAnimation.toggleAnnotator.toggleLabels.toggleLock.toggleReadonly.toggleSort.toggleStack.toggleTable.toggleFullscreen.toggleTooltip.toggleZoom.zoomIn.zoomOut`.split(`.`),j=g(null),M=n(()=>!O[E.component]),N=n(()=>O[E.component]||null);function P(){let e={...D,config:E.config};return k.has(E.component)||(e.dataset=E.dataset),e}let F=[];function I(e,t){return new Promise((n,r)=>{F.push({method:e,args:t,resolve:n,reject:r})})}function L(e){return/* @__PURE__ */ Error(`Method "${e}" not found on ${E.component}`)}function R(e,t){let n=j.value;if(!n)return null;let r=n[e];return typeof r==`function`?r.apply(n,t):null}function z(e,t){let n=j.value;if(!n)return I(e,t);let r=n[e];return typeof r==`function`?r.apply(n,t):Promise.reject(L(e))}S(j,e=>{if(e)for(;F.length;){let{method:t,args:n,resolve:r,reject:i}=F.shift(),a=e[t];typeof a==`function`?Promise.resolve().then(()=>a.apply(e,n)).then(r).catch(i):i(L(t))}}),w({getData(...e){return z(`getData`,e)},getImage(e={}){let{scale:t=2}=e;return z(`getImage`,[{scale:t}])},...Object.fromEntries(A.map(e=>[e,(...t)=>R(e,t)]))}),m(()=>{M.value&&console.error(`\n\nVue Data UI exception:\nThe provided component "${E.component}" does not exist. Check the spelling.\n\nAvailable components:\n\n${Object.keys(O).map(e=>`. ${e}\n`).join(``)}`)});let B=n(()=>{let e=`The provided component ${E.component} does not exist.`;return[`VueUiIcon`,`VueUiPattern`,`Arrow`].includes(E.component)?(e=`${E.component} is not supported by the VueDataUi universal component. You must import it individually.`,console.warn(e),{status:`notSupported`,message:e}):(console.warn(e),{status:`unknown`,message:e})});return(e,n)=>M.value?(h(),a(`div`,{key:0,style:p({width:`100%`,display:`flex`,gap:`6px`,alignItems:`center`,color:B.value.status===`notSupported`?`#FF9000`:`#FF0000`})},[o(`div`,T,[B.value.status===`unknown`?(h(),r(t,{key:0,name:`moodFlat`,stroke:`#FF0000`})):i(``,!0),B.value.status===`notSupported`?(h(),r(t,{key:1,name:`circleExclamation`,stroke:`#FF9000`})):i(``,!0)]),c(` `+b(B.value.message),1)],4)):(h(),r(y(N.value),d({key:1,ref_key:`currentComponentRef`,ref:j},P()),s({_:2},[_(e.$slots,(t,n)=>({name:n,fn:C(t=>[v(e.$slots,n,f(u(t)))])}))]),1040))}});export{w as n,E as t};
|
package/dist/vue-data-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./vue-ui-graph-
|
|
1
|
+
import{t as e}from"./vue-ui-graph-CBkbFJIA.js";import{t}from"./vue-ui-xy-2VCMSzeE.js";import{t as ee}from"./Arrow-CITPKnWF.js";import{t as n}from"./vue-ui-3d-bar-D1XfKXhp.js";import{t as r}from"./vue-ui-accordion-DxGxf-Rm.js";import{t as i}from"./vue-ui-age-pyramid-CJqqtEIh.js";import{t as a}from"./vue-ui-annotator-D31LD4-s.js";import{t as o}from"./vue-ui-candlestick-CQXdyPEt.js";import{t as s}from"./vue-ui-chestnut-DV7XKL7g.js";import{t as c}from"./vue-ui-cursor-DSgVvP1L.js";import{t as l}from"./vue-ui-dashboard-Dh_Zi8oG.js";import{t as u}from"./vue-ui-digits-Cy3Y6qro.js";import{t as d}from"./vue-ui-donut-DasGeYdl.js";import{t as f}from"./vue-ui-donut-evolution-Bw7ilDYR.js";import{t as p}from"./vue-ui-dumbbell-BPvvKhag.js";import{t as m}from"./vue-ui-flow-XI5Y3qdk.js";import{t as h}from"./vue-ui-galaxy-NRaBIHpn.js";import{t as g}from"./vue-ui-gauge-DX4SBIKS.js";import{t as _}from"./vue-ui-heatmap-D6KP1N8f.js";import{t as v}from"./BaseIcon-CoY0vuL3.js";import{t as y}from"./vue-ui-kpi-D1MUlURM.js";import{t as b}from"./vue-ui-mini-loader-PsWZLMLF.js";import{t as x}from"./vue-ui-molecule-BRB54XBD.js";import{t as S}from"./vue-ui-mood-radar-CkHJdUyF.js";import{t as C}from"./vue-ui-nested-donuts-C-7VZO11.js";import{t as w}from"./vue-ui-onion-erpKpDKg.js";import{t as T}from"./vue-ui-parallel-coordinate-plot-BDg0pRkN.js";import{t as E}from"./vue-ui-quadrant-CUdNxC6W.js";import{t as D}from"./vue-ui-quick-chart-DE5Zwioe.js";import{t as O}from"./vue-ui-radar-6y6er9ND.js";import{t as k}from"./vue-ui-rating-D0QvpD3V.js";import{t as A}from"./vue-ui-relation-circle-CjnG9G7s.js";import{t as j}from"./vue-ui-rings-EYfCkNB6.js";import{t as M}from"./vue-ui-scatter-Tw-5uRac.js";import{t as N}from"./vue-ui-skeleton-CZMyXM-1.js";import{t as P}from"./vue-ui-smiley-C00q-teB.js";import{t as F}from"./vue-ui-sparkhistogram-CK7JmyCw.js";import{t as I}from"./vue-ui-sparkstackbar-Dwdn2_9q.js";import{t as L}from"./vue-ui-spark-trend-Cmj4aWcQ.js";import{t as R}from"./vue-ui-sparkbar-Crq1Vui3.js";import{t as z}from"./vue-ui-sparkgauge-CN_9yenn.js";import{t as B}from"./vue-ui-sparkline-2_RlGrAT.js";import{t as V}from"./vue-ui-strip-plot-Dig2RljR.js";import{t as H}from"./vue-ui-table-_qSw3iGd.js";import{t as U}from"./vue-ui-table-heatmap-BwoRcqFD.js";import{t as W}from"./vue-ui-table-sparkline-39sKOqcp.js";import{t as G}from"./vue-ui-thermometer-CoVrrzHW.js";import{t as K}from"./vue-ui-timer-DoR5PqOa.js";import{t as q}from"./vue-ui-tiremarks-9tPPNGiq.js";import{t as J}from"./vue-ui-treemap-D3mZkT4P.js";import{t as Y}from"./vue-ui-horizontal-bar-CVP5jBNJ.js";import{t as X}from"./vue-ui-waffle-D2GfM_Se.js";import{t as Z}from"./vue-ui-wheel-CYBaqHm6.js";import{t as Q}from"./vue-ui-word-cloud-ClGL6iKL.js";import{t as $}from"./vue-ui-xy-canvas-CRSisgSA.js";import{t as te}from"./vue-ui-carousel-table-DwsfnL_l.js";import{t as ne}from"./vue-ui-gizmo-C9ls2b4h.js";import{t as re}from"./vue-ui-stackbar-BVmQJn2b.js";import{t as ie}from"./vue-ui-stackline-nvhui30B.js";import{t as ae}from"./vue-ui-bullet-CxyL5Bdm.js";import{t as oe}from"./vue-ui-funnel-DqoQogQE.js";import{t as se}from"./vue-ui-history-plot-CowxWkEd.js";import{t as ce}from"./vue-ui-pattern-DrPCu32G.js";import{t as le}from"./vue-ui-circle-pack-BcA9ZxZS.js";import{t as ue}from"./vue-ui-world-Dm7LSNB2.js";import{t as de}from"./vue-ui-ridgeline-B4qi2Ajl.js";import{t as fe}from"./vue-ui-chord-DRNn_E6i.js";import{t as pe}from"./vue-ui-dag-CWpyU7AJ.js";import{t as me}from"./vue-data-ui-Da3HK_wb.js";import{t as he}from"./vue-ui-geo-C3e4J_kw.js";import{t as ge}from"./vue-ui-bump-BWWMzAN_.js";import{t as _e}from"./vue-ui-hill-8c-9u8eg.js";import{t as ve}from"./vue-ui-pattern-seed-B8YjAAEH.js";import{t as ye}from"./vue-ui-label-CBrMoFDG.js";import{i as be,n as xe,r as Se,t as Ce}from"./useObjectBindings-D789Dz63.js";import{E as we,P as Te,U as Ee,Z as De,bt as Oe,ft as ke,ht as Ae,mt as je,n as Me,q as Ne}from"./lib-rPeBMZrn.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,t as ze}from"./exposedLib-BRtClmZy.js";import{t as Be}from"./patternUtils-_q3ArM3g.js";import{n as Ve,t as He}from"./useParentSize-DGkyQ711.js";export{ee as Arrow,me as VueDataUi,n as VueUi3dBar,r as VueUiAccordion,i as VueUiAgePyramid,a as VueUiAnnotator,ae as VueUiBullet,ge as VueUiBump,o as VueUiCandlestick,te as VueUiCarouselTable,s as VueUiChestnut,fe as VueUiChord,le as VueUiCirclePack,c as VueUiCursor,pe as VueUiDag,l as VueUiDashboard,u as VueUiDigits,d as VueUiDonut,f as VueUiDonutEvolution,p as VueUiDumbbell,m as VueUiFlow,oe as VueUiFunnel,h as VueUiGalaxy,g as VueUiGauge,he as VueUiGeo,ne as VueUiGizmo,e as VueUiGraph,_ as VueUiHeatmap,_e as VueUiHill,se as VueUiHistoryPlot,Y as VueUiHorizontalBar,Y as VueUiVerticalBar,v as VueUiIcon,y as VueUiKpi,ye as VueUiLabel,b as VueUiMiniLoader,x as VueUiMolecule,S as VueUiMoodRadar,C as VueUiNestedDonuts,w as VueUiOnion,T as VueUiParallelCoordinatePlot,ce as VueUiPattern,ve as VueUiPatternSeed,E as VueUiQuadrant,D as VueUiQuickChart,O as VueUiRadar,k as VueUiRating,A as VueUiRelationCircle,de as VueUiRidgeline,j as VueUiRings,M as VueUiScatter,N as VueUiSkeleton,P as VueUiSmiley,F as VueUiSparkHistogram,I as VueUiSparkStackbar,L as VueUiSparkTrend,R as VueUiSparkbar,z as VueUiSparkgauge,B as VueUiSparkline,re as VueUiStackbar,ie as VueUiStackline,V as VueUiStripPlot,H as VueUiTable,U as VueUiTableHeatmap,W as VueUiTableSparkline,G as VueUiThermometer,K as VueUiTimer,q as VueUiTiremarks,J as VueUiTreemap,X as VueUiWaffle,Z as VueUiWheel,Q as VueUiWordCloud,ue as VueUiWorld,t as VueUiXy,$ as VueUiXyCanvas,Me as abbreviate,xe as applyDataCorrection,ze as average,we as createColorWheel,Be as createPatternDef,Te as createSmoothPath,Ee as createStraightPath,Ne as createTSpans,De as createWordCloudDatasetFromPlainText,Ie as darkenColor,ke as formatSmallValue,je as getCumulativeAverage,Ae as getCumulativeMedian,Oe as getPalette,Se as getThemeConfig,be as getVueDataUiConfig,Re as lightenColor,Fe as median,Pe as mergeConfigs,Le as shiftColorHue,Ce as useObjectBindings,He as useParentSize,Ve as useTooltipPosition};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,D as d,Ft as f,Ht as p,It as ee,Jt as m,Q as h,S as te,X as ne,at as re,b as ie,f as g,h as ae,i as oe,in as se,nt as ce,p as le,t as ue,w as de,yt as fe,zt as pe}from"./lib-rPeBMZrn.js";import{c as me}from"./canvas-lib-22VpOI4_.js";import{n as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./useConfig-_JwRfIqE.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{t as ye}from"./usePrinter-DVf3YcG5.js";import{t as be}from"./useResponsive-CENUxfEL.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{t as Se}from"./useUserOptionState-CXlFnwPv.js";import{t as Ce}from"./useChartAccessibility-DOMuYJfm.js";import{t as we}from"./img-D4RQwASc.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./vue_ui_3d_bar-Dm8zmL8w.js";import{t as De}from"./A11yDataTable-DWNlWXzs.js";import{t as _}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as v,computed as y,createBlock as b,createCommentVNode as x,createElementBlock as S,createElementVNode as C,createSlots as ke,createTextVNode as Ae,createVNode as w,defineAsyncComponent as T,guardReactiveProps as je,mergeProps as Me,nextTick as Ne,normalizeClass as Pe,normalizeProps as Fe,normalizeStyle as E,onMounted as Ie,openBlock as D,ref as O,renderList as k,renderSlot as A,resolveDynamicComponent as Le,toDisplayString as j,toRefs as Re,unref as M,watch as ze,withCtx as N,withKeys as Be,withModifiers as Ve}from"vue";var He=/* @__PURE__ */ e({default:()=>ln}),Ue=[`id`],We=[`id`],Ge={"aria-live":`polite`,class:`sr-only`},Ke={style:{position:`relative`}},qe=[`xmlns`,`viewBox`,`aria-describedby`],Je=[`width`,`height`],Ye={key:1},Xe=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ze=[`x`,`y`],Qe=[`cx`,`cy`,`stroke`,`opacity`],$e=[`d`,`stroke`],et=[`d`,`stroke`],tt={key:4},nt={key:0},rt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],it=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],at=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],ot=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],st={key:1},ct=[`d`,`stroke`,`stroke-width`,`fill`],lt=[`d`,`stroke`,`stroke-width`,`fill`],ut=[`d`,`stroke`,`stroke-width`,`fill`],dt={key:2},ft=[`aria-label`],pt=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],mt=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],ht=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],gt=[`d`,`onMouseenter`,`onClick`,`onMouseout`],_t=[`d`],vt=[`d`,`stroke`],yt=[`onClick`],bt=[`stroke`,`d`],xt=[`cx`,`cy`,`fill`,`stroke`],St=[`x`,`y`,`width`,`height`],Ct=[`x`,`y`,`width`,`height`],wt={key:3},Tt=[`d`,`stroke`],Et=[`d`,`fill`,`stroke`],Dt={key:0},Ot=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],kt=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],At={key:4},jt=[`d`,`fill`,`stroke`],Mt={key:5},Nt={key:0},Pt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],Ft=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],It=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],Lt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],Rt=[`d`,`stroke`,`stroke-width`,`fill`],zt=[`d`,`stroke`,`stroke-width`,`fill`],Bt=[`d`],Vt={key:1},Ht=[`aria-label`],Ut=[`onMouseenter`,`onClick`,`onMouseout`,`d`,`fill`],Wt=[`onMouseenter`,`onClick`,`onMouseout`,`d`],Gt=[`onMouseenter`,`onClick`,`onMouseout`,`d`,`fill`],Kt=[`onClick`],qt=[`stroke`,`d`],Jt=[`cx`,`cy`,`fill`,`stroke`],Yt=[`x`,`y`,`width`,`height`],Xt=[`x`,`y`,`width`,`height`],Zt={key:3},Qt=[`d`,`stroke`],$t=[`d`,`fill`,`stroke`],en={key:0},tn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],nn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],rn={key:4},an=[`d`,`fill`,`stroke`],on={key:4,class:`vue-data-ui-watermark`},sn={key:0},cn={key:1},ln=/*#__PURE__*/ Oe({__name:`vue-ui-3d-bar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:Oe,emit:He}){let ln=T(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),un=T(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),dn=T(()=>import(`./DataTable-KeuZB1JM.js`)),fn=T(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),pn=T(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),mn=T(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),hn=T(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_3d_bar:gn}=ge(),P=e,_n=He,vn=y(()=>!!P.dataset&&Object.keys(P.dataset).length),F=O(ne()),I=O(null),L=O(!1),yn=O(0),bn=O(0),xn=O(null),Sn=O(null),Cn=O(null),wn=O(null),R=O(!1),Tn=O(null),En=O(null),z=O(null),B=O(``),V=O(Fn()),Dn=y(()=>V.value.style),H=y(()=>V.value.style.chart),U=y(()=>V.value.userOptions);he({config:()=>V.value,dataset:()=>P.dataset,component:`VueUi3dBar`,rules:[{test:e=>e?.series&&e.series.length>8,message:[`👀 The number of series is > 8. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]},{test:e=>e?.series&&e.series.some(e=>e?.breakdown&&e.breakdown.length>6),message:[`👀 Some donut breakdowns have > 6 data points. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" data point.`]}]});let On=y(()=>V.value.userOptions.useCursorPointer),kn=y(()=>se({defaultConfig:{customPalette:[`#808080`,`#ADADAD`,`#DBDBDB`],userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,color:`#6A6A6A`,bar:{color:`#ADADAD`,stroke:`#6A6A6A`},box:{stroke:`#6A6A6A`}}}},userConfig:V.value.skeletonConfig??{}})),{loading:An,FINAL_DATASET:W}=_e({...Re(P),FINAL_CONFIG:V,prepareConfig:Fn,callback:()=>{Promise.resolve().then(async()=>{await Ne(),Wn()})},skeletonDataset:P.config?.skeletonDataset??{series:[{name:`_`,value:21,breakdown:[{name:`_`,value:13},{name:`_`,value:8}]},{name:`_`,value:13,breakdown:[{name:`_`,value:8},{name:`_`,value:5}]},{name:`_`,value:8,breakdown:[{name:`_`,value:5},{name:`_`,value:3}]}]},skeletonConfig:se({defaultConfig:V.value,userConfig:kn.value})}),{userOptionsVisible:jn,setUserOptionsVisibility:Mn,keepUserOptionState:Nn}=Se({config:V.value}),{svgRef:Pn}=Ce({config:V.value.style.chart.title});function Fn(){return l(P.config,gn,Ee)}ze(()=>P.config,e=>{An.value||(V.value=Fn()),jn.value=!V.value.userOptions.showOnChartHover,qn(),yn.value+=1,bn.value+=1,G.value.showTable=V.value.table.show},{deep:!0});let{isPrinting:In,isImaging:Ln,generatePdf:Rn,generateImage:zn}=ye({elementId:`3d_bar_${F.value}`,fileName:H.value.title.text||`vue-ui-3d-bar`,options:V.value.userOptions.print}),Bn=y(()=>de(V.value.customPalette)),G=O({showTable:V.value.table.show});ze(V,()=>{G.value={showTable:V.value.table.show}},{immediate:!0});let K=y(()=>W.value.series&&W.value.series.length),Vn=O(H.value.box.dimensions.width*(K.value?2:1)),Hn=O(H.value.box.dimensions.height),q=y(()=>({height:Hn.value,width:Vn.value,absoluteWidth:Vn.value,top:H.value.box.dimensions.top,bottom:H.value.box.dimensions.bottom,left:H.value.box.dimensions.left,right:H.value.box.dimensions.right,perspective:H.value.box.dimensions.perspective})),J=y(()=>{if(K.value){let e=W.value.series.map(e=>e.value||0).reduce((e,t)=>e+t,0),t=W.value.series.map((t,n)=>({...t,seriesIndex:n,id:ne(),proportion:(t.value||0)/e,color:te(t.color)||Bn.value[n]||p[n]||p[n%p.length],breakdown:t.breakdown?t.breakdown.sort((e,t)=>t.value-e.value):null})).sort((e,t)=>t.value-e.value),n=[],r=0;for(let e=0;e<t.length;e+=1)n.push({...t[e],fill:Yn(r,t[e].proportion,t[e].breakdown,t[e].color)}),r+=t[e].proportion;return n}return null}),Y=y(()=>{let e=q.value.width/2,t=q.value;return{right:`M${e},${t.top} ${t.width-t.right}, ${t.top+t.perspective} ${t.width-t.right},${t.height-t.bottom-t.perspective} ${e},${t.height-t.bottom}`,left:`M${e},${t.top} ${t.left},${t.top+t.perspective} ${t.left},${t.height-t.bottom-t.perspective} ${e},${t.height-t.bottom}`,side:`M${e},${t.height-t.bottom} ${e},${t.top+t.perspective*2}`,topSides:`M${t.left},${t.top+t.perspective} ${e},${t.top+t.perspective*2} ${t.width-t.right},${t.top+t.perspective}`,tubeTop:`M${t.left},${t.top+t.perspective} C ${t.left},${t.top-t.perspective/3} ${t.width-t.right},${t.top-t.perspective/3} ${t.width-t.right},${t.top+t.perspective} C ${t.width-t.right},${t.top+t.perspective*2.3} ${t.left},${t.top+t.perspective*2.3} ${t.left},${t.top+t.perspective}`,tubeLeft:`M${t.left},${t.top+t.perspective} ${t.left},${t.height-t.bottom-t.perspective}`,tubeRight:`M${t.width-t.right},${t.top+t.perspective} ${t.width-t.right},${t.height-t.bottom-t.perspective}`,tubeBottom:`M${t.width-t.right},${t.height-t.bottom-t.perspective} C ${t.width-t.right},${t.height} ${t.left},${t.height} ${t.left},${t.height-t.bottom-t.perspective}`}}),Un=O(H.value.animation.use?0:W.value.percentage);function Wn(){let e=0,t=H.value.animation.speed,n=.005*H.value.animation.acceleration;function r(){Un.value+=t+e,e+=n,Un.value<W.value.percentage?requestAnimationFrame(r):Un.value=W.value.percentage}H.value.animation.use&&(Un.value=0,r())}Ie(()=>{qn(),Wn()});let Gn=y(()=>V.value.debug);function Kn(){Gn.value&&(pe(P.dataset)?re({componentName:`VueUi3dBar`,type:`dataset`,debug:Gn.value}):P.dataset.series?P.dataset.series.forEach((e,t)=>{fe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetSerieAttribute`,property:e,index:t,debug:Gn.value})}),e.breakdown&&e.breakdown.forEach((e,n)=>{fe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`,debug:Gn.value})})})}):fe({datasetObject:P.dataset,requiredAttributes:[`percentage`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetAttribute`,property:e,debug:Gn.value})}))}function qn(){if(Kn(),V.value.responsive){let e=me(()=>{let{width:e,height:t}=be({chart:I.value,title:H.value.title.text?xn.value:null,source:wn.value});requestAnimationFrame(()=>{Hn.value=t-12,Vn.value=e})});Sn.value&&(Cn.value&&Sn.value.unobserve(Cn.value),Sn.value.disconnect()),Sn.value=new ResizeObserver(e),Cn.value=I.value.parentNode,Sn.value.observe(Cn.value)}}let Jn=y(()=>q.value.width/4);function Yn(e,t,n,r){let i=q.value.height-q.value.bottom-q.value.top-q.value.perspective*2,{width:a,height:o,bottom:s,right:c,left:l,perspective:u}=q.value,d=K.value?a/4:a/2,p=d*2+l,m=s+i*e,h=o-m-u-i*t/2,te=h>q.value.height/2?`top`:`bottom`,ne=o*.25,re=!!n,ie=null,g=null;return re&&(n=n.map((e,t)=>({...e,value:e.value||0,color:f(r,t/n.length)})),ie=ee({series:n},a/2+a/5,te===`top`?h-ne:h+ne,a/10,a/10,1.99999,2,1,360,105.25,a/20),g=ee({series:n},a-p+a/14,o-m-u-i*t/2,a/40,a/40,1.99999,2,1,360,105.25,a/40)),{donut:ie,miniDonut:g,donutR:a/20,CENTER_X:d,sidePointer:{x:a-p,x2:a-p+a/14,xText:a-p+a/9,y:o-m-u-i*t/2,topY:o-m-u-i*t,height:i*t},apexBottom:{y:o-m,x:d},apexTop:{y:o-m-i*t,x:d},right:`M${d},${o-m} ${d},${o-m-i*t} ${a-p},${o-m-u-i*t} ${a-p},${o-m-u}Z`,left:`M${d},${o-m} ${d},${o-m-i*t} ${l}, ${o-m-u-i*t} ${l},${o-m-u}Z`,liningTop:`M${l},${o-m-u-i*t} ${d},${o-m-i*t} ${a-p},${o-m-u-i*t}`,liningTopShade:`M${l},${o-m-u-i*t-.5} ${d},${o-m-i*t-.5} ${a-p},${o-m-u-i*t-.5}`,top:`M${d},${o-m-i*t} ${l},${o-m-u-i*t} ${d},${o-m-u*2-i*t} ${a-p},${o-m-u-i*t} Z`,tubeTop:`M${l},${o-m-i*t-u} C ${l},${o-m-i*t-u*2.5} ${a-p},${o-m-i*t-u*2.5} ${a-p},${o-m-i*t-u} C ${a-p},${o-m-i*t+u/2} ${l},${o-m-i*t+u/2} ${l},${o-m-i*t-u}`,bottomTubeTop:`M ${a-p-.5},${o-m-u} C ${a-p-.5},${o-m+u/2} ${l},${o-m+u/2} ${l+.5},${o-m-u}`,tubeBody:`M
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,D as d,Ft as f,Ht as p,It as ee,Jt as m,Q as h,S as te,X as ne,at as re,b as ie,f as g,h as ae,i as oe,in as se,nt as ce,p as le,t as ue,w as de,yt as fe,zt as pe}from"./lib-rPeBMZrn.js";import{c as me}from"./canvas-lib-22VpOI4_.js";import{n as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./useConfig-_JwRfIqE.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{t as ye}from"./usePrinter-DVf3YcG5.js";import{t as be}from"./useResponsive-CENUxfEL.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{t as Se}from"./useUserOptionState-CXlFnwPv.js";import{t as Ce}from"./useChartAccessibility-DOMuYJfm.js";import{t as we}from"./img-D4RQwASc.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./vue_ui_3d_bar-Dm8zmL8w.js";import{t as De}from"./A11yDataTable-DWNlWXzs.js";import{t as _}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as v,computed as y,createBlock as b,createCommentVNode as x,createElementBlock as S,createElementVNode as C,createSlots as ke,createTextVNode as Ae,createVNode as w,defineAsyncComponent as T,guardReactiveProps as je,mergeProps as Me,nextTick as Ne,normalizeClass as Pe,normalizeProps as Fe,normalizeStyle as E,onMounted as Ie,openBlock as D,ref as O,renderList as k,renderSlot as A,resolveDynamicComponent as Le,toDisplayString as j,toRefs as Re,unref as M,watch as ze,withCtx as N,withKeys as Be,withModifiers as Ve}from"vue";var He=/* @__PURE__ */ e({default:()=>ln}),Ue=[`id`],We=[`id`],Ge={"aria-live":`polite`,class:`sr-only`},Ke={style:{position:`relative`}},qe=[`xmlns`,`viewBox`,`aria-describedby`],Je=[`width`,`height`],Ye={key:1},Xe=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ze=[`x`,`y`],Qe=[`cx`,`cy`,`stroke`,`opacity`],$e=[`d`,`stroke`],et=[`d`,`stroke`],tt={key:4},nt={key:0},rt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],it=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],at=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],ot=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],st={key:1},ct=[`d`,`stroke`,`stroke-width`,`fill`],lt=[`d`,`stroke`,`stroke-width`,`fill`],ut=[`d`,`stroke`,`stroke-width`,`fill`],dt={key:2},ft=[`aria-label`],pt=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],mt=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],ht=[`d`,`fill`,`onMouseenter`,`onClick`,`onMouseout`],gt=[`d`,`onMouseenter`,`onClick`,`onMouseout`],_t=[`d`],vt=[`d`,`stroke`],yt=[`onClick`],bt=[`stroke`,`d`],xt=[`cx`,`cy`,`fill`,`stroke`],St=[`x`,`y`,`width`,`height`],Ct=[`x`,`y`,`width`,`height`],wt={key:3},Tt=[`d`,`stroke`],Et=[`d`,`fill`,`stroke`],Dt={key:0},Ot=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],kt=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],At={key:4},jt=[`d`,`fill`,`stroke`],Mt={key:5},Nt={key:0},Pt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],Ft=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],It=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],Lt=[`stroke-dasharray`,`d`,`stroke`,`stroke-width`],Rt=[`d`,`stroke`,`stroke-width`,`fill`],zt=[`d`,`stroke`,`stroke-width`,`fill`],Bt=[`d`],Vt={key:1},Ht=[`aria-label`],Ut=[`onMouseenter`,`onClick`,`onMouseout`,`d`,`fill`],Wt=[`onMouseenter`,`onClick`,`onMouseout`,`d`],Gt=[`onMouseenter`,`onClick`,`onMouseout`,`d`,`fill`],Kt=[`onClick`],qt=[`stroke`,`d`],Jt=[`cx`,`cy`,`fill`,`stroke`],Yt=[`x`,`y`,`width`,`height`],Xt=[`x`,`y`,`width`,`height`],Zt={key:3},Qt=[`d`,`stroke`],$t=[`d`,`fill`,`stroke`],en={key:0},tn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],nn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`font-weight`],rn={key:4},an=[`d`,`fill`,`stroke`],on={key:4,class:`vue-data-ui-watermark`},sn={key:0},cn={key:1},ln=/*#__PURE__*/ Oe({__name:`vue-ui-3d-bar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:Oe,emit:He}){let ln=T(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),un=T(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),dn=T(()=>import(`./DataTable-KeuZB1JM.js`)),fn=T(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),pn=T(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),mn=T(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),hn=T(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_3d_bar:gn}=ge(),P=e,_n=He,vn=y(()=>!!P.dataset&&Object.keys(P.dataset).length),F=O(ne()),I=O(null),L=O(!1),yn=O(0),bn=O(0),xn=O(null),Sn=O(null),Cn=O(null),wn=O(null),R=O(!1),Tn=O(null),En=O(null),z=O(null),B=O(``),V=O(Fn()),Dn=y(()=>V.value.style),H=y(()=>V.value.style.chart),U=y(()=>V.value.userOptions);he({config:()=>V.value,dataset:()=>P.dataset,component:`VueUi3dBar`,rules:[{test:e=>e?.series&&e.series.length>8,message:[`👀 The number of series is > 8. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]},{test:e=>e?.series&&e.series.some(e=>e?.breakdown&&e.breakdown.length>6),message:[`👀 Some donut breakdowns have > 6 data points. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" data point.`]}]});let On=y(()=>V.value.userOptions.useCursorPointer),kn=y(()=>se({defaultConfig:{customPalette:[`#808080`,`#ADADAD`,`#DBDBDB`],userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,color:`#6A6A6A`,bar:{color:`#ADADAD`,stroke:`#6A6A6A`},box:{stroke:`#6A6A6A`}}}},userConfig:V.value.skeletonConfig??{}})),{loading:An,FINAL_DATASET:W}=_e({...Re(P),FINAL_CONFIG:V,prepareConfig:Fn,callback:()=>{Promise.resolve().then(async()=>{await Ne(),Wn()})},skeletonDataset:P.config?.skeletonDataset??{series:[{name:`_`,value:21,breakdown:[{name:`_`,value:13},{name:`_`,value:8}]},{name:`_`,value:13,breakdown:[{name:`_`,value:8},{name:`_`,value:5}]},{name:`_`,value:8,breakdown:[{name:`_`,value:5},{name:`_`,value:3}]}]},skeletonConfig:se({defaultConfig:V.value,userConfig:kn.value})}),{userOptionsVisible:jn,setUserOptionsVisibility:Mn,keepUserOptionState:Nn}=Se({config:V.value}),{svgRef:Pn}=Ce({config:V.value.style.chart.title});function Fn(){return l(P.config,gn,Ee)}ze(()=>P.config,e=>{An.value||(V.value=Fn()),jn.value=!V.value.userOptions.showOnChartHover,qn(),yn.value+=1,bn.value+=1,G.value.showTable=V.value.table.show},{deep:!0});let{isPrinting:In,isImaging:Ln,generatePdf:Rn,generateImage:zn}=ye({elementId:`3d_bar_${F.value}`,fileName:H.value.title.text||`vue-ui-3d-bar`,options:V.value.userOptions.print}),Bn=y(()=>de(V.value.customPalette)),G=O({showTable:V.value.table.show});ze(V,()=>{G.value={showTable:V.value.table.show}},{immediate:!0});let K=y(()=>W.value.series&&W.value.series.length),Vn=O(H.value.box.dimensions.width*(K.value?2:1)),Hn=O(H.value.box.dimensions.height),q=y(()=>({height:Hn.value,width:Vn.value,absoluteWidth:Vn.value,top:H.value.box.dimensions.top,bottom:H.value.box.dimensions.bottom,left:H.value.box.dimensions.left,right:H.value.box.dimensions.right,perspective:H.value.box.dimensions.perspective})),J=y(()=>{if(K.value){let e=W.value.series.map(e=>e.value||0).reduce((e,t)=>e+t,0),t=W.value.series.map((t,n)=>({...t,seriesIndex:n,id:ne(),proportion:(t.value||0)/e,color:te(t.color)||Bn.value[n]||p[n]||p[n%p.length],breakdown:t.breakdown?t.breakdown.sort((e,t)=>t.value-e.value):null})).sort((e,t)=>t.value-e.value),n=[],r=0;for(let e=0;e<t.length;e+=1)n.push({...t[e],fill:Yn(r,t[e].proportion,t[e].breakdown,t[e].color)}),r+=t[e].proportion;return n}return null}),Y=y(()=>{let e=q.value.width/2,t=q.value;return{right:`M${e},${t.top} ${t.width-t.right}, ${t.top+t.perspective} ${t.width-t.right},${t.height-t.bottom-t.perspective} ${e},${t.height-t.bottom}`,left:`M${e},${t.top} ${t.left},${t.top+t.perspective} ${t.left},${t.height-t.bottom-t.perspective} ${e},${t.height-t.bottom}`,side:`M${e},${t.height-t.bottom} ${e},${t.top+t.perspective*2}`,topSides:`M${t.left},${t.top+t.perspective} ${e},${t.top+t.perspective*2} ${t.width-t.right},${t.top+t.perspective}`,tubeTop:`M${t.left},${t.top+t.perspective} C ${t.left},${t.top-t.perspective/3} ${t.width-t.right},${t.top-t.perspective/3} ${t.width-t.right},${t.top+t.perspective} C ${t.width-t.right},${t.top+t.perspective*2.3} ${t.left},${t.top+t.perspective*2.3} ${t.left},${t.top+t.perspective}`,tubeLeft:`M${t.left},${t.top+t.perspective} ${t.left},${t.height-t.bottom-t.perspective}`,tubeRight:`M${t.width-t.right},${t.top+t.perspective} ${t.width-t.right},${t.height-t.bottom-t.perspective}`,tubeBottom:`M${t.width-t.right},${t.height-t.bottom-t.perspective} C ${t.width-t.right},${t.height} ${t.left},${t.height} ${t.left},${t.height-t.bottom-t.perspective}`}}),Un=O(H.value.animation.use?0:W.value.percentage);function Wn(){let e=0,t=H.value.animation.speed,n=.005*H.value.animation.acceleration;function r(){Un.value+=t+e,e+=n,Un.value<W.value.percentage?requestAnimationFrame(r):Un.value=W.value.percentage}H.value.animation.use&&(Un.value=0,r())}Ie(()=>{qn(),Wn()});let Gn=y(()=>V.value.debug);function Kn(){Gn.value&&(pe(P.dataset)?re({componentName:`VueUi3dBar`,type:`dataset`,debug:Gn.value}):P.dataset.series?P.dataset.series.forEach((e,t)=>{fe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetSerieAttribute`,property:e,index:t,debug:Gn.value})}),e.breakdown&&e.breakdown.forEach((e,n)=>{fe({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`,debug:Gn.value})})})}):fe({datasetObject:P.dataset,requiredAttributes:[`percentage`]}).forEach(e=>{re({componentName:`VueUi3dBar`,type:`datasetAttribute`,property:e,debug:Gn.value})}))}function qn(){if(Kn(),V.value.responsive){let e=me(()=>{let{width:e,height:t}=be({chart:I.value,title:H.value.title.text?xn.value:null,source:wn.value});requestAnimationFrame(()=>{Hn.value=t-12,Vn.value=e})});Sn.value&&(Cn.value&&Sn.value.unobserve(Cn.value),Sn.value.disconnect()),Sn.value=new ResizeObserver(e),Cn.value=I.value.parentNode,Sn.value.observe(Cn.value)}}let Jn=y(()=>q.value.width/4);function Yn(e,t,n,r){let i=q.value.height-q.value.bottom-q.value.top-q.value.perspective*2,{width:a,height:o,bottom:s,right:c,left:l,perspective:u}=q.value,d=K.value?a/4:a/2,p=d*2+l,m=s+i*e,h=o-m-u-i*t/2,te=h>q.value.height/2?`top`:`bottom`,ne=o*.25,re=!!n,ie=null,g=null;return re&&(n=n.map((e,t)=>({...e,value:e.value||0,color:f(r,t/n.length)})),ie=ee({series:n},a/2+a/5,te===`top`?h-ne:h+ne,a/10,a/10,1.99999,2,1,360,105.25,a/20),g=ee({series:n},a-p+a/14,o-m-u-i*t/2,a/40,a/40,1.99999,2,1,360,105.25,a/40)),{donut:ie,miniDonut:g,donutR:a/20,CENTER_X:d,sidePointer:{x:a-p,x2:a-p+a/14,xText:a-p+a/9,y:o-m-u-i*t/2,topY:o-m-u-i*t,height:i*t},apexBottom:{y:o-m,x:d},apexTop:{y:o-m-i*t,x:d},right:`M${d},${o-m} ${d},${o-m-i*t} ${a-p},${o-m-u-i*t} ${a-p},${o-m-u}Z`,left:`M${d},${o-m} ${d},${o-m-i*t} ${l}, ${o-m-u-i*t} ${l},${o-m-u}Z`,liningTop:`M${l},${o-m-u-i*t} ${d},${o-m-i*t} ${a-p},${o-m-u-i*t}`,liningTopShade:`M${l},${o-m-u-i*t-.5} ${d},${o-m-i*t-.5} ${a-p},${o-m-u-i*t-.5}`,top:`M${d},${o-m-i*t} ${l},${o-m-u-i*t} ${d},${o-m-u*2-i*t} ${a-p},${o-m-u-i*t} Z`,tubeTop:`M${l},${o-m-i*t-u} C ${l},${o-m-i*t-u*2.5} ${a-p},${o-m-i*t-u*2.5} ${a-p},${o-m-i*t-u} C ${a-p},${o-m-i*t+u/2} ${l},${o-m-i*t+u/2} ${l},${o-m-i*t-u}`,bottomTubeTop:`M ${a-p-.5},${o-m-u} C ${a-p-.5},${o-m+u/2} ${l},${o-m+u/2} ${l+.5},${o-m-u}`,tubeBody:`M
|
|
2
2
|
${l},${o-m-i*t-u}
|
|
3
3
|
C ${l},${o-m-i*t+u/2}
|
|
4
4
|
${a-p},${o-m-i*t+u/2}
|
|
@@ -1 +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{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as ee}from"./resolveChartConfig-0IvbmIE_.js";import{$ as l,D as te,Dt as ne,Jt as re,X as ie,Yt as ae,at as oe,b as u,et as se,i as d,in as ce,nt as le,pt as ue,t as de,tn as fe,zt as pe}from"./lib-rPeBMZrn.js";import{n as me,t as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./useConfig-_JwRfIqE.js";import{t as _e}from"./useSvgLabelLayout-42Kats14.js";import{n as ve,t as ye}from"./BaseScanner-8NdoBs7B.js";import{t as be}from"./usePrinter-DVf3YcG5.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ee}from"./img-D4RQwASc.js";import{n as De}from"./Title-BliHuXfT.js";import{t as Oe}from"./vue_ui_age_pyramid-DXJeenVU.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 f,computed as p,createBlock as m,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createSlots as Me,createTextVNode as Ne,createVNode as v,defineAsyncComponent as y,guardReactiveProps as b,mergeProps as Pe,nextTick as Fe,normalizeClass as Ie,normalizeProps as x,normalizeStyle as Le,onBeforeUnmount as Re,onMounted as ze,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as Be,shallowRef as Ve,toDisplayString as E,toRefs as He,unref as D,watch as O,withCtx as k}from"vue";var Ue=/* @__PURE__ */ e({default:()=>vt}),We=[`id`],Ge=[`id`],Ke={style:{position:`relative`}},qe=[`xmlns`,`viewBox`,`aria-describedby`],Je=[`x`,`y`,`width`,`height`],Ye=[`x`,`y`,`width`,`height`,`fill`,`rx`],Xe=[`x`,`y`,`width`,`height`,`fill`,`rx`],Ze=[`x`,`y`,`width`,`height`,`fill`,`rx`],Qe=[`x`,`y`,`width`,`height`,`fill`,`rx`],$e=[`x`,`y`,`font-size`,`font-weight`,`fill`,`stroke`],et=[`x`,`y`,`font-size`,`font-weight`,`fill`,`stroke`],tt={key:0},nt=[`x`,`y`,`fill`,`font-size`,`font-weight`],rt=[`x`,`y`,`fill`,`font-size`,`font-weight`],it={key:1},at=[`x`,`y`,`font-size`,`fill`,`font-weight`],ot={key:2},st={key:0},ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],lt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft=[`font-size`,`fill`,`text-anchor`,`font-weight`,`transform`],pt=[`font-size`,`fill`,`text-anchor`,`font-weight`,`transform`],mt=[`x`,`y`,`font-size`,`fill`,`font-weight`],ht=[`x`,`y`,`width`,`height`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],gt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_t={key:5,class:`vue-data-ui-watermark`},vt=/*#__PURE__*/ je({__name:`vue-ui-age-pyramid`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:je,emit:Ue}){let vt=y(()=>import(`./Tooltip-C1q0Qoh7.js`)),yt=y(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),bt=y(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),xt=y(()=>import(`./DataTable-KeuZB1JM.js`)),St=y(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Ct=y(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),wt=y(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Tt=y(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_age_pyramid:Et}=ge(),A=e,Dt=Ue,Ot=p(()=>!!A.dataset&&A.dataset.length),j=C(ie()),kt=C(!1),At=C(``),M=C(null),jt=C(0),N=C(null),Mt=C(null),Nt=C(null),Pt=C(null),Ft=C(0),It=C(0),Lt=C(null),Rt=C(null),zt=C(null),P=C(null),Bt=C({x:0,y:0}),F=C(`pointer`),Vt=C(!1),I=C(Yt()),L=p(()=>I.value.style),R=p(()=>I.value.style.layout.dataLabels),z=p(()=>I.value.style.layout.bars),B=p(()=>I.value.style.layout.bars.labels);me({config:()=>I.value,dataset:()=>A.dataset,component:`VueUiAgePyramid`,rules:[he.emptyArray,{test:e=>e.length>130,message:[`👀 Dataset has > 130 points. Consider:`,``,`▶️ Grouping small values into aggregated categories.`,``,`▶️ Using VueUiStackline to display data in a more compact way.`]}]});let V=p(()=>I.value.userOptions.useCursorPointer),Ht=p(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},translations:{male:``,female:``},style:{backgroundColor:`#99999930`,layout:{bars:{left:{color:`#CACACA`},right:{color:`#999999`}},dataLabels:{xAxis:{fontSize:0,scale:1e3,translation:``},yAxis:{show:!1}},grid:{stroke:`#6A6A6A`}}}},userConfig:I.value.skeletonConfig??{}})),{loading:Ut,FINAL_DATASET:Wt,manualLoading:Gt}=ve({...He(A),FINAL_CONFIG:I,prepareConfig:Yt,skeletonDataset:A.config?.skeletonDataset??[[`_`,9,2,2],[`_`,8,3,3],[`_`,7,5,5],[`_`,6,8,8],[`_`,5,13,13],[`_`,4,21,21],[`_`,3,34,34],[`_`,2,55,55],[`_`,1,89,89],[`_`,0,144,144]],skeletonConfig:ce({defaultConfig:I.value,userConfig:Ht.value})}),{userOptionsVisible:Kt,setUserOptionsVisibility:qt,keepUserOptionState:Jt}=Ce({config:I.value}),{svgRef:H}=we({config:I.value.style.title});function Yt(){return ee(A.config,Et,Oe)}function Xt(e){let t=se(e);return t?.style?.chart&&delete t.style.tooltip,JSON.stringify(t)}let Zt=Xt(A.config);O(()=>A.config,(e,t)=>{let n=Xt(e),r=n!==Zt;Zt=n;let i=Yt();r?(Ut.value||(I.value=i),Kt.value=!I.value.userOptions.showOnChartHover,tn(),Ft.value+=1,It.value+=1,G.value.showTable=I.value.table.show,G.value.showTooltip=I.value.style.tooltip.show):(I.value.style.tooltip=i.style.tooltip,G.value.showTooltip=I.value.style.tooltip.show)},{deep:!0}),O(()=>A.dataset,e=>{Array.isArray(e)&&e.length>0&&(Gt.value=!1)},{deep:!0});let U=Ve(null),W=Ve(null),Qt=C(!1),$t=0;ze(()=>{tn()});let en=p(()=>I.value.debug);function tn(){pe(A.dataset)&&(oe({componentName:`VueUiAgePyramid`,type:`dataset`,debug:en.value}),Gt.value=!0),pe(A.dataset)||(Gt.value=I.value.loading),I.value.responsive&&(U.value&&(W.value&&U.value.unobserve(W.value),U.value.disconnect()),U.value=new ResizeObserver(()=>{let{width:e,height:t}=xe({chart:N.value,title:L.value.title.text?Mt.value:null,source:Nt.value,noTitle:Pt.value});cancelAnimationFrame($t),$t=requestAnimationFrame(()=>{K.value.width=e,K.value.height=t,Qt.value=!0})}),W.value=N.value.parentNode,U.value.observe(W.value))}Re(()=>{cancelAnimationFrame($t),U.value&&(W.value&&U.value.unobserve(W.value),U.value.disconnect())});let{isPrinting:nn,isImaging:rn,generatePdf:an,generateImage:on}=be({elementId:`vue-ui-age-pyramid_${j.value}`,fileName:L.value.title.text||`vue-ui-age-pyramid`,options:I.value.userOptions.print}),sn=p(()=>I.value.userOptions.show&&!L.value.title.text),G=C({showTable:I.value.table.show,showTooltip:L.value.tooltip.show});O(I,()=>{G.value={showTable:I.value.table.show,showTooltip:L.value.tooltip.show}},{immediate:!0});let K=C({height:L.value.height,width:L.value.width}),cn=p(()=>K.value.width),ln=p(()=>K.value.height),{metrics:un,ready:dn,settling:fn,update:pn}=_e({svgRef:H,canMeasure:()=>!I.value.responsive||Qt.value,initialMetrics:{bottom:0},measure:e=>({bottom:e(Lt.value).height})}),mn=p(()=>un.value.bottom),q=p(()=>{let e=K.value.width-L.value.layout.padding.right-L.value.layout.padding.left,t=L.value.layout.padding.left,n=K.value.width-L.value.layout.padding.right;return{top:L.value.layout.padding.top+R.value.sideTitles.fontSize+R.value.sideTitles.offsetY+12,left:t,right:n,bottom:K.value.height-L.value.layout.padding.bottom-mn.value,width:e,height:K.value.height-L.value.layout.padding.top-L.value.layout.padding.bottom-mn.value-R.value.sideTitles.fontSize-R.value.sideTitles.offsetY-12,centerX:L.value.layout.padding.left+e/2,leftChart:{width:e/2-L.value.layout.centerSlit.width,right:t+e/2-L.value.layout.centerSlit.width},rightChart:{width:e/2-L.value.layout.centerSlit.width,left:t+e/2+L.value.layout.centerSlit.width}}}),hn=p(()=>Wt.value.map(e=>R.value.yAxis.display===`age`?e[1]:e[0])),J=p(()=>{let e=gn(_n.value/5),t=[],n=[];for(let r=0;r<=5;r+=1){let i=e*r,a=e*(r-5);t.push({value:i,x:q.value.left+q.value.width/2+L.value.layout.centerSlit.width+i/_n.value*q.value.leftChart.width}),n.push({value:Math.abs(a),x:q.value.left+q.value.width/2+a/_n.value*q.value.leftChart.width-L.value.layout.centerSlit.width})}return{right:t,left:n}});function gn(e){if(e===0)return 0;let t=10**Math.floor(Math.log10(Math.abs(e))),n;return n=Math.round(e/t)*t,n}let _n=p(()=>Math.max(...Wt.value.flatMap(e=>e.slice(-2).map(e=>u(e))))),Y=p(()=>Wt.value.length),vn=p(()=>Wt.value.map(e=>({segment:e[0],age:e[1],left:{value:e[2],proportionToMax:e[2]/_n.value},right:{value:e[3],proportionToMax:e[3]/_n.value}}))),X=p(()=>vn.value.map((e,t)=>{let n=q.value.top+q.value.height/Y.value*t,r=q.value.height/Y.value-z.value.gap;return{segment:e.segment,age:e.age,left:{...e.left,y:n,color:z.value.left.color,x:q.value.leftChart.right-e.left.proportionToMax*q.value.leftChart.width,width:u(e.left.proportionToMax*q.value.leftChart.width),height:r},right:{...e.right,y:n,color:z.value.right.color,x:q.value.rightChart.left,width:u(e.right.proportionToMax*q.value.rightChart.width),height:r}}})),yn=C(null);function bn(e){let[t,n,r,i]=e;return{segment:t,index:n,left:r,right:i}}function xn(e,t){I.value.events.datapointClick&&I.value.events.datapointClick({datapoint:bn(t),seriesIndex:e})}function Sn(e,t){I.value.events.datapointLeave&&I.value.events.datapointLeave({datapoint:bn(t),seriesIndex:e}),(F.value!==`keyboard`||P.value!==e)&&(M.value=null,kt.value=!1)}function Cn(e){if(!H.value)return;let t=X.value[e];if(!t)return;let n=fe(q.value.left+q.value.width/2,t.left.y+t.left.height/2,H.value);n&&(Bt.value=n)}function wn(e,t,n=`pointer`){I.value.events.datapointEnter&&I.value.events.datapointEnter({datapoint:bn(t),seriesIndex:e}),M.value=e,P.value=e,F.value=n,yn.value={datapoint:t,seriesIndex:e,series:X.value,config:I.value};let r=L.value.tooltip.customFormat;if(ne(r)&&ue(()=>r({seriesIndex:e,datapoint:{segment:t[0],index:t[1],left:t[2],right:t[3]},series:X.value,config:I.value})))At.value=r({seriesIndex:e,datapoint:{segment:t[0],index:t[1],left:t[2],right:t[3]},series:X.value,config:I.value});else{let n=``,r=X.value[e];n+=`<div><b>${r.segment}</b></div>`,n+=`<div>${I.value.translations.age}: ${d(R.value.yAxis.formatter,u(r.age),l({v:u(r.age)}),{datapoint:t,seriesIndex:e})}</div>`,n+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${L.value.tooltip.borderColor}">`,n+=`<div style="display:flex; flex-direction:row;gap:12px">`,n+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.show?`url(#age_pyramid_left_${j.value})`:z.value.left.color}"/></svg><div>${I.value.translations.female}</div><div><b>${d(R.value.xAxis.formatter,u(r.left.value),l({v:u(r.left.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,n+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.show?`url(#age_pyramid_right_${j.value})`:z.value.right.color}"/></svg><div>${I.value.translations.male}</div><div><b>${d(R.value.xAxis.formatter,u(r.right.value),l({v:u(r.right.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,n+=`</div>`,n+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${L.value.tooltip.borderColor}"><div>${I.value.translations.total}</div><div><b>${d(R.value.xAxis.formatter,u(r.right.value)+u(r.left.value),l({v:u(r.right.value)+u(r.left.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,n+=`</div>`,At.value=`<div>${n}</div>`}kt.value=!0,n===`keyboard`&&Fe(()=>{Cn(e)})}function Tn(e=null){Fe(()=>{let t=[I.value.translations.year,I.value.translations.age,I.value.translations.female,I.value.translations.male,I.value.translations.total],n=A.dataset.map(e=>[e[0],e[1],e[2],e[3],e[2]??0+e[3]??0]),r=[[L.value.title.text],[L.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),i=te(r);e?e(i):le({csvContent:i,title:L.value.title.text||`vue-ui-heatmap`})})}let Z=p(()=>{let e=[I.value.translations.year,I.value.translations.age,I.value.translations.female,I.value.translations.male,I.value.translations.total];return{head:e,body:A.dataset.map(e=>[e[0],e[1],e[2]==null?``:e[2].toLocaleString(),e[3]==null?``:e[3].toLocaleString(),(e[2]??0+e[3]??0).toLocaleString()]),config:{th:{backgroundColor:I.value.table.th.backgroundColor,color:I.value.table.th.color,outline:I.value.table.th.outline},td:{backgroundColor:I.value.table.td.backgroundColor,color:I.value.table.td.color,outline:I.value.table.td.outline},breakpoint:I.value.table.responsiveBreakpoint},colNames:e}}),Q=C(!1);function En(e){Q.value=e,jt.value+=1}function Dn(){G.value.showTable=!G.value.showTable}function On(){G.value.showTooltip=!G.value.showTooltip}let kn=C(!1);function An(){kn.value=!kn.value}async function jn({scale:e=2}={}){if(!N.value)return;let{width:t,height:n}=N.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await Ee({domElement:N.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:L.value.title.text,width:t,height:n,aspectRatio:r}}let Mn=C([]),Nn=C({start:0,end:X.value.length});Te({timeLabelsEls:Lt,timeLabels:Mn,slicer:Nn,configRef:I,rotationPath:[`style`,`layout`,`dataLabels`,`xAxis`,`rotation`],autoRotatePath:[`style`,`layout`,`dataLabels`,`xAxis`,`autoRotate`,`enable`],isAutoSize:!1,width:cn,height:ln,targetClass:`.vue-ui-age-pyramid-x-axis-label`,rotation:L.value.layout.dataLabels.xAxis.autoRotate.angle});let $=p(()=>c({config:I,style:L,mutableConfig:G,dialog:Tt,accordion:bt,isFullscreen:Q,parent:N,maxWidth:800,isCursorPointer:V}));O(()=>G.value.showTable,e=>s(e,I,Rt));function Pn(){G.value.showTable=!1,zt.value&&zt.value.setTableIconState(!1)}let Fn=p(()=>I.value.style.backgroundColor),In=p(()=>I.value.style.title),{isCallbackImaging:Ln,isCallbackSvg:Rn,generateSvg:zn,onGenerateImage:Bn}=Se({svg:H,title:In,legend:null,legendItems:null,backgroundColor:Fn,getSvgCallback:()=>I.value.userOptions.callbacks.svg,generateImage:on});async function Vn(){Dt(`copyAlt`,{config:I.value,dataset:X.value}),I.value.userOptions.callbacks.altCopy?await Promise.resolve(I.value.userOptions.callbacks.altCopy({config:I.value,dataset:X.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Hn(){Vt.value=!0}function Un(){M.value=null,P.value=null,F.value=`pointer`,kt.value=!1,Vt.value=!1}function Wn(e){if(!H.value||kn.value||document.activeElement!==H.value||!X.value.length)return;let t=[`ArrowUp`,`ArrowLeft`].includes(e.key),n=[`ArrowDown`,`ArrowRight`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){M.value=null,P.value=null,F.value=`pointer`,kt.value=!1;return}if(r){if(P.value===null)return;let e=A.dataset[P.value];if(!e)return;xn(P.value,e);return}let a=P.value,o=M.value,s=a!==null&&a>=0&&a<X.value.length,c=o!==null&&o>=0&&o<X.value.length;s?t?a=a-1<0?X.value.length-1:a-1:n&&(a=a+1>X.value.length-1?0:a+1):c?(a=n?o+1:o-1,a>=X.value.length&&(a=0),a<0&&(a=X.value.length-1)):a=n?0:X.value.length-1;let ee=A.dataset[a];ee&&wn(a,ee,`keyboard`)}return je({getImage:jn,generatePdf:an,generateCsv:Tn,generateImage:on,generateSvg:zn,toggleTable:Dn,toggleTooltip:On,toggleAnnotator:An,toggleFullscreen:En,copyAlt:Vn}),O(()=>[K.value,R.value,Lt.value,A.dataset,Qt.value,I.value.style.fontFamily],pn,{flush:`post`,deep:!0}),(s,c)=>(S(),g(`div`,{class:Ie(`vue-data-ui-component vue-ui-age-pyramid ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`agePyramid`,ref:N,id:`vue-ui-age-pyramid_${j.value}`,style:Le(`font-family:${L.value.fontFamily};width:100%; text-align:center;background:${L.value.backgroundColor};${I.value.responsive?`height:100%`:``}`),onMouseenter:c[1]||=()=>D(qt)(!0),onMouseleave:c[2]||=()=>D(qt)(!1)},[_(`div`,{id:`chart-instructions-${j.value}`,class:`sr-only`},[_(`p`,null,E(I.value.a11y.translations.keyboardNavigation),1)],8,Ge),Z.value?.body?.length?(S(),m(ke,{key:0,uid:j.value,head:Z.value.head,body:Z.value.body,notice:I.value.a11y.translations.tableAvailable,caption:I.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):h(``,!0),I.value.userOptions.buttons.annotator?(S(),m(D(St),Pe({key:1},D(a)(I.value.userOptions.annotator),{svgRef:D(H),backgroundColor:L.value.backgroundColor,color:L.value.color,active:kn.value,isCursorPointer:V.value,palette:I.value.userOptions.annotatorPalette,onClose:An}),Me({_:2},[w(D(o),e=>({name:e,fn:k(t=>[T(s.$slots,e,x(b(D(i)(e,t))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):h(``,!0),sn.value?(S(),g(`div`,{key:2,ref_key:`noTitle`,ref:Pt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):h(``,!0),L.value.title.text?(S(),g(`div`,{key:3,ref_key:`chartTitle`,ref:Mt,style:`width:100%;background:transparent`},[(S(),m(De,{key:`title_${Ft.value}`,config:{title:{cy:`pyramid-div-title`,...L.value.title},subtitle:{cy:`pyramid-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):h(``,!0),I.value.userOptions.show&&Ot.value&&(D(Jt)||D(Kt))?(S(),m(D(Ct),Pe({ref_key:`userOptionsRef`,ref:zt,key:`user_options_${jt.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:D(rn),isPrinting:D(nn),uid:j.value,hasTooltip:I.value.userOptions.buttons.tooltip&&L.value.tooltip.show,isFullscreen:Q.value,isTooltip:G.value.showTooltip,chartElement:N.value},D(n)(I.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:kn.value,tableDialog:I.value.table.useDialog,isCursorPointer:V.value,onToggleFullscreen:En,onGeneratePdf:D(an),onGenerateCsv:Tn,onGenerateImage:D(Bn),onGenerateSvg:D(zn),onToggleTable:Dn,onToggleTooltip:On,onToggleAnnotator:An,onCopyAlt:Vn,style:{visibility:D(Jt)?D(Kt)?`visible`:`hidden`:`visible`}}),Me({_:2},[w(D(t)(s.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:k(t=>[T(s.$slots,e,x(b(D(r)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):h(``,!0),_(`div`,Ke,[(S(),g(`svg`,{ref_key:`svgRef`,ref:H,xmlns:D(de),class:Ie({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${K.value.width<=0?10:K.value.width} ${K.value.height<=0?10:K.value.height}`,style:Le(`max-width:100%;overflow:visible;background:transparent;color:${L.value.color};visibility:${D(dn)?`visible`:`hidden`}`),tabindex:`0`,"aria-describedby":`chart-instructions-${j.value}`,onFocus:Hn,onBlur:Un,onKeydown:Wn},[v(D(wt)),T(s.$slots,`svg-underlayer`,{svg:{...K.value,drawingArea:q.value,isPrintingImg:D(nn)||D(rn)||D(Ln),isPrintingSvg:D(Rn)}},void 0,!0),s.$slots[`chart-background`]?(S(),g(`foreignObject`,{key:0,x:q.value.left,y:q.value.top,width:Math.max(.1,q.value.width),height:Math.max(.1,q.value.height),style:{pointerEvents:`none`}},[T(s.$slots,`chart-background`,{},void 0,!0)],8,Je)):h(``,!0),_(`defs`,null,[v(Ae,{t:`linear`,id:`age_pyramid_left_${j.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,z.value.left.color,1],[`100%`,D(re)(D(ae)(z.value.left.color,z.value.gradient.shiftHue),100-z.value.gradient.intensity),1]]},null,8,[`id`,`stops`]),v(Ae,{t:`linear`,id:`age_pyramid_right_${j.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,D(re)(D(ae)(z.value.right.color,z.value.gradient.shiftHue),100-z.value.gradient.intensity),1],[`100%`,z.value.right.color,1]]},null,8,[`id`,`stops`])]),(S(!0),g(f,null,w(X.value,(e,t)=>(S(),g(`g`,null,[_(`rect`,{x:e.left.x,y:e.left.y,width:D(u)(e.left.width<=0?1e-4:e.left.width),height:e.left.height<=0?1e-4:e.left.height,fill:z.value.gradient.underlayer,rx:z.value.borderRadius},null,8,Ye),_(`rect`,{x:e.left.x,y:e.left.y,width:e.left.width<=0?1e-4:e.left.width,height:e.left.height<=0?1e-4:e.left.height,fill:z.value.gradient.show?`url(#age_pyramid_left_${j.value})`:e.left.color,rx:z.value.borderRadius},null,8,Xe),_(`rect`,{x:e.right.x,y:e.right.y,width:e.right.width<=0?1e-4:e.right.width,height:e.right.height<=0?1e-4:e.right.height,fill:z.value.gradient.underlayer,rx:z.value.borderRadius},null,8,Ze),_(`rect`,{x:e.right.x,y:e.right.y,width:e.right.width<=0?1e-4:e.right.width,height:e.right.height<=0?1e-4:e.right.height,fill:z.value.gradient.show?`url(#age_pyramid_right_${j.value})`:e.right.color,rx:z.value.borderRadius},null,8,Qe)]))),256)),(S(!0),g(f,null,w(X.value,(e,t)=>(S(),g(`g`,null,[B.value.show?(S(),g(f,{key:0},[!B.value.showOnHover||B.value.showOnHover&&M.value===t?(S(),g(`text`,{key:0,x:e.left.x+Math.max(1e-4,e.left.width)-B.value.offsetX-6,y:e.left.y+Math.max(1e-4,e.left.height/2)+z.value.gap/2,"text-anchor":`end`,"dominant-baseline":`middle`,"font-size":B.value.fontSize,"font-weight":B.value.bold?`bold`:`normal`,fill:B.value.color,stroke:L.value.backgroundColor,"paint-order":`stroke fill`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`},E(D(d)(B.value.formatter,e.left.value,D(l)({v:e.left.value}),{datapoint:e.left,seriesIndex:t})),9,$e)):h(``,!0)],64)):h(``,!0),B.value.show?(S(),g(f,{key:1},[!B.value.showOnHover||B.value.showOnHover&&M.value===t?(S(),g(`text`,{key:0,x:e.right.x+B.value.offsetX+6,y:e.right.y+Math.max(1e-4,e.right.height/2)+z.value.gap/2,"text-anchor":`start`,"dominant-baseline":`middle`,"font-size":B.value.fontSize,"font-weight":B.value.bold?`bold`:`normal`,fill:B.value.color,stroke:L.value.backgroundColor,"paint-order":`stroke fill`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`},E(D(d)(B.value.formatter,e.right.value,D(l)({v:e.right.value}),{datapoint:e.right,seriesIndex:t})),9,et)):h(``,!0)],64)):h(``,!0)]))),256)),_(`g`,null,[R.value.sideTitles.show?(S(),g(`g`,tt,[_(`text`,{x:q.value.left,y:R.value.sideTitles.fontSize,fill:R.value.sideTitles.useSideColor?z.value.left.color:R.value.sideTitles.color,"font-size":R.value.sideTitles.fontSize,"text-anchor":`start`,"font-weight":R.value.sideTitles.bold?`bold`:`normal`},E(I.value.translations.female),9,nt),_(`text`,{x:q.value.right,y:R.value.sideTitles.fontSize,fill:R.value.sideTitles.useSideColor?z.value.right.color:R.value.sideTitles.color,"font-size":R.value.sideTitles.fontSize,"text-anchor":`end`,"font-weight":R.value.sideTitles.bold?`bold`:`normal`},E(I.value.translations.male),9,rt)])):h(``,!0),R.value.yAxis.show?(S(),g(`g`,it,[(S(!0),g(f,null,w(hn.value,(e,t)=>(S(),g(f,null,[t%R.value.yAxis.showEvery===0&&(!B.value.show||B.value.showOnHover&&M.value===t||M.value===null)||(B.value.show||B.value.showOnHover)&&M.value===t?(S(),g(`text`,{key:0,x:q.value.centerX,y:q.value.top+q.value.height/Y.value/2+q.value.height/Y.value*t,"dominant-baseline":`middle`,"text-anchor":`middle`,"font-size":R.value.yAxis.fontSize,fill:R.value.yAxis.color,"font-weight":R.value.yAxis.bold?`bold`:`normal`},E(D(d)(R.value.yAxis.formatter,e,D(l)({v:e}),{datapoint:e,seriesIndex:t})),9,at)):h(``,!0)],64))),256))])):h(``,!0),R.value.xAxis.show?(S(),g(`g`,ot,[L.value.layout.grid.show?(S(),g(`g`,st,[_(`line`,{x1:J.value.right[0].x,x2:J.value.right.at(-1).x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,ct),_(`line`,{x1:J.value.left[0].x,x2:J.value.left.at(-1).x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,lt)])):h(``,!0),(S(!0),g(f,null,w(J.value.right,(e,t)=>(S(),g(`g`,null,[L.value.layout.grid.show?(S(),g(`line`,{key:0,x1:e.x,x2:e.x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2+4,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,ut)):h(``,!0)]))),256)),(S(!0),g(f,null,w(J.value.left,(e,t)=>(S(),g(`g`,null,[L.value.layout.grid.show?(S(),g(`line`,{key:0,x1:e.x,x2:e.x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2+4,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,dt)):h(``,!0)]))),256)),_(`g`,{ref_key:`xAxisLabels`,ref:Lt},[(S(!0),g(f,null,w(J.value.right,(e,t)=>(S(),g(`text`,{class:`vue-ui-age-pyramid-x-axis-label`,"font-size":R.value.xAxis.fontSize,fill:R.value.xAxis.color,"text-anchor":R.value.xAxis.rotation>0?`start`:R.value.xAxis.rotation<0?`end`:`middle`,"font-weight":R.value.xAxis.bold?`bold`:`normal`,transform:`translate(${e.x}, ${q.value.bottom+R.value.xAxis.fontSize*2}) rotate(${R.value.xAxis.rotation})`},E(D(d)(R.value.xAxis.formatter,e.value/R.value.xAxis.scale,D(l)({v:e.value/L.value.layout.dataLabels.xAxis.scale}),{datapoint:e,seriesIndex:t})),9,ft))),256)),(S(!0),g(f,null,w(J.value.left,(e,t)=>(S(),g(`text`,{class:`vue-ui-age-pyramid-x-axis-label`,"font-size":R.value.xAxis.fontSize,fill:R.value.xAxis.color,"text-anchor":R.value.xAxis.rotation>0?`start`:R.value.xAxis.rotation<0?`end`:`middle`,"font-weight":R.value.xAxis.bold?`bold`:`normal`,transform:`translate(${e.x}, ${q.value.bottom+R.value.xAxis.fontSize*2}) rotate(${R.value.xAxis.rotation})`},E(D(d)(R.value.xAxis.formatter,e.value/R.value.xAxis.scale,D(l)({v:e.value/L.value.layout.dataLabels.xAxis.scale}),{datapoint:e,seriesIndex:t})),9,pt))),256))],512),_(`text`,{x:q.value.right,y:K.value.height,"text-anchor":`end`,"font-size":R.value.xAxis.fontSize,fill:R.value.xAxis.color,"font-weight":R.value.xAxis.bold?`bold`:`normal`},E(R.value.xAxis.translation),9,mt)])):h(``,!0)]),(S(!0),g(f,null,w(e.dataset,(e,t)=>(S(),g(`g`,null,[_(`rect`,{x:q.value.left,y:q.value.top+q.value.height/Y.value*t-z.value.gap/2,width:q.value.width<=0?1e-4:q.value.width,height:q.value.height/Y.value<=0?1e-4:q.value.height/Y.value,fill:M.value!==null&&M.value===t?D(re)(L.value.highlighter.color,L.value.highlighter.opacity):`transparent`,onMouseover:n=>wn(t,e,`pointer`),onMouseleave:n=>Sn(t,e),onClick:n=>xn(t,e)},null,40,ht)]))),256)),T(s.$slots,`svg`,{svg:{...K.value,drawingArea:q.value,isPrintingImg:D(nn)||D(rn)||D(Ln),isPrintingSvg:D(Rn)}},void 0,!0)],46,qe)),s.$slots.hint?(S(),g(`div`,gt,[T(s.$slots,`hint`,x(b({hint:I.value.a11y.translations.keyboardNavigation,isVisible:Vt.value})),void 0,!0)])):h(``,!0)]),s.$slots.watermark?(S(),g(`div`,_t,[T(s.$slots,`watermark`,x(b({isPrinting:D(nn)||D(rn)||D(Ln)||D(Rn)})),void 0,!0)])):h(``,!0),T(s.$slots,`legend`,{legend:X.value},void 0,!0),s.$slots.source?(S(),g(`div`,{key:6,ref_key:`source`,ref:Nt,dir:`auto`},[T(s.$slots,`source`,{},void 0,!0)],512)):h(``,!0),v(D(vt),{teleportTo:L.value.tooltip.teleportTo,show:G.value.showTooltip&&kt.value,backgroundColor:L.value.tooltip.backgroundColor,color:L.value.tooltip.color,borderRadius:L.value.tooltip.borderRadius,borderColor:L.value.tooltip.borderColor,borderWidth:L.value.tooltip.borderWidth,fontSize:L.value.tooltip.fontSize,backgroundOpacity:L.value.tooltip.backgroundOpacity,position:L.value.tooltip.position,offsetX:L.value.tooltip.offsetX,offsetY:L.value.tooltip.offsetY,parent:N.value,content:At.value,isFullscreen:Q.value,isCustom:L.value.tooltip.customFormat&&typeof L.value.tooltip.customFormat==`function`,smooth:L.value.tooltip.smooth,backdropFilter:L.value.tooltip.backdropFilter,smoothForce:L.value.tooltip.smoothForce,smoothSnapThreshold:L.value.tooltip.smoothSnapThreshold,isA11yMode:F.value===`keyboard`,a11yPosition:Bt.value},{"tooltip-before":k(()=>[T(s.$slots,`tooltip-before`,x(b({...yn.value})),void 0,!0)]),tooltip:k(()=>[T(s.$slots,`tooltip`,x(b({...yn.value})),void 0,!0)]),"tooltip-after":k(()=>[T(s.$slots,`tooltip-after`,x(b({...yn.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`]),Ot.value&&I.value.userOptions.buttons.table?(S(),m(Be($.value.component),Pe({key:7},$.value.props,{ref_key:`tableUnit`,ref:Rt,onClose:Pn}),Me({content:k(()=>[(S(),m(D(xt),{key:`table_${It.value}`,colNames:Z.value.colNames,head:Z.value.head,body:Z.value.body,config:Z.value.config,title:I.value.table.useDialog?``:$.value.title,withCloseButton:!I.value.table.useDialog,isCursorPointer:V.value,onClose:Pn},{th:k(({th:e})=>[Ne(E(e),1)]),td:k(({td:e})=>[Ne(E(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[I.value.table.useDialog?{name:`title`,fn:k(()=>[Ne(E($.value.title),1)]),key:`0`}:void 0,I.value.table.useDialog?{name:`actions`,fn:k(()=>[_(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:c[0]||=e=>Tn(I.value.userOptions.callbacks.csv),style:Le({cursor:V.value?`pointer`:`default`})},[v(D(yt),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):h(``,!0),T(s.$slots,`skeleton`,{},()=>[D(Ut)?(S(),m(ye,{key:0})):h(``,!0)],!0)],46,We))}},[[`__scopeId`,`data-v-7bff9fd5`]]);export{Ue as n,vt as t};
|
|
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"./resolveChartConfig-0IvbmIE_.js";import{$ as l,D as te,Dt as ne,Jt as re,X as ie,Yt as ae,at as oe,b as u,et as se,i as d,in as ce,nt as le,pt as ue,t as de,tn as fe,zt as pe}from"./lib-rPeBMZrn.js";import{n as me,t as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./useConfig-_JwRfIqE.js";import{t as _e}from"./useSvgLabelLayout-42Kats14.js";import{n as ve,t as ye}from"./BaseScanner-8NdoBs7B.js";import{t as be}from"./usePrinter-DVf3YcG5.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ee}from"./img-D4RQwASc.js";import{n as De}from"./Title-BliHuXfT.js";import{t as Oe}from"./vue_ui_age_pyramid-DXJeenVU.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 f,computed as p,createBlock as m,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createSlots as Me,createTextVNode as Ne,createVNode as v,defineAsyncComponent as y,guardReactiveProps as b,mergeProps as Pe,nextTick as Fe,normalizeClass as Ie,normalizeProps as x,normalizeStyle as Le,onBeforeUnmount as Re,onMounted as ze,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as Be,shallowRef as Ve,toDisplayString as E,toRefs as He,unref as D,watch as O,withCtx as k}from"vue";var Ue=/* @__PURE__ */ e({default:()=>vt}),We=[`id`],Ge=[`id`],Ke={style:{position:`relative`}},qe=[`xmlns`,`viewBox`,`aria-describedby`],Je=[`x`,`y`,`width`,`height`],Ye=[`x`,`y`,`width`,`height`,`fill`,`rx`],Xe=[`x`,`y`,`width`,`height`,`fill`,`rx`],Ze=[`x`,`y`,`width`,`height`,`fill`,`rx`],Qe=[`x`,`y`,`width`,`height`,`fill`,`rx`],$e=[`x`,`y`,`font-size`,`font-weight`,`fill`,`stroke`],et=[`x`,`y`,`font-size`,`font-weight`,`fill`,`stroke`],tt={key:0},nt=[`x`,`y`,`fill`,`font-size`,`font-weight`],rt=[`x`,`y`,`fill`,`font-size`,`font-weight`],it={key:1},at=[`x`,`y`,`font-size`,`fill`,`font-weight`],ot={key:2},st={key:0},ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],lt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft=[`font-size`,`fill`,`text-anchor`,`font-weight`,`transform`],pt=[`font-size`,`fill`,`text-anchor`,`font-weight`,`transform`],mt=[`x`,`y`,`font-size`,`fill`,`font-weight`],ht=[`x`,`y`,`width`,`height`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],gt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_t={key:5,class:`vue-data-ui-watermark`},vt=/*#__PURE__*/ je({__name:`vue-ui-age-pyramid`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:je,emit:Ue}){let vt=y(()=>import(`./Tooltip-C1q0Qoh7.js`)),yt=y(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),bt=y(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),xt=y(()=>import(`./DataTable-KeuZB1JM.js`)),St=y(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Ct=y(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),wt=y(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),Tt=y(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_age_pyramid:Et}=ge(),A=e,Dt=Ue,Ot=p(()=>!!A.dataset&&A.dataset.length),j=C(ie()),kt=C(!1),At=C(``),M=C(null),jt=C(0),N=C(null),Mt=C(null),Nt=C(null),Pt=C(null),Ft=C(0),It=C(0),Lt=C(null),Rt=C(null),zt=C(null),P=C(null),Bt=C({x:0,y:0}),F=C(`pointer`),Vt=C(!1),I=C(Yt()),L=p(()=>I.value.style),R=p(()=>I.value.style.layout.dataLabels),z=p(()=>I.value.style.layout.bars),B=p(()=>I.value.style.layout.bars.labels);me({config:()=>I.value,dataset:()=>A.dataset,component:`VueUiAgePyramid`,rules:[he.emptyArray,{test:e=>e.length>130,message:[`👀 Dataset has > 130 points. Consider:`,``,`▶️ Grouping small values into aggregated categories.`,``,`▶️ Using VueUiStackline to display data in a more compact way.`]}]});let V=p(()=>I.value.userOptions.useCursorPointer),Ht=p(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},translations:{male:``,female:``},style:{backgroundColor:`#99999930`,layout:{bars:{left:{color:`#CACACA`},right:{color:`#999999`}},dataLabels:{xAxis:{fontSize:0,scale:1e3,translation:``},yAxis:{show:!1}},grid:{stroke:`#6A6A6A`}}}},userConfig:I.value.skeletonConfig??{}})),{loading:Ut,FINAL_DATASET:Wt,manualLoading:Gt}=ve({...He(A),FINAL_CONFIG:I,prepareConfig:Yt,skeletonDataset:A.config?.skeletonDataset??[[`_`,9,2,2],[`_`,8,3,3],[`_`,7,5,5],[`_`,6,8,8],[`_`,5,13,13],[`_`,4,21,21],[`_`,3,34,34],[`_`,2,55,55],[`_`,1,89,89],[`_`,0,144,144]],skeletonConfig:ce({defaultConfig:I.value,userConfig:Ht.value})}),{userOptionsVisible:Kt,setUserOptionsVisibility:qt,keepUserOptionState:Jt}=Ce({config:I.value}),{svgRef:H}=we({config:I.value.style.title});function Yt(){return ee(A.config,Et,Oe)}function Xt(e){let t=se(e);return t?.style?.chart&&delete t.style.tooltip,JSON.stringify(t)}let Zt=Xt(A.config);O(()=>A.config,(e,t)=>{let n=Xt(e),r=n!==Zt;Zt=n;let i=Yt();r?(Ut.value||(I.value=i),Kt.value=!I.value.userOptions.showOnChartHover,tn(),Ft.value+=1,It.value+=1,G.value.showTable=I.value.table.show,G.value.showTooltip=I.value.style.tooltip.show):(I.value.style.tooltip=i.style.tooltip,G.value.showTooltip=I.value.style.tooltip.show)},{deep:!0}),O(()=>A.dataset,e=>{Array.isArray(e)&&e.length>0&&(Gt.value=!1)},{deep:!0});let U=Ve(null),W=Ve(null),Qt=C(!1),$t=0;ze(()=>{tn()});let en=p(()=>I.value.debug);function tn(){pe(A.dataset)&&(oe({componentName:`VueUiAgePyramid`,type:`dataset`,debug:en.value}),Gt.value=!0),pe(A.dataset)||(Gt.value=I.value.loading),I.value.responsive&&(U.value&&(W.value&&U.value.unobserve(W.value),U.value.disconnect()),U.value=new ResizeObserver(()=>{let{width:e,height:t}=xe({chart:N.value,title:L.value.title.text?Mt.value:null,source:Nt.value,noTitle:Pt.value});cancelAnimationFrame($t),$t=requestAnimationFrame(()=>{K.value.width=e,K.value.height=t,Qt.value=!0})}),W.value=N.value.parentNode,U.value.observe(W.value))}Re(()=>{cancelAnimationFrame($t),U.value&&(W.value&&U.value.unobserve(W.value),U.value.disconnect())});let{isPrinting:nn,isImaging:rn,generatePdf:an,generateImage:on}=be({elementId:`vue-ui-age-pyramid_${j.value}`,fileName:L.value.title.text||`vue-ui-age-pyramid`,options:I.value.userOptions.print}),sn=p(()=>I.value.userOptions.show&&!L.value.title.text),G=C({showTable:I.value.table.show,showTooltip:L.value.tooltip.show});O(I,()=>{G.value={showTable:I.value.table.show,showTooltip:L.value.tooltip.show}},{immediate:!0});let K=C({height:L.value.height,width:L.value.width}),cn=p(()=>K.value.width),ln=p(()=>K.value.height),{metrics:un,ready:dn,settling:fn,update:pn}=_e({svgRef:H,canMeasure:()=>!I.value.responsive||Qt.value,initialMetrics:{bottom:0},measure:e=>({bottom:e(Lt.value).height})}),mn=p(()=>un.value.bottom),q=p(()=>{let e=K.value.width-L.value.layout.padding.right-L.value.layout.padding.left,t=L.value.layout.padding.left,n=K.value.width-L.value.layout.padding.right;return{top:L.value.layout.padding.top+R.value.sideTitles.fontSize+R.value.sideTitles.offsetY+12,left:t,right:n,bottom:K.value.height-L.value.layout.padding.bottom-mn.value,width:e,height:K.value.height-L.value.layout.padding.top-L.value.layout.padding.bottom-mn.value-R.value.sideTitles.fontSize-R.value.sideTitles.offsetY-12,centerX:L.value.layout.padding.left+e/2,leftChart:{width:e/2-L.value.layout.centerSlit.width,right:t+e/2-L.value.layout.centerSlit.width},rightChart:{width:e/2-L.value.layout.centerSlit.width,left:t+e/2+L.value.layout.centerSlit.width}}}),hn=p(()=>Wt.value.map(e=>R.value.yAxis.display===`age`?e[1]:e[0])),J=p(()=>{let e=gn(_n.value/5),t=[],n=[];for(let r=0;r<=5;r+=1){let i=e*r,a=e*(r-5);t.push({value:i,x:q.value.left+q.value.width/2+L.value.layout.centerSlit.width+i/_n.value*q.value.leftChart.width}),n.push({value:Math.abs(a),x:q.value.left+q.value.width/2+a/_n.value*q.value.leftChart.width-L.value.layout.centerSlit.width})}return{right:t,left:n}});function gn(e){if(e===0)return 0;let t=10**Math.floor(Math.log10(Math.abs(e))),n;return n=Math.round(e/t)*t,n}let _n=p(()=>Math.max(...Wt.value.flatMap(e=>e.slice(-2).map(e=>u(e))))),Y=p(()=>Wt.value.length),vn=p(()=>Wt.value.map(e=>({segment:e[0],age:e[1],left:{value:e[2],proportionToMax:e[2]/_n.value},right:{value:e[3],proportionToMax:e[3]/_n.value}}))),X=p(()=>vn.value.map((e,t)=>{let n=q.value.top+q.value.height/Y.value*t,r=q.value.height/Y.value-z.value.gap;return{segment:e.segment,age:e.age,left:{...e.left,y:n,color:z.value.left.color,x:q.value.leftChart.right-e.left.proportionToMax*q.value.leftChart.width,width:u(e.left.proportionToMax*q.value.leftChart.width),height:r},right:{...e.right,y:n,color:z.value.right.color,x:q.value.rightChart.left,width:u(e.right.proportionToMax*q.value.rightChart.width),height:r}}})),yn=C(null);function bn(e){let[t,n,r,i]=e;return{segment:t,index:n,left:r,right:i}}function xn(e,t){I.value.events.datapointClick&&I.value.events.datapointClick({datapoint:bn(t),seriesIndex:e})}function Sn(e,t){I.value.events.datapointLeave&&I.value.events.datapointLeave({datapoint:bn(t),seriesIndex:e}),(F.value!==`keyboard`||P.value!==e)&&(M.value=null,kt.value=!1)}function Cn(e){if(!H.value)return;let t=X.value[e];if(!t)return;let n=fe(q.value.left+q.value.width/2,t.left.y+t.left.height/2,H.value);n&&(Bt.value=n)}function wn(e,t,n=`pointer`){I.value.events.datapointEnter&&I.value.events.datapointEnter({datapoint:bn(t),seriesIndex:e}),M.value=e,P.value=e,F.value=n,yn.value={datapoint:t,seriesIndex:e,series:X.value,config:I.value};let r=L.value.tooltip.customFormat;if(ne(r)&&ue(()=>r({seriesIndex:e,datapoint:{segment:t[0],index:t[1],left:t[2],right:t[3]},series:X.value,config:I.value})))At.value=r({seriesIndex:e,datapoint:{segment:t[0],index:t[1],left:t[2],right:t[3]},series:X.value,config:I.value});else{let n=``,r=X.value[e];n+=`<div><b>${r.segment}</b></div>`,n+=`<div>${I.value.translations.age}: ${d(R.value.yAxis.formatter,u(r.age),l({v:u(r.age)}),{datapoint:t,seriesIndex:e})}</div>`,n+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${L.value.tooltip.borderColor}">`,n+=`<div style="display:flex; flex-direction:row;gap:12px">`,n+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.show?`url(#age_pyramid_left_${j.value})`:z.value.left.color}"/></svg><div>${I.value.translations.female}</div><div><b>${d(R.value.xAxis.formatter,u(r.left.value),l({v:u(r.left.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,n+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${z.value.gradient.show?`url(#age_pyramid_right_${j.value})`:z.value.right.color}"/></svg><div>${I.value.translations.male}</div><div><b>${d(R.value.xAxis.formatter,u(r.right.value),l({v:u(r.right.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,n+=`</div>`,n+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${L.value.tooltip.borderColor}"><div>${I.value.translations.total}</div><div><b>${d(R.value.xAxis.formatter,u(r.right.value)+u(r.left.value),l({v:u(r.right.value)+u(r.left.value)}),{datapoint:t,seriesIndex:e})}</b></div></div>`,n+=`</div>`,At.value=`<div>${n}</div>`}kt.value=!0,n===`keyboard`&&Fe(()=>{Cn(e)})}function Tn(e=null){Fe(()=>{let t=[I.value.translations.year,I.value.translations.age,I.value.translations.female,I.value.translations.male,I.value.translations.total],n=A.dataset.map(e=>[e[0],e[1],e[2],e[3],e[2]??0+e[3]??0]),r=[[L.value.title.text],[L.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),i=te(r);e?e(i):le({csvContent:i,title:L.value.title.text||`vue-ui-heatmap`})})}let Z=p(()=>{let e=[I.value.translations.year,I.value.translations.age,I.value.translations.female,I.value.translations.male,I.value.translations.total];return{head:e,body:A.dataset.map(e=>[e[0],e[1],e[2]==null?``:e[2].toLocaleString(),e[3]==null?``:e[3].toLocaleString(),(e[2]??0+e[3]??0).toLocaleString()]),config:{th:{backgroundColor:I.value.table.th.backgroundColor,color:I.value.table.th.color,outline:I.value.table.th.outline},td:{backgroundColor:I.value.table.td.backgroundColor,color:I.value.table.td.color,outline:I.value.table.td.outline},breakpoint:I.value.table.responsiveBreakpoint},colNames:e}}),Q=C(!1);function En(e){Q.value=e,jt.value+=1}function Dn(){G.value.showTable=!G.value.showTable}function On(){G.value.showTooltip=!G.value.showTooltip}let kn=C(!1);function An(){kn.value=!kn.value}async function jn({scale:e=2}={}){if(!N.value)return;let{width:t,height:n}=N.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await Ee({domElement:N.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:L.value.title.text,width:t,height:n,aspectRatio:r}}let Mn=C([]),Nn=C({start:0,end:X.value.length});Te({timeLabelsEls:Lt,timeLabels:Mn,slicer:Nn,configRef:I,rotationPath:[`style`,`layout`,`dataLabels`,`xAxis`,`rotation`],autoRotatePath:[`style`,`layout`,`dataLabels`,`xAxis`,`autoRotate`,`enable`],isAutoSize:!1,width:cn,height:ln,targetClass:`.vue-ui-age-pyramid-x-axis-label`,rotation:L.value.layout.dataLabels.xAxis.autoRotate.angle});let $=p(()=>c({config:I,style:L,mutableConfig:G,dialog:Tt,accordion:bt,isFullscreen:Q,parent:N,maxWidth:800,isCursorPointer:V}));O(()=>G.value.showTable,e=>s(e,I,Rt));function Pn(){G.value.showTable=!1,zt.value&&zt.value.setTableIconState(!1)}let Fn=p(()=>I.value.style.backgroundColor),In=p(()=>I.value.style.title),{isCallbackImaging:Ln,isCallbackSvg:Rn,generateSvg:zn,onGenerateImage:Bn}=Se({svg:H,title:In,legend:null,legendItems:null,backgroundColor:Fn,getSvgCallback:()=>I.value.userOptions.callbacks.svg,generateImage:on});async function Vn(){Dt(`copyAlt`,{config:I.value,dataset:X.value}),I.value.userOptions.callbacks.altCopy?await Promise.resolve(I.value.userOptions.callbacks.altCopy({config:I.value,dataset:X.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Hn(){Vt.value=!0}function Un(){M.value=null,P.value=null,F.value=`pointer`,kt.value=!1,Vt.value=!1}function Wn(e){if(!H.value||kn.value||document.activeElement!==H.value||!X.value.length)return;let t=[`ArrowUp`,`ArrowLeft`].includes(e.key),n=[`ArrowDown`,`ArrowRight`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){M.value=null,P.value=null,F.value=`pointer`,kt.value=!1;return}if(r){if(P.value===null)return;let e=A.dataset[P.value];if(!e)return;xn(P.value,e);return}let a=P.value,o=M.value,s=a!==null&&a>=0&&a<X.value.length,c=o!==null&&o>=0&&o<X.value.length;s?t?a=a-1<0?X.value.length-1:a-1:n&&(a=a+1>X.value.length-1?0:a+1):c?(a=n?o+1:o-1,a>=X.value.length&&(a=0),a<0&&(a=X.value.length-1)):a=n?0:X.value.length-1;let ee=A.dataset[a];ee&&wn(a,ee,`keyboard`)}return je({getImage:jn,generatePdf:an,generateCsv:Tn,generateImage:on,generateSvg:zn,toggleTable:Dn,toggleTooltip:On,toggleAnnotator:An,toggleFullscreen:En,copyAlt:Vn}),O(()=>[K.value,R.value,Lt.value,A.dataset,Qt.value,I.value.style.fontFamily],pn,{flush:`post`,deep:!0}),(s,c)=>(S(),g(`div`,{class:Ie(`vue-data-ui-component vue-ui-age-pyramid ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`agePyramid`,ref:N,id:`vue-ui-age-pyramid_${j.value}`,style:Le(`font-family:${L.value.fontFamily};width:100%; text-align:center;background:${L.value.backgroundColor};${I.value.responsive?`height:100%`:``}`),onMouseenter:c[1]||=()=>D(qt)(!0),onMouseleave:c[2]||=()=>D(qt)(!1)},[_(`div`,{id:`chart-instructions-${j.value}`,class:`sr-only`},[_(`p`,null,E(I.value.a11y.translations.keyboardNavigation),1)],8,Ge),Z.value?.body?.length?(S(),m(ke,{key:0,uid:j.value,head:Z.value.head,body:Z.value.body,notice:I.value.a11y.translations.tableAvailable,caption:I.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):h(``,!0),I.value.userOptions.buttons.annotator?(S(),m(D(St),Pe({key:1},D(a)(I.value.userOptions.annotator),{svgRef:D(H),backgroundColor:L.value.backgroundColor,color:L.value.color,active:kn.value,isCursorPointer:V.value,palette:I.value.userOptions.annotatorPalette,onClose:An}),Me({_:2},[w(D(o),e=>({name:e,fn:k(t=>[T(s.$slots,e,x(b(D(i)(e,t))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):h(``,!0),sn.value?(S(),g(`div`,{key:2,ref_key:`noTitle`,ref:Pt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):h(``,!0),L.value.title.text?(S(),g(`div`,{key:3,ref_key:`chartTitle`,ref:Mt,style:`width:100%;background:transparent`},[(S(),m(De,{key:`title_${Ft.value}`,config:{title:{cy:`pyramid-div-title`,...L.value.title},subtitle:{cy:`pyramid-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):h(``,!0),I.value.userOptions.show&&Ot.value&&(D(Jt)||D(Kt))?(S(),m(D(Ct),Pe({ref_key:`userOptionsRef`,ref:zt,key:`user_options_${jt.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:D(rn),isPrinting:D(nn),uid:j.value,hasTooltip:I.value.userOptions.buttons.tooltip&&L.value.tooltip.show,isFullscreen:Q.value,isTooltip:G.value.showTooltip,chartElement:N.value},D(n)(I.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:kn.value,tableDialog:I.value.table.useDialog,isCursorPointer:V.value,onToggleFullscreen:En,onGeneratePdf:D(an),onGenerateCsv:Tn,onGenerateImage:D(Bn),onGenerateSvg:D(zn),onToggleTable:Dn,onToggleTooltip:On,onToggleAnnotator:An,onCopyAlt:Vn,style:{visibility:D(Jt)?D(Kt)?`visible`:`hidden`:`visible`}}),Me({_:2},[w(D(t)(s.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:k(t=>[T(s.$slots,e,x(b(D(r)(e,t))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):h(``,!0),_(`div`,Ke,[(S(),g(`svg`,{ref_key:`svgRef`,ref:H,xmlns:D(de),class:Ie({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${K.value.width<=0?10:K.value.width} ${K.value.height<=0?10:K.value.height}`,style:Le(`max-width:100%;overflow:visible;background:transparent;color:${L.value.color};visibility:${D(dn)?`visible`:`hidden`}`),tabindex:`0`,"aria-describedby":`chart-instructions-${j.value}`,onFocus:Hn,onBlur:Un,onKeydown:Wn},[v(D(wt)),T(s.$slots,`svg-underlayer`,{svg:{...K.value,drawingArea:q.value,isPrintingImg:D(nn)||D(rn)||D(Ln),isPrintingSvg:D(Rn)}},void 0,!0),s.$slots[`chart-background`]?(S(),g(`foreignObject`,{key:0,x:q.value.left,y:q.value.top,width:Math.max(.1,q.value.width),height:Math.max(.1,q.value.height),style:{pointerEvents:`none`}},[T(s.$slots,`chart-background`,{},void 0,!0)],8,Je)):h(``,!0),_(`defs`,null,[v(Ae,{t:`linear`,id:`age_pyramid_left_${j.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,z.value.left.color,1],[`100%`,D(re)(D(ae)(z.value.left.color,z.value.gradient.shiftHue),100-z.value.gradient.intensity),1]]},null,8,[`id`,`stops`]),v(Ae,{t:`linear`,id:`age_pyramid_right_${j.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,D(re)(D(ae)(z.value.right.color,z.value.gradient.shiftHue),100-z.value.gradient.intensity),1],[`100%`,z.value.right.color,1]]},null,8,[`id`,`stops`])]),(S(!0),g(f,null,w(X.value,(e,t)=>(S(),g(`g`,null,[_(`rect`,{x:e.left.x,y:e.left.y,width:D(u)(e.left.width<=0?1e-4:e.left.width),height:e.left.height<=0?1e-4:e.left.height,fill:z.value.gradient.underlayer,rx:z.value.borderRadius},null,8,Ye),_(`rect`,{x:e.left.x,y:e.left.y,width:e.left.width<=0?1e-4:e.left.width,height:e.left.height<=0?1e-4:e.left.height,fill:z.value.gradient.show?`url(#age_pyramid_left_${j.value})`:e.left.color,rx:z.value.borderRadius},null,8,Xe),_(`rect`,{x:e.right.x,y:e.right.y,width:e.right.width<=0?1e-4:e.right.width,height:e.right.height<=0?1e-4:e.right.height,fill:z.value.gradient.underlayer,rx:z.value.borderRadius},null,8,Ze),_(`rect`,{x:e.right.x,y:e.right.y,width:e.right.width<=0?1e-4:e.right.width,height:e.right.height<=0?1e-4:e.right.height,fill:z.value.gradient.show?`url(#age_pyramid_right_${j.value})`:e.right.color,rx:z.value.borderRadius},null,8,Qe)]))),256)),(S(!0),g(f,null,w(X.value,(e,t)=>(S(),g(`g`,null,[B.value.show?(S(),g(f,{key:0},[!B.value.showOnHover||B.value.showOnHover&&M.value===t?(S(),g(`text`,{key:0,x:e.left.x+Math.max(1e-4,e.left.width)-B.value.offsetX-6,y:e.left.y+Math.max(1e-4,e.left.height/2)+z.value.gap/2,"text-anchor":`end`,"dominant-baseline":`middle`,"font-size":B.value.fontSize,"font-weight":B.value.bold?`bold`:`normal`,fill:B.value.color,stroke:L.value.backgroundColor,"paint-order":`stroke fill`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`},E(D(d)(B.value.formatter,e.left.value,D(l)({v:e.left.value}),{datapoint:e.left,seriesIndex:t})),9,$e)):h(``,!0)],64)):h(``,!0),B.value.show?(S(),g(f,{key:1},[!B.value.showOnHover||B.value.showOnHover&&M.value===t?(S(),g(`text`,{key:0,x:e.right.x+B.value.offsetX+6,y:e.right.y+Math.max(1e-4,e.right.height/2)+z.value.gap/2,"text-anchor":`start`,"dominant-baseline":`middle`,"font-size":B.value.fontSize,"font-weight":B.value.bold?`bold`:`normal`,fill:B.value.color,stroke:L.value.backgroundColor,"paint-order":`stroke fill`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`},E(D(d)(B.value.formatter,e.right.value,D(l)({v:e.right.value}),{datapoint:e.right,seriesIndex:t})),9,et)):h(``,!0)],64)):h(``,!0)]))),256)),_(`g`,null,[R.value.sideTitles.show?(S(),g(`g`,tt,[_(`text`,{x:q.value.left,y:R.value.sideTitles.fontSize,fill:R.value.sideTitles.useSideColor?z.value.left.color:R.value.sideTitles.color,"font-size":R.value.sideTitles.fontSize,"text-anchor":`start`,"font-weight":R.value.sideTitles.bold?`bold`:`normal`},E(I.value.translations.female),9,nt),_(`text`,{x:q.value.right,y:R.value.sideTitles.fontSize,fill:R.value.sideTitles.useSideColor?z.value.right.color:R.value.sideTitles.color,"font-size":R.value.sideTitles.fontSize,"text-anchor":`end`,"font-weight":R.value.sideTitles.bold?`bold`:`normal`},E(I.value.translations.male),9,rt)])):h(``,!0),R.value.yAxis.show?(S(),g(`g`,it,[(S(!0),g(f,null,w(hn.value,(e,t)=>(S(),g(f,null,[t%R.value.yAxis.showEvery===0&&(!B.value.show||B.value.showOnHover&&M.value===t||M.value===null)||(B.value.show||B.value.showOnHover)&&M.value===t?(S(),g(`text`,{key:0,x:q.value.centerX,y:q.value.top+q.value.height/Y.value/2+q.value.height/Y.value*t,"dominant-baseline":`middle`,"text-anchor":`middle`,"font-size":R.value.yAxis.fontSize,fill:R.value.yAxis.color,"font-weight":R.value.yAxis.bold?`bold`:`normal`},E(D(d)(R.value.yAxis.formatter,e,D(l)({v:e}),{datapoint:e,seriesIndex:t})),9,at)):h(``,!0)],64))),256))])):h(``,!0),R.value.xAxis.show?(S(),g(`g`,ot,[L.value.layout.grid.show?(S(),g(`g`,st,[_(`line`,{x1:J.value.right[0].x,x2:J.value.right.at(-1).x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,ct),_(`line`,{x1:J.value.left[0].x,x2:J.value.left.at(-1).x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,lt)])):h(``,!0),(S(!0),g(f,null,w(J.value.right,(e,t)=>(S(),g(`g`,null,[L.value.layout.grid.show?(S(),g(`line`,{key:0,x1:e.x,x2:e.x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2+4,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,ut)):h(``,!0)]))),256)),(S(!0),g(f,null,w(J.value.left,(e,t)=>(S(),g(`g`,null,[L.value.layout.grid.show?(S(),g(`line`,{key:0,x1:e.x,x2:e.x,y1:q.value.bottom+R.value.xAxis.fontSize/2,y2:q.value.bottom+R.value.xAxis.fontSize/2+4,stroke:L.value.layout.grid.stroke,"stroke-width":L.value.layout.grid.strokeWidth,"stroke-linecap":`round`},null,8,dt)):h(``,!0)]))),256)),_(`g`,{ref_key:`xAxisLabels`,ref:Lt},[(S(!0),g(f,null,w(J.value.right,(e,t)=>(S(),g(`text`,{class:`vue-ui-age-pyramid-x-axis-label`,"font-size":R.value.xAxis.fontSize,fill:R.value.xAxis.color,"text-anchor":R.value.xAxis.rotation>0?`start`:R.value.xAxis.rotation<0?`end`:`middle`,"font-weight":R.value.xAxis.bold?`bold`:`normal`,transform:`translate(${e.x}, ${q.value.bottom+R.value.xAxis.fontSize*2}) rotate(${R.value.xAxis.rotation})`},E(D(d)(R.value.xAxis.formatter,e.value/R.value.xAxis.scale,D(l)({v:e.value/L.value.layout.dataLabels.xAxis.scale}),{datapoint:e,seriesIndex:t})),9,ft))),256)),(S(!0),g(f,null,w(J.value.left,(e,t)=>(S(),g(`text`,{class:`vue-ui-age-pyramid-x-axis-label`,"font-size":R.value.xAxis.fontSize,fill:R.value.xAxis.color,"text-anchor":R.value.xAxis.rotation>0?`start`:R.value.xAxis.rotation<0?`end`:`middle`,"font-weight":R.value.xAxis.bold?`bold`:`normal`,transform:`translate(${e.x}, ${q.value.bottom+R.value.xAxis.fontSize*2}) rotate(${R.value.xAxis.rotation})`},E(D(d)(R.value.xAxis.formatter,e.value/R.value.xAxis.scale,D(l)({v:e.value/L.value.layout.dataLabels.xAxis.scale}),{datapoint:e,seriesIndex:t})),9,pt))),256))],512),_(`text`,{x:q.value.right,y:K.value.height,"text-anchor":`end`,"font-size":R.value.xAxis.fontSize,fill:R.value.xAxis.color,"font-weight":R.value.xAxis.bold?`bold`:`normal`},E(R.value.xAxis.translation),9,mt)])):h(``,!0)]),(S(!0),g(f,null,w(e.dataset,(e,t)=>(S(),g(`g`,null,[_(`rect`,{x:q.value.left,y:q.value.top+q.value.height/Y.value*t-z.value.gap/2,width:q.value.width<=0?1e-4:q.value.width,height:q.value.height/Y.value<=0?1e-4:q.value.height/Y.value,fill:M.value!==null&&M.value===t?D(re)(L.value.highlighter.color,L.value.highlighter.opacity):`transparent`,onMouseover:n=>wn(t,e,`pointer`),onMouseleave:n=>Sn(t,e),onClick:n=>xn(t,e)},null,40,ht)]))),256)),T(s.$slots,`svg`,{svg:{...K.value,drawingArea:q.value,isPrintingImg:D(nn)||D(rn)||D(Ln),isPrintingSvg:D(Rn)}},void 0,!0)],46,qe)),s.$slots.hint?(S(),g(`div`,gt,[T(s.$slots,`hint`,x(b({hint:I.value.a11y.translations.keyboardNavigation,isVisible:Vt.value})),void 0,!0)])):h(``,!0)]),s.$slots.watermark?(S(),g(`div`,_t,[T(s.$slots,`watermark`,x(b({isPrinting:D(nn)||D(rn)||D(Ln)||D(Rn)})),void 0,!0)])):h(``,!0),T(s.$slots,`legend`,{legend:X.value},void 0,!0),s.$slots.source?(S(),g(`div`,{key:6,ref_key:`source`,ref:Nt,dir:`auto`},[T(s.$slots,`source`,{},void 0,!0)],512)):h(``,!0),v(D(vt),{teleportTo:L.value.tooltip.teleportTo,show:G.value.showTooltip&&kt.value,backgroundColor:L.value.tooltip.backgroundColor,color:L.value.tooltip.color,borderRadius:L.value.tooltip.borderRadius,borderColor:L.value.tooltip.borderColor,borderWidth:L.value.tooltip.borderWidth,fontSize:L.value.tooltip.fontSize,backgroundOpacity:L.value.tooltip.backgroundOpacity,position:L.value.tooltip.position,offsetX:L.value.tooltip.offsetX,offsetY:L.value.tooltip.offsetY,parent:N.value,content:At.value,isFullscreen:Q.value,isCustom:L.value.tooltip.customFormat&&typeof L.value.tooltip.customFormat==`function`,smooth:L.value.tooltip.smooth,backdropFilter:L.value.tooltip.backdropFilter,smoothForce:L.value.tooltip.smoothForce,smoothSnapThreshold:L.value.tooltip.smoothSnapThreshold,isA11yMode:F.value===`keyboard`,a11yPosition:Bt.value},{"tooltip-before":k(()=>[T(s.$slots,`tooltip-before`,x(b({...yn.value})),void 0,!0)]),tooltip:k(()=>[T(s.$slots,`tooltip`,x(b({...yn.value})),void 0,!0)]),"tooltip-after":k(()=>[T(s.$slots,`tooltip-after`,x(b({...yn.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`]),Ot.value&&I.value.userOptions.buttons.table?(S(),m(Be($.value.component),Pe({key:7},$.value.props,{ref_key:`tableUnit`,ref:Rt,onClose:Pn}),Me({content:k(()=>[(S(),m(D(xt),{key:`table_${It.value}`,colNames:Z.value.colNames,head:Z.value.head,body:Z.value.body,config:Z.value.config,title:I.value.table.useDialog?``:$.value.title,withCloseButton:!I.value.table.useDialog,isCursorPointer:V.value,onClose:Pn},{th:k(({th:e})=>[Ne(E(e),1)]),td:k(({td:e})=>[Ne(E(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[I.value.table.useDialog?{name:`title`,fn:k(()=>[Ne(E($.value.title),1)]),key:`0`}:void 0,I.value.table.useDialog?{name:`actions`,fn:k(()=>[_(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:c[0]||=e=>Tn(I.value.userOptions.callbacks.csv),style:Le({cursor:V.value?`pointer`:`default`})},[v(D(yt),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):h(``,!0),T(s.$slots,`skeleton`,{},()=>[D(Ut)?(S(),m(ye,{key:0})):h(``,!0)],!0)],46,We))}},[[`__scopeId`,`data-v-7bff9fd5`]]);export{Ue as n,vt as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
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 ee,t as te}from"./annotationSlots-OLiW25XN.js";import{t as a}from"./chartImage-DPGnEuYM.js";import{t as ne}from"./resolveChartConfig-0IvbmIE_.js";import{$ as o,Ft as re,S as ie,X as ae,_ as oe,at as se,i as s,in as ce,t as le,yt as ue,zt as de}from"./lib-rPeBMZrn.js";import{c as fe}from"./canvas-lib-22VpOI4_.js";import{n as pe}from"./useHints-C-TwxM0Y.js";import{t as me}from"./useConfig-_JwRfIqE.js";import{t as he}from"./usePrinter-DVf3YcG5.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{t as ve}from"./useResponsive-CENUxfEL.js";import{t as ye}from"./useChartExport-BZts4KFb.js";import{t as be}from"./useUserOptionState-CXlFnwPv.js";import{t as xe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Se}from"./vue_ui_bullet-Biewiy1l.js";import{t as Ce}from"./Legend-W9YVYVX-.js";import{n as we}from"./Title-BliHuXfT.js";import{t as Te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,Teleport as Ee,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as De,createVNode as Oe,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as ke,normalizeClass as Ae,normalizeProps as g,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,toRefs as Pe,unref as S,watch as Fe,withCtx as C}from"vue";var Ie=/* @__PURE__ */ e({default:()=>w}),Le=[`id`],Re={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},ze=[`id`],Be=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Ve=[`id`],He=[`id`],Ue=[`width`,`height`],We={key:1},Ge=[`x`,`y`,`height`,`width`,`fill`,`stroke`],Ke=[`x`,`y`,`height`,`width`,`rx`,`fill`,`stroke`,`stroke-width`],qe=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`],Je=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ye=[`x`,`y`,`height`,`width`,`rx`,`fill`,`stroke`,`stroke-width`],Xe={key:3},Ze=[`x`,`y`,`fill`,`font-size`,`font-weight`],Qe={key:4},$e=[`x1`,`x2`,`y1`,`y2`,`stroke`],et={key:4,class:`vue-data-ui-watermark`},tt=[`id`],nt={key:0,class:`vue-ui-bullet-legend-item`,dir:`auto`},rt={style:{"margin-right":`2px`}},w=/*#__PURE__*/ Te({__name:`vue-ui-bullet`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:Te,emit:Ie}){let w=m(()=>import(`./PackageVersion-
|
|
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 ee,t as te}from"./annotationSlots-OLiW25XN.js";import{t as a}from"./chartImage-DPGnEuYM.js";import{t as ne}from"./resolveChartConfig-0IvbmIE_.js";import{$ as o,Ft as re,S as ie,X as ae,_ as oe,at as se,i as s,in as ce,t as le,yt as ue,zt as de}from"./lib-rPeBMZrn.js";import{c as fe}from"./canvas-lib-22VpOI4_.js";import{n as pe}from"./useHints-C-TwxM0Y.js";import{t as me}from"./useConfig-_JwRfIqE.js";import{t as he}from"./usePrinter-DVf3YcG5.js";import{n as ge,t as _e}from"./BaseScanner-8NdoBs7B.js";import{t as ve}from"./useResponsive-CENUxfEL.js";import{t as ye}from"./useChartExport-BZts4KFb.js";import{t as be}from"./useUserOptionState-CXlFnwPv.js";import{t as xe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Se}from"./vue_ui_bullet-Biewiy1l.js";import{t as Ce}from"./Legend-W9YVYVX-.js";import{n as we}from"./Title-BliHuXfT.js";import{t as Te}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,Teleport as Ee,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as De,createVNode as Oe,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as ke,normalizeClass as Ae,normalizeProps as g,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,toRefs as Pe,unref as S,watch as Fe,withCtx as C}from"vue";var Ie=/* @__PURE__ */ e({default:()=>w}),Le=[`id`],Re={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},ze=[`id`],Be=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Ve=[`id`],He=[`id`],Ue=[`width`,`height`],We={key:1},Ge=[`x`,`y`,`height`,`width`,`fill`,`stroke`],Ke=[`x`,`y`,`height`,`width`,`rx`,`fill`,`stroke`,`stroke-width`],qe=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`],Je=[`x`,`y`,`font-size`,`font-weight`,`fill`],Ye=[`x`,`y`,`height`,`width`,`rx`,`fill`,`stroke`,`stroke-width`],Xe={key:3},Ze=[`x`,`y`,`fill`,`font-size`,`font-weight`],Qe={key:4},$e=[`x1`,`x2`,`y1`,`y2`,`stroke`],et={key:4,class:`vue-data-ui-watermark`},tt=[`id`],nt={key:0,class:`vue-ui-bullet-legend-item`,dir:`auto`},rt={style:{"margin-right":`2px`}},w=/*#__PURE__*/ Te({__name:`vue-ui-bullet`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:Te,emit:Ie}){let w=m(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),it=m(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),at=m(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),{vue_ui_bullet:ot}=me(),T=e,st=Ie,E=v(null),ct=v(null),lt=v(0),ut=v(null),dt=v(null),ft=v(0),D=v(null),O=v(null),pt=v(!1),k=l({get:()=>B.value.hasOwnProperty(`value`),set:e=>e}),A=v(R()),j=l(()=>A.value.debug),M=l(()=>A.value.style.chart.target),N=l(()=>A.value.style.chart.segments),P=l(()=>A.value.style.chart),F=l(()=>A.value.userOptions),I=l(()=>B.value.segments?Array.isArray(B.value.segments)?B.value.segments.length?!0:(j.value&&console.warn(`VueUiBullet: dataset segments is empty. Provide segments with this datastructure:
|
|
2
2
|
|
|
3
3
|
segments: [
|
|
4
4
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
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,At as u,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,nn as fe,nt 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-_JwRfIqE.js";import{t as Se}from"./useSvgLabelLayout-42Kats14.js";import{n as Ce,t as we}from"./BaseScanner-8NdoBs7B.js";import{t as Te}from"./usePrinter-DVf3YcG5.js";import{t as Ee}from"./useNestedProp-DnGoh-XS.js";import{t as De}from"./useResponsive-CENUxfEL.js";import{t as Oe}from"./useThemeCheck-BKNRbGeC.js";import{t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./useChartExport-BZts4KFb.js";import{t as je}from"./useUserOptionState-CXlFnwPv.js";import{t as Me}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ne}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Pe}from"./vue_ui_bump-DZoGcET0.js";import{n as Fe}from"./Title-BliHuXfT.js";import{t as Ie}from"./A11yDataTable-DWNlWXzs.js";import{t as Le}from"./BaseDraggableDialog-DVstuNhT.js";import{t as Re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as d,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as ze,createTextVNode as Be,createVNode as Ve,defineAsyncComponent as _,guardReactiveProps as He,mergeProps as Ue,normalizeClass as We,normalizeProps as Ge,normalizeStyle as v,onBeforeUnmount as Ke,onMounted as qe,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as C,toRefs as Xe,unref as w,watch as T,watchEffect as Ze,withCtx as E}from"vue";var Qe=/* @__PURE__ */ e({default:()=>vt}),$e=[`id`],et=[`id`],tt={style:{position:`relative`}},nt=[`xmlns`,`aria-describedby`,`viewBox`],rt=[`x`,`y`,`width`,`height`],it=[`d`,`stroke`,`stroke-width`,`onMouseenter`],at=[`d`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],ot=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],st=[`x`,`y`,`fill`,`font-size`],ct=[`onMouseenter`,`onMouseleave`,`onClick`],lt=[`x`,`y`,`fill`,`font-size`],ut=[`x`,`y`,`fill`,`font-size`,`font--weight`,`innerHTML`,`onMouseenter`,`onMouseleave`,`onClick`],dt=[`x`,`y`,`fill`,`font-size`,`font--weight`,`innerHTML`,`onMouseenter`,`onMouseleave`,`onClick`],ft={key:0},pt={key:1},mt=[`text-anchor`,`font-size`,`font-weight`,`fill`,`stroke`,`transform`],ht=[`text-anchor`,`font-size`,`fill`,`transform`,`innerHTML`],gt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_t={key:5,class:`vue-data-ui-watermark`},vt=/*#__PURE__*/ Re({__name:`vue-ui-bump`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:Re,emit:Qe}){let vt=_(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),yt=_(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),bt=_(()=>import(`./DataTable-KeuZB1JM.js`)),xt=_(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),St=_(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ct=_(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_bump:wt}=xe(),{isThemeValid:Tt,warnInvalidTheme:Et}=Oe(),D=e,Dt=Qe,Ot=f({get(){return!!D.dataset&&D.dataset.length},set(e){return e}}),O=b(null),k=b(se()),kt=b(0),At=b(null),jt=b(null),Mt=b(null),Nt=b(!1),Pt=b(!1),Ft=b(0),It=b(0),Lt=b(null),Rt=b(null),zt=b(!1),A=b(null),Bt=b(null),Vt=b(null),Ht=b(null),j=b(null),Ut=b(!1),M=b(Xt()),N=f(()=>M.value.style.chart.layout.plots),P=f(()=>M.value.style.chart.layout),F=f(()=>M.value.style.chart),I=f(()=>M.value.userOptions);ye({config:()=>M.value,dataset:()=>D.dataset,component:`VueUiBump`,rules:[be.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>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 L=f(()=>M.value.userOptions.useCursorPointer),Wt=f(()=>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:M.value.skeletonConfig??{}})),{loading:Gt,FINAL_DATASET:Kt,manualLoading:qt}=Ce({...Xe(D),FINAL_CONFIG:M,prepareConfig:Xt,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:M.value,userConfig:Wt.value})}),Jt=b(!1),Yt=0;qe(dn);function Xt(){let e=Ee({userConfig:D.config,defaultConfig:wt}),t={},n=e.theme;if(n){if(!Tt.value(e))Et(e),t=e;else{let r=Ee({userConfig:Pe[n]||D.config,defaultConfig:e});t={...Ee({userConfig:D.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:fe[n]||ne}}}else t=e;return t}let{userOptionsVisible:Zt,setUserOptionsVisibility:Qt,keepUserOptionState:$t}=je({config:M.value}),{svgRef:R}=Me({config:F.value.title});function en(){zt.value=!0,Qt(!0)}function tn(){Qt(!1),zt.value=!1}let z=b({showTable:M.value.table.show});T(M,()=>{z.value={showTable:M.value.table.show}},{immediate:!0}),T(()=>D.config,e=>{Gt.value||(M.value=Xt()),Zt.value=!M.value.userOptions.showOnChartHover,dn(),Ft.value+=1,It.value+=1,z.value.showTable=M.value.table.show,M.value.responsive||(B.value.width=F.value.width,B.value.height=F.value.height),B.value.paddingRatio={top:F.value.padding.top/F.value.height,right:F.value.padding.right/F.value.width,bottom:F.value.padding.bottom/F.value.height,left:F.value.padding.left/F.value.width}}),T(()=>D.dataset,e=>{Array.isArray(e)&&e.length>0&&(qt.value=!1)},{deep:!0});let{isPrinting:nn,isImaging:rn,generatePdf:an,generateImage:on}=Te({elementId:`bump_${k.value}`,fileName:F.value.title.text||`vue-ui-bump`,options:M.value.userOptions.print}),sn=f(()=>M.value.userOptions.show&&!F.value.title.text),B=b({width:F.value.width,height:F.value.height,paddingRatio:{top:F.value.padding.top/F.value.height,right:F.value.padding.right/F.value.width,bottom:F.value.padding.bottom/F.value.height,left:F.value.padding.left/F.value.width}}),cn=f(()=>ge(M.value.customPalette)),V=Ye(null),H=Ye(null),ln=b(null),un=f(()=>M.value.debug);function dn(){ve(D.dataset)?(ce({componentName:`VueUiBump`,type:`dataset`,debug:un.value}),qt.value=!0):D.dataset.forEach((e,t)=>{_e({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Ot.value=!1,ce({componentName:`VueUiBump`,type:`datasetSerieAttribute`,property:e,index:t,debug:un.value}),qt.value=!0})}),ve(D.dataset)||(qt.value=M.value.loading),setTimeout(()=>{Pt.value=!0},10),M.value.responsive&&(V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(()=>{Pt.value=!1;let{width:e,height:t}=De({chart:O.value,noTitle:jt.value,title:F.value.title.text?At.value:null,legend:null,slicer:null,source:Mt.value});cancelAnimationFrame(Yt),Yt=requestAnimationFrame(()=>{B.value.width=e,B.value.height=t-12,Jt.value=!0,clearTimeout(ln.value),ln.value=setTimeout(()=>{Pt.value=!0},10)})}),H.value=O.value.parentNode,V.value.observe(H.value))}Ke(()=>{cancelAnimationFrame(Yt),V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let fn=f(()=>Kt.value.map((e,t)=>{let n=ae(e.color)||cn.value[t]||ne[t]||ne[t%ne.length];return{...e,absoluteIndex:t,id:se(),color:n}})),U=f(()=>Math.max(...fn.value.map(e=>e.values.length)));function pn(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?t[r][n-1]:r})).filter(e=>Number.isFinite(e.value));r.sort((e,t)=>t.value===e.value?e.previousPosition-t.previousPosition: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:mn,ready:hn,settling:gn,update:_n}=Se({svgRef:R,canMeasure:()=>(!M.value.responsive||Jt.value)&&(!P.value.timeLabels.show||wn.value),initialMetrics:{left:0,right:0,bottom:0},measure:e=>P.value.timeLabels.autoRotate.enable&&Pn()?null:{left:e(Bt.value).width,right:e(Vt.value).width,bottom:e(Ht.value).height}});function vn(){return mn.value.left}function yn(){return mn.value.right}let bn=f(()=>P.value.timeLabels.show&&q.value.length?mn.value.bottom+Math.abs(P.value.timeLabels.offsetY)+P.value.timeLabels.fontSize*.3:0),W=f(()=>{let{height:e,width:t}=B.value,{right:n,left:r}=B.value.paddingRatio,i=vn(),a=yn(),o=F.value.padding.top,s=t-t*n-a,ee=t*r+i,c=t-t*n-t*r-i-a,l=e-o-F.value.padding.bottom-bn.value,u=o+l,te=o+l,ne=Math.max(0,e);return{chartHeight:te,chartWidth:Math.max(0,t),top:o,right:Math.max(0,s),bottom:Math.max(0,u),left:Math.max(0,ee),width:Math.max(0,c),height:Math.max(0,l),unitH:Math.max(0,l)/fn.value.length,unitW:Math.max(0,c)/U.value,svgHeight:ne}}),G=f(()=>{if(!Ot.value&&!Gt.value)return[];let e=pn(fn.value);return fn.value.map((t,n)=>({...t,positions:e[n]})).map(e=>{let t=e.positions.map((t,n)=>{let r=ue(N.value.labels.formatter,e.values[n],l({p:N.value.labels.prefix,v:e.values[n],s:N.value.labels.suffix,r:N.value.labels.rounding}));return{name:e.name,id:e.id,x:W.value.left+n*W.value.unitW+W.value.unitW/2,y:W.value.top+t*W.value.unitH+W.value.unitH/2,value:e.values[n],displayValue:r,rank:e.positions[n]+1,color:e.color,labelColor:N.value.labels.color===`auto`?me(e.color):ae(N.value.labels.color)??me(e.color)}}),n=t.filter(e=>u(e.value)),r=P.value.lines.smooth?ie(n):oe(n);return{...e,coordinates:t,path:r}})});f(()=>G.value.flatMap((e,t)=>e.coordinates.map((n,r)=>({...n,pointIndex:r,seriesIndex:t,seriesId:e.id,seriesName:e.name,pointId:`${e.id}_${r}`})).filter(e=>u(e.value))));function xn(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 Sn=f(()=>{let e=[],t=[];G.value.forEach(n=>{let r=n.coordinates.filter(e=>Number.isFinite(e.rank));if(!r.length)return;e.push({...r[0]});let i=r[r.length-1];t.push({...i})});let n=P.value.nameLabels.fontSize,r=n*1.4,i=W.value.top+n,a=W.value.bottom-n,o=xn(t,r,i,a);return{left:xn(e,r,i,a),right:o}});function Cn(e){let t=N.value.labels.fontSize*.4,n=e.displayValue,r=n.length*(N.value.labels.fontSize*(n.length===1?1:.6)),i=N.value.labels.fontSize,a=r+t*2,o=i+t*2,s=e.x-a/2,ee=e.y-o/2,c=N.value.strokeWidth;return{x:s-c/2,y:ee-c/2,width:a+c,height:o+c,fill:e.color,stroke:N.value.stroke,"stroke-width":c,rx:o/2}}let K=b([]),wn=b(!1),Tn=0;Ze(()=>{let e=++Tn,t=P.value.timeLabels,n=t.values,r=t.datetimeFormatter,i=U.value;!i||!Array.isArray(n)||n.length===0?(K.value=[],wn.value=!0):(async()=>{let t=await ke({values:n,maxDatapoints:i,formatter:r,start:0,end:i});e===Tn&&(K.value=t,wn.value=!0)})()});let q=f(()=>{let e=P.value.timeLabels,t=K.value||[],n=K.value||[],r=U.value,i=t.map(e=>e?.text??``),a=n.map(e=>e?.text??``);return le(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Math.max(1,Number(e.modulo)||1),i,a,0,null,r)}),En=f(()=>B.value.width),Dn=f(()=>B.value.height),On=f(()=>({start:0,end:U.value})),J=f(()=>[...G.value].map(e=>{let t=[...e.coordinates].filter(e=>u(e.value)).at(-1);return{...e,navigationRank:t?.rank??1/0}}).sort((e,t)=>e.navigationRank-t.navigationRank));function kn(){j.value=null,Ut.value=!0}function An(){Mn(),Ut.value=!1}function jn(e,t){let n=J.value.length;return n?e===null||e<0||e>=n?0:t===`previous`?(e-1+n)%n:(e+1)%n:null}function Mn(){if(j.value!==null){let e=J.value[j.value];e&&$(e,e)}j.value=null,A.value=null}function Nn(e){if(!R.value||X.value||document.activeElement!==R.value||!J.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){Mn();return}if(r){if(j.value===null)return;let e=J.value[j.value];if(!e)return;Yn(e,e);return}let a=j.value;a===null?a=0:t?a=jn(a,`previous`):n&&(a=jn(a,`next`));let o=J.value[a];o&&(j.value=a,Q(o,o))}let Y=f(()=>({head:Vn.value.head,body:G.value.map(e=>[e.name,...e.coordinates.map(e=>u(e.value)?`${e.displayValue} (${e.rank})`:`-`)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable})),{detectTimeLabelCollisionNow:Pn}=Ne({timeLabelsEls:Ht,timeLabels:K,slicer:On,configRef:M,rotationPath:[`style`,`chart`,`layout`,`timeLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`layout`,`timeLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:En,height:Dn,rotation:P.value.timeLabels.autoRotate.angle,resizeDebounceMs:0}),X=b(!1);function Fn(){X.value=!X.value}function In(e){Nt.value=e,kt.value+=1}function Ln(){z.value.showTable=!z.value.showTable}T(()=>z.value.showTable,e=>s(e,M,Lt));function Rn(){z.value.showTable=!1,Rt.value&&Rt.value.setTableIconState(!1)}function zn(){return G.value}function Bn(e=null){let t=[[F.value.title.text],[F.value.title.subtitle.text],[``]],n=[``,...q.value.map(e=>e?.text??``)],r=G.value.map(e=>[e.name,...e.coordinates.map(e=>`${e.displayValue}`)]),i=G.value.map(e=>[e.name,...e.coordinates.map(e=>`${e.rank}`)]),a=t.concat([[M.value.table.columnNames.values]]).concat([n]).concat(r).concat([[``],[M.value.table.columnNames.ranking],[n]]).concat(i),o=te(a);e?e(o):pe({csvContent:o,title:F.value.title.text||`vue-ui-bump`})}let Z=f(()=>ee({config:M,style:F,mutableConfig:z,dialog:Le,accordion:yt,isFullscreen:Nt,parent:O,maxWidth:800,isCursorPointer:L})),Vn=f(()=>({head:[``].concat(q.value.map(e=>e.text)),body:G.value.map((e,t)=>[e.name,...e.coordinates.map(e=>`${e.displayValue} (${e.rank})`)]),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:[M.value.table.columnNames.series]})),Hn=f(()=>F.value.backgroundColor),Un=f(()=>F.value.title),{isCallbackImaging:Wn,isCallbackSvg:Gn,generateSvg:Kn,onGenerateImage:qn}=Ae({svg:R,title:Un,legend:null,legendItems:null,backgroundColor:Hn,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:on}),Jn=c(O,()=>F.value.title.text);function Q(e,t){A.value=t.id,M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:e?.pointIndex??null})}function $(e,t){A.value=null,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:e?.pointIndex??null})}function Yn(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:e?.pointIndex??null})}async function Xn(){Dt(`copyAlt`,{config:M.value,dataset:G.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return Re({getData:zn,getImage:Jn,generatePdf:an,generateCsv:Bn,generateImage:on,generateSvg:Kn,toggleTable:Ln,toggleAnnotator:Fn,toggleFullscreen:In,copyAlt:Xn}),T(()=>[B.value.width,B.value.height,P.value,K.value,wn.value,Bt.value,Vt.value,Ht.value,D.dataset,Jt.value,M.value.style.fontFamily],_n,{flush:`post`,deep:!0}),(e,s)=>(y(),h(`div`,{id:`bump_${k.value}`,ref_key:`bumpChart`,ref:O,class:We({"vue-data-ui-component":!0,"vue-ui-bump":!0,"vue-data-ui-wrapper-fullscreen":Nt.value}),style:v(`background:${F.value.backgroundColor};color:${F.value.color};font-family:${M.value.style.fontFamily}; position: relative; ${M.value.responsive?`height: 100%`:``}`),onMouseenter:en,onMouseleave:tn},[g(`p`,{id:`chart-instructions-${k.value}`,class:`sr-only`},C(M.value.a11y.translations.keyboardNavigation),9,et),Y.value.body.length?(y(),p(Ie,{key:0,uid:k.value,head:Y.value.head,body:Y.value.body,caption:Y.value.caption,notice:Y.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):m(``,!0),I.value.buttons.annotator?(y(),p(w(xt),Ue({key:1},w(a)(I.value.annotator),{svgRef:w(R),backgroundColor:F.value.backgroundColor,color:F.value.color,active:X.value,isCursorPointer:L.value,palette:I.value.annotatorPalette,onClose:Fn}),ze({_:2},[x(w(o),t=>({name:t,fn:E(n=>[S(e.$slots,t,Ge(He(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),sn.value?(y(),h(`div`,{key:2,ref_key:`noTitle`,ref:jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),F.value.title.text?(y(),h(`div`,{key:3,ref_key:`chartTitle`,ref:At,style:`width:100%;background:transparent;`},[(y(),p(Fe,{key:`title_${Ft.value}`,config:{title:{cy:`bump-title`,...F.value.title},subtitle:{cy:`bump-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),I.value.show&&Ot.value&&(w($t)||w(Zt))?(y(),p(w(St),Ue({ref_key:`userOptionsRef`,ref:Rt,key:`user_option_${kt.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:w(nn),isImaging:w(rn),uid:k.value,hasTooltip:!1,hasLabel:!1,isFullscreen:Nt.value,chartElement:O.value},w(n)(I.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:X.value,tableDialog:M.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:In,onGeneratePdf:w(an),onGenerateCsv:Bn,onGenerateImage:w(qn),onGenerateSvg:w(Kn),onToggleTable:Ln,onToggleAnnotator:Fn,onCopyAlt:Xn,style:{visibility:w($t)?w(Zt)?`visible`:`hidden`:`visible`}}),ze({_: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,Ge(He(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):m(``,!0),g(`div`,tt,[(y(),h(`svg`,{ref_key:`svgRef`,ref:R,xmlns:w(he),"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:We({"vue-data-ui-loading":w(Gt),"no-transition":!M.value.useCssAnimation}),style:v(`max-width:100%;overflow:visible;background:transparent;color:${F.value.color};visibility:${w(hn)?`visible`:`hidden`}`),role:`img`,"aria-live":`polite`,preserveAspectRatio:`xMidYMid`,tabindex:`0`,onFocus:kn,onBlur:An,onKeydown:Nn},[Ve(w(Ct)),S(e.$slots,`svg-underlayer`,{svg:{drawingArea:W.value,data:G.value,isPrintingImg:w(nn)||w(rn)||w(Wn),isPrintingSvg:w(Gn)}},void 0,!0),e.$slots[`chart-background`]?(y(),h(`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,rt)):m(``,!0),(y(!0),h(d,null,x(G.value,e=>(y(),h(d,null,[g(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:P.value.lines.coatingColor,"stroke-width":P.value.lines.strokeWidth+2,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>A.value=e.id,onMouseleave:s[0]||=e=>A.value=null},null,44,it),g(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:e.color,"stroke-width":P.value.lines.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>Yn(e,e)},null,44,at)],64))),256)),(y(!0),h(d,null,x(G.value,t=>(y(),h(d,null,[N.value.labels.displayedValue===`rank`?(y(!0),h(d,{key:0},x(t.coordinates,(e,n)=>(y(),h(`circle`,{class:`transition-opacity`,cx:e.x,cy:e.y,r:N.value.radius,fill:t.color,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,style:v({opacity:A.value==null||A.value===t.id?1:.1}),onMouseenter:r=>Q({...e,pointIndex:n},t),onMouseleave:r=>$({...e,pointIndex:n},t),onClick:r=>Q({...e,pointIndex:n},t)},null,44,ot))),256)):m(``,!0),N.value.labels.show&&N.value.labels.displayedValue===`rank`?(y(!0),h(d,{key:1},x(t.coordinates,e=>(y(),h(`text`,{class:`transition-opacity`,x:e.x,y:e.y+N.value.labels.fontSize/3,fill:e.labelColor,"font-size":N.value.labels.fontSize,"text-anchor":`middle`,style:v({userSelect:`none`,pointerEvents:`none`,opacity:A.value==null||A.value===t.id?1:.1})},C(e.rank),13,st))),256)):m(``,!0),N.value.labels.displayedValue===`value`?(y(!0),h(d,{key:2},x(t.coordinates,n=>(y(),h(d,null,[w(u)(n.value)?(y(),h(`rect`,Ue({key:0,class:`transition-opacity`},{ref_for:!0},Cn(n),{style:{opacity:A.value==null||A.value===t.id?1:.1},onMouseenter:n=>Q({...e.point,pointIndex:e.i},t),onMouseleave:n=>$({...e.point,pointIndex:e.i},t),onClick:n=>Q({...e.point,pointIndex:e.i},t)}),null,16,ct)):m(``,!0),w(u)(n.value)&&N.value.labels.show?(y(),h(`text`,{key:1,class:`transition-opacity`,x:n.x,y:n.y+N.value.labels.fontSize/3,fill:n.labelColor,"font-size":N.value.labels.fontSize,"text-anchor":`middle`,style:v({userSelect:`none`,pointerEvents:`none`,opacity:A.value==null||A.value===t.id?1:.1})},C(n.displayValue),13,lt)):m(``,!0)],64))),256)):m(``,!0)],64))),256)),P.value.nameLabels.leftLabels.show?(y(),h(`g`,{key:1,ref_key:`labelsLeft`,ref:Bt},[(y(!0),h(d,null,x(Sn.value.left.filter(e=>w(u)(e.value)),(e,t)=>(y(),h(`text`,{class:`transition-opacity`,x:W.value.left,y:e.y+P.value.nameLabels.fontSize/3,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,"font-size":P.value.nameLabels.fontSize,"font--weight":P.value.nameLabels.bold?`bold`:`normal`,"text-anchor":`end`,innerHTML:w(re)({content:e.name,fontSize:P.value.nameLabels.fontSize,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,x:W.value.left-P.value.nameLabels.offsetX,y:e.y+P.value.nameLabels.fontSize/3,translateY:!0}),style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>Yn(e,e)},null,44,ut))),256))],512)):m(``,!0),P.value.nameLabels.rightLabels.show?(y(),h(`g`,{key:2,ref_key:`labelsRight`,ref:Vt},[(y(!0),h(d,null,x(Sn.value.right.filter(e=>w(u)(e.value)),(e,t)=>(y(),h(`text`,{class:`transition-opacity`,x:W.value.right,y:e.y+P.value.nameLabels.fontSize/3,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,"font-size":P.value.nameLabels.fontSize,"font--weight":P.value.nameLabels.bold?`bold`:`normal`,"text-anchor":`start`,innerHTML:w(re)({content:e.name,fontSize:P.value.nameLabels.fontSize,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,x:W.value.right+P.value.nameLabels.offsetX,y:e.y+P.value.nameLabels.fontSize/3,translateY:!0}),style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>Yn(e,e)},null,44,dt))),256))],512)):m(``,!0),P.value.timeLabels.show?(y(),h(`g`,{key:3,ref_key:`timeLabelsEls`,ref:Ht},[e.$slots[`time-label`]?(y(),h(`g`,ft,[(y(!0),h(d,null,x(q.value,(t,n)=>(y(),h(`g`,null,[S(e.$slots,`time-label`,Ue({ref_for:!0},{x:W.value.unitW*n+W.value.unitW/2+W.value.left,y:W.value.chartHeight+P.value.timeLabels.offsetY,fontSize:P.value.timeLabels.fontSize,fill:P.value.timeLabels.color,transform:`translate(${W.value.unitW*n+W.value.unitW/2+W.value.left}, ${W.value.chartHeight+P.value.timeLabels.offsetY}), rotate(${P.value.timeLabels.rotation})`,absoluteIndex:t.absoluteIndex,content:t.text,textAnchor:P.value.timeLabels.rotation>0?`start`:F.value.layout.timeLabels.rotation<0?`end`:`middle`,show:!0}),void 0,!0)]))),256))])):(y(),h(`g`,pt,[(y(!0),h(d,null,x(q.value,(e,t)=>(y(),h(`g`,null,[String(e.text).includes(`
|
|
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,At as u,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,nn as fe,nt 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-_JwRfIqE.js";import{t as Se}from"./useSvgLabelLayout-42Kats14.js";import{n as Ce,t as we}from"./BaseScanner-8NdoBs7B.js";import{t as Te}from"./usePrinter-DVf3YcG5.js";import{t as Ee}from"./useNestedProp-DnGoh-XS.js";import{t as De}from"./useResponsive-CENUxfEL.js";import{t as Oe}from"./useThemeCheck-BKNRbGeC.js";import{t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./useChartExport-BZts4KFb.js";import{t as je}from"./useUserOptionState-CXlFnwPv.js";import{t as Me}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ne}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Pe}from"./vue_ui_bump-DZoGcET0.js";import{n as Fe}from"./Title-BliHuXfT.js";import{t as Ie}from"./A11yDataTable-DWNlWXzs.js";import{t as Le}from"./BaseDraggableDialog-DVstuNhT.js";import{t as Re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as d,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as ze,createTextVNode as Be,createVNode as Ve,defineAsyncComponent as _,guardReactiveProps as He,mergeProps as Ue,normalizeClass as We,normalizeProps as Ge,normalizeStyle as v,onBeforeUnmount as Ke,onMounted as qe,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as C,toRefs as Xe,unref as w,watch as T,watchEffect as Ze,withCtx as E}from"vue";var Qe=/* @__PURE__ */ e({default:()=>vt}),$e=[`id`],et=[`id`],tt={style:{position:`relative`}},nt=[`xmlns`,`aria-describedby`,`viewBox`],rt=[`x`,`y`,`width`,`height`],it=[`d`,`stroke`,`stroke-width`,`onMouseenter`],at=[`d`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],ot=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],st=[`x`,`y`,`fill`,`font-size`],ct=[`onMouseenter`,`onMouseleave`,`onClick`],lt=[`x`,`y`,`fill`,`font-size`],ut=[`x`,`y`,`fill`,`font-size`,`font--weight`,`innerHTML`,`onMouseenter`,`onMouseleave`,`onClick`],dt=[`x`,`y`,`fill`,`font-size`,`font--weight`,`innerHTML`,`onMouseenter`,`onMouseleave`,`onClick`],ft={key:0},pt={key:1},mt=[`text-anchor`,`font-size`,`font-weight`,`fill`,`stroke`,`transform`],ht=[`text-anchor`,`font-size`,`fill`,`transform`,`innerHTML`],gt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},_t={key:5,class:`vue-data-ui-watermark`},vt=/*#__PURE__*/ Re({__name:`vue-ui-bump`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:Re,emit:Qe}){let vt=_(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),yt=_(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),bt=_(()=>import(`./DataTable-KeuZB1JM.js`)),xt=_(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),St=_(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ct=_(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),{vue_ui_bump:wt}=xe(),{isThemeValid:Tt,warnInvalidTheme:Et}=Oe(),D=e,Dt=Qe,Ot=f({get(){return!!D.dataset&&D.dataset.length},set(e){return e}}),O=b(null),k=b(se()),kt=b(0),At=b(null),jt=b(null),Mt=b(null),Nt=b(!1),Pt=b(!1),Ft=b(0),It=b(0),Lt=b(null),Rt=b(null),zt=b(!1),A=b(null),Bt=b(null),Vt=b(null),Ht=b(null),j=b(null),Ut=b(!1),M=b(Xt()),N=f(()=>M.value.style.chart.layout.plots),P=f(()=>M.value.style.chart.layout),F=f(()=>M.value.style.chart),I=f(()=>M.value.userOptions);ye({config:()=>M.value,dataset:()=>D.dataset,component:`VueUiBump`,rules:[be.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>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 L=f(()=>M.value.userOptions.useCursorPointer),Wt=f(()=>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:M.value.skeletonConfig??{}})),{loading:Gt,FINAL_DATASET:Kt,manualLoading:qt}=Ce({...Xe(D),FINAL_CONFIG:M,prepareConfig:Xt,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:M.value,userConfig:Wt.value})}),Jt=b(!1),Yt=0;qe(dn);function Xt(){let e=Ee({userConfig:D.config,defaultConfig:wt}),t={},n=e.theme;if(n){if(!Tt.value(e))Et(e),t=e;else{let r=Ee({userConfig:Pe[n]||D.config,defaultConfig:e});t={...Ee({userConfig:D.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:fe[n]||ne}}}else t=e;return t}let{userOptionsVisible:Zt,setUserOptionsVisibility:Qt,keepUserOptionState:$t}=je({config:M.value}),{svgRef:R}=Me({config:F.value.title});function en(){zt.value=!0,Qt(!0)}function tn(){Qt(!1),zt.value=!1}let z=b({showTable:M.value.table.show});T(M,()=>{z.value={showTable:M.value.table.show}},{immediate:!0}),T(()=>D.config,e=>{Gt.value||(M.value=Xt()),Zt.value=!M.value.userOptions.showOnChartHover,dn(),Ft.value+=1,It.value+=1,z.value.showTable=M.value.table.show,M.value.responsive||(B.value.width=F.value.width,B.value.height=F.value.height),B.value.paddingRatio={top:F.value.padding.top/F.value.height,right:F.value.padding.right/F.value.width,bottom:F.value.padding.bottom/F.value.height,left:F.value.padding.left/F.value.width}}),T(()=>D.dataset,e=>{Array.isArray(e)&&e.length>0&&(qt.value=!1)},{deep:!0});let{isPrinting:nn,isImaging:rn,generatePdf:an,generateImage:on}=Te({elementId:`bump_${k.value}`,fileName:F.value.title.text||`vue-ui-bump`,options:M.value.userOptions.print}),sn=f(()=>M.value.userOptions.show&&!F.value.title.text),B=b({width:F.value.width,height:F.value.height,paddingRatio:{top:F.value.padding.top/F.value.height,right:F.value.padding.right/F.value.width,bottom:F.value.padding.bottom/F.value.height,left:F.value.padding.left/F.value.width}}),cn=f(()=>ge(M.value.customPalette)),V=Ye(null),H=Ye(null),ln=b(null),un=f(()=>M.value.debug);function dn(){ve(D.dataset)?(ce({componentName:`VueUiBump`,type:`dataset`,debug:un.value}),qt.value=!0):D.dataset.forEach((e,t)=>{_e({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Ot.value=!1,ce({componentName:`VueUiBump`,type:`datasetSerieAttribute`,property:e,index:t,debug:un.value}),qt.value=!0})}),ve(D.dataset)||(qt.value=M.value.loading),setTimeout(()=>{Pt.value=!0},10),M.value.responsive&&(V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(()=>{Pt.value=!1;let{width:e,height:t}=De({chart:O.value,noTitle:jt.value,title:F.value.title.text?At.value:null,legend:null,slicer:null,source:Mt.value});cancelAnimationFrame(Yt),Yt=requestAnimationFrame(()=>{B.value.width=e,B.value.height=t-12,Jt.value=!0,clearTimeout(ln.value),ln.value=setTimeout(()=>{Pt.value=!0},10)})}),H.value=O.value.parentNode,V.value.observe(H.value))}Ke(()=>{cancelAnimationFrame(Yt),V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let fn=f(()=>Kt.value.map((e,t)=>{let n=ae(e.color)||cn.value[t]||ne[t]||ne[t%ne.length];return{...e,absoluteIndex:t,id:se(),color:n}})),U=f(()=>Math.max(...fn.value.map(e=>e.values.length)));function pn(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?t[r][n-1]:r})).filter(e=>Number.isFinite(e.value));r.sort((e,t)=>t.value===e.value?e.previousPosition-t.previousPosition: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:mn,ready:hn,settling:gn,update:_n}=Se({svgRef:R,canMeasure:()=>(!M.value.responsive||Jt.value)&&(!P.value.timeLabels.show||wn.value),initialMetrics:{left:0,right:0,bottom:0},measure:e=>P.value.timeLabels.autoRotate.enable&&Pn()?null:{left:e(Bt.value).width,right:e(Vt.value).width,bottom:e(Ht.value).height}});function vn(){return mn.value.left}function yn(){return mn.value.right}let bn=f(()=>P.value.timeLabels.show&&q.value.length?mn.value.bottom+Math.abs(P.value.timeLabels.offsetY)+P.value.timeLabels.fontSize*.3:0),W=f(()=>{let{height:e,width:t}=B.value,{right:n,left:r}=B.value.paddingRatio,i=vn(),a=yn(),o=F.value.padding.top,s=t-t*n-a,ee=t*r+i,c=t-t*n-t*r-i-a,l=e-o-F.value.padding.bottom-bn.value,u=o+l,te=o+l,ne=Math.max(0,e);return{chartHeight:te,chartWidth:Math.max(0,t),top:o,right:Math.max(0,s),bottom:Math.max(0,u),left:Math.max(0,ee),width:Math.max(0,c),height:Math.max(0,l),unitH:Math.max(0,l)/fn.value.length,unitW:Math.max(0,c)/U.value,svgHeight:ne}}),G=f(()=>{if(!Ot.value&&!Gt.value)return[];let e=pn(fn.value);return fn.value.map((t,n)=>({...t,positions:e[n]})).map(e=>{let t=e.positions.map((t,n)=>{let r=ue(N.value.labels.formatter,e.values[n],l({p:N.value.labels.prefix,v:e.values[n],s:N.value.labels.suffix,r:N.value.labels.rounding}));return{name:e.name,id:e.id,x:W.value.left+n*W.value.unitW+W.value.unitW/2,y:W.value.top+t*W.value.unitH+W.value.unitH/2,value:e.values[n],displayValue:r,rank:e.positions[n]+1,color:e.color,labelColor:N.value.labels.color===`auto`?me(e.color):ae(N.value.labels.color)??me(e.color)}}),n=t.filter(e=>u(e.value)),r=P.value.lines.smooth?ie(n):oe(n);return{...e,coordinates:t,path:r}})});f(()=>G.value.flatMap((e,t)=>e.coordinates.map((n,r)=>({...n,pointIndex:r,seriesIndex:t,seriesId:e.id,seriesName:e.name,pointId:`${e.id}_${r}`})).filter(e=>u(e.value))));function xn(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 Sn=f(()=>{let e=[],t=[];G.value.forEach(n=>{let r=n.coordinates.filter(e=>Number.isFinite(e.rank));if(!r.length)return;e.push({...r[0]});let i=r[r.length-1];t.push({...i})});let n=P.value.nameLabels.fontSize,r=n*1.4,i=W.value.top+n,a=W.value.bottom-n,o=xn(t,r,i,a);return{left:xn(e,r,i,a),right:o}});function Cn(e){let t=N.value.labels.fontSize*.4,n=e.displayValue,r=n.length*(N.value.labels.fontSize*(n.length===1?1:.6)),i=N.value.labels.fontSize,a=r+t*2,o=i+t*2,s=e.x-a/2,ee=e.y-o/2,c=N.value.strokeWidth;return{x:s-c/2,y:ee-c/2,width:a+c,height:o+c,fill:e.color,stroke:N.value.stroke,"stroke-width":c,rx:o/2}}let K=b([]),wn=b(!1),Tn=0;Ze(()=>{let e=++Tn,t=P.value.timeLabels,n=t.values,r=t.datetimeFormatter,i=U.value;!i||!Array.isArray(n)||n.length===0?(K.value=[],wn.value=!0):(async()=>{let t=await ke({values:n,maxDatapoints:i,formatter:r,start:0,end:i});e===Tn&&(K.value=t,wn.value=!0)})()});let q=f(()=>{let e=P.value.timeLabels,t=K.value||[],n=K.value||[],r=U.value,i=t.map(e=>e?.text??``),a=n.map(e=>e?.text??``);return le(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Math.max(1,Number(e.modulo)||1),i,a,0,null,r)}),En=f(()=>B.value.width),Dn=f(()=>B.value.height),On=f(()=>({start:0,end:U.value})),J=f(()=>[...G.value].map(e=>{let t=[...e.coordinates].filter(e=>u(e.value)).at(-1);return{...e,navigationRank:t?.rank??1/0}}).sort((e,t)=>e.navigationRank-t.navigationRank));function kn(){j.value=null,Ut.value=!0}function An(){Mn(),Ut.value=!1}function jn(e,t){let n=J.value.length;return n?e===null||e<0||e>=n?0:t===`previous`?(e-1+n)%n:(e+1)%n:null}function Mn(){if(j.value!==null){let e=J.value[j.value];e&&$(e,e)}j.value=null,A.value=null}function Nn(e){if(!R.value||X.value||document.activeElement!==R.value||!J.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){Mn();return}if(r){if(j.value===null)return;let e=J.value[j.value];if(!e)return;Yn(e,e);return}let a=j.value;a===null?a=0:t?a=jn(a,`previous`):n&&(a=jn(a,`next`));let o=J.value[a];o&&(j.value=a,Q(o,o))}let Y=f(()=>({head:Vn.value.head,body:G.value.map(e=>[e.name,...e.coordinates.map(e=>u(e.value)?`${e.displayValue} (${e.rank})`:`-`)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable})),{detectTimeLabelCollisionNow:Pn}=Ne({timeLabelsEls:Ht,timeLabels:K,slicer:On,configRef:M,rotationPath:[`style`,`chart`,`layout`,`timeLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`layout`,`timeLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:En,height:Dn,rotation:P.value.timeLabels.autoRotate.angle,resizeDebounceMs:0}),X=b(!1);function Fn(){X.value=!X.value}function In(e){Nt.value=e,kt.value+=1}function Ln(){z.value.showTable=!z.value.showTable}T(()=>z.value.showTable,e=>s(e,M,Lt));function Rn(){z.value.showTable=!1,Rt.value&&Rt.value.setTableIconState(!1)}function zn(){return G.value}function Bn(e=null){let t=[[F.value.title.text],[F.value.title.subtitle.text],[``]],n=[``,...q.value.map(e=>e?.text??``)],r=G.value.map(e=>[e.name,...e.coordinates.map(e=>`${e.displayValue}`)]),i=G.value.map(e=>[e.name,...e.coordinates.map(e=>`${e.rank}`)]),a=t.concat([[M.value.table.columnNames.values]]).concat([n]).concat(r).concat([[``],[M.value.table.columnNames.ranking],[n]]).concat(i),o=te(a);e?e(o):pe({csvContent:o,title:F.value.title.text||`vue-ui-bump`})}let Z=f(()=>ee({config:M,style:F,mutableConfig:z,dialog:Le,accordion:yt,isFullscreen:Nt,parent:O,maxWidth:800,isCursorPointer:L})),Vn=f(()=>({head:[``].concat(q.value.map(e=>e.text)),body:G.value.map((e,t)=>[e.name,...e.coordinates.map(e=>`${e.displayValue} (${e.rank})`)]),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:[M.value.table.columnNames.series]})),Hn=f(()=>F.value.backgroundColor),Un=f(()=>F.value.title),{isCallbackImaging:Wn,isCallbackSvg:Gn,generateSvg:Kn,onGenerateImage:qn}=Ae({svg:R,title:Un,legend:null,legendItems:null,backgroundColor:Hn,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:on}),Jn=c(O,()=>F.value.title.text);function Q(e,t){A.value=t.id,M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:e?.pointIndex??null})}function $(e,t){A.value=null,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:e?.pointIndex??null})}function Yn(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:e?.pointIndex??null})}async function Xn(){Dt(`copyAlt`,{config:M.value,dataset:G.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return Re({getData:zn,getImage:Jn,generatePdf:an,generateCsv:Bn,generateImage:on,generateSvg:Kn,toggleTable:Ln,toggleAnnotator:Fn,toggleFullscreen:In,copyAlt:Xn}),T(()=>[B.value.width,B.value.height,P.value,K.value,wn.value,Bt.value,Vt.value,Ht.value,D.dataset,Jt.value,M.value.style.fontFamily],_n,{flush:`post`,deep:!0}),(e,s)=>(y(),h(`div`,{id:`bump_${k.value}`,ref_key:`bumpChart`,ref:O,class:We({"vue-data-ui-component":!0,"vue-ui-bump":!0,"vue-data-ui-wrapper-fullscreen":Nt.value}),style:v(`background:${F.value.backgroundColor};color:${F.value.color};font-family:${M.value.style.fontFamily}; position: relative; ${M.value.responsive?`height: 100%`:``}`),onMouseenter:en,onMouseleave:tn},[g(`p`,{id:`chart-instructions-${k.value}`,class:`sr-only`},C(M.value.a11y.translations.keyboardNavigation),9,et),Y.value.body.length?(y(),p(Ie,{key:0,uid:k.value,head:Y.value.head,body:Y.value.body,caption:Y.value.caption,notice:Y.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):m(``,!0),I.value.buttons.annotator?(y(),p(w(xt),Ue({key:1},w(a)(I.value.annotator),{svgRef:w(R),backgroundColor:F.value.backgroundColor,color:F.value.color,active:X.value,isCursorPointer:L.value,palette:I.value.annotatorPalette,onClose:Fn}),ze({_:2},[x(w(o),t=>({name:t,fn:E(n=>[S(e.$slots,t,Ge(He(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),sn.value?(y(),h(`div`,{key:2,ref_key:`noTitle`,ref:jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),F.value.title.text?(y(),h(`div`,{key:3,ref_key:`chartTitle`,ref:At,style:`width:100%;background:transparent;`},[(y(),p(Fe,{key:`title_${Ft.value}`,config:{title:{cy:`bump-title`,...F.value.title},subtitle:{cy:`bump-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),I.value.show&&Ot.value&&(w($t)||w(Zt))?(y(),p(w(St),Ue({ref_key:`userOptionsRef`,ref:Rt,key:`user_option_${kt.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:w(nn),isImaging:w(rn),uid:k.value,hasTooltip:!1,hasLabel:!1,isFullscreen:Nt.value,chartElement:O.value},w(n)(I.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:X.value,tableDialog:M.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:In,onGeneratePdf:w(an),onGenerateCsv:Bn,onGenerateImage:w(qn),onGenerateSvg:w(Kn),onToggleTable:Ln,onToggleAnnotator:Fn,onCopyAlt:Xn,style:{visibility:w($t)?w(Zt)?`visible`:`hidden`:`visible`}}),ze({_: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,Ge(He(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):m(``,!0),g(`div`,tt,[(y(),h(`svg`,{ref_key:`svgRef`,ref:R,xmlns:w(he),"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:We({"vue-data-ui-loading":w(Gt),"no-transition":!M.value.useCssAnimation}),style:v(`max-width:100%;overflow:visible;background:transparent;color:${F.value.color};visibility:${w(hn)?`visible`:`hidden`}`),role:`img`,"aria-live":`polite`,preserveAspectRatio:`xMidYMid`,tabindex:`0`,onFocus:kn,onBlur:An,onKeydown:Nn},[Ve(w(Ct)),S(e.$slots,`svg-underlayer`,{svg:{drawingArea:W.value,data:G.value,isPrintingImg:w(nn)||w(rn)||w(Wn),isPrintingSvg:w(Gn)}},void 0,!0),e.$slots[`chart-background`]?(y(),h(`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,rt)):m(``,!0),(y(!0),h(d,null,x(G.value,e=>(y(),h(d,null,[g(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:P.value.lines.coatingColor,"stroke-width":P.value.lines.strokeWidth+2,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>A.value=e.id,onMouseleave:s[0]||=e=>A.value=null},null,44,it),g(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:e.color,"stroke-width":P.value.lines.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>Yn(e,e)},null,44,at)],64))),256)),(y(!0),h(d,null,x(G.value,t=>(y(),h(d,null,[N.value.labels.displayedValue===`rank`?(y(!0),h(d,{key:0},x(t.coordinates,(e,n)=>(y(),h(`circle`,{class:`transition-opacity`,cx:e.x,cy:e.y,r:N.value.radius,fill:t.color,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,style:v({opacity:A.value==null||A.value===t.id?1:.1}),onMouseenter:r=>Q({...e,pointIndex:n},t),onMouseleave:r=>$({...e,pointIndex:n},t),onClick:r=>Q({...e,pointIndex:n},t)},null,44,ot))),256)):m(``,!0),N.value.labels.show&&N.value.labels.displayedValue===`rank`?(y(!0),h(d,{key:1},x(t.coordinates,e=>(y(),h(`text`,{class:`transition-opacity`,x:e.x,y:e.y+N.value.labels.fontSize/3,fill:e.labelColor,"font-size":N.value.labels.fontSize,"text-anchor":`middle`,style:v({userSelect:`none`,pointerEvents:`none`,opacity:A.value==null||A.value===t.id?1:.1})},C(e.rank),13,st))),256)):m(``,!0),N.value.labels.displayedValue===`value`?(y(!0),h(d,{key:2},x(t.coordinates,n=>(y(),h(d,null,[w(u)(n.value)?(y(),h(`rect`,Ue({key:0,class:`transition-opacity`},{ref_for:!0},Cn(n),{style:{opacity:A.value==null||A.value===t.id?1:.1},onMouseenter:n=>Q({...e.point,pointIndex:e.i},t),onMouseleave:n=>$({...e.point,pointIndex:e.i},t),onClick:n=>Q({...e.point,pointIndex:e.i},t)}),null,16,ct)):m(``,!0),w(u)(n.value)&&N.value.labels.show?(y(),h(`text`,{key:1,class:`transition-opacity`,x:n.x,y:n.y+N.value.labels.fontSize/3,fill:n.labelColor,"font-size":N.value.labels.fontSize,"text-anchor":`middle`,style:v({userSelect:`none`,pointerEvents:`none`,opacity:A.value==null||A.value===t.id?1:.1})},C(n.displayValue),13,lt)):m(``,!0)],64))),256)):m(``,!0)],64))),256)),P.value.nameLabels.leftLabels.show?(y(),h(`g`,{key:1,ref_key:`labelsLeft`,ref:Bt},[(y(!0),h(d,null,x(Sn.value.left.filter(e=>w(u)(e.value)),(e,t)=>(y(),h(`text`,{class:`transition-opacity`,x:W.value.left,y:e.y+P.value.nameLabels.fontSize/3,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,"font-size":P.value.nameLabels.fontSize,"font--weight":P.value.nameLabels.bold?`bold`:`normal`,"text-anchor":`end`,innerHTML:w(re)({content:e.name,fontSize:P.value.nameLabels.fontSize,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,x:W.value.left-P.value.nameLabels.offsetX,y:e.y+P.value.nameLabels.fontSize/3,translateY:!0}),style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>Yn(e,e)},null,44,ut))),256))],512)):m(``,!0),P.value.nameLabels.rightLabels.show?(y(),h(`g`,{key:2,ref_key:`labelsRight`,ref:Vt},[(y(!0),h(d,null,x(Sn.value.right.filter(e=>w(u)(e.value)),(e,t)=>(y(),h(`text`,{class:`transition-opacity`,x:W.value.right,y:e.y+P.value.nameLabels.fontSize/3,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,"font-size":P.value.nameLabels.fontSize,"font--weight":P.value.nameLabels.bold?`bold`:`normal`,"text-anchor":`start`,innerHTML:w(re)({content:e.name,fontSize:P.value.nameLabels.fontSize,fill:P.value.nameLabels.useSerieColor?e.color:P.value.nameLabels.color,x:W.value.right+P.value.nameLabels.offsetX,y:e.y+P.value.nameLabels.fontSize/3,translateY:!0}),style:v({opacity:A.value==null||A.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>Yn(e,e)},null,44,dt))),256))],512)):m(``,!0),P.value.timeLabels.show?(y(),h(`g`,{key:3,ref_key:`timeLabelsEls`,ref:Ht},[e.$slots[`time-label`]?(y(),h(`g`,ft,[(y(!0),h(d,null,x(q.value,(t,n)=>(y(),h(`g`,null,[S(e.$slots,`time-label`,Ue({ref_for:!0},{x:W.value.unitW*n+W.value.unitW/2+W.value.left,y:W.value.chartHeight+P.value.timeLabels.offsetY,fontSize:P.value.timeLabels.fontSize,fill:P.value.timeLabels.color,transform:`translate(${W.value.unitW*n+W.value.unitW/2+W.value.left}, ${W.value.chartHeight+P.value.timeLabels.offsetY}), rotate(${P.value.timeLabels.rotation})`,absoluteIndex:t.absoluteIndex,content:t.text,textAnchor:P.value.timeLabels.rotation>0?`start`:F.value.layout.timeLabels.rotation<0?`end`:`middle`,show:!0}),void 0,!0)]))),256))])):(y(),h(`g`,pt,[(y(!0),h(d,null,x(q.value,(e,t)=>(y(),h(`g`,null,[String(e.text).includes(`
|
|
2
2
|
`)?(y(),h(`text`,{key:t+`-multi`,"text-anchor":P.value.timeLabels.rotation>0?`start`:P.value.timeLabels.rotation<0?`end`:`middle`,"font-size":P.value.timeLabels.fontSize,fill:P.value.timeLabels.color,transform:`
|
|
3
3
|
translate(
|
|
4
4
|
${W.value.unitW*t+W.value.unitW/2+W.value.left},
|
|
@@ -1,4 +1,4 @@
|
|
|
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 l,D as te,Dt as ne,Jt as re,Qt as ie,X as ae,Yt as oe,_ as se,_t as ce,at as u,b as d,c as le,gt as ue,in as de,nt as fe,pt as pe,rn as me,t as he,wt 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-_JwRfIqE.js";import{t as xe}from"./useSvgLabelLayout-42Kats14.js";import{n as Se,r as Ce,t as we}from"./useTimeLabels-Das5O74F.js";import{t as Te}from"./usePrinter-DVf3YcG5.js";import{n as Ee,t as De}from"./BaseScanner-8NdoBs7B.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"./A11yDataTable-DWNlWXzs.js";import{t as Be}from"./SlicerPreview-0m9E7Zh_.js";import{t as Ve}from"./DefGrad-DKMq1REY.js";import{t as He}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as f,computed as p,createBlock as Ue,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as qe,guardReactiveProps as Je,mergeProps as Ye,nextTick as Xe,normalizeClass as _,normalizeProps as Ze,normalizeStyle as Qe,onBeforeUnmount as $e,onMounted as et,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as tt,shallowRef as nt,toDisplayString as rt,toRefs as it,unref as S,watch as at,watchEffect as ot,withCtx as C}from"vue";var st=/* @__PURE__ */ e({default:()=>Ht}),ct=[`id`],lt=[`id`],ut={style:{position:`relative`}},dt=[`xmlns`,`aria-describedby`,`viewBox`],ft=[`x`,`y`,`width`,`height`],pt={key:1},mt={key:0},ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],St=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],Ct=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],wt=[`x`,`y`,`width`,`height`,`fill`,`rx`],Tt={key:0},Et=[`cx`,`cy`,`r`,`fill`],Dt=[`cx`,`cy`,`r`,`fill`],Ot={key:1},kt=[`x`,`y`,`width`,`height`,`rx`,`fill`],At=[`x`,`y`,`width`,`height`,`fill`,`rx`],jt=[`x`,`y`,`height`,`width`,`fill`,`rx`],Mt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],Nt=[`d`,`stroke`],Pt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Ft=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],It=[`data-start`,`data-end`],Lt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Rt={key:5,class:`vue-data-ui-watermark`},zt=[`d`,`stroke`],Bt=[`d`,`stroke`,`stroke-width`],Vt=[`innerHTML`],Ht=/*#__PURE__*/ He({__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:He,emit:st}){let Ht=qe(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ut=qe(()=>import(`./Tooltip-C1q0Qoh7.js`)),Wt=qe(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Gt=qe(()=>import(`./DataTable-KeuZB1JM.js`)),Kt=qe(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),qt=qe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Jt=qe(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Yt=qe(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_candlestick:Xt}=be(),{isThemeValid:Zt,warnInvalidTheme:Qt}=Ae(),w=e,T=st,$t=p(()=>!!w.dataset&&w.dataset.length),E=y(!1),en=y(!1),tn=0,nn=y(null),D=y(ae()),rn=y(!1),an=y(``),O=y(void 0),on=y(0),k=y(null),sn=y(null),cn=y(null),ln=y(null),un=y(null),dn=y(null),fn=y(0),pn=y(0),mn=y(0),hn=y(null),gn=y(null),_n=y(null),vn=y(null),yn=y(null),A=y(null),bn=y({x:0,y:0}),xn=y(`pointer`),Sn=y(!1),j=y(Mn()),M=p(()=>j.value.style.layout.candle),N=p(()=>j.value.style.layout.grid),P=p(()=>j.value.style.layout),F=p(()=>j.value.style),I=p(()=>j.value.userOptions);ve({config:()=>j.value,dataset:()=>w.dataset,component:`VueUiCandlestick`,rules:[ye.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:Cn}=Me({config:()=>j.value.transitions,dataset:()=>w.dataset}),wn=p(()=>j.value.userOptions.useCursorPointer),Tn=p(()=>de({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:En}=Ee({...it(w),FINAL_CONFIG:j,prepareConfig:Mn,callback:()=>{Promise.resolve().then(async()=>{await Xr()})},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:de({defaultConfig:j.value,userConfig:Tn.value})}),{userOptionsVisible:Dn,setUserOptionsVisibility:On,keepUserOptionState:kn}=Ne({config:j.value}),{svgRef:z}=Pe({config:F.value.title});function An(){On(!0)}function jn(){On(!1),T(`selectX`,{seriesIndex:null,datapoint:null}),O.value=null}function Mn(){let e=Oe({userConfig:w.config,defaultConfig:Xt}),t={};w.config&&ge(w.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!w.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Zt.value(e))Qt(e),t=e;else{let r=Oe({userConfig:Re[n]||w.config,defaultConfig:e});t={...Oe({userConfig:w.config,defaultConfig:r})}}}else t=e;return t}let Nn=ie(w.config);at(()=>w.config,(e,t)=>{let n=ie(e),r=n!==Nn;Nn=n;let i=Mn();r?(L.value||(j.value=Mn()),Dn.value=!j.value.userOptions.showOnChartHover,Ln(),fn.value+=1,mn.value+=1,pn.value+=1,V.value.showTable=j.value.table.show,V.value.showTooltip=F.value.tooltip.show,dr()):(j.value.style.tooltip=i.style.tooltip,V.value.showTooltip=j.value.style.tooltip.show)},{deep:!0}),at(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(En.value=!1),Kr()},{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}),Pn=nt(null),Fn=nt(null);et(()=>{Ln()});let In=p(()=>j.value.debug);function Ln(){_e(w.dataset)&&(u({componentName:`VueUiCandlestick`,type:`dataset`,debug:In.value}),En.value=!0),_e(w.dataset)||(En.value=j.value.loading),setTimeout(()=>{E.value=!0},10),j.value.responsive&&(Pn.value&&(Fn.value&&Pn.value.unobserve(Fn.value),Pn.value.disconnect()),Pn.value=new ResizeObserver(()=>{E.value=!1;let{width:e,height:t}=ke({chart:k.value,title:F.value.title.text?sn.value:null,slicer:F.value.zoom.show&&W.value>6?ln.value.$el:null,legend:cn.value,source:un.value,noTitle:dn.value});cancelAnimationFrame(tn),tn=requestAnimationFrame(()=>{B.value.width=e,B.value.height=t-12,en.value=!0,j.value.responsiveProportionalSizing?(B.value.xAxisFontSize=me({relator:Math.min(e,t),adjuster:F.value.width,source:N.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),B.value.yAxisFontSize=me({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),nn.value&&clearTimeout(nn.value),nn.value=setTimeout(()=>{E.value=!0},10)})}),Fn.value=k.value.parentNode,Pn.value.observe(Fn.value)),Xr()}$e(()=>{cancelAnimationFrame(tn),Pn.value&&(Fn.value&&Pn.value.unobserve(Fn.value),Pn.value.disconnect())});let{isPrinting:Rn,isImaging:zn,generatePdf:Bn,generateImage:Vn}=Te({elementId:`vue-ui-candlestick_${D.value}`,fileName:F.value.title.text||`vue-ui-candlestick`,options:j.value.userOptions.print}),Hn=p(()=>j.value.userOptions.show&&!F.value.title.text),V=y({showTable:j.value.table.show,showTooltip:F.value.tooltip.show}),{metrics:Un,ready:Wn,settling:H,update:Gn}=xe({svgRef:z,canMeasure:()=>(!j.value.responsive||en.value)&&(!N.value.xAxis.dataLabels.show||Er.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:hn.value?e(hn.value).textWidth:N.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(gn.value).height})}),Kn=p(()=>gn.value?Un.value.timeLabelsHeight+B.value.xAxisFontSize:0),qn=p(()=>N.value.yAxis.position===`right`);function Jn(){let e=Un.value.scaleLabelsWidth,t=N.value.yAxis.axisName?.show?N.value.yAxis.axisName.fontSize+N.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:qn.value?0:n,right:qn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let U=p(()=>{let{top:e,right:t,bottom:n,left:r}=P.value.padding,i=Jn();return{top:e+12,right:B.value.width-t-i.right,left:r+i.left,bottom:B.value.height-n-Kn.value,width:B.value.width-r-t-i.left-i.right,height:B.value.height-e-n-Kn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),Yn=p(()=>{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)),l=Math.max(0,Math.min(a,ee));return{x:e+c*o,y:t,width:(l-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=p(()=>R.value.length),G=y({start:0,end:W.value}),K=y({start:0,end:W.value}),Xn=y(!1),Zn=y(!1),Qn=y(null),q=y(null),J=y(null),$n=y(!1),er=y({time:0,x:0,y:0,pointerType:null}),tr=p(()=>F.value.zoom?.dragToZoom),Y=p(()=>tr.value.show&&$t.value&&Jr.value&&W.value>1&&!L.value),nr=null,rr={},ir=p(()=>F.value.zoom.preview.enable&&(K.value.start!==G.value.start||K.value.end!==G.value.end));function ar(e,t){K.value[e]=t}function or(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 sr(e){let t=or(e);t&&T(`update:zoomState`,t)}function cr(){nr&&=(cancelAnimationFrame(nr),null),rr={}}function lr(e){let t=or(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(G.value.start)||r!==Number(G.value.end))&&(cr(),G.value={start:n,end:r},K.value={start:n,end:r},dr()),{start:Number(G.value.start),end:Number(G.value.end)}}function ur(e){let t=lr(e);return t?(T(`update:zoomState`,t),t):null}function dr(){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,ln.value&&ln.value.setRangeValues(e,t)}let fr=p(()=>R.value.map((e,t)=>({...e,absoluteIndex:t}))),pr=p(()=>fr.value.slice(G.value.start,G.value.end)),mr=p(()=>(In.value&&R.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),pr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),hr=p(()=>fr.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=p(()=>U.value.width/pr.value.length),gr=p(()=>{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 mr.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}}),_r=p(()=>({max:N.value.yAxis.scale.max===null?gr.value.max.h:N.value.yAxis.scale.max,min:N.value.yAxis.scale.min===null?0:N.value.yAxis.scale.min})),Z=p(()=>se(_r.value.min,_r.value.max,N.value.yAxis.dataLabels.steps));function vr(e,t,n=null,r=null){return{...e,x:d(U.value.left+t*X.value+X.value/2),y:d(U.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*U.value.height),value:d(e),isMax:e===n,isMin:e===r}}let Q=p(()=>{let{max:e,min:t,volumeMax:n,volumeMin:r}=gr.value;return mr.value.map((i,a)=>{let o=vr(i.open,a,e.o,t.o),s=vr(i.high,a,e.h,t.h),ee=vr(i.low,a,e.l,t.l),c=vr(i.close,a,e.c,t.c),l=i.close>i.open,te=i.volume===n,ne=i.volume===r;return{period:i.period,open:o,high:s,low:ee,close:c,volume:i.volume,isBullish:l,absoluteIndex:i.absoluteIndex,isMaxVolume:te,isMinVolume:ne}})}),yr=p(()=>{let e=-1/0;for(let t of R.value)e=Math.max(e,t[2]);return e});function br({item:e,index:t,minimapH:n,unitW:r,min:i,max:a}){return{...e,x:d(t*r),y:d((1-(e-i)/(a-i))*n),value:d(e)}}let xr=p(()=>{let e=hr.value,t=N.value.yAxis.scale.min??0,n=N.value.yAxis.scale.max??yr.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=br({item:e.open,index:r,minimapH:o,unitW:s,min:t,max:n}),a=br({item:e.high,index:r,minimapH:o,unitW:s,min:t,max:n}),ee=br({item:e.low,index:r,minimapH:o,unitW:s,min:t,max:n}),c=br({item:e.close,index:r,minimapH:o,unitW:s,min:t,max:n}),l=e.close>e.open;return{period:e.period,open:i,high:a,low:ee,close:c,volume:e.volume,isBullish:l,absoluteIndex:e.absoluteIndex}})),a)}),Sr=p(()=>F.value.zoom.minimap.show?[{name:``,series:R.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function Cr(e){return d((e-Z.value.min)/(Z.value.max-Z.value.min))}let wr=p(()=>Z.value.ticks.map(e=>({y:U.value.bottom-U.value.height*Cr(e),value:d(e)}))),Tr=p(()=>mr.value.map(e=>e.period)),$=y([]),Er=y(!1),Dr=y([]),Or=0;ot(()=>{let e=++Or;(async()=>{let t=await we({values:R.value.map(e=>e[0]),maxDatapoints:R.value.length,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:G.value.start,end:G.value.end});e===Or&&($.value=t,Er.value=!0)})()});let kr=0;ot(()=>{let e=++kr;(async()=>{let t=await we({values:R.value.map(e=>e[0]),maxDatapoints:R.value.length,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:0,end:W.value});e===kr&&(Dr.value=t)})()});let Ar=y({months:[],shortMonths:[],days:[],shortDays:[]}),jr=0;ot(()=>{let e=++jr,t=N.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await Ce(t.locale).catch(()=>Ce(`en`));e===jr&&(Ar.value=n.data)})()});let Mr=p(()=>{let e=N.value.xAxis.dataLabels.datetimeFormatter,t=Se({useUTC:e.useUTC,locale:Ar.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=R.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),Nr=p(()=>(R.value.map(e=>e[0])||[]).map((e,t)=>({text:Mr.value(t,F.value.tooltip.timeFormat),absoluteIndex:t}))),Pr=p(()=>(R.value.map(e=>e[0])||[]).map((e,t)=>({text:Mr.value(t,F.value.zoom.timeFormat),absoluteIndex:t}))),Fr=p(()=>($.value||[]).map(e=>e?.text??``)),Ir=p(()=>(Dr.value||[]).map(e=>e?.text??``)),Lr=p(()=>{let e=Math.max(1,Math.floor(Number(N.value.xAxis.dataLabels.modulo)||1)),t=Fr.value,n=Ir.value,r=G.value.start??0,i=r>0||t.length<n.length;return ue({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),Rr=p(()=>{let e=N.value.xAxis.dataLabels,t=G.value.start??0,n=O.value,r=W.value,i=Fr.value,a=Ir.value,o=le(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Lr.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]??``})}),zr=p(()=>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]}),Br=y(null);function Vr(e,t){j.value.events.datapointClick&&j.value.events.datapointClick({datapoint:t,seriesIndex:e+G.value.start})}function Hr(e,t){j.value.events.datapointLeave&&j.value.events.datapointLeave({datapoint:t,seriesIndex:e+G.value.start}),O.value=void 0,rn.value=!1,A.value=null,xn.value=`pointer`}at(()=>w.selectedXIndex,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 Ur(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,xn.value=n,Br.value={datapoint:t,seriesIndex:e,series:Q.value,config:j.value},Ii({seriesIndex:e,datapoint:t});let r=F.value.tooltip.customFormat;if(ne(r)&&pe(()=>r({seriesIndex:e,datapoint:t,series:Q.value,config:j.value})))an.value=r({seriesIndex:e,datapoint:t,series:Q.value,config:j.value});else if(F.value.tooltip.show){let n=``,{period:r,open:i,high:a,low:o,close:s,volume:ee,isBullish:c}=Q.value[e],{period:te,open:ne,high:re,low:ie,close:ae,volume:oe}=j.value.translations,se=N.value.xAxis.dataLabels.datetimeFormatter.enable?F.value.tooltip.useDefaultTimeFormat?$.value[e].text:Nr.value[e].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}"
|
|
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 l,D as te,Dt as ne,Jt as re,Qt as ie,X as ae,Yt as oe,_ as se,_t as ce,at as u,b as d,c as le,gt as ue,in as de,nt as fe,pt as pe,rn as me,t as he,wt 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-_JwRfIqE.js";import{t as xe}from"./useSvgLabelLayout-42Kats14.js";import{n as Se,r as Ce,t as we}from"./useTimeLabels-Das5O74F.js";import{t as Te}from"./usePrinter-DVf3YcG5.js";import{n as Ee,t as De}from"./BaseScanner-8NdoBs7B.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"./A11yDataTable-DWNlWXzs.js";import{t as Be}from"./SlicerPreview-0m9E7Zh_.js";import{t as Ve}from"./DefGrad-DKMq1REY.js";import{t as He}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as f,computed as p,createBlock as Ue,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as qe,guardReactiveProps as Je,mergeProps as Ye,nextTick as Xe,normalizeClass as _,normalizeProps as Ze,normalizeStyle as Qe,onBeforeUnmount as $e,onMounted as et,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as tt,shallowRef as nt,toDisplayString as rt,toRefs as it,unref as S,watch as at,watchEffect as ot,withCtx as C}from"vue";var st=/* @__PURE__ */ e({default:()=>Ht}),ct=[`id`],lt=[`id`],ut={style:{position:`relative`}},dt=[`xmlns`,`aria-describedby`,`viewBox`],ft=[`x`,`y`,`width`,`height`],pt={key:1},mt={key:0},ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],St=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],Ct=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],wt=[`x`,`y`,`width`,`height`,`fill`,`rx`],Tt={key:0},Et=[`cx`,`cy`,`r`,`fill`],Dt=[`cx`,`cy`,`r`,`fill`],Ot={key:1},kt=[`x`,`y`,`width`,`height`,`rx`,`fill`],At=[`x`,`y`,`width`,`height`,`fill`,`rx`],jt=[`x`,`y`,`height`,`width`,`fill`,`rx`],Mt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],Nt=[`d`,`stroke`],Pt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Ft=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],It=[`data-start`,`data-end`],Lt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Rt={key:5,class:`vue-data-ui-watermark`},zt=[`d`,`stroke`],Bt=[`d`,`stroke`,`stroke-width`],Vt=[`innerHTML`],Ht=/*#__PURE__*/ He({__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:He,emit:st}){let Ht=qe(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ut=qe(()=>import(`./Tooltip-C1q0Qoh7.js`)),Wt=qe(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Gt=qe(()=>import(`./DataTable-KeuZB1JM.js`)),Kt=qe(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),qt=qe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Jt=qe(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),Yt=qe(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_candlestick:Xt}=be(),{isThemeValid:Zt,warnInvalidTheme:Qt}=Ae(),w=e,T=st,$t=p(()=>!!w.dataset&&w.dataset.length),E=y(!1),en=y(!1),tn=0,nn=y(null),D=y(ae()),rn=y(!1),an=y(``),O=y(void 0),on=y(0),k=y(null),sn=y(null),cn=y(null),ln=y(null),un=y(null),dn=y(null),fn=y(0),pn=y(0),mn=y(0),hn=y(null),gn=y(null),_n=y(null),vn=y(null),yn=y(null),A=y(null),bn=y({x:0,y:0}),xn=y(`pointer`),Sn=y(!1),j=y(Mn()),M=p(()=>j.value.style.layout.candle),N=p(()=>j.value.style.layout.grid),P=p(()=>j.value.style.layout),F=p(()=>j.value.style),I=p(()=>j.value.userOptions);ve({config:()=>j.value,dataset:()=>w.dataset,component:`VueUiCandlestick`,rules:[ye.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:Cn}=Me({config:()=>j.value.transitions,dataset:()=>w.dataset}),wn=p(()=>j.value.userOptions.useCursorPointer),Tn=p(()=>de({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:En}=Ee({...it(w),FINAL_CONFIG:j,prepareConfig:Mn,callback:()=>{Promise.resolve().then(async()=>{await Xr()})},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:de({defaultConfig:j.value,userConfig:Tn.value})}),{userOptionsVisible:Dn,setUserOptionsVisibility:On,keepUserOptionState:kn}=Ne({config:j.value}),{svgRef:z}=Pe({config:F.value.title});function An(){On(!0)}function jn(){On(!1),T(`selectX`,{seriesIndex:null,datapoint:null}),O.value=null}function Mn(){let e=Oe({userConfig:w.config,defaultConfig:Xt}),t={};w.config&&ge(w.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!w.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Zt.value(e))Qt(e),t=e;else{let r=Oe({userConfig:Re[n]||w.config,defaultConfig:e});t={...Oe({userConfig:w.config,defaultConfig:r})}}}else t=e;return t}let Nn=ie(w.config);at(()=>w.config,(e,t)=>{let n=ie(e),r=n!==Nn;Nn=n;let i=Mn();r?(L.value||(j.value=Mn()),Dn.value=!j.value.userOptions.showOnChartHover,Ln(),fn.value+=1,mn.value+=1,pn.value+=1,V.value.showTable=j.value.table.show,V.value.showTooltip=F.value.tooltip.show,dr()):(j.value.style.tooltip=i.style.tooltip,V.value.showTooltip=j.value.style.tooltip.show)},{deep:!0}),at(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(En.value=!1),Kr()},{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}),Pn=nt(null),Fn=nt(null);et(()=>{Ln()});let In=p(()=>j.value.debug);function Ln(){_e(w.dataset)&&(u({componentName:`VueUiCandlestick`,type:`dataset`,debug:In.value}),En.value=!0),_e(w.dataset)||(En.value=j.value.loading),setTimeout(()=>{E.value=!0},10),j.value.responsive&&(Pn.value&&(Fn.value&&Pn.value.unobserve(Fn.value),Pn.value.disconnect()),Pn.value=new ResizeObserver(()=>{E.value=!1;let{width:e,height:t}=ke({chart:k.value,title:F.value.title.text?sn.value:null,slicer:F.value.zoom.show&&W.value>6?ln.value.$el:null,legend:cn.value,source:un.value,noTitle:dn.value});cancelAnimationFrame(tn),tn=requestAnimationFrame(()=>{B.value.width=e,B.value.height=t-12,en.value=!0,j.value.responsiveProportionalSizing?(B.value.xAxisFontSize=me({relator:Math.min(e,t),adjuster:F.value.width,source:N.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),B.value.yAxisFontSize=me({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),nn.value&&clearTimeout(nn.value),nn.value=setTimeout(()=>{E.value=!0},10)})}),Fn.value=k.value.parentNode,Pn.value.observe(Fn.value)),Xr()}$e(()=>{cancelAnimationFrame(tn),Pn.value&&(Fn.value&&Pn.value.unobserve(Fn.value),Pn.value.disconnect())});let{isPrinting:Rn,isImaging:zn,generatePdf:Bn,generateImage:Vn}=Te({elementId:`vue-ui-candlestick_${D.value}`,fileName:F.value.title.text||`vue-ui-candlestick`,options:j.value.userOptions.print}),Hn=p(()=>j.value.userOptions.show&&!F.value.title.text),V=y({showTable:j.value.table.show,showTooltip:F.value.tooltip.show}),{metrics:Un,ready:Wn,settling:H,update:Gn}=xe({svgRef:z,canMeasure:()=>(!j.value.responsive||en.value)&&(!N.value.xAxis.dataLabels.show||Er.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:hn.value?e(hn.value).textWidth:N.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(gn.value).height})}),Kn=p(()=>gn.value?Un.value.timeLabelsHeight+B.value.xAxisFontSize:0),qn=p(()=>N.value.yAxis.position===`right`);function Jn(){let e=Un.value.scaleLabelsWidth,t=N.value.yAxis.axisName?.show?N.value.yAxis.axisName.fontSize+N.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:qn.value?0:n,right:qn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let U=p(()=>{let{top:e,right:t,bottom:n,left:r}=P.value.padding,i=Jn();return{top:e+12,right:B.value.width-t-i.right,left:r+i.left,bottom:B.value.height-n-Kn.value,width:B.value.width-r-t-i.left-i.right,height:B.value.height-e-n-Kn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),Yn=p(()=>{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)),l=Math.max(0,Math.min(a,ee));return{x:e+c*o,y:t,width:(l-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=p(()=>R.value.length),G=y({start:0,end:W.value}),K=y({start:0,end:W.value}),Xn=y(!1),Zn=y(!1),Qn=y(null),q=y(null),J=y(null),$n=y(!1),er=y({time:0,x:0,y:0,pointerType:null}),tr=p(()=>F.value.zoom?.dragToZoom),Y=p(()=>tr.value.show&&$t.value&&Jr.value&&W.value>1&&!L.value),nr=null,rr={},ir=p(()=>F.value.zoom.preview.enable&&(K.value.start!==G.value.start||K.value.end!==G.value.end));function ar(e,t){K.value[e]=t}function or(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 sr(e){let t=or(e);t&&T(`update:zoomState`,t)}function cr(){nr&&=(cancelAnimationFrame(nr),null),rr={}}function lr(e){let t=or(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(G.value.start)||r!==Number(G.value.end))&&(cr(),G.value={start:n,end:r},K.value={start:n,end:r},dr()),{start:Number(G.value.start),end:Number(G.value.end)}}function ur(e){let t=lr(e);return t?(T(`update:zoomState`,t),t):null}function dr(){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,ln.value&&ln.value.setRangeValues(e,t)}let fr=p(()=>R.value.map((e,t)=>({...e,absoluteIndex:t}))),pr=p(()=>fr.value.slice(G.value.start,G.value.end)),mr=p(()=>(In.value&&R.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&u({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),pr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),hr=p(()=>fr.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=p(()=>U.value.width/pr.value.length),gr=p(()=>{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 mr.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}}),_r=p(()=>({max:N.value.yAxis.scale.max===null?gr.value.max.h:N.value.yAxis.scale.max,min:N.value.yAxis.scale.min===null?0:N.value.yAxis.scale.min})),Z=p(()=>se(_r.value.min,_r.value.max,N.value.yAxis.dataLabels.steps));function vr(e,t,n=null,r=null){return{...e,x:d(U.value.left+t*X.value+X.value/2),y:d(U.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*U.value.height),value:d(e),isMax:e===n,isMin:e===r}}let Q=p(()=>{let{max:e,min:t,volumeMax:n,volumeMin:r}=gr.value;return mr.value.map((i,a)=>{let o=vr(i.open,a,e.o,t.o),s=vr(i.high,a,e.h,t.h),ee=vr(i.low,a,e.l,t.l),c=vr(i.close,a,e.c,t.c),l=i.close>i.open,te=i.volume===n,ne=i.volume===r;return{period:i.period,open:o,high:s,low:ee,close:c,volume:i.volume,isBullish:l,absoluteIndex:i.absoluteIndex,isMaxVolume:te,isMinVolume:ne}})}),yr=p(()=>{let e=-1/0;for(let t of R.value)e=Math.max(e,t[2]);return e});function br({item:e,index:t,minimapH:n,unitW:r,min:i,max:a}){return{...e,x:d(t*r),y:d((1-(e-i)/(a-i))*n),value:d(e)}}let xr=p(()=>{let e=hr.value,t=N.value.yAxis.scale.min??0,n=N.value.yAxis.scale.max??yr.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=br({item:e.open,index:r,minimapH:o,unitW:s,min:t,max:n}),a=br({item:e.high,index:r,minimapH:o,unitW:s,min:t,max:n}),ee=br({item:e.low,index:r,minimapH:o,unitW:s,min:t,max:n}),c=br({item:e.close,index:r,minimapH:o,unitW:s,min:t,max:n}),l=e.close>e.open;return{period:e.period,open:i,high:a,low:ee,close:c,volume:e.volume,isBullish:l,absoluteIndex:e.absoluteIndex}})),a)}),Sr=p(()=>F.value.zoom.minimap.show?[{name:``,series:R.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function Cr(e){return d((e-Z.value.min)/(Z.value.max-Z.value.min))}let wr=p(()=>Z.value.ticks.map(e=>({y:U.value.bottom-U.value.height*Cr(e),value:d(e)}))),Tr=p(()=>mr.value.map(e=>e.period)),$=y([]),Er=y(!1),Dr=y([]),Or=0;ot(()=>{let e=++Or;(async()=>{let t=await we({values:R.value.map(e=>e[0]),maxDatapoints:R.value.length,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:G.value.start,end:G.value.end});e===Or&&($.value=t,Er.value=!0)})()});let kr=0;ot(()=>{let e=++kr;(async()=>{let t=await we({values:R.value.map(e=>e[0]),maxDatapoints:R.value.length,formatter:N.value.xAxis.dataLabels.datetimeFormatter,start:0,end:W.value});e===kr&&(Dr.value=t)})()});let Ar=y({months:[],shortMonths:[],days:[],shortDays:[]}),jr=0;ot(()=>{let e=++jr,t=N.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await Ce(t.locale).catch(()=>Ce(`en`));e===jr&&(Ar.value=n.data)})()});let Mr=p(()=>{let e=N.value.xAxis.dataLabels.datetimeFormatter,t=Se({useUTC:e.useUTC,locale:Ar.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=R.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),Nr=p(()=>(R.value.map(e=>e[0])||[]).map((e,t)=>({text:Mr.value(t,F.value.tooltip.timeFormat),absoluteIndex:t}))),Pr=p(()=>(R.value.map(e=>e[0])||[]).map((e,t)=>({text:Mr.value(t,F.value.zoom.timeFormat),absoluteIndex:t}))),Fr=p(()=>($.value||[]).map(e=>e?.text??``)),Ir=p(()=>(Dr.value||[]).map(e=>e?.text??``)),Lr=p(()=>{let e=Math.max(1,Math.floor(Number(N.value.xAxis.dataLabels.modulo)||1)),t=Fr.value,n=Ir.value,r=G.value.start??0,i=r>0||t.length<n.length;return ue({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),Rr=p(()=>{let e=N.value.xAxis.dataLabels,t=G.value.start??0,n=O.value,r=W.value,i=Fr.value,a=Ir.value,o=le(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Lr.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]??``})}),zr=p(()=>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]}),Br=y(null);function Vr(e,t){j.value.events.datapointClick&&j.value.events.datapointClick({datapoint:t,seriesIndex:e+G.value.start})}function Hr(e,t){j.value.events.datapointLeave&&j.value.events.datapointLeave({datapoint:t,seriesIndex:e+G.value.start}),O.value=void 0,rn.value=!1,A.value=null,xn.value=`pointer`}at(()=>w.selectedXIndex,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 Ur(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,xn.value=n,Br.value={datapoint:t,seriesIndex:e,series:Q.value,config:j.value},Ii({seriesIndex:e,datapoint:t});let r=F.value.tooltip.customFormat;if(ne(r)&&pe(()=>r({seriesIndex:e,datapoint:t,series:Q.value,config:j.value})))an.value=r({seriesIndex:e,datapoint:t,series:Q.value,config:j.value});else if(F.value.tooltip.show){let n=``,{period:r,open:i,high:a,low:o,close:s,volume:ee,isBullish:c}=Q.value[e],{period:te,open:ne,high:re,low:ie,close:ae,volume:oe}=j.value.translations,se=N.value.xAxis.dataLabels.datetimeFormatter.enable?F.value.tooltip.useDefaultTimeFormat?$.value[e].text:Nr.value[e].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
2
|
fill="${M.value.gradient.show?c?`url(#bullish_gradient_${D.value})`:`url(#bearish_gradient_${D.value})`:c?M.value.colors.bullish:M.value.colors.bearish}"/></svg>${se}</div>`,n+=`${oe} : <b>${isNaN(ee)?`-`:Number(ee.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 ce=l({p:F.value.tooltip.prefix,v:i.value,s:F.value.tooltip.suffix,r:F.value.tooltip.roundingValue}),u=l({p:F.value.tooltip.prefix,v:a.value,s:F.value.tooltip.suffix,r:F.value.tooltip.roundingValue}),d=l({p:F.value.tooltip.prefix,v:o.value,s:F.value.tooltip.suffix,r:F.value.tooltip.roundingValue}),le=l({p:F.value.tooltip.prefix,v:s.value,s:F.value.tooltip.suffix,r:F.value.tooltip.roundingValue});F.value.tooltip.showChart?n+=`<div style="width:100%;display:flex;align-items:center;justify-content:center;">
|
|
3
3
|
<svg viewBox="0 0 100 100" width="100px" style="background: transparent; overflow: visible">
|
|
4
4
|
<g>
|