vue-data-ui 2.4.63 → 2.4.65
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/README.md +66 -34
- package/dist/{Arrow-BpZBF7Ak.cjs → Arrow-BKPURRQ6.cjs} +1 -1
- package/dist/{Arrow-nOy23OOV.js → Arrow-C7ihyW4O.js} +1 -1
- package/dist/{BaseIcon-rzIvDo2Q.cjs → BaseIcon-CyTdOpDr.cjs} +1 -1
- package/dist/{BaseIcon-CrqNvGTs.js → BaseIcon-DpaRUsHC.js} +1 -1
- package/dist/{DataTable-CCJGHIVo.cjs → DataTable-CwzQ-L0W.cjs} +1 -1
- package/dist/{DataTable-BBh7_ttv.js → DataTable-DX_jYNWG.js} +2 -2
- package/dist/Legend-BMTBtkoQ.cjs +1 -0
- package/dist/Legend-DGUxLqhs.js +70 -0
- package/dist/{PackageVersion-dR8EUy_P.js → PackageVersion-B9_Ed72C.js} +1 -1
- package/dist/{PackageVersion-eZ5Dmuid.cjs → PackageVersion-D_9QTWVm.cjs} +1 -1
- package/dist/{PenAndPaper-D_w2N2qM.cjs → PenAndPaper-CfGYucSm.cjs} +1 -1
- package/dist/{PenAndPaper-CrXlqi9I.js → PenAndPaper-CzjoEhsO.js} +3 -3
- package/dist/{Shape-qkkvCKyp.cjs → Shape-CZB2KQ0L.cjs} +1 -1
- package/dist/{Shape-CwmKWYzq.js → Shape-aXd72O71.js} +1 -1
- package/dist/{Slicer-oNEtv1s3.cjs → Slicer-ChxjRhai.cjs} +1 -1
- package/dist/{Slicer-DvdU-uf8.js → Slicer-CopZgIzh.js} +2 -2
- package/dist/{Title-CoNtoGH9.cjs → Title-BnRtxxP4.cjs} +1 -1
- package/dist/{Title-obqvTiXP.js → Title-DyUTj8GI.js} +1 -1
- package/dist/{Tooltip-BK-ACGDE.js → Tooltip-B-0uEV3l.js} +1 -1
- package/dist/{Tooltip-Dz4wVJkz.cjs → Tooltip-CUoQNXZK.cjs} +1 -1
- package/dist/documentation/installation.md +34 -34
- package/dist/{index-Z_vzxZTo.js → index-BVNcFEqn.js} +398 -393
- package/dist/{index-ChOY3hT9.cjs → index-CKgv8c-A.cjs} +5 -5
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-CA8PjFJH.cjs → useNestedProp-0Mn5Z6Ae.cjs} +1 -1
- package/dist/{useNestedProp-Buhi5uyL.js → useNestedProp-D79dWdel.js} +1 -1
- package/dist/{usePrinter-Ck0oiMlt.js → usePrinter-Bcfs_I6G.js} +1 -1
- package/dist/{usePrinter-c3c7_uAW.cjs → usePrinter-Gkda9yEJ.cjs} +1 -1
- package/dist/{vue-data-ui-BGng_wXI.js → vue-data-ui-CXxR_hXg.js} +60 -60
- package/dist/{vue-data-ui-CihfnXFF.cjs → vue-data-ui-DAwVdbN1.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +9 -9
- package/dist/{vue-ui-3d-bar-BsxFEhMN.cjs → vue-ui-3d-bar-baVCskbW.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-B7k4LzL1.js → vue-ui-3d-bar-mxTzin_H.js} +9 -9
- package/dist/{vue-ui-accordion-CV2-8b1O.js → vue-ui-accordion-GNblUy42.js} +3 -3
- package/dist/{vue-ui-accordion-CZ8AlriN.cjs → vue-ui-accordion-xV0it5je.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-Bc4DaLIy.js → vue-ui-age-pyramid-DFBuvQgd.js} +10 -10
- package/dist/{vue-ui-age-pyramid-C1crnKk7.cjs → vue-ui-age-pyramid-ULh6qSJs.cjs} +1 -1
- package/dist/{vue-ui-annotator-DNKcAaEh.cjs → vue-ui-annotator-C89rtAuX.cjs} +1 -1
- package/dist/{vue-ui-annotator-DLbAn_Mz.js → vue-ui-annotator-XbCqxBQ0.js} +1 -1
- package/dist/{vue-ui-bullet-ClODxNrk.js → vue-ui-bullet-D_CS85II.js} +8 -8
- package/dist/{vue-ui-bullet-CEO3AsWC.cjs → vue-ui-bullet-DxRqDaiw.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DI7t6jqz.js → vue-ui-candlestick-C8mUQTPF.js} +11 -11
- package/dist/{vue-ui-candlestick-B00zQB4B.cjs → vue-ui-candlestick-CZxpFMKR.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-5jXlkslq.js → vue-ui-carousel-table-D5iLQe38.js} +4 -4
- package/dist/{vue-ui-carousel-table-Bm2D_0pZ.cjs → vue-ui-carousel-table-DKcc-jNW.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DP6-Gie6.cjs → vue-ui-chestnut-BFV6pTfc.cjs} +1 -1
- package/dist/{vue-ui-chestnut-CRZsXRUH.js → vue-ui-chestnut-BqGCLMiu.js} +8 -8
- package/dist/{vue-ui-cursor-BGe0gZK8.cjs → vue-ui-cursor-BJjzKpLm.cjs} +1 -1
- package/dist/{vue-ui-cursor-DA8bsmEc.js → vue-ui-cursor-BysQ-bDH.js} +2 -2
- package/dist/{vue-ui-dashboard-D2v4oSiB.cjs → vue-ui-dashboard-C0L_0gyc.cjs} +1 -1
- package/dist/{vue-ui-dashboard-BZD-6Pz7.js → vue-ui-dashboard-zrJGrAmc.js} +2 -2
- package/dist/{vue-ui-digits-CKvrL9Wc.js → vue-ui-digits-B5P9UheE.js} +2 -2
- package/dist/{vue-ui-digits-DC8ZuHOj.cjs → vue-ui-digits-BG_xts2G.cjs} +1 -1
- package/dist/vue-ui-donut-7tNjrx1E.js +1173 -0
- package/dist/vue-ui-donut-B9M9CW9D.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-CBsxmrTO.js → vue-ui-donut-evolution-C7FpJ59u.js} +11 -11
- package/dist/{vue-ui-donut-evolution-AlCGLfzy.cjs → vue-ui-donut-evolution-CEvGFdxK.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DB7jNjQP.js → vue-ui-dumbbell-CdxHbLz6.js} +10 -10
- package/dist/{vue-ui-dumbbell-B9cELz3z.cjs → vue-ui-dumbbell-DP27C8NG.cjs} +1 -1
- package/dist/{vue-ui-flow-Cw1Vfk_e.js → vue-ui-flow-cKQSDKfP.js} +9 -9
- package/dist/{vue-ui-flow-CCM51fzQ.cjs → vue-ui-flow-yW5Pa_MJ.cjs} +1 -1
- package/dist/{vue-ui-funnel--4JhwVwW.cjs → vue-ui-funnel-73aPtRj5.cjs} +1 -1
- package/dist/{vue-ui-funnel-CU72MuGg.js → vue-ui-funnel-qPYVhQpD.js} +9 -9
- package/dist/{vue-ui-galaxy-BKInqdOk.js → vue-ui-galaxy-2SRA_RYP.js} +11 -11
- package/dist/{vue-ui-galaxy-BJrkygeR.cjs → vue-ui-galaxy-9E5GUtBD.cjs} +1 -1
- package/dist/vue-ui-gauge-CBbvp9DU.cjs +1 -0
- package/dist/{vue-ui-gauge-DBPB11Eo.js → vue-ui-gauge-Cpvg4BBS.js} +236 -224
- package/dist/{vue-ui-gizmo-BSDdKP_q.js → vue-ui-gizmo-B5v0g_Ly.js} +3 -3
- package/dist/{vue-ui-gizmo-D7hHruEs.cjs → vue-ui-gizmo-BkNuHnnf.cjs} +1 -1
- package/dist/{vue-ui-heatmap-CysVyR78.cjs → vue-ui-heatmap-CcUuOqGT.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DhoDd6I_.js → vue-ui-heatmap-dNeKqLC0.js} +10 -10
- package/dist/{vue-ui-history-plot-C1IcR5tn.js → vue-ui-history-plot-COtfhHw8.js} +11 -11
- package/dist/{vue-ui-history-plot-D97p0C8E.cjs → vue-ui-history-plot-p18wqHFY.cjs} +1 -1
- package/dist/{vue-ui-kpi-Cu2PoWud.cjs → vue-ui-kpi-DCn50wZ8.cjs} +1 -1
- package/dist/{vue-ui-kpi-C43FJnkn.js → vue-ui-kpi-HyZOfh63.js} +3 -3
- package/dist/{vue-ui-mini-loader-Bdr0862F.cjs → vue-ui-mini-loader-DaPxFP7e.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DgPnsWaW.js → vue-ui-mini-loader-Dp7zc34Q.js} +2 -2
- package/dist/{vue-ui-molecule-CvxtHapj.js → vue-ui-molecule-Oim4-hUn.js} +11 -11
- package/dist/{vue-ui-molecule-CEJzQ7RY.cjs → vue-ui-molecule-zkdP7FYM.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DIn_Oars.cjs → vue-ui-mood-radar-CKdM8iDY.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-B6EmzBGf.js → vue-ui-mood-radar-DsSO6gfa.js} +11 -11
- package/dist/{vue-ui-nested-donuts-D4pAkaZH.js → vue-ui-nested-donuts-B5NPJfg6.js} +11 -11
- package/dist/{vue-ui-nested-donuts-c2pJF_ex.cjs → vue-ui-nested-donuts-DbTXLan2.cjs} +1 -1
- package/dist/{vue-ui-onion-DHOhnx2s.cjs → vue-ui-onion-0Od2Vodu.cjs} +1 -1
- package/dist/{vue-ui-onion-98XPhnVF.js → vue-ui-onion-CID0DNSa.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-DLOtv_NO.js → vue-ui-parallel-coordinate-plot-DAfBgYbI.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-CrVVxflg.cjs → vue-ui-parallel-coordinate-plot-WtcXCTd-.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DWM3zE7x.js → vue-ui-quadrant-063Cq0di.js} +12 -12
- package/dist/{vue-ui-quadrant-DbDQtcxz.cjs → vue-ui-quadrant-B6WNmecC.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DP0hSesI.cjs → vue-ui-quick-chart-CwNFF0R4.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CFVAisN4.js → vue-ui-quick-chart-DCPwhpbx.js} +9 -9
- package/dist/{vue-ui-radar-CNBN5GF9.js → vue-ui-radar-BmY47r3J.js} +12 -12
- package/dist/{vue-ui-radar-CDhwXWfs.cjs → vue-ui-radar-DcnVyGrM.cjs} +1 -1
- package/dist/{vue-ui-rating-cHW6zh7i.cjs → vue-ui-rating-D_9Fqvd_.cjs} +1 -1
- package/dist/{vue-ui-rating-CEfg8aGb.js → vue-ui-rating-b2SThMJw.js} +2 -2
- package/dist/{vue-ui-relation-circle-92LvehQf.js → vue-ui-relation-circle-B0Q2FdDW.js} +7 -7
- package/dist/{vue-ui-relation-circle-olDAN0lU.cjs → vue-ui-relation-circle-Cg3QL_aP.cjs} +1 -1
- package/dist/vue-ui-rings-BQdgj7bV.cjs +2 -0
- package/dist/vue-ui-rings-DlsKpDkQ.js +666 -0
- package/dist/{vue-ui-scatter-BvdgtUHX.cjs → vue-ui-scatter-D6Yb6VpP.cjs} +1 -1
- package/dist/{vue-ui-scatter-6wDrQ5fP.js → vue-ui-scatter-E_WveJ4p.js} +36 -36
- package/dist/{vue-ui-screenshot-CIAlcAvq.js → vue-ui-screenshot-CbLsOjZv.js} +1 -1
- package/dist/{vue-ui-screenshot-ChB7VFUO.cjs → vue-ui-screenshot-DhvqiF7S.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DlnPFtb4.cjs → vue-ui-skeleton-73YO0ovP.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BMRe3SzB.js → vue-ui-skeleton-Bgf16k10.js} +3 -3
- package/dist/{vue-ui-smiley-DkrQ5gDD.cjs → vue-ui-smiley-D-QDQ3Re.cjs} +1 -1
- package/dist/{vue-ui-smiley-CN5FWJ1G.js → vue-ui-smiley-ne5pBMum.js} +2 -2
- package/dist/{vue-ui-spark-trend-MNkadB41.js → vue-ui-spark-trend-BkiRBoVD.js} +13 -13
- package/dist/{vue-ui-spark-trend-BlOdnAb4.cjs → vue-ui-spark-trend-Dq1hox65.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CBPO2mUa.js → vue-ui-sparkbar--Q2alJoW.js} +4 -4
- package/dist/{vue-ui-sparkbar-ChTbwY11.cjs → vue-ui-sparkbar-DV5CtFQY.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-VLkIev3p.js → vue-ui-sparkgauge-BOcEbdij.js} +4 -4
- package/dist/{vue-ui-sparkgauge-B7yvQfZW.cjs → vue-ui-sparkgauge-BVNkRW_m.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DbOxX4Ks.js → vue-ui-sparkhistogram-CIJmWjb4.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-mYU6RAK_.cjs → vue-ui-sparkhistogram-CUiNT8vT.cjs} +1 -1
- package/dist/vue-ui-sparkline-BFlRfhM6.cjs +1 -0
- package/dist/{vue-ui-sparkline-D_-31O2S.js → vue-ui-sparkline-lY0wS6kU.js} +96 -96
- package/dist/{vue-ui-sparkstackbar-KaFMlIAL.cjs → vue-ui-sparkstackbar-CGeg_k0k.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-gW7rpJmQ.js → vue-ui-sparkstackbar-GHM4EY7-.js} +5 -5
- package/dist/vue-ui-stackbar-CQur8zP0.cjs +6 -0
- package/dist/vue-ui-stackbar-uR3T6rG4.js +1114 -0
- package/dist/{vue-ui-strip-plot-MlP5pDNx.cjs → vue-ui-strip-plot-CBYrZEIt.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-4o1zAxG_.js → vue-ui-strip-plot-CNFrYVZ6.js} +11 -11
- package/dist/{vue-ui-table-B0PFrkLI.cjs → vue-ui-table-BbTwHDCo.cjs} +1 -1
- package/dist/{vue-ui-table-DWNrd7zM.js → vue-ui-table-DZV-uDG2.js} +1 -1
- package/dist/{vue-ui-table-heatmap-BSKCS8Lq.js → vue-ui-table-heatmap-DQBm_9Z3.js} +14 -14
- package/dist/{vue-ui-table-heatmap-4k74Ux7O.cjs → vue-ui-table-heatmap-DSgQpgxG.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DCCogh2-.cjs → vue-ui-table-sparkline-AFK2LNsw.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BrImSTh0.js → vue-ui-table-sparkline-wWAVQ0es.js} +5 -5
- package/dist/{vue-ui-thermometer-DswmMXiU.cjs → vue-ui-thermometer-CGFQfRUy.cjs} +1 -1
- package/dist/{vue-ui-thermometer-DHEoT4yB.js → vue-ui-thermometer-DRZWIAFj.js} +7 -7
- package/dist/{vue-ui-timer-Tv94CYqL.cjs → vue-ui-timer-C-RRrh5f.cjs} +1 -1
- package/dist/{vue-ui-timer-BNFihNgK.js → vue-ui-timer-D2_1bbpl.js} +5 -5
- package/dist/{vue-ui-tiremarks-B2kuKLe-.cjs → vue-ui-tiremarks-CIeid_A2.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-DzaUfiET.js → vue-ui-tiremarks-CdX2b-Fq.js} +7 -7
- package/dist/{vue-ui-treemap-qKZJcEYe.js → vue-ui-treemap-CgzgE20q.js} +11 -11
- package/dist/{vue-ui-treemap-Dmt3RPF2.cjs → vue-ui-treemap-r8xOrE8F.cjs} +1 -1
- package/dist/vue-ui-vertical-bar-BcxAjcoh.cjs +4 -0
- package/dist/vue-ui-vertical-bar-v9LvL35a.js +936 -0
- package/dist/{vue-ui-waffle-DjJoezg-.js → vue-ui-waffle-0mHE8fud.js} +11 -11
- package/dist/{vue-ui-waffle-fWQvVbAH.cjs → vue-ui-waffle-5h_9tS3C.cjs} +1 -1
- package/dist/{vue-ui-wheel-DOrWSWt6.js → vue-ui-wheel-BWL-td7-.js} +7 -7
- package/dist/{vue-ui-wheel-2qIHyZe1.cjs → vue-ui-wheel-rL5Shua2.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-Tgg5jCE6.cjs → vue-ui-word-cloud-2E23n-B8.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-UPPKGsXt.js → vue-ui-word-cloud-OkAF9hSC.js} +10 -10
- package/dist/{vue-ui-xy-zCJv-Vao.js → vue-ui-xy-C8E2WzGt.js} +866 -819
- package/dist/vue-ui-xy-DbJNxL5O.cjs +3 -0
- package/dist/{vue-ui-xy-canvas-paHHRtqs.js → vue-ui-xy-canvas-C_0c8FlA.js} +31 -31
- package/dist/{vue-ui-xy-canvas-Dm3YUQ3g.cjs → vue-ui-xy-canvas-I7rw1uDf.cjs} +1 -1
- package/package.json +1 -1
- package/dist/Legend-CqilK5CI.cjs +0 -1
- package/dist/Legend-WOejx9sp.js +0 -68
- package/dist/vue-ui-donut-D5mDCNky.cjs +0 -1
- package/dist/vue-ui-donut-DDayabSz.js +0 -1122
- package/dist/vue-ui-gauge-Uo_1rs0Z.cjs +0 -1
- package/dist/vue-ui-rings-Bp0WLW4E.js +0 -628
- package/dist/vue-ui-rings-BwvTmRCE.cjs +0 -2
- package/dist/vue-ui-sparkline-DO496Tk5.cjs +0 -1
- package/dist/vue-ui-stackbar-CYHsSzEK.cjs +0 -6
- package/dist/vue-ui-stackbar-vIyS6oag.js +0 -1061
- package/dist/vue-ui-vertical-bar-CMXtevyE.js +0 -888
- package/dist/vue-ui-vertical-bar-CQ_qEJ_O.cjs +0 -4
- package/dist/vue-ui-xy-CMde0Kq-.cjs +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-CA8PjFJH.cjs"),c=require("./index-ChOY3hT9.cjs"),J=require("./Title-CoNtoGH9.cjs"),j=require("./usePrinter-c3c7_uAW.cjs"),K=require("./vue-ui-skeleton-DlnPFtb4.cjs"),Q=require("./PackageVersion-eZ5Dmuid.cjs"),W=require("./PenAndPaper-D_w2N2qM.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ae=["xmlns","viewBox"],le=["width","height"],re={key:1},ne=["d","stroke-width","stroke"],se={key:2},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const v=G,{vue_ui_tiremarks:D}=c.useConfig(),$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),B=e.ref(c.createUid()),P=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:x,setUserOptionsVisibility:N,keepUserOptionState:z}=Z.useUserOptionState({config:t.value});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:I,isImaging:F,generatePdf:V,generateImage:q}=j.usePrinter({elementId:B.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?T(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function Y(o){_.value=o,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:P,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:B.value,onMouseenter:n[0]||(n[0]=()=>e.unref(N)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(N)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:P.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(),e.createBlock(J._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(z)||e.unref(x))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(F),uid:B.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,le)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(K.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,te))}},he=ee._export_sfc(de,[["__scopeId","data-v-60aa805a"]]);exports.default=he;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-0Mn5Z6Ae.cjs"),c=require("./index-CKgv8c-A.cjs"),J=require("./Title-BnRtxxP4.cjs"),j=require("./usePrinter-Gkda9yEJ.cjs"),K=require("./vue-ui-skeleton-73YO0ovP.cjs"),Q=require("./PackageVersion-D_9QTWVm.cjs"),W=require("./PenAndPaper-CfGYucSm.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ae=["xmlns","viewBox"],le=["width","height"],re={key:1},ne=["d","stroke-width","stroke"],se={key:2},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const v=G,{vue_ui_tiremarks:D}=c.useConfig(),$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),B=e.ref(c.createUid()),P=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:x,setUserOptionsVisibility:N,keepUserOptionState:z}=Z.useUserOptionState({config:t.value});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:I,isImaging:F,generatePdf:V,generateImage:q}=j.usePrinter({elementId:B.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?T(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function Y(o){_.value=o,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:P,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:B.value,onMouseenter:n[0]||(n[0]=()=>e.unref(N)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(N)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:P.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(),e.createBlock(J._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(z)||e.unref(x))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(F),uid:B.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,le)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(K.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,te))}},he=ee._export_sfc(de,[["__scopeId","data-v-60aa805a"]]);exports.default=he;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as h, ref as k, watch as W, onMounted as ie, openBlock as s, createElementBlock as c, normalizeClass as U, normalizeStyle as G, unref as n, createBlock as I, createCommentVNode as d, createSlots as ce, withCtx as F, renderSlot as b, normalizeProps as L, guardReactiveProps as j, createVNode as ve, Fragment as Z, renderList as ee, toDisplayString as he } from "vue";
|
|
2
|
-
import { u as te } from "./useNestedProp-
|
|
3
|
-
import { u as de, c as fe, t as pe, v as ye, o as ge, e as me, w as ae, X as ke, i as be, f as _e } from "./index-
|
|
4
|
-
import { _ as Ce } from "./Title-
|
|
5
|
-
import { u as $e, U as we } from "./usePrinter-
|
|
6
|
-
import xe from "./vue-ui-skeleton-
|
|
7
|
-
import { _ as Pe } from "./PackageVersion-
|
|
8
|
-
import { P as Oe } from "./PenAndPaper-
|
|
2
|
+
import { u as te } from "./useNestedProp-D79dWdel.js";
|
|
3
|
+
import { u as de, c as fe, t as pe, v as ye, o as ge, e as me, w as ae, X as ke, i as be, f as _e } from "./index-BVNcFEqn.js";
|
|
4
|
+
import { _ as Ce } from "./Title-DyUTj8GI.js";
|
|
5
|
+
import { u as $e, U as we } from "./usePrinter-Bcfs_I6G.js";
|
|
6
|
+
import xe from "./vue-ui-skeleton-Bgf16k10.js";
|
|
7
|
+
import { _ as Pe } from "./PackageVersion-B9_Ed72C.js";
|
|
8
|
+
import { P as Oe } from "./PenAndPaper-CzjoEhsO.js";
|
|
9
9
|
import { u as Ae } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const Fe = ["id"], ze = {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useSlots as at, onMounted as Ie, computed as k, ref as f, watch as nt, onBeforeUnmount as st, openBlock as g, createElementBlock as w, normalizeClass as Le, normalizeStyle as R, unref as y, createBlock as E, createCommentVNode as S, createSlots as rt, withCtx as T, renderSlot as $, normalizeProps as G, guardReactiveProps as X, createVNode as Re, Fragment as De, renderList as Me, createElementVNode as N, toDisplayString as Y, createTextVNode as Ve, nextTick as ut, pushScopeId as it, popScopeId as ct } from "vue";
|
|
2
|
-
import { u as dt, c as Ue, t as vt, a as ht, p as _, b as ft, o as pt, e as gt, d as ae, i as ne, f as K, X as yt, l as Be, G as He, x as We, y as mt, q as bt, r as kt } from "./index-
|
|
3
|
-
import { _ as wt } from "./Title-
|
|
4
|
-
import { u as Ct, U as $t } from "./usePrinter-
|
|
5
|
-
import { _ as xt } from "./Tooltip-
|
|
6
|
-
import { L as Tt } from "./Legend-
|
|
7
|
-
import _t from "./vue-ui-skeleton-
|
|
8
|
-
import { D as Ot } from "./DataTable-
|
|
9
|
-
import St from "./vue-ui-accordion-
|
|
2
|
+
import { u as dt, c as Ue, t as vt, a as ht, p as _, b as ft, o as pt, e as gt, d as ae, i as ne, f as K, X as yt, l as Be, G as He, x as We, y as mt, q as bt, r as kt } from "./index-BVNcFEqn.js";
|
|
3
|
+
import { _ as wt } from "./Title-DyUTj8GI.js";
|
|
4
|
+
import { u as Ct, U as $t } from "./usePrinter-Bcfs_I6G.js";
|
|
5
|
+
import { _ as xt } from "./Tooltip-B-0uEV3l.js";
|
|
6
|
+
import { L as Tt } from "./Legend-DGUxLqhs.js";
|
|
7
|
+
import _t from "./vue-ui-skeleton-Bgf16k10.js";
|
|
8
|
+
import { D as Ot } from "./DataTable-DX_jYNWG.js";
|
|
9
|
+
import St from "./vue-ui-accordion-GNblUy42.js";
|
|
10
10
|
import { t as Nt, u as zt } from "./useResponsive-CoxXLe23.js";
|
|
11
|
-
import { u as Ee } from "./useNestedProp-
|
|
12
|
-
import { _ as Pt } from "./PackageVersion-
|
|
13
|
-
import { P as At } from "./PenAndPaper-
|
|
11
|
+
import { u as Ee } from "./useNestedProp-D79dWdel.js";
|
|
12
|
+
import { _ as Pt } from "./PackageVersion-B9_Ed72C.js";
|
|
13
|
+
import { P as At } from "./PenAndPaper-CzjoEhsO.js";
|
|
14
14
|
import { u as Ft } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { _ as It } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
function Ge(a, c) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-ChOY3hT9.cjs"),Ee=require("./Title-CoNtoGH9.cjs"),ye=require("./usePrinter-c3c7_uAW.cjs"),Le=require("./Tooltip-Dz4wVJkz.cjs"),Re=require("./Legend-CqilK5CI.cjs"),Ae=require("./vue-ui-skeleton-DlnPFtb4.cjs"),Fe=require("./DataTable-CCJGHIVo.cjs"),Ie=require("./vue-ui-accordion-CZ8AlriN.cjs"),be=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./useNestedProp-CA8PjFJH.cjs"),De=require("./PackageVersion-eZ5Dmuid.cjs"),qe=require("./PenAndPaper-D_w2N2qM.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Ce(n,v){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,d=-1/0,p=0;for(let g=0;g<s;g+=1){const h=n[g].normalizedValue;h<u&&(u=h),h>d&&(d=h),p+=h}return Math.max(v**2*d/p**2,p**2/(v**2*u))}}function we(n){const{xOffset:v,yOffset:s,width:u,height:d}=n;return{x0:v,y0:s,x1:v+u,y1:s+d}}function Ue(n,v,s){if(n.length===0)return!0;{const u=n.concat(v),d=Ce(n,s),p=Ce(u,s);return d>=p}}function We(n){const v=[],s=n.length;for(let u=0;u<s;u+=1){const d=n[u],p=d.length;for(let c=0;c<p;c+=1)v.push(d[c])}return v}function Ge(n,v){const s={...v,children:n};return Te(s)}function je(n){return(n.x1-n.x0)*(n.y1-n.y0)}function xe(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(v),c=n.length,g=n.map(f=>f.normalizedValue||0).reduce((f,y)=>f+y,0),h=g/u,w=g/s;let C=d,b=p;const k=[];if(s>=u){for(let f=0;f<c;f+=1){const y=n[f],x=b+y.normalizedValue/h,B={x0:C,y0:b,x1:C+h,y1:x},T=Object.assign({},y,B);b=x,k.push(T)}return k}else{for(let f=0;f<c;f+=1){const y=n[f],x=C+y.normalizedValue/w,B={x0:C,y0:b,x1:x,y1:b+w},T=Object.assign({},y,B);C=x,k.push(T)}return k}}function Xe(n){const v=Y(n),s=v.width,u=v.height;return Math.min(s,u)}function Ye(n,v){const s=n.length,u=n.map(h=>h.value??0).reduce((h,w)=>h+w,0),d=v/u,p=[];let c,g;for(let h=0;h<s;h+=1)g=n[h],c=Object.assign({},g,{normalizedValue:g.value*(d||0)}),p.push(c);return p}function Y(n){const{x0:v,y0:s,x1:u,y1:d}=n;return{xOffset:v,yOffset:s,width:u-v,height:d-s}}function Ze(n,v,s,u){let d=n,p=v,c=s,g=u;for(;;){const h=d.length;if(h===0){const k=xe(p,c);return g.concat(k)}const w=Xe(c),C=d[0],b=d.slice(1,h);if(Ue(p,C,w)){const k=p.concat(C);d=b,p=k,c=c,g=g}else{const k=p.length;let f=0;for(let T=0;T<k;T+=1)f+=p[T].normalizedValue;const y=Je(c,f),x=xe(p,c),B=g.concat(x);d=d,p=[],c=y,g=B}}}function Te(n){if(typeof n.children>"u"||!n.children.length)return[n];{const v=Ye(n.children,je(n)),s=Ze(v,[],n,[]),u=s.length,d=[];for(let c=0;c<u;c+=1)d.push(Te(s[c]));return We(d)}}function Je(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(n);if(s>=u){const c=v/u,g=s-c,h={xOffset:d+c,yOffset:p,width:g,height:u};return we(h)}else{const c=v/s,g=u-c,h={xOffset:d,yOffset:p+c,width:s,height:g};return we(h)}}const Ke=n=>(e.pushScopeId("data-v-d58b1737"),n=n(),e.popScopeId(),n),Qe=["id"],et=["xmlns","viewBox"],tt={key:0},ot=["id"],lt=["stop-color"],at=["stop-color"],nt=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],rt=["x","y","height","width"],ut={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},st=Ke(()=>e.createElementVNode("br",null,null,-1)),it={key:5,class:"vue-data-ui-watermark"},ct=["onClick"],dt={key:0},vt={key:1},ht=["innerHTML"],pt={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:v,emit:s}){const u=n,{vue_ui_treemap:d}=r.useConfig(),p=e.useSlots();e.onMounted(()=>{p["chart-background"]&&console.warn("VueUiTreemap does not support the #chart-background slot.")});const c=e.computed(()=>!!u.dataset&&u.dataset.length),g=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),h=e.ref(r.createUid()),w=e.ref(!1),C=e.ref(""),b=e.ref(!1),k=e.ref(0),f=e.ref([]),y=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0),t=e.computed({get:()=>oe(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:ee,keepUserOptionState:te}=Me.useUserOptionState({config:t.value});function oe(){const o=ke.useNestedProp({userConfig:u.config,defaultConfig:d});return o.theme?{...ke.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=oe(),U.value=!t.value.showOnChartHover,J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const{isPrinting:le,isImaging:ae,generatePdf:ne,generateImage:re}=ye.usePrinter({elementId:`treemap_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Se=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function ue(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),ue(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{$e()});function $e(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),ue(V.value),t.value.responsive){const o=be.throttle(()=>{const{width:a,height:l}=be.useResponsive({chart:y.value,title:t.value.style.chart.title.text?x.value:null,legend:t.value.style.chart.legend.show?B.value:null,source:T.value,noTitle:Z.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(y.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!f.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!f.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),se=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ie(o,a){return o.value/a}function Ne(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ie(a,l);return r.lightenHexColor(o,i<0?0:i)}function ce(o,a,l,i){return o.map((m,_)=>{const H=Ne(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],m,i),Ve=ie(m,i);return{...m,color:H,proportion:Ve,parentName:l,children:m.children?ce(m.children,H,m.name,i):void 0}})}const F=e.computed(()=>Ge(se.value.map((o,a)=>{const l=o.children?o.children.reduce((i,m)=>i+m.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ce(o.children.sort((i,m)=>m.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function de({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function ve({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Be(o){b.value=o,k.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),S=e.ref(!1);function G(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=G(o,l.children);if(i)return i}}return null}function Oe(o){if(S.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const $=e.ref(null),he=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:f.value.includes(o.id)?.5:1}))),Pe=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function pe(o){S.value=!1,$.value=null,f.value.includes(o.id)?f.value=f.value.filter(a=>a!==o.id):f.value.length<u.dataset.length-1&&f.value.push(o.id),s("selectLegend",se.value)}const j=e.ref(null);function _e({datapoint:o,seriesIndex:a}){$.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}w.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function fe(){e.nextTick(()=>{const o=N.value.head.map((i,m)=>[[i.name],[N.value.body[m]],[isNaN(N.value.body[m]/L.value)?"-":N.value.body[m]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((m,_)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[_],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[_],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:m.color,name:m.name,shape:"square"},H,isNaN(N.value.body[_]/L.value)?"-":r.dataLabel({v:N.value.body[_]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function ze(){return F.value}function ge(){O.value.showTable=!O.value.showTable}function me(){O.value.showTooltip=!O.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return v({getData:ze,generateCsv:fe,generateImage:re,generatePdf:ne,toggleTable:ge,toggleTooltip:me,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:y,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${h.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(ee)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(ee)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Z,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:x,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${J.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&c.value&&(e.unref(te)||e.unref(U))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref:"details",key:`user_option_${k.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:h.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:O.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Be,onGeneratePdf:e.unref(ne),onGenerateCsv:fe,onGenerateImage:e.unref(re),onToggleTable:ge,onToggleTooltip:me,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(te)?e.unref(U)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(De._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",tt,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,lt),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,at)],8,ot)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:de(l),width:ve(l),fill:g.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:m=>Oe(l),onMouseenter:()=>_e({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=m=>{$.value=null,w.value=!1}),style:e.normalizeStyle(`opacity:${$.value?$.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,nt),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:de(l),width:ve(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ut,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),st,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,rt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:S.value,rect:$.value,config:t.value})),void 0,!0)],14,et)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ae.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:B},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Re.Legend,{key:`legend_${Q.value}`,legendSet:he.value,config:Pe.value,id:`treemap_legend_${h.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>pe(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:m=>pe(l),style:e.normalizeStyle(`opacity:${f.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),f.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",dt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ct)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:he.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:T,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Le._sfc_main,{show:O.value.showTooltip&&w.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),c.value?(e.openBlock(),e.createBlock(Ie.default,{key:8,hideDetails:"",config:{open:O.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Fe.DataTable,{key:`table_${K.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>O.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ht)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Qe))}},ft=He._export_sfc(pt,[["__scopeId","data-v-d58b1737"]]);exports.default=ft;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CKgv8c-A.cjs"),Ee=require("./Title-BnRtxxP4.cjs"),ye=require("./usePrinter-Gkda9yEJ.cjs"),Le=require("./Tooltip-CUoQNXZK.cjs"),Re=require("./Legend-BMTBtkoQ.cjs"),Ae=require("./vue-ui-skeleton-73YO0ovP.cjs"),Fe=require("./DataTable-CwzQ-L0W.cjs"),Ie=require("./vue-ui-accordion-xV0it5je.cjs"),be=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./useNestedProp-0Mn5Z6Ae.cjs"),De=require("./PackageVersion-D_9QTWVm.cjs"),qe=require("./PenAndPaper-CfGYucSm.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Ce(n,v){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,d=-1/0,p=0;for(let g=0;g<s;g+=1){const h=n[g].normalizedValue;h<u&&(u=h),h>d&&(d=h),p+=h}return Math.max(v**2*d/p**2,p**2/(v**2*u))}}function we(n){const{xOffset:v,yOffset:s,width:u,height:d}=n;return{x0:v,y0:s,x1:v+u,y1:s+d}}function Ue(n,v,s){if(n.length===0)return!0;{const u=n.concat(v),d=Ce(n,s),p=Ce(u,s);return d>=p}}function We(n){const v=[],s=n.length;for(let u=0;u<s;u+=1){const d=n[u],p=d.length;for(let c=0;c<p;c+=1)v.push(d[c])}return v}function Ge(n,v){const s={...v,children:n};return Te(s)}function je(n){return(n.x1-n.x0)*(n.y1-n.y0)}function xe(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(v),c=n.length,g=n.map(f=>f.normalizedValue||0).reduce((f,y)=>f+y,0),h=g/u,w=g/s;let C=d,b=p;const k=[];if(s>=u){for(let f=0;f<c;f+=1){const y=n[f],x=b+y.normalizedValue/h,B={x0:C,y0:b,x1:C+h,y1:x},T=Object.assign({},y,B);b=x,k.push(T)}return k}else{for(let f=0;f<c;f+=1){const y=n[f],x=C+y.normalizedValue/w,B={x0:C,y0:b,x1:x,y1:b+w},T=Object.assign({},y,B);C=x,k.push(T)}return k}}function Xe(n){const v=Y(n),s=v.width,u=v.height;return Math.min(s,u)}function Ye(n,v){const s=n.length,u=n.map(h=>h.value??0).reduce((h,w)=>h+w,0),d=v/u,p=[];let c,g;for(let h=0;h<s;h+=1)g=n[h],c=Object.assign({},g,{normalizedValue:g.value*(d||0)}),p.push(c);return p}function Y(n){const{x0:v,y0:s,x1:u,y1:d}=n;return{xOffset:v,yOffset:s,width:u-v,height:d-s}}function Ze(n,v,s,u){let d=n,p=v,c=s,g=u;for(;;){const h=d.length;if(h===0){const k=xe(p,c);return g.concat(k)}const w=Xe(c),C=d[0],b=d.slice(1,h);if(Ue(p,C,w)){const k=p.concat(C);d=b,p=k,c=c,g=g}else{const k=p.length;let f=0;for(let T=0;T<k;T+=1)f+=p[T].normalizedValue;const y=Je(c,f),x=xe(p,c),B=g.concat(x);d=d,p=[],c=y,g=B}}}function Te(n){if(typeof n.children>"u"||!n.children.length)return[n];{const v=Ye(n.children,je(n)),s=Ze(v,[],n,[]),u=s.length,d=[];for(let c=0;c<u;c+=1)d.push(Te(s[c]));return We(d)}}function Je(n,v){const{width:s,height:u,xOffset:d,yOffset:p}=Y(n);if(s>=u){const c=v/u,g=s-c,h={xOffset:d+c,yOffset:p,width:g,height:u};return we(h)}else{const c=v/s,g=u-c,h={xOffset:d,yOffset:p+c,width:s,height:g};return we(h)}}const Ke=n=>(e.pushScopeId("data-v-d58b1737"),n=n(),e.popScopeId(),n),Qe=["id"],et=["xmlns","viewBox"],tt={key:0},ot=["id"],lt=["stop-color"],at=["stop-color"],nt=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],rt=["x","y","height","width"],ut={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},st=Ke(()=>e.createElementVNode("br",null,null,-1)),it={key:5,class:"vue-data-ui-watermark"},ct=["onClick"],dt={key:0},vt={key:1},ht=["innerHTML"],pt={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:v,emit:s}){const u=n,{vue_ui_treemap:d}=r.useConfig(),p=e.useSlots();e.onMounted(()=>{p["chart-background"]&&console.warn("VueUiTreemap does not support the #chart-background slot.")});const c=e.computed(()=>!!u.dataset&&u.dataset.length),g=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),h=e.ref(r.createUid()),w=e.ref(!1),C=e.ref(""),b=e.ref(!1),k=e.ref(0),f=e.ref([]),y=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0),t=e.computed({get:()=>oe(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:ee,keepUserOptionState:te}=Me.useUserOptionState({config:t.value});function oe(){const o=ke.useNestedProp({userConfig:u.config,defaultConfig:d});return o.theme?{...ke.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=oe(),U.value=!t.value.showOnChartHover,J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const{isPrinting:le,isImaging:ae,generatePdf:ne,generateImage:re}=ye.usePrinter({elementId:`treemap_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Se=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function ue(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),ue(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{$e()});function $e(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),ue(V.value),t.value.responsive){const o=be.throttle(()=>{const{width:a,height:l}=be.useResponsive({chart:y.value,title:t.value.style.chart.title.text?x.value:null,legend:t.value.style.chart.legend.show?B.value:null,source:T.value,noTitle:Z.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(y.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!f.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!f.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),se=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ie(o,a){return o.value/a}function Ne(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ie(a,l);return r.lightenHexColor(o,i<0?0:i)}function ce(o,a,l,i){return o.map((m,_)=>{const H=Ne(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],m,i),Ve=ie(m,i);return{...m,color:H,proportion:Ve,parentName:l,children:m.children?ce(m.children,H,m.name,i):void 0}})}const F=e.computed(()=>Ge(se.value.map((o,a)=>{const l=o.children?o.children.reduce((i,m)=>i+m.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ce(o.children.sort((i,m)=>m.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function de({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function ve({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Be(o){b.value=o,k.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),S=e.ref(!1);function G(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=G(o,l.children);if(i)return i}}return null}function Oe(o){if(S.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const $=e.ref(null),he=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:f.value.includes(o.id)?.5:1}))),Pe=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function pe(o){S.value=!1,$.value=null,f.value.includes(o.id)?f.value=f.value.filter(a=>a!==o.id):f.value.length<u.dataset.length-1&&f.value.push(o.id),s("selectLegend",se.value)}const j=e.ref(null);function _e({datapoint:o,seriesIndex:a}){$.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}w.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function fe(){e.nextTick(()=>{const o=N.value.head.map((i,m)=>[[i.name],[N.value.body[m]],[isNaN(N.value.body[m]/L.value)?"-":N.value.body[m]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((m,_)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[_],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[_],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:m.color,name:m.name,shape:"square"},H,isNaN(N.value.body[_]/L.value)?"-":r.dataLabel({v:N.value.body[_]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function ze(){return F.value}function ge(){O.value.showTable=!O.value.showTable}function me(){O.value.showTooltip=!O.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return v({getData:ze,generateCsv:fe,generateImage:re,generatePdf:ne,toggleTable:ge,toggleTooltip:me,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:y,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${h.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(ee)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(ee)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Z,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:x,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${J.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&c.value&&(e.unref(te)||e.unref(U))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref:"details",key:`user_option_${k.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:h.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:O.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Be,onGeneratePdf:e.unref(ne),onGenerateCsv:fe,onGenerateImage:e.unref(re),onToggleTable:ge,onToggleTooltip:me,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(te)?e.unref(U)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(De._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",tt,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,lt),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,at)],8,ot)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:de(l),width:ve(l),fill:g.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:m=>Oe(l),onMouseenter:()=>_e({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=m=>{$.value=null,w.value=!1}),style:e.normalizeStyle(`opacity:${$.value?$.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,nt),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:de(l),width:ve(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ut,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),st,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,rt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:S.value,rect:$.value,config:t.value})),void 0,!0)],14,et)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ae.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:B},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Re.Legend,{key:`legend_${Q.value}`,legendSet:he.value,config:Pe.value,id:`treemap_legend_${h.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>pe(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:m=>pe(l),style:e.normalizeStyle(`opacity:${f.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),f.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",dt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ct)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:he.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:T,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Le._sfc_main,{show:O.value.showTooltip&&w.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),c.value?(e.openBlock(),e.createBlock(Ie.default,{key:8,hideDetails:"",config:{open:O.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Fe.DataTable,{key:`table_${K.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>O.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ht)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Qe))}},ft=He._export_sfc(pt,[["__scopeId","data-v-d58b1737"]]);exports.default=ft;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CKgv8c-A.cjs"),pe=require("./useResponsive-BJ7DTGpm.cjs"),De=require("./Title-BnRtxxP4.cjs"),ye=require("./usePrinter-Gkda9yEJ.cjs"),Fe=require("./Tooltip-CUoQNXZK.cjs"),ge=require("./Legend-BMTBtkoQ.cjs"),Oe=require("./vue-ui-skeleton-73YO0ovP.cjs"),Ie=require("./BaseIcon-CyTdOpDr.cjs"),Me=require("./vue-ui-accordion-xV0it5je.cjs"),fe=require("./useNestedProp-0Mn5Z6Ae.cjs"),Ae=require("./PackageVersion-D_9QTWVm.cjs"),Re=require("./PenAndPaper-CfGYucSm.cjs"),qe=require("./useUserOptionState-BgepsfED.cjs"),me=require("./Shape-CZB2KQ0L.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ue=["id"],Xe=["onClick"],je=["xmlns","viewBox"],Ge=["width","height"],We=["id"],Ye=["stop-color"],Ke=["stop-color"],Je={key:1},Qe=["x","y","width","height","fill","rx"],Ze=["x","y","width","height","fill","rx","stroke","stroke-width"],et=["x","y","width","height","fill","rx","stroke","stroke-width"],tt=["x2","y1","y2","stroke","stroke-width"],lt=["x1","x2","y1","y2","stroke","stroke-width"],at=["x","y","text-anchor","font-size","fill","font-weight"],ot=["x","y","font-size","fill","font-weight"],nt=["x","y","font-size","fill","font-weight"],rt=["x","y","font-size","fill","font-weight"],ut=["y","width","height","fill","onMouseenter"],st={key:6,class:"vue-data-ui-watermark"},it=["onClick"],ct={style:"width:100%;padding-top: 36px;position:relative"},dt={class:"vue-ui-data-table"},vt={key:0},ht={style:{width:"100%"}},pt=["data-cell"],yt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},gt=["data-cell"],ft={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},mt=["data-cell"],bt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},kt=["data-cell"],Ct={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},_t=["data-cell"],xt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Nt=["data-cell"],wt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},$t=["data-cell"],St={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Vt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(be,{expose:ke,emit:Ce}){const f=be;e.useCssVars(a=>({"646b6c72":a.tdo}));const{vue_ui_vertical_bar:_e}=n.useConfig(),xe=e.useSlots(),T=e.computed(()=>!!f.dataset&&f.dataset.length),y=e.ref(n.createUid()),Ne=e.ref(null),D=e.ref(!1),F=e.ref(""),E=e.ref(0),we=e.ref(null),H=e.ref(0),$=e.ref(null),U=e.ref(null),O=e.ref(null),X=e.ref(null),j=e.ref(null),G=e.ref(0),I=e.ref(0),t=e.computed({get:()=>K(),set:a=>a}),{userOptionsVisible:M,setUserOptionsVisibility:W,keepUserOptionState:Y}=qe.useUserOptionState({config:t.value});function K(){const a=fe.useNestedProp({userConfig:f.config,defaultConfig:_e});return a.theme?{...fe.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[a.theme]||f.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}e.watch(()=>f.config,a=>{t.value=K(),M.value=!t.value.showOnChartHover,oe(),G.value+=1,I.value+=1,s.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>f.dataset,P,{deep:!0});const{isPrinting:J,isImaging:Q,generatePdf:Z,generateImage:ee}=ye.usePrinter({elementId:`vue-ui-vertical-bar_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),$e=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),le=e.ref(null),ae=e.ref(!1),Se=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{oe()});function oe(){if(n.objectIsEmpty(f.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=f.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),Ve(),t.value.responsive){const a=pe.throttle(()=>{const{width:o,height:l}=pe.useResponsive({chart:$.value,title:t.value.style.chart.title.text?U.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:X.value,noTitle:j.value});ue.value=o,s.value=l/E.value-c.value*2});L.value=new ResizeObserver(a),L.value.observe($.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function Ve(){new ResizeObserver(o=>{o.forEach(l=>{ae.value=l.contentRect.width<Se.value})}).observe(le.value)}const g=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),ne=e.computed(()=>g.value.sortDesc),_=e.computed(()=>(f.dataset.forEach((a,o)=>{!a.value&&!a.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),a.children&&(n.objectIsEmpty(a.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):a.children.forEach((l,r)=>{[null,void 0].includes(l.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),f.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${y.value}`,r=a.children&&a.children.length>0,v=n.checkNaN(a.value?a.value:r?a.children.map(p=>p.value||0).reduce((p,C)=>p+C,0):0),d=v>=0?1:-1;return{...a,id:l,absoluteIndex:o,shape:"square",opacity:b.value.includes(l)?.5:1,value:Math.abs(v),sign:d,hasChildren:r,isChild:!1,segregate:()=>V(l),isSegregated:b.value.includes(l),color:n.convertColorToHex(a.color)||te.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((p,C)=>ne.value?C.value-p.value:p.value-C.value).map((p,C)=>({...p,value:n.checkNaN(Math.abs(p.value)),absoluteIndex:o,sign:p.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:v,parentSign:d,id:`vertical_child_${o}_${C}_${y.value}`,childIndex:C,color:n.convertColorToHex(p.color)||n.convertColorToHex(a.color)||te.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((p,C)=>({...p,isFirstChild:C===0,isLastChild:C===a.children.length-1}))}}).toSorted((a,o)=>ne.value?o.value-a.value:a.value-o.value))),re=e.computed(()=>({cy:"vertical-bar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),s=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),Be=e.computed(()=>(s.value+c.value)*E.value),ue=e.ref(512),i=e.computed(()=>({width:ue.value,height:Be.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:i.value.padding.top+i.value.padding.bottom+i.value.height,top:i.value.padding.top,left:i.value.padding.left,right:i.value.width-i.value.padding.right,bottom:i.value.padding.top+i.value.height,width:i.value.width-(i.value.padding.left+i.value.padding.right)}));function P(){E.value=x.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const b=e.ref([]);function V(a){b.value.includes(a)?b.value=b.value.filter(o=>o!==a):b.value.push(a),P(),Ce("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(a=>!b.value.includes(a.id))),k=e.computed(()=>x.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function se(a,o=!1,l=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(a)/k.value*100),s:"%",r:l}):Math.abs(a)/k.value}const N=e.computed(()=>x.value.flatMap(a=>a.hasChildren?a.children:a)),w=e.computed(()=>N.value.map(a=>a.sign).includes(-1)),Te=e.computed(()=>Math.max(...x.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function h(a){const o=a/Te.value;return u.value.width/(w.value?2:1)*o}function Ee(a){return h(a)+u.value.left}function B(a,o){const l=x.value.find(d=>d.id===a.parentId),r=u.value.top+(c.value+s.value)*o,v=l.children.length*(c.value+s.value);return{y:r+v/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:l.name,value:[void 0,NaN,null].includes(l.value)?"":l.sign===1?l.value:-l.value,percentageToTotal:isNaN(l.value/k.value)?"":se(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function Le(){return x.value}const A=e.ref(null),R=e.ref(null);function Pe(a,o){R.value={datapoint:a,seriesIndex:o,series:_.value,config:t.value},D.value=!0,A.value=a.id;let l="";const r=a.isChild?a.parentName:a.name,v=a.isChild?a.name:"",d=t.value.style.chart.tooltip.customFormat;n.isFunction(d)&&n.functionReturnsString(()=>d({datapoint:a,series:_.value,config:t.value,seriesIndex:o}))?F.value=d({datapoint:a,series:_.value,config:t.value,seriesIndex:o}):(l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
|
|
2
|
+
<div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="${a.color}"/>${xe.pattern?`<rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="url(#pattern_${y.value}_${a.absoluteIndex})"/>`:""}</svg> ${r}</div>
|
|
3
|
+
${v?`<div>${v}</div>`:""}
|
|
4
|
+
</div>`,t.value.style.chart.tooltip.showValue&&(l+=`<div>${t.value.translations.value}: <b>${n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.sign===1?a.value:-a.value,n.dataLabel({p:t.value.style.chart.tooltip.prefix,v:a.sign===1?a.value:-a.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(l+=`<div>${t.value.translations.percentageToTotal} : <b>${n.dataLabel({v:Math.abs(a.value)/k.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,a.isChild&&(l+=`<div>${t.value.translations.percentageToSerie}: <b>${n.dataLabel({v:Math.abs(a.value)/Math.abs(a.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),F.value=`<div style="text-align:left">${l}</div>`)}function ie(a,o,l,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const v=n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n.checkNaN(r===-1&&a>=0?-a:a),n.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n.checkNaN(r===-1&&a>=0?-a:a),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:l}),d=`(${se(a,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${v}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${d}`:""}`}const m=e.computed(()=>{const a=[t.value.translations.parentName,t.value.translations.value,t.value.translations.percentageToTotal,t.value.translations.childName,t.value.translations.value,t.value.translations.percentageToSerie,t.value.translations.percentageToTotal],o=N.value.map(l=>l.isChild?l.isFirstChild?{color:l.color,parentName:l.parentName,parentValue:l.parentValue,percentageToTotal:l.parentValue/k.value,childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/k.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/k.value}:{color:l.color,parentName:l.name,parentValue:l.sign===1?l.value:-l.value,percentageToTotal:Math.abs(l.value)/k.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:a,body:o}});function ce(){const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=m.value.head,l=m.value.body.map(d=>[d.parentName,d.parentValue,d.percentageToTotal,d.childName,d.childValue,d.childPercentageToParent,d.childPercentageToTotal]),r=a.concat([o]).concat(l),v=n.createCsvContent(r);n.downloadCsv({csvContent:v,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const S=e.ref(!1);function ze(a){S.value=a,H.value+=1}function de(){g.value.showTable=!g.value.showTable}function ve(){g.value.sortDesc=!g.value.sortDesc,P()}function he(){g.value.showTooltip=!g.value.showTooltip}const z=e.ref(!1);function q(){z.value=!z.value}return ke({getData:Le,recalculateHeight:P,generatePdf:Z,generateCsv:ce,generateImage:ee,toggleTable:de,toggleSort:ve,toggleTooltip:he,toggleAnnotator:q}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${S.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:$,id:`vue-ui-vertical-bar_${y.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),onMouseenter:o[5]||(o[5]=()=>e.unref(W)(!0)),onMouseleave:o[6]||(o[6]=()=>e.unref(W)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Re.PenAndPaper,{key:0,parent:$.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:z.value,onClose:q},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),$e.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:j,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:U,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(De._sfc_main,{key:`title_${G.value}`,config:{title:{cy:"vertical-bar-div-title",...t.value.style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&T.value&&(e.unref(Y)||e.unref(M))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref_key:"details",ref:Ne,key:`user_options_${H.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasSort:t.value.userOptions.buttons.sort,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:S.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:z.value,onToggleFullscreen:ze,onGeneratePdf:e.unref(Z),onGenerateCsv:ce,onGenerateImage:e.unref(ee),onToggleTable:de,onToggleSort:ve,onToggleTooltip:he,onToggleAnnotator:q,style:e.normalizeStyle({visibility:e.unref(Y)?e.unref(M)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"7"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:4,ref_key:"chartLegend",ref:O},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_top_${I.value}`,legendSet:_.value,config:re.value,onClickMarker:o[0]||(o[0]=({legend:l})=>V(l.id))},e.createSlots({item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:v=>V(l.id),style:e.normalizeStyle(`opacity:${b.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,Xe)]),_:2},[a.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:l,index:r})=>[e.createVNode(me._sfc_main,{shape:l.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${y.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"]))],512)):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",{key:5,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":S.value,"vue-data-ui-fulscreen--off":!S.value}),viewBox:`0 0 ${i.value.width<=0?10:i.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ae._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:i.value.width<=0?10:i.value.width,height:u.value.fullHeight<=0?10:u.value.fullHeight,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,Ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${y.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.03),100-t.value.style.chart.layout.bars.gradientIntensity)},null,8,Ke)],8,We))),256)),a.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,l=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(a.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:l.absoluteIndex,patternId:`pattern_${y.value}_${l.absoluteIndex}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(w.value?u.value.left+u.value.width/2-(l.sign===1?0:h(l.value)<=0?1e-4:h(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(h(l.value)<=0?1e-4:h(l.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.underlayerColor,rx:t.value.style.chart.layout.bars.borderRadius,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Qe)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(w.value?u.value.left+u.value.width/2-(l.sign===1?0:h(l.value)<=0?1e-4:h(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(h(l.value)<=0?1e-4:h(l.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${y.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.bars.fillOpacity),rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?l.color:"none","stroke-width":t.value.style.chart.layout.bars.useStroke?t.value.style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Ze),a.$slots.pattern?(e.openBlock(),e.createElementBlock("rect",{key:0,x:e.unref(n.checkNaN)(w.value?u.value.left+u.value.width/2-(l.sign===1?0:h(l.value)<=0?1e-4:h(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(h(l.value)<=0?1e-4:h(l.value)),height:s.value<=0?1e-4:s.value,fill:`url(#pattern_${y.value}_${l.absoluteIndex})`,rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?l.color:"none","stroke-width":t.value.style.chart.layout.bars.useStroke?t.value.style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,et)):e.createCommentVNode("",!0),(!l.isChild||l.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==N.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:1,x1:0,x2:u.value.left,y1:s.value+c.value/2+u.value.top+(c.value+s.value)*r,y2:s.value+c.value/2+u.value.top+(c.value+s.value)*r,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,tt)):e.createCommentVNode("",!0),w.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:2,x1:u.value.left+u.value.width/2,x2:u.value.left+u.value.width/2,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,lt)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:w.value?u.value.left+u.value.width/2+(l.sign===1?-12:12)+(l.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):Ee(l.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!w.value||l.sign===-1?"start":"end","font-size":t.value.style.chart.layout.bars.dataLabels.fontSize,fill:t.value.style.chart.layout.bars.dataLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(ie(l.value,l,r,l.sign)),9,at),(l.isChild||!l.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,"text-anchor":"end",x:u.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.nameLabels.fontSize/2,"font-size":t.value.style.chart.layout.bars.nameLabels.fontSize,fill:t.value.style.chart.layout.bars.nameLabels.color,"font-weight":t.value.style.chart.layout.bars.nameLabels.bold?"bold":"normal"},e.toDisplayString(l.name),9,ot)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:B(l,r).y,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(B(l,r).name),9,nt)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:B(l,r).y+t.value.style.chart.layout.bars.parentLabels.fontSize+6,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(ie(B(l,r).value),B(l,r),r,l.parentSign||l.sign),9,rt)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(c.value+s.value)*r-c.value/2,width:i.value.width<=0?1e-4:i.value.width,height:s.value+c.value<=0?1e-4:s.value+c.value,fill:A.value===l.id?e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity):"transparent",onMouseenter:v=>Pe(l,r),onMouseleave:o[1]||(o[1]=v=>{we.value=null,D.value=!1,A.value=null})},null,40,ut)]))),256)),e.renderSlot(a.$slots,"svg",{svg:i.value},void 0,!0)],14,je)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(J)||e.unref(Q)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Oe.default,{key:7,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"chartLegend",ref:O},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_bottom_${I.value}`,legendSet:_.value,config:re.value,onClickMarker:o[2]||(o[2]=({legend:l})=>V(l.id))},e.createSlots({item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{onClick:v=>V(l.id),style:e.normalizeStyle(`opacity:${b.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,it)]),_:2},[a.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:l,index:r})=>[e.createVNode(me._sfc_main,{shape:l.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${y.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:_.value},void 0,!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:9,ref_key:"source",ref:X,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Fe._sfc_main,{show:g.value.showTooltip&&D.value&&b.value.length<f.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:F.value,isFullscreen:S.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),T.value?(e.openBlock(),e.createBlock(Me.default,{key:10,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:le,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",ct,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:o[3]||(o[3]=l=>g.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(l=>g.value.showTable=!1,["enter"]))},[e.createVNode(Ie.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%","container-type":"inline-size"},class:e.normalizeClass({"vue-ui-responsive":ae.value})},[e.createElementVNode("table",dt,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline}),class:"vue-ui-data-table__caption"},[e.createTextVNode(e.toDisplayString(t.value.style.chart.title.text)+" ",1),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",vt,e.toDisplayString(t.value.style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value.head,l=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",ht,e.toDisplayString(l),1)],4))),256))],4),e.createElementVNode("tr",null,[e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"∑ "+e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(isNaN(k.value)?"":k.value.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value.body,(l,r)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":m.value.head[0]??""},[e.createElementVNode("div",yt,[l.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${l.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(l.parentName),1)])],12,pt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[1]??""},[e.createElementVNode("div",ft,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.parentValue)?"":l.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,gt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[2]??""},[e.createElementVNode("div",bt,e.toDisplayString(["",NaN,void 0].includes(l.percentageToTotal)?"":`${(l.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,mt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[3]??""},[e.createElementVNode("div",Ct,e.toDisplayString(l.childName),1)],12,kt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[4]??""},[e.createElementVNode("div",xt,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.childValue)?"":l.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,_t),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[5]??""},[e.createElementVNode("div",wt,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToParent)?"":`${(l.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,Nt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":m.value.head[6]??""},[e.createElementVNode("div",St,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToTotal)?"":`${(l.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,$t)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ue))}},Bt=He._export_sfc(Vt,[["__scopeId","data-v-b7b6fe7f"]]);exports.default=Bt;
|