vue-data-ui 2.6.27 → 2.6.28
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-CHXZhVTe.js → Arrow-CAjJ853A.js} +1 -1
- package/dist/{Arrow-CChyrfjt.cjs → Arrow-DAyQKLcK.cjs} +1 -1
- package/dist/{BaseIcon-DFBOAQtA.cjs → BaseIcon-BI3eFhr1.cjs} +1 -1
- package/dist/{BaseIcon-B2NGtTKw.js → BaseIcon-h1prcupB.js} +1 -1
- package/dist/{DataTable-CsVlKV_b.js → DataTable-BT1MSIYm.js} +2 -2
- package/dist/{DataTable-Byw5diyo.cjs → DataTable-r2HNsyUX.cjs} +1 -1
- package/dist/{Legend-D9yoEEFS.js → Legend-Bi_ML4Pn.js} +2 -2
- package/dist/{Legend-DXZ1SEB4.cjs → Legend-Bpt6RBG8.cjs} +1 -1
- package/dist/{PackageVersion-CkZZ1O_f.cjs → PackageVersion-BV7LcPDV.cjs} +1 -1
- package/dist/{PackageVersion-DuKFN8zj.js → PackageVersion-J4TBr3Rf.js} +1 -1
- package/dist/{PenAndPaper-miw4fZWP.js → PenAndPaper-CZ-9vnJd.js} +3 -3
- package/dist/{PenAndPaper-CCISmaF4.cjs → PenAndPaper-DP7fHf74.cjs} +1 -1
- package/dist/{PenAndPaper.vue_vue_type_style_index_0_scoped_3cea7589_lang-DrCSj3_o.cjs → PenAndPaper.vue_vue_type_style_index_0_scoped_3cea7589_lang-DTVlE6RY.cjs} +1 -1
- package/dist/{PenAndPaper.vue_vue_type_style_index_0_scoped_3cea7589_lang-6o5i0FF1.js → PenAndPaper.vue_vue_type_style_index_0_scoped_3cea7589_lang-q8a9FDTk.js} +3 -3
- package/dist/{Shape-B9vIBFjb.cjs → Shape-B1cFbBnY.cjs} +1 -1
- package/dist/{Shape-wxGrDLa2.js → Shape-DKT9Kqk7.js} +1 -1
- package/dist/{Slicer-CYeEtD2A.js → Slicer-DB-NAuJL.js} +2 -2
- package/dist/{Slicer-BppEj_gm.cjs → Slicer-RU1fvaGI.cjs} +1 -1
- package/dist/{Title-SvGfFxd0.js → Title-B47pulul.js} +1 -1
- package/dist/{Title-J0zilijE.cjs → Title-DjxAodUf.cjs} +1 -1
- package/dist/{Tooltip-B3qjUlBg.cjs → Tooltip-ogV3t9Et.cjs} +1 -1
- package/dist/{Tooltip-DobAFgUS.js → Tooltip-v3_dMNKi.js} +1 -1
- package/dist/{index-BYGiASHP.cjs → index-0ZojJ1mH.cjs} +1 -1
- package/dist/{index-KnT6sCk3.js → index-4RRlWcLr.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-C58pZChx.js → useNestedProp-CPc3u5vP.js} +1 -1
- package/dist/{useNestedProp-DtjjNlbm.cjs → useNestedProp-OY09Srif.cjs} +1 -1
- package/dist/{usePrinter-BNP686uC.cjs → usePrinter-DDgV-g0v.cjs} +1 -1
- package/dist/{usePrinter-BMTbK98y.js → usePrinter-FdlD3Leg.js} +1 -1
- package/dist/{vue-data-ui-DfY2plzb.cjs → vue-data-ui-BSNSO6yu.cjs} +1 -1
- package/dist/{vue-data-ui-DPfxs1NG.js → vue-data-ui-BmgimpbQ.js} +61 -61
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-CsXb5kNN.js → vue-ui-3d-bar-0-nrP5n6.js} +9 -9
- package/dist/{vue-ui-3d-bar-DkM_KFYn.cjs → vue-ui-3d-bar-BGI5KJpt.cjs} +1 -1
- package/dist/{vue-ui-accordion-KL1QlKX4.cjs → vue-ui-accordion-BboUGt-9.cjs} +1 -1
- package/dist/{vue-ui-accordion-mb3fG5mO.js → vue-ui-accordion-I9YX633w.js} +3 -3
- package/dist/{vue-ui-age-pyramid-JVpnanhX.js → vue-ui-age-pyramid-C6NmpTMr.js} +10 -10
- package/dist/{vue-ui-age-pyramid-o9lDHYRC.cjs → vue-ui-age-pyramid-DN_KJekA.cjs} +1 -1
- package/dist/{vue-ui-annotator-BE53nSRk.js → vue-ui-annotator-DStzhwzU.js} +1 -1
- package/dist/{vue-ui-annotator-Dv9R9AZd.cjs → vue-ui-annotator-L-f_1hLT.cjs} +1 -1
- package/dist/{vue-ui-bullet-CqIJebnb.cjs → vue-ui-bullet-BCNaSp3O.cjs} +1 -1
- package/dist/{vue-ui-bullet-DTJRfs0W.js → vue-ui-bullet-Dq2MsuyN.js} +8 -8
- package/dist/{vue-ui-candlestick-CvN5dXb8.js → vue-ui-candlestick-9iTYHhad.js} +11 -11
- package/dist/{vue-ui-candlestick-D9StYnly.cjs → vue-ui-candlestick-hg6BYKYF.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CJgC0bsa.cjs → vue-ui-carousel-table-CaMRToS_.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-C_Du0OJl.js → vue-ui-carousel-table-D3GqEHvK.js} +4 -4
- package/dist/{vue-ui-chestnut-DrBG08AQ.js → vue-ui-chestnut-Dl_TQF-L.js} +8 -8
- package/dist/{vue-ui-chestnut-eL4QUsSh.cjs → vue-ui-chestnut-ViGzV_gH.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-ByTETRaV.cjs → vue-ui-circle-pack-CDF6Vpt6.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-BQtK78wc.js → vue-ui-circle-pack-CzgQYWZS.js} +9 -9
- package/dist/{vue-ui-cursor-CGMIOJf0.cjs → vue-ui-cursor-B6B1RIBj.cjs} +1 -1
- package/dist/{vue-ui-cursor-xD1Tdk-Z.js → vue-ui-cursor-Cd2gEBSb.js} +2 -2
- package/dist/{vue-ui-dashboard-BBmDgB2R.cjs → vue-ui-dashboard-CJpCmlsb.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CwRxjnLz.js → vue-ui-dashboard-CQ0t86PU.js} +2 -2
- package/dist/{vue-ui-digits-HBzfvNqJ.cjs → vue-ui-digits--Uo-UP39.cjs} +1 -1
- package/dist/{vue-ui-digits-Za2atvi0.js → vue-ui-digits-De_0njxV.js} +2 -2
- package/dist/{vue-ui-donut-CY-Ri8hO.js → vue-ui-donut-CpJ4w6x_.js} +12 -12
- package/dist/{vue-ui-donut-PMbPEsi-.cjs → vue-ui-donut-eRo_Rcn7.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-h9dIxYX-.js → vue-ui-donut-evolution-BNcCQB_7.js} +11 -11
- package/dist/{vue-ui-donut-evolution-Bz71q48v.cjs → vue-ui-donut-evolution-C4ggQb2r.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BYo_816p.js → vue-ui-dumbbell-B3sk0RXg.js} +10 -10
- package/dist/{vue-ui-dumbbell-BhMfZzyR.cjs → vue-ui-dumbbell-C9IjXewZ.cjs} +1 -1
- package/dist/{vue-ui-flow-BVMI08gu.cjs → vue-ui-flow-BuDDlyI4.cjs} +1 -1
- package/dist/{vue-ui-flow-sROhIAoF.js → vue-ui-flow-g7pN_Y8S.js} +9 -9
- package/dist/{vue-ui-funnel-B0-6Ohp6.js → vue-ui-funnel-BG4S2tkJ.js} +9 -9
- package/dist/{vue-ui-funnel-FjjWshAy.cjs → vue-ui-funnel-DgcymfFg.cjs} +1 -1
- package/dist/{vue-ui-galaxy-DwBLJ_ud.cjs → vue-ui-galaxy-B1XpQCbj.cjs} +1 -1
- package/dist/{vue-ui-galaxy-a73Wv_D9.js → vue-ui-galaxy-DZyXCGNE.js} +11 -11
- package/dist/{vue-ui-gauge-D71MHsHI.js → vue-ui-gauge-C5XEkmG7.js} +7 -7
- package/dist/{vue-ui-gauge-BFsd6hZB.cjs → vue-ui-gauge-sup8MraV.cjs} +1 -1
- package/dist/{vue-ui-gizmo-H7CRW_B1.cjs → vue-ui-gizmo-Con0HdYV.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BhBHAkTu.js → vue-ui-gizmo-DnbVyXdl.js} +3 -3
- package/dist/{vue-ui-heatmap-DTHF8Wnw.cjs → vue-ui-heatmap-CMEjJp25.cjs} +1 -1
- package/dist/{vue-ui-heatmap-pB5l7X1i.js → vue-ui-heatmap-JSiKvLGN.js} +10 -10
- package/dist/{vue-ui-history-plot-BdpLONh8.js → vue-ui-history-plot-DX5bxrQE.js} +11 -11
- package/dist/{vue-ui-history-plot-CWor5BkY.cjs → vue-ui-history-plot-LSny6C9i.cjs} +1 -1
- package/dist/{vue-ui-kpi-CDU2UdYZ.js → vue-ui-kpi-D5hjTCaA.js} +3 -3
- package/dist/{vue-ui-kpi-DLN9UTi9.cjs → vue-ui-kpi-Dn-ifyxf.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-eZubk-59.cjs → vue-ui-mini-loader-Dav_SSSQ.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-D0nRZeUQ.js → vue-ui-mini-loader-QaFKK0A0.js} +2 -2
- package/dist/{vue-ui-molecule-BIrr5biv.cjs → vue-ui-molecule-BB1J8Dbo.cjs} +1 -1
- package/dist/{vue-ui-molecule-CVwa7je_.js → vue-ui-molecule-BLbSDPvP.js} +10 -10
- package/dist/{vue-ui-mood-radar-Xwyyay9J.cjs → vue-ui-mood-radar-2i9AMp4M.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-259F_TGi.js → vue-ui-mood-radar-DALxGShD.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BnFkovqB.cjs → vue-ui-nested-donuts-BNE1i3hX.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CEbRPLqg.js → vue-ui-nested-donuts-CrwpbYj1.js} +11 -11
- package/dist/{vue-ui-onion-DTCFbg0S.js → vue-ui-onion-CCAFH42D.js} +11 -11
- package/dist/{vue-ui-onion-C4YGHPyl.cjs → vue-ui-onion-Dg11ctuw.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-BbTlJU53.cjs → vue-ui-parallel-coordinate-plot-BEVOsDtM.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-Br1aduNj.js → vue-ui-parallel-coordinate-plot-v8Ynm3w5.js} +12 -12
- package/dist/{vue-ui-quadrant-DgQYL-Gw.cjs → vue-ui-quadrant--F_ZyLFk.cjs} +1 -1
- package/dist/{vue-ui-quadrant-BIS8ODgU.js → vue-ui-quadrant-HwNbrGMQ.js} +12 -12
- package/dist/{vue-ui-quick-chart-BDbWfjBw.js → vue-ui-quick-chart-CVfXiwBs.js} +9 -9
- package/dist/{vue-ui-quick-chart-yUmVs4oO.cjs → vue-ui-quick-chart-DQdiHpqZ.cjs} +1 -1
- package/dist/{vue-ui-radar-mhl13Wrd.cjs → vue-ui-radar-BAp4IGrw.cjs} +1 -1
- package/dist/{vue-ui-radar-C-k3pIyW.js → vue-ui-radar-DpBICEaV.js} +12 -12
- package/dist/{vue-ui-rating-CIhWXY70.js → vue-ui-rating-Bjmj2p6V.js} +2 -2
- package/dist/{vue-ui-rating-C6kJnYvS.cjs → vue-ui-rating-D72lzAno.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-0gNlkYk7.cjs → vue-ui-relation-circle-C9hr45P6.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-pkH3-y2p.js → vue-ui-relation-circle-CWpiwvyP.js} +7 -7
- package/dist/{vue-ui-rings-CV9yd0Ug.cjs → vue-ui-rings-BhZWnXiZ.cjs} +1 -1
- package/dist/{vue-ui-rings-DDrCUaRz.js → vue-ui-rings-Cp0F0mSk.js} +12 -12
- package/dist/{vue-ui-scatter-CnsqbO3Z.js → vue-ui-scatter-BJrYQZAa.js} +12 -12
- package/dist/{vue-ui-scatter-BNBEA9aJ.cjs → vue-ui-scatter-BWk3QtZv.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DvKtaZRj.js → vue-ui-screenshot-R5QLfXl9.js} +1 -1
- package/dist/{vue-ui-screenshot-Bn92LBO0.cjs → vue-ui-screenshot-sXfihBWk.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BLEWRF9c.js → vue-ui-skeleton-Txytd5FS.js} +3 -3
- package/dist/{vue-ui-skeleton-Cp7xQivG.cjs → vue-ui-skeleton-raZOriRn.cjs} +1 -1
- package/dist/{vue-ui-smiley-C2mcRykY.cjs → vue-ui-smiley-BWIjNtsk.cjs} +1 -1
- package/dist/{vue-ui-smiley-CItAN3kt.js → vue-ui-smiley-Dcyf6FLr.js} +2 -2
- package/dist/{vue-ui-spark-trend-Av2htm-a.js → vue-ui-spark-trend-1CYZEhc-.js} +5 -5
- package/dist/{vue-ui-spark-trend-QCX1L9sT.cjs → vue-ui-spark-trend-DO9LbfKP.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-yx3IrEbr.cjs → vue-ui-sparkbar-BydU6AYL.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-DlHEIr5y.js → vue-ui-sparkbar-_ImT_rmQ.js} +4 -4
- package/dist/{vue-ui-sparkgauge-IKjgedtT.cjs → vue-ui-sparkgauge-CP1tnMln.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-0TLHJqm0.js → vue-ui-sparkgauge-DwVjglhg.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-DSsT7LNX.js → vue-ui-sparkhistogram-BsaYQmh9.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-qQeJmfXa.cjs → vue-ui-sparkhistogram-DUi7rP7a.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CFHhOskK.cjs → vue-ui-sparkline-CMURk8mO.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CFTe1quQ.js → vue-ui-sparkline-DmePoZxQ.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-BItz67Xe.js → vue-ui-sparkstackbar-B83LJYrz.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-DiWo6prF.cjs → vue-ui-sparkstackbar-DIsWXCPJ.cjs} +1 -1
- package/dist/{vue-ui-stackbar-Hpi0jRyt.cjs → vue-ui-stackbar-CUmbJBQz.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DTZqWNNO.js → vue-ui-stackbar-D7ayfpLF.js} +13 -13
- package/dist/{vue-ui-strip-plot-Cx2FeTty.js → vue-ui-strip-plot-Co4JPPsu.js} +11 -11
- package/dist/{vue-ui-strip-plot-C4yxTha0.cjs → vue-ui-strip-plot-D4VJAtJv.cjs} +1 -1
- package/dist/{vue-ui-table-Bix1j1fJ.js → vue-ui-table-CqBuNHeX.js} +1 -1
- package/dist/{vue-ui-table-heatmap-DurTtOqy.cjs → vue-ui-table-heatmap-B8V6IJRD.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-ChJcwy7O.js → vue-ui-table-heatmap-CcVjIvRn.js} +4 -4
- package/dist/{vue-ui-table-sparkline-BAFEMARQ.js → vue-ui-table-sparkline-A52CEigV.js} +5 -5
- package/dist/{vue-ui-table-sparkline-BtHmcSN6.cjs → vue-ui-table-sparkline-DqNoUFXf.cjs} +1 -1
- package/dist/{vue-ui-table-CJNbNcGy.cjs → vue-ui-table-vBPVOVdW.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BFyVVOwQ.js → vue-ui-thermometer-CZwzbH4U.js} +7 -7
- package/dist/{vue-ui-thermometer-Drjrf95Z.cjs → vue-ui-thermometer-s-VfsY-H.cjs} +1 -1
- package/dist/{vue-ui-timer-OSLT_1m8.js → vue-ui-timer-CtLLA8zf.js} +5 -5
- package/dist/{vue-ui-timer-DDOk0OTr.cjs → vue-ui-timer-xBfXaHH4.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-KpITx0tF.js → vue-ui-tiremarks-DAf44W2K.js} +7 -7
- package/dist/{vue-ui-tiremarks-QsuYkqiG.cjs → vue-ui-tiremarks-gIdzqyuY.cjs} +1 -1
- package/dist/{vue-ui-treemap-BaBGqaku.js → vue-ui-treemap-aeR4rGYE.js} +11 -11
- package/dist/{vue-ui-treemap-Cy9Dzxff.cjs → vue-ui-treemap-ux_WLWjB.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-Co3wvtzE.js → vue-ui-vertical-bar-BVxrBq8G.js} +12 -12
- package/dist/{vue-ui-vertical-bar-FZQr77nT.cjs → vue-ui-vertical-bar-D4XQjiLY.cjs} +1 -1
- package/dist/{vue-ui-waffle-Cn6kiy1l.cjs → vue-ui-waffle-lSlfXn1P.cjs} +1 -1
- package/dist/{vue-ui-waffle-DhnLmJ45.js → vue-ui-waffle-o1EM500w.js} +12 -12
- package/dist/{vue-ui-wheel-DXT33l3Q.js → vue-ui-wheel-CU_OW9-2.js} +7 -7
- package/dist/{vue-ui-wheel-BPTvUaom.cjs → vue-ui-wheel-lEiHpMDb.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-BK6GChwj.cjs → vue-ui-word-cloud-BhbV09xg.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-CXuEH53W.js → vue-ui-word-cloud-DKlJ3x7X.js} +10 -10
- package/dist/{vue-ui-xy-DBoMUbad.js → vue-ui-xy-CsFUNXKI.js} +146 -139
- package/dist/{vue-ui-xy-BIWpE650.cjs → vue-ui-xy-DdSlwQAQ.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-ZREDvUHG.cjs → vue-ui-xy-canvas-Dow767yO.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-BkkC46-q.js → vue-ui-xy-canvas-DxpbUfTQ.js} +12 -12
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BYGiASHP.cjs"),le=require("./useNestedProp-DtjjNlbm.cjs"),ae=require("./usePrinter-BNP686uC.cjs"),Ce=require("./PackageVersion-CkZZ1O_f.cjs"),we=require("./Legend-DXZ1SEB4.cjs"),Be=require("./Title-J0zilijE.cjs"),Se=require("./Tooltip-B3qjUlBg.cjs"),_e=require("./DataTable-Byw5diyo.cjs"),Ne=require("./vue-ui-accordion-KL1QlKX4.cjs"),ze=require("./PenAndPaper-CCISmaF4.cjs"),$e=require("./vue-ui-skeleton-Cp7xQivG.cjs"),oe=require("./useResponsive-N8jl0-aC.cjs"),Le=require("./useUserOptionState-BgepsfED.cjs"),Ee=require("./useChartAccessibility-Cm7nkzTG.cjs"),Me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["id"],Ae=["xmlns","viewBox"],Pe=["x","y","width","height"],Ve={key:1},Fe=["id"],Oe=["stop-color"],De=["stop-color"],Ie=["stop-color"],Xe={key:2},qe=["x1","x2","y1","y2","stroke","stroke-width"],Ye={key:3},Re=["x","y","fill","font-size"],je=["transform","font-size","fill","font-weight"],Ue={key:5},He=["x1","x2","y1","y2","stroke","stroke-width"],We={key:6},Ge=["transform","fill","font-size","text-anchor"],Ze=["x","y","font-size","fill","font-weight"],Je=["x1","x2","y1","y2","stroke","stroke-width"],Ke=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["d","stroke","stroke-width"],et=["d","stroke","stroke-width"],tt=["cx","cy","fill","r"],lt=["cx","cy","fill","r","stroke","stroke-width"],at={key:1},ot=["x","y","font-size","fill","font-weight"],st={key:2},rt=["x","y","font-size","font-weight","fill"],nt=["cx","cy","r","onMouseenter","onClick"],it={key:5,class:"vue-data-ui-watermark"},ut=["onClick"],ct=["innerHTML"],vt={__name:"vue-ui-history-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(se,{expose:re,emit:ne}){const{vue_ui_history_plot:ie}=r.useConfig(),c=se,k=e.ref(null),M=e.ref(null),T=e.ref(0),A=e.ref(null),P=e.ref(0),V=e.ref(0),F=e.ref(0),w=e.ref(null),O=e.ref(null),b=e.ref(r.createUid()),N=e.ref(!1),z=e.ref(""),h=e.ref([]),B=e.ref(!1),p=e.ref(null),C=e.ref(!1),D=e.ref(null),y=e.computed({get:()=>!!c.dataset&&c.dataset.length,set:l=>l}),I=ne;e.onMounted(X),e.onBeforeUnmount(()=>{w.value&&w.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=oe.throttle(()=>{const{width:o,height:a}=oe.useResponsive({chart:k.value,title:t.value.style.chart.title.text?M.value:null,noTitle:O.value,legend:t.value.style.chart.legend.show?A.value:null,source:D.value});requestAnimationFrame(()=>{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})})});w.value=new ResizeObserver(l),w.value.observe(k.value.parentNode)}}function q(){const l=le.useNestedProp({userConfig:c.config,defaultConfig:ie});let o={};return l.theme?o={...le.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:()=>q(),set:l=>l}),{userOptionsVisible:$,setUserOptionsVisibility:Y,keepUserOptionState:R}=Le.useUserOptionState({config:t.value}),{svgRef:j}=Ee.useChartAccessibility({config:t.value.style.chart.title});e.watch(()=>c.config,l=>{t.value=q(),$.value=!t.value.userOptions.showOnChartHover,X(),T.value+=1,V.value+=1,P.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,f.value.showTable=t.value.table.show,f.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ae.usePrinter({elementId:`history_plot_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-history-plot"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ce=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),f=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):ce.value[o]||r.palette[o]||r.palette[o%r.palette.length],seriesIndex:o})):[]),ve=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.x))):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.x)));return l<0?l:0}),he=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.y))):1),ye=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?de.value:t.value.style.chart.axes.x.scaleMin,t.value.style.chart.axes.x.scaleMax===null?ve.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?ye.value:t.value.style.chart.axes.y.scaleMin,t.value.style.chart.axes.y.scaleMax===null?he.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 fe(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 me(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,m)=>({valueX:s.x,valueY:s.y,label:s.label,x:fe(s.x),y:me(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 Z(l){h.value.includes(l)?h.value=h.value.filter(o=>o!==l):h.value.push(l)}const J=e.computed(()=>x.value.map(l=>({...l,opacity:h.value.includes(l.seriesIndex)?.5:1,segregate:()=>Z(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 xe(l){I("selectDatapoint",l)}function K(l){I("selectLegend",{...l,isSegregated:!l.isSegregated,opacity:l.isSegregated?1:.5})}function ge(l){B.value=l,F.value+=1}const L=e.ref(null);function ke({datapoint:l,plotIndex:o,seriesIndex:a}){L.value={datapoint:l,seriesIndex:a,plotIndex:o,config:t.value,series:x.value},p.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 Q(){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(m=>[[m.seriesName],[m.label],[m.valueX],[m.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 ee(){f.value.showTable=!f.value.showTable}function te(){f.value.showTooltip=!f.value.showTooltip}function be(){return g.value}return re({getData:be,generatePdf:W,generateCsv:Q,generateImage:G,toggleTable:ee,toggleTooltip:te,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":B.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(Y)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Y)(!1))},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ze.PenAndPaper,{key:0,svgRef:e.unref(j),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:E},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.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:M,class:"vue-ui-xy-title",style:e.normalizeStyle(`font-family:${t.value.style.fontFamily}`)},[(e.openBlock(),e.createBlock(Be._sfc_main,{key:`title_${T.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(R)||e.unref($))?(e.openBlock(),e.createBlock(ae.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),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:B.value,chartElement:k.value,position:t.value.userOptions.position,isTooltip:f.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:ge,onGeneratePdf:e.unref(W),onGenerateCsv:Q,onGenerateImage:e.unref(G),onToggleTable:ee,onToggleTooltip:te,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(R)?e.unref($)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:u})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:u})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}: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:"6"}: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:"7"}: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,ref_key:"svgRef",ref:j,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(Ce._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,Pe)):e.createCommentVNode("",!0),t.value.style.chart.plots.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ve,[(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,Oe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(a.color,.1)},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ie)],8,Fe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalLines.show?(e.openBlock(),e.createElementBlock("g",Xe,[(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,qe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.y.labels.show?(e.openBlock(),e.createElementBlock("g",Ye,[(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,Re))),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,je)):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalLines.show?(e.openBlock(),e.createElementBlock("g",Ue,[(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,He))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.x.labels.show?(e.openBlock(),e.createElementBlock("g",We,[(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,Ge))),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,Ze)):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,Je)):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,Ke)):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:p.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,Qe),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,et)],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,tt))),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:p.value===null||p.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},null,14,lt))),256)),t.value.style.chart.plots.labels.show?(e.openBlock(),e.createElementBlock("g",at,[(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:p.value===null||p.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(s.label),15,ot))),256))])):e.createCommentVNode("",!0),t.value.style.chart.plots.indexLabels.show?(e.openBlock(),e.createElementBlock("g",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(s,m)=>(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:p.value===null||p.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(t.value.style.chart.plots.indexLabels.startAtZero?m:m+1),15,rt))),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:m=>ke({datapoint:u,plotIndex:s,seriesIndex:a.seriesIndex}),onMouseleave:o[0]||(o[0]=m=>{N.value=!1,p.value=null}),onClick:()=>xe(u)},null,40,nt))),256))]))),256)),e.renderSlot(l.$slots,"svg",{svg:v.value},void 0,!0)],12,Ae)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.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:A},[t.value.style.chart.legend.show&&y.value?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${P.value}`,legendSet:J.value,config:pe.value,onClickMarker:o[1]||(o[1]=({legend:a})=>{Z(a.seriesIndex),K(a)})},{item:e.withCtx(({legend:a,index:u})=>[e.createElementVNode("div",{onClick:s=>{a.segregate(),K(a)},style:e.normalizeStyle(`opacity:${h.value.includes(a.seriesIndex)?.5:1}`)},e.toDisplayString(a.name),13,ut)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:J.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:D,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Se._sfc_main,{show:f.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:B.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.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(Ne.default,{key:8,hideDetails:"",config:{open:f.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(_e.DataTable,{key:`table_${V.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=>f.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,ct)]),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,Te))}},dt=Me._export_sfc(vt,[["__scopeId","data-v-8852c1fd"]]);exports.default=dt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-0ZojJ1mH.cjs"),le=require("./useNestedProp-OY09Srif.cjs"),ae=require("./usePrinter-DDgV-g0v.cjs"),Ce=require("./PackageVersion-BV7LcPDV.cjs"),we=require("./Legend-Bpt6RBG8.cjs"),Be=require("./Title-DjxAodUf.cjs"),Se=require("./Tooltip-ogV3t9Et.cjs"),_e=require("./DataTable-r2HNsyUX.cjs"),Ne=require("./vue-ui-accordion-BboUGt-9.cjs"),ze=require("./PenAndPaper-DP7fHf74.cjs"),$e=require("./vue-ui-skeleton-raZOriRn.cjs"),oe=require("./useResponsive-N8jl0-aC.cjs"),Le=require("./useUserOptionState-BgepsfED.cjs"),Ee=require("./useChartAccessibility-Cm7nkzTG.cjs"),Me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["id"],Ae=["xmlns","viewBox"],Pe=["x","y","width","height"],Ve={key:1},Fe=["id"],Oe=["stop-color"],De=["stop-color"],Ie=["stop-color"],Xe={key:2},qe=["x1","x2","y1","y2","stroke","stroke-width"],Ye={key:3},Re=["x","y","fill","font-size"],je=["transform","font-size","fill","font-weight"],Ue={key:5},He=["x1","x2","y1","y2","stroke","stroke-width"],We={key:6},Ge=["transform","fill","font-size","text-anchor"],Ze=["x","y","font-size","fill","font-weight"],Je=["x1","x2","y1","y2","stroke","stroke-width"],Ke=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["d","stroke","stroke-width"],et=["d","stroke","stroke-width"],tt=["cx","cy","fill","r"],lt=["cx","cy","fill","r","stroke","stroke-width"],at={key:1},ot=["x","y","font-size","fill","font-weight"],st={key:2},rt=["x","y","font-size","font-weight","fill"],nt=["cx","cy","r","onMouseenter","onClick"],it={key:5,class:"vue-data-ui-watermark"},ut=["onClick"],ct=["innerHTML"],vt={__name:"vue-ui-history-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(se,{expose:re,emit:ne}){const{vue_ui_history_plot:ie}=r.useConfig(),c=se,k=e.ref(null),M=e.ref(null),T=e.ref(0),A=e.ref(null),P=e.ref(0),V=e.ref(0),F=e.ref(0),w=e.ref(null),O=e.ref(null),b=e.ref(r.createUid()),N=e.ref(!1),z=e.ref(""),h=e.ref([]),B=e.ref(!1),p=e.ref(null),C=e.ref(!1),D=e.ref(null),y=e.computed({get:()=>!!c.dataset&&c.dataset.length,set:l=>l}),I=ne;e.onMounted(X),e.onBeforeUnmount(()=>{w.value&&w.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=oe.throttle(()=>{const{width:o,height:a}=oe.useResponsive({chart:k.value,title:t.value.style.chart.title.text?M.value:null,noTitle:O.value,legend:t.value.style.chart.legend.show?A.value:null,source:D.value});requestAnimationFrame(()=>{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})})});w.value=new ResizeObserver(l),w.value.observe(k.value.parentNode)}}function q(){const l=le.useNestedProp({userConfig:c.config,defaultConfig:ie});let o={};return l.theme?o={...le.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:()=>q(),set:l=>l}),{userOptionsVisible:$,setUserOptionsVisibility:Y,keepUserOptionState:R}=Le.useUserOptionState({config:t.value}),{svgRef:j}=Ee.useChartAccessibility({config:t.value.style.chart.title});e.watch(()=>c.config,l=>{t.value=q(),$.value=!t.value.userOptions.showOnChartHover,X(),T.value+=1,V.value+=1,P.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,f.value.showTable=t.value.table.show,f.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ae.usePrinter({elementId:`history_plot_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-history-plot"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ce=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),f=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):ce.value[o]||r.palette[o]||r.palette[o%r.palette.length],seriesIndex:o})):[]),ve=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.x))):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.x)));return l<0?l:0}),he=e.computed(()=>y.value?Math.max(...x.value.filter(l=>!h.value.includes(l.seriesIndex)).flatMap(l=>l.values.map(o=>o.y))):1),ye=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?de.value:t.value.style.chart.axes.x.scaleMin,t.value.style.chart.axes.x.scaleMax===null?ve.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?ye.value:t.value.style.chart.axes.y.scaleMin,t.value.style.chart.axes.y.scaleMax===null?he.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 fe(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 me(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,m)=>({valueX:s.x,valueY:s.y,label:s.label,x:fe(s.x),y:me(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 Z(l){h.value.includes(l)?h.value=h.value.filter(o=>o!==l):h.value.push(l)}const J=e.computed(()=>x.value.map(l=>({...l,opacity:h.value.includes(l.seriesIndex)?.5:1,segregate:()=>Z(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 xe(l){I("selectDatapoint",l)}function K(l){I("selectLegend",{...l,isSegregated:!l.isSegregated,opacity:l.isSegregated?1:.5})}function ge(l){B.value=l,F.value+=1}const L=e.ref(null);function ke({datapoint:l,plotIndex:o,seriesIndex:a}){L.value={datapoint:l,seriesIndex:a,plotIndex:o,config:t.value,series:x.value},p.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 Q(){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(m=>[[m.seriesName],[m.label],[m.valueX],[m.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 ee(){f.value.showTable=!f.value.showTable}function te(){f.value.showTooltip=!f.value.showTooltip}function be(){return g.value}return re({getData:be,generatePdf:W,generateCsv:Q,generateImage:G,toggleTable:ee,toggleTooltip:te,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":B.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(Y)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Y)(!1))},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ze.PenAndPaper,{key:0,svgRef:e.unref(j),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:E},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.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:M,class:"vue-ui-xy-title",style:e.normalizeStyle(`font-family:${t.value.style.fontFamily}`)},[(e.openBlock(),e.createBlock(Be._sfc_main,{key:`title_${T.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(R)||e.unref($))?(e.openBlock(),e.createBlock(ae.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),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:B.value,chartElement:k.value,position:t.value.userOptions.position,isTooltip:f.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:ge,onGeneratePdf:e.unref(W),onGenerateCsv:Q,onGenerateImage:e.unref(G),onToggleTable:ee,onToggleTooltip:te,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(R)?e.unref($)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:u})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:u})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}: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:"6"}: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:"7"}: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,ref_key:"svgRef",ref:j,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(Ce._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,Pe)):e.createCommentVNode("",!0),t.value.style.chart.plots.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ve,[(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,Oe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(a.color,.1)},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ie)],8,Fe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalLines.show?(e.openBlock(),e.createElementBlock("g",Xe,[(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,qe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.y.labels.show?(e.openBlock(),e.createElementBlock("g",Ye,[(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,Re))),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,je)):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalLines.show?(e.openBlock(),e.createElementBlock("g",Ue,[(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,He))),256))])):e.createCommentVNode("",!0),t.value.style.chart.axes.x.labels.show?(e.openBlock(),e.createElementBlock("g",We,[(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,Ge))),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,Ze)):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,Je)):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,Ke)):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:p.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,Qe),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,et)],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,tt))),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:p.value===null||p.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},null,14,lt))),256)),t.value.style.chart.plots.labels.show?(e.openBlock(),e.createElementBlock("g",at,[(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:p.value===null||p.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(s.label),15,ot))),256))])):e.createCommentVNode("",!0),t.value.style.chart.plots.indexLabels.show?(e.openBlock(),e.createElementBlock("g",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(s,m)=>(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:p.value===null||p.value.id===s.id?1:.3,transition:"opacity 0.2s ease-in-out"})},e.toDisplayString(t.value.style.chart.plots.indexLabels.startAtZero?m:m+1),15,rt))),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:m=>ke({datapoint:u,plotIndex:s,seriesIndex:a.seriesIndex}),onMouseleave:o[0]||(o[0]=m=>{N.value=!1,p.value=null}),onClick:()=>xe(u)},null,40,nt))),256))]))),256)),e.renderSlot(l.$slots,"svg",{svg:v.value},void 0,!0)],12,Ae)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.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:A},[t.value.style.chart.legend.show&&y.value?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${P.value}`,legendSet:J.value,config:pe.value,onClickMarker:o[1]||(o[1]=({legend:a})=>{Z(a.seriesIndex),K(a)})},{item:e.withCtx(({legend:a,index:u})=>[e.createElementVNode("div",{onClick:s=>{a.segregate(),K(a)},style:e.normalizeStyle(`opacity:${h.value.includes(a.seriesIndex)?.5:1}`)},e.toDisplayString(a.name),13,ut)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:J.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:D,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Se._sfc_main,{show:f.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:B.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.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(Ne.default,{key:8,hideDetails:"",config:{open:f.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(_e.DataTable,{key:`table_${V.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=>f.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,ct)]),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,Te))}},dt=Me._export_sfc(vt,[["__scopeId","data-v-8852c1fd"]]);exports.default=dt;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as D, useSlots as x, onMounted as g, watch as C, ref as $, createElementBlock as i, openBlock as s, normalizeStyle as u, normalizeClass as r, 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-CPc3u5vP.js";
|
|
3
|
+
import { u as B, i as L, f as M } from "./index-4RRlWcLr.js";
|
|
4
|
+
import E from "./vue-ui-digits-De_0njxV.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-OY09Srif.cjs"),u=require("./index-0ZojJ1mH.cjs"),y=require("./vue-ui-digits--Uo-UP39.cjs"),C={__name:"vue-ui-kpi",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(n){const{vue_ui_kpi:m}=u.useConfig(),o=n,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 +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-OY09Srif.cjs"),n=require("./index-0ZojJ1mH.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){e.useCssVars(k=>({"4430a3e6":c.value,"056a6732":d.value,"7f3540a4":p.value}));const{vue_ui_mini_loader:a}=n.useConfig(),i=u,t=e.computed(()=>v.useNestedProp({userConfig:i.config,defaultConfig:a})),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",{class:"vue-ui-mini-loader",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-3b670831"]]);exports.default=N;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCssVars as h, computed as r, ref as f, createElementBlock as n, openBlock as u, unref as M, createCommentVNode as a, createElementVNode as t, normalizeStyle as l } 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-CPc3u5vP.js";
|
|
3
|
+
import { u as y, X as L } from "./index-4RRlWcLr.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"),y=require("./index-BYGiASHP.cjs"),ke=require("./Title-J0zilijE.cjs"),re=require("./usePrinter-BNP686uC.cjs"),be=require("./DataTable-Byw5diyo.cjs"),Ce=require("./Tooltip-B3qjUlBg.cjs"),we=require("./vue-ui-skeleton-Cp7xQivG.cjs"),Be=require("./vue-ui-accordion-KL1QlKX4.cjs"),ae=require("./useNestedProp-DtjjNlbm.cjs"),Pe=require("./PackageVersion-CkZZ1O_f.cjs"),xe=require("./PenAndPaper-CCISmaF4.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),$e=require("./useChartAccessibility-Cm7nkzTG.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["cx","cy","r","fill","stroke","stroke-width","onClick","onMouseover"],Ne=["x","y","height","width","onClick","onMouseover"],Te={__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:["click","hover"],setup(s,{emit:N}){const T=s,P=N;function a(r){P("click",r)}function p(r){P("hover",r)}return e.toRef(T,"dataset").value.forEach(r=>{r.nodes&&r.nodes.length>0&&r.nodes.forEach(v=>{v.ancestor=r})}),(r,v)=>{const L=e.resolveComponent("RecursiveCircles",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,i=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.polygonPath&&i.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.polygonPath.coordinates,(k,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("circle",{cx:k.x,cy:k.y,r:i.circleRadius,fill:`url(#gradient_${i.color})`,stroke:s.hoveredUid&&s.hoveredUid===i.uid?s.strokeHovered:s.stroke,"stroke-width":s.hoveredUid&&s.hoveredUid===i.uid?i.circleRadius/6:i.circleRadius/12,style:{cursor:"pointer"},onClick:x=>a(i),onMouseover:x=>p(i),onMouseleave:v[0]||(v[0]=x=>p(null))},null,40,Se),r.$slots.node?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:k.x-i.circleRadius,y:k.y-i.circleRadius,height:i.circleRadius*2,width:i.circleRadius*2,style:{overflow:"visible"},onClick:e.withModifiers(x=>a(i),["stop"]),onMouseover:x=>p(i),onMouseleave:v[1]||(v[1]=x=>p(null))},[e.renderSlot(r.$slots,"node",e.mergeProps({ref_for:!0},{node:i}))],40,Ne)):e.createCommentVNode("",!0)],64))),256)),i.nodes&&i.nodes.length>0?(e.openBlock(),e.createBlock(L,{key:0,dataset:i.nodes,color:s.color,stroke:s.stroke,strokeHovered:s.strokeHovered,hoveredUid:s.hoveredUid,onClick:a,onHover:p},{node:e.withCtx(({node:k})=>[e.renderSlot(r.$slots,"node",e.mergeProps({ref_for:!0},{node:k}))]),_:2},1032,["dataset","color","stroke","strokeHovered","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Le=["x1","y1","x2","y2","stroke","stroke-width"],Ve=["x1","y1","x2","y2","stroke","stroke-width"],Re={__name:"RecursiveLinks",props:{dataset:{type:Array,default:()=>[]},color:{type:String,default:"#DDDDDD"},backgroundColor:{type:String,default:"#FFFFFF"}},setup(s){const N=s;return e.toRef(N,"dataset").value.forEach(P=>{P.nodes&&P.nodes.length>0&&P.nodes.forEach(a=>{a.ancestor=P})}),(P,a)=>{const p=e.resolveComponent("RecursiveLinks",!0);return e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,c=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.polygonPath&&c.polygonPath.coordinates?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.polygonPath.coordinates,(r,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.ancestor&&c.ancestor.polygonPath?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("line",{x1:r.x,y1:r.y,x2:c.ancestor.polygonPath.coordinates[0].x,y2:c.ancestor.polygonPath.coordinates[0].y,stroke:s.backgroundColor,"stroke-width":c.circleRadius/1.5},null,8,Le),e.createElementVNode("line",{x1:r.x,y1:r.y,x2:c.ancestor.polygonPath.coordinates[0].x,y2:c.ancestor.polygonPath.coordinates[0].y,stroke:s.color,"stroke-width":c.circleRadius/2},null,8,Ve)],64)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,c=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.polygonPath&&c.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.nodes&&c.nodes.length>0?(e.openBlock(),e.createBlock(p,{key:0,dataset:c.nodes,color:s.color,backgroundColor:s.backgroundColor},null,8,["dataset","color","backgroundColor"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256))],64)}}},Oe=["x","y","fill","font-size"],Ue={__name:"RecursiveLabels",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null}},emits:["zoom","hover"],setup(s,{emit:N}){const T=s;return e.toRef(T,"dataset").value.forEach(a=>{a.nodes&&a.nodes.length>0&&a.nodes.forEach(p=>{p.ancestor=a})}),(a,p)=>{const c=e.resolveComponent("RecursiveLabels",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,r=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.polygonPath&&r.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.polygonPath.coordinates,v=>(e.openBlock(),e.createElementBlock("text",{x:v.x,y:v.y+r.circleRadius*2,fill:s.color,"font-size":r.circleRadius,"text-anchor":"middle",style:{opacity:"0.8","pointer-events":"none"}},e.toDisplayString(r.name),9,Oe))),256)),r.nodes&&r.nodes.length>0?(e.openBlock(),e.createBlock(c,{key:0,dataset:r.nodes,color:s.color,hoveredUid:s.hoveredUid},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}};function De(s,N={x:0,y:0,width:100,height:100},T=1,P){const a=e.ref({...N}),p=e.ref(1),c=e.ref(!1),r=e.ref({x:0,y:0});let v={x:0,y:0},L=null,i=null;function k(l){var E;const d=s.value;if(!d)return{x:0,y:0};const m=d.createSVGPoint();m.x=l.clientX,m.y=l.clientY;const C=(E=d.getScreenCTM())==null?void 0:E.inverse();return C?m.matrixTransform(C):{x:0,y:0}}function $(l){c.value=!0;const d=k(l.touches?l.touches[0]:l);r.value={x:d.x,y:d.y},v={x:0,y:0}}function x(l){if(!c.value)return;const d=k(l.touches?l.touches[0]:l);let m=d.x-r.value.x,C=d.y-r.value.y;Math.abs(m)<.3&&Math.abs(C)<.3||(v.x=m*.8+v.x*.2,v.y=C*.8+v.y*.2,r.value=d,L||(L=requestAnimationFrame(q)))}function q(){a.value.x-=v.x,a.value.y-=v.y,L=null}function F(){c.value=!1}function t(l){l.preventDefault();const d=l.deltaY>0?.9:1.1;R(d,k(l))}function V(l){l.preventDefault();const d=k(l),m=1.02*(1+T/100);H(m,d)}function H(l,d){i&&cancelAnimationFrame(i);let m=p.value,C=m*l,E=0;const g=()=>{E+=.02;let U=m+(C-m)*G(E);if(E>=1){p.value=C,i=null;return}R(U/m,d),i=requestAnimationFrame(g)};g()}const G=l=>l<.5?2*l*l:-1+(4-2*l)*l;function R(l,d){const m=p.value*l,C=m/p.value,E=a.value.width/C,g=a.value.height/C,U=(d.x-a.value.x)*(1-1/C),X=(d.y-a.value.y)*(1-1/C);a.value.x+=U,a.value.y+=X,a.value.width=E,a.value.height=g,p.value=m}e.onMounted(A),e.onUnmounted(O);function A(){const l=s.value;l&&(l.addEventListener("mousedown",$),l.addEventListener("mousemove",x),l.addEventListener("mouseup",F),l.addEventListener("mouseleave",F),l.addEventListener("wheel",t,{passive:!1}),l.addEventListener("dblclick",V),l.addEventListener("touchstart",d=>{d.preventDefault(),$(d)},{passive:!1}),l.addEventListener("touchmove",d=>{d.preventDefault(),x(d)},{passive:!1}),l.addEventListener("touchend",F))}function O(){const l=s.value;l&&(l.removeEventListener("mousedown",$),l.removeEventListener("mousemove",x),l.removeEventListener("mouseup",F),l.removeEventListener("mouseleave",F),l.removeEventListener("wheel",t),l.removeEventListener("dblclick",V),l.removeEventListener("touchstart",$),l.removeEventListener("touchmove",x),l.removeEventListener("touchend",F))}return e.watchEffect(()=>(P.value?A():O(),()=>{O()})),{viewBox:a}}const Ae=["id"],ze={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},Ie={key:2,style:"width:100%;background:transparent;"},Me=["xmlns","viewBox"],_e=["width","height"],qe=["id"],He=["stop-color"],Ge=["stop-color"],je={key:5,class:"vue-data-ui-watermark"},Xe={key:7,ref:"source",dir:"auto"},Ye=["innerHTML"],We={__name:"vue-ui-molecule",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectNode"],setup(s,{expose:N,emit:T}){const{vue_ui_molecule:P}=y.useConfig(),a=s,p=T,c=e.computed(()=>!!a.dataset&&a.dataset.length);e.onMounted(()=>{r()});function r(){y.objectIsEmpty(a.dataset)&&y.error({componentName:"VueUiMolecule",type:"dataset"})}const v=e.ref(y.createUid()),L=e.ref(null),i=e.ref(!1),k=e.ref(""),$=e.ref(null),x=e.ref(0),q=e.ref(0),F=e.ref(0),t=e.computed({get:()=>A(),set:o=>o}),{userOptionsVisible:V,setUserOptionsVisibility:H,keepUserOptionState:G}=Ee.useUserOptionState({config:t.value}),{svgRef:R}=$e.useChartAccessibility({config:t.value.style.chart.title});function A(){const o=ae.useNestedProp({userConfig:a.config,defaultConfig:P});return o.theme?{...ae.useNestedProp({userConfig:y.themes.vue_ui_molecule[o.theme]||a.config,defaultConfig:o}),customPalette:y.themePalettes[o.theme]||y.palette}:o}e.watch(()=>a.config,o=>{t.value=A(),V.value=!t.value.userOptions.showOnChartHover,r(),q.value+=1,F.value+=1,g.value.showTable=t.value.table.show,g.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const{isPrinting:O,isImaging:l,generatePdf:d,generateImage:m}=re.usePrinter({elementId:`cluster_${v.value}`,fileName:t.value.style.chart.title.text||"vue-ui-molecule"}),C=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),E=e.computed(()=>y.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showDataLabels:!0,showTooltip:t.value.style.chart.tooltip.show});function U(o,u=0){return Array.isArray(o)&&o.length>0&&o[0].nodes?U(o[0].nodes,u+1):u}function X(){const o=U(a.dataset);let u=100,n=u;for(let h=0;h<o;h+=1)u/=1,n+=u;return{height:n,width:n}}const w=e.ref(X());e.ref(`0 0 ${w.value.width} ${w.value.height}`);function Q(o,u={x:-w.value.width/2.43,y:w.value.height/2},n=w.value.width/1.1,h=24,f=0,b=0,Z="#BBBBBB"){if(o&&o.length>0){const ge=y.createPolygonPath({plot:u,radius:n,sides:o.length,rotation:f});o.forEach((B,le)=>{const ne=ge.coordinates[le];let _;if(B.ancestor?B.ancestor.ancestor?_=B.ancestor.color||Z:(_=E.value[b]||y.palette[b]||Z,b+=1):_=Z,B.polygonPath={coordinates:[ne]},B.circleRadius=h,B.color=_,B.uid=y.createUid(),B.nodes&&B.nodes.length>0){const ye=!B.ancestor||!B.ancestor.ancestor?b:0;B.nodes=Q(B.nodes,ne,n/2.9,h/2.2,f+Math.PI*le/B.nodes.length,ye,_)}})}return o}function se(o){const u=new Set;function n(f){f.forEach(b=>{b.color&&!u.has(b.color)&&u.add(b.color),b.nodes&&b.nodes.length>0&&n(b.nodes)})}n(o);const h={};return Array.from(u).forEach((f,b)=>{h[f]=`gradient_${b}`}),h}const ie=e.computed(()=>se(S.value)),S=e.computed(()=>Q(a.dataset)),Y=e.ref(null);function ue(o){Y.value={datapoint:o,seriesIndex:-1,series:S.value,config:t.value};const u=t.value.style.chart.tooltip.customFormat;if(y.isFunction(u)&&y.functionReturnsString(()=>u({seriesIndex:-1,datapoint:o,series:S.value,config:t.value})))k.value=u({seriesIndex:-1,datapoint:o,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${o.color}">⬤</div><div>${o.name}</div></div>`,o.details&&(n+=`<div style="width:100%;border-top:1px solid ${t.value.style.chart.tooltip.borderColor};margin-top: 2px">${o.details}</div>`),k.value=`<div style="font-family:inherit">${n}</div>`}}const J=e.ref(null),z=e.ref(null);function ce(o){J.value=o,o?(i.value=!0,ue(o),z.value=o.uid):(i.value=!1,k.value="",z.value=null)}function de(o){const u=[];function n(h){h.forEach(f=>{const b={name:f.name,details:f.details||"-",ancestor:f.ancestor&&f.ancestor.name||"-",color:f.color||""};u.push(b),f.nodes&&f.nodes.length>0&&n(f.nodes,f.name)})}return n(o),u}const ve=e.computed(()=>de(S.value)),D=e.computed(()=>{const o=[t.value.table.translations.nodeName,t.value.table.translations.details,t.value.table.translations.ancestor],u=ve.value.map((f,b)=>[{color:f.color,name:f.name},f.details,f.ancestor||""]),n={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},h=[t.value.table.translations.nodeName,t.value.table.translations.details,t.value.table.translations.ancestor];return{head:o,body:u,config:n,colNames:h}});function K(){e.nextTick(()=>{const o=D.value.body.map((h,f)=>[[h[0].name],[h[1]],[h[2]]]),u=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[...D.value.head]]].concat(o),n=y.createCsvContent(u);y.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-molecule"})})}function he(){return S.value}const I=e.ref(!1);function fe(o){I.value=o,x.value+=1}function ee(){g.value.showTable=!g.value.showTable}function te(){g.value.showDataLabels=!g.value.showDataLabels}function oe(){g.value.showTooltip=!g.value.showTooltip}const M=e.ref(!1);function W(){M.value=!M.value}const me=e.computed(()=>!M.value),{viewBox:j}=De(R,{x:0,y:0,width:w.value.width<=0?10:w.value.width,height:w.value.height<=0?10:w.value.height},t.value.style.chart.zoom.speed,me);function pe(o){p("selectNode",o)}return N({getData:he,generatePdf:d,generateCsv:K,generateImage:m,toggleTable:ee,toggleLabels:te,toggleTooltip:oe,toggleAnnotator:W}),(o,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"moleculeChart",ref:$,class:e.normalizeClass(`vue-ui-molecule ${I.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`cluster_${v.value}`,onMouseleave:u[1]||(u[1]=n=>{J.value=null,z.value=null,e.unref(H)(!1)}),onMouseenter:u[2]||(u[2]=()=>e.unref(H)(!0))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,svgRef:e.unref(R),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:W},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",ze,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"molecule-div-title",...t.value.style.chart.title},subtitle:{cy:"molecule-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&c.value&&(e.unref(G)||e.unref(V))?(e.openBlock(),e.createBlock(re.UserOptions,{ref_key:"details",ref:L,key:`user_options_${x.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(l),uid:v.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:fe,onGeneratePdf:e.unref(d),onGenerateCsv:K,onGenerateImage:e.unref(m),onToggleTable:ee,onToggleLabels:te,onToggleTooltip:oe,onToggleAnnotator:W,style:e.normalizeStyle({visibility:e.unref(G)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:n,color:h})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:n,color:h})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,o.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:h})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:h})),void 0,!0)]),key:"7"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:h})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:h})),void 0,!0)]),key:"8"}: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,ref_key:"svgRef",ref:R,xmlns:e.unref(y.XMLNS),viewBox:`${e.unref(j).x} ${e.unref(j).y} ${e.unref(j).width} ${e.unref(j).height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":I.value,"vue-data-ui-fulscreen--off":!I.value}),style:e.normalizeStyle(`overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:w.value.width<=0?10:w.value.width,height:w.value.height<=0?10:w.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,_e)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(ie.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(y.lightenHexColor)(n,.5)},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":n},null,8,Ge)],8,qe))),256))]),e.createVNode(Re,{dataset:S.value,color:t.value.style.chart.links.stroke,backgroundColor:t.value.style.chart.backgroundColor},null,8,["dataset","color","backgroundColor"]),e.createVNode(Te,{dataset:S.value,hoveredUid:z.value,stroke:t.value.style.chart.nodes.stroke,strokeHovered:t.value.style.chart.nodes.strokeHovered,onClick:pe,onHover:ce},{node:e.withCtx(({node:n})=>[e.renderSlot(o.$slots,"node",e.normalizeProps(e.guardReactiveProps({node:n})),void 0,!0)]),_:3},8,["dataset","hoveredUid","stroke","strokeHovered"]),g.value.showDataLabels?(e.openBlock(),e.createBlock(Ue,{key:1,dataset:S.value,color:t.value.style.chart.color,hoveredUid:z.value},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:w.value},void 0,!0)],14,Me)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(l)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:6,config:{type:"molecule",style:{backgroundColor:t.value.style.chart.backgroundColor,molecule:{color:"#CCCCCC"}}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Xe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ce._sfc_main,{show:g.value.showTooltip&&i.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:k.value,isFullscreen:I.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...Y.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...Y.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(Be.default,{key:8,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(be.DataTable,{key:`table_${F.value}`,colNames:D.value.colNames,head:D.value.head,body:D.value.body,config:D.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:u[0]||(u[0]=n=>g.value.showTable=!1)},{th:e.withCtx(({th:n})=>[e.createElementVNode("div",{innerHTML:n,style:{display:"flex","align-items":"center"}},null,8,Ye)]),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,Ae))}},Ze=Fe._export_sfc(We,[["__scopeId","data-v-c4dc9cf3"]]);exports.default=Ze;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("./index-0ZojJ1mH.cjs"),ke=require("./Title-DjxAodUf.cjs"),re=require("./usePrinter-DDgV-g0v.cjs"),be=require("./DataTable-r2HNsyUX.cjs"),Ce=require("./Tooltip-ogV3t9Et.cjs"),we=require("./vue-ui-skeleton-raZOriRn.cjs"),Be=require("./vue-ui-accordion-BboUGt-9.cjs"),ae=require("./useNestedProp-OY09Srif.cjs"),Pe=require("./PackageVersion-BV7LcPDV.cjs"),xe=require("./PenAndPaper-DP7fHf74.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),$e=require("./useChartAccessibility-Cm7nkzTG.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["cx","cy","r","fill","stroke","stroke-width","onClick","onMouseover"],Ne=["x","y","height","width","onClick","onMouseover"],Te={__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:["click","hover"],setup(s,{emit:N}){const T=s,P=N;function a(r){P("click",r)}function p(r){P("hover",r)}return e.toRef(T,"dataset").value.forEach(r=>{r.nodes&&r.nodes.length>0&&r.nodes.forEach(v=>{v.ancestor=r})}),(r,v)=>{const L=e.resolveComponent("RecursiveCircles",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,i=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.polygonPath&&i.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.polygonPath.coordinates,(k,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("circle",{cx:k.x,cy:k.y,r:i.circleRadius,fill:`url(#gradient_${i.color})`,stroke:s.hoveredUid&&s.hoveredUid===i.uid?s.strokeHovered:s.stroke,"stroke-width":s.hoveredUid&&s.hoveredUid===i.uid?i.circleRadius/6:i.circleRadius/12,style:{cursor:"pointer"},onClick:x=>a(i),onMouseover:x=>p(i),onMouseleave:v[0]||(v[0]=x=>p(null))},null,40,Se),r.$slots.node?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:k.x-i.circleRadius,y:k.y-i.circleRadius,height:i.circleRadius*2,width:i.circleRadius*2,style:{overflow:"visible"},onClick:e.withModifiers(x=>a(i),["stop"]),onMouseover:x=>p(i),onMouseleave:v[1]||(v[1]=x=>p(null))},[e.renderSlot(r.$slots,"node",e.mergeProps({ref_for:!0},{node:i}))],40,Ne)):e.createCommentVNode("",!0)],64))),256)),i.nodes&&i.nodes.length>0?(e.openBlock(),e.createBlock(L,{key:0,dataset:i.nodes,color:s.color,stroke:s.stroke,strokeHovered:s.strokeHovered,hoveredUid:s.hoveredUid,onClick:a,onHover:p},{node:e.withCtx(({node:k})=>[e.renderSlot(r.$slots,"node",e.mergeProps({ref_for:!0},{node:k}))]),_:2},1032,["dataset","color","stroke","strokeHovered","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Le=["x1","y1","x2","y2","stroke","stroke-width"],Ve=["x1","y1","x2","y2","stroke","stroke-width"],Re={__name:"RecursiveLinks",props:{dataset:{type:Array,default:()=>[]},color:{type:String,default:"#DDDDDD"},backgroundColor:{type:String,default:"#FFFFFF"}},setup(s){const N=s;return e.toRef(N,"dataset").value.forEach(P=>{P.nodes&&P.nodes.length>0&&P.nodes.forEach(a=>{a.ancestor=P})}),(P,a)=>{const p=e.resolveComponent("RecursiveLinks",!0);return e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,c=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.polygonPath&&c.polygonPath.coordinates?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.polygonPath.coordinates,(r,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.ancestor&&c.ancestor.polygonPath?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("line",{x1:r.x,y1:r.y,x2:c.ancestor.polygonPath.coordinates[0].x,y2:c.ancestor.polygonPath.coordinates[0].y,stroke:s.backgroundColor,"stroke-width":c.circleRadius/1.5},null,8,Le),e.createElementVNode("line",{x1:r.x,y1:r.y,x2:c.ancestor.polygonPath.coordinates[0].x,y2:c.ancestor.polygonPath.coordinates[0].y,stroke:s.color,"stroke-width":c.circleRadius/2},null,8,Ve)],64)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,c=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.polygonPath&&c.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.nodes&&c.nodes.length>0?(e.openBlock(),e.createBlock(p,{key:0,dataset:c.nodes,color:s.color,backgroundColor:s.backgroundColor},null,8,["dataset","color","backgroundColor"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256))],64)}}},Oe=["x","y","fill","font-size"],Ue={__name:"RecursiveLabels",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null}},emits:["zoom","hover"],setup(s,{emit:N}){const T=s;return e.toRef(T,"dataset").value.forEach(a=>{a.nodes&&a.nodes.length>0&&a.nodes.forEach(p=>{p.ancestor=a})}),(a,p)=>{const c=e.resolveComponent("RecursiveLabels",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataset,r=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.polygonPath&&r.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.polygonPath.coordinates,v=>(e.openBlock(),e.createElementBlock("text",{x:v.x,y:v.y+r.circleRadius*2,fill:s.color,"font-size":r.circleRadius,"text-anchor":"middle",style:{opacity:"0.8","pointer-events":"none"}},e.toDisplayString(r.name),9,Oe))),256)),r.nodes&&r.nodes.length>0?(e.openBlock(),e.createBlock(c,{key:0,dataset:r.nodes,color:s.color,hoveredUid:s.hoveredUid},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}};function De(s,N={x:0,y:0,width:100,height:100},T=1,P){const a=e.ref({...N}),p=e.ref(1),c=e.ref(!1),r=e.ref({x:0,y:0});let v={x:0,y:0},L=null,i=null;function k(l){var E;const d=s.value;if(!d)return{x:0,y:0};const m=d.createSVGPoint();m.x=l.clientX,m.y=l.clientY;const C=(E=d.getScreenCTM())==null?void 0:E.inverse();return C?m.matrixTransform(C):{x:0,y:0}}function $(l){c.value=!0;const d=k(l.touches?l.touches[0]:l);r.value={x:d.x,y:d.y},v={x:0,y:0}}function x(l){if(!c.value)return;const d=k(l.touches?l.touches[0]:l);let m=d.x-r.value.x,C=d.y-r.value.y;Math.abs(m)<.3&&Math.abs(C)<.3||(v.x=m*.8+v.x*.2,v.y=C*.8+v.y*.2,r.value=d,L||(L=requestAnimationFrame(q)))}function q(){a.value.x-=v.x,a.value.y-=v.y,L=null}function F(){c.value=!1}function t(l){l.preventDefault();const d=l.deltaY>0?.9:1.1;R(d,k(l))}function V(l){l.preventDefault();const d=k(l),m=1.02*(1+T/100);H(m,d)}function H(l,d){i&&cancelAnimationFrame(i);let m=p.value,C=m*l,E=0;const g=()=>{E+=.02;let U=m+(C-m)*G(E);if(E>=1){p.value=C,i=null;return}R(U/m,d),i=requestAnimationFrame(g)};g()}const G=l=>l<.5?2*l*l:-1+(4-2*l)*l;function R(l,d){const m=p.value*l,C=m/p.value,E=a.value.width/C,g=a.value.height/C,U=(d.x-a.value.x)*(1-1/C),X=(d.y-a.value.y)*(1-1/C);a.value.x+=U,a.value.y+=X,a.value.width=E,a.value.height=g,p.value=m}e.onMounted(A),e.onUnmounted(O);function A(){const l=s.value;l&&(l.addEventListener("mousedown",$),l.addEventListener("mousemove",x),l.addEventListener("mouseup",F),l.addEventListener("mouseleave",F),l.addEventListener("wheel",t,{passive:!1}),l.addEventListener("dblclick",V),l.addEventListener("touchstart",d=>{d.preventDefault(),$(d)},{passive:!1}),l.addEventListener("touchmove",d=>{d.preventDefault(),x(d)},{passive:!1}),l.addEventListener("touchend",F))}function O(){const l=s.value;l&&(l.removeEventListener("mousedown",$),l.removeEventListener("mousemove",x),l.removeEventListener("mouseup",F),l.removeEventListener("mouseleave",F),l.removeEventListener("wheel",t),l.removeEventListener("dblclick",V),l.removeEventListener("touchstart",$),l.removeEventListener("touchmove",x),l.removeEventListener("touchend",F))}return e.watchEffect(()=>(P.value?A():O(),()=>{O()})),{viewBox:a}}const Ae=["id"],ze={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},Ie={key:2,style:"width:100%;background:transparent;"},Me=["xmlns","viewBox"],_e=["width","height"],qe=["id"],He=["stop-color"],Ge=["stop-color"],je={key:5,class:"vue-data-ui-watermark"},Xe={key:7,ref:"source",dir:"auto"},Ye=["innerHTML"],We={__name:"vue-ui-molecule",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectNode"],setup(s,{expose:N,emit:T}){const{vue_ui_molecule:P}=y.useConfig(),a=s,p=T,c=e.computed(()=>!!a.dataset&&a.dataset.length);e.onMounted(()=>{r()});function r(){y.objectIsEmpty(a.dataset)&&y.error({componentName:"VueUiMolecule",type:"dataset"})}const v=e.ref(y.createUid()),L=e.ref(null),i=e.ref(!1),k=e.ref(""),$=e.ref(null),x=e.ref(0),q=e.ref(0),F=e.ref(0),t=e.computed({get:()=>A(),set:o=>o}),{userOptionsVisible:V,setUserOptionsVisibility:H,keepUserOptionState:G}=Ee.useUserOptionState({config:t.value}),{svgRef:R}=$e.useChartAccessibility({config:t.value.style.chart.title});function A(){const o=ae.useNestedProp({userConfig:a.config,defaultConfig:P});return o.theme?{...ae.useNestedProp({userConfig:y.themes.vue_ui_molecule[o.theme]||a.config,defaultConfig:o}),customPalette:y.themePalettes[o.theme]||y.palette}:o}e.watch(()=>a.config,o=>{t.value=A(),V.value=!t.value.userOptions.showOnChartHover,r(),q.value+=1,F.value+=1,g.value.showTable=t.value.table.show,g.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const{isPrinting:O,isImaging:l,generatePdf:d,generateImage:m}=re.usePrinter({elementId:`cluster_${v.value}`,fileName:t.value.style.chart.title.text||"vue-ui-molecule"}),C=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),E=e.computed(()=>y.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showDataLabels:!0,showTooltip:t.value.style.chart.tooltip.show});function U(o,u=0){return Array.isArray(o)&&o.length>0&&o[0].nodes?U(o[0].nodes,u+1):u}function X(){const o=U(a.dataset);let u=100,n=u;for(let h=0;h<o;h+=1)u/=1,n+=u;return{height:n,width:n}}const w=e.ref(X());e.ref(`0 0 ${w.value.width} ${w.value.height}`);function Q(o,u={x:-w.value.width/2.43,y:w.value.height/2},n=w.value.width/1.1,h=24,f=0,b=0,Z="#BBBBBB"){if(o&&o.length>0){const ge=y.createPolygonPath({plot:u,radius:n,sides:o.length,rotation:f});o.forEach((B,le)=>{const ne=ge.coordinates[le];let _;if(B.ancestor?B.ancestor.ancestor?_=B.ancestor.color||Z:(_=E.value[b]||y.palette[b]||Z,b+=1):_=Z,B.polygonPath={coordinates:[ne]},B.circleRadius=h,B.color=_,B.uid=y.createUid(),B.nodes&&B.nodes.length>0){const ye=!B.ancestor||!B.ancestor.ancestor?b:0;B.nodes=Q(B.nodes,ne,n/2.9,h/2.2,f+Math.PI*le/B.nodes.length,ye,_)}})}return o}function se(o){const u=new Set;function n(f){f.forEach(b=>{b.color&&!u.has(b.color)&&u.add(b.color),b.nodes&&b.nodes.length>0&&n(b.nodes)})}n(o);const h={};return Array.from(u).forEach((f,b)=>{h[f]=`gradient_${b}`}),h}const ie=e.computed(()=>se(S.value)),S=e.computed(()=>Q(a.dataset)),Y=e.ref(null);function ue(o){Y.value={datapoint:o,seriesIndex:-1,series:S.value,config:t.value};const u=t.value.style.chart.tooltip.customFormat;if(y.isFunction(u)&&y.functionReturnsString(()=>u({seriesIndex:-1,datapoint:o,series:S.value,config:t.value})))k.value=u({seriesIndex:-1,datapoint:o,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${o.color}">⬤</div><div>${o.name}</div></div>`,o.details&&(n+=`<div style="width:100%;border-top:1px solid ${t.value.style.chart.tooltip.borderColor};margin-top: 2px">${o.details}</div>`),k.value=`<div style="font-family:inherit">${n}</div>`}}const J=e.ref(null),z=e.ref(null);function ce(o){J.value=o,o?(i.value=!0,ue(o),z.value=o.uid):(i.value=!1,k.value="",z.value=null)}function de(o){const u=[];function n(h){h.forEach(f=>{const b={name:f.name,details:f.details||"-",ancestor:f.ancestor&&f.ancestor.name||"-",color:f.color||""};u.push(b),f.nodes&&f.nodes.length>0&&n(f.nodes,f.name)})}return n(o),u}const ve=e.computed(()=>de(S.value)),D=e.computed(()=>{const o=[t.value.table.translations.nodeName,t.value.table.translations.details,t.value.table.translations.ancestor],u=ve.value.map((f,b)=>[{color:f.color,name:f.name},f.details,f.ancestor||""]),n={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},h=[t.value.table.translations.nodeName,t.value.table.translations.details,t.value.table.translations.ancestor];return{head:o,body:u,config:n,colNames:h}});function K(){e.nextTick(()=>{const o=D.value.body.map((h,f)=>[[h[0].name],[h[1]],[h[2]]]),u=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[...D.value.head]]].concat(o),n=y.createCsvContent(u);y.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-molecule"})})}function he(){return S.value}const I=e.ref(!1);function fe(o){I.value=o,x.value+=1}function ee(){g.value.showTable=!g.value.showTable}function te(){g.value.showDataLabels=!g.value.showDataLabels}function oe(){g.value.showTooltip=!g.value.showTooltip}const M=e.ref(!1);function W(){M.value=!M.value}const me=e.computed(()=>!M.value),{viewBox:j}=De(R,{x:0,y:0,width:w.value.width<=0?10:w.value.width,height:w.value.height<=0?10:w.value.height},t.value.style.chart.zoom.speed,me);function pe(o){p("selectNode",o)}return N({getData:he,generatePdf:d,generateCsv:K,generateImage:m,toggleTable:ee,toggleLabels:te,toggleTooltip:oe,toggleAnnotator:W}),(o,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"moleculeChart",ref:$,class:e.normalizeClass(`vue-ui-molecule ${I.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`cluster_${v.value}`,onMouseleave:u[1]||(u[1]=n=>{J.value=null,z.value=null,e.unref(H)(!1)}),onMouseenter:u[2]||(u[2]=()=>e.unref(H)(!0))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,svgRef:e.unref(R),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:W},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",ze,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"molecule-div-title",...t.value.style.chart.title},subtitle:{cy:"molecule-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&c.value&&(e.unref(G)||e.unref(V))?(e.openBlock(),e.createBlock(re.UserOptions,{ref_key:"details",ref:L,key:`user_options_${x.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(l),uid:v.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:fe,onGeneratePdf:e.unref(d),onGenerateCsv:K,onGenerateImage:e.unref(m),onToggleTable:ee,onToggleLabels:te,onToggleTooltip:oe,onToggleAnnotator:W,style:e.normalizeStyle({visibility:e.unref(G)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:n,color:h})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:n,color:h})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,o.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:h})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:h})),void 0,!0)]),key:"7"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:n,isAnnotator:h})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:n,isAnnotator:h})),void 0,!0)]),key:"8"}: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,ref_key:"svgRef",ref:R,xmlns:e.unref(y.XMLNS),viewBox:`${e.unref(j).x} ${e.unref(j).y} ${e.unref(j).width} ${e.unref(j).height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":I.value,"vue-data-ui-fulscreen--off":!I.value}),style:e.normalizeStyle(`overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:w.value.width<=0?10:w.value.width,height:w.value.height<=0?10:w.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,_e)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(ie.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(y.lightenHexColor)(n,.5)},null,8,He),e.createElementVNode("stop",{offset:"100%","stop-color":n},null,8,Ge)],8,qe))),256))]),e.createVNode(Re,{dataset:S.value,color:t.value.style.chart.links.stroke,backgroundColor:t.value.style.chart.backgroundColor},null,8,["dataset","color","backgroundColor"]),e.createVNode(Te,{dataset:S.value,hoveredUid:z.value,stroke:t.value.style.chart.nodes.stroke,strokeHovered:t.value.style.chart.nodes.strokeHovered,onClick:pe,onHover:ce},{node:e.withCtx(({node:n})=>[e.renderSlot(o.$slots,"node",e.normalizeProps(e.guardReactiveProps({node:n})),void 0,!0)]),_:3},8,["dataset","hoveredUid","stroke","strokeHovered"]),g.value.showDataLabels?(e.openBlock(),e.createBlock(Ue,{key:1,dataset:S.value,color:t.value.style.chart.color,hoveredUid:z.value},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:w.value},void 0,!0)],14,Me)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(l)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:6,config:{type:"molecule",style:{backgroundColor:t.value.style.chart.backgroundColor,molecule:{color:"#CCCCCC"}}}},null,8,["config"])),o.$slots.source?(e.openBlock(),e.createElementBlock("div",Xe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ce._sfc_main,{show:g.value.showTooltip&&i.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:k.value,isFullscreen:I.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...Y.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...Y.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(Be.default,{key:8,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(be.DataTable,{key:`table_${F.value}`,colNames:D.value.colNames,head:D.value.head,body:D.value.body,config:D.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:u[0]||(u[0]=n=>g.value.showTable=!1)},{th:e.withCtx(({th:n})=>[e.createElementVNode("div",{innerHTML:n,style:{display:"flex","align-items":"center"}},null,8,Ye)]),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,Ae))}},Ze=Fe._export_sfc(We,[["__scopeId","data-v-c4dc9cf3"]]);exports.default=Ze;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { toRef as de, resolveComponent as ve, createElementBlock as d, openBlock as s, Fragment as k, renderList as _, createCommentVNode as m, createBlock as R, createElementVNode as V, withModifiers as ze, renderSlot as $, mergeProps as Ce, withCtx as T, toDisplayString as Te, ref as p, onMounted as Le, onUnmounted as He, watchEffect as Be, computed as N, watch as Ge, unref as b, normalizeStyle as ce, normalizeClass as we, createVNode as ae, createSlots as Ve, normalizeProps as B, guardReactiveProps as G, createTextVNode as Xe, nextTick as je } from "vue";
|
|
2
|
-
import { u as qe, o as Ye, e as We, c as $e, t as Ze, p as xe, a as Qe, b as Je, X as Ke, l as et, P as tt, q as ot, r as lt, x as st, y as at } from "./index-
|
|
3
|
-
import { _ as nt } from "./Title-
|
|
4
|
-
import { u as rt, U as it } from "./usePrinter-
|
|
5
|
-
import { D as ut } from "./DataTable-
|
|
6
|
-
import { _ as ct } from "./Tooltip-
|
|
7
|
-
import dt from "./vue-ui-skeleton-
|
|
8
|
-
import vt from "./vue-ui-accordion-
|
|
9
|
-
import { u as Pe } from "./useNestedProp-
|
|
10
|
-
import { _ as ht } from "./PackageVersion-
|
|
11
|
-
import { P as ft } from "./PenAndPaper-
|
|
2
|
+
import { u as qe, o as Ye, e as We, c as $e, t as Ze, p as xe, a as Qe, b as Je, X as Ke, l as et, P as tt, q as ot, r as lt, x as st, y as at } from "./index-4RRlWcLr.js";
|
|
3
|
+
import { _ as nt } from "./Title-B47pulul.js";
|
|
4
|
+
import { u as rt, U as it } from "./usePrinter-FdlD3Leg.js";
|
|
5
|
+
import { D as ut } from "./DataTable-BT1MSIYm.js";
|
|
6
|
+
import { _ as ct } from "./Tooltip-v3_dMNKi.js";
|
|
7
|
+
import dt from "./vue-ui-skeleton-Txytd5FS.js";
|
|
8
|
+
import vt from "./vue-ui-accordion-I9YX633w.js";
|
|
9
|
+
import { u as Pe } from "./useNestedProp-CPc3u5vP.js";
|
|
10
|
+
import { _ as ht } from "./PackageVersion-J4TBr3Rf.js";
|
|
11
|
+
import { P as ft } from "./PenAndPaper-CZ-9vnJd.js";
|
|
12
12
|
import { u as yt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
13
13
|
import { u as pt } from "./useChartAccessibility-BWojgys7.js";
|
|
14
14
|
import { _ as mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BYGiASHP.cjs"),oe=require("./Title-J0zilijE.cjs"),q=require("./usePrinter-BNP686uC.cjs"),le=require("./Legend-DXZ1SEB4.cjs"),g=require("./BaseIcon-DFBOAQtA.cjs"),ae=require("./DataTable-Byw5diyo.cjs"),re=require("./vue-ui-skeleton-Cp7xQivG.cjs"),ne=require("./vue-ui-accordion-KL1QlKX4.cjs"),z=require("./useNestedProp-DtjjNlbm.cjs"),se=require("./PackageVersion-CkZZ1O_f.cjs"),ue=require("./PenAndPaper-CCISmaF4.cjs"),ie=require("./useUserOptionState-BgepsfED.cjs"),ce=require("./useChartAccessibility-Cm7nkzTG.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],ye={key:2,style:"width:100%;background:transparent"},me=["xmlns","viewBox"],he=["width","height"],fe=["id"],pe=["stop-color"],ke=["stop-color"],ge=["x1","y1","x2","y2","stroke","stroke-width"],be=["d","stroke","stroke-width"],Ce=["stroke"],Ne=["fill"],we=["stroke"],xe=["fill"],Ve=["stroke"],_e=["fill"],Pe=["stroke"],Be=["fill"],$e=["stroke"],Me=["fill"],Ee=["d","stroke","stroke-width","fill"],Oe=["x1","y1","stroke"],Se=["cx","cy","fill","stroke"],Ae=["fill","stroke"],Te=["y","fill","font-weight"],Le=["y","fill"],Ie={key:5,class:"vue-data-ui-watermark"},Fe=["onClick"],qe={style:{"font-weight":"bold"}},ze={key:8,ref:"source",dir:"auto"},De=["innerHTML"],Re={__name:"vue-ui-mood-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(D,{expose:R}){const{vue_ui_mood_radar:j}=r.useConfig(),u=D,m=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length);e.onMounted(()=>{V()});function V(){r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiMoodRadar",type:"dataset"})}const h=e.ref(r.createUid()),_=e.ref(null),U=e.ref(null),n=e.ref(null),W=e.ref(null),G=e.ref(0),H=e.ref(0),P=e.ref(0),t=e.computed({get:()=>E(),set:l=>l}),{userOptionsVisible:N,setUserOptionsVisibility:B,keepUserOptionState:$}=ie.useUserOptionState({config:t.value}),{svgRef:M}=ce.useChartAccessibility({config:t.value.style.chart.title});function E(){const l=z.useNestedProp({userConfig:u.config,defaultConfig:j});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_mood_radar[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=E(),N.value=!t.value.userOptions.showOnChartHover,V(),G.value+=1,H.value+=1,P.value+=1,f.value.showTable=t.value.table.show},{deep:!0});const{isPrinting:O,isImaging:S,generatePdf:A,generateImage:T}=q.usePrinter({elementId:h.value,fileName:t.value.style.chart.title.text||"vue-ui-mood-radar"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),f=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 K({centerX:l,centerY:a,apexX:o,apexY:s,proportion:d,key:k,value:te}){return{x:l+(o-l)*d,y:a+(s-a)*d,key:k,value:te}}const Y=e.computed(()=>Math.max(...Object.values(u.dataset).map(l=>isNaN(l)?0:l))),y=e.computed(()=>Object.values(u.dataset).reduce((l,a)=>(isNaN(l)?0:l)+(isNaN(a)?0:a),0)),c=e.computed(()=>Object.keys(u.dataset).map((l,a)=>{const o=typeof u.dataset[l]!="number"||isNaN(u.dataset[l])?0:u.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)),L=e.computed(()=>m.value?(["1","2","3","4","5"].forEach(l=>{[null,void 0].includes(u.dataset[l])&&r.error({componentName:"VueUiMoodRadar",type:"datasetAttribute",property:l})}),w.value.coordinates.map((l,a)=>{const o=K({centerX:i.value.width/2,centerY:i.value.height/2,apexX:l.x,apexY:l.y,proportion:c.value[a].value/Y.value,key:c.value[a].key,value:c.value[a].value});return{...l,plots:o,key:c.value[a].key}})):[]),J=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 Q(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 I(){e.nextTick(()=>{const l=v.value.head.map((s,d)=>[[s.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 b=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,k)=>[{color:d.color,name:d.name},v.value.body[k].toFixed(t.value.table.td.roundingValue),isNaN(v.value.body[k]/y.value)?"-":(v.value.body[k]/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},s=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:s}});function Z(){return c.value}function F(){f.value.showTable=!f.value.showTable}const p=e.ref(!1);function ee(l){p.value=l}const C=e.ref(!1);function x(){C.value=!C.value}return R({getData:Z,generatePdf:A,generateCsv:I,generateImage:T,toggleTable:F,toggleAnnotator:x}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-mood-radar ${p.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"moodRadarChart",ref:_,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(B)(!0)),onMouseleave:a[12]||(a[12]=()=>e.unref(B)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.PenAndPaper,{key:0,svgRef:e.unref(M),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:C.value,onClose:x},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.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",ye,[e.createVNode(oe._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(N))?(e.openBlock(),e.createBlock(q.UserOptions,{key:3,ref_key:"details",ref:U,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(S),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,isFullscreen:p.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:C.value,onToggleFullscreen:ee,onGeneratePdf:e.unref(A),onGenerateCsv:I,onGenerateImage:e.unref(T),onToggleTable:F,onToggleAnnotator:x,style:e.normalizeStyle({visibility:e.unref($)?e.unref(N)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:s})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:s})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:s})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:s})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:M,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":p.value,"vue-data-ui-fulscreen--off":!p.value}),style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(se._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,he)):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,pe),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,ke)],8,fe)]),(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,ge))),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,be),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,Ce),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,Ne),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,we),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,xe),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,Ve),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,_e),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,Pe),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,Be),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,$e),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,Me),e.createElementVNode("path",{d:e.unref(r.makePath)(L.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,Ee),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value.map(o=>o.plots),(o,s)=>(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,Oe),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,Se),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,Ae),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:s})),9,Te),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,Le)],4))),256)),e.renderSlot(l.$slots,"svg",{svg:i.value},void 0,!0)],14,me)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(S)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.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(le.Legend,{legendSet:c.value,config:J.value,key:`legend_${P.value}`,style:{display:"flex","row-gap":"6px"}},{item:e.withCtx(({legend:o,index:s})=>[e.createElementVNode("div",{onClick:()=>Q(o.key),style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center",margin:"3px 0"}},[o.key==1?(e.openBlock(),e.createBlock(g.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(g.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(g.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(g.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(g.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",qe,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:s})),1),e.createTextVNode(" ("+e.toDisplayString(e.unref(r.dataLabel)({v:o.proportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1)],8,Fe)]),_: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",ze,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(ne.default,{key:9,hideDetails:"",config:{open:f.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(ae.DataTable,{colNames:b.value.colNames,head:b.value.head,body:b.value.body,config:b.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=>f.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,De)]),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,ve))}},je=de._export_sfc(Re,[["__scopeId","data-v-245f5bd2"]]);exports.default=je;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-0ZojJ1mH.cjs"),oe=require("./Title-DjxAodUf.cjs"),q=require("./usePrinter-DDgV-g0v.cjs"),le=require("./Legend-Bpt6RBG8.cjs"),g=require("./BaseIcon-BI3eFhr1.cjs"),ae=require("./DataTable-r2HNsyUX.cjs"),re=require("./vue-ui-skeleton-raZOriRn.cjs"),ne=require("./vue-ui-accordion-BboUGt-9.cjs"),z=require("./useNestedProp-OY09Srif.cjs"),se=require("./PackageVersion-BV7LcPDV.cjs"),ue=require("./PenAndPaper-DP7fHf74.cjs"),ie=require("./useUserOptionState-BgepsfED.cjs"),ce=require("./useChartAccessibility-Cm7nkzTG.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],ye={key:2,style:"width:100%;background:transparent"},me=["xmlns","viewBox"],he=["width","height"],fe=["id"],pe=["stop-color"],ke=["stop-color"],ge=["x1","y1","x2","y2","stroke","stroke-width"],be=["d","stroke","stroke-width"],Ce=["stroke"],Ne=["fill"],we=["stroke"],xe=["fill"],Ve=["stroke"],_e=["fill"],Pe=["stroke"],Be=["fill"],$e=["stroke"],Me=["fill"],Ee=["d","stroke","stroke-width","fill"],Oe=["x1","y1","stroke"],Se=["cx","cy","fill","stroke"],Ae=["fill","stroke"],Te=["y","fill","font-weight"],Le=["y","fill"],Ie={key:5,class:"vue-data-ui-watermark"},Fe=["onClick"],qe={style:{"font-weight":"bold"}},ze={key:8,ref:"source",dir:"auto"},De=["innerHTML"],Re={__name:"vue-ui-mood-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(D,{expose:R}){const{vue_ui_mood_radar:j}=r.useConfig(),u=D,m=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length);e.onMounted(()=>{V()});function V(){r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiMoodRadar",type:"dataset"})}const h=e.ref(r.createUid()),_=e.ref(null),U=e.ref(null),n=e.ref(null),W=e.ref(null),G=e.ref(0),H=e.ref(0),P=e.ref(0),t=e.computed({get:()=>E(),set:l=>l}),{userOptionsVisible:N,setUserOptionsVisibility:B,keepUserOptionState:$}=ie.useUserOptionState({config:t.value}),{svgRef:M}=ce.useChartAccessibility({config:t.value.style.chart.title});function E(){const l=z.useNestedProp({userConfig:u.config,defaultConfig:j});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_mood_radar[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=E(),N.value=!t.value.userOptions.showOnChartHover,V(),G.value+=1,H.value+=1,P.value+=1,f.value.showTable=t.value.table.show},{deep:!0});const{isPrinting:O,isImaging:S,generatePdf:A,generateImage:T}=q.usePrinter({elementId:h.value,fileName:t.value.style.chart.title.text||"vue-ui-mood-radar"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),f=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 K({centerX:l,centerY:a,apexX:o,apexY:s,proportion:d,key:k,value:te}){return{x:l+(o-l)*d,y:a+(s-a)*d,key:k,value:te}}const Y=e.computed(()=>Math.max(...Object.values(u.dataset).map(l=>isNaN(l)?0:l))),y=e.computed(()=>Object.values(u.dataset).reduce((l,a)=>(isNaN(l)?0:l)+(isNaN(a)?0:a),0)),c=e.computed(()=>Object.keys(u.dataset).map((l,a)=>{const o=typeof u.dataset[l]!="number"||isNaN(u.dataset[l])?0:u.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)),L=e.computed(()=>m.value?(["1","2","3","4","5"].forEach(l=>{[null,void 0].includes(u.dataset[l])&&r.error({componentName:"VueUiMoodRadar",type:"datasetAttribute",property:l})}),w.value.coordinates.map((l,a)=>{const o=K({centerX:i.value.width/2,centerY:i.value.height/2,apexX:l.x,apexY:l.y,proportion:c.value[a].value/Y.value,key:c.value[a].key,value:c.value[a].value});return{...l,plots:o,key:c.value[a].key}})):[]),J=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 Q(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 I(){e.nextTick(()=>{const l=v.value.head.map((s,d)=>[[s.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 b=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,k)=>[{color:d.color,name:d.name},v.value.body[k].toFixed(t.value.table.td.roundingValue),isNaN(v.value.body[k]/y.value)?"-":(v.value.body[k]/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},s=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:s}});function Z(){return c.value}function F(){f.value.showTable=!f.value.showTable}const p=e.ref(!1);function ee(l){p.value=l}const C=e.ref(!1);function x(){C.value=!C.value}return R({getData:Z,generatePdf:A,generateCsv:I,generateImage:T,toggleTable:F,toggleAnnotator:x}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-mood-radar ${p.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"moodRadarChart",ref:_,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(B)(!0)),onMouseleave:a[12]||(a[12]=()=>e.unref(B)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.PenAndPaper,{key:0,svgRef:e.unref(M),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:C.value,onClose:x},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.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",ye,[e.createVNode(oe._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(N))?(e.openBlock(),e.createBlock(q.UserOptions,{key:3,ref_key:"details",ref:U,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(O),isImaging:e.unref(S),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,isFullscreen:p.value,titles:{...t.value.userOptions.buttonTitles},chartElement:_.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:C.value,onToggleFullscreen:ee,onGeneratePdf:e.unref(A),onGenerateCsv:I,onGenerateImage:e.unref(T),onToggleTable:F,onToggleAnnotator:x,style:e.normalizeStyle({visibility:e.unref($)?e.unref(N)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:s})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:s})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:s})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:s})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:s})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:M,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":p.value,"vue-data-ui-fulscreen--off":!p.value}),style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(se._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,he)):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,pe),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,ke)],8,fe)]),(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,ge))),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,be),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,Ce),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,Ne),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,we),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,xe),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,Ve),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,_e),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,Pe),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,Be),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,$e),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,Me),e.createElementVNode("path",{d:e.unref(r.makePath)(L.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,Ee),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value.map(o=>o.plots),(o,s)=>(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,Oe),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,Se),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,Ae),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:s})),9,Te),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,Le)],4))),256)),e.renderSlot(l.$slots,"svg",{svg:i.value},void 0,!0)],14,me)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(O)||e.unref(S)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.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(le.Legend,{legendSet:c.value,config:J.value,key:`legend_${P.value}`,style:{display:"flex","row-gap":"6px"}},{item:e.withCtx(({legend:o,index:s})=>[e.createElementVNode("div",{onClick:()=>Q(o.key),style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center",margin:"3px 0"}},[o.key==1?(e.openBlock(),e.createBlock(g.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(g.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(g.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(g.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(g.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",qe,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:s})),1),e.createTextVNode(" ("+e.toDisplayString(e.unref(r.dataLabel)({v:o.proportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1)],8,Fe)]),_: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",ze,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(ne.default,{key:9,hideDetails:"",config:{open:f.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(ae.DataTable,{colNames:b.value.colNames,head:b.value.head,body:b.value.body,config:b.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=>f.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,De)]),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,ve))}},je=de._export_sfc(Re,[["__scopeId","data-v-245f5bd2"]]);exports.default=je;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as c, onMounted as we, ref as y, watch as xe, createElementBlock as h, openBlock as r, unref as a, normalizeStyle as L, normalizeClass as ee, createBlock as p, createCommentVNode as u, renderSlot as v, createVNode as U, createSlots as _e, withCtx as f, normalizeProps as I, guardReactiveProps as F, createElementVNode as s, Fragment as te, renderList as oe, toDisplayString as N, createTextVNode as le, nextTick as $e } from "vue";
|
|
2
|
-
import { u as Me, o as Pe, e as ae, c as Ne, a as Ae, P as Oe, X as Te, s as C, w as Le, Q as Ie, i as se, f as S, q as Fe, r as Se } from "./index-
|
|
3
|
-
import { _ as Ve } from "./Title-
|
|
4
|
-
import { u as je, U as Re } from "./usePrinter-
|
|
5
|
-
import { L as Ue } from "./Legend-
|
|
6
|
-
import A 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 re } from "./useNestedProp-
|
|
11
|
-
import { _ as ze } from "./PackageVersion-
|
|
12
|
-
import { P as Ee } from "./PenAndPaper-
|
|
2
|
+
import { u as Me, o as Pe, e as ae, c as Ne, a as Ae, P as Oe, X as Te, s as C, w as Le, Q as Ie, i as se, f as S, q as Fe, r as Se } from "./index-4RRlWcLr.js";
|
|
3
|
+
import { _ as Ve } from "./Title-B47pulul.js";
|
|
4
|
+
import { u as je, U as Re } from "./usePrinter-FdlD3Leg.js";
|
|
5
|
+
import { L as Ue } from "./Legend-Bi_ML4Pn.js";
|
|
6
|
+
import A from "./BaseIcon-h1prcupB.js";
|
|
7
|
+
import { D as Be } from "./DataTable-BT1MSIYm.js";
|
|
8
|
+
import De from "./vue-ui-skeleton-Txytd5FS.js";
|
|
9
|
+
import We from "./vue-ui-accordion-I9YX633w.js";
|
|
10
|
+
import { u as re } from "./useNestedProp-CPc3u5vP.js";
|
|
11
|
+
import { _ as ze } from "./PackageVersion-J4TBr3Rf.js";
|
|
12
|
+
import { P as Ee } from "./PenAndPaper-CZ-9vnJd.js";
|
|
13
13
|
import { u as Ge } from "./useUserOptionState-BIvW1Kz7.js";
|
|
14
14
|
import { u as He } from "./useChartAccessibility-BWojgys7.js";
|
|
15
15
|
import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -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-0ZojJ1mH.cjs"),ye=require("./useResponsive-N8jl0-aC.cjs"),Fe=require("./Title-DjxAodUf.cjs"),me=require("./usePrinter-DDgV-g0v.cjs"),Te=require("./DataTable-r2HNsyUX.cjs"),Oe=require("./Tooltip-ogV3t9Et.cjs"),Pe=require("./Legend-Bpt6RBG8.cjs"),ze=require("./vue-ui-skeleton-raZOriRn.cjs"),De=require("./vue-ui-accordion-BboUGt-9.cjs"),be=require("./useNestedProp-OY09Srif.cjs"),Ae=require("./PackageVersion-BV7LcPDV.cjs"),Ie=require("./PenAndPaper-DP7fHf74.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./useChartAccessibility-Cm7nkzTG.cjs"),Ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),qe=["id"],Ye=["xmlns","viewBox"],Xe=["width","height"],Ge=["id"],He=["offset","stop-color"],We=["offset","stop-opacity"],Je=["id"],Ke=["id"],Qe=["id"],Ze=["flood-color"],je=["d","fill","stroke","stroke-width","filter"],et={key:1},tt=["d","fill"],lt={key:2},at=["x","y","font-size","font-weight","fill"],ot={key:3},nt=["filter"],rt=["text-anchor","x","y","fill","font-size","font-weight"],st=["text-anchor","x","y","fill","font-size","font-weight"],ut=["text-anchor","x","y","fill","font-size","font-weight"],it=["d","fill","onMouseenter","onClick"],ct={key:5,class:"vue-data-ui-watermark"},dt={key:0,class:"vue-ui-nested-donuts-legend-title"},vt=["onClick"],ft=["innerHTML"],pt={__name:"vue-ui-nested-donuts",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(ge,{expose:ke,emit:Ce}){const{vue_ui_nested_donuts:we}=r.useConfig(),k=ge,x=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(r.createUid()),F=e.ref(!1),T=e.ref(""),Le=e.ref(null),U=e.ref(0),B=e.ref(null),q=e.ref(null),O=e.ref(null),Y=e.ref(null),X=e.ref(null),G=e.ref(0),H=e.ref(0),W=e.ref(0),L=e.ref(!1);function Be(l){L.value=l,U.value+=1}const t=e.computed({get:()=>Z(),set:l=>l}),{userOptionsVisible:P,setUserOptionsVisibility:J,keepUserOptionState:K}=Me.useUserOptionState({config:t.value}),{svgRef:Q}=Re.useChartAccessibility({config:t.value.style.chart.title});function Z(){const l=be.useNestedProp({userConfig:k.config,defaultConfig:we});return l.theme?{...be.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=Z(),P.value=!t.value.userOptions.showOnChartHover,j(),G.value+=1,H.value+=1,W.value+=1,v.value.dataLabels.show=t.value.style.chart.layout.labels.dataLabels.show,v.value.showTable=t.value.table.show,v.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const $=e.ref(null);e.onMounted(()=>{j()});function j(){if(r.objectIsEmpty(k.dataset)&&r.error({componentName:"VueUiNestedDonuts",type:"dataset"}),t.value.responsive){const l=ye.throttle(()=>{const{width:s,height:o}=ye.useResponsive({chart:B.value,title:t.value.style.chart.title.text?q.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:Y.value,noTitle:X.value});requestAnimationFrame(()=>{c.value.width=s,c.value.height=o})});$.value=new ResizeObserver(l),$.value.observe(B.value.parentNode)}}e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:le,generateImage:ae}=me.usePrinter({elementId:`nested_donuts_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-nested-donuts"}),xe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),$e=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),c=e.ref({height:512,width:512}),oe=Ce;function Ne({datapoint:l,index:s}){oe("selectDatapoint",{datapoint:l,index:s})}const f=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=>!f.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:`${h.value}_${s}`,series:l.series.map((o,n)=>({name:o.name,arcOf:l.name,arcOfId:`${h.value}_${s}`,id:`${h.value}_${s}_${n}`,seriesIndex:n,datasetIndex:s,color:r.convertColorToHex(o.color)||$e.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)),ne=e.computed(()=>[...m.value].map((l,s)=>{const o=l.series.filter(n=>!f.value.includes(n.id)).map(n=>n.value).reduce((n,a)=>n+a,0);return{...l,total:o,series:l.series.filter(n=>!f.value.includes(n.id)).map(n=>({...n,proportion:n.value/o}))}}));function Se(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(ne.value);e.watch(()=>ne.value,l=>d.value=l);const re=e.ref(null),se=e.ref(null);function z(l){oe("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),p=Se(u,u.length-1,f.value);if(f.value.includes(l.id)){let i=function(){a>s.value?(cancelAnimationFrame(re.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)})),re.value=requestAnimationFrame(i))};f.value=f.value.filter(y=>y!==l.id),i()}else if(p){let i=function(){a<.1?(cancelAnimationFrame(se.value),f.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)})),se.value=requestAnimationFrame(i))};i()}}const D=e.computed(()=>b.value/m.value.length*t.value.style.chart.layout.donut.spacingRatio),ue=e.computed(()=>d.value.map((l,s)=>b.value-s*b.value/m.value.length)),N=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,D.value)}})),ie=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]}})),ce=e.ref(null),S=e.ref(null),_=e.ref(null),A=e.ref(null);function _e({datapoint:l,_relativeIndex:s,seriesIndex:o}){ce.value=l.arcOfId,S.value=l.id,_.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})))T.value=n({seriesIndex:o,datapoint:l,series:d.value,config:t.value});else{let a="";if(t.value.style.chart.tooltip.showAllItemsAtIndex&&f.value.length===0){const u=d.value.map(p=>p.series.find(i=>i.seriesIndex===o));u.forEach((p,i)=>{if(!p)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}">
|