vue-data-ui 2.4.78 → 2.4.80
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-DbrjRMa6.cjs → Arrow-D7TkI6Ay.cjs} +1 -1
- package/dist/{Arrow-C7AmfY-d.js → Arrow-HywvQFIb.js} +1 -1
- package/dist/{BaseIcon-CIjjPDqj.cjs → BaseIcon-5jC5U27p.cjs} +1 -1
- package/dist/{BaseIcon-Dzpk4O8L.js → BaseIcon-CL3j-fI9.js} +1 -1
- package/dist/{DataTable-DtRXoetj.js → DataTable-DInI0nyj.js} +2 -2
- package/dist/{DataTable-wN-jvOfe.cjs → DataTable-fHBZCQD_.cjs} +1 -1
- package/dist/{Legend-DqGE1lkA.cjs → Legend-BGxT3Yv0.cjs} +1 -1
- package/dist/{Legend-RnRqBxiV.js → Legend-Ci1axdG_.js} +2 -2
- package/dist/{PackageVersion-CgJdp_Ki.js → PackageVersion-Cchpqacn.js} +1 -1
- package/dist/{PackageVersion-Dn-t7tbm.cjs → PackageVersion-X1kVHC-z.cjs} +1 -1
- package/dist/{PenAndPaper-BTLEk55u.js → PenAndPaper-BKH98f-S.js} +3 -3
- package/dist/{PenAndPaper-DFXJJink.cjs → PenAndPaper-ChPMqRX7.cjs} +1 -1
- package/dist/{Shape-B1fqUhjt.js → Shape-Cvp52J0c.js} +1 -1
- package/dist/{Shape-D7IbPjU8.cjs → Shape-kTprcCU0.cjs} +1 -1
- package/dist/Slicer-BAXp89_0.cjs +1 -0
- package/dist/Slicer-CtV2RLUM.js +546 -0
- package/dist/{Title-D-6pIV0l.cjs → Title-ByUzU0ju.cjs} +1 -1
- package/dist/{Title-XYNHfYwN.js → Title-PkqdmDqN.js} +1 -1
- package/dist/{Tooltip-CNox4F8U.cjs → Tooltip-D0I2_wrW.cjs} +1 -1
- package/dist/{Tooltip-DYRo59nq.js → Tooltip-m3Z3Wlu2.js} +1 -1
- package/dist/{index-B8Eaq54E.js → index-C2mIRYI5.js} +1 -1
- package/dist/{index-KJL8ra_6.cjs → index-DBFjPsZ3.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-Bu958azG.cjs → useNestedProp-C6A3gxy9.cjs} +1 -1
- package/dist/{useNestedProp-Ka0R_Yqa.js → useNestedProp-nx1ZIRNV.js} +1 -1
- package/dist/{usePrinter-D83W2gfG.js → usePrinter-D0_MYOSc.js} +1 -1
- package/dist/{usePrinter-pDOF3CfL.cjs → usePrinter-NpeVna5L.cjs} +1 -1
- package/dist/{vue-data-ui-Ot5xYhbV.cjs → vue-data-ui-DCBYDQ8d.cjs} +1 -1
- package/dist/{vue-data-ui-DgmXnSUU.js → vue-data-ui-DN2kou23.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-CB0XzatQ.cjs → vue-ui-3d-bar-BzqpUiO9.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CqiW8qFZ.js → vue-ui-3d-bar-CX4cgFJW.js} +9 -9
- package/dist/{vue-ui-accordion-4-dyMgJA.cjs → vue-ui-accordion-BB0V98cT.cjs} +1 -1
- package/dist/{vue-ui-accordion--5td7b94.js → vue-ui-accordion-CbgAyykZ.js} +3 -3
- package/dist/{vue-ui-age-pyramid-Bsg0z9ei.js → vue-ui-age-pyramid-DKNcamFG.js} +10 -10
- package/dist/{vue-ui-age-pyramid-DNseB8ej.cjs → vue-ui-age-pyramid-lTOdjMKu.cjs} +1 -1
- package/dist/{vue-ui-annotator-obnYFvvq.js → vue-ui-annotator-CUzQpHGa.js} +1 -1
- package/dist/{vue-ui-annotator-CHjtF8NT.cjs → vue-ui-annotator-pJhAuSac.cjs} +1 -1
- package/dist/{vue-ui-bullet-yKEVhE17.js → vue-ui-bullet-Bthmg1VV.js} +8 -8
- package/dist/{vue-ui-bullet-CNWHd7dO.cjs → vue-ui-bullet-R3ISDQsd.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Cc-Ee4zv.js → vue-ui-candlestick-CvHVfAu7.js} +11 -11
- package/dist/{vue-ui-candlestick-VBq82rfW.cjs → vue-ui-candlestick-KvgWKIaO.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DLwVijSb.cjs → vue-ui-carousel-table-BjjvMcc0.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-B6v1NycN.js → vue-ui-carousel-table-DCi_yXu2.js} +4 -4
- package/dist/{vue-ui-chestnut-CekC1moT.js → vue-ui-chestnut-BckiQcJs.js} +8 -8
- package/dist/{vue-ui-chestnut-DHZbhIf_.cjs → vue-ui-chestnut-Dotk5uHN.cjs} +1 -1
- package/dist/{vue-ui-cursor-Bz-jVx3a.cjs → vue-ui-cursor-C9LwYeDb.cjs} +1 -1
- package/dist/{vue-ui-cursor-CISKzkNu.js → vue-ui-cursor-DE0HZhQL.js} +2 -2
- package/dist/{vue-ui-dashboard-PAi8o4AC.cjs → vue-ui-dashboard-Dp87Gc9L.cjs} +1 -1
- package/dist/{vue-ui-dashboard-w7Ts26Xc.js → vue-ui-dashboard-DtWvVA-k.js} +2 -2
- package/dist/{vue-ui-digits-kaBR5FUU.js → vue-ui-digits-CFjurLzc.js} +2 -2
- package/dist/{vue-ui-digits-I_lj1m6d.cjs → vue-ui-digits-DQA6ixem.cjs} +1 -1
- package/dist/{vue-ui-donut-dDpMdK4G.cjs → vue-ui-donut-DIHfCjBP.cjs} +1 -1
- package/dist/{vue-ui-donut-BVuaExCl.js → vue-ui-donut-DRIPG4qf.js} +12 -12
- package/dist/{vue-ui-donut-evolution-ChGao_WW.cjs → vue-ui-donut-evolution-BrcrheUX.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DAmX1OX-.js → vue-ui-donut-evolution-DfKOKQFY.js} +11 -11
- package/dist/{vue-ui-dumbbell-DsR4RQY9.cjs → vue-ui-dumbbell-CAg1cU2x.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CrQNRN_m.js → vue-ui-dumbbell-Dx6YSKly.js} +10 -10
- package/dist/{vue-ui-flow-B0lCe4G8.js → vue-ui-flow-DOipmqqm.js} +9 -9
- package/dist/{vue-ui-flow-Dhcvvzee.cjs → vue-ui-flow-HuZqv_Mr.cjs} +1 -1
- package/dist/{vue-ui-funnel-Cinv1hUx.js → vue-ui-funnel-CSRH6I73.js} +9 -9
- package/dist/{vue-ui-funnel-Bu_wMJ98.cjs → vue-ui-funnel-ClZWVU3W.cjs} +1 -1
- package/dist/{vue-ui-galaxy-zx6O9AuV.cjs → vue-ui-galaxy-B0Gxsuaj.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BcwunIK3.js → vue-ui-galaxy-vP8xR-K-.js} +11 -11
- package/dist/{vue-ui-gauge-Cb6sxoZI.cjs → vue-ui-gauge-Dr7NdYqP.cjs} +1 -1
- package/dist/{vue-ui-gauge-C4W4OAXQ.js → vue-ui-gauge-QEApv_T5.js} +7 -7
- package/dist/{vue-ui-gizmo-D4VHyFmN.js → vue-ui-gizmo-Cr3L2fkb.js} +3 -3
- package/dist/{vue-ui-gizmo-DBSYx24z.cjs → vue-ui-gizmo-q7PyJf3N.cjs} +1 -1
- package/dist/{vue-ui-heatmap-C3WHfifV.js → vue-ui-heatmap-CY7z5uPC.js} +10 -10
- package/dist/{vue-ui-heatmap-CBNt4Huo.cjs → vue-ui-heatmap-Dlqs0ZRP.cjs} +1 -1
- package/dist/{vue-ui-history-plot-dJp-Lai2.js → vue-ui-history-plot-B0UmKljg.js} +11 -11
- package/dist/{vue-ui-history-plot-Dp8Llb3A.cjs → vue-ui-history-plot-De2TbpxV.cjs} +1 -1
- package/dist/{vue-ui-kpi-B3XhowYx.js → vue-ui-kpi-CR1lNimt.js} +3 -3
- package/dist/{vue-ui-kpi-Dnp8IUyb.cjs → vue-ui-kpi-CdbzO6dm.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Cca7PA4v.js → vue-ui-mini-loader-B2k4Zk3c.js} +2 -2
- package/dist/{vue-ui-mini-loader-BgwhuEda.cjs → vue-ui-mini-loader-DJ2voqOx.cjs} +1 -1
- package/dist/{vue-ui-molecule-B1AocG3H.cjs → vue-ui-molecule-C72LUB1R.cjs} +1 -1
- package/dist/{vue-ui-molecule-BcZNqWfD.js → vue-ui-molecule-DAz6ytsR.js} +11 -11
- package/dist/{vue-ui-mood-radar-HjLL0ZZ8.js → vue-ui-mood-radar-CwFs3yx-.js} +11 -11
- package/dist/{vue-ui-mood-radar-Cn65TQEs.cjs → vue-ui-mood-radar-atwG7SN7.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CymFt4B3.cjs → vue-ui-nested-donuts-CmjvIdjy.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BIqySYG_.js → vue-ui-nested-donuts-CyOGu99e.js} +11 -11
- package/dist/{vue-ui-onion-muCAMEG8.js → vue-ui-onion-D-PSIMqW.js} +11 -11
- package/dist/{vue-ui-onion-BLMFR0GK.cjs → vue-ui-onion-Tcb-YXPb.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DYOlnKPw.js → vue-ui-parallel-coordinate-plot-CSq_ztwh.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-i-hhfnwF.cjs → vue-ui-parallel-coordinate-plot-Do_BYnGv.cjs} +1 -1
- package/dist/{vue-ui-quadrant-TU5fWoEw.js → vue-ui-quadrant-A1-scvDl.js} +12 -12
- package/dist/{vue-ui-quadrant-DJPOp1-A.cjs → vue-ui-quadrant-CFT6mDQf.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DzuUofFN.js → vue-ui-quick-chart-CfAX6N6x.js} +9 -9
- package/dist/{vue-ui-quick-chart-CTJxOisL.cjs → vue-ui-quick-chart-oZu8nE65.cjs} +1 -1
- package/dist/{vue-ui-radar-C0WA20R8.js → vue-ui-radar-BF_X5reX.js} +12 -12
- package/dist/{vue-ui-radar-D4xX7TNQ.cjs → vue-ui-radar-BLIRb8-e.cjs} +1 -1
- package/dist/{vue-ui-rating-C2JILb2g.cjs → vue-ui-rating-BcJxCL9T.cjs} +1 -1
- package/dist/{vue-ui-rating-DUcyhyrN.js → vue-ui-rating-CPhAqTMY.js} +2 -2
- package/dist/{vue-ui-relation-circle-D-Wxskec.cjs → vue-ui-relation-circle-BSq5niUB.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BYlIjbUK.js → vue-ui-relation-circle-C4WtlzjR.js} +7 -7
- package/dist/{vue-ui-rings-w4KQSfym.js → vue-ui-rings-BxKf1fKQ.js} +12 -12
- package/dist/{vue-ui-rings-CsXVOIn3.cjs → vue-ui-rings-D_oSqIee.cjs} +1 -1
- package/dist/{vue-ui-scatter--5Ob2lKM.cjs → vue-ui-scatter-BzNnkurj.cjs} +1 -1
- package/dist/{vue-ui-scatter-CfgCA3Di.js → vue-ui-scatter-Dy-p7Wtu.js} +12 -12
- package/dist/{vue-ui-screenshot-BsD3ySuA.js → vue-ui-screenshot-CgPpGG9k.js} +1 -1
- package/dist/{vue-ui-screenshot-UEVUHXWY.cjs → vue-ui-screenshot-DSmfT3MR.cjs} +1 -1
- package/dist/{vue-ui-skeleton-D_YCUi1y.cjs → vue-ui-skeleton-20TN6Ch2.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DpadzgbS.js → vue-ui-skeleton-Cb2qrhYT.js} +3 -3
- package/dist/{vue-ui-smiley-C32dLhtP.cjs → vue-ui-smiley-DtlSAsdM.cjs} +1 -1
- package/dist/{vue-ui-smiley-BHqeb-Ol.js → vue-ui-smiley-U2CIWUwg.js} +2 -2
- package/dist/{vue-ui-spark-trend-NAcB2zZ1.js → vue-ui-spark-trend-BMtR1Pi0.js} +5 -5
- package/dist/{vue-ui-spark-trend-Bt2wpc5C.cjs → vue-ui-spark-trend-Bdb83Or_.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CgoGRT0_.cjs → vue-ui-sparkbar-C-0M8j8u.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BPpSxe5Z.js → vue-ui-sparkbar-D0VeUaEb.js} +4 -4
- package/dist/{vue-ui-sparkgauge-frN6uK_L.cjs → vue-ui-sparkgauge-BWojoCVe.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-C1mW3KbZ.js → vue-ui-sparkgauge-Hp3ybBWb.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-CqQY434G.cjs → vue-ui-sparkhistogram-DRASXRMH.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-HgBi5OvP.js → vue-ui-sparkhistogram-PvQgia6F.js} +5 -5
- package/dist/{vue-ui-sparkline-BABBXY2c.js → vue-ui-sparkline-CI-MxWXp.js} +4 -4
- package/dist/{vue-ui-sparkline-XOa6LfX2.cjs → vue-ui-sparkline-DthSItEI.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-Ch3JvFBq.js → vue-ui-sparkstackbar-BDw738BK.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-B4Xduiv1.cjs → vue-ui-sparkstackbar-CSPWjjZ9.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CH8tLDZq.cjs → vue-ui-stackbar-C14-7LhJ.cjs} +1 -1
- package/dist/{vue-ui-stackbar-JIEn0g7t.js → vue-ui-stackbar-CMe20-6p.js} +13 -13
- package/dist/{vue-ui-strip-plot-RZu43QbP.js → vue-ui-strip-plot-3V5Roils.js} +11 -11
- package/dist/{vue-ui-strip-plot-BkWzm1mI.cjs → vue-ui-strip-plot-CT6zIUSS.cjs} +1 -1
- package/dist/{vue-ui-table-CgtE4HWs.cjs → vue-ui-table-CwsJHKSJ.cjs} +1 -1
- package/dist/{vue-ui-table-CJ2gGmYi.js → vue-ui-table-LiO7zYPI.js} +1 -1
- package/dist/{vue-ui-table-heatmap-B_TfeHsa.js → vue-ui-table-heatmap-BDydCyHc.js} +4 -4
- package/dist/{vue-ui-table-heatmap-DxTs_PZF.cjs → vue-ui-table-heatmap-Ch3IAca3.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DqMH7xbY.js → vue-ui-table-sparkline-CpMMEuyJ.js} +5 -5
- package/dist/{vue-ui-table-sparkline-PA9L6AjE.cjs → vue-ui-table-sparkline-uRakWvAL.cjs} +1 -1
- package/dist/{vue-ui-thermometer-AwZdEG3j.cjs → vue-ui-thermometer-C1WVxmG2.cjs} +1 -1
- package/dist/{vue-ui-thermometer-D7aR0elr.js → vue-ui-thermometer-ccjAdXXK.js} +7 -7
- package/dist/{vue-ui-timer-C9sO9AoQ.js → vue-ui-timer-Bz5-5ROu.js} +5 -5
- package/dist/{vue-ui-timer-C6fnDeD8.cjs → vue-ui-timer-C4xMxcYZ.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Dje0I1vf.cjs → vue-ui-tiremarks-CpVvaTWi.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-KvOyYNVW.js → vue-ui-tiremarks-N_GjxnG-.js} +7 -7
- package/dist/{vue-ui-treemap-BPxLXNZ5.js → vue-ui-treemap-CaxwLYar.js} +11 -11
- package/dist/{vue-ui-treemap-C2Vrj3tg.cjs → vue-ui-treemap-I3ZJNnqf.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BAdSzbYU.js → vue-ui-vertical-bar-CIFczbF9.js} +12 -12
- package/dist/{vue-ui-vertical-bar-_MWpPkwZ.cjs → vue-ui-vertical-bar-CwOtDK03.cjs} +1 -1
- package/dist/{vue-ui-waffle-DfJI5Lez.cjs → vue-ui-waffle-CMSJBjtH.cjs} +1 -1
- package/dist/{vue-ui-waffle-CW1UVf-q.js → vue-ui-waffle-C_HzXt-Y.js} +12 -12
- package/dist/{vue-ui-wheel-DAwYc7XY.js → vue-ui-wheel-BHszQkHF.js} +7 -7
- package/dist/{vue-ui-wheel-CzZEsjmd.cjs → vue-ui-wheel-CfcHGnt7.cjs} +1 -1
- package/dist/vue-ui-word-cloud-BaTb-aot.cjs +1 -0
- package/dist/{vue-ui-word-cloud-BzfYkI08.js → vue-ui-word-cloud-C0v5gBrv.js} +151 -149
- package/dist/{vue-ui-xy-CJYGMbMt.js → vue-ui-xy-CCXp8odX.js} +14 -14
- package/dist/{vue-ui-xy-BolkwiXB.cjs → vue-ui-xy-CabZW_Ej.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-sB1dmJQc.js → vue-ui-xy-canvas-CdgdK8ol.js} +11 -11
- package/dist/{vue-ui-xy-canvas-DkltjVWN.cjs → vue-ui-xy-canvas-Dk6948dM.cjs} +1 -1
- package/package.json +1 -1
- package/dist/Slicer-8bCK41mN.cjs +0 -1
- package/dist/Slicer-GQf9ZyPj.js +0 -491
- package/dist/vue-ui-word-cloud-BEyV6jMo.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),te=require("./useNestedProp-Bu958azG.cjs"),le=require("./usePrinter-pDOF3CfL.cjs"),ke=require("./PackageVersion-Dn-t7tbm.cjs"),be=require("./Legend-DqGE1lkA.cjs"),Ce=require("./Title-D-6pIV0l.cjs"),Be=require("./Tooltip-CNox4F8U.cjs"),we=require("./DataTable-wN-jvOfe.cjs"),Se=require("./vue-ui-accordion-4-dyMgJA.cjs"),_e=require("./PenAndPaper-DFXJJink.cjs"),Ne=require("./vue-ui-skeleton-D_YCUi1y.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],Ee=["xmlns","viewBox"],Me=["x","y","width","height"],Te={key:1},Ae=["id"],Pe=["stop-color"],Ve=["stop-color"],Fe=["stop-color"],De={key:2},Oe=["x1","x2","y1","y2","stroke","stroke-width"],Ie={key:3},Xe=["x","y","fill","font-size"],Ye=["transform","font-size","fill","font-weight"],qe={key:5},je=["x1","x2","y1","y2","stroke","stroke-width"],Ue={key:6},Re=["transform","fill","font-size","text-anchor"],He=["x","y","font-size","fill","font-weight"],We=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],Ze=["d","stroke","stroke-width"],Je=["d","stroke","stroke-width"],Ke=["cx","cy","fill","r"],Qe=["cx","cy","fill","r","stroke","stroke-width"],et={key:1},tt=["x","y","font-size","fill","font-weight"],lt={key:2},at=["x","y","font-size","font-weight","fill"],ot=["cx","cy","r","onMouseenter","onClick"],st={key:5,class:"vue-data-ui-watermark"},rt=["onClick"],nt=["innerHTML"],it={__name:"vue-ui-history-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(oe,{expose:se,emit:M}){const c=oe,{vue_ui_history_plot:re}=r.useConfig(),k=e.ref(null),T=e.ref(null),A=e.ref(0),P=e.ref(null),V=e.ref(0),F=e.ref(0),D=e.ref(0),B=e.ref(null),O=e.ref(null),b=e.ref(r.createUid()),N=e.ref(!1),z=e.ref(""),h=e.ref([]),w=e.ref(!1),f=e.ref(null),C=e.ref(!1),I=e.ref(null),y=e.computed({get:()=>!!c.dataset&&c.dataset.length,set:l=>l});e.onMounted(X),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});function X(){if(r.objectIsEmpty(c.dataset)?r.error({componentName:"VueUiHistoryPlot",type:"dataset"}):c.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{y.value=!1,r.error({componentName:"VueUiHistoryPlot",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:o,height:a}=ae.useResponsive({chart:k.value,title:t.value.style.chart.title.text?T.value:null,noTitle:O.value,legend:t.value.style.chart.legend.show?P.value:null,source:I.value});v.value.width=o,v.value.height=a,i.value.plots=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.plots.radius,threshold:3,fallback:3}),i.value.indexLabels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.plots.indexLabels.fontSize,threshold:6,fallback:6}),i.value.labels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.plots.labels.fontSize,threshold:6,fallback:6}),i.value.xAxisLabels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.x.labels.fontSize,threshold:6,fallback:6}),i.value.xAxisName=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.x.name.fontSize,threshold:6,fallback:6}),i.value.yAxisLabels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.y.labels.fontSize,threshold:6,fallback:6}),i.value.yAxisName=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.y.name.fontSize,threshold:6,fallback:6})});B.value=new ResizeObserver(l),B.value.observe(k.value.parentNode)}}function Y(){const l=te.useNestedProp({userConfig:c.config,defaultConfig:re});let o={};return l.theme?o={...te.useNestedProp({userConfig:r.themes.vue_ui_history_plot[l.theme]||c.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:o=l,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.x.scaleMin")?o.style.chart.axes.x.scaleMin=c.config.style.chart.axes.x.scaleMin:o.style.chart.axes.x.scaleMin=null,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.x.scaleMax")?o.style.chart.axes.x.scaleMax=c.config.style.chart.axes.x.scaleMax:o.style.chart.axes.x.scaleMax=null,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.y.scaleMin")?o.style.chart.axes.y.scaleMin=c.config.style.chart.axes.y.scaleMin:o.style.chart.axes.y.scaleMin=null,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.y.scaleMax")?o.style.chart.axes.y.scaleMax=c.config.style.chart.axes.y.scaleMax:o.style.chart.axes.y.scaleMax=null,o}const t=e.computed({get:()=>Y(),set:l=>l}),{userOptionsVisible:L,setUserOptionsVisibility:q,keepUserOptionState:j}=ze.useUserOptionState({config:t.value});e.watch(()=>c.config,l=>{t.value=Y(),L.value=!t.value.showOnChartHover,X(),A.value+=1,F.value+=1,V.value+=1,v.value.height=t.value.style.chart.height,v.value.width=t.value.style.chart.width,i.value.plots=t.value.style.chart.plots.radius,i.value.indexLabels=t.value.style.chart.plots.indexLabels.fontSize,i.value.labels=t.value.style.chart.plots.labels.fontSize,i.value.xAxisLabels=t.value.style.chart.axes.x.labels.fontSize,i.value.xAxisName=t.value.style.chart.axes.x.name.fontSize,i.value.yAxisLabels=t.value.style.chart.axes.y.labels.fontSize,i.value.yAxisName=t.value.style.chart.axes.y.name.fontSize},{deep:!0});const{isPrinting:U,isImaging:R,generatePdf:H,generateImage:W}=le.usePrinter({elementId:`history_plot_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-history-plot"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ie=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),v=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),n=e.computed(()=>{const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:v.value.width-t.value.style.chart.padding.right,bottom:v.value.height-t.value.style.chart.padding.bottom,width:v.value.width-l-t.value.style.chart.padding.right,height:v.value.height-o-t.value.style.chart.padding.bottom}}),i=e.ref({plots:t.value.style.chart.plots.radius,indexLabels:t.value.style.chart.plots.indexLabels.fontSize,labels:t.value.style.chart.plots.labels.fontSize,xAxisLabels:t.value.style.chart.axes.x.labels.fontSize,xAxisName:t.value.style.chart.axes.x.name.fontSize,yAxisLabels:t.value.style.chart.axes.y.labels.fontSize,yAxisName:t.value.style.chart.axes.y.name.fontSize}),x=e.computed(()=>y.value?c.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):ie.value[o]||r.palette[o]||r.palette[o%r.palette.length],seriesIndex:o})):[]),ue=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.x))):1),ce=e.computed(()=>{if(!y.value)return 1;const l=Math.min(...x.value.filter(o=>!h.value.includes(o.seriesIndex)).flatMap(o=>o.values.map(a=>a.x)));return l<0?l:0}),ve=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.y))):1),de=e.computed(()=>{if(!y.value)return 1;const l=Math.min(...x.value.filter(o=>!h.value.includes(o.seriesIndex)).flatMap(o=>o.values.map(a=>a.y)));return l<0?l:0}),d=e.computed(()=>{const l=r.calculateNiceScale(t.value.style.chart.axes.x.scaleMin===null?ce.value:t.value.style.chart.axes.x.scaleMin,t.value.style.chart.axes.x.scaleMax===null?ue.value:t.value.style.chart.axes.x.scaleMax,t.value.style.chart.axes.x.ticks),o=r.calculateNiceScale(t.value.style.chart.axes.y.scaleMin===null?de.value:t.value.style.chart.axes.y.scaleMin,t.value.style.chart.axes.y.scaleMax===null?ve.value:t.value.style.chart.axes.y.scaleMax,t.value.style.chart.axes.y.ticks);return{x:l,y:o,tickX:l.ticks.map(a=>({x:n.value.left+(a-l.min)/(l.max-l.min)*n.value.width,y1:n.value.top,y2:n.value.bottom,value:a})),tickY:o.ticks.map(a=>({y:n.value.bottom-(a-o.min)/(o.max-o.min)*n.value.height,x1:n.value.left,x2:n.value.right,value:a}))}});function he(l){const o=d.value.x.min<0?Math.abs(d.value.x.min):d.value.x.min>0?-d.value.x.min:0;return n.value.left+((l||0)+o)/(d.value.x.max+o)*n.value.width}function ye(l){const o=d.value.y.min<0?Math.abs(d.value.y.min):d.value.y.min>0?-d.value.y.min:0;return n.value.bottom-((l||0)+o)/(d.value.y.max+o)*n.value.height}const g=e.computed(()=>x.value.filter(l=>!h.value.includes(l.seriesIndex)).map((l,o)=>{const a=l.values.map((s,p)=>({valueX:s.x,valueY:s.y,label:s.label,x:he(s.x),y:ye(s.y),color:l.color,seriesName:l.name,id:r.createUid()})),u=a.map(s=>`${s.x},${s.y} `).join("").trim();return{...l,plots:a,path:`M${u}`}}));function G(l){h.value.includes(l)?h.value=h.value.filter(o=>o!==l):h.value.push(l)}const Z=e.computed(()=>x.value.map(l=>({...l,opacity:h.value.includes(l.seriesIndex)?.5:1,segregate:()=>G(l.seriesIndex),isSegregated:h.value.includes(l.seriesIndex),shape:"circle"}))),pe=e.computed(()=>({cy:"history-plot-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function fe(l){M("selectDatapoint",l)}function J(l){M("selectLegend",{...l,isSegregated:!l.isSegregated,opacity:l.isSegregated?1:.5})}function me(l){w.value=l,D.value+=1}const $=e.ref(null);function xe({datapoint:l,plotIndex:o,seriesIndex:a}){$.value={datapoint:l,seriesIndex:a,plotIndex:o,config:t.value,series:x.value},f.value=l;const u=t.value.style.chart.tooltip.customFormat;if(C.value=!1,r.isFunction(u))try{const s=u({seriesIndex:a,datapoint:l,plotIndex:o,series:x.value,config:t.value});typeof s=="string"&&(z.value=s,C.value=!0)}catch{console.warn("Custom format cannot be applied."),C.value=!1}if(!C.value){let s="";s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};margin-bottom:3px;padding-bottom:6px;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg><span>${l.seriesName}</span></div>`,s+=`<div>${l.label}</div>`,s+=`<div>${t.value.style.chart.axes.x.name.text||"x"}: ${r.applyDataLabel(t.value.style.chart.axes.x.labels.formatter,l.valueX,r.dataLabel({p:t.value.style.chart.axes.x.labels.prefix,v:l.valueX,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding}))}</div>`,s+=`<div>${t.value.style.chart.axes.y.name.text||"y"}: ${r.applyDataLabel(t.value.style.chart.axes.y.labels.formatter,l.valueY,r.dataLabel({p:t.value.style.chart.axes.y.labels.prefix,v:l.valueY,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))}</div>`,z.value=`<div>${s}</div>`}N.value=!0}e.computed(()=>({head:g.value.map(o=>({name:o.name,color:o.color}))}));const S=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.datapoint,t.value.table.columnNames.x,t.value.table.columnNames.y],o=g.value.flatMap(u=>u.plots.map(s=>[{color:s.color,name:s.seriesName},s.label,r.applyDataLabel(t.value.style.chart.axes.x.labels.formatter,s.valueX,r.dataLabel({p:t.value.style.chart.axes.x.labels.prefix,v:s.valueX,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding})),r.applyDataLabel(t.value.style.chart.axes.y.labels.formatter,s.valueY,r.dataLabel({p:t.value.style.chart.axes.y.labels.prefix,v:s.valueY,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))])),a={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{head:l,body:o,config:a,colNames:l}});function K(){e.nextTick(()=>{const l=[[t.value.table.columnNames.series],[t.value.table.columnNames.datapoint],[t.value.table.columnNames.x],[t.value.table.columnNames.y]],o=g.value.flatMap(s=>s.plots.map(p=>[[p.seriesName],[p.label],[p.valueX],[p.valueY]])),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],l].concat(o),u=r.createCsvContent(a);r.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-history-plot"})})}const _=e.ref(!1);function E(){_.value=!_.value}function Q(){m.value.showTable=!m.value.showTable}function ee(){m.value.showTooltip=!m.value.showTooltip}function ge(){return g.value}return se({getData:ge,generatePdf:H,generateCsv:K,generateImage:W,toggleTable:Q,toggleTooltip:ee,toggleAnnotator:E}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{id:`history_plot_${b.value}`,ref_key:"historyPlotChart",ref:k,class:e.normalizeClass({"vue-ui-history-plot":!0,"vue-data-ui-wrapper-fullscreen":w.value}),style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(q)(!1))},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(_e.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:E},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:O,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:T,class:"vue-ui-xy-title",style:e.normalizeStyle(`font-family:${t.value.style.fontFamily}`)},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"history-plot-div-title",...t.value.style.chart.title},subtitle:{cy:"history-plot-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&y.value&&(e.unref(j)||e.unref(L))?(e.openBlock(),e.createBlock(le.UserOptions,{ref:"details",key:`user_option_${D.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(R),uid:b.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:w.value,chartElement:k.value,position:t.value.userOptions.position,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:me,onGeneratePdf:e.unref(H),onGenerateCsv:K,onGenerateImage:e.unref(W),onToggleTable:Q,onToggleTooltip:ee,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(j)?e.unref(L)?"visible":"hidden":"visible"})},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:a,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:u})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:u})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${v.value.width<0?.1:v.value.width} ${v.value.height<0?.1:v.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ke._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:n.value.left,y:n.value.top,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Me)):e.createCommentVNode("",!0),t.value.style.chart.plots.gradient.show?(e.openBlock(),e.createElementBlock("defs",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,u)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_${u}_${b.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Pe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(a.color,.1)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Fe)],8,Ae))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalLines.show?(e.openBlock(),e.createElementBlock("g",De,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickX,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x,x2:a.x,y1:a.y1,y2:a.y2,stroke:t.value.style.chart.grid.verticalLines.stroke,"stroke-width":t.value.style.chart.grid.verticalLines.strokeWidth,"stroke-linecap":"round"},null,8,Oe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.y.labels.show?(e.openBlock(),e.createElementBlock("g",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickY,a=>(e.openBlock(),e.createElementBlock("text",{x:n.value.left+t.value.style.chart.axes.y.labels.offsetX-4,y:a.y+i.value.yAxisLabels/3,fill:t.value.style.chart.axes.y.labels.color,"font-size":i.value.yAxisLabels,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.axes.y.labels.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.axes.y.labels.prefix,v:a.value,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))),9,Xe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.y.name.text?(e.openBlock(),e.createElementBlock("text",{key:4,transform:`translate(${t.value.style.chart.axes.y.name.offsetX+i.value.yAxisName}, ${v.value.height/2+t.value.style.chart.axes.y.name.offsetY}), rotate(-90)`,"font-size":i.value.yAxisName,fill:t.value.style.chart.axes.y.name.color,"font-weight":t.value.style.chart.axes.y.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.axes.y.name.text),9,Ye)):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalLines.show?(e.openBlock(),e.createElementBlock("g",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickY,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalLines.stroke,"stroke-width":t.value.style.chart.grid.horizontalLines.strokeWidth,"stroke-linecap":"round"},null,8,je))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.x.labels.show?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickX,a=>(e.openBlock(),e.createElementBlock("text",{transform:`translate(${a.x}, ${n.value.bottom+t.value.style.chart.axes.x.labels.offsetY+i.value.xAxisLabels}), rotate(${t.value.style.chart.axes.x.labels.rotation})`,fill:t.value.style.chart.axes.x.labels.color,"font-size":i.value.xAxisLabels,"text-anchor":t.value.style.chart.axes.x.labels.rotation>0?"start":t.value.style.chart.axes.x.labels.rotation<0?"end":"middle"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.axes.x.labels.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.axes.x.labels.prefix,v:a.value,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding}))),9,Re))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.x.name.text?(e.openBlock(),e.createElementBlock("text",{key:7,x:v.value.width/2+t.value.style.chart.axes.x.name.offsetX,y:v.value.height+t.value.style.chart.axes.x.name.offsetY,"font-size":i.value.xAxisName,fill:t.value.style.chart.axes.x.name.color,"font-weight":t.value.style.chart.axes.x.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.axes.x.name.text),9,He)):e.createCommentVNode("",!0),t.value.style.chart.grid.xAxis.show?(e.openBlock(),e.createElementBlock("line",{key:8,x1:n.value.left,x2:n.value.left+n.value.width,y1:n.value.bottom,y2:n.value.bottom,stroke:t.value.style.chart.grid.xAxis.stroke,"stroke-width":t.value.style.chart.grid.xAxis.strokeWidth,"stroke-linecap":"round"},null,8,We)):e.createCommentVNode("",!0),t.value.style.chart.grid.yAxis.show?(e.openBlock(),e.createElementBlock("line",{key:9,x1:n.value.left,x2:n.value.left,y1:n.value.top,y2:n.value.bottom,stroke:t.value.style.chart.grid.yAxis.stroke,"stroke-width":t.value.style.chart.grid.yAxis.strokeWidth,"stroke-linecap":"round"},null,8,Ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,u)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.paths.show?(e.openBlock(),e.createElementBlock("g",{key:0,style:e.normalizeStyle({opacity:f.value===null?1:.3})},[e.createElementVNode("path",{d:a.path,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.paths.strokeWidth+4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Ze),e.createElementVNode("path",{d:a.path,stroke:t.value.style.chart.paths.useSerieColor?a.color:t.value.style.chart.paths.stroke,"stroke-width":t.value.style.chart.paths.strokeWidth,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Je)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,s=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:t.value.style.chart.backgroundColor,r:i.value.plots,stroke:"none"},null,8,Ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,s=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:t.value.style.chart.plots.gradient.show?`url(#gradient_${u}_${b.value})`:s.color,r:i.value.plots,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth,class:e.normalizeClass({animated:t.value.useCssAnimation}),style:e.normalizeStyle({opacity:f.value===null||f.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},null,14,Qe))),256)),t.value.style.chart.plots.labels.show?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,s=>(e.openBlock(),e.createElementBlock("text",{x:s.x+t.value.style.chart.plots.labels.offsetX,y:s.y+t.value.style.chart.plots.labels.offsetY+i.value.plots+i.value.labels,"font-size":i.value.labels,fill:t.value.style.chart.plots.labels.color,"font-weight":t.value.style.chart.plots.labels.bold?"bold":"normal","text-anchor":"middle",class:e.normalizeClass({animated:t.value.useCssAnimation}),style:e.normalizeStyle({opacity:f.value===null||f.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(s.label),15,tt))),256))])):e.createCommentVNode("",!0),t.value.style.chart.plots.indexLabels.show?(e.openBlock(),e.createElementBlock("g",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(s,p)=>(e.openBlock(),e.createElementBlock("text",{x:s.x+t.value.style.chart.plots.indexLabels.offsetX,y:s.y+t.value.style.chart.plots.indexLabels.offsetY+i.value.indexLabels/3,"font-size":i.value.indexLabels,"font-weight":t.value.style.chart.plots.indexLabels.bold?"bold":"normal",fill:t.value.style.chart.plots.indexLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.plots.indexLabels.color,"text-anchor":"middle",class:e.normalizeClass({animated:t.value.useCssAnimation}),style:e.normalizeStyle({opacity:f.value===null||f.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(t.value.style.chart.plots.indexLabels.startAtZero?p:p+1),15,at))),256))])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:"transparent",r:i.value.plots,stroke:"none",onMouseenter:p=>xe({datapoint:u,plotIndex:s,seriesIndex:a.seriesIndex}),onMouseleave:o[0]||(o[0]=p=>{N.value=!1,f.value=null}),onClick:()=>fe(u)},null,40,ot))),256))]))),256)),e.renderSlot(l.$slots,"svg",{svg:v.value},void 0,!0)],12,Ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne.default,{key:6,config:{type:"historyPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,historyPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:P},[t.value.style.chart.legend.show&&y.value?(e.openBlock(),e.createBlock(be.Legend,{key:`legend_${V.value}`,legendSet:Z.value,config:pe.value,onClickMarker:o[1]||(o[1]=({legend:a})=>{G(a.seriesIndex),J(a)})},{item:e.withCtx(({legend:a,index:u})=>[e.createElementVNode("div",{onClick:s=>{a.segregate(),J(a)},style:e.normalizeStyle(`opacity:${h.value.includes(a.seriesIndex)?.5:1}`)},e.toDisplayString(a.name),13,rt)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Z.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:I,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:m.value.showTooltip&&N.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:z.value,isCustom:C.value,isFullscreen:w.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...$.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...$.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","isFullscreen"]),y.value?(e.openBlock(),e.createBlock(Se.default,{key:8,hideDetails:"",config:{open:m.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(we.DataTable,{key:`table_${F.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,nt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},ut=Le._export_sfc(it,[["__scopeId","data-v-df582d76"]]);exports.default=ut;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DBFjPsZ3.cjs"),te=require("./useNestedProp-C6A3gxy9.cjs"),le=require("./usePrinter-NpeVna5L.cjs"),ke=require("./PackageVersion-X1kVHC-z.cjs"),be=require("./Legend-BGxT3Yv0.cjs"),Ce=require("./Title-ByUzU0ju.cjs"),Be=require("./Tooltip-D0I2_wrW.cjs"),we=require("./DataTable-fHBZCQD_.cjs"),Se=require("./vue-ui-accordion-BB0V98cT.cjs"),_e=require("./PenAndPaper-ChPMqRX7.cjs"),Ne=require("./vue-ui-skeleton-20TN6Ch2.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],Ee=["xmlns","viewBox"],Me=["x","y","width","height"],Te={key:1},Ae=["id"],Pe=["stop-color"],Ve=["stop-color"],Fe=["stop-color"],De={key:2},Oe=["x1","x2","y1","y2","stroke","stroke-width"],Ie={key:3},Xe=["x","y","fill","font-size"],Ye=["transform","font-size","fill","font-weight"],qe={key:5},je=["x1","x2","y1","y2","stroke","stroke-width"],Ue={key:6},Re=["transform","fill","font-size","text-anchor"],He=["x","y","font-size","fill","font-weight"],We=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],Ze=["d","stroke","stroke-width"],Je=["d","stroke","stroke-width"],Ke=["cx","cy","fill","r"],Qe=["cx","cy","fill","r","stroke","stroke-width"],et={key:1},tt=["x","y","font-size","fill","font-weight"],lt={key:2},at=["x","y","font-size","font-weight","fill"],ot=["cx","cy","r","onMouseenter","onClick"],st={key:5,class:"vue-data-ui-watermark"},rt=["onClick"],nt=["innerHTML"],it={__name:"vue-ui-history-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(oe,{expose:se,emit:M}){const c=oe,{vue_ui_history_plot:re}=r.useConfig(),k=e.ref(null),T=e.ref(null),A=e.ref(0),P=e.ref(null),V=e.ref(0),F=e.ref(0),D=e.ref(0),B=e.ref(null),O=e.ref(null),b=e.ref(r.createUid()),N=e.ref(!1),z=e.ref(""),h=e.ref([]),w=e.ref(!1),f=e.ref(null),C=e.ref(!1),I=e.ref(null),y=e.computed({get:()=>!!c.dataset&&c.dataset.length,set:l=>l});e.onMounted(X),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});function X(){if(r.objectIsEmpty(c.dataset)?r.error({componentName:"VueUiHistoryPlot",type:"dataset"}):c.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{y.value=!1,r.error({componentName:"VueUiHistoryPlot",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:o,height:a}=ae.useResponsive({chart:k.value,title:t.value.style.chart.title.text?T.value:null,noTitle:O.value,legend:t.value.style.chart.legend.show?P.value:null,source:I.value});v.value.width=o,v.value.height=a,i.value.plots=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.plots.radius,threshold:3,fallback:3}),i.value.indexLabels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.plots.indexLabels.fontSize,threshold:6,fallback:6}),i.value.labels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.plots.labels.fontSize,threshold:6,fallback:6}),i.value.xAxisLabels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.x.labels.fontSize,threshold:6,fallback:6}),i.value.xAxisName=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.x.name.fontSize,threshold:6,fallback:6}),i.value.yAxisLabels=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.y.labels.fontSize,threshold:6,fallback:6}),i.value.yAxisName=r.translateSize({relator:Math.min(o,a),adjuster:600,source:t.value.style.chart.axes.y.name.fontSize,threshold:6,fallback:6})});B.value=new ResizeObserver(l),B.value.observe(k.value.parentNode)}}function Y(){const l=te.useNestedProp({userConfig:c.config,defaultConfig:re});let o={};return l.theme?o={...te.useNestedProp({userConfig:r.themes.vue_ui_history_plot[l.theme]||c.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:o=l,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.x.scaleMin")?o.style.chart.axes.x.scaleMin=c.config.style.chart.axes.x.scaleMin:o.style.chart.axes.x.scaleMin=null,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.x.scaleMax")?o.style.chart.axes.x.scaleMax=c.config.style.chart.axes.x.scaleMax:o.style.chart.axes.x.scaleMax=null,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.y.scaleMin")?o.style.chart.axes.y.scaleMin=c.config.style.chart.axes.y.scaleMin:o.style.chart.axes.y.scaleMin=null,c.config&&r.hasDeepProperty(c.config,"style.chart.axes.y.scaleMax")?o.style.chart.axes.y.scaleMax=c.config.style.chart.axes.y.scaleMax:o.style.chart.axes.y.scaleMax=null,o}const t=e.computed({get:()=>Y(),set:l=>l}),{userOptionsVisible:L,setUserOptionsVisibility:q,keepUserOptionState:j}=ze.useUserOptionState({config:t.value});e.watch(()=>c.config,l=>{t.value=Y(),L.value=!t.value.showOnChartHover,X(),A.value+=1,F.value+=1,V.value+=1,v.value.height=t.value.style.chart.height,v.value.width=t.value.style.chart.width,i.value.plots=t.value.style.chart.plots.radius,i.value.indexLabels=t.value.style.chart.plots.indexLabels.fontSize,i.value.labels=t.value.style.chart.plots.labels.fontSize,i.value.xAxisLabels=t.value.style.chart.axes.x.labels.fontSize,i.value.xAxisName=t.value.style.chart.axes.x.name.fontSize,i.value.yAxisLabels=t.value.style.chart.axes.y.labels.fontSize,i.value.yAxisName=t.value.style.chart.axes.y.name.fontSize},{deep:!0});const{isPrinting:U,isImaging:R,generatePdf:H,generateImage:W}=le.usePrinter({elementId:`history_plot_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-history-plot"}),ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ie=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),v=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),n=e.computed(()=>{const l=t.value.style.chart.padding.left,o=t.value.style.chart.padding.top;return{left:l,top:o,right:v.value.width-t.value.style.chart.padding.right,bottom:v.value.height-t.value.style.chart.padding.bottom,width:v.value.width-l-t.value.style.chart.padding.right,height:v.value.height-o-t.value.style.chart.padding.bottom}}),i=e.ref({plots:t.value.style.chart.plots.radius,indexLabels:t.value.style.chart.plots.indexLabels.fontSize,labels:t.value.style.chart.plots.labels.fontSize,xAxisLabels:t.value.style.chart.axes.x.labels.fontSize,xAxisName:t.value.style.chart.axes.x.name.fontSize,yAxisLabels:t.value.style.chart.axes.y.labels.fontSize,yAxisName:t.value.style.chart.axes.y.name.fontSize}),x=e.computed(()=>y.value?c.dataset.map((l,o)=>({...l,color:l.color?r.convertColorToHex(l.color):ie.value[o]||r.palette[o]||r.palette[o%r.palette.length],seriesIndex:o})):[]),ue=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.x))):1),ce=e.computed(()=>{if(!y.value)return 1;const l=Math.min(...x.value.filter(o=>!h.value.includes(o.seriesIndex)).flatMap(o=>o.values.map(a=>a.x)));return l<0?l:0}),ve=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.y))):1),de=e.computed(()=>{if(!y.value)return 1;const l=Math.min(...x.value.filter(o=>!h.value.includes(o.seriesIndex)).flatMap(o=>o.values.map(a=>a.y)));return l<0?l:0}),d=e.computed(()=>{const l=r.calculateNiceScale(t.value.style.chart.axes.x.scaleMin===null?ce.value:t.value.style.chart.axes.x.scaleMin,t.value.style.chart.axes.x.scaleMax===null?ue.value:t.value.style.chart.axes.x.scaleMax,t.value.style.chart.axes.x.ticks),o=r.calculateNiceScale(t.value.style.chart.axes.y.scaleMin===null?de.value:t.value.style.chart.axes.y.scaleMin,t.value.style.chart.axes.y.scaleMax===null?ve.value:t.value.style.chart.axes.y.scaleMax,t.value.style.chart.axes.y.ticks);return{x:l,y:o,tickX:l.ticks.map(a=>({x:n.value.left+(a-l.min)/(l.max-l.min)*n.value.width,y1:n.value.top,y2:n.value.bottom,value:a})),tickY:o.ticks.map(a=>({y:n.value.bottom-(a-o.min)/(o.max-o.min)*n.value.height,x1:n.value.left,x2:n.value.right,value:a}))}});function he(l){const o=d.value.x.min<0?Math.abs(d.value.x.min):d.value.x.min>0?-d.value.x.min:0;return n.value.left+((l||0)+o)/(d.value.x.max+o)*n.value.width}function ye(l){const o=d.value.y.min<0?Math.abs(d.value.y.min):d.value.y.min>0?-d.value.y.min:0;return n.value.bottom-((l||0)+o)/(d.value.y.max+o)*n.value.height}const g=e.computed(()=>x.value.filter(l=>!h.value.includes(l.seriesIndex)).map((l,o)=>{const a=l.values.map((s,p)=>({valueX:s.x,valueY:s.y,label:s.label,x:he(s.x),y:ye(s.y),color:l.color,seriesName:l.name,id:r.createUid()})),u=a.map(s=>`${s.x},${s.y} `).join("").trim();return{...l,plots:a,path:`M${u}`}}));function G(l){h.value.includes(l)?h.value=h.value.filter(o=>o!==l):h.value.push(l)}const Z=e.computed(()=>x.value.map(l=>({...l,opacity:h.value.includes(l.seriesIndex)?.5:1,segregate:()=>G(l.seriesIndex),isSegregated:h.value.includes(l.seriesIndex),shape:"circle"}))),pe=e.computed(()=>({cy:"history-plot-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function fe(l){M("selectDatapoint",l)}function J(l){M("selectLegend",{...l,isSegregated:!l.isSegregated,opacity:l.isSegregated?1:.5})}function me(l){w.value=l,D.value+=1}const $=e.ref(null);function xe({datapoint:l,plotIndex:o,seriesIndex:a}){$.value={datapoint:l,seriesIndex:a,plotIndex:o,config:t.value,series:x.value},f.value=l;const u=t.value.style.chart.tooltip.customFormat;if(C.value=!1,r.isFunction(u))try{const s=u({seriesIndex:a,datapoint:l,plotIndex:o,series:x.value,config:t.value});typeof s=="string"&&(z.value=s,C.value=!0)}catch{console.warn("Custom format cannot be applied."),C.value=!1}if(!C.value){let s="";s+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};margin-bottom:3px;padding-bottom:6px;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg><span>${l.seriesName}</span></div>`,s+=`<div>${l.label}</div>`,s+=`<div>${t.value.style.chart.axes.x.name.text||"x"}: ${r.applyDataLabel(t.value.style.chart.axes.x.labels.formatter,l.valueX,r.dataLabel({p:t.value.style.chart.axes.x.labels.prefix,v:l.valueX,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding}))}</div>`,s+=`<div>${t.value.style.chart.axes.y.name.text||"y"}: ${r.applyDataLabel(t.value.style.chart.axes.y.labels.formatter,l.valueY,r.dataLabel({p:t.value.style.chart.axes.y.labels.prefix,v:l.valueY,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))}</div>`,z.value=`<div>${s}</div>`}N.value=!0}e.computed(()=>({head:g.value.map(o=>({name:o.name,color:o.color}))}));const S=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.datapoint,t.value.table.columnNames.x,t.value.table.columnNames.y],o=g.value.flatMap(u=>u.plots.map(s=>[{color:s.color,name:s.seriesName},s.label,r.applyDataLabel(t.value.style.chart.axes.x.labels.formatter,s.valueX,r.dataLabel({p:t.value.style.chart.axes.x.labels.prefix,v:s.valueX,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding})),r.applyDataLabel(t.value.style.chart.axes.y.labels.formatter,s.valueY,r.dataLabel({p:t.value.style.chart.axes.y.labels.prefix,v:s.valueY,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))])),a={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{head:l,body:o,config:a,colNames:l}});function K(){e.nextTick(()=>{const l=[[t.value.table.columnNames.series],[t.value.table.columnNames.datapoint],[t.value.table.columnNames.x],[t.value.table.columnNames.y]],o=g.value.flatMap(s=>s.plots.map(p=>[[p.seriesName],[p.label],[p.valueX],[p.valueY]])),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],l].concat(o),u=r.createCsvContent(a);r.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-history-plot"})})}const _=e.ref(!1);function E(){_.value=!_.value}function Q(){m.value.showTable=!m.value.showTable}function ee(){m.value.showTooltip=!m.value.showTooltip}function ge(){return g.value}return se({getData:ge,generatePdf:H,generateCsv:K,generateImage:W,toggleTable:Q,toggleTooltip:ee,toggleAnnotator:E}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{id:`history_plot_${b.value}`,ref_key:"historyPlotChart",ref:k,class:e.normalizeClass({"vue-ui-history-plot":!0,"vue-data-ui-wrapper-fullscreen":w.value}),style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(q)(!1))},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(_e.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:E},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:O,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:T,class:"vue-ui-xy-title",style:e.normalizeStyle(`font-family:${t.value.style.fontFamily}`)},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"history-plot-div-title",...t.value.style.chart.title},subtitle:{cy:"history-plot-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&y.value&&(e.unref(j)||e.unref(L))?(e.openBlock(),e.createBlock(le.UserOptions,{ref:"details",key:`user_option_${D.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(R),uid:b.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:w.value,chartElement:k.value,position:t.value.userOptions.position,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:me,onGeneratePdf:e.unref(H),onGenerateCsv:K,onGenerateImage:e.unref(W),onToggleTable:Q,onToggleTooltip:ee,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(j)?e.unref(L)?"visible":"hidden":"visible"})},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:a,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:u})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:u})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${v.value.width<0?.1:v.value.width} ${v.value.height<0?.1:v.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ke._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:n.value.left,y:n.value.top,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Me)):e.createCommentVNode("",!0),t.value.style.chart.plots.gradient.show?(e.openBlock(),e.createElementBlock("defs",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,u)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_${u}_${b.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Pe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(a.color,.1)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Fe)],8,Ae))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalLines.show?(e.openBlock(),e.createElementBlock("g",De,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickX,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x,x2:a.x,y1:a.y1,y2:a.y2,stroke:t.value.style.chart.grid.verticalLines.stroke,"stroke-width":t.value.style.chart.grid.verticalLines.strokeWidth,"stroke-linecap":"round"},null,8,Oe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.y.labels.show?(e.openBlock(),e.createElementBlock("g",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickY,a=>(e.openBlock(),e.createElementBlock("text",{x:n.value.left+t.value.style.chart.axes.y.labels.offsetX-4,y:a.y+i.value.yAxisLabels/3,fill:t.value.style.chart.axes.y.labels.color,"font-size":i.value.yAxisLabels,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.axes.y.labels.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.axes.y.labels.prefix,v:a.value,s:t.value.style.chart.axes.y.labels.suffix,r:t.value.style.chart.axes.y.labels.rounding}))),9,Xe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.y.name.text?(e.openBlock(),e.createElementBlock("text",{key:4,transform:`translate(${t.value.style.chart.axes.y.name.offsetX+i.value.yAxisName}, ${v.value.height/2+t.value.style.chart.axes.y.name.offsetY}), rotate(-90)`,"font-size":i.value.yAxisName,fill:t.value.style.chart.axes.y.name.color,"font-weight":t.value.style.chart.axes.y.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.axes.y.name.text),9,Ye)):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalLines.show?(e.openBlock(),e.createElementBlock("g",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickY,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalLines.stroke,"stroke-width":t.value.style.chart.grid.horizontalLines.strokeWidth,"stroke-linecap":"round"},null,8,je))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.x.labels.show?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tickX,a=>(e.openBlock(),e.createElementBlock("text",{transform:`translate(${a.x}, ${n.value.bottom+t.value.style.chart.axes.x.labels.offsetY+i.value.xAxisLabels}), rotate(${t.value.style.chart.axes.x.labels.rotation})`,fill:t.value.style.chart.axes.x.labels.color,"font-size":i.value.xAxisLabels,"text-anchor":t.value.style.chart.axes.x.labels.rotation>0?"start":t.value.style.chart.axes.x.labels.rotation<0?"end":"middle"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.axes.x.labels.formatter,a.value,e.unref(r.dataLabel)({p:t.value.style.chart.axes.x.labels.prefix,v:a.value,s:t.value.style.chart.axes.x.labels.suffix,r:t.value.style.chart.axes.x.labels.rounding}))),9,Re))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.x.name.text?(e.openBlock(),e.createElementBlock("text",{key:7,x:v.value.width/2+t.value.style.chart.axes.x.name.offsetX,y:v.value.height+t.value.style.chart.axes.x.name.offsetY,"font-size":i.value.xAxisName,fill:t.value.style.chart.axes.x.name.color,"font-weight":t.value.style.chart.axes.x.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.axes.x.name.text),9,He)):e.createCommentVNode("",!0),t.value.style.chart.grid.xAxis.show?(e.openBlock(),e.createElementBlock("line",{key:8,x1:n.value.left,x2:n.value.left+n.value.width,y1:n.value.bottom,y2:n.value.bottom,stroke:t.value.style.chart.grid.xAxis.stroke,"stroke-width":t.value.style.chart.grid.xAxis.strokeWidth,"stroke-linecap":"round"},null,8,We)):e.createCommentVNode("",!0),t.value.style.chart.grid.yAxis.show?(e.openBlock(),e.createElementBlock("line",{key:9,x1:n.value.left,x2:n.value.left,y1:n.value.top,y2:n.value.bottom,stroke:t.value.style.chart.grid.yAxis.stroke,"stroke-width":t.value.style.chart.grid.yAxis.strokeWidth,"stroke-linecap":"round"},null,8,Ge)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,u)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.paths.show?(e.openBlock(),e.createElementBlock("g",{key:0,style:e.normalizeStyle({opacity:f.value===null?1:.3})},[e.createElementVNode("path",{d:a.path,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.paths.strokeWidth+4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Ze),e.createElementVNode("path",{d:a.path,stroke:t.value.style.chart.paths.useSerieColor?a.color:t.value.style.chart.paths.stroke,"stroke-width":t.value.style.chart.paths.strokeWidth,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Je)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,s=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:t.value.style.chart.backgroundColor,r:i.value.plots,stroke:"none"},null,8,Ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,s=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:t.value.style.chart.plots.gradient.show?`url(#gradient_${u}_${b.value})`:s.color,r:i.value.plots,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth,class:e.normalizeClass({animated:t.value.useCssAnimation}),style:e.normalizeStyle({opacity:f.value===null||f.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},null,14,Qe))),256)),t.value.style.chart.plots.labels.show?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,s=>(e.openBlock(),e.createElementBlock("text",{x:s.x+t.value.style.chart.plots.labels.offsetX,y:s.y+t.value.style.chart.plots.labels.offsetY+i.value.plots+i.value.labels,"font-size":i.value.labels,fill:t.value.style.chart.plots.labels.color,"font-weight":t.value.style.chart.plots.labels.bold?"bold":"normal","text-anchor":"middle",class:e.normalizeClass({animated:t.value.useCssAnimation}),style:e.normalizeStyle({opacity:f.value===null||f.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(s.label),15,tt))),256))])):e.createCommentVNode("",!0),t.value.style.chart.plots.indexLabels.show?(e.openBlock(),e.createElementBlock("g",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(s,p)=>(e.openBlock(),e.createElementBlock("text",{x:s.x+t.value.style.chart.plots.indexLabels.offsetX,y:s.y+t.value.style.chart.plots.indexLabels.offsetY+i.value.indexLabels/3,"font-size":i.value.indexLabels,"font-weight":t.value.style.chart.plots.indexLabels.bold?"bold":"normal",fill:t.value.style.chart.plots.indexLabels.adaptColorToBackground?e.unref(r.adaptColorToBackground)(a.color):t.value.style.chart.plots.indexLabels.color,"text-anchor":"middle",class:e.normalizeClass({animated:t.value.useCssAnimation}),style:e.normalizeStyle({opacity:f.value===null||f.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(t.value.style.chart.plots.indexLabels.startAtZero?p:p+1),15,at))),256))])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:"transparent",r:i.value.plots,stroke:"none",onMouseenter:p=>xe({datapoint:u,plotIndex:s,seriesIndex:a.seriesIndex}),onMouseleave:o[0]||(o[0]=p=>{N.value=!1,f.value=null}),onClick:()=>fe(u)},null,40,ot))),256))]))),256)),e.renderSlot(l.$slots,"svg",{svg:v.value},void 0,!0)],12,Ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(R)})),void 0,!0)])):e.createCommentVNode("",!0),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ne.default,{key:6,config:{type:"historyPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,historyPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:P},[t.value.style.chart.legend.show&&y.value?(e.openBlock(),e.createBlock(be.Legend,{key:`legend_${V.value}`,legendSet:Z.value,config:pe.value,onClickMarker:o[1]||(o[1]=({legend:a})=>{G(a.seriesIndex),J(a)})},{item:e.withCtx(({legend:a,index:u})=>[e.createElementVNode("div",{onClick:s=>{a.segregate(),J(a)},style:e.normalizeStyle(`opacity:${h.value.includes(a.seriesIndex)?.5:1}`)},e.toDisplayString(a.name),13,rt)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Z.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:I,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:m.value.showTooltip&&N.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:z.value,isCustom:C.value,isFullscreen:w.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...$.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...$.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","isFullscreen"]),y.value?(e.openBlock(),e.createBlock(Se.default,{key:8,hideDetails:"",config:{open:m.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(we.DataTable,{key:`table_${F.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,nt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,$e))}},ut=Le._export_sfc(it,[["__scopeId","data-v-df582d76"]]);exports.default=ut;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as D, useSlots as x, onMounted as g, watch as C, ref as $, openBlock as i, createElementBlock as s, normalizeClass as r, normalizeStyle as u, createElementVNode as k, renderSlot as n, createTextVNode as y, toDisplayString as h, createVNode as z, Fragment as A, unref as b } from "vue";
|
|
2
|
-
import { u as w } from "./useNestedProp-
|
|
3
|
-
import { u as B, i as L, f as M } from "./index-
|
|
4
|
-
import E from "./vue-ui-digits-
|
|
2
|
+
import { u as w } from "./useNestedProp-nx1ZIRNV.js";
|
|
3
|
+
import { u as B, i as L, f as M } from "./index-C2mIRYI5.js";
|
|
4
|
+
import E from "./vue-ui-digits-CFjurLzc.js";
|
|
5
5
|
const G = {
|
|
6
6
|
__name: "vue-ui-kpi",
|
|
7
7
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./useNestedProp-C6A3gxy9.cjs"),u=require("./index-DBFjPsZ3.cjs"),y=require("./vue-ui-digits-DQA6ixem.cjs"),C={__name:"vue-ui-kpi",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(n){const o=n,{vue_ui_kpi:m}=u.useConfig(),a=e.computed({get:()=>i(),set:t=>t}),f=e.useSlots();e.onMounted(()=>{f["chart-background"]&&console.warn("VueUiKpi does not support the #chart-background slot.")});function i(){return p.useNestedProp({userConfig:o.config,defaultConfig:m})}e.watch(()=>o.config,t=>{a.value=i(),r()},{deep:!0});const g=e.ref((typeof o.dataset=="number",o.dataset)),l=e.ref(a.value.useAnimation?a.value.animationValueStart:g.value),s=t=>{const v=a.value.animationFrames,c=Math.abs(t-l.value)/v;function d(){l.value<t?l.value=Math.min(l.value+c,t):l.value>t&&(l.value=Math.max(l.value-c,t)),l.value!==t&&requestAnimationFrame(d)}d()};e.onMounted(()=>{r()});function r(){a.value.useAnimation?(l.value=a.value.animationValueStart,s(o.dataset)):l.value=o.dataset}return e.watch(()=>o.dataset,t=>{a.value.useAnimation?s(t):l.value=t}),(t,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-kpi ${a.value.layoutClass}`),style:e.normalizeStyle(`background:${a.value.backgroundColor}; ${a.value.layoutCss}`)},[e.createElementVNode("div",{class:e.normalizeClass(`vue-ui-kpi-title ${a.value.titleClass}`),style:e.normalizeStyle(`font-family: ${a.value.fontFamily}; font-size:${a.value.titleFontSize}px; color:${a.value.titleColor}; font-weight:${a.value.titleBold?"bold":"normal"}; ${a.value.titleCss}`)},[e.renderSlot(t.$slots,"title",{comment:n.dataset}),e.createTextVNode(" "+e.toDisplayString(a.value.title),1)],6),e.renderSlot(t.$slots,"comment-before",{comment:n.dataset}),e.createElementVNode("div",{class:e.normalizeClass(`vue-ui-kpi-value ${a.value.valueClass}`),style:e.normalizeStyle(`font-family: ${a.value.fontFamily}; font-size:${a.value.valueFontSize}px; color:${a.value.valueColor}; font-weight:${a.value.valueBold?"bold":"normal"}; ${a.value.valueCss}`)},[e.renderSlot(t.$slots,"value",{comment:n.dataset}),a.value.analogDigits.show?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:a.value.analogDigits.height+"px"})},[e.createVNode(y.default,{dataset:Number(l.value.toFixed(a.value.valueRounding)),config:{backgroundColor:a.value.backgroundColor,digits:{color:a.value.analogDigits.color,skeletonColor:a.value.analogDigits.skeletonColor}}},null,8,["dataset","config"])],4)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(u.applyDataLabel)(a.value.formatter,l.value,e.unref(u.dataLabel)({p:a.value.prefix,v:l.value,s:a.value.suffix,r:a.value.valueRounding}))),1)],64))],6),e.renderSlot(t.$slots,"comment-after",{comment:n.dataset})],6))}};exports.default=C;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCssVars as h, computed as r, ref as f, openBlock as n, createElementBlock as u, unref as M, createElementVNode as t, normalizeStyle as l, createCommentVNode as a } from "vue";
|
|
2
|
-
import { u as m } from "./useNestedProp-
|
|
3
|
-
import { u as y, X as L } from "./index-
|
|
2
|
+
import { u as m } from "./useNestedProp-nx1ZIRNV.js";
|
|
3
|
+
import { u as y, X as L } from "./index-C2mIRYI5.js";
|
|
4
4
|
import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const b = ["xmlns", "viewBox"], x = { key: 0 }, $ = ["stroke"], w = ["stroke"], A = ["stroke"], N = { key: 1 }, O = ["stroke"], S = { key: 2 }, F = ["stroke"], I = {
|
|
6
6
|
__name: "vue-ui-mini-loader",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("./useNestedProp-C6A3gxy9.cjs"),n=require("./index-DBFjPsZ3.cjs"),m=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g=["xmlns","viewBox"],C={key:0},_=["stroke"],h=["stroke"],M=["stroke"],y={key:1},B=["stroke"],f={key:2},L=["stroke"],b={__name:"vue-ui-mini-loader",props:{config:{type:Object,default(){return{}}}},setup(u){const a=u;e.useCssVars(k=>({"221651ee":c.value,d11bae38:d.value,d85c00de:p.value}));const{vue_ui_mini_loader:i}=n.useConfig(),t=e.computed(()=>v.useNestedProp({userConfig:a.config,defaultConfig:i})),s=e.ref({onion:"-10 -10 84 84",line:"-10 -10 112 84",bar:"-10 -10 106 84"}),r=e.computed(()=>({gutter:`stroke:${t.value.line.gutterColor};opacity:${t.value.line.gutterOpacity};`,gutterBlur:`filter:blur(${t.value.line.gutterBlur}px);`})),l=e.computed(()=>({gutter:`stroke:${t.value.bar.gutterColor};opacity:${t.value.bar.gutterOpacity};`,gutterBlur:`filter:blur(${t.value.bar.gutterBlur}px);`})),o=e.computed(()=>({gutter:`stroke:${t.value.onion.gutterColor};opacity:${t.value.onion.gutterOpacity};`,gutterBlur:`filter:blur(${t.value.onion.gutterBlur}px);`})),c=e.computed(()=>`blur(${t.value.onion.trackBlur}px) hue-rotate(${t.value.onion.trackHueRotate}deg)`),d=e.computed(()=>`blur(${t.value.line.trackBlur}px) hue-rotate(${t.value.line.trackHueRotate}deg)`),p=e.computed(()=>`blur(${t.value.bar.trackBlur}px) hue-rotate(${t.value.bar.trackHueRotate}deg)`);return(k,x)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.XMLNS),viewBox:s.value[t.value.type],style:{background:"transparent"},width:"100%"},[t.value.type==="onion"?(e.openBlock(),e.createElementBlock("g",C,[e.createElementVNode("path",{d:"M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3","stroke-width":"4",fill:"none","stroke-linecap":"round",style:e.normalizeStyle(o.value.gutter+o.value.gutterBlur)},null,4),e.createElementVNode("path",{d:"M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13","stroke-width":"4",fill:"none","stroke-linecap":"round",style:e.normalizeStyle(o.value.gutter+o.value.gutterBlur)},null,4),e.createElementVNode("path",{d:"M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25","stroke-width":"4",fill:"none","stroke-linecap":"round",style:e.normalizeStyle(o.value.gutter+o.value.gutterBlur)},null,4),e.createElementVNode("path",{d:"M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3",stroke:t.value.onion.trackColor,"stroke-width":"4",fill:"none","stroke-linecap":"round",class:"onion-animated"},null,8,_),e.createElementVNode("path",{d:"M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13",stroke:t.value.onion.trackColor,"stroke-width":"4",fill:"none","stroke-linecap":"round",class:"onion-animated"},null,8,h),e.createElementVNode("path",{d:"M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25",stroke:t.value.onion.trackColor,"stroke-width":"4",fill:"none","stroke-linecap":"round",class:"onion-animated"},null,8,M)])):e.createCommentVNode("",!0),t.value.type==="line"?(e.openBlock(),e.createElementBlock("g",y,[e.createElementVNode("path",{d:"M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5","stroke-width":"4",fill:"none","stroke-linecap":"round",style:e.normalizeStyle(r.value.gutter+r.value.gutterBlur)},null,4),e.createElementVNode("path",{d:"M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5",stroke:t.value.line.trackColor,"stroke-width":"4",fill:"none","stroke-linecap":"round",class:"line-animated"},null,8,B)])):e.createCommentVNode("",!0),t.value.type==="bar"?(e.openBlock(),e.createElementBlock("g",f,[e.createElementVNode("path",{d:"M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5","stroke-width":"4",fill:"none","stroke-linecap":"round",style:e.normalizeStyle(l.value.gutter+l.value.gutterBlur)},null,4),e.createElementVNode("path",{d:"M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5",stroke:t.value.bar.trackColor,"stroke-width":"4",fill:"none","stroke-linecap":"round",class:"bar-animated"},null,8,L)])):e.createCommentVNode("",!0)],8,g))}},N=m._export_sfc(b,[["__scopeId","data-v-20f54e0e"]]);exports.default=N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("./index-KJL8ra_6.cjs"),Le=require("./Title-D-6pIV0l.cjs"),pe=require("./usePrinter-pDOF3CfL.cjs"),Oe=require("./DataTable-wN-jvOfe.cjs"),ze=require("./Tooltip-CNox4F8U.cjs"),O=require("./BaseIcon-CIjjPDqj.cjs"),Ue=require("./vue-ui-skeleton-D_YCUi1y.cjs"),Me=require("./vue-ui-accordion-4-dyMgJA.cjs"),fe=require("./useNestedProp-Bu958azG.cjs"),De=require("./PackageVersion-Dn-t7tbm.cjs"),Ae=require("./PenAndPaper-DFXJJink.cjs"),Ie=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),qe=["cx","cy","r","fill","stroke","stroke-width","onClick","onMouseover"],je={__name:"RecursiveCircles",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null},linkColor:{type:String,default:"#CCCCCC"},stroke:{type:String,default:"#FFFFFF"},strokeHovered:{type:String,default:"#000000"}},emits:["zoom","hover"],setup(r,{emit:g}){const h=r;function u(a){g("zoom",a)}function c(a){g("hover",a)}return e.toRef(h,"dataset").value.forEach(a=>{a.nodes&&a.nodes.length>0&&a.nodes.forEach(d=>{d.ancestor=a})}),(a,d)=>{const B=e.resolveComponent("RecursiveCircles",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,v=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.polygonPath&&v.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.polygonPath.coordinates,(x,z)=>(e.openBlock(),e.createElementBlock("circle",{cx:x.x,cy:x.y,r:v.circleRadius,fill:`url(#gradient_${v.color})`,stroke:r.hoveredUid&&r.hoveredUid===v.uid?r.strokeHovered:r.stroke,"stroke-width":r.hoveredUid&&r.hoveredUid===v.uid?v.circleRadius/6:v.circleRadius/12,style:{cursor:"pointer"},onClick:e.withModifiers($=>u(v),["stop"]),onMouseover:$=>c(v),onMouseleave:d[0]||(d[0]=$=>c(null))},null,40,qe))),256)),v.nodes&&v.nodes.length>0?(e.openBlock(),e.createBlock(B,{key:0,dataset:v.nodes,color:r.color,stroke:r.stroke,strokeHovered:r.strokeHovered,hoveredUid:r.hoveredUid,onZoom:u,onHover:c},null,8,["dataset","color","stroke","strokeHovered","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Ge=["x1","y1","x2","y2","stroke","stroke-width"],Xe=["x1","y1","x2","y2","stroke","stroke-width"],Ye={__name:"RecursiveLinks",props:{dataset:{type:Array,default:()=>[]},color:{type:String,default:"#DDDDDD"},backgroundColor:{type:String,default:"#FFFFFF"}},setup(r){const g=r;return e.toRef(g,"dataset").value.forEach(u=>{u.nodes&&u.nodes.length>0&&u.nodes.forEach(c=>{c.ancestor=u})}),(u,c)=>{const w=e.resolveComponent("RecursiveLinks",!0);return e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.polygonPath.coordinates,(d,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.ancestor&&a.ancestor.polygonPath?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("line",{x1:d.x,y1:d.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:r.backgroundColor,"stroke-width":a.circleRadius/1.5},null,8,Ge),e.createElementVNode("line",{x1:d.x,y1:d.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:r.color,"stroke-width":a.circleRadius/2},null,8,Xe)],64)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.nodes&&a.nodes.length>0?(e.openBlock(),e.createBlock(w,{key:0,dataset:a.nodes,color:r.color,backgroundColor:r.backgroundColor},null,8,["dataset","color","backgroundColor"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256))],64)}}},We=["x","y","fill","font-size"],Ze={__name:"RecursiveLabels",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null}},emits:["zoom","hover"],setup(r,{emit:g}){const h=r;return e.toRef(h,"dataset").value.forEach(c=>{c.nodes&&c.nodes.length>0&&c.nodes.forEach(w=>{w.ancestor=c})}),(c,w)=>{const a=e.resolveComponent("RecursiveLabels",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,d=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[d.polygonPath&&d.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.polygonPath.coordinates,B=>(e.openBlock(),e.createElementBlock("text",{x:B.x,y:B.y+d.circleRadius*2,fill:r.color,"font-size":d.circleRadius,"text-anchor":"middle",style:{opacity:"0.8","pointer-events":"none"}},e.toDisplayString(d.name),9,We))),256)),d.nodes&&d.nodes.length>0?(e.openBlock(),e.createBlock(a,{key:0,dataset:d.nodes,color:r.color,hoveredUid:r.hoveredUid},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Je={style:{position:"relative",height:"100%",width:"100%"}},Ke={__name:"BaseDirectionPad",props:{color:{type:String,default:"#FF0000"},isFullscreen:{type:Boolean,default:!1}},emits:["moveLeft","moveTop","moveRight","moveBottom","reset"],setup(r,{emit:g}){return(h,u)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`position: ${r.isFullscreen?"fixed":"absolute"};bottom:0;right:${r.isFullscreen?"12px":"0"};width:80px;height:80px`),"data-html2canvas-ignore":""},[e.createElementVNode("div",Je,[e.createElementVNode("button",{onClick:u[0]||(u[0]=e.withModifiers(c=>g("moveLeft"),["stop"])),style:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowLeft",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[1]||(u[1]=e.withModifiers(c=>g("moveTop"),["stop"])),style:{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowTop",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[2]||(u[2]=e.withModifiers(c=>g("moveRight"),["stop"])),style:{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowRight",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[3]||(u[3]=e.withModifiers(c=>g("moveBottom"),["stop"])),style:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowBottom",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[4]||(u[4]=e.withModifiers(c=>g("reset"),["stop"])),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"close",style:{cursor:"pointer"},strokeWidth:2},null,8,["stroke"])])])],4))}},Qe=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},et={key:2,style:"width:100%;background:transparent;"},tt=["xmlns","viewBox"],ot=["width","height"],lt=["id"],nt=["stop-color"],rt=["stop-color"],at={key:6,class:"vue-data-ui-watermark"},st={key:8,ref:"source",dir:"auto"},it=["innerHTML"],ut={__name:"vue-ui-molecule",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(r,{expose:g}){const h=r,{vue_ui_molecule:u}=m.useConfig(),c=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{w()});function w(){m.objectIsEmpty(h.dataset)&&m.error({componentName:"VueUiMolecule",type:"dataset"})}const a=e.ref(m.createUid()),d=e.ref(null),B=e.ref(!1),v=e.ref(""),x=e.ref(null),z=e.ref(null),$=e.ref(!1),k=e.ref(null),Z=e.ref(null),D=e.ref(0),J=e.ref(0),K=e.ref(0),o=e.computed({get:()=>ee(),set:t=>t}),{userOptionsVisible:A,setUserOptionsVisibility:Q,keepUserOptionState:_}=Ie.useUserOptionState({config:o.value});function ee(){const t=fe.useNestedProp({userConfig:h.config,defaultConfig:u});return t.theme?{...fe.useNestedProp({userConfig:m.themes.vue_ui_molecule[t.theme]||h.config,defaultConfig:t}),customPalette:m.themePalettes[t.theme]||m.palette}:t}e.watch(()=>h.config,t=>{o.value=ee(),A.value=!o.value.showOnChartHover,w(),J.value+=1,K.value+=1},{deep:!0});const{isPrinting:te,isImaging:oe,generatePdf:le,generateImage:ne}=pe.usePrinter({elementId:`cluster_${a.value}`,fileName:o.value.style.chart.title.text||"vue-ui-molecule"}),me=e.computed(()=>o.value.userOptions.show&&!o.value.style.chart.title.text),he=e.computed(()=>m.convertCustomPalette(o.value.customPalette)),b=e.ref({showTable:o.value.table.show,showDataLabels:!0,showTooltip:o.value.style.chart.tooltip.show});function re(t,l=0){return Array.isArray(t)&&t.length>0&&t[0].nodes?re(t[0].nodes,l+1):l}function ge(){const t=re(h.dataset);let l=100,n=l;for(let i=0;i<t;i+=1)l/=1,n+=l;return{height:n,width:n}}const y=e.ref(ge()),I=e.ref(`0 0 ${y.value.width} ${y.value.height}`);function ae(t,l={x:-y.value.width/2.43,y:y.value.height/2},n=y.value.width/1.1,i=24,s=0,p=0,V="#BBBBBB"){if(t&&t.length>0){const Y=m.createPolygonPath({plot:l,radius:n,sides:t.length,rotation:s});t.forEach((f,F)=>{const R=Y.coordinates[F];let P;if(f.ancestor?f.ancestor.ancestor?P=f.ancestor.color||V:(P=he.value[p]||m.palette[p]||V,p+=1):P=V,f.polygonPath={coordinates:[R]},f.circleRadius=i,f.color=P,f.uid=m.createUid(),f.nodes&&f.nodes.length>0){const W=!f.ancestor||!f.ancestor.ancestor?p:0;f.nodes=ae(f.nodes,R,n/2.9,i/2.2,s+Math.PI*F/f.nodes.length,W,P)}})}return t}function ye(t){const l=new Set;function n(s){s.forEach(p=>{p.color&&!l.has(p.color)&&l.add(p.color),p.nodes&&p.nodes.length>0&&n(p.nodes)})}n(t);const i={};return Array.from(l).forEach((s,p)=>{i[s]=`gradient_${p}`}),i}const ke=e.computed(()=>ye(C.value)),C=e.computed(()=>ae(h.dataset));function H(){$.value=!1,z.value=null,Z.value=null,k.value=null,j({polygonPath:{coordinates:[{x:y.value.width/2,y:y.value.height/2}]},circleRadius:24})}const q=e.ref(null);function j(t){x.value.focus(),e.nextTick(()=>{q.value&&cancelAnimationFrame(q.value);const l=I.value.split(" "),n=parseFloat(l[0]),i=parseFloat(l[1]),s=parseFloat(l[2]),p=parseFloat(l[3]),{x:V,y:Y}=t.polygonPath.coordinates[0],{circleRadius:f}=t,F=8.34,R=V-f*F,P=Y-f*F,W=f*F*2,Ne=f*F*2,Ee=Math.sqrt((R-n)**2+(P-i)**2),L=Math.min(1200,Math.max(20,Math.floor(Ee/10))),Te=(R-n)/L,Se=(P-i)/L,Ve=(W-s)/L,Re=(Ne-p)/L;let T=0;function ve(){I.value=`${n+Te*T} ${i+Se*T} ${s+Ve*T} ${p+Re*T}`,T+=o.value.style.chart.zoom.speed,T<=L&&(q.value=requestAnimationFrame(ve))}ve()})}function be(t){z.value===t.uid?H():(z.value=t.uid,Z.value=t,k.value={circleRadius:t.circleRadius,polygonPath:{coordinates:[{x:t.polygonPath.coordinates[0].x,y:t.polygonPath.coordinates[0].y}]}},j(t),$.value=t.uid!==C.value[0].uid)}function Ce(t){if(t.target.nodeName!=="circle")H(),$.value=!1;else return}const G=e.ref(null);function Be(t){G.value={datapoint:t,seriesIndex:-1,series:C.value,config:o.value};const l=o.value.style.chart.tooltip.customFormat;if(m.isFunction(l)&&m.functionReturnsString(()=>l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value})))v.value=l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value});else{let n="";n+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${t.color}">⬤</div><div>${t.name}</div></div>`,t.details&&(n+=`<div style="width:100%;border-top:1px solid ${o.value.style.chart.tooltip.borderColor};margin-top: 2px">${t.details}</div>`),v.value=`<div style="font-family:inherit">${n}</div>`}}const se=e.ref(null),S=e.ref(null);function we(t){se.value=t,t?(B.value=!0,Be(t),S.value=t.uid):(B.value=!1,v.value="",S.value=null)}function U(t){t==="right"&&(k.value.polygonPath.coordinates[0].x+=k.value.circleRadius),t==="left"&&(k.value.polygonPath.coordinates[0].x-=k.value.circleRadius),t==="top"&&(k.value.polygonPath.coordinates[0].y-=k.value.circleRadius),t==="bottom"&&(k.value.polygonPath.coordinates[0].y+=k.value.circleRadius),j(k.value)}function xe(t){const l=[];function n(i){i.forEach(s=>{const p={name:s.name,details:s.details||"-",ancestor:s.ancestor&&s.ancestor.name||"-",color:s.color||""};l.push(p),s.nodes&&s.nodes.length>0&&n(s.nodes,s.name)})}return n(t),l}const $e=e.computed(()=>xe(C.value)),N=e.computed(()=>{const t=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor],l=$e.value.map((s,p)=>[{color:s.color,name:s.name},s.details,s.ancestor||""]),n={th:{backgroundColor:o.value.table.th.backgroundColor,color:o.value.table.th.color,outline:o.value.table.th.outline},td:{backgroundColor:o.value.table.td.backgroundColor,color:o.value.table.td.color,outline:o.value.table.td.outline},breakpoint:o.value.table.responsiveBreakpoint},i=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor];return{head:t,body:l,config:n,colNames:i}});function ie(){e.nextTick(()=>{const t=N.value.body.map((i,s)=>[[i[0].name],[i[1]],[i[2]]]),l=[[o.value.style.chart.title.text],[o.value.style.chart.title.subtitle.text],[[...N.value.head]]].concat(t),n=m.createCsvContent(l);m.downloadCsv({csvContent:n,title:o.value.style.chart.title.text||"vue-ui-molecule"})})}function Pe(){return C.value}const E=e.ref(!1);function Fe(t){E.value=t,D.value+=1}function ue(){b.value.showTable=!b.value.showTable}function ce(){b.value.showDataLabels=!b.value.showDataLabels}function de(){b.value.showTooltip=!b.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return g({getData:Pe,generatePdf:le,generateCsv:ie,generateImage:ne,toggleTable:ue,toggleLabels:ce,toggleTooltip:de,toggleAnnotator:X}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"moleculeChart",ref:x,class:e.normalizeClass(`vue-ui-molecule ${E.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${o.value.style.fontFamily};width:100%; text-align:center;background:${o.value.style.chart.backgroundColor}`),id:`cluster_${a.value}`,onMouseleave:l[7]||(l[7]=n=>{se.value=null,S.value=null,e.unref(Q)(!1)}),onMouseenter:l[8]||(l[8]=()=>e.unref(Q)(!0))},[o.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:x.value,backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color,active:M.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),me.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),o.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",et,[(e.openBlock(),e.createBlock(Le._sfc_main,{key:`title_${J.value}`,config:{title:{cy:"molecule-div-title",...o.value.style.chart.title},subtitle:{cy:"molecule-div-subtitle",...o.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),o.value.userOptions.show&&c.value&&(e.unref(_)||e.unref(A))?(e.openBlock(),e.createBlock(pe.UserOptions,{ref_key:"details",ref:d,key:`user_options_${D.value}`,backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color,isPrinting:e.unref(te),isImaging:e.unref(oe),uid:a.value,hasTooltip:o.value.userOptions.buttons.tooltip&&o.value.style.chart.tooltip.show,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasTable:o.value.userOptions.buttons.table,hasLabel:o.value.userOptions.buttons.labels,hasFullscreen:o.value.userOptions.buttons.fullscreen,isTooltip:b.value.showTooltip,titles:{...o.value.userOptions.buttonTitles},chartElement:x.value,position:o.value.userOptions.position,hasAnnotator:o.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Fe,onGeneratePdf:e.unref(le),onGenerateCsv:ie,onGenerateImage:e.unref(ne),onToggleTable:ue,onToggleLabels:ce,onToggleTooltip:de,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(_)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,t.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,t.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:i})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:i})),void 0,!0)]),key:"6"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:i})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:i})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(m.XMLNS),viewBox:I.value,class:e.normalizeClass({"vue-data-ui-fullscreen--on":E.value,"vue-data-ui-fulscreen--off":!E.value}),style:e.normalizeStyle(`overflow: hidden; background:transparent;color:${o.value.style.chart.color}`),onClick:l[0]||(l[0]=e.withModifiers(n=>Ce(n),["stop"]))},[e.createVNode(De._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:y.value.width<=0?10:y.value.width,height:y.value.height<=0?10:y.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,ot)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(ke.value),n=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_${n}`,cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(m.lightenHexColor)(n,.5)},null,8,nt),e.createElementVNode("stop",{offset:"100%","stop-color":n},null,8,rt)],8,lt))),256))]),e.createVNode(Ye,{dataset:C.value,color:o.value.style.chart.links.stroke,backgroundColor:o.value.style.chart.backgroundColor},null,8,["dataset","color","backgroundColor"]),e.createVNode(je,{dataset:C.value,hoveredUid:S.value,stroke:o.value.style.chart.nodes.stroke,strokeHovered:o.value.style.chart.nodes.strokeHovered,onZoom:be,onHover:we},null,8,["dataset","hoveredUid","stroke","strokeHovered"]),b.value.showDataLabels?(e.openBlock(),e.createBlock(Ze,{key:1,dataset:C.value,color:o.value.style.chart.color,hoveredUid:S.value},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"svg",{svg:y.value},void 0,!0)],14,tt)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createBlock(Ke,{key:`direction_pad_${D.value}`,color:o.value.style.chart.color,isFullscreen:E.value,onMoveLeft:l[1]||(l[1]=n=>U("left")),onMoveRight:l[2]||(l[2]=n=>U("right")),onMoveTop:l[3]||(l[3]=n=>U("top")),onMoveBottom:l[4]||(l[4]=n=>U("bottom")),onReset:l[5]||(l[5]=n=>{H(),$.value=!1})},null,8,["color","isFullscreen"])):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(te)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ue.default,{key:7,config:{type:"molecule",style:{backgroundColor:o.value.style.chart.backgroundColor,molecule:{color:"#CCCCCC"}}}},null,8,["config"])),t.$slots.source?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:b.value.showTooltip&&B.value,backgroundColor:o.value.style.chart.tooltip.backgroundColor,color:o.value.style.chart.tooltip.color,borderRadius:o.value.style.chart.tooltip.borderRadius,borderColor:o.value.style.chart.tooltip.borderColor,borderWidth:o.value.style.chart.tooltip.borderWidth,fontSize:o.value.style.chart.tooltip.fontSize,backgroundOpacity:o.value.style.chart.tooltip.backgroundOpacity,position:o.value.style.chart.tooltip.position,offsetY:o.value.style.chart.tooltip.offsetY,parent:x.value,content:v.value,isFullscreen:E.value,isCustom:o.value.style.chart.tooltip.customFormat&&typeof o.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),c.value?(e.openBlock(),e.createBlock(Me.default,{key:9,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color},head:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Oe.DataTable,{key:`table_${K.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${o.value.style.chart.title.text}${o.value.style.chart.title.subtitle.text?` : ${o.value.style.chart.title.subtitle.text}`:""}`,onClose:l[6]||(l[6]=n=>b.value.showTable=!1)},{th:e.withCtx(({th:n})=>[e.createElementVNode("div",{innerHTML:n,style:{display:"flex","align-items":"center"}},null,8,it)]),td:e.withCtx(({td:n})=>[e.createTextVNode(e.toDisplayString(n.name||n),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Qe))}},ct=He._export_sfc(ut,[["__scopeId","data-v-84f8e29e"]]);exports.default=ct;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("./index-DBFjPsZ3.cjs"),Le=require("./Title-ByUzU0ju.cjs"),pe=require("./usePrinter-NpeVna5L.cjs"),Oe=require("./DataTable-fHBZCQD_.cjs"),ze=require("./Tooltip-D0I2_wrW.cjs"),O=require("./BaseIcon-5jC5U27p.cjs"),Ue=require("./vue-ui-skeleton-20TN6Ch2.cjs"),Me=require("./vue-ui-accordion-BB0V98cT.cjs"),fe=require("./useNestedProp-C6A3gxy9.cjs"),De=require("./PackageVersion-X1kVHC-z.cjs"),Ae=require("./PenAndPaper-ChPMqRX7.cjs"),Ie=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),qe=["cx","cy","r","fill","stroke","stroke-width","onClick","onMouseover"],je={__name:"RecursiveCircles",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null},linkColor:{type:String,default:"#CCCCCC"},stroke:{type:String,default:"#FFFFFF"},strokeHovered:{type:String,default:"#000000"}},emits:["zoom","hover"],setup(r,{emit:g}){const h=r;function u(a){g("zoom",a)}function c(a){g("hover",a)}return e.toRef(h,"dataset").value.forEach(a=>{a.nodes&&a.nodes.length>0&&a.nodes.forEach(d=>{d.ancestor=a})}),(a,d)=>{const B=e.resolveComponent("RecursiveCircles",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,v=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.polygonPath&&v.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.polygonPath.coordinates,(x,z)=>(e.openBlock(),e.createElementBlock("circle",{cx:x.x,cy:x.y,r:v.circleRadius,fill:`url(#gradient_${v.color})`,stroke:r.hoveredUid&&r.hoveredUid===v.uid?r.strokeHovered:r.stroke,"stroke-width":r.hoveredUid&&r.hoveredUid===v.uid?v.circleRadius/6:v.circleRadius/12,style:{cursor:"pointer"},onClick:e.withModifiers($=>u(v),["stop"]),onMouseover:$=>c(v),onMouseleave:d[0]||(d[0]=$=>c(null))},null,40,qe))),256)),v.nodes&&v.nodes.length>0?(e.openBlock(),e.createBlock(B,{key:0,dataset:v.nodes,color:r.color,stroke:r.stroke,strokeHovered:r.strokeHovered,hoveredUid:r.hoveredUid,onZoom:u,onHover:c},null,8,["dataset","color","stroke","strokeHovered","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Ge=["x1","y1","x2","y2","stroke","stroke-width"],Xe=["x1","y1","x2","y2","stroke","stroke-width"],Ye={__name:"RecursiveLinks",props:{dataset:{type:Array,default:()=>[]},color:{type:String,default:"#DDDDDD"},backgroundColor:{type:String,default:"#FFFFFF"}},setup(r){const g=r;return e.toRef(g,"dataset").value.forEach(u=>{u.nodes&&u.nodes.length>0&&u.nodes.forEach(c=>{c.ancestor=u})}),(u,c)=>{const w=e.resolveComponent("RecursiveLinks",!0);return e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.polygonPath.coordinates,(d,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.ancestor&&a.ancestor.polygonPath?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("line",{x1:d.x,y1:d.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:r.backgroundColor,"stroke-width":a.circleRadius/1.5},null,8,Ge),e.createElementVNode("line",{x1:d.x,y1:d.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:r.color,"stroke-width":a.circleRadius/2},null,8,Xe)],64)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.nodes&&a.nodes.length>0?(e.openBlock(),e.createBlock(w,{key:0,dataset:a.nodes,color:r.color,backgroundColor:r.backgroundColor},null,8,["dataset","color","backgroundColor"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256))],64)}}},We=["x","y","fill","font-size"],Ze={__name:"RecursiveLabels",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null}},emits:["zoom","hover"],setup(r,{emit:g}){const h=r;return e.toRef(h,"dataset").value.forEach(c=>{c.nodes&&c.nodes.length>0&&c.nodes.forEach(w=>{w.ancestor=c})}),(c,w)=>{const a=e.resolveComponent("RecursiveLabels",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataset,d=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[d.polygonPath&&d.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.polygonPath.coordinates,B=>(e.openBlock(),e.createElementBlock("text",{x:B.x,y:B.y+d.circleRadius*2,fill:r.color,"font-size":d.circleRadius,"text-anchor":"middle",style:{opacity:"0.8","pointer-events":"none"}},e.toDisplayString(d.name),9,We))),256)),d.nodes&&d.nodes.length>0?(e.openBlock(),e.createBlock(a,{key:0,dataset:d.nodes,color:r.color,hoveredUid:r.hoveredUid},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Je={style:{position:"relative",height:"100%",width:"100%"}},Ke={__name:"BaseDirectionPad",props:{color:{type:String,default:"#FF0000"},isFullscreen:{type:Boolean,default:!1}},emits:["moveLeft","moveTop","moveRight","moveBottom","reset"],setup(r,{emit:g}){return(h,u)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`position: ${r.isFullscreen?"fixed":"absolute"};bottom:0;right:${r.isFullscreen?"12px":"0"};width:80px;height:80px`),"data-html2canvas-ignore":""},[e.createElementVNode("div",Je,[e.createElementVNode("button",{onClick:u[0]||(u[0]=e.withModifiers(c=>g("moveLeft"),["stop"])),style:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowLeft",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[1]||(u[1]=e.withModifiers(c=>g("moveTop"),["stop"])),style:{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowTop",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[2]||(u[2]=e.withModifiers(c=>g("moveRight"),["stop"])),style:{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowRight",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[3]||(u[3]=e.withModifiers(c=>g("moveBottom"),["stop"])),style:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"arrowBottom",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[4]||(u[4]=e.withModifiers(c=>g("reset"),["stop"])),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(O.default,{stroke:r.color,name:"close",style:{cursor:"pointer"},strokeWidth:2},null,8,["stroke"])])])],4))}},Qe=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},et={key:2,style:"width:100%;background:transparent;"},tt=["xmlns","viewBox"],ot=["width","height"],lt=["id"],nt=["stop-color"],rt=["stop-color"],at={key:6,class:"vue-data-ui-watermark"},st={key:8,ref:"source",dir:"auto"},it=["innerHTML"],ut={__name:"vue-ui-molecule",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(r,{expose:g}){const h=r,{vue_ui_molecule:u}=m.useConfig(),c=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{w()});function w(){m.objectIsEmpty(h.dataset)&&m.error({componentName:"VueUiMolecule",type:"dataset"})}const a=e.ref(m.createUid()),d=e.ref(null),B=e.ref(!1),v=e.ref(""),x=e.ref(null),z=e.ref(null),$=e.ref(!1),k=e.ref(null),Z=e.ref(null),D=e.ref(0),J=e.ref(0),K=e.ref(0),o=e.computed({get:()=>ee(),set:t=>t}),{userOptionsVisible:A,setUserOptionsVisibility:Q,keepUserOptionState:_}=Ie.useUserOptionState({config:o.value});function ee(){const t=fe.useNestedProp({userConfig:h.config,defaultConfig:u});return t.theme?{...fe.useNestedProp({userConfig:m.themes.vue_ui_molecule[t.theme]||h.config,defaultConfig:t}),customPalette:m.themePalettes[t.theme]||m.palette}:t}e.watch(()=>h.config,t=>{o.value=ee(),A.value=!o.value.showOnChartHover,w(),J.value+=1,K.value+=1},{deep:!0});const{isPrinting:te,isImaging:oe,generatePdf:le,generateImage:ne}=pe.usePrinter({elementId:`cluster_${a.value}`,fileName:o.value.style.chart.title.text||"vue-ui-molecule"}),me=e.computed(()=>o.value.userOptions.show&&!o.value.style.chart.title.text),he=e.computed(()=>m.convertCustomPalette(o.value.customPalette)),b=e.ref({showTable:o.value.table.show,showDataLabels:!0,showTooltip:o.value.style.chart.tooltip.show});function re(t,l=0){return Array.isArray(t)&&t.length>0&&t[0].nodes?re(t[0].nodes,l+1):l}function ge(){const t=re(h.dataset);let l=100,n=l;for(let i=0;i<t;i+=1)l/=1,n+=l;return{height:n,width:n}}const y=e.ref(ge()),I=e.ref(`0 0 ${y.value.width} ${y.value.height}`);function ae(t,l={x:-y.value.width/2.43,y:y.value.height/2},n=y.value.width/1.1,i=24,s=0,p=0,V="#BBBBBB"){if(t&&t.length>0){const Y=m.createPolygonPath({plot:l,radius:n,sides:t.length,rotation:s});t.forEach((f,F)=>{const R=Y.coordinates[F];let P;if(f.ancestor?f.ancestor.ancestor?P=f.ancestor.color||V:(P=he.value[p]||m.palette[p]||V,p+=1):P=V,f.polygonPath={coordinates:[R]},f.circleRadius=i,f.color=P,f.uid=m.createUid(),f.nodes&&f.nodes.length>0){const W=!f.ancestor||!f.ancestor.ancestor?p:0;f.nodes=ae(f.nodes,R,n/2.9,i/2.2,s+Math.PI*F/f.nodes.length,W,P)}})}return t}function ye(t){const l=new Set;function n(s){s.forEach(p=>{p.color&&!l.has(p.color)&&l.add(p.color),p.nodes&&p.nodes.length>0&&n(p.nodes)})}n(t);const i={};return Array.from(l).forEach((s,p)=>{i[s]=`gradient_${p}`}),i}const ke=e.computed(()=>ye(C.value)),C=e.computed(()=>ae(h.dataset));function H(){$.value=!1,z.value=null,Z.value=null,k.value=null,j({polygonPath:{coordinates:[{x:y.value.width/2,y:y.value.height/2}]},circleRadius:24})}const q=e.ref(null);function j(t){x.value.focus(),e.nextTick(()=>{q.value&&cancelAnimationFrame(q.value);const l=I.value.split(" "),n=parseFloat(l[0]),i=parseFloat(l[1]),s=parseFloat(l[2]),p=parseFloat(l[3]),{x:V,y:Y}=t.polygonPath.coordinates[0],{circleRadius:f}=t,F=8.34,R=V-f*F,P=Y-f*F,W=f*F*2,Ne=f*F*2,Ee=Math.sqrt((R-n)**2+(P-i)**2),L=Math.min(1200,Math.max(20,Math.floor(Ee/10))),Te=(R-n)/L,Se=(P-i)/L,Ve=(W-s)/L,Re=(Ne-p)/L;let T=0;function ve(){I.value=`${n+Te*T} ${i+Se*T} ${s+Ve*T} ${p+Re*T}`,T+=o.value.style.chart.zoom.speed,T<=L&&(q.value=requestAnimationFrame(ve))}ve()})}function be(t){z.value===t.uid?H():(z.value=t.uid,Z.value=t,k.value={circleRadius:t.circleRadius,polygonPath:{coordinates:[{x:t.polygonPath.coordinates[0].x,y:t.polygonPath.coordinates[0].y}]}},j(t),$.value=t.uid!==C.value[0].uid)}function Ce(t){if(t.target.nodeName!=="circle")H(),$.value=!1;else return}const G=e.ref(null);function Be(t){G.value={datapoint:t,seriesIndex:-1,series:C.value,config:o.value};const l=o.value.style.chart.tooltip.customFormat;if(m.isFunction(l)&&m.functionReturnsString(()=>l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value})))v.value=l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value});else{let n="";n+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${t.color}">⬤</div><div>${t.name}</div></div>`,t.details&&(n+=`<div style="width:100%;border-top:1px solid ${o.value.style.chart.tooltip.borderColor};margin-top: 2px">${t.details}</div>`),v.value=`<div style="font-family:inherit">${n}</div>`}}const se=e.ref(null),S=e.ref(null);function we(t){se.value=t,t?(B.value=!0,Be(t),S.value=t.uid):(B.value=!1,v.value="",S.value=null)}function U(t){t==="right"&&(k.value.polygonPath.coordinates[0].x+=k.value.circleRadius),t==="left"&&(k.value.polygonPath.coordinates[0].x-=k.value.circleRadius),t==="top"&&(k.value.polygonPath.coordinates[0].y-=k.value.circleRadius),t==="bottom"&&(k.value.polygonPath.coordinates[0].y+=k.value.circleRadius),j(k.value)}function xe(t){const l=[];function n(i){i.forEach(s=>{const p={name:s.name,details:s.details||"-",ancestor:s.ancestor&&s.ancestor.name||"-",color:s.color||""};l.push(p),s.nodes&&s.nodes.length>0&&n(s.nodes,s.name)})}return n(t),l}const $e=e.computed(()=>xe(C.value)),N=e.computed(()=>{const t=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor],l=$e.value.map((s,p)=>[{color:s.color,name:s.name},s.details,s.ancestor||""]),n={th:{backgroundColor:o.value.table.th.backgroundColor,color:o.value.table.th.color,outline:o.value.table.th.outline},td:{backgroundColor:o.value.table.td.backgroundColor,color:o.value.table.td.color,outline:o.value.table.td.outline},breakpoint:o.value.table.responsiveBreakpoint},i=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor];return{head:t,body:l,config:n,colNames:i}});function ie(){e.nextTick(()=>{const t=N.value.body.map((i,s)=>[[i[0].name],[i[1]],[i[2]]]),l=[[o.value.style.chart.title.text],[o.value.style.chart.title.subtitle.text],[[...N.value.head]]].concat(t),n=m.createCsvContent(l);m.downloadCsv({csvContent:n,title:o.value.style.chart.title.text||"vue-ui-molecule"})})}function Pe(){return C.value}const E=e.ref(!1);function Fe(t){E.value=t,D.value+=1}function ue(){b.value.showTable=!b.value.showTable}function ce(){b.value.showDataLabels=!b.value.showDataLabels}function de(){b.value.showTooltip=!b.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return g({getData:Pe,generatePdf:le,generateCsv:ie,generateImage:ne,toggleTable:ue,toggleLabels:ce,toggleTooltip:de,toggleAnnotator:X}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"moleculeChart",ref:x,class:e.normalizeClass(`vue-ui-molecule ${E.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${o.value.style.fontFamily};width:100%; text-align:center;background:${o.value.style.chart.backgroundColor}`),id:`cluster_${a.value}`,onMouseleave:l[7]||(l[7]=n=>{se.value=null,S.value=null,e.unref(Q)(!1)}),onMouseenter:l[8]||(l[8]=()=>e.unref(Q)(!0))},[o.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:x.value,backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color,active:M.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),me.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),o.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",et,[(e.openBlock(),e.createBlock(Le._sfc_main,{key:`title_${J.value}`,config:{title:{cy:"molecule-div-title",...o.value.style.chart.title},subtitle:{cy:"molecule-div-subtitle",...o.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),o.value.userOptions.show&&c.value&&(e.unref(_)||e.unref(A))?(e.openBlock(),e.createBlock(pe.UserOptions,{ref_key:"details",ref:d,key:`user_options_${D.value}`,backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color,isPrinting:e.unref(te),isImaging:e.unref(oe),uid:a.value,hasTooltip:o.value.userOptions.buttons.tooltip&&o.value.style.chart.tooltip.show,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasTable:o.value.userOptions.buttons.table,hasLabel:o.value.userOptions.buttons.labels,hasFullscreen:o.value.userOptions.buttons.fullscreen,isTooltip:b.value.showTooltip,titles:{...o.value.userOptions.buttonTitles},chartElement:x.value,position:o.value.userOptions.position,hasAnnotator:o.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Fe,onGeneratePdf:e.unref(le),onGenerateCsv:ie,onGenerateImage:e.unref(ne),onToggleTable:ue,onToggleLabels:ce,onToggleTooltip:de,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(_)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,t.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,t.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:i})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:i})),void 0,!0)]),key:"6"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:i})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:i})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(m.XMLNS),viewBox:I.value,class:e.normalizeClass({"vue-data-ui-fullscreen--on":E.value,"vue-data-ui-fulscreen--off":!E.value}),style:e.normalizeStyle(`overflow: hidden; background:transparent;color:${o.value.style.chart.color}`),onClick:l[0]||(l[0]=e.withModifiers(n=>Ce(n),["stop"]))},[e.createVNode(De._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:y.value.width<=0?10:y.value.width,height:y.value.height<=0?10:y.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,ot)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(ke.value),n=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_${n}`,cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(m.lightenHexColor)(n,.5)},null,8,nt),e.createElementVNode("stop",{offset:"100%","stop-color":n},null,8,rt)],8,lt))),256))]),e.createVNode(Ye,{dataset:C.value,color:o.value.style.chart.links.stroke,backgroundColor:o.value.style.chart.backgroundColor},null,8,["dataset","color","backgroundColor"]),e.createVNode(je,{dataset:C.value,hoveredUid:S.value,stroke:o.value.style.chart.nodes.stroke,strokeHovered:o.value.style.chart.nodes.strokeHovered,onZoom:be,onHover:we},null,8,["dataset","hoveredUid","stroke","strokeHovered"]),b.value.showDataLabels?(e.openBlock(),e.createBlock(Ze,{key:1,dataset:C.value,color:o.value.style.chart.color,hoveredUid:S.value},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"svg",{svg:y.value},void 0,!0)],14,tt)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createBlock(Ke,{key:`direction_pad_${D.value}`,color:o.value.style.chart.color,isFullscreen:E.value,onMoveLeft:l[1]||(l[1]=n=>U("left")),onMoveRight:l[2]||(l[2]=n=>U("right")),onMoveTop:l[3]||(l[3]=n=>U("top")),onMoveBottom:l[4]||(l[4]=n=>U("bottom")),onReset:l[5]||(l[5]=n=>{H(),$.value=!1})},null,8,["color","isFullscreen"])):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(te)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ue.default,{key:7,config:{type:"molecule",style:{backgroundColor:o.value.style.chart.backgroundColor,molecule:{color:"#CCCCCC"}}}},null,8,["config"])),t.$slots.source?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:b.value.showTooltip&&B.value,backgroundColor:o.value.style.chart.tooltip.backgroundColor,color:o.value.style.chart.tooltip.color,borderRadius:o.value.style.chart.tooltip.borderRadius,borderColor:o.value.style.chart.tooltip.borderColor,borderWidth:o.value.style.chart.tooltip.borderWidth,fontSize:o.value.style.chart.tooltip.fontSize,backgroundOpacity:o.value.style.chart.tooltip.backgroundOpacity,position:o.value.style.chart.tooltip.position,offsetY:o.value.style.chart.tooltip.offsetY,parent:x.value,content:v.value,isFullscreen:E.value,isCustom:o.value.style.chart.tooltip.customFormat&&typeof o.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),c.value?(e.openBlock(),e.createBlock(Me.default,{key:9,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color},head:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Oe.DataTable,{key:`table_${K.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${o.value.style.chart.title.text}${o.value.style.chart.title.subtitle.text?` : ${o.value.style.chart.title.subtitle.text}`:""}`,onClose:l[6]||(l[6]=n=>b.value.showTable=!1)},{th:e.withCtx(({th:n})=>[e.createElementVNode("div",{innerHTML:n,style:{display:"flex","align-items":"center"}},null,8,it)]),td:e.withCtx(({td:n})=>[e.createTextVNode(e.toDisplayString(n.name||n),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Qe))}},ct=He._export_sfc(ut,[["__scopeId","data-v-84f8e29e"]]);exports.default=ct;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { toRef as ce, resolveComponent as de, openBlock as a, createElementBlock as r, Fragment as m, renderList as z, withModifiers as M, createBlock as R, createCommentVNode as h, createElementVNode as P, toDisplayString as Ie, normalizeStyle as _, createVNode as L, computed as N, onMounted as tt, ref as f, watch as ot, normalizeClass as Oe, unref as b, createSlots as lt, withCtx as $, renderSlot as k, normalizeProps as W, guardReactiveProps as q, createTextVNode as at, nextTick as Le } from "vue";
|
|
2
|
-
import { u as nt, o as st, e as rt, c as Ue, t as it, a as ut, p as De, b as ct, X as dt, l as vt, O as ft, q as ht, r as pt, x as gt, y as yt } from "./index-
|
|
3
|
-
import { _ as mt } from "./Title-
|
|
4
|
-
import { u as bt, U as kt } from "./usePrinter-
|
|
5
|
-
import { D as Ct } from "./DataTable-
|
|
6
|
-
import { _ as $t } from "./Tooltip-
|
|
7
|
-
import Z from "./BaseIcon-
|
|
8
|
-
import wt from "./vue-ui-skeleton-
|
|
9
|
-
import xt from "./vue-ui-accordion
|
|
10
|
-
import { u as Ae } from "./useNestedProp-
|
|
11
|
-
import { _ as Pt } from "./PackageVersion-
|
|
12
|
-
import { P as Tt } from "./PenAndPaper-
|
|
2
|
+
import { u as nt, o as st, e as rt, c as Ue, t as it, a as ut, p as De, b as ct, X as dt, l as vt, O as ft, q as ht, r as pt, x as gt, y as yt } from "./index-C2mIRYI5.js";
|
|
3
|
+
import { _ as mt } from "./Title-PkqdmDqN.js";
|
|
4
|
+
import { u as bt, U as kt } from "./usePrinter-D0_MYOSc.js";
|
|
5
|
+
import { D as Ct } from "./DataTable-DInI0nyj.js";
|
|
6
|
+
import { _ as $t } from "./Tooltip-m3Z3Wlu2.js";
|
|
7
|
+
import Z from "./BaseIcon-CL3j-fI9.js";
|
|
8
|
+
import wt from "./vue-ui-skeleton-Cb2qrhYT.js";
|
|
9
|
+
import xt from "./vue-ui-accordion-CbgAyykZ.js";
|
|
10
|
+
import { u as Ae } from "./useNestedProp-nx1ZIRNV.js";
|
|
11
|
+
import { _ as Pt } from "./PackageVersion-Cchpqacn.js";
|
|
12
|
+
import { P as Tt } from "./PenAndPaper-BKH98f-S.js";
|
|
13
13
|
import { u as Ft } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as Rt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const St = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick", "onMouseover"], Ot = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as c, onMounted as Ce, ref as v, watch as we, openBlock as r, createElementBlock as y, normalizeClass as Z, normalizeStyle as L, unref as a, createBlock as p, createCommentVNode as u, createVNode as U, createSlots as xe, withCtx as m, renderSlot as h, normalizeProps as B, guardReactiveProps as D, createElementVNode as s, Fragment as ee, renderList as te, toDisplayString as M, createTextVNode as oe, nextTick as _e } from "vue";
|
|
2
|
-
import { u as $e, o as Me, e as le, c as Pe, t as Ne, O as Ae, X as Oe, s as C, w as Te, P as Le, i as ae, f as I, q as Ie, r as Fe } from "./index-
|
|
3
|
-
import { _ as Se } from "./Title-
|
|
4
|
-
import { u as Ve, U as je } from "./usePrinter-
|
|
5
|
-
import { L as Ue } from "./Legend-
|
|
6
|
-
import P from "./BaseIcon-
|
|
7
|
-
import { D as Be } from "./DataTable-
|
|
8
|
-
import De from "./vue-ui-skeleton-
|
|
9
|
-
import We from "./vue-ui-accordion
|
|
10
|
-
import { u as se } from "./useNestedProp-
|
|
11
|
-
import { _ as ze } from "./PackageVersion-
|
|
12
|
-
import { P as Ee } from "./PenAndPaper-
|
|
2
|
+
import { u as $e, o as Me, e as le, c as Pe, t as Ne, O as Ae, X as Oe, s as C, w as Te, P as Le, i as ae, f as I, q as Ie, r as Fe } from "./index-C2mIRYI5.js";
|
|
3
|
+
import { _ as Se } from "./Title-PkqdmDqN.js";
|
|
4
|
+
import { u as Ve, U as je } from "./usePrinter-D0_MYOSc.js";
|
|
5
|
+
import { L as Ue } from "./Legend-Ci1axdG_.js";
|
|
6
|
+
import P from "./BaseIcon-CL3j-fI9.js";
|
|
7
|
+
import { D as Be } from "./DataTable-DInI0nyj.js";
|
|
8
|
+
import De from "./vue-ui-skeleton-Cb2qrhYT.js";
|
|
9
|
+
import We from "./vue-ui-accordion-CbgAyykZ.js";
|
|
10
|
+
import { u as se } from "./useNestedProp-nx1ZIRNV.js";
|
|
11
|
+
import { _ as ze } from "./PackageVersion-Cchpqacn.js";
|
|
12
|
+
import { P as Ee } from "./PenAndPaper-BKH98f-S.js";
|
|
13
13
|
import { u as Ge } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { _ as He } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const Re = ["id"], Xe = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-KJL8ra_6.cjs"),te=require("./Title-D-6pIV0l.cjs"),F=require("./usePrinter-pDOF3CfL.cjs"),oe=require("./Legend-DqGE1lkA.cjs"),f=require("./BaseIcon-CIjjPDqj.cjs"),le=require("./DataTable-wN-jvOfe.cjs"),ae=require("./vue-ui-skeleton-D_YCUi1y.cjs"),re=require("./vue-ui-accordion-4-dyMgJA.cjs"),q=require("./useNestedProp-Bu958azG.cjs"),ne=require("./PackageVersion-Dn-t7tbm.cjs"),se=require("./PenAndPaper-DFXJJink.cjs"),ue=require("./useUserOptionState-BgepsfED.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],de={key:2,style:"width:100%;background:transparent"},ve=["xmlns","viewBox"],ye=["width","height"],me=["id"],he=["stop-color"],pe=["stop-color"],fe=["x1","y1","x2","y2","stroke","stroke-width"],ke=["d","stroke","stroke-width"],ge=["stroke"],be=["fill"],Ce=["stroke"],Ne=["fill"],xe=["stroke"],we=["fill"],Ve=["stroke"],_e=["fill"],Be=["stroke"],Pe=["fill"],$e=["d","stroke","stroke-width","fill"],Me=["x1","y1","stroke"],Ee=["cx","cy","fill","stroke"],Oe=["fill","stroke"],Se=["y","fill","font-weight"],Ae=["y","fill"],Te={key:5,class:"vue-data-ui-watermark"},Le=["onClick"],Ie={style:{"font-weight":"bold"}},Fe={key:8,ref:"source",dir:"auto"},qe=["innerHTML"],ze={__name:"vue-ui-mood-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(z,{expose:D}){const s=z,{vue_ui_mood_radar:j}=r.useConfig(),m=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{_()});function _(){r.objectIsEmpty(s.dataset)&&r.error({componentName:"VueUiMoodRadar",type:"dataset"})}const h=e.ref(r.createUid()),N=e.ref(null),U=e.ref(null),n=e.ref(null),W=e.ref(null),G=e.ref(0),H=e.ref(0),B=e.ref(0),t=e.computed({get:()=>M(),set:l=>l}),{userOptionsVisible:x,setUserOptionsVisibility:P,keepUserOptionState:$}=ue.useUserOptionState({config:t.value});function M(){const l=q.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...q.useNestedProp({userConfig:r.themes.vue_ui_mood_radar[l.theme]||s.config,defaultConfig:l})}:l}e.watch(()=>s.config,l=>{t.value=M(),x.value=!t.value.showOnChartHover,_(),G.value+=1,H.value+=1,B.value+=1},{deep:!0});const{isPrinting:E,isImaging:O,generatePdf:S,generateImage:A}=F.usePrinter({elementId:h.value,fileName:t.value.style.chart.title.text||"vue-ui-mood-radar"}),R=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),k=e.ref({showTable:t.value.table.show}),i=e.computed(()=>({height:256,width:256})),w=e.computed(()=>r.createPolygonPath({plot:{x:128,y:i.value.height/2},radius:90,sides:5,rotation:11}));function X({centerX:l,centerY:a,apexX:o,apexY:u,proportion:d,key:p,value:ee}){return{x:l+(o-l)*d,y:a+(u-a)*d,key:p,value:ee}}const K=e.computed(()=>Math.max(...Object.values(s.dataset).map(l=>isNaN(l)?0:l))),y=e.computed(()=>Object.values(s.dataset).reduce((l,a)=>(isNaN(l)?0:l)+(isNaN(a)?0:a),0)),c=e.computed(()=>Object.keys(s.dataset).map((l,a)=>{const o=typeof s.dataset[l]!="number"||isNaN(s.dataset[l])?0:s.dataset[l];return{index:a,key:l,value:o,proportion:o/y.value,color:t.value.style.chart.layout.smileys.colors[l]}}).sort((l,a)=>a.key-l.key)),T=e.computed(()=>m.value?(["1","2","3","4","5"].forEach(l=>{[null,void 0].includes(s.dataset[l])&&r.error({componentName:"VueUiMoodRadar",type:"datasetAttribute",property:l})}),w.value.coordinates.map((l,a)=>{const o=X({centerX:i.value.width/2,centerY:i.value.height/2,apexX:l.x,apexY:l.y,proportion:c.value[a].value/K.value,key:c.value[a].key,value:c.value[a].value});return{...l,plots:o,key:c.value[a].key}})):[]),Y=e.computed(()=>({cy:"mood-radar-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function J(l){l===n.value?n.value=null:n.value=l}const v=e.computed(()=>{const l=c.value.map(o=>({name:o.key,color:o.color})),a=c.value.map(o=>isNaN(o.value)?0:o.value);return{head:l,body:a}});function L(){e.nextTick(()=>{const l=v.value.head.map((u,d)=>[[u.name],[v.value.body[d]],[isNaN(v.value.body[d]/y.value)?"-":v.value.body[d]/y.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-mood-radar"})})}const g=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>',Number(y.value.toFixed(t.value.table.td.roundingValue)).toLocaleString(),"100%"],a=v.value.head.map((d,p)=>[{color:d.color,name:d.name},v.value.body[p].toFixed(t.value.table.td.roundingValue),isNaN(v.value.body[p]/y.value)?"-":(v.value.body[p]/y.value*100).toFixed(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},u=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:u}});function Q(){return c.value}function I(){k.value.showTable=!k.value.showTable}const b=e.ref(!1);function Z(l){b.value=l}const C=e.ref(!1);function V(){C.value=!C.value}return D({getData:Q,generatePdf:S,generateCsv:L,generateImage:A,toggleTable:I,toggleAnnotator:V}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-mood-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"moodRadarChart",ref:N,id:`${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),onMouseenter:a[11]||(a[11]=()=>e.unref(P)(!0)),onMouseleave:a[12]||(a[12]=()=>e.unref(P)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(se.PenAndPaper,{key:0,parent:N.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:C.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,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",de,[e.createVNode(te._sfc_main,{config:{title:{cy:"mood-radar-title",...t.value.style.chart.title},subtitle:{cy:"mood-radar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])])):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value&&(e.unref($)||e.unref(x))?(e.openBlock(),e.createBlock(F.UserOptions,{key:3,ref_key:"details",ref:U,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(E),isImaging:e.unref(O),uid:h.value,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,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:C.value,onToggleFullscreen:Z,onGeneratePdf:e.unref(S),onGenerateCsv:L,onGenerateImage:e.unref(A),onToggleTable:I,onToggleAnnotator:V,style:e.normalizeStyle({visibility:e.unref($)?e.unref(x)?"visible":"hidden":"visible"})},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.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}: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:"4"}: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:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ne._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:i.value.width,height:i.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,ye)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`mood_radar_gradient_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,he),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.gradient.intensity/100),t.value.style.chart.layout.dataPolygon.opacity)},null,8,pe)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value.coordinates,o=>(e.openBlock(),e.createElementBlock("line",{x1:i.value.width/2,y1:i.value.height/2,x2:o.x,y2:o.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,fe))),256)),e.createElementVNode("path",{d:w.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,ke),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[5],"stroke-width":"1","stroke-linecap":"round",d:"M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22"},null,8,ge),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[0]||(a[0]=o=>n.value=5),onMouseleave:a[1]||(a[1]=o=>n.value=null),cx:"128",cy:"25",r:"20",fill:n.value===5?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[5],20):"transparent"},null,40,be),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[4],"stroke-width":"1","stroke-linecap":"round",d:"M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92"},null,8,Ce),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[2]||(a[2]=o=>n.value=4),onMouseleave:a[3]||(a[3]=o=>n.value=null),cx:"227",cy:"95.5",r:"20",fill:n.value===4?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[4],20):"transparent"},null,40,Ne),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[3],"stroke-width":"1","stroke-linecap":"round",d:"M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215"},null,8,xe),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[4]||(a[4]=o=>n.value=3),onMouseleave:a[5]||(a[5]=o=>n.value=null),cx:"190",cy:"213.5",r:"20",fill:n.value===3?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[3],20):"transparent"},null,40,we),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[2],"stroke-width":"1","stroke-linecap":"round",d:"M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210"},null,8,Ve),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[6]||(a[6]=o=>n.value=2),onMouseleave:a[7]||(a[7]=o=>n.value=null),cx:"65",cy:"213.5",r:"20",fill:n.value===2?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[2],20):"transparent"},null,40,_e),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[1],"stroke-width":"1","stroke-linecap":"round",d:"M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93"},null,8,Be),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[8]||(a[8]=o=>n.value=1),onMouseleave:a[9]||(a[9]=o=>n.value=null),cx:"29",cy:"95.5",r:"20",fill:n.value===1?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[1],20):"transparent"},null,40,Pe),e.createElementVNode("path",{d:e.unref(r.makePath)(T.value.map(o=>o.plots)),stroke:t.value.style.chart.layout.dataPolygon.stroke,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:t.value.style.chart.layout.dataPolygon.gradient.show?`url(#mood_radar_gradient_${h.value})`:e.unref(r.setOpacity)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,$e),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value.map(o=>o.plots),(o,u)=>(e.openBlock(),e.createElementBlock("g",{class:"vue-ui-mood-radar-trap",style:e.normalizeStyle(`opacity:${n.value==o.key?"1":"0"}`)},[e.createElementVNode("line",{x1:o.x,y1:o.y,x2:128,y2:128,stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,Me),e.createElementVNode("circle",{cx:o.x,cy:o.y,fill:t.value.style.chart.layout.smileys.colors[o.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,Ee),e.createElementVNode("circle",{cx:128,cy:128,fill:t.value.style.chart.layout.smileys.colors[o.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,Oe),e.createElementVNode("text",{x:128,y:["5",5].includes(o.key)?145:120,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle","font-weight":t.value.style.chart.layout.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:o.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:o,seriesIndex:u})),9,Se),e.createElementVNode("text",{x:128,y:["5",5].includes(o.key)?163:102,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle"}," ("+e.toDisplayString(e.unref(r.dataLabel)({v:o.value/y.value*100,s:"%",r:t.value.style.chart.layout.dataLabel.roundingPercentage}))+") ",9,Ae)],4))),256)),e.renderSlot(l.$slots,"svg",{svg:i.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Te,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(E)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ae.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:"#CCCCCC"},shapes:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(oe.Legend,{legendSet:c.value,config:Y.value,key:`legend_${B.value}`,style:{display:"flex","row-gap":"6px"}},{item:e.withCtx(({legend:o,index:u})=>[e.createElementVNode("div",{onClick:()=>J(o.key),style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center",margin:"3px 0"}},[o.key==1?(e.openBlock(),e.createBlock(f.default,{key:0,strokeWidth:1,name:"moodSad",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==2?(e.openBlock(),e.createBlock(f.default,{key:1,strokeWidth:1,name:"moodFlat",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==3?(e.openBlock(),e.createBlock(f.default,{key:2,strokeWidth:1,name:"moodNeutral",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==4?(e.openBlock(),e.createBlock(f.default,{key:3,strokeWidth:1,name:"smiley",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==5?(e.openBlock(),e.createBlock(f.default,{key:4,strokeWidth:1,name:"moodHappy",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),e.createElementVNode("span",Ie,e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:o.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:o,seriesIndex:u})),1),e.createTextVNode(" ("+e.toDisplayString(e.unref(r.dataLabel)({v:o.proportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1)],8,Le)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:c.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(re.default,{key:9,hideDetails:"",config:{open:k.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(le.DataTable,{colNames:g.value.colNames,head:g.value.head,body:g.value.body,config:g.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[10]||(a[10]=o=>k.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,qe)]),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)],46,ce))}},De=ie._export_sfc(ze,[["__scopeId","data-v-9ac93b41"]]);exports.default=De;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DBFjPsZ3.cjs"),te=require("./Title-ByUzU0ju.cjs"),F=require("./usePrinter-NpeVna5L.cjs"),oe=require("./Legend-BGxT3Yv0.cjs"),f=require("./BaseIcon-5jC5U27p.cjs"),le=require("./DataTable-fHBZCQD_.cjs"),ae=require("./vue-ui-skeleton-20TN6Ch2.cjs"),re=require("./vue-ui-accordion-BB0V98cT.cjs"),q=require("./useNestedProp-C6A3gxy9.cjs"),ne=require("./PackageVersion-X1kVHC-z.cjs"),se=require("./PenAndPaper-ChPMqRX7.cjs"),ue=require("./useUserOptionState-BgepsfED.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],de={key:2,style:"width:100%;background:transparent"},ve=["xmlns","viewBox"],ye=["width","height"],me=["id"],he=["stop-color"],pe=["stop-color"],fe=["x1","y1","x2","y2","stroke","stroke-width"],ke=["d","stroke","stroke-width"],ge=["stroke"],be=["fill"],Ce=["stroke"],Ne=["fill"],xe=["stroke"],we=["fill"],Ve=["stroke"],_e=["fill"],Be=["stroke"],Pe=["fill"],$e=["d","stroke","stroke-width","fill"],Me=["x1","y1","stroke"],Ee=["cx","cy","fill","stroke"],Oe=["fill","stroke"],Se=["y","fill","font-weight"],Ae=["y","fill"],Te={key:5,class:"vue-data-ui-watermark"},Le=["onClick"],Ie={style:{"font-weight":"bold"}},Fe={key:8,ref:"source",dir:"auto"},qe=["innerHTML"],ze={__name:"vue-ui-mood-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(z,{expose:D}){const s=z,{vue_ui_mood_radar:j}=r.useConfig(),m=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{_()});function _(){r.objectIsEmpty(s.dataset)&&r.error({componentName:"VueUiMoodRadar",type:"dataset"})}const h=e.ref(r.createUid()),N=e.ref(null),U=e.ref(null),n=e.ref(null),W=e.ref(null),G=e.ref(0),H=e.ref(0),B=e.ref(0),t=e.computed({get:()=>M(),set:l=>l}),{userOptionsVisible:x,setUserOptionsVisibility:P,keepUserOptionState:$}=ue.useUserOptionState({config:t.value});function M(){const l=q.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...q.useNestedProp({userConfig:r.themes.vue_ui_mood_radar[l.theme]||s.config,defaultConfig:l})}:l}e.watch(()=>s.config,l=>{t.value=M(),x.value=!t.value.showOnChartHover,_(),G.value+=1,H.value+=1,B.value+=1},{deep:!0});const{isPrinting:E,isImaging:O,generatePdf:S,generateImage:A}=F.usePrinter({elementId:h.value,fileName:t.value.style.chart.title.text||"vue-ui-mood-radar"}),R=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),k=e.ref({showTable:t.value.table.show}),i=e.computed(()=>({height:256,width:256})),w=e.computed(()=>r.createPolygonPath({plot:{x:128,y:i.value.height/2},radius:90,sides:5,rotation:11}));function X({centerX:l,centerY:a,apexX:o,apexY:u,proportion:d,key:p,value:ee}){return{x:l+(o-l)*d,y:a+(u-a)*d,key:p,value:ee}}const K=e.computed(()=>Math.max(...Object.values(s.dataset).map(l=>isNaN(l)?0:l))),y=e.computed(()=>Object.values(s.dataset).reduce((l,a)=>(isNaN(l)?0:l)+(isNaN(a)?0:a),0)),c=e.computed(()=>Object.keys(s.dataset).map((l,a)=>{const o=typeof s.dataset[l]!="number"||isNaN(s.dataset[l])?0:s.dataset[l];return{index:a,key:l,value:o,proportion:o/y.value,color:t.value.style.chart.layout.smileys.colors[l]}}).sort((l,a)=>a.key-l.key)),T=e.computed(()=>m.value?(["1","2","3","4","5"].forEach(l=>{[null,void 0].includes(s.dataset[l])&&r.error({componentName:"VueUiMoodRadar",type:"datasetAttribute",property:l})}),w.value.coordinates.map((l,a)=>{const o=X({centerX:i.value.width/2,centerY:i.value.height/2,apexX:l.x,apexY:l.y,proportion:c.value[a].value/K.value,key:c.value[a].key,value:c.value[a].value});return{...l,plots:o,key:c.value[a].key}})):[]),Y=e.computed(()=>({cy:"mood-radar-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function J(l){l===n.value?n.value=null:n.value=l}const v=e.computed(()=>{const l=c.value.map(o=>({name:o.key,color:o.color})),a=c.value.map(o=>isNaN(o.value)?0:o.value);return{head:l,body:a}});function L(){e.nextTick(()=>{const l=v.value.head.map((u,d)=>[[u.name],[v.value.body[d]],[isNaN(v.value.body[d]/y.value)?"-":v.value.body[d]/y.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-mood-radar"})})}const g=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>',Number(y.value.toFixed(t.value.table.td.roundingValue)).toLocaleString(),"100%"],a=v.value.head.map((d,p)=>[{color:d.color,name:d.name},v.value.body[p].toFixed(t.value.table.td.roundingValue),isNaN(v.value.body[p]/y.value)?"-":(v.value.body[p]/y.value*100).toFixed(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},u=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:u}});function Q(){return c.value}function I(){k.value.showTable=!k.value.showTable}const b=e.ref(!1);function Z(l){b.value=l}const C=e.ref(!1);function V(){C.value=!C.value}return D({getData:Q,generatePdf:S,generateCsv:L,generateImage:A,toggleTable:I,toggleAnnotator:V}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-mood-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"moodRadarChart",ref:N,id:`${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),onMouseenter:a[11]||(a[11]=()=>e.unref(P)(!0)),onMouseleave:a[12]||(a[12]=()=>e.unref(P)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(se.PenAndPaper,{key:0,parent:N.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:C.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:W,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",de,[e.createVNode(te._sfc_main,{config:{title:{cy:"mood-radar-title",...t.value.style.chart.title},subtitle:{cy:"mood-radar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])])):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value&&(e.unref($)||e.unref(x))?(e.openBlock(),e.createBlock(F.UserOptions,{key:3,ref_key:"details",ref:U,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(E),isImaging:e.unref(O),uid:h.value,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,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:C.value,onToggleFullscreen:Z,onGeneratePdf:e.unref(S),onGenerateCsv:L,onGenerateImage:e.unref(A),onToggleTable:I,onToggleAnnotator:V,style:e.normalizeStyle({visibility:e.unref($)?e.unref(x)?"visible":"hidden":"visible"})},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.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}: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:"4"}: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:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ne._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:i.value.width,height:i.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,ye)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`mood_radar_gradient_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,he),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.gradient.intensity/100),t.value.style.chart.layout.dataPolygon.opacity)},null,8,pe)],8,me)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value.coordinates,o=>(e.openBlock(),e.createElementBlock("line",{x1:i.value.width/2,y1:i.value.height/2,x2:o.x,y2:o.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,fe))),256)),e.createElementVNode("path",{d:w.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,ke),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[5],"stroke-width":"1","stroke-linecap":"round",d:"M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22"},null,8,ge),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[0]||(a[0]=o=>n.value=5),onMouseleave:a[1]||(a[1]=o=>n.value=null),cx:"128",cy:"25",r:"20",fill:n.value===5?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[5],20):"transparent"},null,40,be),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[4],"stroke-width":"1","stroke-linecap":"round",d:"M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92"},null,8,Ce),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[2]||(a[2]=o=>n.value=4),onMouseleave:a[3]||(a[3]=o=>n.value=null),cx:"227",cy:"95.5",r:"20",fill:n.value===4?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[4],20):"transparent"},null,40,Ne),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[3],"stroke-width":"1","stroke-linecap":"round",d:"M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215"},null,8,xe),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[4]||(a[4]=o=>n.value=3),onMouseleave:a[5]||(a[5]=o=>n.value=null),cx:"190",cy:"213.5",r:"20",fill:n.value===3?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[3],20):"transparent"},null,40,we),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[2],"stroke-width":"1","stroke-linecap":"round",d:"M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210"},null,8,Ve),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[6]||(a[6]=o=>n.value=2),onMouseleave:a[7]||(a[7]=o=>n.value=null),cx:"65",cy:"213.5",r:"20",fill:n.value===2?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[2],20):"transparent"},null,40,_e),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[1],"stroke-width":"1","stroke-linecap":"round",d:"M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93"},null,8,Be),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[8]||(a[8]=o=>n.value=1),onMouseleave:a[9]||(a[9]=o=>n.value=null),cx:"29",cy:"95.5",r:"20",fill:n.value===1?e.unref(r.setOpacity)(t.value.style.chart.layout.smileys.colors[1],20):"transparent"},null,40,Pe),e.createElementVNode("path",{d:e.unref(r.makePath)(T.value.map(o=>o.plots)),stroke:t.value.style.chart.layout.dataPolygon.stroke,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:t.value.style.chart.layout.dataPolygon.gradient.show?`url(#mood_radar_gradient_${h.value})`:e.unref(r.setOpacity)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,$e),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value.map(o=>o.plots),(o,u)=>(e.openBlock(),e.createElementBlock("g",{class:"vue-ui-mood-radar-trap",style:e.normalizeStyle(`opacity:${n.value==o.key?"1":"0"}`)},[e.createElementVNode("line",{x1:o.x,y1:o.y,x2:128,y2:128,stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,Me),e.createElementVNode("circle",{cx:o.x,cy:o.y,fill:t.value.style.chart.layout.smileys.colors[o.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,Ee),e.createElementVNode("circle",{cx:128,cy:128,fill:t.value.style.chart.layout.smileys.colors[o.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,Oe),e.createElementVNode("text",{x:128,y:["5",5].includes(o.key)?145:120,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle","font-weight":t.value.style.chart.layout.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:o.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:o,seriesIndex:u})),9,Se),e.createElementVNode("text",{x:128,y:["5",5].includes(o.key)?163:102,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle"}," ("+e.toDisplayString(e.unref(r.dataLabel)({v:o.value/y.value*100,s:"%",r:t.value.style.chart.layout.dataLabel.roundingPercentage}))+") ",9,Ae)],4))),256)),e.renderSlot(l.$slots,"svg",{svg:i.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Te,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(E)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ae.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:"#CCCCCC"},shapes:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(oe.Legend,{legendSet:c.value,config:Y.value,key:`legend_${B.value}`,style:{display:"flex","row-gap":"6px"}},{item:e.withCtx(({legend:o,index:u})=>[e.createElementVNode("div",{onClick:()=>J(o.key),style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center",margin:"3px 0"}},[o.key==1?(e.openBlock(),e.createBlock(f.default,{key:0,strokeWidth:1,name:"moodSad",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==2?(e.openBlock(),e.createBlock(f.default,{key:1,strokeWidth:1,name:"moodFlat",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==3?(e.openBlock(),e.createBlock(f.default,{key:2,strokeWidth:1,name:"moodNeutral",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==4?(e.openBlock(),e.createBlock(f.default,{key:3,strokeWidth:1,name:"smiley",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),o.key==5?(e.openBlock(),e.createBlock(f.default,{key:4,strokeWidth:1,name:"moodHappy",stroke:t.value.style.chart.layout.smileys.colors[o.key]},null,8,["stroke"])):e.createCommentVNode("",!0),e.createElementVNode("span",Ie,e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:o.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:o,seriesIndex:u})),1),e.createTextVNode(" ("+e.toDisplayString(e.unref(r.dataLabel)({v:o.proportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1)],8,Le)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:c.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(re.default,{key:9,hideDetails:"",config:{open:k.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(le.DataTable,{colNames:g.value.colNames,head:g.value.head,body:g.value.body,config:g.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[10]||(a[10]=o=>k.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,qe)]),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)],46,ce))}},De=ie._export_sfc(ze,[["__scopeId","data-v-9ac93b41"]]);exports.default=De;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DBFjPsZ3.cjs"),me=require("./useResponsive-BJ7DTGpm.cjs"),Ee=require("./Title-ByUzU0ju.cjs"),be=require("./usePrinter-NpeVna5L.cjs"),Fe=require("./DataTable-fHBZCQD_.cjs"),Te=require("./Tooltip-D0I2_wrW.cjs"),Oe=require("./Legend-BGxT3Yv0.cjs"),Pe=require("./vue-ui-skeleton-20TN6Ch2.cjs"),ze=require("./vue-ui-accordion-BB0V98cT.cjs"),ge=require("./useNestedProp-C6A3gxy9.cjs"),De=require("./PackageVersion-X1kVHC-z.cjs"),Ie=require("./PenAndPaper-ChPMqRX7.cjs"),Ae=require("./useUserOptionState-BgepsfED.cjs"),Me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),q=x=>(e.pushScopeId("data-v-7b38ae51"),x=x(),e.popScopeId(),x),Ue=["id"],Re=["xmlns","viewBox"],qe=["width","height"],Ye=["id"],Xe=q(()=>e.createElementVNode("stop",{offset:"0%","stop-color":"#FFFFFF","stop-opacity":"0"},null,-1)),Ge=["offset","stop-color"],He=["offset","stop-opacity"],We=q(()=>e.createElementVNode("stop",{offset:"100%","stop-color":"#FFFFFF","stop-opacity":"0"},null,-1)),Je=["id"],Ke=["id"],Qe=q(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ze=["id"],je=["flood-color"],et=["d","fill","stroke","stroke-width","filter"],tt={key:1},lt=["d","fill"],at={key:2},ot=["x","y","font-size","font-weight","fill"],nt={key:3},rt=["filter"],st=["text-anchor","x","y","fill","font-size","font-weight"],ut=["text-anchor","x","y","fill","font-size","font-weight"],it=["text-anchor","x","y","fill","font-size","font-weight"],ct=["d","fill","onMouseenter","onClick"],dt={key:5,class:"vue-data-ui-watermark"},vt={key:0,class:"vue-ui-nested-donuts-legend-title"},ft=["onClick"],pt=["innerHTML"],ht={__name:"vue-ui-nested-donuts",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(x,{expose:ke,emit:Y}){const k=x,{vue_ui_nested_donuts:Ce}=r.useConfig(),$=e.computed(()=>!!k.dataset&&k.dataset.length),p=e.ref(r.createUid()),T=e.ref(!1),O=e.ref(""),we=e.ref(null),X=e.ref(0),L=e.ref(null),G=e.ref(null),P=e.ref(null),H=e.ref(null),W=e.ref(null),J=e.ref(0),K=e.ref(0),Q=e.ref(0),B=e.ref(!1);function Le(l){B.value=l,X.value+=1}const t=e.computed({get:()=>ee(),set:l=>l}),{userOptionsVisible:z,setUserOptionsVisibility:Z,keepUserOptionState:j}=Ae.useUserOptionState({config:t.value});function ee(){const l=ge.useNestedProp({userConfig:k.config,defaultConfig:Ce});return l.theme?{...ge.useNestedProp({userConfig:r.themes.vue_ui_nested_donuts[l.theme]||k.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>k.config,l=>{t.value=ee(),z.value=!t.value.showOnChartHover,te(),J.value+=1,K.value+=1,Q.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{te()});function te(){if(r.objectIsEmpty(k.dataset)&&r.error({componentName:"VueUiNestedDonuts",type:"dataset"}),t.value.responsive){const l=me.throttle(()=>{const{width:s,height:o}=me.useResponsive({chart:L.value,title:t.value.style.chart.title.text?G.value:null,legend:t.value.style.chart.legend.show?P.value:null,source:H.value,noTitle:W.value});c.value.width=s,c.value.height=o});N.value=new ResizeObserver(l),N.value.observe(L.value.parentNode)}}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:le,isImaging:ae,generatePdf:oe,generateImage:ne}=be.usePrinter({elementId:`nested_donuts_${p.value}`,fileName:t.value.style.chart.title.text||"vue-ui-nested-donuts"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),xe=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),c=e.ref({height:512,width:512});function $e({datapoint:l,index:s}){Y("selectDatapoint",{datapoint:l,index:s})}const v=e.ref([]),m=e.computed(()=>(k.dataset.forEach((l,s)=>{[null,void 0].includes(l.name)&&r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"name",index:s}),[null,void 0].includes(l.series)?r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"series",index:s}):l.series.length===0?r.error({componentName:"VueUiNestedDonuts",type:"datasetAttributeEmpty",property:`series at index ${s}`}):l.series.forEach((o,n)=>{[null,void 0].includes(o.name)&&r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"name",index:n,key:"serie"}),[null,void 0].includes(o.values)&&r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"values",index:n,key:"serie"})})}),k.dataset.map((l,s)=>({...l,total:l.series.filter(o=>!v.value.includes(o.id)).map(o=>r.sanitizeArray(o.values).reduce((n,a)=>n+a,0)).reduce((o,n)=>o+n,0),datasetIndex:s,id:`${p.value}_${s}`,series:l.series.map((o,n)=>({name:o.name,arcOf:l.name,arcOfId:`${p.value}_${s}`,id:`${p.value}_${s}_${n}`,seriesIndex:n,datasetIndex:s,color:r.convertColorToHex(o.color)||xe.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:r.sanitizeArray(o.values).reduce((a,u)=>a+u,0),absoluteValues:o.values||[]}))})))),b=e.computed(()=>Math.min(c.value.height,c.value.width)*(t.value.style.chart.layout.donut.strokeWidth/512)),re=e.computed(()=>[...m.value].map((l,s)=>{const o=l.series.filter(n=>!v.value.includes(n.id)).map(n=>n.value).reduce((n,a)=>n+a,0);return{...l,total:o,series:l.series.filter(n=>!v.value.includes(n.id)).map(n=>({...n,proportion:n.value/o}))}}));function Ne(l,s,o){let n=0;for(let a=0;a<l.length;a+=1)o.includes(l[a])&&(n+=1);return n<s}const d=e.ref(re.value);e.watch(()=>re.value,l=>d.value=l);const se=e.ref(null),ue=e.ref(null);function D(l){Y("selectLegend",l);const s=m.value.flatMap(i=>i.series).find(i=>i.id===l.id),o=d.value.flatMap(i=>i.series).find(i=>i.id===l.id);let a=o?o.value:0;const u=m.value.find(i=>i.id===s.arcOfId).series.map(i=>i.id),f=Ne(u,u.length-1,v.value);if(v.value.includes(l.id)){let i=function(){a>s.value?(cancelAnimationFrame(se.value),d.value=d.value.map(y=>({...y,series:y.series.map(g=>g.id==l.id?{...g,value:s.value}:g)}))):(a+=s.value*.025,d.value=d.value.map(y=>({...y,series:y.series.map(g=>g.id===l.id?{...g,value:a}:g)})),se.value=requestAnimationFrame(i))};v.value=v.value.filter(y=>y!==l.id),i()}else if(f){let i=function(){a<.1?(cancelAnimationFrame(ue.value),v.value.push(l.id),d.value=d.value.map((y,g)=>({...y,series:y.series.map(w=>w.id===l.id?{...w,value:0}:w)}))):(a/=1.1,d.value=d.value.map((y,g)=>({...y,series:y.series.map(w=>w.id===l.id?{...w,value:a}:w)})),ue.value=requestAnimationFrame(i))};i()}}const I=e.computed(()=>b.value/m.value.length*t.value.style.chart.layout.donut.spacingRatio),ie=e.computed(()=>d.value.map((l,s)=>b.value-s*b.value/m.value.length)),_=e.computed(()=>d.value.map((l,s)=>{const o=s*b.value/m.value.length;return{...l,radius:b.value-o,donut:r.makeDonut({series:l.series},c.value.width/2,c.value.height/2,b.value-o,b.value-o,1.99999,2,1,360,105.25,I.value)}})),ce=e.computed(()=>[...m.value].map((l,s)=>{const o=s*b.value/m.value.length;return{sizeRatio:o,donut:r.makeDonut({series:[{value:1}]},c.value.width/2,c.value.height/2,b.value-o,b.value-o,1.99999,2,1,360,105.25,b.value/m.value.length*t.value.style.chart.layout.donut.spacingRatio)[0]}})),de=e.ref(null),S=e.ref(null),V=e.ref(null),A=e.ref(null);function _e({datapoint:l,_relativeIndex:s,seriesIndex:o}){de.value=l.arcOfId,S.value=l.id,V.value=o,A.value={datapoint:l,seriesIndex:o,series:d.value,config:t.value};const n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:o,datapoint:l,series:d.value,config:t.value})))O.value=n({seriesIndex:o,datapoint:l,series:d.value,config:t.value});else{let a="";if(t.value.style.chart.tooltip.showAllItemsAtIndex&&v.value.length===0){const u=d.value.map(f=>f.series.find(i=>i.seriesIndex===o));u.forEach((f,i)=>{if(!f)return"";a+=`
|
|
2
2
|
<div style="display:flex; flex-direction: column; justify-content:flex-start; align-items:flex-start;padding:6px 0; ${i<u.length-1?`border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor}`:""}">
|
|
3
3
|
<div style="display:flex; flex-direction: row; gap: 3px; justify-content:flex-start; align-items:center;">
|
|
4
4
|
<svg viewBox="0 0 20 20" height="${t.value.style.chart.tooltip.fontSize}" width="${t.value.style.chart.tooltip.fontSize}">
|