vue-data-ui 2.4.40 → 2.4.41
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-DkayNE_-.js → Arrow-6z0ZQva_.js} +1 -1
- package/dist/{Arrow-Bg4pmMHf.cjs → Arrow-Cht76m69.cjs} +1 -1
- package/dist/{BaseIcon-zXh1vLYa.cjs → BaseIcon-D-JUZiGA.cjs} +1 -1
- package/dist/{BaseIcon-DpYqpYmv.js → BaseIcon-DCE3wRiG.js} +1 -1
- package/dist/{DataTable-BuiPd6c1.js → DataTable-B5DiCrf_.js} +2 -2
- package/dist/{DataTable-BB87HJ5b.cjs → DataTable-Cr3Xkxe4.cjs} +1 -1
- package/dist/{Legend-D2Yi-COI.cjs → Legend-BXG_XPom.cjs} +1 -1
- package/dist/{Legend-BRVDmlwW.js → Legend-DzxQIjDO.js} +1 -1
- package/dist/{PackageVersion-rf9gXZ-Q.cjs → PackageVersion-CMtZxTqq.cjs} +1 -1
- package/dist/{PackageVersion-BT4zkGPO.js → PackageVersion-S7OD_s5u.js} +1 -1
- package/dist/{PenAndPaper-BFq1cFfJ.js → PenAndPaper-BxJZd7k9.js} +3 -3
- package/dist/{PenAndPaper-DS7gA4X0.cjs → PenAndPaper-DWYhyZye.cjs} +1 -1
- package/dist/{Shape-Dwxh0EWa.js → Shape-C3ywBhkW.js} +1 -1
- package/dist/{Shape-DVggzfpA.cjs → Shape-CvL90fNe.cjs} +1 -1
- package/dist/{Slicer-BXHFpzP5.cjs → Slicer-B2aHb4bj.cjs} +1 -1
- package/dist/{Slicer-D7x1gyjP.js → Slicer-D9ASV60L.js} +2 -2
- package/dist/{Title-BFvWnqI4.js → Title-BB0O0yol.js} +1 -1
- package/dist/{Title-RB80eFiD.cjs → Title-D9gPXVTT.cjs} +1 -1
- package/dist/{Tooltip-RHI1EGzy.js → Tooltip-GvLaModr.js} +1 -1
- package/dist/{Tooltip-BC1YZMi2.cjs → Tooltip-ypQtmi99.cjs} +1 -1
- package/dist/index-B5Ugkauv.cjs +9 -0
- package/dist/{index-DY8hDTi7.js → index-B6Q1Fyk0.js} +12 -3
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +9 -0
- package/dist/types/vue-data-ui.d.ts +9 -0
- package/dist/{useNestedProp-lhL30X68.js → useNestedProp-DQpuJSz3.js} +1 -1
- package/dist/{useNestedProp-DLJc0s53.cjs → useNestedProp-bZitLnbb.cjs} +1 -1
- package/dist/{usePrinter-DjAQofRy.js → usePrinter-D8dIU7aG.js} +1 -1
- package/dist/{usePrinter-BfuqGrO4.cjs → usePrinter-DtpFEgOX.cjs} +1 -1
- package/dist/{vue-data-ui-DYb5l8_5.cjs → vue-data-ui-DBN7iJHU.cjs} +1 -1
- package/dist/{vue-data-ui-BjixO_L4.js → vue-data-ui-H24TWcBx.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-CkYhOmXF.js → vue-ui-3d-bar-BA2CQYGW.js} +9 -9
- package/dist/{vue-ui-3d-bar-BEjtuA39.cjs → vue-ui-3d-bar-BaNI_M3v.cjs} +1 -1
- package/dist/{vue-ui-accordion-xK9e3wkz.js → vue-ui-accordion-BOHicozd.js} +3 -3
- package/dist/{vue-ui-accordion-ClQObElI.cjs → vue-ui-accordion-u4xDSvRn.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-x5CjkABf.cjs → vue-ui-age-pyramid-DN25tjv-.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DtQAo1-2.js → vue-ui-age-pyramid-vKWko9vn.js} +10 -10
- package/dist/{vue-ui-annotator-DqDELeOR.cjs → vue-ui-annotator-BcxUQ5tM.cjs} +1 -1
- package/dist/{vue-ui-annotator-Yt34insl.js → vue-ui-annotator-D4KNucw5.js} +1 -1
- package/dist/{vue-ui-bullet-DSPQ5yWt.cjs → vue-ui-bullet-C3DKTZbg.cjs} +1 -1
- package/dist/{vue-ui-bullet-CCvwPwji.js → vue-ui-bullet-DZgtd_qb.js} +8 -8
- package/dist/{vue-ui-candlestick-CVJB9WMH.js → vue-ui-candlestick-C8yBMu8-.js} +11 -11
- package/dist/{vue-ui-candlestick-Cb7CgmeV.cjs → vue-ui-candlestick-DVEofXBZ.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-IqZRrbo_.js → vue-ui-carousel-table-Bpsrlbx9.js} +4 -4
- package/dist/{vue-ui-carousel-table-CkJngi1u.cjs → vue-ui-carousel-table-C62szGjt.cjs} +1 -1
- package/dist/{vue-ui-chestnut-Dt3GLx3U.js → vue-ui-chestnut-DhPSNM96.js} +8 -8
- package/dist/{vue-ui-chestnut-ojvaZyue.cjs → vue-ui-chestnut-VWwSZnUX.cjs} +1 -1
- package/dist/{vue-ui-cursor-D24bAdi0.js → vue-ui-cursor-BM2OiZnZ.js} +2 -2
- package/dist/{vue-ui-cursor-Cbi7OUiE.cjs → vue-ui-cursor-BwnZYB4D.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CB_W7yvi.js → vue-ui-dashboard-BcnW7vDs.js} +2 -2
- package/dist/{vue-ui-dashboard-DVf1sULB.cjs → vue-ui-dashboard-D8FU1GbE.cjs} +1 -1
- package/dist/{vue-ui-digits-CVAyG4kM.cjs → vue-ui-digits-BmQBwho3.cjs} +1 -1
- package/dist/{vue-ui-digits-Qn4l0R5o.js → vue-ui-digits-M4Pvrg0n.js} +2 -2
- package/dist/{vue-ui-donut-t688YqqL.js → vue-ui-donut-BgsQjURe.js} +11 -11
- package/dist/{vue-ui-donut-Cgvksx9U.cjs → vue-ui-donut-CZZfvbPk.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-KdVsB3m_.js → vue-ui-donut-evolution-BO2-ARBX.js} +11 -11
- package/dist/{vue-ui-donut-evolution-DWdf8MKP.cjs → vue-ui-donut-evolution-DP14ctdf.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DxMZm_Xi.cjs → vue-ui-dumbbell-CsMqgiGr.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CS5kvI8A.js → vue-ui-dumbbell-zv7yiPPM.js} +10 -10
- package/dist/{vue-ui-flow-4sSoYnJt.js → vue-ui-flow-BqtIWBkz.js} +9 -9
- package/dist/{vue-ui-flow-In-tHpYL.cjs → vue-ui-flow-E5MkZ3Yb.cjs} +1 -1
- package/dist/{vue-ui-funnel-MD4lrv0t.js → vue-ui-funnel-CmVLAttG.js} +8 -8
- package/dist/{vue-ui-funnel-MXYMVu1G.cjs → vue-ui-funnel-QU0_JscL.cjs} +1 -1
- package/dist/{vue-ui-galaxy-B9KiEfI4.cjs → vue-ui-galaxy-BPDH-9KW.cjs} +1 -1
- package/dist/{vue-ui-galaxy-K09M9SgI.js → vue-ui-galaxy-sy8zvgcg.js} +11 -11
- package/dist/{vue-ui-gauge-Bg2V5WNl.js → vue-ui-gauge--hARSvgz.js} +7 -7
- package/dist/{vue-ui-gauge-DaR_viLn.cjs → vue-ui-gauge-D_yokJMS.cjs} +1 -1
- package/dist/{vue-ui-gizmo-7Hv-0fsh.cjs → vue-ui-gizmo-AUJq3EQL.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CdLxfJUw.js → vue-ui-gizmo-CvTeq5j0.js} +3 -3
- package/dist/{vue-ui-heatmap-DhgJ3LO9.cjs → vue-ui-heatmap-D-xNLuqW.cjs} +1 -1
- package/dist/{vue-ui-heatmap-CNPjaHGJ.js → vue-ui-heatmap-lI8oO-nh.js} +10 -10
- package/dist/{vue-ui-history-plot-DZOYwPTh.cjs → vue-ui-history-plot-BC0Rvo-r.cjs} +1 -1
- package/dist/{vue-ui-history-plot-DRwX7quj.js → vue-ui-history-plot-D3CwJpll.js} +11 -11
- package/dist/{vue-ui-kpi-Cnrfv2vn.cjs → vue-ui-kpi-B4FQKZ_r.cjs} +1 -1
- package/dist/{vue-ui-kpi-C-5_TwY8.js → vue-ui-kpi-C0agq-Os.js} +3 -3
- package/dist/{vue-ui-mini-loader-uBFny7gt.cjs → vue-ui-mini-loader-BJ70GAEv.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-fZawewEF.js → vue-ui-mini-loader-CkjJ5pRO.js} +2 -2
- package/dist/{vue-ui-molecule-BOClRlY3.cjs → vue-ui-molecule-CsQfkIEE.cjs} +1 -1
- package/dist/{vue-ui-molecule-pO5l42Vf.js → vue-ui-molecule-V9UFJHeV.js} +11 -11
- package/dist/{vue-ui-mood-radar-CiMiQJuS.cjs → vue-ui-mood-radar-CdU2vusL.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-jbYjFZID.js → vue-ui-mood-radar-Cj_wOEbY.js} +11 -11
- package/dist/{vue-ui-nested-donuts-Bb5otIw_.js → vue-ui-nested-donuts-DFVQwbHg.js} +11 -11
- package/dist/{vue-ui-nested-donuts-IArnFfHY.cjs → vue-ui-nested-donuts-DevV-xZr.cjs} +1 -1
- package/dist/{vue-ui-onion-BvQLUPjh.js → vue-ui-onion-BJ-PjA7d.js} +11 -11
- package/dist/{vue-ui-onion-SKVqk7rN.cjs → vue-ui-onion-DGWktnME.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-_LH1iK_w.js → vue-ui-parallel-coordinate-plot-33naX1Ss.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-CeqeyIHj.cjs → vue-ui-parallel-coordinate-plot-CjxZbVNa.cjs} +1 -1
- package/dist/{vue-ui-quadrant-7jB46g4Z.cjs → vue-ui-quadrant-DqZqBb2L.cjs} +1 -1
- package/dist/{vue-ui-quadrant-BiWyF1fA.js → vue-ui-quadrant-xJaZzXgo.js} +12 -12
- package/dist/{vue-ui-quick-chart-C1398EYu.js → vue-ui-quick-chart-BwN9eLye.js} +9 -9
- package/dist/{vue-ui-quick-chart-79l8Uv8o.cjs → vue-ui-quick-chart-BzpXJYR_.cjs} +1 -1
- package/dist/{vue-ui-radar-BvWCcL2b.js → vue-ui-radar-B4EXwJDY.js} +12 -12
- package/dist/{vue-ui-radar-BYk3bLkt.cjs → vue-ui-radar-CQ66YUG5.cjs} +1 -1
- package/dist/{vue-ui-rating-jKjMQHRN.cjs → vue-ui-rating-D334I4ju.cjs} +1 -1
- package/dist/{vue-ui-rating-CyGmfYEU.js → vue-ui-rating-DNkygw1i.js} +2 -2
- package/dist/vue-ui-relation-circle-BKeSh28h.js +492 -0
- package/dist/vue-ui-relation-circle-CP2Z6IWV.cjs +1 -0
- package/dist/{vue-ui-rings-L8pGRQbs.cjs → vue-ui-rings-2oDSTctd.cjs} +1 -1
- package/dist/{vue-ui-rings-DEwuDHW2.js → vue-ui-rings-D6M3UNSE.js} +11 -11
- package/dist/{vue-ui-scatter-BfI6xftp.cjs → vue-ui-scatter-C9ZoWV1q.cjs} +1 -1
- package/dist/{vue-ui-scatter-BYL4iitb.js → vue-ui-scatter-JUPbbsO7.js} +12 -12
- package/dist/{vue-ui-screenshot-D4aNIcHd.js → vue-ui-screenshot-DmLDHfF9.js} +1 -1
- package/dist/{vue-ui-screenshot-Cf8g-RjG.cjs → vue-ui-screenshot-JMBX_AWn.cjs} +1 -1
- package/dist/{vue-ui-skeleton-FCpm0_eE.js → vue-ui-skeleton-D7rg5vFC.js} +3 -3
- package/dist/{vue-ui-skeleton-BGfzzQdU.cjs → vue-ui-skeleton-E9_X0-sa.cjs} +1 -1
- package/dist/{vue-ui-smiley-BFXulKpd.js → vue-ui-smiley-BAlHZm8H.js} +2 -2
- package/dist/{vue-ui-smiley-mjxS_13E.cjs → vue-ui-smiley-aRTznf8z.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-B2SOk378.cjs → vue-ui-spark-trend-DZR6Fqu5.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-D-13-kV6.js → vue-ui-spark-trend-J9swikF_.js} +5 -5
- package/dist/{vue-ui-sparkbar-C8cjDKBy.js → vue-ui-sparkbar-B0tCpwZ9.js} +4 -4
- package/dist/{vue-ui-sparkbar-BlA1rgRo.cjs → vue-ui-sparkbar-Bjmi8pMf.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DRBVe3tu.js → vue-ui-sparkgauge-DVX2pIC3.js} +4 -4
- package/dist/{vue-ui-sparkgauge-C4sFc7nb.cjs → vue-ui-sparkgauge-Dhzbkn67.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-iMRsSDvC.js → vue-ui-sparkhistogram-Wd6q0mqj.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-CkqzLBYq.cjs → vue-ui-sparkhistogram-gIaXDrFh.cjs} +1 -1
- package/dist/{vue-ui-sparkline-C0JZ7Xq1.cjs → vue-ui-sparkline-B5ySeM9y.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DIkUaObR.js → vue-ui-sparkline-DYT-gts9.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-DJW1lBGU.js → vue-ui-sparkstackbar-BMGA05VR.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-DJbWCqs3.cjs → vue-ui-sparkstackbar-ilvB3RBv.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BtOrW2Ml.cjs → vue-ui-stackbar-BZKwsAjO.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BGUXEdZi.js → vue-ui-stackbar-BZbOagnf.js} +12 -12
- package/dist/{vue-ui-strip-plot-hn1U9cvT.js → vue-ui-strip-plot-B-r4luYX.js} +11 -11
- package/dist/{vue-ui-strip-plot-DJTQ8r5H.cjs → vue-ui-strip-plot-DPo7osh_.cjs} +1 -1
- package/dist/{vue-ui-table-DFvOQzJu.cjs → vue-ui-table-C6z56ODT.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-ZnkAoAkQ.cjs → vue-ui-table-heatmap-B05GifSw.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DqZsXcsO.js → vue-ui-table-heatmap-CM-c7n0F.js} +4 -4
- package/dist/{vue-ui-table-sparkline-CV8o-yV6.js → vue-ui-table-sparkline-DHaEHFG_.js} +5 -5
- package/dist/{vue-ui-table-sparkline-5mX0B27t.cjs → vue-ui-table-sparkline-Dx-ePVqW.cjs} +1 -1
- package/dist/{vue-ui-table-7A1eCPQd.js → vue-ui-table-wlXHwJVW.js} +1 -1
- package/dist/{vue-ui-thermometer-M6QwKOld.js → vue-ui-thermometer-BU_ckSdu.js} +7 -7
- package/dist/{vue-ui-thermometer-BwLTfi7y.cjs → vue-ui-thermometer-HCpOZBHv.cjs} +1 -1
- package/dist/{vue-ui-timer-QypGImgW.cjs → vue-ui-timer-CUChwyzF.cjs} +1 -1
- package/dist/{vue-ui-timer-CoYF7LEU.js → vue-ui-timer-DiRZ849L.js} +5 -5
- package/dist/{vue-ui-tiremarks-CzLOyhXF.js → vue-ui-tiremarks-BHMNb_tq.js} +7 -7
- package/dist/{vue-ui-tiremarks-DAFNYvB1.cjs → vue-ui-tiremarks-yoQtfbj7.cjs} +1 -1
- package/dist/{vue-ui-treemap-CutiBRIN.cjs → vue-ui-treemap-BInwLSes.cjs} +1 -1
- package/dist/{vue-ui-treemap-DF5BIKs-.js → vue-ui-treemap-BpD6OdL3.js} +11 -11
- package/dist/{vue-ui-vertical-bar-bDcCcUy8.js → vue-ui-vertical-bar-CBNWMmCg.js} +11 -11
- package/dist/{vue-ui-vertical-bar-D-ZZAU0r.cjs → vue-ui-vertical-bar-hS4gzdKs.cjs} +1 -1
- package/dist/{vue-ui-waffle-BR_HwmLy.js → vue-ui-waffle-BE8iTrGF.js} +11 -11
- package/dist/{vue-ui-waffle-CCO3ZHyo.cjs → vue-ui-waffle-Cmq6zhD8.cjs} +1 -1
- package/dist/{vue-ui-wheel-Cvcfc6o1.cjs → vue-ui-wheel-BT0mLxln.cjs} +1 -1
- package/dist/{vue-ui-wheel-DuO0nc0d.js → vue-ui-wheel-BXSIBRLM.js} +7 -7
- package/dist/{vue-ui-word-cloud-Cv5bXF2B.js → vue-ui-word-cloud-3wvSYRbp.js} +10 -10
- package/dist/{vue-ui-word-cloud-BknJQRiM.cjs → vue-ui-word-cloud-BXHlm41O.cjs} +1 -1
- package/dist/{vue-ui-xy-Cqb73yZ3.cjs → vue-ui-xy-CfduqTWA.cjs} +1 -1
- package/dist/{vue-ui-xy-Clf_sTRI.js → vue-ui-xy-D8XvOgW6.js} +14 -14
- package/dist/{vue-ui-xy-canvas-7OwcP1-L.cjs → vue-ui-xy-canvas-BTR-cL02.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-BOJGw4H7.js → vue-ui-xy-canvas-Cx7vPyfT.js} +11 -11
- package/package.json +1 -1
- package/dist/index--lHmCKjC.cjs +0 -9
- package/dist/vue-ui-relation-circle-B3Df8yCi.js +0 -366
- package/dist/vue-ui-relation-circle-CZomraV2.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index--lHmCKjC.cjs"),re=require("./Legend-D2Yi-COI.cjs"),ne=require("./Title-RB80eFiD.cjs"),se=require("./Tooltip-BC1YZMi2.cjs"),ue=require("./DataTable-BB87HJ5b.cjs"),U=require("./usePrinter-BfuqGrO4.cjs"),ie=require("./vue-ui-skeleton-BGfzzQdU.cjs"),ce=require("./vue-ui-accordion-ClQObElI.cjs"),H=require("./useNestedProp-DLJc0s53.cjs"),de=require("./PackageVersion-rf9gXZ-Q.cjs"),ve=require("./PenAndPaper-DS7gA4X0.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),he=["id"],fe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ye={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},ge=["xmlns","viewBox"],me=["id"],be=["stdDeviation"],ke=["d","stroke","stroke-width"],Ce=["d","stroke","stroke-width"],we=["filter"],xe=["d","stroke","stroke-width"],$e=["d","stroke-width","onMouseenter","onClick"],Be={key:5,class:"vue-data-ui-watermark"},Ne=["onClick"],Te={key:0},_e={key:1},Se={key:8,ref:"source",dir:"auto"},Pe=["innerHTML"],Ve={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(X,{expose:j,emit:S}){const i=X,{vue_ui_galaxy:Y}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const y=e.ref(r.createUid()),k=e.ref(null),J=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),V=e.ref(0),E=e.ref(0),L=e.ref(0),O=e.ref(0),t=e.computed({get:()=>A(),set:l=>l});function A(){const l=H.useNestedProp({userConfig:i.config,defaultConfig:Y});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=A(),P(),E.value+=1,L.value+=1,O.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:z,generateImage:D}=U.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),S("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Q.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function Z(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),ee=e.ref(190),q=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<q.value.length;a+=1){const o=q.value[a];let n=o.value/d.value*ee.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function te(l){m.value=l,V.value+=1}const T=e.ref(null);function le({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},x.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?$.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<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>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),$.value=`<div>${s}</div>`)}const G=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),oe=e.computed(()=>({cy:"galaxy-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":""})),p=e.computed(()=>{const l=g.value.map(o=>({name:o.name,color:o.color})),a=g.value.map(o=>o.value);return{head:l,body:a}});function M(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.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-galaxy"})})}const C=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const ae=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},ae,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.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,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function W(){v.value.showTable=!v.value.showTable}function R(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function _(){w.value=!w.value}return j({getData:Z,generatePdf:z,generateCsv:M,generateImage:D,toggleTable:W,toggleTooltip:R,toggleAnnotator:_}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:k,class:e.normalizeClass(`vue-ui-galaxy ${m.value?"vue-data-ui-wrapper-fullscreen":""} ${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:`galaxy_${y.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",fe,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(I),uid:y.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,isTooltip:v.value.showTooltip,isFullscreen:m.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:te,onGeneratePdf:e.unref(z),onGenerateCsv:M,onGenerateImage:e.unref(D),onToggleTable:W,onToggleTooltip:R,onToggleAnnotator:_},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:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value}),viewBox:`0 0 ${B.value.width} ${B.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(de._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${y.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,be)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Ce)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${y.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,xe)],8,we)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>le({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>S("selectDatapoint",o)},null,40,$e)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:B.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(re.Legend,{key:`legend_${O.value}`,legendSet:G.value,config:oe.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",_e," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Te," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ne)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:G.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(se._sfc_main,{show:v.value.showTooltip&&x.value,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:k.value,content:$.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({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(ce.default,{key:9,hideDetails:"",config:{open:v.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(ue.DataTable,{key:`table_${L.value}`,colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.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=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Pe)]),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,he))}},Ee=pe._export_sfc(Ve,[["__scopeId","data-v-9e3163ed"]]);exports.default=Ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-B5Ugkauv.cjs"),re=require("./Legend-BXG_XPom.cjs"),ne=require("./Title-D9gPXVTT.cjs"),se=require("./Tooltip-ypQtmi99.cjs"),ue=require("./DataTable-Cr3Xkxe4.cjs"),U=require("./usePrinter-DtpFEgOX.cjs"),ie=require("./vue-ui-skeleton-E9_X0-sa.cjs"),ce=require("./vue-ui-accordion-u4xDSvRn.cjs"),H=require("./useNestedProp-bZitLnbb.cjs"),de=require("./PackageVersion-CMtZxTqq.cjs"),ve=require("./PenAndPaper-DWYhyZye.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),he=["id"],fe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ye={key:2,style:"width:100%;background:transparent;padding-bottom:24px"},ge=["xmlns","viewBox"],me=["id"],be=["stdDeviation"],ke=["d","stroke","stroke-width"],Ce=["d","stroke","stroke-width"],we=["filter"],xe=["d","stroke","stroke-width"],$e=["d","stroke-width","onMouseenter","onClick"],Be={key:5,class:"vue-data-ui-watermark"},Ne=["onClick"],Te={key:0},_e={key:1},Se={key:8,ref:"source",dir:"auto"},Pe=["innerHTML"],Ve={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(X,{expose:j,emit:S}){const i=X,{vue_ui_galaxy:Y}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})}const y=e.ref(r.createUid()),k=e.ref(null),J=e.ref(null),x=e.ref(!1),$=e.ref(""),c=e.ref(null),V=e.ref(0),E=e.ref(0),L=e.ref(0),O=e.ref(0),t=e.computed({get:()=>A(),set:l=>l});function A(){const l=H.useNestedProp({userConfig:i.config,defaultConfig:Y});return l.theme?{...H.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=A(),P(),E.value+=1,L.value+=1,O.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:z,generateImage:D}=U.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),B=e.ref({height:180,width:250}),u=e.ref([]);function N(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),S("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const h=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Q.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function Z(){return h.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),ee=e.ref(190),q=e.computed(()=>h.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<q.value.length;a+=1){const o=q.value[a];let n=o.value/d.value*ee.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function te(l){m.value=l,V.value+=1}const T=e.ref(null);function le({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){T.value={datapoint:l,seriesIndex:o,series:h.value,config:t.value},x.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}))?$.value=f({seriesIndex:o,datapoint:l,series:h.value,config:t.value}):(s+=`<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>`,s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),$.value=`<div>${s}</div>`)}const G=e.computed(()=>h.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>N(l),isSegregated:u.value.includes(l.id)}))),oe=e.computed(()=>({cy:"galaxy-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":""})),p=e.computed(()=>{const l=g.value.map(o=>({name:o.name,color:o.color})),a=g.value.map(o=>o.value);return{head:l,body:a}});function M(){e.nextTick(()=>{const l=p.value.head.map((n,s)=>[[n.name],[p.value.body[s]],[isNaN(p.value.body[s]/d.value)?"-":p.value.body[s]/d.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-galaxy"})})}const C=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=p.value.head.map((s,f)=>{const ae=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},ae,isNaN(p.value.body[f]/d.value)?"-":r.dataLabel({v:p.value.body[f]/d.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,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function W(){v.value.showTable=!v.value.showTable}function R(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function _(){w.value=!w.value}return j({getData:Z,generatePdf:z,generateCsv:M,generateImage:D,toggleTable:W,toggleTooltip:R,toggleAnnotator:_}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:k,class:e.normalizeClass(`vue-ui-galaxy ${m.value?"vue-data-ui-wrapper-fullscreen":""} ${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:`galaxy_${y.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",fe,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(ne._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(I),uid:y.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,isTooltip:v.value.showTooltip,isFullscreen:m.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:te,onGeneratePdf:e.unref(z),onGenerateCsv:M,onGenerateImage:e.unref(D),onToggleTable:W,onToggleTooltip:R,onToggleAnnotator:_},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:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value}),viewBox:`0 0 ${B.value.width} ${B.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(de._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${y.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,be)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,Ce)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${y.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(c.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,xe)],8,we)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:s=>le({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,c.value=null}),onClick:s=>S("selectDatapoint",o)},null,40,$e)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:B.value},void 0,!0)],14,ge)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:6,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(re.Legend,{key:`legend_${O.value}`,legendSet:G.value,config:oe.value,onClickMarker:a[1]||(a[1]=({legend:o})=>N(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>N(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",_e," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Te," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ne)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:G.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(se._sfc_main,{show:v.value.showTooltip&&x.value,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:k.value,content:$.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({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(ce.default,{key:9,hideDetails:"",config:{open:v.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(ue.DataTable,{key:`table_${L.value}`,colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.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=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Pe)]),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,he))}},Ee=pe._export_sfc(Ve,[["__scopeId","data-v-9e3163ed"]]);exports.default=Ee;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as d, onMounted as Se, ref as u, watch as Ne, openBlock as o, createElementBlock as n, normalizeClass as F, normalizeStyle as H, createBlock as $, createCommentVNode as i, unref as p, createSlots as Le, withCtx as c, renderSlot as v, normalizeProps as S, guardReactiveProps as N, createVNode as re, createElementVNode as x, Fragment as ue, renderList as ne, createTextVNode as ie, toDisplayString as E, nextTick as Oe } from "vue";
|
|
2
|
-
import { u as Ie, o as Ae, e as ce, g as Fe, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, I as de, L as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-
|
|
3
|
-
import { L as Ue } from "./Legend-
|
|
4
|
-
import { _ as Xe } from "./Title-
|
|
5
|
-
import { _ as Re } from "./Tooltip-
|
|
6
|
-
import { D as Ye } from "./DataTable-
|
|
7
|
-
import { u as je, U as qe } from "./usePrinter-
|
|
8
|
-
import Je from "./vue-ui-skeleton-
|
|
9
|
-
import Ke from "./vue-ui-accordion-
|
|
10
|
-
import { u as ye } from "./useNestedProp-
|
|
11
|
-
import { _ as Qe } from "./PackageVersion-
|
|
12
|
-
import { P as Ze } from "./PenAndPaper-
|
|
2
|
+
import { u as Ie, o as Ae, e as ce, g as Fe, c as ve, t as Ee, a as De, p as D, b as Ve, d as Be, I as de, L as Ge, f as k, X as Me, i as he, x as pe, y as ze, q as We, r as He } from "./index-B6Q1Fyk0.js";
|
|
3
|
+
import { L as Ue } from "./Legend-DzxQIjDO.js";
|
|
4
|
+
import { _ as Xe } from "./Title-BB0O0yol.js";
|
|
5
|
+
import { _ as Re } from "./Tooltip-GvLaModr.js";
|
|
6
|
+
import { D as Ye } from "./DataTable-B5DiCrf_.js";
|
|
7
|
+
import { u as je, U as qe } from "./usePrinter-D8dIU7aG.js";
|
|
8
|
+
import Je from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
9
|
+
import Ke from "./vue-ui-accordion-BOHicozd.js";
|
|
10
|
+
import { u as ye } from "./useNestedProp-DQpuJSz3.js";
|
|
11
|
+
import { _ as Qe } from "./PackageVersion-S7OD_s5u.js";
|
|
12
|
+
import { P as Ze } from "./PenAndPaper-BxJZd7k9.js";
|
|
13
13
|
import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const tt = ["id"], lt = {
|
|
15
15
|
key: 1,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed as p, ref as v, watch as se, onMounted as ze, onBeforeUnmount as Ce, openBlock as r, createElementBlock as s, normalizeClass as ue, normalizeStyle as ne, createBlock as N, createCommentVNode as d, withCtx as C, toDisplayString as $, unref as n, createSlots as $e, renderSlot as m, normalizeProps as E, guardReactiveProps as T, createVNode as Me, createElementVNode as g, Fragment as j, renderList as D } from "vue";
|
|
2
|
-
import { u as Pe, c as Oe, t as Ie, a as Ne, p as ie, b as Xe, o as ce, d as Ae, e as X, g as ve, m as de, X as Ye, s as U, H as A, i as B, f as L, E as he } from "./index-
|
|
2
|
+
import { u as Pe, c as Oe, t as Ie, a as Ne, p as ie, b as Xe, o as ce, d as Ae, e as X, g as ve, m as de, X as Ye, s as U, H as A, i as B, f as L, E as he } from "./index-B6Q1Fyk0.js";
|
|
3
3
|
import { t as Ge, u as Re } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { u as Ee, U as Te } from "./usePrinter-
|
|
5
|
-
import je from "./vue-ui-skeleton-
|
|
6
|
-
import { _ as De } from "./Title-
|
|
7
|
-
import { u as fe } from "./useNestedProp-
|
|
8
|
-
import { _ as Ue } from "./PackageVersion-
|
|
9
|
-
import { P as Be } from "./PenAndPaper-
|
|
4
|
+
import { u as Ee, U as Te } from "./usePrinter-D8dIU7aG.js";
|
|
5
|
+
import je from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
6
|
+
import { _ as De } from "./Title-BB0O0yol.js";
|
|
7
|
+
import { u as fe } from "./useNestedProp-DQpuJSz3.js";
|
|
8
|
+
import { _ as Ue } from "./PackageVersion-S7OD_s5u.js";
|
|
9
|
+
import { P as Be } from "./PenAndPaper-BxJZd7k9.js";
|
|
10
10
|
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const We = ["id"], Ve = { key: 0 }, qe = ["xmlns", "viewBox"], He = ["id"], Ze = ["stop-color"], Je = ["stop-color"], Ke = ["stop-color"], Qe = ["id"], et = ["stdDeviation"], tt = ["d", "fill", "stroke"], at = ["d", "filter"], lt = { key: 1 }, ot = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], rt = ["x", "y", "font-size", "font-weight", "fill"], st = { key: 3 }, ut = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], nt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], it = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], ct = { key: 4 }, vt = ["d", "fill", "stroke", "stroke-width"], dt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], ht = ["x", "y", "font-size", "fill"], ft = {
|
|
12
12
|
key: 5,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index--lHmCKjC.cjs"),G=require("./useResponsive-BJ7DTGpm.cjs"),L=require("./usePrinter-BfuqGrO4.cjs"),ae=require("./vue-ui-skeleton-BGfzzQdU.cjs"),le=require("./Title-RB80eFiD.cjs"),q=require("./useNestedProp-DLJc0s53.cjs"),oe=require("./PackageVersion-rf9gXZ-Q.cjs"),re=require("./PenAndPaper-DS7gA4X0.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),se=["id"],ue={key:0},ie=["xmlns","viewBox"],ce=["id"],de=["stop-color"],ve=["stop-color"],he=["stop-color"],fe=["id"],pe=["stdDeviation"],me=["d","fill","stroke"],ye=["d","filter"],ke={key:1},ge=["x","y","text-anchor","font-size","font-weight","fill"],be=["x","y","font-size","font-weight","fill"],_e={key:3},xe=["x1","y1","x2","y2","stroke","stroke-width"],we=["x1","y1","x2","y2","stroke","stroke-width"],Ce=["x1","y1","x2","y2","stroke-width","filter"],Se={key:4},Be=["d","fill","stroke","stroke-width"],Fe=["cx","cy","fill","r","stroke-width","stroke"],Ne=["x","y","font-size","fill"],ze={key:5,class:"vue-data-ui-watermark"},Pe={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(S,{expose:T}){const s=S,{vue_ui_gauge:j}=r.useConfig(),_=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length>0&&s.dataset.series&&s.dataset.series.length),h=e.ref(r.createUid()),U=e.ref(null),N=e.ref(0),y=e.ref(null),z=e.ref(null),P=e.ref(null),E=e.ref(null),$=e.ref(null),M=e.ref(0),t=e.computed({get:()=>O(),set:l=>l});e.watch(()=>s.config,l=>{t.value=O(),D(),M.value+=1},{deep:!0});function O(){const l=q.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...q.useNestedProp({userConfig:r.themes.vue_ui_gauge[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}const{isPrinting:V,isImaging:I,generatePdf:A,generateImage:X}=L.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),W=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),H=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!_.value||r.objectIsEmpty(s.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const l=[];(s.dataset.series||[]).forEach(o=>{l.push(o.from||0),l.push(o.to||0)});const n=Math.max(...l);return{...s.dataset,series:(s.dataset.series||[]).map((o,u)=>({...o,color:r.convertColorToHex(o.color)||H.value[u]||r.palette[u],value:((o.to||0)-(o.from||0))/n*100}))}}),v=e.ref(512),a=e.ref({height:358.4,width:v.value,top:0,bottom:358.4,centerX:179.2,centerY:v.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),k=e.ref(0),g=e.ref(0),c=e.ref(t.value.style.chart.animation.use?0:s.dataset.value);e.watch(()=>s.dataset.value,()=>{R(s.dataset.value)});const d=e.computed(()=>{const l=a.value.width/2,n=i.value.base,o=Math.PI*((c.value+0-g.value)/(k.value-g.value))+Math.PI;return{x1:l,y1:n,x2:l+i.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),y2:n+i.value.pointerSize*a.value.pointerSize*.9*Math.sin(o)}}),Y=e.computed(()=>{const l=a.value.width/2,n=i.value.base,o=Math.PI*((c.value+0-g.value)/(k.value-g.value))+Math.PI,u=l+i.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),C=n+i.value.pointerSize*a.value.pointerSize*.9*Math.sin(o),f=a.value.pointerRadius,K=l+f*Math.cos(o+Math.PI/2),Q=n+f*Math.sin(o+Math.PI/2),ee=l+f*Math.cos(o-Math.PI/2),te=n+f*Math.sin(o-Math.PI/2);return isNaN(u)?null:`M ${u},${C} ${K},${Q} ${ee},${te} Z`}),B=e.computed(()=>{for(let l=0;l<p.value.series.length;l+=1){const{color:n,from:o,to:u}=p.value.series[l];if(c.value>=o&&c.value<=u)return n}return"#2D353C"}),x=e.ref(null);function D(){if(r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiGauge",type:"dataset"}):(r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","series"]}).forEach(l=>{r.error({componentName:"VueUiGauge",type:"datasetAttribute",property:l})}),Object.hasOwn(s.dataset,"series")&&(s.dataset.series.length?s.dataset.series.forEach((l,n)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["from","to"]}).forEach(o=>{r.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:o,index:n})})}):r.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),R(s.dataset.value||0),t.value.responsive){const l=G.throttle(()=>{const{width:n,height:o}=G.useResponsive({chart:y.value,title:t.value.style.chart.title.text?z.value:null,legend:P.value,source:E.value,noTitle:$.value});a.value.width=n,a.value.height=o,a.value.centerX=n/2,a.value.centerY=v.value/2/358.4*o,a.value.bottom=o,a.value.labelFontSize=18/v.value*Math.min(o,n)<10?10:18/v.value*Math.min(o,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/v.value*Math.min(o,n)<14?14:t.value.style.chart.legend.fontSize/v.value*Math.min(o,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/v.value*Math.min(o,n),a.value.trackSize=t.value.style.chart.layout.track.size/v.value*Math.min(o,n),a.value.pointerStrokeWidth=r.translateSize({relator:Math.min(n,o),adjuster:v.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=r.translateSize({relator:Math.max(n,o),adjuster:v.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});x.value=new ResizeObserver(l),x.value.observe(y.value.parentNode)}}e.onMounted(()=>{D()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function R(l){const n=[];(p.value.series||[]).forEach(f=>{n.push(f.from||0),n.push(f.to||0)}),k.value=Math.max(...n),g.value=Math.min(...n);let o=t.value.style.chart.animation.speed;const u=Math.abs(l-c.value)/(o*60);function C(){c.value<l?c.value=Math.min(c.value+u,l):c.value>l&&(c.value=Math.max(c.value-u,l)),c.value!==l&&requestAnimationFrame(C)}C()}const i=e.computed(()=>{const l=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:l/2.5,gradients:l/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),m=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,i.value.base,i.value.arcs,i.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),Z=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,i.value.base,i.value.gradients,i.value.gradients,.95,1,1,180,110.02,2*a.value.trackSize)),b=e.ref(!1);function J(l){b.value=l,N.value+=1}const w=e.ref(!1);function F(){w.value=!w.value}return T({generatePdf:A,generateImage:X,toggleAnnotator:F}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:y,id:`vue-ui-gauge_${h.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%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:F},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),W.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:$,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:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(le._sfc_main,{key:`title_${M.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&S.dataset.base?(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(S.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&_.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref_key:"details",ref:U,key:`user_options_${N.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(V),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:J,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(X),onToggleAnnotator:F},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),_.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}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(oe._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,de),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(r.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,he)],8,ce)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,pe)],8,fe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,u)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${u}`,d:o.arcSlice,fill:o.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,me))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Z.value,(o,u)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${u}`,d:o.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,ye))),128)):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("g",ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,u)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).y,"text-anchor":o.center.startX<a.value.width/2-5?"end":o.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.markers.formatter,o.from,e.unref(r.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:o.from,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,ge))),256))])):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.markers.formatter,k.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:k.value,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,be)):e.createCommentVNode("",!0),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",_e,[isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,xe)),isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?B.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,we)),!isNaN(d.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,Ce)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",Se,[Y.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:Y.value,fill:t.value.style.chart.layout.pointer.useRatingColor?B.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,Be)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:i.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,Fe),t.value.style.chart.legend.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:a.value.width/2,y:i.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?B.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.legend.formatter,c.value,e.unref(r.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&c.value>0?"+":""),v:c.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,Ne)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,ie)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(V)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ae.default,{key:6,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:P},[e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],14,se))}},Ee=ne._export_sfc(Pe,[["__scopeId","data-v-31427f30"]]);exports.default=Ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-B5Ugkauv.cjs"),G=require("./useResponsive-BJ7DTGpm.cjs"),L=require("./usePrinter-DtpFEgOX.cjs"),ae=require("./vue-ui-skeleton-E9_X0-sa.cjs"),le=require("./Title-D9gPXVTT.cjs"),q=require("./useNestedProp-bZitLnbb.cjs"),oe=require("./PackageVersion-CMtZxTqq.cjs"),re=require("./PenAndPaper-DWYhyZye.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),se=["id"],ue={key:0},ie=["xmlns","viewBox"],ce=["id"],de=["stop-color"],ve=["stop-color"],he=["stop-color"],fe=["id"],pe=["stdDeviation"],me=["d","fill","stroke"],ye=["d","filter"],ke={key:1},ge=["x","y","text-anchor","font-size","font-weight","fill"],be=["x","y","font-size","font-weight","fill"],_e={key:3},xe=["x1","y1","x2","y2","stroke","stroke-width"],we=["x1","y1","x2","y2","stroke","stroke-width"],Ce=["x1","y1","x2","y2","stroke-width","filter"],Se={key:4},Be=["d","fill","stroke","stroke-width"],Fe=["cx","cy","fill","r","stroke-width","stroke"],Ne=["x","y","font-size","fill"],ze={key:5,class:"vue-data-ui-watermark"},Pe={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(S,{expose:T}){const s=S,{vue_ui_gauge:j}=r.useConfig(),_=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length>0&&s.dataset.series&&s.dataset.series.length),h=e.ref(r.createUid()),U=e.ref(null),N=e.ref(0),y=e.ref(null),z=e.ref(null),P=e.ref(null),E=e.ref(null),$=e.ref(null),M=e.ref(0),t=e.computed({get:()=>O(),set:l=>l});e.watch(()=>s.config,l=>{t.value=O(),D(),M.value+=1},{deep:!0});function O(){const l=q.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...q.useNestedProp({userConfig:r.themes.vue_ui_gauge[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}const{isPrinting:V,isImaging:I,generatePdf:A,generateImage:X}=L.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),W=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),H=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!_.value||r.objectIsEmpty(s.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const l=[];(s.dataset.series||[]).forEach(o=>{l.push(o.from||0),l.push(o.to||0)});const n=Math.max(...l);return{...s.dataset,series:(s.dataset.series||[]).map((o,u)=>({...o,color:r.convertColorToHex(o.color)||H.value[u]||r.palette[u],value:((o.to||0)-(o.from||0))/n*100}))}}),v=e.ref(512),a=e.ref({height:358.4,width:v.value,top:0,bottom:358.4,centerX:179.2,centerY:v.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),k=e.ref(0),g=e.ref(0),c=e.ref(t.value.style.chart.animation.use?0:s.dataset.value);e.watch(()=>s.dataset.value,()=>{R(s.dataset.value)});const d=e.computed(()=>{const l=a.value.width/2,n=i.value.base,o=Math.PI*((c.value+0-g.value)/(k.value-g.value))+Math.PI;return{x1:l,y1:n,x2:l+i.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),y2:n+i.value.pointerSize*a.value.pointerSize*.9*Math.sin(o)}}),Y=e.computed(()=>{const l=a.value.width/2,n=i.value.base,o=Math.PI*((c.value+0-g.value)/(k.value-g.value))+Math.PI,u=l+i.value.pointerSize*a.value.pointerSize*.9*Math.cos(o),C=n+i.value.pointerSize*a.value.pointerSize*.9*Math.sin(o),f=a.value.pointerRadius,K=l+f*Math.cos(o+Math.PI/2),Q=n+f*Math.sin(o+Math.PI/2),ee=l+f*Math.cos(o-Math.PI/2),te=n+f*Math.sin(o-Math.PI/2);return isNaN(u)?null:`M ${u},${C} ${K},${Q} ${ee},${te} Z`}),B=e.computed(()=>{for(let l=0;l<p.value.series.length;l+=1){const{color:n,from:o,to:u}=p.value.series[l];if(c.value>=o&&c.value<=u)return n}return"#2D353C"}),x=e.ref(null);function D(){if(r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiGauge",type:"dataset"}):(r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","series"]}).forEach(l=>{r.error({componentName:"VueUiGauge",type:"datasetAttribute",property:l})}),Object.hasOwn(s.dataset,"series")&&(s.dataset.series.length?s.dataset.series.forEach((l,n)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["from","to"]}).forEach(o=>{r.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:o,index:n})})}):r.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),R(s.dataset.value||0),t.value.responsive){const l=G.throttle(()=>{const{width:n,height:o}=G.useResponsive({chart:y.value,title:t.value.style.chart.title.text?z.value:null,legend:P.value,source:E.value,noTitle:$.value});a.value.width=n,a.value.height=o,a.value.centerX=n/2,a.value.centerY=v.value/2/358.4*o,a.value.bottom=o,a.value.labelFontSize=18/v.value*Math.min(o,n)<10?10:18/v.value*Math.min(o,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/v.value*Math.min(o,n)<14?14:t.value.style.chart.legend.fontSize/v.value*Math.min(o,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/v.value*Math.min(o,n),a.value.trackSize=t.value.style.chart.layout.track.size/v.value*Math.min(o,n),a.value.pointerStrokeWidth=r.translateSize({relator:Math.min(n,o),adjuster:v.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=r.translateSize({relator:Math.max(n,o),adjuster:v.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});x.value=new ResizeObserver(l),x.value.observe(y.value.parentNode)}}e.onMounted(()=>{D()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function R(l){const n=[];(p.value.series||[]).forEach(f=>{n.push(f.from||0),n.push(f.to||0)}),k.value=Math.max(...n),g.value=Math.min(...n);let o=t.value.style.chart.animation.speed;const u=Math.abs(l-c.value)/(o*60);function C(){c.value<l?c.value=Math.min(c.value+u,l):c.value>l&&(c.value=Math.max(c.value-u,l)),c.value!==l&&requestAnimationFrame(C)}C()}const i=e.computed(()=>{const l=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:l/2.5,gradients:l/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),m=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,i.value.base,i.value.arcs,i.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),Z=e.computed(()=>r.makeDonut({series:p.value.series},a.value.width/2,i.value.base,i.value.gradients,i.value.gradients,.95,1,1,180,110.02,2*a.value.trackSize)),b=e.ref(!1);function J(l){b.value=l,N.value+=1}const w=e.ref(!1);function F(){w.value=!w.value}return T({generatePdf:A,generateImage:X,toggleAnnotator:F}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:y,id:`vue-ui-gauge_${h.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%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:F},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),W.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:$,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:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(le._sfc_main,{key:`title_${M.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&S.dataset.base?(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(S.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&_.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref_key:"details",ref:U,key:`user_options_${N.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(V),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:J,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(X),onToggleAnnotator:F},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),_.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}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(oe._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,de),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(r.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)("#FFFFFF",1)},null,8,he)],8,ce)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,pe)],8,fe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,u)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${u}`,d:o.arcSlice,fill:o.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,me))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Z.value,(o,u)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${u}`,d:o.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,ye))),128)):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("g",ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(o,u)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:o.center.startX,initY:o.center.startY,offset:a.value.markerOffset}).y,"text-anchor":o.center.startX<a.value.width/2-5?"end":o.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.markers.formatter,o.from,e.unref(r.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:o.from,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,ge))),256))])):e.createCommentVNode("",!0),t.value.style.chart.layout.markers.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:i.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.markers.formatter,k.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.markers.prefix,v:k.value,s:t.value.style.chart.layout.markers.suffix,r:t.value.style.chart.layout.markers.roundingValue}))),9,be)):e.createCommentVNode("",!0),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",_e,[isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,xe)),isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?B.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,we)),!isNaN(d.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,Ce)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",Se,[Y.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:Y.value,fill:t.value.style.chart.layout.pointer.useRatingColor?B.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,Be)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:i.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,Fe),t.value.style.chart.legend.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:a.value.width/2,y:i.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?B.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.legend.formatter,c.value,e.unref(r.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&c.value>0?"+":""),v:c.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,Ne)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,ie)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(V)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ae.default,{key:6,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:P},[e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:E,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],14,se))}},Ee=ne._export_sfc(Pe,[["__scopeId","data-v-31427f30"]]);exports.default=Ee;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-B5Ugkauv.cjs"),m=require("./useNestedProp-bZitLnbb.cjs"),_=require("./PackageVersion-CMtZxTqq.cjs"),k=["viewBox","width"],p={key:0},g=["id"],v=["stop-color"],y=["stop-color"],N=["stroke"],C=["stroke"],V=["width","fill"],w=["fill"],x={key:0},B=["id"],E=e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:1},null,-1),b=[E],L=["stroke"],z=["stroke","stroke-dasharray","stroke-dashoffset"],G=["filter"],F=["stroke","stroke-dasharray","stroke-dashoffset"],P=["fill"],$={__name:"vue-ui-gizmo",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(i){const o=i,{vue_ui_gizmo:f}=a.useConfig(),n=e.ref(a.createUid());e.onMounted(()=>{c()});function c(){!o.dataset&&o.dataset!==0&&a.error({componentName:"VueUiGizmo",type:"dataset"}),o.dataset<0&&console.warn("VueUiGizmo: dataset cannot be negative.")}const t=e.computed({get:()=>d(),set:r=>r});function d(){return m.useNestedProp({userConfig:o.config,defaultConfig:f})}e.watch(()=>o.config,r=>{t.value=d(),c()},{deep:!0});const u=e.computed(()=>({battery:{width:t.value.showPercentage?140:80,height:50},gauge:{width:80,height:80}})[t.value.type]),l=e.computed(()=>{const s=2*Math.PI*35,h=s-o.dataset/100*s;return{dasharray:`${s} ${s}`,dashoffset:h}});return(r,s)=>(e.openBlock(),e.createElementBlock("svg",{class:"vue-ui-gizmo",viewBox:`0 0 ${u.value.width} ${u.value.height}`,width:t.value.size,style:e.normalizeStyle({background:"transparent",fontFamily:t.value.fontFamily})},[e.createVNode(_._sfc_main),t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",p,[e.createElementVNode("linearGradient",{id:`gizmo_gradient_${n.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.gradientColor},null,8,v),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.color},null,8,y)],8,g)])):e.createCommentVNode("",!0),t.value.type==="battery"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("path",{d:"M 5 10 L 5 40 C 5 43 7 45 9 45 L 65 45 C 68 45 70 43 70 40 L 70 38 C 73 38 75 38 75 33 L 75 17 C 75 12 73 12 70 12 L 70 10 C 70 7 68 5 65 5 L 10 5 C 7 5 5 7 5 10",stroke:t.value.stroke,"stroke-width":2,fill:"none"},null,8,N),e.createElementVNode("path",{d:"M 70 16 L 70 34",stroke:t.value.stroke,"stroke-width":2,fill:"none",style:{opacity:"0.5"}},null,8,C),e.createElementVNode("rect",{x:10,y:10,height:30,width:55*(i.dataset/100),fill:t.value.useGradient?`url(#gizmo_gradient_${n.value})`:t.value.color,rx:2},null,8,V),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:0,x:85,y:32,"text-anchor":"start","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,w)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="gauge"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",x,[e.createElementVNode("filter",{id:`blur_${n.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},b,8,B)])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.stroke,"stroke-width":2*4,fill:"none"},null,8,L),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.color,"stroke-width":2*4,"stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,"stroke-linecap":"round",fill:"none",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,z),t.value.useGradient?(e.openBlock(),e.createElementBlock("g",{key:1,filter:`url(#blur_${n.value})`},[e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.gradientColor,"stroke-width":1,fill:"none","stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,F)],8,G)):e.createCommentVNode("",!0),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:2,x:40,y:47,"text-anchor":"middle","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,P)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],12,k))}};exports.default=$;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as x, onMounted as C, computed as c, watch as z, openBlock as a, createElementBlock as s, normalizeStyle as G, createVNode as L, createElementVNode as t, createCommentVNode as r, Fragment as g, toDisplayString as y, unref as d } from "vue";
|
|
2
|
-
import { u as b, c as N, e as $, i as p, f as m } from "./index-
|
|
3
|
-
import { u as F } from "./useNestedProp-
|
|
4
|
-
import { _ as B } from "./PackageVersion-
|
|
2
|
+
import { u as b, c as N, e as $, i as p, f as m } from "./index-B6Q1Fyk0.js";
|
|
3
|
+
import { u as F } from "./useNestedProp-DQpuJSz3.js";
|
|
4
|
+
import { _ as B } from "./PackageVersion-S7OD_s5u.js";
|
|
5
5
|
const P = ["viewBox", "width"], V = { key: 0 }, D = ["id"], I = ["stop-color"], M = ["stop-color"], U = ["stroke"], E = ["stroke"], O = ["width", "fill"], S = ["fill"], A = { key: 0 }, j = ["id"], T = /* @__PURE__ */ t("feGaussianBlur", {
|
|
6
6
|
in: "SourceGraphic",
|
|
7
7
|
stdDeviation: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index--lHmCKjC.cjs"),ce=require("./Title-RB80eFiD.cjs"),Z=require("./usePrinter-BfuqGrO4.cjs"),ve=require("./Tooltip-BC1YZMi2.cjs"),ye=require("./vue-ui-skeleton-BGfzzQdU.cjs"),pe=require("./BaseIcon-zXh1vLYa.cjs"),he=require("./vue-ui-accordion-ClQObElI.cjs"),ee=require("./useNestedProp-DLJc0s53.cjs"),fe=require("./PackageVersion-rf9gXZ-Q.cjs"),ge=require("./PenAndPaper-DS7gA4X0.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=["id"],ke={key:2,style:"width:100%;background:transparent"},xe=["xmlns","viewBox"],we=["x","y","width","height","fill","stroke","stroke-width"],Ce=["x","y","width","height","fill","stroke","stroke-width"],_e=["font-size","font-weight","fill","x","y"],Ne=["x","y","width","height","onMouseover"],Be={key:0},Le=["font-size","fill","x","y","font-weight"],Ve={key:0},$e=["text-anchor","font-size","fill","font-weight","transform"],Ee={key:1},Se=["x","y","width","height","stroke","stroke-width"],Ae={key:2},ze=["id"],Te=["stop-color"],Me=["stop-color"],Pe=["x","y","font-size","fill"],Oe=["x","y","height","rx","fill"],Fe=["x","y","font-size","fill"],De=["stroke","x1","x2","y1","y2"],Ie=["fill","d"],Re={key:3},qe={id:"colorScaleHorizontal",x1:"0%",x2:"100%",y1:"0%",y2:"0%"},He=["stop-color"],Ue=["stop-color"],Ge=["x","y","width","height","rx"],Xe=["x","y","font-size","fill"],je=["x","y","font-size","fill"],Ye=["stroke","x1","x2","y1","y2"],We=["fill","d"],Ke={key:5,class:"vue-data-ui-watermark"},Je={key:6,ref:"source",dir:"auto"},Qe={class:"vue-ui-data-table"},Ze={key:0},et=["data-cell"],tt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},lt=["data-cell"],at={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ot={__name:"vue-ui-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(L,{expose:te}){const n=L;e.useCssVars(l=>({"309b083a":l.tdo}));const{vue_ui_heatmap:le}=o.useConfig(),V=e.computed(()=>!!n.dataset&&n.dataset.length);o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiHeatmap",type:"dataset"});const x=e.ref(o.createUid()),$=e.ref(null),ae=e.ref(null),z=e.ref(!1),T=e.ref(""),I=e.ref(void 0),w=e.ref(null),R=e.ref(0),q=e.ref(null),oe=e.ref(null),H=e.ref(!1),U=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=ee.useNestedProp({userConfig:n.config,defaultConfig:le});let s={};return l.theme?s={...ee.useNestedProp({userConfig:o.themes.vue_ui_heatmap[l.theme]||n.config,defaultConfig:l})}:s=l,n.config&&o.hasDeepProperty(n.config,"style.layout.dataLabels.xAxis.showOnlyAtModulo")?s.style.layout.dataLabels.xAxis.showOnlyAtModulo=n.config.style.layout.dataLabels.xAxis.showOnlyAtModulo:s.style.layout.dataLabels.xAxis.showOnlyAtModulo=null,s}e.watch(()=>n.config,l=>{t.value=G(),M(),U.value+=1},{deep:!0}),e.watch(()=>n.dataset,()=>{M()},{deep:!0});const{isPrinting:X,isImaging:j,generatePdf:Y,generateImage:W}=Z.usePrinter({elementId:`heatmap__${x.value}`,fileName:t.value.style.title.text||"vue-ui-heatmap"}),se=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),ue=e.computed(()=>t.value.table.responsiveBreakpoint);function ne(){new ResizeObserver(s=>{s.forEach(u=>{H.value=u.contentRect.width<ue.value})}).observe(q.value)}e.onMounted(M);function M(){ne()}const k=e.computed(()=>Math.max(...n.dataset.flatMap(l=>(l.values||[]).length))),p=e.computed(()=>{const l=t.value.style.layout.padding.top+t.value.style.layout.padding.bottom+n.dataset.length*t.value.style.layout.cells.height,s=t.value.style.layout.padding.left+t.value.style.layout.padding.right+(k.value<n.dataset.length?n.dataset.length:k.value)*t.value.style.layout.cells.height,u=l+(t.value.style.legend.show?t.value.style.legend.position==="right"?0:t.value.style.layout.cells.height*2:0);return{height:l,heightWithLegend:u,width:s}}),E=e.computed(()=>t.value.style.legend.position),a=e.computed(()=>({top:t.value.style.layout.padding.top,left:t.value.style.layout.padding.left,right:p.value.width-t.value.style.layout.padding.right-(E.value==="right"&&t.value.style.legend.show?92:0),bottom:p.value.height-t.value.style.layout.padding.bottom,height:p.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,width:p.value.width-t.value.style.layout.padding.right-t.value.style.layout.padding.left-(E.value==="right"&&t.value.style.legend.show?92:0)})),P=e.computed(()=>i.value.height*n.dataset.length),v=e.computed(()=>Math.max(...n.dataset.flatMap(l=>l.values))),m=e.computed(()=>Math.min(...n.dataset.flatMap(l=>l.values))),b=e.computed(()=>{const l=n.dataset.flatMap(u=>u.values);return l.reduce((u,r)=>u+r,0)/l.length}),i=e.computed(()=>({width:a.value.width/k.value,height:a.value.width/(k.value<n.dataset.length?n.dataset.length:k.value)})),h=e.computed(()=>{const l=t.value.style.layout.dataLabels.yAxis.values.length?t.value.style.layout.dataLabels.yAxis.values:n.dataset.map(u=>u.name),s=t.value.style.layout.dataLabels.xAxis.values;return{yLabels:l,xLabels:s.slice(0,k.value)}}),S=e.computed(()=>(n.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["values"]}).forEach(u=>{o.error({componentName:"VueUiHeatmap",type:"datasetSerieAttribute",property:"values",index:s})})}),n.dataset.map(l=>({...l,temperatures:(l.values||[]).map((s,u)=>s>=b.value?{side:"up",color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),ratio:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value))>1?1:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value)),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`}:{side:"down",ratio:Math.abs(1-Math.abs(s)/Math.abs(b.value))>1?1:Math.abs(1-Math.abs(s)/Math.abs(b.value)),color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`})})))),f=e.ref(null),C=e.ref(null);function re(l,s,u,r){w.value={x:u,y:r};const{value:d,yAxisName:c,xAxisName:g,id:de}=l;I.value=de,f.value=d,C.value={datapoint:l,seriesIndex:s,series:S.value,config:t.value},z.value=!0;let F="";const D=t.value.style.tooltip.customFormat;o.isFunction(D)&&o.functionReturnsString(()=>D({datapoint:l,seriesIndex:s,series:S.value,config:t.value}))?T.value=D({datapoint:l,seriesIndex:s,series:S.value,config:t.value}):(F+=`<div>${c} ${g?`${g}`:""}</div>`,F+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor};font-weight:bold;display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:center"><span style="color:${o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,d)}">⬤</span><span>${isNaN(d)?"-":o.applyDataLabel(t.value.style.layout.cells.value.formatter,d,o.dataLabel({p:t.value.style.layout.dataLabels.prefix,v:d,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</span></div>`,T.value=`<div style="font-size:${t.value.style.tooltip.fontSize}px">${F}</div>`)}const _=e.computed(()=>a.value.top+P.value*(1-f.value/v.value)),N=e.computed(()=>a.value.left+(p.value.width-a.value.left-t.value.style.layout.padding.right)*(f.value/v.value));e.computed(()=>{const l=n.dataset.map(u=>({name:u.name})),s=n.dataset.map(u=>u.values);return{head:l,body:s}});function K(){e.nextTick(()=>{const l=["",...n.dataset.map((d,c)=>d.name)],s=[];for(let d=0;d<h.value.xLabels.length;d+=1){const c=[h.value.xLabels[d]];for(let g=0;g<n.dataset.length;g+=1)c.push([n.dataset[g].values[d]]);s.push(c)}const u=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(s),r=o.createCsvContent(u);o.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-heatmap"})})}const B=e.ref(!1);function ie(l){B.value=l,R.value+=1}function J(){y.value.showTable=!y.value.showTable}function Q(){y.value.showTooltip=!y.value.showTooltip}const A=e.ref(!1);function O(){A.value=!A.value}return te({generatePdf:Y,generateCsv:K,generateImage:W,toggleTable:J,toggleTooltip:Q,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"heatmapChart",ref:$,class:e.normalizeClass(`vue-ui-heatmap ${B.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor}`),id:`heatmap__${x.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ge.PenAndPaper,{key:0,parent:$.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:A.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:oe,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${U.value}`,config:{title:{cy:"heatmap-div-title",...t.value.style.title},subtitle:{cy:"heatmap-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref_key:"details",ref:ae,key:`user_options_${R.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(j),isPrinting:e.unref(X),uid:x.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.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,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:B.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:A.value,onToggleFullscreen:ie,onGeneratePdf:e.unref(Y),onGenerateCsv:K,onGenerateImage:e.unref(W),onToggleTable:J,onToggleTooltip:Q,onToggleAnnotator:O},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:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:u,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:u,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:u,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":B.value,"vue-data-ui-fulscreen--off":!B.value}),viewBox:`0 0 ${p.value.width} ${p.value.heightWithLegend}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(fe._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(u,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:t.value.style.layout.cells.colors.underlayer,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,we),e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:d.color,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,Ce),t.value.style.layout.cells.value.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle","font-size":t.value.style.layout.cells.value.fontSize,"font-weight":t.value.style.layout.cells.value.bold?"bold":"normal",fill:e.unref(o.adaptColorToBackground)(d.color),x:a.value.left+i.value.width*c+i.value.width/2,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.cells.value.fontSize/3},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,d.value,e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.value,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.layout.cells.value.roundingValue}),{datapoint:d})),9,_e)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c,y:a.value.top+i.value.height*r,width:i.value.width,height:i.value.height,fill:"transparent",stroke:"none",onMouseover:g=>re(d,r,a.value.left+i.value.width*c,a.value.top+i.value.height*r),onMouseout:s[0]||(s[0]=g=>{z.value=!1,I.value=void 0,f.value=null,w.value=null})},null,40,Ne)]))),256)),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",Be,[e.createElementVNode("text",{"font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color,x:a.value.left+t.value.style.layout.dataLabels.yAxis.offsetX-6,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.dataLabels.yAxis.fontSize/3+t.value.style.layout.dataLabels.yAxis.offsetY,"text-anchor":"end","font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},e.toDisplayString(h.value.yLabels[r]),9,Le)])):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo||t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo&&r%t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo===0?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.layout.dataLabels.xAxis.rotation===0?"middle":t.value.style.layout.dataLabels.xAxis.rotation<0?"start":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",transform:`translate(${a.value.left+i.value.width/2+a.value.width/h.value.xLabels.length*r+t.value.style.layout.dataLabels.xAxis.offsetX}, ${a.value.top+t.value.style.layout.dataLabels.xAxis.offsetY-6}), rotate(${t.value.style.layout.dataLabels.xAxis.rotation})`},e.toDisplayString(u),9,$e)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("g",Ee,[e.createElementVNode("rect",{style:{"pointer-events":"none"},x:w.value.x-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,y:w.value.y-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,width:i.value.width-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,fill:"transparent",stroke:t.value.style.layout.cells.selected.color,"stroke-width":t.value.style.layout.cells.selected.border,rx:1},null,8,Se)])):e.createCommentVNode("",!0),t.value.style.legend.show&&E.value==="right"?(e.openBlock(),e.createElementBlock("g",Ae,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`colorScaleVertical_${x.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.hot},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.cold},null,8,Me)],8,ze)]),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top-t.value.style.legend.fontSize*1.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Pe),e.createElementVNode("rect",{x:a.value.right+36,y:a.value.top,width:36,height:P.value,rx:t.value.style.legend.scaleBorderRadius,fill:`url(#colorScaleVertical_${x.value})`},null,8,Oe),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top+P.value+t.value.style.legend.fontSize*2.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Fe),f.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(C.value.datapoint.color),"stroke-width":"2",x1:a.value.right+36,x2:a.value.right+72,y1:_.value,y2:_.value},null,8,De)):e.createCommentVNode("",!0),f.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${a.value.right+36},${_.value} ${a.value.right+26},${_.value-8} ${a.value.right+26},${_.value+8}z`},null,8,Ie)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.legend.show&&E.value==="bottom"?(e.openBlock(),e.createElementBlock("g",Re,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",qe,[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.cold},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.hot},null,8,Ue)])]),e.createElementVNode("rect",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height,width:p.value.width-a.value.left-t.value.style.layout.padding.right,height:t.value.style.layout.cells.height,rx:t.value.style.legend.scaleBorderRadius>t.value.style.layout.cells.height/2?t.value.style.layout.cells.height/2:t.value.style.legend.scaleBorderRadius,fill:"url(#colorScaleHorizontal)"},null,8,Ge),e.createElementVNode("text",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"start","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Xe),e.createElementVNode("text",{x:a.value.right,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"end","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,je),f.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(C.value.datapoint.color),"stroke-width":"2",x1:N.value,x2:N.value,y1:a.value.bottom+t.value.style.layout.cells.height,y2:a.value.bottom+t.value.style.layout.cells.height*2},null,8,Ye)):e.createCommentVNode("",!0),f.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${N.value},${a.value.bottom+t.value.style.layout.cells.height} ${N.value-12},${a.value.bottom+t.value.style.layout.cells.height-20} ${N.value+12},${a.value.bottom+t.value.style.layout.cells.height-20}z`},null,8,We)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:p.value},void 0,!0)],14,xe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ye.default,{key:7,config:{type:"heatmap",style:{backgroundColor:t.value.style.backgroundColor,heatmap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(ve._sfc_main,{show:y.value.showTooltip&&z.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:$.value,content:T.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...C.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...C.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock(he.default,{key:8,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:q,class:"vue-ui-heatmap-table"},[e.createElementVNode("div",{style:"width:100%;overflow-x:auto;padding-top:36px;position:relative",class:e.normalizeClass({"vue-ui-responsive":H.value})},[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; left: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:s[1]||(s[1]=u=>y.value.showTable=!1),onKeypress:s[2]||(s[2]=e.withKeys(u=>y.value.showTable=!1,["enter"]))},[e.createVNode(pe.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("table",Qe,[e.createElementVNode("caption",{style:e.normalizeStyle(`backgroundColor:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(t.value.style.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.createElementVNode("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},null,4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.dataset,(u,r)=>(e.openBlock(),e.createElementBlock("th",{align:"right",style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},e.toDisplayString(u.name),5))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",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",{"data-cell":t.value.table.colNames.xAxis,class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",tt,e.toDisplayString(u),1)],12,et),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.dataset,(d,c)=>(e.openBlock(),e.createElementBlock("td",{class:"vue-ui-data-table__tbody__td","data-cell":L.dataset[c].name,style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",at,e.toDisplayString(isNaN(d.values[r])?"-":e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.values[r],s:t.value.style.layout.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)],12,lt))),256))],6))),256))])])],2)],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,be))}},st=me._export_sfc(ot,[["__scopeId","data-v-569c98af"]]);exports.default=st;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-B5Ugkauv.cjs"),ce=require("./Title-D9gPXVTT.cjs"),Z=require("./usePrinter-DtpFEgOX.cjs"),ve=require("./Tooltip-ypQtmi99.cjs"),ye=require("./vue-ui-skeleton-E9_X0-sa.cjs"),pe=require("./BaseIcon-D-JUZiGA.cjs"),he=require("./vue-ui-accordion-u4xDSvRn.cjs"),ee=require("./useNestedProp-bZitLnbb.cjs"),fe=require("./PackageVersion-CMtZxTqq.cjs"),ge=require("./PenAndPaper-DWYhyZye.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=["id"],ke={key:2,style:"width:100%;background:transparent"},xe=["xmlns","viewBox"],we=["x","y","width","height","fill","stroke","stroke-width"],Ce=["x","y","width","height","fill","stroke","stroke-width"],_e=["font-size","font-weight","fill","x","y"],Ne=["x","y","width","height","onMouseover"],Be={key:0},Le=["font-size","fill","x","y","font-weight"],Ve={key:0},$e=["text-anchor","font-size","fill","font-weight","transform"],Ee={key:1},Se=["x","y","width","height","stroke","stroke-width"],Ae={key:2},ze=["id"],Te=["stop-color"],Me=["stop-color"],Pe=["x","y","font-size","fill"],Oe=["x","y","height","rx","fill"],Fe=["x","y","font-size","fill"],De=["stroke","x1","x2","y1","y2"],Ie=["fill","d"],Re={key:3},qe={id:"colorScaleHorizontal",x1:"0%",x2:"100%",y1:"0%",y2:"0%"},He=["stop-color"],Ue=["stop-color"],Ge=["x","y","width","height","rx"],Xe=["x","y","font-size","fill"],je=["x","y","font-size","fill"],Ye=["stroke","x1","x2","y1","y2"],We=["fill","d"],Ke={key:5,class:"vue-data-ui-watermark"},Je={key:6,ref:"source",dir:"auto"},Qe={class:"vue-ui-data-table"},Ze={key:0},et=["data-cell"],tt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},lt=["data-cell"],at={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ot={__name:"vue-ui-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(L,{expose:te}){const n=L;e.useCssVars(l=>({"309b083a":l.tdo}));const{vue_ui_heatmap:le}=o.useConfig(),V=e.computed(()=>!!n.dataset&&n.dataset.length);o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiHeatmap",type:"dataset"});const x=e.ref(o.createUid()),$=e.ref(null),ae=e.ref(null),z=e.ref(!1),T=e.ref(""),I=e.ref(void 0),w=e.ref(null),R=e.ref(0),q=e.ref(null),oe=e.ref(null),H=e.ref(!1),U=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=ee.useNestedProp({userConfig:n.config,defaultConfig:le});let s={};return l.theme?s={...ee.useNestedProp({userConfig:o.themes.vue_ui_heatmap[l.theme]||n.config,defaultConfig:l})}:s=l,n.config&&o.hasDeepProperty(n.config,"style.layout.dataLabels.xAxis.showOnlyAtModulo")?s.style.layout.dataLabels.xAxis.showOnlyAtModulo=n.config.style.layout.dataLabels.xAxis.showOnlyAtModulo:s.style.layout.dataLabels.xAxis.showOnlyAtModulo=null,s}e.watch(()=>n.config,l=>{t.value=G(),M(),U.value+=1},{deep:!0}),e.watch(()=>n.dataset,()=>{M()},{deep:!0});const{isPrinting:X,isImaging:j,generatePdf:Y,generateImage:W}=Z.usePrinter({elementId:`heatmap__${x.value}`,fileName:t.value.style.title.text||"vue-ui-heatmap"}),se=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),ue=e.computed(()=>t.value.table.responsiveBreakpoint);function ne(){new ResizeObserver(s=>{s.forEach(u=>{H.value=u.contentRect.width<ue.value})}).observe(q.value)}e.onMounted(M);function M(){ne()}const k=e.computed(()=>Math.max(...n.dataset.flatMap(l=>(l.values||[]).length))),p=e.computed(()=>{const l=t.value.style.layout.padding.top+t.value.style.layout.padding.bottom+n.dataset.length*t.value.style.layout.cells.height,s=t.value.style.layout.padding.left+t.value.style.layout.padding.right+(k.value<n.dataset.length?n.dataset.length:k.value)*t.value.style.layout.cells.height,u=l+(t.value.style.legend.show?t.value.style.legend.position==="right"?0:t.value.style.layout.cells.height*2:0);return{height:l,heightWithLegend:u,width:s}}),E=e.computed(()=>t.value.style.legend.position),a=e.computed(()=>({top:t.value.style.layout.padding.top,left:t.value.style.layout.padding.left,right:p.value.width-t.value.style.layout.padding.right-(E.value==="right"&&t.value.style.legend.show?92:0),bottom:p.value.height-t.value.style.layout.padding.bottom,height:p.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,width:p.value.width-t.value.style.layout.padding.right-t.value.style.layout.padding.left-(E.value==="right"&&t.value.style.legend.show?92:0)})),P=e.computed(()=>i.value.height*n.dataset.length),v=e.computed(()=>Math.max(...n.dataset.flatMap(l=>l.values))),m=e.computed(()=>Math.min(...n.dataset.flatMap(l=>l.values))),b=e.computed(()=>{const l=n.dataset.flatMap(u=>u.values);return l.reduce((u,r)=>u+r,0)/l.length}),i=e.computed(()=>({width:a.value.width/k.value,height:a.value.width/(k.value<n.dataset.length?n.dataset.length:k.value)})),h=e.computed(()=>{const l=t.value.style.layout.dataLabels.yAxis.values.length?t.value.style.layout.dataLabels.yAxis.values:n.dataset.map(u=>u.name),s=t.value.style.layout.dataLabels.xAxis.values;return{yLabels:l,xLabels:s.slice(0,k.value)}}),S=e.computed(()=>(n.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["values"]}).forEach(u=>{o.error({componentName:"VueUiHeatmap",type:"datasetSerieAttribute",property:"values",index:s})})}),n.dataset.map(l=>({...l,temperatures:(l.values||[]).map((s,u)=>s>=b.value?{side:"up",color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),ratio:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value))>1?1:Math.abs(Math.abs(s-b.value)/Math.abs(v.value-b.value)),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`}:{side:"down",ratio:Math.abs(1-Math.abs(s)/Math.abs(b.value))>1?1:Math.abs(1-Math.abs(s)/Math.abs(b.value)),color:o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,s),value:s,yAxisName:l.name,xAxisName:h.value.xLabels[u],id:`vue-data-ui-heatmap-cell-${o.createUid()}`})})))),f=e.ref(null),C=e.ref(null);function re(l,s,u,r){w.value={x:u,y:r};const{value:d,yAxisName:c,xAxisName:g,id:de}=l;I.value=de,f.value=d,C.value={datapoint:l,seriesIndex:s,series:S.value,config:t.value},z.value=!0;let F="";const D=t.value.style.tooltip.customFormat;o.isFunction(D)&&o.functionReturnsString(()=>D({datapoint:l,seriesIndex:s,series:S.value,config:t.value}))?T.value=D({datapoint:l,seriesIndex:s,series:S.value,config:t.value}):(F+=`<div>${c} ${g?`${g}`:""}</div>`,F+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor};font-weight:bold;display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:center"><span style="color:${o.interpolateColorHex(t.value.style.layout.cells.colors.cold,t.value.style.layout.cells.colors.hot,m.value,v.value,d)}">⬤</span><span>${isNaN(d)?"-":o.applyDataLabel(t.value.style.layout.cells.value.formatter,d,o.dataLabel({p:t.value.style.layout.dataLabels.prefix,v:d,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</span></div>`,T.value=`<div style="font-size:${t.value.style.tooltip.fontSize}px">${F}</div>`)}const _=e.computed(()=>a.value.top+P.value*(1-f.value/v.value)),N=e.computed(()=>a.value.left+(p.value.width-a.value.left-t.value.style.layout.padding.right)*(f.value/v.value));e.computed(()=>{const l=n.dataset.map(u=>({name:u.name})),s=n.dataset.map(u=>u.values);return{head:l,body:s}});function K(){e.nextTick(()=>{const l=["",...n.dataset.map((d,c)=>d.name)],s=[];for(let d=0;d<h.value.xLabels.length;d+=1){const c=[h.value.xLabels[d]];for(let g=0;g<n.dataset.length;g+=1)c.push([n.dataset[g].values[d]]);s.push(c)}const u=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(s),r=o.createCsvContent(u);o.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-heatmap"})})}const B=e.ref(!1);function ie(l){B.value=l,R.value+=1}function J(){y.value.showTable=!y.value.showTable}function Q(){y.value.showTooltip=!y.value.showTooltip}const A=e.ref(!1);function O(){A.value=!A.value}return te({generatePdf:Y,generateCsv:K,generateImage:W,toggleTable:J,toggleTooltip:Q,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"heatmapChart",ref:$,class:e.normalizeClass(`vue-ui-heatmap ${B.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor}`),id:`heatmap__${x.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ge.PenAndPaper,{key:0,parent:$.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:A.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:oe,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${U.value}`,config:{title:{cy:"heatmap-div-title",...t.value.style.title},subtitle:{cy:"heatmap-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref_key:"details",ref:ae,key:`user_options_${R.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(j),isPrinting:e.unref(X),uid:x.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.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,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:B.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:A.value,onToggleFullscreen:ie,onGeneratePdf:e.unref(Y),onGenerateCsv:K,onGenerateImage:e.unref(W),onToggleTable:J,onToggleTooltip:Q,onToggleAnnotator:O},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:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:u,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:u,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:u,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":B.value,"vue-data-ui-fulscreen--off":!B.value}),viewBox:`0 0 ${p.value.width} ${p.value.heightWithLegend}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(fe._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(u,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:t.value.style.layout.cells.colors.underlayer,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,we),e.createElementVNode("rect",{x:a.value.left+i.value.width*c+t.value.style.layout.cells.spacing/2,y:a.value.top+i.value.height*r+t.value.style.layout.cells.spacing/2,width:i.value.width-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing,fill:d.color,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.cells.spacing},null,8,Ce),t.value.style.layout.cells.value.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle","font-size":t.value.style.layout.cells.value.fontSize,"font-weight":t.value.style.layout.cells.value.bold?"bold":"normal",fill:e.unref(o.adaptColorToBackground)(d.color),x:a.value.left+i.value.width*c+i.value.width/2,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.cells.value.fontSize/3},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,d.value,e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.value,s:t.value.style.layout.dataLabels.suffix,r:t.value.style.layout.cells.value.roundingValue}),{datapoint:d})),9,_e)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.temperatures,(d,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.value.left+i.value.width*c,y:a.value.top+i.value.height*r,width:i.value.width,height:i.value.height,fill:"transparent",stroke:"none",onMouseover:g=>re(d,r,a.value.left+i.value.width*c,a.value.top+i.value.height*r),onMouseout:s[0]||(s[0]=g=>{z.value=!1,I.value=void 0,f.value=null,w.value=null})},null,40,Ne)]))),256)),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",Be,[e.createElementVNode("text",{"font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color,x:a.value.left+t.value.style.layout.dataLabels.yAxis.offsetX-6,y:a.value.top+i.value.height*r+i.value.height/2+t.value.style.layout.dataLabels.yAxis.fontSize/3+t.value.style.layout.dataLabels.yAxis.offsetY,"text-anchor":"end","font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},e.toDisplayString(h.value.yLabels[r]),9,Le)])):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo||t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo&&r%t.value.style.layout.dataLabels.xAxis.showOnlyAtModulo===0?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.layout.dataLabels.xAxis.rotation===0?"middle":t.value.style.layout.dataLabels.xAxis.rotation<0?"start":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",transform:`translate(${a.value.left+i.value.width/2+a.value.width/h.value.xLabels.length*r+t.value.style.layout.dataLabels.xAxis.offsetX}, ${a.value.top+t.value.style.layout.dataLabels.xAxis.offsetY-6}), rotate(${t.value.style.layout.dataLabels.xAxis.rotation})`},e.toDisplayString(u),9,$e)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("g",Ee,[e.createElementVNode("rect",{style:{"pointer-events":"none"},x:w.value.x-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,y:w.value.y-t.value.style.layout.cells.selected.border/2+t.value.style.layout.cells.spacing,width:i.value.width-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,height:i.value.height-t.value.style.layout.cells.spacing+t.value.style.layout.cells.selected.border-t.value.style.layout.cells.spacing,fill:"transparent",stroke:t.value.style.layout.cells.selected.color,"stroke-width":t.value.style.layout.cells.selected.border,rx:1},null,8,Se)])):e.createCommentVNode("",!0),t.value.style.legend.show&&E.value==="right"?(e.openBlock(),e.createElementBlock("g",Ae,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`colorScaleVertical_${x.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.hot},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.cold},null,8,Me)],8,ze)]),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top-t.value.style.legend.fontSize*1.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Pe),e.createElementVNode("rect",{x:a.value.right+36,y:a.value.top,width:36,height:P.value,rx:t.value.style.legend.scaleBorderRadius,fill:`url(#colorScaleVertical_${x.value})`},null,8,Oe),e.createElementVNode("text",{x:a.value.right+36+18,y:a.value.top+P.value+t.value.style.legend.fontSize*2.5,"text-anchor":"middle","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Fe),f.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(C.value.datapoint.color),"stroke-width":"2",x1:a.value.right+36,x2:a.value.right+72,y1:_.value,y2:_.value},null,8,De)):e.createCommentVNode("",!0),f.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${a.value.right+36},${_.value} ${a.value.right+26},${_.value-8} ${a.value.right+26},${_.value+8}z`},null,8,Ie)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.legend.show&&E.value==="bottom"?(e.openBlock(),e.createElementBlock("g",Re,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",qe,[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.cells.colors.cold},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.cells.colors.hot},null,8,Ue)])]),e.createElementVNode("rect",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height,width:p.value.width-a.value.left-t.value.style.layout.padding.right,height:t.value.style.layout.cells.height,rx:t.value.style.legend.scaleBorderRadius>t.value.style.layout.cells.height/2?t.value.style.layout.cells.height/2:t.value.style.legend.scaleBorderRadius,fill:"url(#colorScaleHorizontal)"},null,8,Ge),e.createElementVNode("text",{x:a.value.left,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"start","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(m.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(m.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,Xe),e.createElementVNode("text",{x:a.value.right,y:a.value.bottom+t.value.style.layout.cells.height*2+t.value.style.legend.fontSize*2,"text-anchor":"end","font-size":t.value.style.legend.fontSize*2,fill:t.value.style.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.layout.cells.value.formatter,e.unref(o.checkNaN)(v.value),e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:e.unref(o.checkNaN)(v.value),s:t.value.style.layout.dataLabels.suffix,r:t.value.style.legend.roundingValue}))),9,je),f.value!==null?(e.openBlock(),e.createElementBlock("line",{key:0,stroke:e.unref(o.adaptColorToBackground)(C.value.datapoint.color),"stroke-width":"2",x1:N.value,x2:N.value,y1:a.value.bottom+t.value.style.layout.cells.height,y2:a.value.bottom+t.value.style.layout.cells.height*2},null,8,Ye)):e.createCommentVNode("",!0),f.value!==null?(e.openBlock(),e.createElementBlock("path",{key:1,fill:t.value.style.color,stroke:"none",d:`M ${N.value},${a.value.bottom+t.value.style.layout.cells.height} ${N.value-12},${a.value.bottom+t.value.style.layout.cells.height-20} ${N.value+12},${a.value.bottom+t.value.style.layout.cells.height-20}z`},null,8,We)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:p.value},void 0,!0)],14,xe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ye.default,{key:7,config:{type:"heatmap",style:{backgroundColor:t.value.style.backgroundColor,heatmap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(ve._sfc_main,{show:y.value.showTooltip&&z.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:$.value,content:T.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...C.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...C.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),V.value?(e.openBlock(),e.createBlock(he.default,{key:8,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"tableContainer",ref:q,class:"vue-ui-heatmap-table"},[e.createElementVNode("div",{style:"width:100%;overflow-x:auto;padding-top:36px;position:relative",class:e.normalizeClass({"vue-ui-responsive":H.value})},[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; left: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:s[1]||(s[1]=u=>y.value.showTable=!1),onKeypress:s[2]||(s[2]=e.withKeys(u=>y.value.showTable=!1,["enter"]))},[e.createVNode(pe.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("table",Qe,[e.createElementVNode("caption",{style:e.normalizeStyle(`backgroundColor:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(t.value.style.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.createElementVNode("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},null,4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.dataset,(u,r)=>(e.openBlock(),e.createElementBlock("th",{align:"right",style:e.normalizeStyle(`outline:${t.value.table.th.outline};padding-right:6px`)},e.toDisplayString(u.name),5))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.xLabels,(u,r)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",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",{"data-cell":t.value.table.colNames.xAxis,class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",tt,e.toDisplayString(u),1)],12,et),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.dataset,(d,c)=>(e.openBlock(),e.createElementBlock("td",{class:"vue-ui-data-table__tbody__td","data-cell":L.dataset[c].name,style:e.normalizeStyle(`outline:${t.value.table.td.outline}`)},[e.createElementVNode("div",at,e.toDisplayString(isNaN(d.values[r])?"-":e.unref(o.dataLabel)({p:t.value.style.layout.dataLabels.prefix,v:d.values[r],s:t.value.style.layout.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)],12,lt))),256))],6))),256))])])],2)],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,be))}},st=me._export_sfc(ot,[["__scopeId","data-v-569c98af"]]);exports.default=st;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useCssVars as Fe, computed as h, ref as p, watch as we, onMounted as Pe, openBlock as o, createElementBlock as u, normalizeClass as K, normalizeStyle as x, createBlock as G, createCommentVNode as c, unref as i, createSlots as Ve, withCtx as w, renderSlot as f, normalizeProps as X, guardReactiveProps as H, createVNode as oe, Fragment as A, renderList as S, createElementVNode as n, toDisplayString as b, withKeys as Ie, createTextVNode as Be, nextTick as Re } from "vue";
|
|
2
|
-
import { u as Ee, o as Ge, e as _e, c as se, t as Xe, M as He, g as De, N as ue, X as Ue, F as ne, i as F, f as O, v as T, x as Ye, y as je, q as We, r as qe } from "./index-
|
|
3
|
-
import { _ as Ke } from "./Title-
|
|
4
|
-
import { u as Je, U as Qe } from "./usePrinter-
|
|
5
|
-
import { _ as Ze } from "./Tooltip-
|
|
6
|
-
import et from "./vue-ui-skeleton-
|
|
7
|
-
import tt from "./BaseIcon-
|
|
8
|
-
import lt from "./vue-ui-accordion-
|
|
9
|
-
import { u as ke } from "./useNestedProp-
|
|
10
|
-
import { _ as at } from "./PackageVersion-
|
|
11
|
-
import { P as ot } from "./PenAndPaper-
|
|
2
|
+
import { u as Ee, o as Ge, e as _e, c as se, t as Xe, M as He, g as De, N as ue, X as Ue, F as ne, i as F, f as O, v as T, x as Ye, y as je, q as We, r as qe } from "./index-B6Q1Fyk0.js";
|
|
3
|
+
import { _ as Ke } from "./Title-BB0O0yol.js";
|
|
4
|
+
import { u as Je, U as Qe } from "./usePrinter-D8dIU7aG.js";
|
|
5
|
+
import { _ as Ze } from "./Tooltip-GvLaModr.js";
|
|
6
|
+
import et from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
7
|
+
import tt from "./BaseIcon-DCE3wRiG.js";
|
|
8
|
+
import lt from "./vue-ui-accordion-BOHicozd.js";
|
|
9
|
+
import { u as ke } from "./useNestedProp-DQpuJSz3.js";
|
|
10
|
+
import { _ as at } from "./PackageVersion-S7OD_s5u.js";
|
|
11
|
+
import { P as ot } from "./PenAndPaper-BxJZd7k9.js";
|
|
12
12
|
import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const ut = ["id"], nt = {
|
|
14
14
|
key: 2,
|