vue-data-ui 2.3.72 → 2.3.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-CC7jRg59.js → Arrow-CYCrAySW.js} +1 -1
- package/dist/{Arrow-ZIElM1Qw.cjs → Arrow-DK6F5Fq3.cjs} +1 -1
- package/dist/{BaseIcon-CBTIJ_i3.cjs → BaseIcon-DBHVtm3A.cjs} +1 -1
- package/dist/{BaseIcon-CPk98Gv1.js → BaseIcon-kBIAYqUO.js} +1 -1
- package/dist/{DataTable-03mHwPdu.cjs → DataTable-BNFSPjhv.cjs} +1 -1
- package/dist/{DataTable-B9bLH4Tw.js → DataTable-CKdV-L0e.js} +2 -2
- package/dist/{Legend-VJiB_MLq.js → Legend-Cj7T-DqJ.js} +1 -1
- package/dist/{Legend-rxEBmJRW.cjs → Legend-Do2kcWFT.cjs} +1 -1
- package/dist/{Shape-D95l9PFa.js → Shape-Bo8ZjViG.js} +1 -1
- package/dist/{Shape-DGhwVgQc.cjs → Shape-DRDUAe_o.cjs} +1 -1
- package/dist/{Slicer-DBgvUVRS.js → Slicer-4nGKvUYF.js} +2 -2
- package/dist/{Slicer-DUMKJ_f0.cjs → Slicer-D8jHSP7U.cjs} +1 -1
- package/dist/{Title-Du743m6e.cjs → Title-D5cATWsL.cjs} +1 -1
- package/dist/{Title-B_AI8tEZ.js → Title-DZjnxQdN.js} +1 -1
- package/dist/{Tooltip-CPewpyRa.js → Tooltip--kgFEVZs.js} +1 -1
- package/dist/{Tooltip-B_WP5J9X.cjs → Tooltip-B8yLaegk.cjs} +1 -1
- package/dist/{index-BYuu8ZDR.js → index-C8SH0f2u.js} +1 -1
- package/dist/{index-Cuc8JBQE.cjs → index-D_32ZGWd.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-DZwVoxS3.cjs → useNestedProp-BvvH633N.cjs} +1 -1
- package/dist/{useNestedProp-DdJ6Grxg.js → useNestedProp-lS_T5lM3.js} +1 -1
- package/dist/{usePrinter-BaExNQdD.cjs → usePrinter-BouFNHWR.cjs} +1 -1
- package/dist/{usePrinter-DqIk1aRq.js → usePrinter-Dj50NAxo.js} +1 -1
- package/dist/{vue-data-ui-C-epWCMP.js → vue-data-ui-DoXqU7xC.js} +57 -57
- package/dist/{vue-data-ui-CUctczUX.cjs → vue-data-ui-v_BbbLtJ.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BWgmK5sr.js → vue-ui-3d-bar-CnoPOJHm.js} +7 -7
- package/dist/{vue-ui-3d-bar-xEpa156l.cjs → vue-ui-3d-bar-CwCEoPX-.cjs} +1 -1
- package/dist/{vue-ui-accordion-CX_qmhfk.cjs → vue-ui-accordion-Cka6b_Up.cjs} +1 -1
- package/dist/{vue-ui-accordion-CW9p_36e.js → vue-ui-accordion-YHleIgkV.js} +3 -3
- package/dist/{vue-ui-age-pyramid-C2anlrIJ.js → vue-ui-age-pyramid-CENg8fDg.js} +8 -8
- package/dist/{vue-ui-age-pyramid-DgdE2kzJ.cjs → vue-ui-age-pyramid-GqCNpd_h.cjs} +1 -1
- package/dist/{vue-ui-annotator-DBsLmFva.cjs → vue-ui-annotator-ByYg6QMs.cjs} +1 -1
- package/dist/{vue-ui-annotator-BsFyYQmg.js → vue-ui-annotator-VJOLUkqJ.js} +1 -1
- package/dist/{vue-ui-candlestick-BvObxrrO.js → vue-ui-candlestick-CHsGD3bx.js} +9 -9
- package/dist/{vue-ui-candlestick-CuAxLf7q.cjs → vue-ui-candlestick-TdNVq_FX.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-D7VggXPa.js → vue-ui-carousel-table-RAtX3VBu.js} +4 -4
- package/dist/{vue-ui-carousel-table-B8uXpuho.cjs → vue-ui-carousel-table-yXUSFk2u.cjs} +1 -1
- package/dist/{vue-ui-chestnut-WVNJAAhE.js → vue-ui-chestnut-B5GQX0J_.js} +6 -6
- package/dist/{vue-ui-chestnut-DsDFUMa1.cjs → vue-ui-chestnut-EJj-dQSY.cjs} +1 -1
- package/dist/{vue-ui-cursor-BHDKuzwQ.js → vue-ui-cursor-CMm7XSSG.js} +2 -2
- package/dist/{vue-ui-cursor-Dv2x-leV.cjs → vue-ui-cursor-DnZqLj21.cjs} +1 -1
- package/dist/{vue-ui-dashboard-B7UJ5m3e.js → vue-ui-dashboard-Ck_5L3eu.js} +2 -2
- package/dist/{vue-ui-dashboard-CW2crD7k.cjs → vue-ui-dashboard-DgEQJnLr.cjs} +1 -1
- package/dist/{vue-ui-digits-S4d-vjPw.js → vue-ui-digits--ULH35um.js} +2 -2
- package/dist/{vue-ui-digits-DgAV9vHK.cjs → vue-ui-digits-UvwUdi6U.cjs} +1 -1
- package/dist/{vue-ui-donut-CXrbo2vS.cjs → vue-ui-donut-BqUBysA_.cjs} +1 -1
- package/dist/{vue-ui-donut-D-Obra62.js → vue-ui-donut-QQ1fWWvc.js} +9 -9
- package/dist/{vue-ui-donut-evolution-DMN5gqox.cjs → vue-ui-donut-evolution-BXtEnop4.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CPp91gGc.js → vue-ui-donut-evolution-Cx8kBB_7.js} +9 -9
- package/dist/{vue-ui-dumbbell-B6VqQ1kW.js → vue-ui-dumbbell-BYvwHpU8.js} +8 -8
- package/dist/{vue-ui-dumbbell-C5QNKImY.cjs → vue-ui-dumbbell-CjIh7KTm.cjs} +1 -1
- package/dist/{vue-ui-flow-DxDFmEMo.js → vue-ui-flow-hp0Hpuhn.js} +7 -7
- package/dist/{vue-ui-flow-C265HMf-.cjs → vue-ui-flow-u29zqSQj.cjs} +1 -1
- package/dist/{vue-ui-galaxy-3W5_FamU.js → vue-ui-galaxy-B0L57aec.js} +9 -9
- package/dist/{vue-ui-galaxy-CE6eSTiR.cjs → vue-ui-galaxy-DE1HbBi-.cjs} +1 -1
- package/dist/{vue-ui-gauge-Ct9Pm6Rr.cjs → vue-ui-gauge-B_IZrsfj.cjs} +1 -1
- package/dist/{vue-ui-gauge-i_mEreL4.js → vue-ui-gauge-CPyyn7cL.js} +5 -5
- package/dist/{vue-ui-gizmo-DjKx8zQ3.js → vue-ui-gizmo-D2RfM55X.js} +2 -2
- package/dist/{vue-ui-gizmo-fpcEpQC_.cjs → vue-ui-gizmo-DR4gacOL.cjs} +1 -1
- package/dist/{vue-ui-heatmap-BHVAAWge.js → vue-ui-heatmap-DKM0DH41.js} +8 -8
- package/dist/{vue-ui-heatmap-BJ5WgKkA.cjs → vue-ui-heatmap-DMB_eUpA.cjs} +1 -1
- package/dist/{vue-ui-kpi-3vwX1pb-.js → vue-ui-kpi-BAxAY13T.js} +3 -3
- package/dist/{vue-ui-kpi-BJO4Si4A.cjs → vue-ui-kpi-BD21xshi.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Bkz8xXIn.cjs → vue-ui-mini-loader-CLP19Txv.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BGNVjrVa.js → vue-ui-mini-loader-MywnWlYI.js} +2 -2
- package/dist/{vue-ui-molecule-Be2hKLP4.cjs → vue-ui-molecule-BNsWckH-.cjs} +1 -1
- package/dist/{vue-ui-molecule-DmcAp7Nw.js → vue-ui-molecule-CLI9iTRE.js} +9 -9
- package/dist/{vue-ui-mood-radar-DkhEq8kd.cjs → vue-ui-mood-radar-BsWE1f8R.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-mzy-m7VP.js → vue-ui-mood-radar-O30wZo9a.js} +9 -9
- package/dist/{vue-ui-nested-donuts-BiCvS_99.cjs → vue-ui-nested-donuts-CYyUtXs2.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CrZglRrG.js → vue-ui-nested-donuts-D8o4TqTt.js} +9 -9
- package/dist/{vue-ui-onion-Cvm8iYyA.cjs → vue-ui-onion-D7TXJu5w.cjs} +1 -1
- package/dist/{vue-ui-onion-BiM0osaA.js → vue-ui-onion-Hmcke6xB.js} +9 -9
- package/dist/{vue-ui-parallel-coordinate-plot-CSKNUGrK.cjs → vue-ui-parallel-coordinate-plot-BqZB7xKn.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-B2F5TA1E.js → vue-ui-parallel-coordinate-plot-CyChE3NP.js} +10 -10
- package/dist/{vue-ui-quadrant-BMxBMaop.cjs → vue-ui-quadrant-BPDTvxlT.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DPqbsYX0.js → vue-ui-quadrant-DimTQdAj.js} +10 -10
- package/dist/{vue-ui-quick-chart-CUFDSDf1.cjs → vue-ui-quick-chart-C_-ut0if.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BsF68NGZ.js → vue-ui-quick-chart-DxJvENid.js} +7 -7
- package/dist/{vue-ui-radar-D85U18Fh.cjs → vue-ui-radar-C5Kq19hg.cjs} +1 -1
- package/dist/{vue-ui-radar-CP99GsF6.js → vue-ui-radar-D_FieunT.js} +10 -10
- package/dist/{vue-ui-rating-fCVonNIH.cjs → vue-ui-rating-BHW2Onru.cjs} +1 -1
- package/dist/{vue-ui-rating-D2_B2CmO.js → vue-ui-rating-DF1BpH4E.js} +2 -2
- package/dist/{vue-ui-relation-circle-CCw0p9C1.js → vue-ui-relation-circle-4kIYttRI.js} +5 -5
- package/dist/{vue-ui-relation-circle-BwhjRfE-.cjs → vue-ui-relation-circle-DHMHHsqY.cjs} +1 -1
- package/dist/{vue-ui-rings-Cyb2-Fz9.cjs → vue-ui-rings-BqPS8NKl.cjs} +1 -1
- package/dist/{vue-ui-rings-CP9xh0Jf.js → vue-ui-rings-BqS-iece.js} +9 -9
- package/dist/{vue-ui-scatter-C_7m-HWT.cjs → vue-ui-scatter-BLVcdf3d.cjs} +1 -1
- package/dist/{vue-ui-scatter-DahRqX0n.js → vue-ui-scatter-Dns49Nht.js} +10 -10
- package/dist/{vue-ui-screenshot-kjxK6cGN.cjs → vue-ui-screenshot---q062Kd.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bz8ypntU.js → vue-ui-screenshot-5Gsnd0Wr.js} +1 -1
- package/dist/{vue-ui-skeleton-DY6dv9ms.js → vue-ui-skeleton-B4eWLjH3.js} +2 -2
- package/dist/{vue-ui-skeleton-DBlDHYe3.cjs → vue-ui-skeleton-fVPw-oIR.cjs} +1 -1
- package/dist/{vue-ui-smiley-QjSvhCpm.js → vue-ui-smiley-B8Tyunn3.js} +2 -2
- package/dist/{vue-ui-smiley-D4LI_UP4.cjs → vue-ui-smiley-YfHmv0rQ.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-D2lgLtNe.cjs → vue-ui-spark-trend-Dpv6am0Z.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-sS5omLKN.js → vue-ui-spark-trend-Em9OqYyG.js} +4 -4
- package/dist/{vue-ui-sparkbar-D477mrPt.js → vue-ui-sparkbar-9DBvdYn7.js} +3 -3
- package/dist/{vue-ui-sparkbar-BSa3E1PW.cjs → vue-ui-sparkbar-BuSuwQYl.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge--a3JMX4H.js → vue-ui-sparkgauge-BN5feBzp.js} +3 -3
- package/dist/{vue-ui-sparkgauge-CBdtHXSj.cjs → vue-ui-sparkgauge-DKtUZMv1.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-B7vG6DfM.js → vue-ui-sparkhistogram-BBUVmco4.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-GY3NORZf.cjs → vue-ui-sparkhistogram-BmuusW02.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DGM2gvJO.cjs → vue-ui-sparkline-Blzv-tIQ.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DQv6RoBk.js → vue-ui-sparkline-CeqNV6Re.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-CgCC9OyA.js → vue-ui-sparkstackbar-C3GMC1eW.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-CwSD66G_.cjs → vue-ui-sparkstackbar-D__WDEMv.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DE06kEdr.cjs → vue-ui-stackbar-DFqJ5K_q.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CYlI2qNa.js → vue-ui-stackbar-DyGPrFxi.js} +10 -10
- package/dist/{vue-ui-strip-plot-cLATedZC.js → vue-ui-strip-plot-y1AnVJmq.js} +9 -9
- package/dist/{vue-ui-strip-plot-CTPE5LwY.cjs → vue-ui-strip-plot-z9fjJ6Dj.cjs} +1 -1
- package/dist/{vue-ui-table-isDxWkmA.js → vue-ui-table-B4kfykAO.js} +1 -1
- package/dist/{vue-ui-table-heatmap-tqdvfQH_.cjs → vue-ui-table-heatmap-CGKecjtm.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DdEcsnYm.js → vue-ui-table-heatmap-YZRSzwRM.js} +4 -4
- package/dist/{vue-ui-table-sparkline-By0R0tDV.js → vue-ui-table-sparkline-C0v2r4Kf.js} +5 -5
- package/dist/{vue-ui-table-sparkline-D2Eyb3oO.cjs → vue-ui-table-sparkline-CHFZG3Tg.cjs} +1 -1
- package/dist/{vue-ui-table-CYfUUquW.cjs → vue-ui-table-xWvAQS-s.cjs} +1 -1
- package/dist/{vue-ui-thermometer-CewCkrgl.js → vue-ui-thermometer-D5qurIy7.js} +5 -5
- package/dist/{vue-ui-thermometer-DT_17Yji.cjs → vue-ui-thermometer-DoOxxVW1.cjs} +1 -1
- package/dist/{vue-ui-timer-aFikwHk0.cjs → vue-ui-timer-D63zHe-I.cjs} +1 -1
- package/dist/{vue-ui-timer-VmBMBL_O.js → vue-ui-timer-VWjovnKL.js} +4 -4
- package/dist/{vue-ui-tiremarks-CyvUhC9g.cjs → vue-ui-tiremarks-Cp8YEmXh.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-8YMG58Ot.js → vue-ui-tiremarks-jH6cdQOJ.js} +5 -5
- package/dist/{vue-ui-treemap-DlU_2b5A.js → vue-ui-treemap-BCc5sQLB.js} +9 -9
- package/dist/{vue-ui-treemap-83V4TBu2.cjs → vue-ui-treemap-DJrdEFW5.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-D8KpbB9m.js → vue-ui-vertical-bar-2In_g5iC.js} +364 -363
- package/dist/vue-ui-vertical-bar-BfJJqN_z.cjs +4 -0
- package/dist/{vue-ui-waffle-Dn1tci28.cjs → vue-ui-waffle-A2gmRbq0.cjs} +1 -1
- package/dist/{vue-ui-waffle-D5nczTQz.js → vue-ui-waffle-OzU830VX.js} +9 -9
- package/dist/{vue-ui-wheel-D0B43FnX.js → vue-ui-wheel-C9QXzWu1.js} +5 -5
- package/dist/{vue-ui-wheel-DWqZIkI0.cjs → vue-ui-wheel-DGSh9VKq.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DXEW7oYX.js → vue-ui-word-cloud-C2ZaVlfO.js} +7 -7
- package/dist/{vue-ui-word-cloud-BEebLRtX.cjs → vue-ui-word-cloud-DPFB1MYk.cjs} +1 -1
- package/dist/{vue-ui-xy-8508ou3J.cjs → vue-ui-xy-C-2-aijE.cjs} +2 -2
- package/dist/{vue-ui-xy-O3zBtp22.js → vue-ui-xy-DuJtYXKl.js} +16 -16
- package/dist/{vue-ui-xy-canvas-AMNGVzal.js → vue-ui-xy-canvas-CKibMJHh.js} +10 -10
- package/dist/{vue-ui-xy-canvas-CssfbLPK.cjs → vue-ui-xy-canvas-D7wf3xab.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-vertical-bar-DFlujd2F.cjs +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./useNestedProp-BvvH633N.cjs"),c=require("./index-D_32ZGWd.cjs"),T=require("./Title-D5cATWsL.cjs"),O=require("./usePrinter-BouFNHWR.cjs"),j=require("./vue-ui-skeleton-fVPw-oIR.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=["id"],H=["xmlns","viewBox"],D={key:0},X=["d","stroke-width","stroke"],R={key:1},Y=["x1","y1","x2","y2","stroke-width","stroke"],J=["x","y","font-size","fill","font-weight","text-anchor"],K={key:3,class:"vue-data-ui-watermark"},Q={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(A,{expose:q}){const v=A,{vue_ui_tiremarks:L}=c.useConfig(),x=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),$=e.ref(c.createUid()),w=e.ref(null),P=e.ref(0),t=e.computed(()=>{const a=E.useNestedProp({userConfig:v.config,defaultConfig:L});return a.theme?{...E.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}),{isPrinting:B,isImaging:z,generatePdf:S,generateImage:I}=O.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),n=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,a=>{t.value.style.chart.animation.use?F(a.percentage):n.value=a.percentage||0},{deep:!0}),e.onMounted(()=>{c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),F(v.dataset.percentage||0)});function F(a){let u=t.value.style.chart.animation.speed;const l=Math.abs(a-n.value)/(u*120);function r(){n.value<a?n.value=Math.min(n.value+l,a):n.value>a&&(n.value=Math.max(n.value-l,a)),n.value!==a&&requestAnimationFrame(r)}r()}const y=e.computed(()=>t.value.style.chart.layout.display==="vertical"),s=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return y.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),C=e.computed(()=>Object.values(s.value).reduce((a,u)=>a+u,0)),o=e.computed(()=>({height:y.value?312:56,width:y.value?56:312})),M=e.ref(100);e.computed(()=>v.dataset.percentage/M.value);const i=e.computed(()=>y.value?{mark:(o.value.height-C.value)/100*.5,space:(o.value.height-C.value)/100*.5}:{mark:(o.value.width-C.value)/100*.5,space:(o.value.width-C.value)/100*.5}),N=e.computed(()=>{const a=[];for(let l=0;l<100;l+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,l/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(y.value){const g=t.value.style.chart.layout.crescendo?(100-l)*(o.value.width-s.value.left-s.value.right)/100/3:0,d=s.value.left+4+g,h=o.value.width-s.value.right-4-g,m=o.value.height-s.value.bottom-l*i.value.mark-l*i.value.space-i.value.mark,p=o.value.height-s.value.bottom-l*i.value.mark-l*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+l)/100);a.push({x1:d,x2:h,y1:m,y2:p,curve:`M ${d} ${m} C ${d+k} ${m-b}, ${h-k} ${p-b}, ${h} ${p}`,color:r})}else{const g=t.value.style.chart.layout.crescendo?(100-l)*(o.value.height-s.value.top-s.value.bottom)/100/3:0,d=s.value.left+l*i.value.mark+l*i.value.space-i.value.mark,h=d,m=s.value.top+4+g,p=o.value.height-s.value.bottom-4-g,k=t.value.style.chart.layout.curveAngleY*((1+l)/100),b=(p-m)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:m,y2:p,curve:`M ${d} ${m} C ${d+k} ${m+b}, ${h+k} ${p-b}, ${h} ${p}`,color:r})}}return a}),f=e.computed(()=>{let a,u,l;const r=t.value.style.chart.percentage.fontSize/3;return y.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=o.value.width/2,u=s.value.top/2,l="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=o.value.width/2,u=o.value.height-s.value.bottom/2+r,l="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,u=o.value.height/2+r,l="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=o.value.width-s.value.right+8,u=o.value.height/2+r,l="start"),{x:a,y:u,textAnchor:l,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 G(a){_.value=a,P.value+=1}return q({generatePdf:S,generateImage:I}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:w,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:$.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(T._sfc_main,{config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(B),isImaging:e.unref(z),uid:$.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:w.value,onToggleFullscreen:G,onGeneratePdf:e.unref(S),onGenerateImage:e.unref(I)},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}: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:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{d:l.curve,"stroke-width":i.value.mark,stroke:n.value>=r?l.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<=n.value})},null,10,X))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,"stroke-width":i.value.mark,stroke:n.value>=r?l.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,Y))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:f.value.x,y:f.value.y,"font-size":f.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,n.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":f.value.bold?"bold":"normal","text-anchor":f.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,n.value,e.unref(c.dataLabel)({v:n.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,J)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,H)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(B)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j.default,{key:4,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,V))}},W=U._export_sfc(Q,[["__scopeId","data-v-4f20846e"]]);exports.default=W;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed as v, ref as k, watch as Z, onMounted as ee, openBlock as u, createElementBlock as c, normalizeClass as O, normalizeStyle as S, createVNode as te, createCommentVNode as b, createBlock as T, unref as h, createSlots as ae, withCtx as A, renderSlot as w, normalizeProps as X, guardReactiveProps as D, Fragment as H, renderList as R, toDisplayString as le } from "vue";
|
|
2
|
-
import { u as Y } from "./useNestedProp-
|
|
3
|
-
import { u as oe, c as se, t as re, s as ue, o as ne, e as ie, v as q, X as ce, i as ve, f as he } from "./index-
|
|
4
|
-
import { _ as de } from "./Title-
|
|
5
|
-
import { u as me, U as ye } from "./usePrinter-
|
|
6
|
-
import ge from "./vue-ui-skeleton-
|
|
2
|
+
import { u as Y } from "./useNestedProp-lS_T5lM3.js";
|
|
3
|
+
import { u as oe, c as se, t as re, s as ue, o as ne, e as ie, v as q, X as ce, i as ve, f as he } from "./index-C8SH0f2u.js";
|
|
4
|
+
import { _ as de } from "./Title-DZjnxQdN.js";
|
|
5
|
+
import { u as me, U as ye } from "./usePrinter-Dj50NAxo.js";
|
|
6
|
+
import ge from "./vue-ui-skeleton-B4eWLjH3.js";
|
|
7
7
|
import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const pe = ["id"], ke = ["xmlns", "viewBox"], be = { key: 0 }, _e = ["d", "stroke-width", "stroke"], Ce = { key: 1 }, $e = ["x1", "y1", "x2", "y2", "stroke-width", "stroke"], xe = ["x", "y", "font-size", "fill", "font-weight", "text-anchor"], we = {
|
|
9
9
|
key: 3,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as C, ref as y, onMounted as He, onBeforeUnmount as Ue, openBlock as m, createElementBlock as k, normalizeClass as xe, normalizeStyle as M, createVNode as re, createCommentVNode as V, createBlock as te, unref as b, createSlots as Ge, withCtx as T, renderSlot as _, normalizeProps as G, guardReactiveProps as X, Fragment as $e, renderList as Te, createElementVNode as O, toDisplayString as q, createTextVNode as _e, nextTick as Xe, pushScopeId as qe, popScopeId as je } from "vue";
|
|
2
|
-
import { u as Ye, c as Oe, t as Ze, a as Je, p as x, b as Ke, o as Qe, e as et, d as le, i as oe, f as Z, X as tt, l as Se, E as Ne, x as ze, y as lt, q as ot, r as at } from "./index-
|
|
3
|
-
import { _ as nt } from "./Title-
|
|
4
|
-
import { u as st, U as rt } from "./usePrinter-
|
|
5
|
-
import { _ as ut } from "./Tooltip
|
|
6
|
-
import { L as it } from "./Legend-
|
|
7
|
-
import ct from "./vue-ui-skeleton-
|
|
8
|
-
import { D as dt } from "./DataTable-
|
|
9
|
-
import vt from "./vue-ui-accordion-
|
|
2
|
+
import { u as Ye, c as Oe, t as Ze, a as Je, p as x, b as Ke, o as Qe, e as et, d as le, i as oe, f as Z, X as tt, l as Se, E as Ne, x as ze, y as lt, q as ot, r as at } from "./index-C8SH0f2u.js";
|
|
3
|
+
import { _ as nt } from "./Title-DZjnxQdN.js";
|
|
4
|
+
import { u as st, U as rt } from "./usePrinter-Dj50NAxo.js";
|
|
5
|
+
import { _ as ut } from "./Tooltip--kgFEVZs.js";
|
|
6
|
+
import { L as it } from "./Legend-Cj7T-DqJ.js";
|
|
7
|
+
import ct from "./vue-ui-skeleton-B4eWLjH3.js";
|
|
8
|
+
import { D as dt } from "./DataTable-CKdV-L0e.js";
|
|
9
|
+
import vt from "./vue-ui-accordion-YHleIgkV.js";
|
|
10
10
|
import { t as ht, u as ft } from "./useResponsive-NZB-WLRF.js";
|
|
11
|
-
import { u as Ie } from "./useNestedProp-
|
|
11
|
+
import { u as Ie } from "./useNestedProp-lS_T5lM3.js";
|
|
12
12
|
import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
function Pe(a, i) {
|
|
14
14
|
const s = a.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Cuc8JBQE.cjs"),ke=require("./Title-Du743m6e.cjs"),re=require("./usePrinter-BaExNQdD.cjs"),Ce=require("./Tooltip-B_WP5J9X.cjs"),we=require("./Legend-rxEBmJRW.cjs"),xe=require("./vue-ui-skeleton-DBlDHYe3.cjs"),Te=require("./DataTable-03mHwPdu.cjs"),$e=require("./vue-ui-accordion-CX_qmhfk.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-DZwVoxS3.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ie(n,d){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,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function ce(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Ne(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=ie(n,s),v=ie(u,s);return i>=v}}function Be(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function _e(n,d){const s={...d,children:n};return ve(s)}function ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function de(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,t={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,t);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,t={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,t);b=x,g.push(T)}return g}}function Pe(n){const d=U(n),s=d.width,u=d.height;return Math.min(s,u)}function Oe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function U(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ve(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=de(v,h);return f.concat(g)}const C=Pe(h),b=i[0],w=i.slice(1,p);if(Ne(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=Ee(h,m),x=de(v,h),t=f.concat(x);i=i,v=[],h=k,f=t}}}function ve(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Oe(n.children,ze(n)),s=Ve(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ve(s[h]));return Be(i)}}function Ee(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return ce(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return ce(p)}}const Le=n=>(e.pushScopeId("data-v-61b57d4b"),n=n(),e.popScopeId(),n),Re=["id"],Fe=["xmlns","viewBox"],Ie={key:0},De=["id"],qe=["stop-color"],Ae=["stop-color"],He=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Me=["x","y","height","width"],We={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ue=Le(()=>e.createElementVNode("br",null,null,-1)),Ge={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Xe={key:0},Ye={key:1},Ze=["innerHTML"],Je={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:i}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),t=e.computed(()=>{const l=se.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:T,isImaging:G,generatePdf:j,generateImage:X}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),B=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),_=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),P=e.computed(()=>({bottom:_.value.height-t.value.style.chart.padding.bottom,height:_.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:_.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:_.value.height,vbWidth:_.value.width,width:_.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Y(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Y(a.children))})}const O=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Y(O.value),t.value.responsive){const l=ue.throttle(()=>{const{width:a,height:o}=ue.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});_.value.width=a,_.value.height=o});D.value=new ResizeObserver(l),D.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const H=e.ref(O.value),R=e.computed(()=>H.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),E=e.computed(()=>O.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),Z=e.computed({get(){let l=[...R.value];return t.value.style.chart.layout.sorted&&(l=[...R.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function J(l,a){return l.value/a}function he(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-J(a,o);return r.lightenHexColor(l,c<0?0:c)}function K(l,a,o,c){return l.map((y,z)=>{const A=he(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,c),be=J(y,c);return{...y,color:A,proportion:be,parentName:o,children:y.children?K(y.children,A,y.name,c):void 0}})}const F=e.computed(()=>_e(Z.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?K(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:P.value.left*2,y0:P.value.top,x1:P.value.width,y1:P.value.height}));function Q({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ee({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function pe(l){b.value=l,w.value+=1}const L=e.computed(()=>({startX:0,startY:0,width:P.value.vbWidth,height:P.value.vbHeight})),$=e.ref(!1);function M(l,a=O.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=M(l,o.children);if(c)return c}}return null}function fe(l){if($.value)s("selectDatapoint",void 0),H.value=O.value;else{if(s("selectDatapoint",l),!M(l.parentId))return;H.value=[M(l.parentId)]}$.value=!$.value}const S=e.ref(null),te=e.computed(()=>O.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/O.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),ge=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 le(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",Z.value)}const W=e.ref(null);function me({datapoint:l,seriesIndex:a}){S.value=l,W.value={datapoint:l,seriesIndex:a,config:t.value,series:R.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:R.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:R.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,c+=`<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="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,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.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=F.value.map(o=>({name:o.name,color:o.color})),a=F.value.map(o=>o.value);return{head:l,body:a}});function oe(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/E.value)?"-":N.value.body[y]/E.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const A=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},A,isNaN(N.value.body[z]/E.value)?"-":r.dataLabel({v:N.value.body[z]/E.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={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:l,body:a,config:o}});function ye(){return F.value}function ae(){B.value.showTable=!B.value.showTable}function ne(){B.value.showTooltip=!B.value.showTooltip}return d({getData:ye,generateCsv:oe,generateImage:X,generatePdf:j,toggleTable:ae,toggleTooltip:ne}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[e.createVNode(ke._sfc_main,{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&&v.value?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(G),uid:f.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:B.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(j),onGenerateCsv:oe,onGenerateImage:e.unref(X),onToggleTable:ae,onToggleTooltip:ne},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${L.value.startX} ${L.value.startY} ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ie,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,De)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>fe(o),onMouseenter:()=>me({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,He),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:P.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(T)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:0,legendSet:te.value,config:ge.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>le(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>le(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(o.value/E.value)?"-":(o.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:B.value.showTooltip&&p.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:m.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock($e.default,{key:5,hideDetails:"",config:{open:B.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.createVNode(Te.DataTable,{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]=o=>B.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Re))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-61b57d4b"]]);exports.default=Ke;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-D_32ZGWd.cjs"),ke=require("./Title-D5cATWsL.cjs"),re=require("./usePrinter-BouFNHWR.cjs"),Ce=require("./Tooltip-B8yLaegk.cjs"),we=require("./Legend-Do2kcWFT.cjs"),xe=require("./vue-ui-skeleton-fVPw-oIR.cjs"),Te=require("./DataTable-BNFSPjhv.cjs"),$e=require("./vue-ui-accordion-Cka6b_Up.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),se=require("./useNestedProp-BvvH633N.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ie(n,d){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,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function ce(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Ne(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=ie(n,s),v=ie(u,s);return i>=v}}function Be(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function _e(n,d){const s={...d,children:n};return ve(s)}function ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function de(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,t={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,t);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,t={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,t);b=x,g.push(T)}return g}}function Pe(n){const d=U(n),s=d.width,u=d.height;return Math.min(s,u)}function Oe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function U(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ve(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=de(v,h);return f.concat(g)}const C=Pe(h),b=i[0],w=i.slice(1,p);if(Ne(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=Ee(h,m),x=de(v,h),t=f.concat(x);i=i,v=[],h=k,f=t}}}function ve(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Oe(n.children,ze(n)),s=Ve(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ve(s[h]));return Be(i)}}function Ee(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=U(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return ce(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return ce(p)}}const Le=n=>(e.pushScopeId("data-v-61b57d4b"),n=n(),e.popScopeId(),n),Re=["id"],Fe=["xmlns","viewBox"],Ie={key:0},De=["id"],qe=["stop-color"],Ae=["stop-color"],He=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Me=["x","y","height","width"],We={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ue=Le(()=>e.createElementVNode("br",null,null,-1)),Ge={key:3,class:"vue-data-ui-watermark"},je=["onClick"],Xe={key:0},Ye={key:1},Ze=["innerHTML"],Je={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:i}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),t=e.computed(()=>{const l=se.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...se.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:T,isImaging:G,generatePdf:j,generateImage:X}=re.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),B=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),_=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),P=e.computed(()=>({bottom:_.value.height-t.value.style.chart.padding.bottom,height:_.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:_.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:_.value.height,vbWidth:_.value.width,width:_.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Y(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Y(a.children))})}const O=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Y(O.value),t.value.responsive){const l=ue.throttle(()=>{const{width:a,height:o}=ue.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});_.value.width=a,_.value.height=o});D.value=new ResizeObserver(l),D.value.observe(m.value.parentNode)}}),e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const H=e.ref(O.value),R=e.computed(()=>H.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),E=e.computed(()=>O.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),Z=e.computed({get(){let l=[...R.value];return t.value.style.chart.layout.sorted&&(l=[...R.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function J(l,a){return l.value/a}function he(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-J(a,o);return r.lightenHexColor(l,c<0?0:c)}function K(l,a,o,c){return l.map((y,z)=>{const A=he(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,c),be=J(y,c);return{...y,color:A,proportion:be,parentName:o,children:y.children?K(y.children,A,y.name,c):void 0}})}const F=e.computed(()=>_e(Z.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?K(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:P.value.left*2,y0:P.value.top,x1:P.value.width,y1:P.value.height}));function Q({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ee({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function pe(l){b.value=l,w.value+=1}const L=e.computed(()=>({startX:0,startY:0,width:P.value.vbWidth,height:P.value.vbHeight})),$=e.ref(!1);function M(l,a=O.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=M(l,o.children);if(c)return c}}return null}function fe(l){if($.value)s("selectDatapoint",void 0),H.value=O.value;else{if(s("selectDatapoint",l),!M(l.parentId))return;H.value=[M(l.parentId)]}$.value=!$.value}const S=e.ref(null),te=e.computed(()=>O.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/O.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),ge=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 le(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",Z.value)}const W=e.ref(null);function me({datapoint:l,seriesIndex:a}){S.value=l,W.value={datapoint:l,seriesIndex:a,config:t.value,series:R.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:R.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:R.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,c+=`<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="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,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.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=F.value.map(o=>({name:o.name,color:o.color})),a=F.value.map(o=>o.value);return{head:l,body:a}});function oe(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/E.value)?"-":N.value.body[y]/E.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const A=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},A,isNaN(N.value.body[z]/E.value)?"-":r.dataLabel({v:N.value.body[z]/E.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={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:l,body:a,config:o}});function ye(){return F.value}function ae(){B.value.showTable=!B.value.showTable}function ne(){B.value.showTooltip=!B.value.showTooltip}return d({getData:ye,generateCsv:oe,generateImage:X,generatePdf:j,toggleTable:ae,toggleTooltip:ne}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[e.createVNode(ke._sfc_main,{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&&v.value?(e.openBlock(),e.createBlock(re.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(G),uid:f.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:B.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(j),onGenerateCsv:oe,onGenerateImage:e.unref(X),onToggleTable:ae,onToggleTooltip:ne},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${L.value.startX} ${L.value.startY} ${L.value.width<=0?10:L.value.width} ${L.value.height<=0?10:L.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ie,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ae)],8,De)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>fe(o),onMouseenter:()=>me({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,He),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:Q(o),width:ee(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",We,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ue,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Me))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:P.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Fe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(T)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:0,legendSet:te.value,config:ge.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>le(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>le(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(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.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",Ye," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(isNaN(o.value/E.value)?"-":(o.value/E.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,je)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:te.value},void 0,!0)],512),e.createVNode(Ce._sfc_main,{show:B.value.showTooltip&&p.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:m.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...W.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock($e.default,{key:5,hideDetails:"",config:{open:B.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.createVNode(Te.DataTable,{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]=o=>B.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Ze)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Re))}},Ke=Se._export_sfc(Je,[["__scopeId","data-v-61b57d4b"]]);exports.default=Ke;
|