vue-data-ui 2.3.27 → 2.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- package/dist/{Arrow-HROOtfWV.cjs → Arrow-B8z06v67.cjs} +1 -1
- package/dist/{Arrow-O38M_J_k.js → Arrow-Bh7WeO_g.js} +1 -1
- package/dist/{BaseIcon-D8FXGup9.js → BaseIcon-BG_bJS3R.js} +1 -1
- package/dist/{BaseIcon-CiO8gP9x.cjs → BaseIcon-DDCJA3rm.cjs} +1 -1
- package/dist/{DataTable-EqeVt-K-.js → DataTable-CsPidn0_.js} +23 -20
- package/dist/DataTable-Doh_4M84.cjs +1 -0
- package/dist/{Legend-C_lBCmBu.cjs → Legend-B20rRwGi.cjs} +1 -1
- package/dist/{Legend-8eVERYMn.js → Legend-CkQ_zypV.js} +1 -1
- package/dist/{Shape-DvcgW6uK.js → Shape-B4gGeBLI.js} +1 -1
- package/dist/{Shape-D8RdmYWq.cjs → Shape-B8O8_E6l.cjs} +1 -1
- package/dist/{Slicer-BvYL7yVK.cjs → Slicer-BXveU40S.cjs} +1 -1
- package/dist/{Slicer-CH_5wnFM.js → Slicer-DaEfxscP.js} +1 -1
- package/dist/{Title-B9iq63n1.cjs → Title-BU6E8Xld.cjs} +1 -1
- package/dist/{Title-C3Ez1ceq.js → Title-eBTH8iGJ.js} +1 -1
- package/dist/{Tooltip-7SRMoiu-.js → Tooltip-B11OahTD.js} +1 -1
- package/dist/{Tooltip-DcDEanxk.cjs → Tooltip-Oicp_EIo.cjs} +1 -1
- package/dist/documentation/installation.md +1 -1
- package/dist/{index-DiWO-_ca.js → index-BlXzlBwZ.js} +447 -364
- package/dist/index-hKWfT7Wa.cjs +4 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +66 -0
- package/dist/types/vue-data-ui.d.ts +66 -0
- package/dist/{useNestedProp-DNX5EefQ.js → useNestedProp-BoNl5H_z.js} +1 -1
- package/dist/{useNestedProp-BtqgWTf9.cjs → useNestedProp-Cggpoz7e.cjs} +1 -1
- package/dist/{usePrinter-BD40aUzH.js → usePrinter-CZ8F5Cth.js} +1 -1
- package/dist/{usePrinter-Q1J--baX.cjs → usePrinter-DoYKBzst.cjs} +1 -1
- package/dist/{vue-data-ui-GHpxkf8a.js → vue-data-ui-BOqzG_nZ.js} +57 -57
- package/dist/{vue-data-ui-yd5q4Ura.cjs → vue-data-ui-CGgiWEo3.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +6 -6
- package/dist/{vue-ui-3d-bar-CAmoj5dT.js → vue-ui-3d-bar-CjnVg4YI.js} +342 -294
- package/dist/vue-ui-3d-bar-CpntMt7p.cjs +19 -0
- package/dist/{vue-ui-accordion-ogVvFfQy.cjs → vue-ui-accordion-CTYvdLLH.cjs} +1 -1
- package/dist/{vue-ui-accordion-CiNdgRO9.js → vue-ui-accordion-wHRG3nXl.js} +3 -3
- package/dist/vue-ui-age-pyramid-DDiL1Zje.cjs +1 -0
- package/dist/{vue-ui-age-pyramid-BrTpbEha.js → vue-ui-age-pyramid-vmCwgRy9.js} +258 -219
- package/dist/{vue-ui-annotator-B9IqZ-Hy.js → vue-ui-annotator-9FGJdNLY.js} +1 -1
- package/dist/{vue-ui-annotator-QbetAXoj.cjs → vue-ui-annotator-DQ3wKf9n.cjs} +1 -1
- package/dist/{vue-ui-candlestick-BvRwlc3d.cjs → vue-ui-candlestick-6joQ9JKQ.cjs} +1 -1
- package/dist/{vue-ui-candlestick-XjjwFaDO.js → vue-ui-candlestick-DpMr2r0i.js} +9 -9
- package/dist/{vue-ui-carousel-table-DtxcnSEp.cjs → vue-ui-carousel-table-BV0EOLqU.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-KYENY5gp.js → vue-ui-carousel-table-CgR4ADOz.js} +4 -4
- package/dist/{vue-ui-chestnut-DfIcguJd.js → vue-ui-chestnut-Ca2878kV.js} +439 -347
- package/dist/vue-ui-chestnut-CxoCcw_B.cjs +6 -0
- package/dist/{vue-ui-cursor-C4pJe90O.js → vue-ui-cursor-BW8C6oUc.js} +2 -2
- package/dist/{vue-ui-cursor-COS_MXr8.cjs → vue-ui-cursor-DxF_gXQf.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DNOjWStr.cjs → vue-ui-dashboard-BGrVyITN.cjs} +1 -1
- package/dist/{vue-ui-dashboard-B_NUnxEF.js → vue-ui-dashboard-DN4nErBZ.js} +2 -2
- package/dist/{vue-ui-digits-uufqLbRt.js → vue-ui-digits-CmSFSs5S.js} +2 -2
- package/dist/{vue-ui-digits-Vx5prxaT.cjs → vue-ui-digits-CpSKBG2c.cjs} +1 -1
- package/dist/vue-ui-donut-BqfRwAIM.js +857 -0
- package/dist/vue-ui-donut-C29yXH3H.cjs +1 -0
- package/dist/vue-ui-donut-evolution-COFG73Xl.cjs +1 -0
- package/dist/vue-ui-donut-evolution-DIR7yBUC.js +839 -0
- package/dist/{vue-ui-dumbbell-z_Ck4W33.cjs → vue-ui-dumbbell-1NA60u3h.cjs} +2 -2
- package/dist/{vue-ui-dumbbell-KvrVLLw6.js → vue-ui-dumbbell-BASuPAvI.js} +202 -187
- package/dist/{vue-ui-flow-Dg4dkrcd.cjs → vue-ui-flow-DBK7d0DQ.cjs} +1 -1
- package/dist/{vue-ui-flow-BjMikE9b.js → vue-ui-flow-wq0aqc5r.js} +98 -93
- package/dist/vue-ui-galaxy-BgdVvk4N.cjs +1 -0
- package/dist/{vue-ui-galaxy-BdgveN18.js → vue-ui-galaxy-CFQ2hQAl.js} +180 -144
- package/dist/{vue-ui-gauge-D8pokfoA.cjs → vue-ui-gauge-C4_kEbgg.cjs} +1 -1
- package/dist/{vue-ui-gauge-D01FLnNz.js → vue-ui-gauge-CIN265dN.js} +158 -149
- package/dist/vue-ui-gizmo-BpT3iwC9.cjs +1 -0
- package/dist/{vue-ui-gizmo-Cp-EftjP.js → vue-ui-gizmo-DRXWEpqU.js} +63 -49
- package/dist/vue-ui-heatmap-CVD7FVfk.cjs +1 -0
- package/dist/vue-ui-heatmap-Dc0ft_Ga.js +644 -0
- package/dist/{vue-ui-kpi-D6rVKouk.js → vue-ui-kpi-DDL1TvBP.js} +19 -10
- package/dist/{vue-ui-kpi-PWurAGxE.cjs → vue-ui-kpi-WDZIt76s.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-YV68i0nk.js → vue-ui-mini-loader-B2C5U55l.js} +2 -2
- package/dist/{vue-ui-mini-loader-BsypWozL.cjs → vue-ui-mini-loader-BcGSpUfg.cjs} +1 -1
- package/dist/{vue-ui-molecule-Bx3fXHnw.cjs → vue-ui-molecule-C5BmRi2R.cjs} +1 -1
- package/dist/{vue-ui-molecule-BWYCf3Km.js → vue-ui-molecule-CD3cPNOq.js} +9 -9
- package/dist/{vue-ui-mood-radar-DsZozq6x.js → vue-ui-mood-radar-D0KbeV5j.js} +213 -187
- package/dist/vue-ui-mood-radar-afS64zg-.cjs +1 -0
- package/dist/{vue-ui-nested-donuts-qaViBhR3.js → vue-ui-nested-donuts-BGoc1RFX.js} +295 -228
- package/dist/vue-ui-nested-donuts-D-TeyOtL.cjs +17 -0
- package/dist/{vue-ui-onion-0iFsjuLM.js → vue-ui-onion-B_khL0Kv.js} +230 -196
- package/dist/vue-ui-onion-CFdbWLu3.cjs +1 -0
- package/dist/{vue-ui-parallel-coordinate-plot-BkZOKTIS.cjs → vue-ui-parallel-coordinate-plot-BmXvVt8r.cjs} +2 -2
- package/dist/{vue-ui-parallel-coordinate-plot-DxDFs1Lb.js → vue-ui-parallel-coordinate-plot-CP4V0K8m.js} +87 -87
- package/dist/{vue-ui-quadrant-Tw7SKMbQ.js → vue-ui-quadrant-C1YbjeI7.js} +455 -397
- package/dist/vue-ui-quadrant-C6-A8Gx_.cjs +1 -0
- package/dist/vue-ui-quick-chart-ConXdEsU.cjs +15 -0
- package/dist/vue-ui-quick-chart-CtWhs_2c.js +1374 -0
- package/dist/{vue-ui-radar-D5FV2IDm.js → vue-ui-radar-B2vAPYa7.js} +237 -214
- package/dist/vue-ui-radar-DMJLLVWb.cjs +1 -0
- package/dist/{vue-ui-rating-DTWIh_CV.cjs → vue-ui-rating-DhZ0tltR.cjs} +1 -1
- package/dist/{vue-ui-rating-Dds9tjxd.js → vue-ui-rating-xGz4av68.js} +9 -9
- package/dist/{vue-ui-relation-circle-B2p8F7-L.js → vue-ui-relation-circle-BQK8wMQE.js} +5 -5
- package/dist/{vue-ui-relation-circle-Cu9lKkX3.cjs → vue-ui-relation-circle-hb4Q051h.cjs} +1 -1
- package/dist/vue-ui-rings-D1EW3d4M.cjs +2 -0
- package/dist/{vue-ui-rings-BKzCFSx-.js → vue-ui-rings-ZKjhNx5K.js} +191 -162
- package/dist/{vue-ui-scatter-CwV9l1P7.js → vue-ui-scatter-CHONk8k0.js} +437 -381
- package/dist/vue-ui-scatter-CMRe2b2K.cjs +1 -0
- package/dist/{vue-ui-screenshot-CnPWz57l.cjs → vue-ui-screenshot-DcKhT745.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bo6i-aRF.js → vue-ui-screenshot-DmGe5ptH.js} +6 -6
- package/dist/{vue-ui-skeleton-CeNL0kH-.js → vue-ui-skeleton-CJ2R5R6u.js} +37 -37
- package/dist/{vue-ui-skeleton-CcrGR_Vh.cjs → vue-ui-skeleton-j-IOiy5w.cjs} +1 -1
- package/dist/{vue-ui-smiley-BBcmwq4z.cjs → vue-ui-smiley-D5Jn6d5f.cjs} +1 -1
- package/dist/{vue-ui-smiley-BGMzw-SW.js → vue-ui-smiley-DXVcosKR.js} +2 -2
- package/dist/{vue-ui-spark-trend-DlvTlA9z.cjs → vue-ui-spark-trend-CWH3W7h3.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CSC9zmt7.js → vue-ui-spark-trend-Gg6TxR4m.js} +63 -58
- package/dist/vue-ui-sparkbar-BsoKTXr2.cjs +1 -0
- package/dist/vue-ui-sparkbar-DUx1qVzQ.js +280 -0
- package/dist/{vue-ui-sparkgauge-B5g5nxUh.cjs → vue-ui-sparkgauge-DPusPoRv.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DJPt0cLe.js → vue-ui-sparkgauge-xrvp9g87.js} +60 -50
- package/dist/vue-ui-sparkhistogram---JRg2R1.cjs +1 -0
- package/dist/{vue-ui-sparkhistogram-DpvQcFls.js → vue-ui-sparkhistogram-DzYXMNj8.js} +99 -90
- package/dist/{vue-ui-sparkline-Bw3y-88R.cjs → vue-ui-sparkline-1Z6GnwoN.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CDSg9rhl.js → vue-ui-sparkline-CGWePkVI.js} +114 -105
- package/dist/{vue-ui-sparkstackbar-Ckcir2dk.cjs → vue-ui-sparkstackbar-DCc68t8g.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DveNwcVx.js → vue-ui-sparkstackbar-DFgeRAbQ.js} +52 -47
- package/dist/{vue-ui-stackbar-CZUsUeZ_.js → vue-ui-stackbar-B0dWToaf.js} +211 -196
- package/dist/vue-ui-stackbar-Cz0mT8Mo.cjs +15 -0
- package/dist/{vue-ui-strip-plot-lVVqtsNc.js → vue-ui-strip-plot-BFqd-S7c.js} +213 -198
- package/dist/vue-ui-strip-plot-DZt1Wq20.cjs +1 -0
- package/dist/{vue-ui-table-qtBWpg0m.cjs → vue-ui-table-CMvyMuc4.cjs} +1 -1
- package/dist/{vue-ui-table-8hNkBy1z.js → vue-ui-table-DtwEoIzI.js} +9 -9
- package/dist/{vue-ui-table-heatmap-HgHQKSax.cjs → vue-ui-table-heatmap-3RSMOHkc.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BAPA4nvf.js → vue-ui-table-heatmap-C8b3pE04.js} +12 -12
- package/dist/vue-ui-table-sparkline-BKOaVFtt.cjs +1 -0
- package/dist/vue-ui-table-sparkline-BrqhBv29.js +467 -0
- package/dist/vue-ui-thermometer-CKgIqM5y.cjs +1 -0
- package/dist/{vue-ui-thermometer-CcH1qmLq.js → vue-ui-thermometer-DMkLvJgE.js} +118 -108
- package/dist/{vue-ui-timer-C52mSn4m.cjs → vue-ui-timer-D7fvoR77.cjs} +1 -1
- package/dist/{vue-ui-timer-DJfYr02u.js → vue-ui-timer-RA9yfgBk.js} +8 -8
- package/dist/{vue-ui-tiremarks-CcLcd5oA.js → vue-ui-tiremarks-B_EncUi6.js} +79 -71
- package/dist/{vue-ui-tiremarks-dNuNMt_R.cjs → vue-ui-tiremarks-C7y6Mbxe.cjs} +1 -1
- package/dist/{vue-ui-treemap-BOz94BVK.js → vue-ui-treemap-BuGZgQsr.js} +274 -236
- package/dist/vue-ui-treemap-CfngjVUS.cjs +1 -0
- package/dist/vue-ui-vertical-bar-DKbq4bX4.cjs +4 -0
- package/dist/vue-ui-vertical-bar-T4bFd3JF.js +792 -0
- package/dist/vue-ui-waffle-BJFbhWnA.cjs +1 -0
- package/dist/vue-ui-waffle-CrxmrYsV.js +735 -0
- package/dist/{vue-ui-wheel-BVjbh4oM.cjs → vue-ui-wheel-BDRvKR1Z.cjs} +1 -1
- package/dist/{vue-ui-wheel-DMRiVkhu.js → vue-ui-wheel-DOyC7NgR.js} +73 -65
- package/dist/vue-ui-word-cloud-DBxVNlJ3.js +495 -0
- package/dist/vue-ui-word-cloud-Dmcelg3z.cjs +1 -0
- package/dist/{vue-ui-xy-CsFr8tix.js → vue-ui-xy-BIbvJSh2.js} +367 -288
- package/dist/vue-ui-xy-CVKaR90p.cjs +3 -0
- package/dist/vue-ui-xy-canvas-2AaNivzI.cjs +9 -0
- package/dist/{vue-ui-xy-canvas-Bb2Z3E-7.js → vue-ui-xy-canvas-CXVni3kC.js} +284 -259
- package/package.json +1 -1
- package/dist/DataTable-C6HTLT7L.cjs +0 -1
- package/dist/index-BQOxn6SH.cjs +0 -4
- package/dist/vue-ui-3d-bar-DkJ4c3HQ.cjs +0 -19
- package/dist/vue-ui-age-pyramid-CkKVbbl8.cjs +0 -1
- package/dist/vue-ui-chestnut-C7gFvKLJ.cjs +0 -6
- package/dist/vue-ui-donut-C33U3e8H.js +0 -751
- package/dist/vue-ui-donut-CeHnjIGu.cjs +0 -1
- package/dist/vue-ui-donut-evolution-IzfAVo5I.js +0 -805
- package/dist/vue-ui-donut-evolution-hHfvz1Yd.cjs +0 -1
- package/dist/vue-ui-galaxy-B8EoId23.cjs +0 -1
- package/dist/vue-ui-gizmo-8lKc8m8b.cjs +0 -1
- package/dist/vue-ui-heatmap-BEsvmj5R.js +0 -606
- package/dist/vue-ui-heatmap-DvpvKq3Q.cjs +0 -1
- package/dist/vue-ui-mood-radar-C6devC4e.cjs +0 -1
- package/dist/vue-ui-nested-donuts-BtT3VsSf.cjs +0 -16
- package/dist/vue-ui-onion-9ATTDUpw.cjs +0 -1
- package/dist/vue-ui-quadrant-DD4H_Dhk.cjs +0 -1
- package/dist/vue-ui-quick-chart-CpFHKtpm.js +0 -1318
- package/dist/vue-ui-quick-chart-D1udOl47.cjs +0 -13
- package/dist/vue-ui-radar-CZmJDj3q.cjs +0 -1
- package/dist/vue-ui-rings-DN7XmhKZ.cjs +0 -1
- package/dist/vue-ui-scatter-DJlC5mz4.cjs +0 -1
- package/dist/vue-ui-sparkbar-0CNZluKs.js +0 -257
- package/dist/vue-ui-sparkbar-Di-BPkJ0.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-BhkYmR4U.cjs +0 -1
- package/dist/vue-ui-stackbar-jNWFgXiA.cjs +0 -15
- package/dist/vue-ui-strip-plot-CzHFNhr3.cjs +0 -1
- package/dist/vue-ui-table-sparkline-DZY_23mg.js +0 -420
- package/dist/vue-ui-table-sparkline-Q8y6tloS.cjs +0 -1
- package/dist/vue-ui-thermometer-Cbu9jVvC.cjs +0 -1
- package/dist/vue-ui-treemap-orjA7Y0U.cjs +0 -1
- package/dist/vue-ui-vertical-bar-BHIt5cjc.cjs +0 -4
- package/dist/vue-ui-vertical-bar-BquCm_UG.js +0 -745
- package/dist/vue-ui-waffle-CNlp7RTS.js +0 -650
- package/dist/vue-ui-waffle-Dv8pXiYm.cjs +0 -1
- package/dist/vue-ui-word-cloud-CHRE8f_k.js +0 -352
- package/dist/vue-ui-word-cloud-CZum_IjT.cjs +0 -1
- package/dist/vue-ui-xy-BOoG4xg8.cjs +0 -3
- package/dist/vue-ui-xy-canvas-BHa3-phi.cjs +0 -9
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BQOxn6SH.cjs"),ae=require("./useResponsive-B3TrDDIG.cjs"),be=require("./Title-B9iq63n1.cjs"),oe=require("./usePrinter-Q1J--baX.cjs"),ke=require("./Tooltip-DcDEanxk.cjs"),we=require("./DataTable-C6HTLT7L.cjs"),xe=require("./Legend-C_lBCmBu.cjs"),Ce=require("./vue-ui-skeleton-CcrGR_Vh.cjs"),Be=require("./vue-ui-accordion-ogVvFfQy.cjs"),re=require("./useNestedProp-BtqgWTf9.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=S=>(e.pushScopeId("data-v-33939b0e"),S=S(),e.popScopeId(),S),Se=["id"],Ne=["xmlns","viewBox"],$e=["id"],Te=["stop-color"],Pe=["stop-color"],Ve=["id"],Ee=ue(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ie=ue(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),ze=[Ee,Ie],Fe=["x","y","height","width"],Le=["rx","x","y","height","width","stroke","stroke-width","filter"],Oe=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],De=["x","y","height","width","filter"],Ae={key:0},Me={key:1},qe={key:2},Re={key:3},Ue=["onMouseover","x","y","height","width"],je={key:3,class:"vue-data-ui-watermark"},Ge=["onClick"],We={key:0},He={key:1},Ye=["innerHTML"],Xe={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:ne,emit:se}){const p=S,{vue_ui_waffle:ie}=n.useConfig(),E=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(n.createUid()),ce=e.ref(null),L=e.ref(!1),O=e.ref(""),B=e.ref(null),q=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),t=e.computed(()=>{const l=re.useNestedProp({userConfig:p.config,defaultConfig:ie});return l.theme?{...re.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),I=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ae.throttle(()=>{const{width:o,height:a}=ae.useResponsive({chart:N.value,title:t.value.style.chart.title.text?R.value:null,legend:t.value.style.chart.legend.show?U.value:null});b.value.width=o,b.value.height=a,k.value.width=o,k.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:j,isImaging:G,generatePdf:W,generateImage:H}=oe.usePrinter({elementId:`vue-ui-waffle_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),y=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),b=e.ref({height:512,width:512}),k=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(k.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(k.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),$=e.computed(()=>k.value.width/t.value.style.chart.layout.grid.size),z=e.computed(()=>k.value.height/t.value.style.chart.layout.grid.size);function X(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,M)=>h+M,0),r=l.map(h=>h/a*o),u=r.map(Math.floor),s=r.map(h=>h%1);let v=o-u.reduce((h,M)=>h+M,0);for(;v>0;){let h=s.indexOf(Math.max(...s));u[h]+=1,s[h]=0,v-=1}return u}const J=e.computed(()=>p.dataset.map((l,o)=>({...l,color:n.convertColorToHex(l.color)||Y.value[o]||n.palette[o]||n.palette[o%n.palette.length],uid:`serie_${o}`,absoluteIndex:o}))),c=e.ref(J.value),de=e.computed(()=>{const l=c.value.filter((o,a)=>!d.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return X(l)}),ve=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return X(l)}),T=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!d.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:de.value[o]})))),he=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:ve.value[o]})));function pe(){return he.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const fe=e.computed(()=>{let l=0;return T.value.map((o,a)=>{const r=l,u=r+o.proportion,s=[];for(let v=Math.floor(r);v<Math.floor(u);v+=1)s.push(v);return l=u,{...o,start:r,rects:s}})}),i=e.computed(()=>fe.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),P=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+k.value.top});return l}),d=e.ref([]),C=e.ref(!1),K=e.ref(null),Q=e.ref(null);function Z(l){if(!t.value.useAnimation){d.value.includes(l)?d.value=d.value.filter(u=>u!==l):d.value.length<_.value.length-1&&_.value.length>1&&d.value.push(l);return}const o=J.value.find(u=>u.uid===l).values.reduce((u,s)=>u+s,0);let r=c.value.find(u=>u.uid===l).values.reduce((u,s)=>u+s,0);if(d.value.includes(l)){let s=function(){r>u?(cancelAnimationFrame(K.value),c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[u]}:v),C.value=!1):(C.value=!0,r+=u*.025,c.value=c.value.map((v,h)=>v.uid===l?{...v,values:[r]}:v),K.value=requestAnimationFrame(s))};d.value=d.value.filter(v=>v!==l);const u=o;s()}else if(d.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<.1?(cancelAnimationFrame(Q.value),d.value.push(l),c.value=c.value.map((s,v)=>s.uid===l?{...s,values:[0]}:s),C.value=!1):(C.value=!0,r/=1.5,c.value=c.value.map((s,v)=>s.uid===l?{...s,values:[r]}:s),Q.value=requestAnimationFrame(u))};u()}se("selectLegend",T.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||Y[o]||n.palette[o]||n.palette[o%n.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map((l,o)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((r,u)=>r+u,0)).reduce((a,r)=>a+r,0),opacity:d.value.includes(l.uid)?.5:1,segregate:()=>Z(l.uid),isSegregated:d.value.includes(l.uid)}))),ye=e.computed(()=>({cy:"waffle-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":""})),f=e.computed(()=>T.value.map(l=>l.value).reduce((l,o)=>l+o,0)),D=e.ref(null);function ge(l){if(d.value.length===p.dataset.length)return;const o=i.value[l];D.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},L.value=!0,B.value=i.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))O.value=a({seriesIndex:i.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?r+=`<span>(${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:r+=`<b>${(o.value/f.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),O.value=r}}const g=e.computed(()=>{const l=T.value.map(a=>({name:a.name,color:a.color})),o=T.value.map(a=>a.value);return{head:l,body:o}});function A(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${m.value})`:""}function ee(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/f.value)?"-":g.value.body[u]/f.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(o);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const F=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>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],o=g.value.head.map((u,s)=>[{color:u.color,name:u.name},n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[s],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(g.value.body[s]/f.value)?"-":(g.value.body[s]/f.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),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},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),V=e.ref(!1);function me(l){V.value=l,q.value+=1}function te(){y.value.showTable=!y.value.showTable}function le(){y.value.showTooltip=!y.value.showTooltip}return ne({getData:pe,generatePdf:W,generateCsv:ee,generateImage:H,toggleTable:te,toggleTooltip:le}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:R,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(be._sfc_main,{config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&E.value?(e.openBlock(),e.createBlock(oe.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${q.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(G),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:me,onGeneratePdf:e.unref(W),onGenerateCsv:ee,onGenerateImage:e.unref(H),onToggleTable:te,onToggleTooltip:le},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(a.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rect.gradientIntensity]}`},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Pe)],8,$e))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},ze,8,Ve)]),t.value.useCustomCells?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:i.value[r].color,...i.value[r]},isSelected:[null,void 0].includes(B.value)?!0:i.value[r].serieIndex===B.value})),void 0,!0)],8,Fe))),256)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(i.value[r].serieIndex)},null,8,Le))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${m.value}_${r})`:i.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(i.value[r].serieIndex)},null,8,Oe))),256))],64)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(i.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||i.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&i.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:z.value<=0?1e-4:z.value,width:$.value*t.value.style.chart.layout.grid.size<=0?1e-4:$.value*t.value.style.chart.layout.grid.size,filter:A(i.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${$.value/12}px;color:${e.unref(n.adaptColorToBackground)(i.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:i.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):i.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",Me,e.toDisplayString(e.unref(n.dataLabel)({v:i.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",qe," ("+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Re,e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:i.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue})),1)):e.createCommentVNode("",!0)],4)],8,De)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>ge(r),onMouseleave:o[0]||(o[0]=u=>{L.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:z.value<=0?1e-4:z.value,width:$.value<=0?1e-4:$.value,fill:"transparent",stroke:"none"},null,40,Ue))),256)),e.renderSlot(l.$slots,"svg",{svg:b.value},void 0,!0)],14,Ne)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:4,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:U},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(xe.Legend,{key:0,legendSet:_.value,config:ye.value,onClickMarker:o[1]||(o[1]=({legend:a})=>Z(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${d.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:C.value}))+" ",1),d.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",He," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",We," ("+e.toDisplayString(isNaN(a.value/f.value)?"-":e.unref(n.dataLabel)({v:a.value/f.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,Ge)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(ke._sfc_main,{show:y.value.showTooltip&&L.value&&d.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:O.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),E.value?(e.openBlock(),e.createBlock(Be.default,{key:5,hideDetails:"",config:{open:y.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(we.DataTable,{colNames:F.value.colNames,head:F.value.head,body:F.value.body,config:F.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=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Ye)]),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)],14,Se))}},Je=_e._export_sfc(Xe,[["__scopeId","data-v-33939b0e"]]);exports.default=Je;
|
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import { computed as F, ref as r, onMounted as fe, onBeforeUnmount as ge, watch as pe, openBlock as c, createElementBlock as h, normalizeStyle as N, createVNode as R, createCommentVNode as y, createBlock as j, unref as m, createSlots as be, withCtx as v, renderSlot as f, normalizeProps as H, guardReactiveProps as q, normalizeClass as Y, createElementVNode as J, Fragment as ye, renderList as we, toDisplayString as K, createTextVNode as Ce, nextTick as Q } from "vue";
|
|
2
|
-
import { u as ke, S as xe, c as Z, t as $e, a as _e, p as z, o as Te, e as ee, g as Pe, f as Fe, X as Ne, n as ze, q as Ie } from "./index-DiWO-_ca.js";
|
|
3
|
-
import { _ as Se } from "./Title-C3Ez1ceq.js";
|
|
4
|
-
import { u as Oe, U as Me } from "./usePrinter-BD40aUzH.js";
|
|
5
|
-
import { t as De, u as We } from "./useResponsive-NZB-WLRF.js";
|
|
6
|
-
import Ee from "./vue-ui-accordion-CiNdgRO9.js";
|
|
7
|
-
import { D as Ae } from "./DataTable-EqeVt-K-.js";
|
|
8
|
-
import { u as te } from "./useNestedProp-DNX5EefQ.js";
|
|
9
|
-
import { _ as Ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
|
-
const Be = ["id"], Ue = ["xmlns", "viewBox"], Ge = ["transform"], Le = ["fill", "font-weight", "x", "y", "font-size", "transform"], Xe = {
|
|
11
|
-
key: 3,
|
|
12
|
-
class: "vue-data-ui-watermark"
|
|
13
|
-
}, Re = ["innerHTML"], je = {
|
|
14
|
-
__name: "vue-ui-word-cloud",
|
|
15
|
-
props: {
|
|
16
|
-
config: {
|
|
17
|
-
type: Object,
|
|
18
|
-
default() {
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
dataset: {
|
|
23
|
-
type: [Array, String],
|
|
24
|
-
default() {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
setup(ae, { expose: oe }) {
|
|
30
|
-
const i = ae, { vue_ui_word_cloud: le } = ke(), w = F({
|
|
31
|
-
get() {
|
|
32
|
-
return !!i.dataset && i.dataset.length;
|
|
33
|
-
},
|
|
34
|
-
set(t) {
|
|
35
|
-
return t;
|
|
36
|
-
}
|
|
37
|
-
}), I = r(typeof i.dataset == "string" ? xe(i.dataset) : i.dataset), S = r(Z()), D = r(0), C = r(null), W = r(null), e = F(() => {
|
|
38
|
-
const t = te({
|
|
39
|
-
userConfig: i.config,
|
|
40
|
-
defaultConfig: le
|
|
41
|
-
});
|
|
42
|
-
return t.theme ? {
|
|
43
|
-
...te({
|
|
44
|
-
userConfig: $e.vue_ui_word_cloud[t.theme] || i.config,
|
|
45
|
-
defaultConfig: t
|
|
46
|
-
}),
|
|
47
|
-
customPalette: _e[t.theme] || z
|
|
48
|
-
} : t;
|
|
49
|
-
}), s = r({
|
|
50
|
-
width: e.value.style.chart.width,
|
|
51
|
-
height: e.value.style.chart.height,
|
|
52
|
-
maxFontSize: e.value.style.chart.words.maxFontSize,
|
|
53
|
-
minFontSize: e.value.style.chart.words.minFontSize
|
|
54
|
-
}), k = r(null);
|
|
55
|
-
fe(() => {
|
|
56
|
-
if (Te(i.dataset) ? ee({
|
|
57
|
-
componentName: "VueUiWordCloud",
|
|
58
|
-
type: "dataset"
|
|
59
|
-
}) : I.value.forEach((t, o) => {
|
|
60
|
-
Pe({
|
|
61
|
-
datasetObject: t,
|
|
62
|
-
requiredAttributes: ["name", "value"]
|
|
63
|
-
}).forEach((a) => {
|
|
64
|
-
w.value = !1, ee({
|
|
65
|
-
componentName: "VueUiWordCloud",
|
|
66
|
-
type: "datasetSerieAttribute",
|
|
67
|
-
property: a,
|
|
68
|
-
index: o
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}), e.value.responsive) {
|
|
72
|
-
const t = De(() => {
|
|
73
|
-
const { width: o, height: a } = We({
|
|
74
|
-
chart: C.value,
|
|
75
|
-
title: e.value.style.chart.title.text ? W.value : null
|
|
76
|
-
});
|
|
77
|
-
s.value.width = o, s.value.height = a, Q(U);
|
|
78
|
-
});
|
|
79
|
-
k.value = new ResizeObserver(t), k.value.observe(C.value.parentNode);
|
|
80
|
-
}
|
|
81
|
-
}), ge(() => {
|
|
82
|
-
k.value && k.value.disconnect();
|
|
83
|
-
});
|
|
84
|
-
const { isPrinting: E, isImaging: A, generatePdf: V, generateImage: B } = Oe({
|
|
85
|
-
elementId: `wordCloud_${S.value}`,
|
|
86
|
-
fileName: e.value.style.chart.title.text || "vue-ui-word-cloud"
|
|
87
|
-
}), x = r({
|
|
88
|
-
showTable: e.value.table.show
|
|
89
|
-
});
|
|
90
|
-
function se(t, o, a = "Arial") {
|
|
91
|
-
const l = document.createElement("canvas").getContext("2d");
|
|
92
|
-
return l.font = `${o}px ${e.value.style.chart.words.bold ? "bold" : "normal"} ${a}`, {
|
|
93
|
-
width: l.measureText(t).width + e.value.style.chart.words.proximity,
|
|
94
|
-
height: o
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function ne(t, o) {
|
|
98
|
-
return t.x < o.x + o.width && t.x + t.width > o.x && t.y < o.y + o.height && t.y + t.height > o.y;
|
|
99
|
-
}
|
|
100
|
-
function ue(t, o, a) {
|
|
101
|
-
const n = [], l = { x: -o / 2, y: -a / 2, width: o, height: a }, u = 0, g = 0;
|
|
102
|
-
return t.forEach((p) => {
|
|
103
|
-
let O = !1;
|
|
104
|
-
for (let P = 0; P < Math.max(o, a) / 2 && !O; P += e.value.style.chart.words.packingWeight)
|
|
105
|
-
for (let M = 0; M < 360 && !O; M += e.value.style.chart.words.packingWeight) {
|
|
106
|
-
const X = M * Math.PI / 180, ce = u + P * Math.cos(X) - p.width / 2, de = g + P * Math.sin(X) - p.height / 2, d = { ...p, x: ce, y: de }, ve = d.x >= l.x && d.y >= l.y && d.x + d.width <= l.x + l.width && d.y + d.height <= l.y + l.height, he = n.some((me) => ne(d, me));
|
|
107
|
-
ve && !he && (n.push(d), O = !0);
|
|
108
|
-
}
|
|
109
|
-
}), n;
|
|
110
|
-
}
|
|
111
|
-
const b = r([]);
|
|
112
|
-
pe(() => i.dataset, U, { immediate: !0 });
|
|
113
|
-
function U() {
|
|
114
|
-
const t = I.value.map((l) => l.value), o = Math.max(...t), a = Math.min(...t), n = I.value.map((l, u) => {
|
|
115
|
-
const g = (l.value - a) / (o - a) * (s.value.maxFontSize - s.value.minFontSize) + s.value.minFontSize, p = se(l.name, g);
|
|
116
|
-
return {
|
|
117
|
-
...l,
|
|
118
|
-
id: Z(),
|
|
119
|
-
fontSize: g,
|
|
120
|
-
width: p.width,
|
|
121
|
-
height: p.height,
|
|
122
|
-
color: e.value.style.chart.words.usePalette ? e.value.customPalette[u] || e.value.customPalette[u % e.value.customPalette.length] || z[u] || z[u % z.length] : e.value.style.chart.words.color
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
b.value = ue(n, s.value.width, s.value.height).sort((l, u) => u.fontSize - l.fontSize);
|
|
126
|
-
}
|
|
127
|
-
const $ = F(() => {
|
|
128
|
-
const t = b.value.map((a) => ({
|
|
129
|
-
name: a.name,
|
|
130
|
-
color: a.color
|
|
131
|
-
})), o = b.value.map((a) => a.value);
|
|
132
|
-
return { head: t, body: o };
|
|
133
|
-
});
|
|
134
|
-
function G() {
|
|
135
|
-
Q(() => {
|
|
136
|
-
const t = $.value.head.map((n, l) => [[
|
|
137
|
-
n.name
|
|
138
|
-
], [$.value.body[l]]]), o = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(t), a = ze(o);
|
|
139
|
-
Ie({ csvContent: a, title: e.value.style.chart.title.text || "vue-ui-word-cloud" });
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
const _ = F(() => {
|
|
143
|
-
const t = [
|
|
144
|
-
e.value.table.columnNames.series,
|
|
145
|
-
e.value.table.columnNames.value
|
|
146
|
-
], o = $.value.head.map((l, u) => {
|
|
147
|
-
const g = Fe({ p: e.value.table.td.prefix, v: $.value.body[u], s: e.value.table.td.suffix, r: e.value.table.td.roundingValue });
|
|
148
|
-
return [
|
|
149
|
-
{
|
|
150
|
-
color: l.color,
|
|
151
|
-
name: l.name
|
|
152
|
-
},
|
|
153
|
-
g
|
|
154
|
-
];
|
|
155
|
-
}), a = {
|
|
156
|
-
th: {
|
|
157
|
-
backgroundColor: e.value.table.th.backgroundColor,
|
|
158
|
-
color: e.value.table.th.color,
|
|
159
|
-
outline: e.value.table.th.outline
|
|
160
|
-
},
|
|
161
|
-
td: {
|
|
162
|
-
backgroundColor: e.value.table.td.backgroundColor,
|
|
163
|
-
color: e.value.table.td.color,
|
|
164
|
-
outline: e.value.table.td.outline
|
|
165
|
-
},
|
|
166
|
-
breakpoint: e.value.table.responsiveBreakpoint
|
|
167
|
-
};
|
|
168
|
-
return {
|
|
169
|
-
colNames: [
|
|
170
|
-
e.value.table.columnNames.series,
|
|
171
|
-
e.value.table.columnNames.value
|
|
172
|
-
],
|
|
173
|
-
head: t,
|
|
174
|
-
body: o,
|
|
175
|
-
config: a
|
|
176
|
-
};
|
|
177
|
-
}), T = r(!1);
|
|
178
|
-
function re(t) {
|
|
179
|
-
T.value = t, D.value += 1;
|
|
180
|
-
}
|
|
181
|
-
function ie() {
|
|
182
|
-
return b.value;
|
|
183
|
-
}
|
|
184
|
-
function L() {
|
|
185
|
-
x.value.showTable = !x.value.showTable;
|
|
186
|
-
}
|
|
187
|
-
return oe({
|
|
188
|
-
getData: ie,
|
|
189
|
-
generateCsv: G,
|
|
190
|
-
generatePdf: V,
|
|
191
|
-
generateImage: B,
|
|
192
|
-
toggleTable: L
|
|
193
|
-
}), (t, o) => (c(), h("div", {
|
|
194
|
-
class: "vue-ui-word-cloud",
|
|
195
|
-
ref_key: "wordCloudChart",
|
|
196
|
-
ref: C,
|
|
197
|
-
id: `wordCloud_${S.value}`,
|
|
198
|
-
style: N(`width: 100%; font-family:${e.value.style.fontFamily};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`)
|
|
199
|
-
}, [
|
|
200
|
-
e.value.style.chart.title.text ? (c(), h("div", {
|
|
201
|
-
key: 0,
|
|
202
|
-
ref_key: "chartTitle",
|
|
203
|
-
ref: W,
|
|
204
|
-
style: N(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:24px`)
|
|
205
|
-
}, [
|
|
206
|
-
R(Se, {
|
|
207
|
-
config: {
|
|
208
|
-
title: {
|
|
209
|
-
...e.value.style.chart.title
|
|
210
|
-
},
|
|
211
|
-
subtitle: {
|
|
212
|
-
...e.value.style.chart.title.subtitle
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}, null, 8, ["config"])
|
|
216
|
-
], 4)) : y("", !0),
|
|
217
|
-
e.value.userOptions.show && w.value ? (c(), j(Me, {
|
|
218
|
-
ref: "details",
|
|
219
|
-
key: `user_option_${D.value}`,
|
|
220
|
-
backgroundColor: e.value.style.chart.backgroundColor,
|
|
221
|
-
color: e.value.style.chart.color,
|
|
222
|
-
isPrinting: m(E),
|
|
223
|
-
isImaging: m(A),
|
|
224
|
-
uid: S.value,
|
|
225
|
-
hasPdf: e.value.userOptions.buttons.pdf,
|
|
226
|
-
hasXls: e.value.userOptions.buttons.csv,
|
|
227
|
-
hasImg: e.value.userOptions.buttons.img,
|
|
228
|
-
hasTable: e.value.userOptions.buttons.table,
|
|
229
|
-
hasFullscreen: e.value.userOptions.buttons.fullscreen,
|
|
230
|
-
isFullscreen: T.value,
|
|
231
|
-
titles: { ...e.value.userOptions.buttonTitles },
|
|
232
|
-
chartElement: C.value,
|
|
233
|
-
onToggleFullscreen: re,
|
|
234
|
-
onGeneratePdf: m(V),
|
|
235
|
-
onGenerateCsv: G,
|
|
236
|
-
onGenerateImage: m(B),
|
|
237
|
-
onToggleTable: L
|
|
238
|
-
}, be({ _: 2 }, [
|
|
239
|
-
t.$slots.optionPdf ? {
|
|
240
|
-
name: "optionPdf",
|
|
241
|
-
fn: v(() => [
|
|
242
|
-
f(t.$slots, "optionPdf", {}, void 0, !0)
|
|
243
|
-
]),
|
|
244
|
-
key: "0"
|
|
245
|
-
} : void 0,
|
|
246
|
-
t.$slots.optionCsv ? {
|
|
247
|
-
name: "optionCsv",
|
|
248
|
-
fn: v(() => [
|
|
249
|
-
f(t.$slots, "optionCsv", {}, void 0, !0)
|
|
250
|
-
]),
|
|
251
|
-
key: "1"
|
|
252
|
-
} : void 0,
|
|
253
|
-
t.$slots.optionImg ? {
|
|
254
|
-
name: "optionImg",
|
|
255
|
-
fn: v(() => [
|
|
256
|
-
f(t.$slots, "optionImg", {}, void 0, !0)
|
|
257
|
-
]),
|
|
258
|
-
key: "2"
|
|
259
|
-
} : void 0,
|
|
260
|
-
t.$slots.optionTable ? {
|
|
261
|
-
name: "optionTable",
|
|
262
|
-
fn: v(() => [
|
|
263
|
-
f(t.$slots, "optionTable", {}, void 0, !0)
|
|
264
|
-
]),
|
|
265
|
-
key: "3"
|
|
266
|
-
} : void 0,
|
|
267
|
-
t.$slots.optionFullscreen ? {
|
|
268
|
-
name: "optionFullscreen",
|
|
269
|
-
fn: v(({ toggleFullscreen: a, isFullscreen: n }) => [
|
|
270
|
-
f(t.$slots, "optionFullscreen", H(q({ toggleFullscreen: a, isFullscreen: n })), void 0, !0)
|
|
271
|
-
]),
|
|
272
|
-
key: "4"
|
|
273
|
-
} : void 0
|
|
274
|
-
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : y("", !0),
|
|
275
|
-
w.value ? (c(), h("svg", {
|
|
276
|
-
key: 2,
|
|
277
|
-
class: Y({ "vue-data-ui-fullscreen--on": T.value, "vue-data-ui-fulscreen--off": !T.value }),
|
|
278
|
-
xmlns: m(Ne),
|
|
279
|
-
viewBox: `0 0 ${s.value.width <= 0 ? 10 : s.value.width} ${s.value.height <= 0 ? 10 : s.value.height}`,
|
|
280
|
-
style: N(`overflow:visible;background:${e.value.style.chart.backgroundColor};`)
|
|
281
|
-
}, [
|
|
282
|
-
J("g", {
|
|
283
|
-
transform: `translate(${(s.value.width <= 0 ? 10 : s.value.width) / 2}, ${(s.value.height <= 0 ? 10 : s.value.height) / 2})`
|
|
284
|
-
}, [
|
|
285
|
-
(c(!0), h(ye, null, we(b.value, (a, n) => (c(), h("g", null, [
|
|
286
|
-
(c(), h("text", {
|
|
287
|
-
fill: a.color,
|
|
288
|
-
"font-weight": e.value.style.chart.words.bold ? "bold" : "normal",
|
|
289
|
-
key: n,
|
|
290
|
-
x: a.x,
|
|
291
|
-
y: a.y,
|
|
292
|
-
"font-size": a.fontSize,
|
|
293
|
-
transform: `translate(${a.width / 2}, ${a.height / 2})`,
|
|
294
|
-
style: N(`animation-delay:${n * e.value.animationDelayMs}ms !important`),
|
|
295
|
-
class: Y({ animated: e.value.useCssAnimation }),
|
|
296
|
-
"text-anchor": "middle",
|
|
297
|
-
"dominant-baseline": "middle"
|
|
298
|
-
}, K(a.name), 15, Le))
|
|
299
|
-
]))), 256))
|
|
300
|
-
], 8, Ge),
|
|
301
|
-
f(t.$slots, "svg", {
|
|
302
|
-
svg: { height: s.value.height, width: s.value.width }
|
|
303
|
-
}, void 0, !0)
|
|
304
|
-
], 14, Ue)) : y("", !0),
|
|
305
|
-
t.$slots.watermark ? (c(), h("div", Xe, [
|
|
306
|
-
f(t.$slots, "watermark", H(q({ isPrinting: m(E) || m(A) })), void 0, !0)
|
|
307
|
-
])) : y("", !0),
|
|
308
|
-
w.value ? (c(), j(Ee, {
|
|
309
|
-
key: 4,
|
|
310
|
-
hideDetails: "",
|
|
311
|
-
config: {
|
|
312
|
-
open: x.value.showTable,
|
|
313
|
-
maxHeight: 1e4,
|
|
314
|
-
body: {
|
|
315
|
-
backgroundColor: e.value.style.chart.backgroundColor,
|
|
316
|
-
color: e.value.style.chart.color
|
|
317
|
-
},
|
|
318
|
-
head: {
|
|
319
|
-
backgroundColor: e.value.style.chart.backgroundColor,
|
|
320
|
-
color: e.value.style.chart.color
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}, {
|
|
324
|
-
content: v(() => [
|
|
325
|
-
R(Ae, {
|
|
326
|
-
colNames: _.value.colNames,
|
|
327
|
-
head: _.value.head,
|
|
328
|
-
body: _.value.body,
|
|
329
|
-
config: _.value.config,
|
|
330
|
-
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
|
|
331
|
-
onClose: o[0] || (o[0] = (a) => x.value.showTable = !1)
|
|
332
|
-
}, {
|
|
333
|
-
th: v(({ th: a }) => [
|
|
334
|
-
J("div", {
|
|
335
|
-
innerHTML: a,
|
|
336
|
-
style: { display: "flex", "align-items": "center" }
|
|
337
|
-
}, null, 8, Re)
|
|
338
|
-
]),
|
|
339
|
-
td: v(({ td: a }) => [
|
|
340
|
-
Ce(K(a.name || a), 1)
|
|
341
|
-
]),
|
|
342
|
-
_: 1
|
|
343
|
-
}, 8, ["colNames", "head", "body", "config", "title"])
|
|
344
|
-
]),
|
|
345
|
-
_: 1
|
|
346
|
-
}, 8, ["config"])) : y("", !0)
|
|
347
|
-
], 12, Be));
|
|
348
|
-
}
|
|
349
|
-
}, at = /* @__PURE__ */ Ve(je, [["__scopeId", "data-v-682aa7fb"]]);
|
|
350
|
-
export {
|
|
351
|
-
at as default
|
|
352
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BQOxn6SH.cjs"),Z=require("./Title-B9iq63n1.cjs"),M=require("./usePrinter-Q1J--baX.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./vue-ui-accordion-ogVvFfQy.cjs"),te=require("./DataTable-C6HTLT7L.cjs"),W=require("./useNestedProp-BtqgWTf9.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],ne=["transform"],se=["fill","font-weight","x","y","font-size","transform"],re={key:3,class:"vue-data-ui-watermark"},ue=["innerHTML"],ie={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(q,{expose:A}){const c=q,{vue_ui_word_cloud:U}=s.useConfig(),f=e.computed({get(){return!!c.dataset&&c.dataset.length},set(o){return o}}),x=e.ref(typeof c.dataset=="string"?s.createWordCloudDatasetFromPlainText(c.dataset):c.dataset),$=e.ref(s.createUid()),T=e.ref(0),g=e.ref(null),S=e.ref(null),t=e.computed(()=>{const o=W.useNestedProp({userConfig:c.config,defaultConfig:U});return o.theme?{...W.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||c.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}),r=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),p=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(c.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):x.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=D.throttle(()=>{const{width:a,height:l}=D.useResponsive({chart:g.value,title:t.value.style.chart.title.text?S.value:null});r.value.width=a,r.value.height=l,e.nextTick(I)});p.value=new ResizeObserver(o),p.value.observe(g.value.parentNode)}}),e.onBeforeUnmount(()=>{p.value&&p.value.disconnect()});const{isPrinting:_,isImaging:z,generatePdf:F,generateImage:B}=M.usePrinter({elementId:`wordCloud_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),y=e.ref({showTable:t.value.table.show});function G(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function L(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function R(o,a,l){const u=[],n={x:-a/2,y:-l/2,width:a,height:l},i=0,v=0;return o.forEach(h=>{let P=!1;for(let w=0;w<Math.max(a,l)/2&&!P;w+=t.value.style.chart.words.packingWeight)for(let N=0;N<360&&!P;N+=t.value.style.chart.words.packingWeight){const V=N*Math.PI/180,H=i+w*Math.cos(V)-h.width/2,Y=v+w*Math.sin(V)-h.height/2,d={...h,x:H,y:Y},J=d.x>=n.x&&d.y>=n.y&&d.x+d.width<=n.x+n.width&&d.y+d.height<=n.y+n.height,K=u.some(Q=>L(d,Q));J&&!K&&(u.push(d),P=!0)}}),u}const m=e.ref([]);e.watch(()=>c.dataset,I,{immediate:!0});function I(){const o=x.value.map(n=>n.value),a=Math.max(...o),l=Math.min(...o),u=x.value.map((n,i)=>{const v=(n.value-l)/(a-l)*(r.value.maxFontSize-r.value.minFontSize)+r.value.minFontSize,h=G(n.name,v);return{...n,id:s.createUid(),fontSize:v,width:h.width,height:h.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[i]||t.value.customPalette[i%t.value.customPalette.length]||s.palette[i]||s.palette[i%s.palette.length]:t.value.style.chart.words.color}});m.value=R(u,r.value.width,r.value.height).sort((n,i)=>i.fontSize-n.fontSize)}const b=e.computed(()=>{const o=m.value.map(l=>({name:l.name,color:l.color})),a=m.value.map(l=>l.value);return{head:o,body:a}});function E(){e.nextTick(()=>{const o=b.value.head.map((u,n)=>[[u.name],[b.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const C=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=b.value.head.map((n,i)=>{const v=s.dataLabel({p:t.value.table.td.prefix,v:b.value.body[i],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},v]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}}),k=e.ref(!1);function X(o){k.value=o,T.value+=1}function j(){return m.value}function O(){y.value.showTable=!y.value.showTable}return A({getData:j,generateCsv:E,generatePdf:F,generateImage:B,toggleTable:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:g,id:`wordCloud_${$.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:S,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(M.UserOptions,{ref:"details",key:`user_option_${T.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(_),isImaging:e.unref(z),uid:$.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:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:e.unref(F),onGenerateCsv:E,onGenerateImage:e.unref(B),onToggleTable:O},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:${t.value.style.chart.backgroundColor};`)},[e.createElementVNode("g",{transform:`translate(${(r.value.width<=0?10:r.value.width)/2}, ${(r.value.height<=0?10:r.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:u,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,style:e.normalizeStyle(`animation-delay:${u*t.value.animationDelayMs}ms !important`),class:e.normalizeClass({animated:t.value.useCssAnimation}),"text-anchor":"middle","dominant-baseline":"middle"},e.toDisplayString(l.name),15,se))]))),256))],8,ne),e.renderSlot(o.$slots,"svg",{svg:{height:r.value.height,width:r.value.width}},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(_)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(ee.default,{key:4,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(te.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[0]||(a[0]=l=>y.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ue)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,le))}},ce=oe._export_sfc(ie,[["__scopeId","data-v-682aa7fb"]]);exports.default=ce;
|