vue-data-ui 2.3.5 → 2.3.7
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-BSOdhAJO.cjs → Arrow-BZtTM41y.cjs} +1 -1
- package/dist/{Arrow-BjDVSrfA.js → Arrow-nwrjVtgP.js} +1 -1
- package/dist/{BaseIcon-vmmfWlyR.js → BaseIcon-DLlcdgWI.js} +4 -3
- package/dist/{BaseIcon-BoKtpbrI.cjs → BaseIcon-DWx8aSo2.cjs} +1 -1
- package/dist/{DataTable-CaB7GIwQ.js → DataTable-BFsn-W_6.js} +2 -2
- package/dist/{DataTable-ssrNbONo.cjs → DataTable-BSoyXOFT.cjs} +1 -1
- package/dist/{Legend-DHpoRTAE.js → Legend-DThjLfzi.js} +1 -1
- package/dist/{Legend-Dl5IYoxK.cjs → Legend-DZhpxKg4.cjs} +1 -1
- package/dist/{Shape-CaF4pvOn.cjs → Shape-CoCdB8es.cjs} +1 -1
- package/dist/{Shape-CQT4S7N-.js → Shape-DdhpbOB2.js} +1 -1
- package/dist/{Slicer-QC8nTm24.cjs → Slicer-Bb7zhtxv.cjs} +1 -1
- package/dist/{Slicer-Bdb1BlrC.js → Slicer-CBsGmIKc.js} +1 -1
- package/dist/{Title-BNPZwnkp.js → Title-CfofmWzW.js} +1 -1
- package/dist/{Title-Cj_xubjI.cjs → Title-Ci74YZxW.cjs} +1 -1
- package/dist/{Tooltip-CdJ5hegk.cjs → Tooltip-BNMjZUBc.cjs} +1 -1
- package/dist/{Tooltip-ZnJAz6dl.js → Tooltip-cIpD1ChA.js} +1 -1
- package/dist/{index-BMCvLyab.js → index-CGb3gF5A.js} +1 -1
- package/dist/{index-BkomIE9L.cjs → index-DFXgoR1T.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1 -1
- package/dist/types/vue-data-ui.d.ts +1 -1
- package/dist/{useNestedProp-BMxXyPbW.cjs → useNestedProp-CbZUIZc0.cjs} +1 -1
- package/dist/{useNestedProp-CkP8xhG_.js → useNestedProp-DCBzUHfz.js} +1 -1
- package/dist/{usePrinter-r6uHYEcR.cjs → usePrinter-DoFYRZKM.cjs} +1 -1
- package/dist/{usePrinter-BuuBz5JR.js → usePrinter-VlAyPtaS.js} +1 -1
- package/dist/{vue-data-ui-Bc5U1cOP.cjs → vue-data-ui-DT5BwtL1.cjs} +1 -1
- package/dist/{vue-data-ui-DxeO0iaC.js → vue-data-ui-DkU-TK4x.js} +55 -55
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-32wM0tiX.js → vue-ui-3d-bar-B2ZdZ5yW.js} +7 -7
- package/dist/{vue-ui-3d-bar-CgB0fLQT.cjs → vue-ui-3d-bar-BwdmaNwO.cjs} +1 -1
- package/dist/{vue-ui-accordion-CLlVxx3Q.js → vue-ui-accordion-Br7xhAKF.js} +3 -3
- package/dist/{vue-ui-accordion-SXsobrUt.cjs → vue-ui-accordion-P9OYffC3.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DqiwcOIr.cjs → vue-ui-age-pyramid-CJGz5iEy.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-D_CY99xF.js → vue-ui-age-pyramid-D_GP1VkP.js} +8 -8
- package/dist/{vue-ui-annotator-DvP-IxDm.js → vue-ui-annotator-BHI5Uicp.js} +1 -1
- package/dist/{vue-ui-annotator-mntqd3q_.cjs → vue-ui-annotator-C9I6Zikz.cjs} +1 -1
- package/dist/{vue-ui-candlestick-C_TvUQvH.cjs → vue-ui-candlestick-B3Z-Zw-o.cjs} +1 -1
- package/dist/{vue-ui-candlestick-C-5u3i-1.js → vue-ui-candlestick-BMz6lY9I.js} +9 -9
- package/dist/{vue-ui-carousel-table-CAqhsLVx.js → vue-ui-carousel-table-9W-FPpp4.js} +114 -104
- package/dist/vue-ui-carousel-table-ZyIsiWGm.cjs +1 -0
- package/dist/{vue-ui-chestnut-DhWlw2MD.cjs → vue-ui-chestnut-C4vJDydB.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DylSfYMB.js → vue-ui-chestnut-DikFweqJ.js} +6 -6
- package/dist/{vue-ui-cursor-DTYEMgbU.js → vue-ui-cursor-CmWl10Om.js} +2 -2
- package/dist/{vue-ui-cursor-B04HJQVl.cjs → vue-ui-cursor-CxvSx8wW.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DFIYwP1s.cjs → vue-ui-dashboard-BRZFA0Yv.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Bd0-cmSZ.js → vue-ui-dashboard-CqNO4CkA.js} +2 -2
- package/dist/{vue-ui-digits-Ced5mBJZ.cjs → vue-ui-digits-B5AQ1wb4.cjs} +1 -1
- package/dist/{vue-ui-digits-CW5qNMIk.js → vue-ui-digits-Bq86VtLg.js} +2 -2
- package/dist/{vue-ui-donut-EeVmrVJs.js → vue-ui-donut-BSM49MRr.js} +9 -9
- package/dist/{vue-ui-donut-evolution-Ct6KAzs-.cjs → vue-ui-donut-evolution-D4vsG4oJ.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-BN08Y2hy.js → vue-ui-donut-evolution-hXH6wndl.js} +9 -9
- package/dist/{vue-ui-donut-DIhhgvWp.cjs → vue-ui-donut-fUSFXY5z.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-pextarqH.cjs → vue-ui-dumbbell-CSxoMYt4.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BMlxS1Nq.js → vue-ui-dumbbell-DF7resYk.js} +8 -8
- package/dist/{vue-ui-flow-CHmkgfyb.js → vue-ui-flow-2Wc505ek.js} +7 -7
- package/dist/{vue-ui-flow-BXVsbmyb.cjs → vue-ui-flow-qhWWfhM9.cjs} +1 -1
- package/dist/{vue-ui-galaxy-kiVOZOBz.js → vue-ui-galaxy-C1tqFf2k.js} +9 -9
- package/dist/{vue-ui-galaxy-D4xyd-J1.cjs → vue-ui-galaxy-DTYcNRMO.cjs} +1 -1
- package/dist/{vue-ui-gauge-DPFBsbFj.cjs → vue-ui-gauge-4oL43tii.cjs} +1 -1
- package/dist/{vue-ui-gauge-BcO-z97J.js → vue-ui-gauge-qkz3wSir.js} +4 -4
- package/dist/{vue-ui-heatmap-DBOKYaJz.cjs → vue-ui-heatmap-B8vDpGuW.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DD-Bzddj.js → vue-ui-heatmap-SUwlu7rR.js} +8 -8
- package/dist/{vue-ui-kpi-BEgf5yDv.cjs → vue-ui-kpi-Bw-xbRgX.cjs} +1 -1
- package/dist/{vue-ui-kpi-BS0o7zb9.js → vue-ui-kpi-jQgfkbVw.js} +2 -2
- package/dist/{vue-ui-mini-loader-DJEvG6ju.js → vue-ui-mini-loader-5YEExcv8.js} +2 -2
- package/dist/{vue-ui-mini-loader-Bm5EJxtG.cjs → vue-ui-mini-loader-DT-Ww_uE.cjs} +1 -1
- package/dist/{vue-ui-molecule-DzUqcaxd.cjs → vue-ui-molecule-DA0NQGMP.cjs} +1 -1
- package/dist/{vue-ui-molecule-DdwnFEBJ.js → vue-ui-molecule-sddRGEOr.js} +9 -9
- package/dist/{vue-ui-mood-radar-B9Gczs_Z.js → vue-ui-mood-radar-BlwtCy7m.js} +9 -9
- package/dist/{vue-ui-mood-radar-DbB7m4Ku.cjs → vue-ui-mood-radar-CUfTRsXf.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CVQ1CaXo.js → vue-ui-nested-donuts-BYDoEtqK.js} +9 -9
- package/dist/{vue-ui-nested-donuts-BSINf8hd.cjs → vue-ui-nested-donuts-CyhCktfb.cjs} +1 -1
- package/dist/{vue-ui-onion-Ut75t7hB.js → vue-ui-onion-BiS7G_xb.js} +9 -9
- package/dist/{vue-ui-onion-D3-6Tv4u.cjs → vue-ui-onion-DKjJWVtm.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-Bjo09ZTX.js → vue-ui-parallel-coordinate-plot-BcZOH5MA.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-CJGkoIgN.cjs → vue-ui-parallel-coordinate-plot-CB5WohUW.cjs} +1 -1
- package/dist/{vue-ui-quadrant-Du9PKvlO.js → vue-ui-quadrant-BX2Z_BiG.js} +10 -10
- package/dist/{vue-ui-quadrant-CzCvejGn.cjs → vue-ui-quadrant-aRRuJrr1.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BsxsPbjz.cjs → vue-ui-quick-chart-BSov5yuk.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-u0cPmD3q.js → vue-ui-quick-chart-aCDLYVC0.js} +6 -6
- package/dist/{vue-ui-radar-DIpCrj1h.cjs → vue-ui-radar-B3DWzSx8.cjs} +1 -1
- package/dist/{vue-ui-radar-CBrpuE5r.js → vue-ui-radar-DGhNZx7E.js} +10 -10
- package/dist/{vue-ui-rating-D8fJC8Yt.cjs → vue-ui-rating-DI2herA3.cjs} +1 -1
- package/dist/{vue-ui-rating-CaeGGlCw.js → vue-ui-rating-QJp1mzIX.js} +2 -2
- package/dist/{vue-ui-relation-circle-5DNf880s.js → vue-ui-relation-circle-DRKymwCT.js} +5 -5
- package/dist/{vue-ui-relation-circle-Ky3nPk6S.cjs → vue-ui-relation-circle-Dgk6ILFm.cjs} +1 -1
- package/dist/{vue-ui-rings-IE3IdNRF.js → vue-ui-rings-Dc_Xgav-.js} +9 -9
- package/dist/{vue-ui-rings-CffZ4T2S.cjs → vue-ui-rings-m9Gm4w5-.cjs} +1 -1
- package/dist/{vue-ui-scatter-C4GCZm0V.js → vue-ui-scatter-3p_U1RQz.js} +10 -10
- package/dist/{vue-ui-scatter-TsX5dW9l.cjs → vue-ui-scatter-CwNnmbpv.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bzpg6yof.cjs → vue-ui-screenshot-Bdg6KSR_.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bl3oooKI.js → vue-ui-screenshot-DjN1leGW.js} +1 -1
- package/dist/{vue-ui-skeleton-BisWX1sO.js → vue-ui-skeleton-B0udzFdQ.js} +2 -2
- package/dist/{vue-ui-skeleton-JmGp11-u.cjs → vue-ui-skeleton-CmABeGyu.cjs} +1 -1
- package/dist/{vue-ui-smiley-Sth2pqG1.js → vue-ui-smiley-BJdbZUnl.js} +2 -2
- package/dist/{vue-ui-smiley-BhSrt9f-.cjs → vue-ui-smiley-CIMwndRh.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-C8NSz4l8.cjs → vue-ui-spark-trend-BiqhJCi0.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-DAqO0TW2.js → vue-ui-spark-trend-Bs8wWJc2.js} +4 -4
- package/dist/{vue-ui-sparkbar-hL1Q6ObK.cjs → vue-ui-sparkbar-C2YT0NxS.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-B0zX7NU7.js → vue-ui-sparkbar-CDi8i8_Q.js} +3 -3
- package/dist/{vue-ui-sparkgauge-CWR8zJnU.js → vue-ui-sparkgauge-11o7Kgbf.js} +3 -3
- package/dist/{vue-ui-sparkgauge-tbVqaLCK.cjs → vue-ui-sparkgauge-D7sVelKC.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-Dv-lml4g.cjs → vue-ui-sparkhistogram-C6nnvqeP.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DxqCtDpw.js → vue-ui-sparkhistogram-DW4yBl5Z.js} +4 -4
- package/dist/{vue-ui-sparkline-BpL1jn7F.js → vue-ui-sparkline-B-jMIILk.js} +3 -3
- package/dist/{vue-ui-sparkline-B6pvaBY_.cjs → vue-ui-sparkline-Bnc9Cv0E.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CQ2TEi4p.cjs → vue-ui-sparkstackbar-CVyS6viy.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-BzbuBNIV.js → vue-ui-sparkstackbar-cUpn5wUS.js} +3 -3
- package/dist/{vue-ui-strip-plot-DCcbD6UE.js → vue-ui-strip-plot-CpfV9-gw.js} +9 -9
- package/dist/{vue-ui-strip-plot-DCC6F4VM.cjs → vue-ui-strip-plot-Dc1Y7Lfz.cjs} +1 -1
- package/dist/{vue-ui-table-CseaFWgX.cjs → vue-ui-table-BHENqbW6.cjs} +1 -1
- package/dist/{vue-ui-table-CFqIWfxl.js → vue-ui-table-CaCOIekW.js} +1 -1
- package/dist/{vue-ui-table-heatmap-Bwut-V1D.cjs → vue-ui-table-heatmap-r9XRz_dD.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Bz8KYDxr.js → vue-ui-table-heatmap-s7r2sGYk.js} +4 -4
- package/dist/{vue-ui-table-sparkline-z29ND2lq.js → vue-ui-table-sparkline-BS7VAPDv.js} +5 -5
- package/dist/{vue-ui-table-sparkline-CJBU3y8-.cjs → vue-ui-table-sparkline-Dk_FjirH.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BNAITzJa.js → vue-ui-thermometer-BQLqVj-X.js} +5 -5
- package/dist/{vue-ui-thermometer-DM2IKhqN.cjs → vue-ui-thermometer-DU49ev3a.cjs} +1 -1
- package/dist/{vue-ui-timer-DLfXuW8T.cjs → vue-ui-timer-9QQVkkbc.cjs} +1 -1
- package/dist/{vue-ui-timer-DV6lQVHU.js → vue-ui-timer-DGM9AHJ5.js} +4 -4
- package/dist/{vue-ui-tiremarks-WyQPg7yo.js → vue-ui-tiremarks-Bxop3uDk.js} +5 -5
- package/dist/{vue-ui-tiremarks-B1bd1jPf.cjs → vue-ui-tiremarks-CJ9xiM-i.cjs} +1 -1
- package/dist/{vue-ui-treemap-BZGmoDHb.cjs → vue-ui-treemap-BOEC1m08.cjs} +1 -1
- package/dist/{vue-ui-treemap-DKmBhzV-.js → vue-ui-treemap-CQ9rJnkn.js} +9 -9
- package/dist/{vue-ui-vertical-bar-Bi-0rRN3.cjs → vue-ui-vertical-bar-BBHN-hhJ.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-C-ySfrhJ.js → vue-ui-vertical-bar-CwcIKeM-.js} +9 -9
- package/dist/{vue-ui-waffle-VLYkR-YZ.cjs → vue-ui-waffle-Bg_hB8yK.cjs} +1 -1
- package/dist/{vue-ui-waffle-CGRWu-da.js → vue-ui-waffle-DB3cEJx6.js} +9 -9
- package/dist/{vue-ui-wheel-Pj9OPk9f.js → vue-ui-wheel-CF6psk6N.js} +5 -5
- package/dist/{vue-ui-wheel-D2q5vy5V.cjs → vue-ui-wheel-DpTCJpZn.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-Ba4BjatU.cjs → vue-ui-word-cloud-DVu3gTbu.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-8Vr-jo1p.js → vue-ui-word-cloud-QlpZWR2c.js} +6 -6
- package/dist/{vue-ui-xy-qToggEfh.js → vue-ui-xy-CpcGvBUq.js} +12 -12
- package/dist/{vue-ui-xy-C4QW5Lfl.cjs → vue-ui-xy-DFiOxWGU.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-DnLWrf0e.js → vue-ui-xy-canvas-CBlzHZ_m.js} +10 -10
- package/dist/{vue-ui-xy-canvas-Be-Da_0x.cjs → vue-ui-xy-canvas-DR_8n36F.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-carousel-table-BCePqkuz.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-BkomIE9L.cjs"),le=require("./useResponsive-B3TrDDIG.cjs"),pe=require("./Title-Cj_xubjI.cjs"),oe=require("./usePrinter-r6uHYEcR.cjs"),me=require("./DataTable-ssrNbONo.cjs"),ge=require("./Tooltip-CdJ5hegk.cjs"),be=require("./Legend-Dl5IYoxK.cjs"),ke=require("./vue-ui-skeleton-JmGp11-u.cjs"),we=require("./vue-ui-accordion-SXsobrUt.cjs"),ae=require("./useNestedProp-BMxXyPbW.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=B=>(e.pushScopeId("data-v-a76ecc28"),B=B(),e.popScopeId(),B),_e=["id"],Be=["xmlns","viewBox"],Se=["id"],$e=["stop-color"],Ne=["stop-color"],Le=["stop-color"],Ee=["id"],Ve=["id"],Te=xe(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),ze=["id"],Oe=["flood-color"],Fe=["d","stroke","filter"],Me=["cx","cy","r","fill","filter"],Pe=["stroke","d"],De=["d","fill","stroke","stroke-width","filter"],Ie=["cx","cy","r","fill"],Xe=["d","fill","onMouseenter","onClick"],Ae=["cx","cy","r","fill"],qe=["x","y","fill","font-size"],Re=["x","y","fill","font-size"],Ge=["x","y","fill","font-size"],He=["x","y","fill","font-size"],Ue=["filter"],Ye={key:0},je=["x","y"],We={key:1},Je=["cx","cy","fill","filter","onClick"],Ke=["text-anchor","x","y","fill","font-size","onClick"],Qe=["text-anchor","x","y","fill","font-size","onClick"],Ze={key:2},et=["x","y","width"],tt=["onClick"],lt={key:0,style:{"font-variant-numeric":"tabular-nums"}},ot={key:1},at=["innerHTML"],rt={__name:"vue-ui-donut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(B,{expose:re,emit:D}){const y=B,{vue_ui_donut:ne}=a.useConfig(),S=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),$=e.ref(null),I=e.ref(null),X=e.ref(null),E=e.ref(null);e.onMounted(()=>{if(a.objectIsEmpty(y.dataset)?a.error({componentName:"VueUiDonut",type:"dataset"}):y.dataset.forEach((l,r)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{S.value=!1,a.error({componentName:"VueUiDonut",type:"datasetSerieAttribute",property:o,index:r})})}),t.value.responsive){const l=le.throttle(()=>{const{width:r,height:o}=le.useResponsive({chart:$.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?X.value:null});s.value.width=r,s.value.height=o});E.value=new ResizeObserver(l),E.value.observe($.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const h=e.ref(a.createUid()),ue=e.ref(null),z=e.ref(!1),O=e.ref(""),p=e.ref(null),A=e.ref(0),t=e.computed(()=>{const l=ae.useNestedProp({userConfig:y.config,defaultConfig:ne});return l.theme?{...ae.useNestedProp({userConfig:a.themes.vue_ui_donut[l.theme]||y.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}),{isPrinting:se,isImaging:ie,generatePdf:q,generateImage:R}=oe.usePrinter({elementId:`donut__${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-donut"}),G=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),c=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:512}),N=e.computed(()=>{const l=t.value.style.chart.layout.donut.strokeWidth/512,r=s.value.width*l;return r>t.value.style.chart.layout.donut.strokeWidth?t.value.style.chart.layout.donut.strokeWidth:r}),g=e.computed(()=>y.dataset.map((l,r)=>({name:l.name,color:a.convertColorToHex(l.color)||G.value[r]||a.palette[r]||a.palette[r%a.palette.length],value:l.values.reduce((o,n)=>o+n,0),absoluteValues:l.values,comment:l.comment||""}))),v=e.ref(g.value);e.watch(()=>g.value,l=>v.value=l);function ce(){return g.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const f=e.ref([]),H=e.ref(null),U=e.ref(null),C=e.ref(!1);function Y(l){const r=g.value.find((u,i)=>i===l);let n=v.value.find((u,i)=>i===l).value;if(f.value.includes(l)){let i=function(){n>u?(cancelAnimationFrame(H.value),v.value=v.value.map((d,P)=>l===P?{...d,value:u}:d),C.value=!1):(C.value=!0,n+=u*.025,v.value=v.value.map((d,P)=>l===P?{...d,value:n}:d),H.value=requestAnimationFrame(i))};f.value=f.value.filter(d=>d!==l);const u=r.value;i()}else if(f.value.length<g.value.length-1){let u=function(){n<.1?(cancelAnimationFrame(U.value),f.value.push(l),v.value=v.value.map((i,d)=>l===d?{...i,value:0}:i),C.value=!1):(C.value=!0,n/=1.1,v.value=v.value.map((i,d)=>l===d?{...i,value:n}:i),U.value=requestAnimationFrame(u))};u()}D("selectLegend",x.value.map(u=>({name:u.name,color:u.color,value:u.value})))}const x=e.computed(()=>(v.value.forEach((l,r)=>{if([null,void 0].includes(l.values))return{...l,values:[]}}),v.value.map((l,r)=>({...l,seriesIndex:r})).filter((l,r)=>!f.value.includes(r)))),j=e.computed(()=>y.dataset.map((l,r)=>({name:l.name,color:a.convertColorToHex(l.color)||G.value[r]||a.palette[r]||a.palette[r%a.palette.length],value:(l.values||[]).reduce((o,n)=>o+n,0),shape:"circle"})).map((l,r)=>({...l,proportion:l.value/y.dataset.map(o=>(o.values||[]).reduce((n,u)=>n+u,0)).reduce((o,n)=>o+n,0),opacity:f.value.includes(r)?.5:1,segregate:()=>Y(r),isSegregated:f.value.includes(r)}))),de=e.computed(()=>({cy:"donut-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":""})),b=e.computed(()=>{const l=Math.min(s.value.width/3,s.value.height/3);return l<55?55:l}),w=e.computed(()=>a.makeDonut({series:x.value},s.value.width/2,s.value.height/2,b.value,b.value,1.99999,2,1,360,105.25,N.value));function _(l){return l.proportion*100>t.value.style.chart.layout.labels.dataLabels.hideUnderValue}function W(l,r){return isNaN(l.value/J(r))?0:(l.value/J(r)*100).toFixed(0)+"%"}function J(l){return[...l].map(r=>r.value).reduce((r,o)=>r+o,0)}const m=e.computed(()=>x.value.map(l=>l.value).reduce((l,r)=>l+r,0)),ve=e.computed(()=>m.value/x.value.length),F=e.ref(null);function he({datapoint:l,relativeIndex:r,seriesIndex:o,show:n=!1}){F.value={datapoint:l,seriesIndex:o,config:t.value,series:g.value},z.value=n,p.value=r;let u="";const i=t.value.style.chart.tooltip.customFormat;a.isFunction(i)&&a.functionReturnsString(()=>i({seriesIndex:o,datapoint:l,series:g.value,config:t.value}))?O.value=i({seriesIndex:o,datapoint:l,series:g.value,config:t.value}):(u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${a.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),t.value.style.chart.comments.showInTooltip&&l.comment&&(u+=`<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${l.color}">${l.comment}</div>`),O.value=`<div>${u}</div>`)}function M(l){return t.value.useBlurOnHover&&![null,void 0].includes(p.value)&&p.value!==l?`url(#blur_${h.value})`:""}const k=e.computed(()=>{const l=x.value.map(o=>({name:o.name,color:o.color})),r=x.value.map(o=>o.value);return{head:l,body:r}});function K(){e.nextTick(()=>{const l=k.value.head.map((n,u)=>[[n.name],[k.value.body[u]],[isNaN(k.value.body[u]/m.value)?"-":k.value.body[u]/m.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=a.createCsvContent(r);a.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-donut"})})}const V=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>',a.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:m.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],r=k.value.head.map((u,i)=>{const d=a.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:k.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},d,isNaN(k.value.body[i]/m.value)?"-":(k.value.body[i]/m.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};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:r,config:o}}),L=e.ref(!1);function fe(l){L.value=l,A.value+=1}const Q=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent));function ye(l){return l.toFixed(t.value.style.chart.legend.roundingPercentage).split("").map(r=>"-").join("")}function T(l,r){D("selectDatapoint",{datapoint:l,index:r})}function Z(){c.value.showTable=!c.value.showTable}function ee(){c.value.dataLabels.show=!c.value.dataLabels.show}function te(){c.value.showTooltip=!c.value.showTooltip}return re({getData:ce,generatePdf:q,generateCsv:K,generateImage:R,toggleTable:Z,toggleLabels:ee,toggleTooltip:te}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutChart",ref:$,class:e.normalizeClass(`vue-ui-donut ${L.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`donut__${h.value}`},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:I,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(pe._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&S.value?(e.openBlock(),e.createBlock(oe.UserOptions,{ref_key:"details",ref:ue,key:`user_option_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(se),isImaging:e.unref(ie),uid:h.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:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:L.value,chartElement:$.value,isTooltip:c.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},onToggleFullscreen:fe,onGeneratePdf:e.unref(q),onGenerateCsv:K,onGenerateImage:e.unref(R),onToggleTable:Z,onToggleLabels:ee,onToggleTooltip:te},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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","isTooltip","titles","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":L.value,"vue-data-ui-fulscreen--off":!L.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.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,[t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("radialGradient",{key:0,id:`gradient_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,$e),e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF"+e.unref(a.opacity)[t.value.style.chart.gradientIntensity]},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(a.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Le)],8,Se)):e.createCommentVNode("",!0)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2,id:`blur_std_${h.value}`},null,8,Ve),Te],8,Ee),e.createElementVNode("filter",{id:`shadow_${h.value}`,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"10","flood-opacity":"0.5","flood-color":t.value.style.chart.layout.donut.shadowColor},null,8,Oe)],8,ze)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(a.calcNutArrowPath)(o,{x:s.value.width/2,y:s.value.height/2},16,16,!1,!1,N.value),stroke:o.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:M(n)},null,8,Fe)):e.createCommentVNode("",!0)]))),256)),e.createElementVNode("circle",{cx:s.value.width/2,cy:s.value.height/2,r:b.value<=0?10:b.value,fill:t.value.style.chart.backgroundColor,filter:t.value.style.chart.layout.donut.useShadow?`url(#shadow_${h.value})`:""},null,8,Me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("path",{stroke:t.value.style.chart.backgroundColor,d:o.arcSlice,fill:"#FFFFFF"},null,8,Pe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}CC`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:M(n)},null,8,De))),256)),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.width/2,cy:s.value.height/2,r:b.value<=0?10:b.value,fill:`url(#gradient_${h.value})`},null,8,Ie)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("path",{"data-cy-donut-trap":"",d:o.arcSlice,fill:p.value===n?"rgba(0,0,0,0.1)":"transparent",onMouseenter:u=>he({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:r[0]||(r[0]=u=>{z.value=!1,p.value=null}),onClick:u=>T(o,n)},null,40,Xe))),256)),t.value.style.chart.layout.labels.hollow.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:s.value.width/2,cy:s.value.height/2,r:b.value-N.value<=0?10:b.value-N.value,fill:t.value.style.chart.backgroundColor},null,8,Ae)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.color,"font-size":t.value.style.chart.layout.labels.hollow.total.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.total.text),13,qe)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:3,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+t.value.style.chart.layout.labels.hollow.total.fontSize-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.value.color,"font-size":t.value.style.chart.layout.labels.hollow.total.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.value.bold?"bold":""}`)},e.toDisplayString(e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.hollow.total.value.prefix,v:m.value,s:t.value.style.chart.layout.labels.hollow.total.value.suffix})),13,Re)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:4,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.color,"font-size":t.value.style.chart.layout.labels.hollow.average.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.average.text),13,Ge)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:5,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.fontSize+t.value.style.chart.layout.labels.hollow.average.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.value.color,"font-size":t.value.style.chart.layout.labels.hollow.average.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.value.bold?"bold":""}`)},e.toDisplayString(C.value?"--":e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.hollow.average.value.prefix,v:ve.value,s:t.value.style.chart.layout.labels.hollow.average.value.suffix,r:t.value.style.chart.layout.labels.hollow.average.value.rounding})),13,He)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",{filter:M(n),class:e.normalizeClass({animated:t.value.useCssAnimation})},[t.value.style.chart.layout.labels.dataLabels.useLabelSlots?(e.openBlock(),e.createElementBlock("g",Ye,[(e.openBlock(),e.createElementBlock("foreignObject",{x:e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="end"?e.unref(a.calcMarkerOffsetX)(o).x-120:e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="middle"?e.unref(a.calcMarkerOffsetX)(o).x-60:e.unref(a.calcMarkerOffsetX)(o).x,y:e.unref(a.calcMarkerOffsetY)(o)-(Q.value?20:0),width:"120",height:"60",style:{overflow:"visible"}},[e.createElementVNode("div",null,[e.renderSlot(l.$slots,"dataLabel",e.normalizeProps(e.guardReactiveProps({datapoint:o,isBlur:!t.value.useBlurOnHover||[null,void 0].includes(p.value)||p.value===n,isSafari:Q.value,isVisible:_(o)&&c.value.dataLabels.show,textAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16,!0).anchor,flexAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16).anchor,percentage:W(o,w.value)})),void 0,!0)])],8,je))])):(e.openBlock(),e.createElementBlock("g",We,[_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(a.calcMarkerOffsetX)(o).x,cy:e.unref(a.calcMarkerOffsetY)(o)-3.5,fill:o.color,r:3,filter:!t.value.useBlurOnHover||[null,void 0].includes(p.value)||p.value===n?"":`url(#blur_${h.value})`,onClick:u=>T(o,n)},null,8,Je)):e.createCommentVNode("",!0),_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":e.unref(a.calcMarkerOffsetX)(o,!0,12).anchor,x:e.unref(a.calcMarkerOffsetX)(o,!0,12).x,y:e.unref(a.calcMarkerOffsetY)(o),fill:t.value.style.chart.layout.labels.percentage.color,"font-size":t.value.style.chart.layout.labels.percentage.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.percentage.bold?"bold":""}`),onClick:u=>T(o,n)},e.toDisplayString(W(o,w.value))+" "+e.toDisplayString(t.value.style.chart.layout.labels.value.show?`(${e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,rounding:t.value.style.chart.layout.labels.value.rounding})})`:""),13,Ke)):e.createCommentVNode("",!0),_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":e.unref(a.calcMarkerOffsetX)(o).anchor,x:e.unref(a.calcMarkerOffsetX)(o,!0,12).x,y:e.unref(a.calcMarkerOffsetY)(o)+t.value.style.chart.layout.labels.percentage.fontSize,fill:t.value.style.chart.layout.labels.name.color,"font-size":t.value.style.chart.layout.labels.name.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.name.bold?"bold":""}`),onClick:u=>T(o,n)},e.toDisplayString(o.name),13,Qe)):e.createCommentVNode("",!0)])),c.value.dataLabels.show&&t.value.style.chart.comments.show&&o.comment?(e.openBlock(),e.createElementBlock("g",Ze,[_(o)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:t.value.style.chart.comments.offsetX+(e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="end"?e.unref(a.calcMarkerOffsetX)(o).x-t.value.style.chart.comments.width:e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="middle"?e.unref(a.calcMarkerOffsetX)(o).x-t.value.style.chart.comments.width/2:e.unref(a.calcMarkerOffsetX)(o).x),y:e.unref(a.calcMarkerOffsetY)(o)+24+t.value.style.chart.comments.offsetY,width:t.value.style.chart.comments.width,height:"200",style:{overflow:"visible","pointer-events":"none"}},[e.createElementVNode("div",null,[e.renderSlot(l.$slots,"plot-comment",{plot:{...o,textAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16,!0).anchor,flexAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16).anchor}},void 0,!0)])],8,et)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Ue))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,Be)):e.createCommentVNode("",!0),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:3,config:{type:"donut",style:{backgroundColor:t.value.style.chart.backgroundColor,donut:{color:"#CCCCCC",strokeWidth:N.value*.8}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:X},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(be.Legend,{key:0,legendSet:j.value,config:de.value,onClickMarker:r[1]||(r[1]=({i:o})=>Y(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:u=>o.segregate(),style:e.normalizeStyle(`opacity:${f.value.includes(n)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),f.value.includes(n)?(e.openBlock(),e.createElementBlock("span",ot," ( "+e.toDisplayString(ye(o.proportion*100))+" % ) ",1)):(e.openBlock(),e.createElementBlock("span",lt," ("+e.toDisplayString(isNaN(o.value/m.value)?"-":e.unref(a.dataLabel)({v:C.value?o.proportion*100:o.value/m.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,tt)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:j.value},void 0,!0)],512),e.createVNode(ge._sfc_main,{show:c.value.showTooltip&&z.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,parent:$.value,content:O.value,isCustom:e.unref(a.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","parent","content","isCustom"]),S.value?(e.openBlock(),e.createBlock(we.default,{key:4,hideDetails:"",config:{open:c.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(me.DataTable,{colNames:V.value.colNames,head:V.value.head,body:V.value.body,config:V.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,at)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,_e))}},nt=Ce._export_sfc(rt,[["__scopeId","data-v-a76ecc28"]]);exports.default=nt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DFXgoR1T.cjs"),le=require("./useResponsive-B3TrDDIG.cjs"),pe=require("./Title-Ci74YZxW.cjs"),oe=require("./usePrinter-DoFYRZKM.cjs"),me=require("./DataTable-BSoyXOFT.cjs"),ge=require("./Tooltip-BNMjZUBc.cjs"),be=require("./Legend-DZhpxKg4.cjs"),ke=require("./vue-ui-skeleton-CmABeGyu.cjs"),we=require("./vue-ui-accordion-P9OYffC3.cjs"),ae=require("./useNestedProp-CbZUIZc0.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=B=>(e.pushScopeId("data-v-a76ecc28"),B=B(),e.popScopeId(),B),_e=["id"],Be=["xmlns","viewBox"],Se=["id"],$e=["stop-color"],Ne=["stop-color"],Le=["stop-color"],Ee=["id"],Ve=["id"],Te=xe(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),ze=["id"],Oe=["flood-color"],Fe=["d","stroke","filter"],Me=["cx","cy","r","fill","filter"],Pe=["stroke","d"],De=["d","fill","stroke","stroke-width","filter"],Ie=["cx","cy","r","fill"],Xe=["d","fill","onMouseenter","onClick"],Ae=["cx","cy","r","fill"],qe=["x","y","fill","font-size"],Re=["x","y","fill","font-size"],Ge=["x","y","fill","font-size"],He=["x","y","fill","font-size"],Ue=["filter"],Ye={key:0},je=["x","y"],We={key:1},Je=["cx","cy","fill","filter","onClick"],Ke=["text-anchor","x","y","fill","font-size","onClick"],Qe=["text-anchor","x","y","fill","font-size","onClick"],Ze={key:2},et=["x","y","width"],tt=["onClick"],lt={key:0,style:{"font-variant-numeric":"tabular-nums"}},ot={key:1},at=["innerHTML"],rt={__name:"vue-ui-donut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(B,{expose:re,emit:D}){const y=B,{vue_ui_donut:ne}=a.useConfig(),S=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),$=e.ref(null),I=e.ref(null),X=e.ref(null),E=e.ref(null);e.onMounted(()=>{if(a.objectIsEmpty(y.dataset)?a.error({componentName:"VueUiDonut",type:"dataset"}):y.dataset.forEach((l,r)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{S.value=!1,a.error({componentName:"VueUiDonut",type:"datasetSerieAttribute",property:o,index:r})})}),t.value.responsive){const l=le.throttle(()=>{const{width:r,height:o}=le.useResponsive({chart:$.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?X.value:null});s.value.width=r,s.value.height=o});E.value=new ResizeObserver(l),E.value.observe($.value.parentNode)}}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const h=e.ref(a.createUid()),ue=e.ref(null),z=e.ref(!1),O=e.ref(""),p=e.ref(null),A=e.ref(0),t=e.computed(()=>{const l=ae.useNestedProp({userConfig:y.config,defaultConfig:ne});return l.theme?{...ae.useNestedProp({userConfig:a.themes.vue_ui_donut[l.theme]||y.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}),{isPrinting:se,isImaging:ie,generatePdf:q,generateImage:R}=oe.usePrinter({elementId:`donut__${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-donut"}),G=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),c=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:512}),N=e.computed(()=>{const l=t.value.style.chart.layout.donut.strokeWidth/512,r=s.value.width*l;return r>t.value.style.chart.layout.donut.strokeWidth?t.value.style.chart.layout.donut.strokeWidth:r}),g=e.computed(()=>y.dataset.map((l,r)=>({name:l.name,color:a.convertColorToHex(l.color)||G.value[r]||a.palette[r]||a.palette[r%a.palette.length],value:l.values.reduce((o,n)=>o+n,0),absoluteValues:l.values,comment:l.comment||""}))),v=e.ref(g.value);e.watch(()=>g.value,l=>v.value=l);function ce(){return g.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const f=e.ref([]),H=e.ref(null),U=e.ref(null),C=e.ref(!1);function Y(l){const r=g.value.find((u,i)=>i===l);let n=v.value.find((u,i)=>i===l).value;if(f.value.includes(l)){let i=function(){n>u?(cancelAnimationFrame(H.value),v.value=v.value.map((d,P)=>l===P?{...d,value:u}:d),C.value=!1):(C.value=!0,n+=u*.025,v.value=v.value.map((d,P)=>l===P?{...d,value:n}:d),H.value=requestAnimationFrame(i))};f.value=f.value.filter(d=>d!==l);const u=r.value;i()}else if(f.value.length<g.value.length-1){let u=function(){n<.1?(cancelAnimationFrame(U.value),f.value.push(l),v.value=v.value.map((i,d)=>l===d?{...i,value:0}:i),C.value=!1):(C.value=!0,n/=1.1,v.value=v.value.map((i,d)=>l===d?{...i,value:n}:i),U.value=requestAnimationFrame(u))};u()}D("selectLegend",x.value.map(u=>({name:u.name,color:u.color,value:u.value})))}const x=e.computed(()=>(v.value.forEach((l,r)=>{if([null,void 0].includes(l.values))return{...l,values:[]}}),v.value.map((l,r)=>({...l,seriesIndex:r})).filter((l,r)=>!f.value.includes(r)))),j=e.computed(()=>y.dataset.map((l,r)=>({name:l.name,color:a.convertColorToHex(l.color)||G.value[r]||a.palette[r]||a.palette[r%a.palette.length],value:(l.values||[]).reduce((o,n)=>o+n,0),shape:"circle"})).map((l,r)=>({...l,proportion:l.value/y.dataset.map(o=>(o.values||[]).reduce((n,u)=>n+u,0)).reduce((o,n)=>o+n,0),opacity:f.value.includes(r)?.5:1,segregate:()=>Y(r),isSegregated:f.value.includes(r)}))),de=e.computed(()=>({cy:"donut-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":""})),b=e.computed(()=>{const l=Math.min(s.value.width/3,s.value.height/3);return l<55?55:l}),w=e.computed(()=>a.makeDonut({series:x.value},s.value.width/2,s.value.height/2,b.value,b.value,1.99999,2,1,360,105.25,N.value));function _(l){return l.proportion*100>t.value.style.chart.layout.labels.dataLabels.hideUnderValue}function W(l,r){return isNaN(l.value/J(r))?0:(l.value/J(r)*100).toFixed(0)+"%"}function J(l){return[...l].map(r=>r.value).reduce((r,o)=>r+o,0)}const m=e.computed(()=>x.value.map(l=>l.value).reduce((l,r)=>l+r,0)),ve=e.computed(()=>m.value/x.value.length),F=e.ref(null);function he({datapoint:l,relativeIndex:r,seriesIndex:o,show:n=!1}){F.value={datapoint:l,seriesIndex:o,config:t.value,series:g.value},z.value=n,p.value=r;let u="";const i=t.value.style.chart.tooltip.customFormat;a.isFunction(i)&&a.functionReturnsString(()=>i({seriesIndex:o,datapoint:l,series:g.value,config:t.value}))?O.value=i({seriesIndex:o,datapoint:l,series:g.value,config:t.value}):(u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${a.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),t.value.style.chart.comments.showInTooltip&&l.comment&&(u+=`<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${l.color}">${l.comment}</div>`),O.value=`<div>${u}</div>`)}function M(l){return t.value.useBlurOnHover&&![null,void 0].includes(p.value)&&p.value!==l?`url(#blur_${h.value})`:""}const k=e.computed(()=>{const l=x.value.map(o=>({name:o.name,color:o.color})),r=x.value.map(o=>o.value);return{head:l,body:r}});function K(){e.nextTick(()=>{const l=k.value.head.map((n,u)=>[[n.name],[k.value.body[u]],[isNaN(k.value.body[u]/m.value)?"-":k.value.body[u]/m.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=a.createCsvContent(r);a.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-donut"})})}const V=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>',a.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:m.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],r=k.value.head.map((u,i)=>{const d=a.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:k.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},d,isNaN(k.value.body[i]/m.value)?"-":(k.value.body[i]/m.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};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:r,config:o}}),L=e.ref(!1);function fe(l){L.value=l,A.value+=1}const Q=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent));function ye(l){return l.toFixed(t.value.style.chart.legend.roundingPercentage).split("").map(r=>"-").join("")}function T(l,r){D("selectDatapoint",{datapoint:l,index:r})}function Z(){c.value.showTable=!c.value.showTable}function ee(){c.value.dataLabels.show=!c.value.dataLabels.show}function te(){c.value.showTooltip=!c.value.showTooltip}return re({getData:ce,generatePdf:q,generateCsv:K,generateImage:R,toggleTable:Z,toggleLabels:ee,toggleTooltip:te}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutChart",ref:$,class:e.normalizeClass(`vue-ui-donut ${L.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`donut__${h.value}`},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:I,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(pe._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&S.value?(e.openBlock(),e.createBlock(oe.UserOptions,{ref_key:"details",ref:ue,key:`user_option_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(se),isImaging:e.unref(ie),uid:h.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:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:L.value,chartElement:$.value,isTooltip:c.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},onToggleFullscreen:fe,onGeneratePdf:e.unref(q),onGenerateCsv:K,onGenerateImage:e.unref(R),onToggleTable:Z,onToggleLabels:ee,onToggleTooltip:te},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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","isTooltip","titles","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":L.value,"vue-data-ui-fulscreen--off":!L.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.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,[t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("radialGradient",{key:0,id:`gradient_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,$e),e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF"+e.unref(a.opacity)[t.value.style.chart.gradientIntensity]},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(a.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Le)],8,Se)):e.createCommentVNode("",!0)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2,id:`blur_std_${h.value}`},null,8,Ve),Te],8,Ee),e.createElementVNode("filter",{id:`shadow_${h.value}`,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"10","flood-opacity":"0.5","flood-color":t.value.style.chart.layout.donut.shadowColor},null,8,Oe)],8,ze)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(a.calcNutArrowPath)(o,{x:s.value.width/2,y:s.value.height/2},16,16,!1,!1,N.value),stroke:o.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:M(n)},null,8,Fe)):e.createCommentVNode("",!0)]))),256)),e.createElementVNode("circle",{cx:s.value.width/2,cy:s.value.height/2,r:b.value<=0?10:b.value,fill:t.value.style.chart.backgroundColor,filter:t.value.style.chart.layout.donut.useShadow?`url(#shadow_${h.value})`:""},null,8,Me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("path",{stroke:t.value.style.chart.backgroundColor,d:o.arcSlice,fill:"#FFFFFF"},null,8,Pe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}CC`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:M(n)},null,8,De))),256)),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.width/2,cy:s.value.height/2,r:b.value<=0?10:b.value,fill:`url(#gradient_${h.value})`},null,8,Ie)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("path",{"data-cy-donut-trap":"",d:o.arcSlice,fill:p.value===n?"rgba(0,0,0,0.1)":"transparent",onMouseenter:u=>he({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:r[0]||(r[0]=u=>{z.value=!1,p.value=null}),onClick:u=>T(o,n)},null,40,Xe))),256)),t.value.style.chart.layout.labels.hollow.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:s.value.width/2,cy:s.value.height/2,r:b.value-N.value<=0?10:b.value-N.value,fill:t.value.style.chart.backgroundColor},null,8,Ae)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.color,"font-size":t.value.style.chart.layout.labels.hollow.total.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.total.text),13,qe)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:3,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+t.value.style.chart.layout.labels.hollow.total.fontSize-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.value.color,"font-size":t.value.style.chart.layout.labels.hollow.total.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.value.bold?"bold":""}`)},e.toDisplayString(e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.hollow.total.value.prefix,v:m.value,s:t.value.style.chart.layout.labels.hollow.total.value.suffix})),13,Re)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:4,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.color,"font-size":t.value.style.chart.layout.labels.hollow.average.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.average.text),13,Ge)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:5,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.fontSize+t.value.style.chart.layout.labels.hollow.average.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.value.color,"font-size":t.value.style.chart.layout.labels.hollow.average.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.value.bold?"bold":""}`)},e.toDisplayString(C.value?"--":e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.hollow.average.value.prefix,v:ve.value,s:t.value.style.chart.layout.labels.hollow.average.value.suffix,r:t.value.style.chart.layout.labels.hollow.average.value.rounding})),13,He)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",{filter:M(n),class:e.normalizeClass({animated:t.value.useCssAnimation})},[t.value.style.chart.layout.labels.dataLabels.useLabelSlots?(e.openBlock(),e.createElementBlock("g",Ye,[(e.openBlock(),e.createElementBlock("foreignObject",{x:e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="end"?e.unref(a.calcMarkerOffsetX)(o).x-120:e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="middle"?e.unref(a.calcMarkerOffsetX)(o).x-60:e.unref(a.calcMarkerOffsetX)(o).x,y:e.unref(a.calcMarkerOffsetY)(o)-(Q.value?20:0),width:"120",height:"60",style:{overflow:"visible"}},[e.createElementVNode("div",null,[e.renderSlot(l.$slots,"dataLabel",e.normalizeProps(e.guardReactiveProps({datapoint:o,isBlur:!t.value.useBlurOnHover||[null,void 0].includes(p.value)||p.value===n,isSafari:Q.value,isVisible:_(o)&&c.value.dataLabels.show,textAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16,!0).anchor,flexAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16).anchor,percentage:W(o,w.value)})),void 0,!0)])],8,je))])):(e.openBlock(),e.createElementBlock("g",We,[_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(a.calcMarkerOffsetX)(o).x,cy:e.unref(a.calcMarkerOffsetY)(o)-3.5,fill:o.color,r:3,filter:!t.value.useBlurOnHover||[null,void 0].includes(p.value)||p.value===n?"":`url(#blur_${h.value})`,onClick:u=>T(o,n)},null,8,Je)):e.createCommentVNode("",!0),_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":e.unref(a.calcMarkerOffsetX)(o,!0,12).anchor,x:e.unref(a.calcMarkerOffsetX)(o,!0,12).x,y:e.unref(a.calcMarkerOffsetY)(o),fill:t.value.style.chart.layout.labels.percentage.color,"font-size":t.value.style.chart.layout.labels.percentage.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.percentage.bold?"bold":""}`),onClick:u=>T(o,n)},e.toDisplayString(W(o,w.value))+" "+e.toDisplayString(t.value.style.chart.layout.labels.value.show?`(${e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,rounding:t.value.style.chart.layout.labels.value.rounding})})`:""),13,Ke)):e.createCommentVNode("",!0),_(o)&&c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":e.unref(a.calcMarkerOffsetX)(o).anchor,x:e.unref(a.calcMarkerOffsetX)(o,!0,12).x,y:e.unref(a.calcMarkerOffsetY)(o)+t.value.style.chart.layout.labels.percentage.fontSize,fill:t.value.style.chart.layout.labels.name.color,"font-size":t.value.style.chart.layout.labels.name.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.name.bold?"bold":""}`),onClick:u=>T(o,n)},e.toDisplayString(o.name),13,Qe)):e.createCommentVNode("",!0)])),c.value.dataLabels.show&&t.value.style.chart.comments.show&&o.comment?(e.openBlock(),e.createElementBlock("g",Ze,[_(o)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:t.value.style.chart.comments.offsetX+(e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="end"?e.unref(a.calcMarkerOffsetX)(o).x-t.value.style.chart.comments.width:e.unref(a.calcMarkerOffsetX)(o,!0).anchor==="middle"?e.unref(a.calcMarkerOffsetX)(o).x-t.value.style.chart.comments.width/2:e.unref(a.calcMarkerOffsetX)(o).x),y:e.unref(a.calcMarkerOffsetY)(o)+24+t.value.style.chart.comments.offsetY,width:t.value.style.chart.comments.width,height:"200",style:{overflow:"visible","pointer-events":"none"}},[e.createElementVNode("div",null,[e.renderSlot(l.$slots,"plot-comment",{plot:{...o,textAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16,!0).anchor,flexAlign:e.unref(a.calcMarkerOffsetX)(o,!0,16).anchor}},void 0,!0)])],8,et)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Ue))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,Be)):e.createCommentVNode("",!0),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:3,config:{type:"donut",style:{backgroundColor:t.value.style.chart.backgroundColor,donut:{color:"#CCCCCC",strokeWidth:N.value*.8}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:X},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(be.Legend,{key:0,legendSet:j.value,config:de.value,onClickMarker:r[1]||(r[1]=({i:o})=>Y(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:u=>o.segregate(),style:e.normalizeStyle(`opacity:${f.value.includes(n)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(a.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),f.value.includes(n)?(e.openBlock(),e.createElementBlock("span",ot," ( "+e.toDisplayString(ye(o.proportion*100))+" % ) ",1)):(e.openBlock(),e.createElementBlock("span",lt," ("+e.toDisplayString(isNaN(o.value/m.value)?"-":e.unref(a.dataLabel)({v:C.value?o.proportion*100:o.value/m.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,tt)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:j.value},void 0,!0)],512),e.createVNode(ge._sfc_main,{show:c.value.showTooltip&&z.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,parent:$.value,content:O.value,isCustom:e.unref(a.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","parent","content","isCustom"]),S.value?(e.openBlock(),e.createBlock(we.default,{key:4,hideDetails:"",config:{open:c.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(me.DataTable,{colNames:V.value.colNames,head:V.value.head,body:V.value.body,config:V.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,at)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,_e))}},nt=Ce._export_sfc(rt,[["__scopeId","data-v-a76ecc28"]]);exports.default=nt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BkomIE9L.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),Z=require("./Title-Cj_xubjI.cjs"),D=require("./usePrinter-r6uHYEcR.cjs"),J=require("./DataTable-ssrNbONo.cjs"),K=require("./vue-ui-skeleton-JmGp11-u.cjs"),Q=require("./Legend-Dl5IYoxK.cjs"),ee=require("./vue-ui-accordion-SXsobrUt.cjs"),M=require("./useNestedProp-BMxXyPbW.cjs"),te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],oe={key:0},re=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],se={key:1},ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ue=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce={key:2},ie=["x","y","font-size","fill","font-weight"],de=["x","y","font-size","fill"],ve={key:3},he=["x","y","font-size","fill","font-weight"],ye=["id"],me=["stop-color"],be=["stop-color"],fe=["stop-color"],ge=["id"],pe=["stop-color"],ke=["stop-color"],xe=["stop-color"],_e=["id"],Ce=["stop-color"],we=["stop-color"],Be=["id"],Ne=["stop-color"],Ee=["stop-color"],Le={key:0},$e=["d","fill"],Ve={key:1},Se=["x","y","height","width","fill"],ze=["cx","cy","r","fill","stroke","stroke-width"],Xe=["cx","cy","r","fill","stroke","stroke-width"],Ae={key:2},Te=["x","y","fill","font-size"],Pe={key:3},Fe=["x","y","fill","font-size"],De=["xmlns","height","width"],Me=["fill"],Ge=["innerHTML"],Ie={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(G,{expose:I,emit:He}){const y=G,{vue_ui_dumbbell:O}=s.useConfig(),f=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),i=e.ref(s.createUid()),L=e.ref(0),p=e.ref(null),$=e.ref(null),V=e.ref(null),t=e.computed(()=>{const a=M.useNestedProp({userConfig:y.config,defaultConfig:O});return a.theme?{...M.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}),k=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=F.throttle(()=>{const{width:n,height:l}=F.useResponsive({chart:p.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?V.value:null});_.value=n,d.value=l/y.dataset.length,v.value=C()});k.value=new ResizeObserver(a),k.value.observe(p.value.parentNode)}}),e.onBeforeUnmount(()=>{k.value&&k.value.disconnect()});const{isPrinting:H,isImaging:q,generatePdf:S,generateImage:z}=D.usePrinter({elementId:`dumbbell_${i.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),x=e.ref({showTable:t.value.table.show}),m=e.computed(()=>y.dataset.map((a,n)=>({...a,id:s.createUid()}))),N=e.computed(()=>({max:Math.max(...m.value.flatMap(a=>[a.start,a.end])),min:Math.min(...m.value.flatMap(a=>[a.start,a.end]))})),u=e.computed(()=>s.calculateNiceScale(N.value.min<0?N.value.min:0,N.value.max,t.value.style.chart.grid.scaleSteps)),d=e.ref(t.value.style.chart.rowHeight),_=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=d.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+_.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=u.value.ticks.length*(_.value/u.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:_.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return m.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,c=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:c,y:o.value.top+n*d.value+d.value/2,endVal:a.start}})}const v=e.ref([]),X=e.ref(null),W=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=m.value.map(r=>r.end-r.start);a>=W.value?(cancelAnimationFrame(X.value),v.value=C()):(v.value=v.value.map((r,c)=>{r.endVal+=l[c]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,B=o.value.left+(r.endVal+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,E=h+(B-h)/2;return{...r,startX:h,endX:B,centerX:E,y:o.value.top+c*d.value+d.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,c)=>r+c,0),X.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()});const A=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${i.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${i.value})`:t.value.style.chart.plots.endColor}]),R=e.computed(()=>({cy:"donut-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,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),b=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=b.value.head.map((c,h)=>{const B=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),E=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),Y=s.dataLabel({v:100*(b.value.body[h].end/b.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:c.name},B,E,Y]}),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.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function T(){e.nextTick(()=>{const a=b.value.head.map((r,c)=>[[r.name],[b.value.body[c].start],[b.value.body[c].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const g=e.ref(!1);function U(a){g.value=a,L.value+=1}function j(){return v.value}function P(){x.value.showTable=!x.value.showTable}return I({getData:j,generatePdf:S,generateCsv:T,generateImage:z,toggleTable:P}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),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%":""}`),id:`dumbbell_${i.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(H),isImaging:e.unref(q),uid:i.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:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,onToggleFullscreen:U,onGeneratePdf:e.unref(S),onGenerateCsv:T,onGenerateImage:e.unref(z),onToggleTable:P},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"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,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(u.value.ticks.length-1),x2:o.value.left+r*o.value.width/(u.value.ticks.length-1),y1:o.value.top,y2:o.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,re))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*d.value,y2:o.value.top+r*d.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ne))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ue)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+(t.value.style.chart.labels.yAxisLabels.showProgression?d.value/3:d.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,ie))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+d.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,de))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(u.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding})),9,he))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,me),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,fe)],8,ye),e.createElementVNode("radialGradient",{id:`end_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,pe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,ke),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,xe)],8,ge)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,we)],8,_e),e.createElementVNode("linearGradient",{id:`grad_negative_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ee)],8,Be)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DFXgoR1T.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),Z=require("./Title-Ci74YZxW.cjs"),D=require("./usePrinter-DoFYRZKM.cjs"),J=require("./DataTable-BSoyXOFT.cjs"),K=require("./vue-ui-skeleton-CmABeGyu.cjs"),Q=require("./Legend-DZhpxKg4.cjs"),ee=require("./vue-ui-accordion-P9OYffC3.cjs"),M=require("./useNestedProp-CbZUIZc0.cjs"),te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],oe={key:0},re=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],se={key:1},ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ue=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce={key:2},ie=["x","y","font-size","fill","font-weight"],de=["x","y","font-size","fill"],ve={key:3},he=["x","y","font-size","fill","font-weight"],ye=["id"],me=["stop-color"],be=["stop-color"],fe=["stop-color"],ge=["id"],pe=["stop-color"],ke=["stop-color"],xe=["stop-color"],_e=["id"],Ce=["stop-color"],we=["stop-color"],Be=["id"],Ne=["stop-color"],Ee=["stop-color"],Le={key:0},$e=["d","fill"],Ve={key:1},Se=["x","y","height","width","fill"],ze=["cx","cy","r","fill","stroke","stroke-width"],Xe=["cx","cy","r","fill","stroke","stroke-width"],Ae={key:2},Te=["x","y","fill","font-size"],Pe={key:3},Fe=["x","y","fill","font-size"],De=["xmlns","height","width"],Me=["fill"],Ge=["innerHTML"],Ie={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(G,{expose:I,emit:He}){const y=G,{vue_ui_dumbbell:O}=s.useConfig(),f=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),i=e.ref(s.createUid()),L=e.ref(0),p=e.ref(null),$=e.ref(null),V=e.ref(null),t=e.computed(()=>{const a=M.useNestedProp({userConfig:y.config,defaultConfig:O});return a.theme?{...M.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}),k=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=F.throttle(()=>{const{width:n,height:l}=F.useResponsive({chart:p.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?V.value:null});_.value=n,d.value=l/y.dataset.length,v.value=C()});k.value=new ResizeObserver(a),k.value.observe(p.value.parentNode)}}),e.onBeforeUnmount(()=>{k.value&&k.value.disconnect()});const{isPrinting:H,isImaging:q,generatePdf:S,generateImage:z}=D.usePrinter({elementId:`dumbbell_${i.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),x=e.ref({showTable:t.value.table.show}),m=e.computed(()=>y.dataset.map((a,n)=>({...a,id:s.createUid()}))),N=e.computed(()=>({max:Math.max(...m.value.flatMap(a=>[a.start,a.end])),min:Math.min(...m.value.flatMap(a=>[a.start,a.end]))})),u=e.computed(()=>s.calculateNiceScale(N.value.min<0?N.value.min:0,N.value.max,t.value.style.chart.grid.scaleSteps)),d=e.ref(t.value.style.chart.rowHeight),_=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=d.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+_.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=u.value.ticks.length*(_.value/u.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:_.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return m.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,c=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:c,y:o.value.top+n*d.value+d.value/2,endVal:a.start}})}const v=e.ref([]),X=e.ref(null),W=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=m.value.map(r=>r.end-r.start);a>=W.value?(cancelAnimationFrame(X.value),v.value=C()):(v.value=v.value.map((r,c)=>{r.endVal+=l[c]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,B=o.value.left+(r.endVal+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,E=h+(B-h)/2;return{...r,startX:h,endX:B,centerX:E,y:o.value.top+c*d.value+d.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,c)=>r+c,0),X.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()});const A=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${i.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${i.value})`:t.value.style.chart.plots.endColor}]),R=e.computed(()=>({cy:"donut-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,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),b=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=b.value.head.map((c,h)=>{const B=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),E=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),Y=s.dataLabel({v:100*(b.value.body[h].end/b.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:c.name},B,E,Y]}),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.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function T(){e.nextTick(()=>{const a=b.value.head.map((r,c)=>[[r.name],[b.value.body[c].start],[b.value.body[c].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const g=e.ref(!1);function U(a){g.value=a,L.value+=1}function j(){return v.value}function P(){x.value.showTable=!x.value.showTable}return I({getData:j,generatePdf:S,generateCsv:T,generateImage:z,toggleTable:P}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),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%":""}`),id:`dumbbell_${i.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(H),isImaging:e.unref(q),uid:i.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:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,onToggleFullscreen:U,onGeneratePdf:e.unref(S),onGenerateCsv:T,onGenerateImage:e.unref(z),onToggleTable:P},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"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,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(u.value.ticks.length-1),x2:o.value.left+r*o.value.width/(u.value.ticks.length-1),y1:o.value.top,y2:o.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,re))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*d.value,y2:o.value.top+r*d.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ne))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ue)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+(t.value.style.chart.labels.yAxisLabels.showProgression?d.value/3:d.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,ie))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+d.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,de))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(u.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding})),9,he))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,me),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,fe)],8,ye),e.createElementVNode("radialGradient",{id:`end_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,pe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,ke),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,xe)],8,ge)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,we)],8,_e),e.createElementVNode("linearGradient",{id:`grad_negative_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ee)],8,Be)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("path",{d:`M
|
|
2
2
|
${l.startX},${l.y+t.value.style.chart.plots.radius/2}
|
|
3
3
|
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
4
4
|
${l.endX},${l.y+t.value.style.chart.plots.radius/2}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as m, ref as f, onMounted as Z, onBeforeUnmount as fe, openBlock as o, createElementBlock as r, normalizeClass as J, normalizeStyle as F, createVNode as K, createCommentVNode as g, createBlock as I, unref as y, createSlots as ge, withCtx as _, renderSlot as $, normalizeProps as me, guardReactiveProps as pe, Fragment as C, renderList as w, createElementVNode as n, toDisplayString as L, createTextVNode as Q, nextTick as _e } from "vue";
|
|
2
|
-
import { u as xe, c as ee, t as ke, o as Ce, e as te, g as we, z as $e, f as z, X as le, l as ae, h as se, n as Le, q as ze } from "./index-
|
|
2
|
+
import { u as xe, c as ee, t as ke, o as Ce, e as te, g as we, z as $e, f as z, X as le, l as ae, h as se, n as Le, q as ze } from "./index-CGb3gF5A.js";
|
|
3
3
|
import { t as Xe, u as Ae } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Se } from "./Title-
|
|
5
|
-
import { u as Ne, U as Te } from "./usePrinter-
|
|
6
|
-
import { D as Pe } from "./DataTable-
|
|
7
|
-
import Ge from "./vue-ui-skeleton-
|
|
8
|
-
import { L as Me } from "./Legend-
|
|
9
|
-
import De from "./vue-ui-accordion-
|
|
10
|
-
import { u as oe } from "./useNestedProp-
|
|
4
|
+
import { _ as Se } from "./Title-CfofmWzW.js";
|
|
5
|
+
import { u as Ne, U as Te } from "./usePrinter-VlAyPtaS.js";
|
|
6
|
+
import { D as Pe } from "./DataTable-BFsn-W_6.js";
|
|
7
|
+
import Ge from "./vue-ui-skeleton-B0udzFdQ.js";
|
|
8
|
+
import { L as Me } from "./Legend-DThjLfzi.js";
|
|
9
|
+
import De from "./vue-ui-accordion-Br7xhAKF.js";
|
|
10
|
+
import { u as oe } from "./useNestedProp-DCBzUHfz.js";
|
|
11
11
|
import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const Ie = ["id"], Oe = ["xmlns", "viewBox"], Ve = { key: 0 }, Ee = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], We = { key: 1 }, He = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Re = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Be = { key: 2 }, Ue = ["x", "y", "font-size", "fill", "font-weight"], je = ["x", "y", "font-size", "fill"], qe = { key: 3 }, Ye = ["x", "y", "font-size", "fill", "font-weight"], Ze = ["id"], Je = ["stop-color"], Ke = ["stop-color"], Qe = ["stop-color"], et = ["id"], tt = ["stop-color"], lt = ["stop-color"], at = ["stop-color"], st = ["id"], ot = ["stop-color"], rt = ["stop-color"], nt = ["id"], ut = ["stop-color"], it = ["stop-color"], ct = { key: 0 }, dt = ["d", "fill"], vt = { key: 1 }, ht = ["x", "y", "height", "width", "fill"], yt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], bt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], ft = { key: 2 }, gt = ["x", "y", "fill", "font-size"], mt = { key: 3 }, pt = ["x", "y", "fill", "font-size"], _t = ["xmlns", "height", "width"], xt = ["fill"], kt = ["innerHTML"], Ct = {
|
|
13
13
|
__name: "vue-ui-dumbbell",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as f, onMounted as _e, ref as k, openBlock as r, createElementBlock as v, normalizeClass as oe, normalizeStyle as w, createVNode as ae, createCommentVNode as L, createBlock as G, unref as g, createSlots as Ne, withCtx as b, renderSlot as $, normalizeProps as Te, guardReactiveProps as Pe, createElementVNode as E, Fragment as N, renderList as T, toDisplayString as B, createTextVNode as Fe, nextTick as Ie } from "vue";
|
|
2
|
-
import { u as He, o as Le, e as Ee, c as ne, t as Oe, a as Me, p as A, b as Se, f as se, X as ze, C as ue, E as Ye, n as De, q as Ge } from "./index-
|
|
3
|
-
import { _ as Be } from "./Title-
|
|
4
|
-
import { u as Ae, U as Ue } from "./usePrinter-
|
|
5
|
-
import { D as Ve } from "./DataTable-
|
|
6
|
-
import je from "./vue-ui-accordion-
|
|
7
|
-
import Xe from "./vue-ui-skeleton-
|
|
8
|
-
import { u as re } from "./useNestedProp-
|
|
2
|
+
import { u as He, o as Le, e as Ee, c as ne, t as Oe, a as Me, p as A, b as Se, f as se, X as ze, C as ue, E as Ye, n as De, q as Ge } from "./index-CGb3gF5A.js";
|
|
3
|
+
import { _ as Be } from "./Title-CfofmWzW.js";
|
|
4
|
+
import { u as Ae, U as Ue } from "./usePrinter-VlAyPtaS.js";
|
|
5
|
+
import { D as Ve } from "./DataTable-BFsn-W_6.js";
|
|
6
|
+
import je from "./vue-ui-accordion-Br7xhAKF.js";
|
|
7
|
+
import Xe from "./vue-ui-skeleton-B0udzFdQ.js";
|
|
8
|
+
import { u as re } from "./useNestedProp-DCBzUHfz.js";
|
|
9
9
|
import { _ as We } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const qe = ["id"], Re = ["xmlns", "viewBox"], Ze = ["id"], Je = ["stop-color"], Ke = ["stop-color"], Qe = ["d", "fill", "stroke", "stroke-width"], et = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "onMouseenter"], tt = ["x", "y", "font-size", "fill"], lt = ["x", "y", "font-size", "fill"], ot = ["innerHTML"], at = {
|
|
11
11
|
__name: "vue-ui-flow",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-BkomIE9L.cjs"),ue=require("./Title-Cj_xubjI.cjs"),U=require("./usePrinter-r6uHYEcR.cjs"),ie=require("./DataTable-ssrNbONo.cjs"),ce=require("./vue-ui-accordion-SXsobrUt.cjs"),de=require("./vue-ui-skeleton-JmGp11-u.cjs"),j=require("./useNestedProp-BMxXyPbW.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],he=["xmlns","viewBox"],me=["id"],ge=["stop-color"],pe=["stop-color"],ye=["d","fill","stroke","stroke-width"],be=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],ke=["x","y","font-size","fill"],we=["x","y","font-size","fill"],Ce=["innerHTML"],xe={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(A,{expose:W}){const f=A,{vue_ui_flow:X}=i.useConfig(),$=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{i.objectIsEmpty(f.dataset)&&i.error({componentName:"VueUiFlow",type:"dataset"})});const B=e.ref(i.createUid()),T=e.ref(null),P=e.ref(0),b=e.ref(!1);function R(n){b.value=n,P.value+=1}const t=e.computed(()=>{const n=j.useNestedProp({userConfig:f.config,defaultConfig:X});return n.theme?{...j.useNestedProp({userConfig:i.themes.vue_ui_flow[n.theme]||f.config,defaultConfig:n}),customPalette:i.themePalettes[n.theme]||i.palette}:n}),{isPrinting:Z,isImaging:J,generatePdf:F,generateImage:L}=U.usePrinter({elementId:`flow_${B.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),N=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),z=e.computed(()=>t.value.style.chart.nodes.gap),p=e.computed(()=>t.value.style.chart.nodes.width),k=e.ref({showTable:t.value.table.show}),I=e.computed(()=>t.value.style.chart.links.width),H=e.computed(()=>{const n={};function o(r){n[r]||(n[r]={inflow:0,outflow:0})}f.dataset.forEach(([r,a,c])=>{o(r),o(a),n[r].outflow+=c,n[a].inflow+=c});let l=0;for(const r in n){const a=Math.max(n[r].inflow,n[r].outflow);l=Math.max(l,a)}return l});function K(n){return n/H.value*100+t.value.style.chart.nodes.minHeight}function Q(n){const o=t.value.style.chart.nodes.minHeight;return(n-o)/100*H.value}function ee(n){const o={},l={};function r(s,u){o[s]||(o[s]={height:0,level:null,inflow:0,outflow:0}),o[s].level===null&&(o[s].level=u),l[u]||(l[u]=[]),l[u].includes(s)||l[u].push(s)}n.forEach(([s,u,v],y)=>{const g=o[s]?o[s].level:0,x=g+1;r(s,g),r(u,x),o[s].children||(o[s].children=[]),o[s].children.push({target:u,value:v}),o[s].outflow+=v,o[u].inflow+=v}),Object.keys(o).forEach((s,u)=>{o[s].color=N.value[u]||N.value[u%N.value.length]||i.palette[u]||i.palette[u%d.length]});for(const s in o)o[s].height=K(Math.max(o[s].inflow,o[s].outflow)),o[s].name=s;const a={};for(const s in l){let u=0;l[s].forEach((v,y)=>{const g=o[v].height;a[v]={x:parseInt(s,10)*I.value+t.value.style.chart.padding.left,y:u,absoluteY:u,height:g,i:y,color:o[v].color,value:Q(g)},u+=g+z.value})}const c=[];for(const s in o){let u=a[s].absoluteY;o[s].children&&o[s].children.forEach(({target:v,value:y},g)=>{const x=a[v].y,E=a[s],S=a[v],Y=u,D=u+y/o[s].outflow*E.height,q=x,G=x+y/o[v].inflow*S.height,re={id:i.createUid(),source:s,target:v,path:`M ${E.x+p.value} ${Y} L ${E.x+p.value} ${D} L ${S.x} ${G} L ${S.x} ${q} Z`,value:y,sourceColor:o[s].color,targetColor:o[v].color};c.push(re),u+=D-Y,a[v].y+=G-q})}return{nodeCoordinates:a,links:c}}const h=e.computed(()=>{const n=ee(f.dataset);return{nodes:Object.keys(n.nodeCoordinates).map((o,l)=>({...n.nodeCoordinates[o],name:o})),links:n.links}}),te=e.computed(()=>le(h.value.nodes));function le(n){const o={};for(const r in n){const{x:a,height:c}=n[r];o[a]||(o[a]=0),o[a]+=c+z.value}return Math.max(...Object.values(o))}const _=e.computed(()=>{const{top:n,right:o,left:l,bottom:r}=t.value.style.chart.padding,a=f.dataset.length*I.value;return{height:te.value+n+r,width:o+Math.max(...h.value.nodes.map(c=>c.x))+p.value,left:l,top:n,right:a-o,p_top:n,p_bottom:r}});function oe(n){const o={},l={},r=new Set;return f.dataset.forEach(([a,c,s])=>{o[a]||(o[a]=[]),l[c]||(l[c]=[]),o[a].push(c),l[c].push(a)}),o[n]&&o[n].forEach(a=>r.add(a)),l[n]&&l[n].forEach(a=>r.add(a)),Array.from(r).concat(n)}const m=e.ref(null),w=e.ref(null);function ne(n){m.value=oe(n.name),w.value=n.name}function ae(){m.value=null,w.value=null}const O=e.computed(()=>h.value.links.map(({source:n,target:o,sourceColor:l,targetColor:r,value:a})=>({source:n,target:o,sourceColor:l,targetColor:r,value:a})));function M(){e.nextTick(()=>{const n=O.value.map((r,a)=>[[r.source],[r.target],[r.value]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(n),l=i.createCsvContent(o);i.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const n=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],o=O.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},i.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:n,body:o,config:l}});function se(){return h.value}function V(){k.value.showTable=!k.value.showTable}return W({getData:se,generateCsv:M,generateImage:L,generatePdf:F,toggleTable:V}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:T,class:e.normalizeClass(`vue-ui-flow ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`flow_${B.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(ue._sfc_main,{config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_option_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Z),isImaging:e.unref(J),uid:B.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:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:T.value,onToggleFullscreen:R,onGeneratePdf:e.unref(F),onGenerateCsv:M,onGenerateImage:e.unref(L),onToggleTable:V},e.createSlots({_:2},[n.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,n.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,n.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,n.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,n.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(n.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),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),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(i.XMLNS),viewBox:`0 0 ${_.value.width} ${_.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),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(h.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,pe)],8,me))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[l.target,l.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,ye))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:l.absoluteY,height:l.height,width:p.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ne(l),onMouseleave:o[0]||(o[0]=a=>ae()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+p.value/2,y:l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(i.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(i.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+p.value/2,y:l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(i.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})),13,we))),256)),e.renderSlot(n.$slots,"svg",{svg:_.value},void 0,!0)],14,he)),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:2,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),$.value?(e.openBlock(),e.createBlock(ce.default,{key:3,hideDetails:"",config:{open:k.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ie.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:o[1]||(o[1]=l=>k.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ce)]),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)],14,fe))}},$e=ve._export_sfc(xe,[["__scopeId","data-v-f8a1c2bf"]]);exports.default=$e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-DFXgoR1T.cjs"),ue=require("./Title-Ci74YZxW.cjs"),U=require("./usePrinter-DoFYRZKM.cjs"),ie=require("./DataTable-BSoyXOFT.cjs"),ce=require("./vue-ui-accordion-P9OYffC3.cjs"),de=require("./vue-ui-skeleton-CmABeGyu.cjs"),j=require("./useNestedProp-CbZUIZc0.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],he=["xmlns","viewBox"],me=["id"],ge=["stop-color"],pe=["stop-color"],ye=["d","fill","stroke","stroke-width"],be=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],ke=["x","y","font-size","fill"],we=["x","y","font-size","fill"],Ce=["innerHTML"],xe={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(A,{expose:W}){const f=A,{vue_ui_flow:X}=i.useConfig(),$=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{i.objectIsEmpty(f.dataset)&&i.error({componentName:"VueUiFlow",type:"dataset"})});const B=e.ref(i.createUid()),T=e.ref(null),P=e.ref(0),b=e.ref(!1);function R(n){b.value=n,P.value+=1}const t=e.computed(()=>{const n=j.useNestedProp({userConfig:f.config,defaultConfig:X});return n.theme?{...j.useNestedProp({userConfig:i.themes.vue_ui_flow[n.theme]||f.config,defaultConfig:n}),customPalette:i.themePalettes[n.theme]||i.palette}:n}),{isPrinting:Z,isImaging:J,generatePdf:F,generateImage:L}=U.usePrinter({elementId:`flow_${B.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),N=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),z=e.computed(()=>t.value.style.chart.nodes.gap),p=e.computed(()=>t.value.style.chart.nodes.width),k=e.ref({showTable:t.value.table.show}),I=e.computed(()=>t.value.style.chart.links.width),H=e.computed(()=>{const n={};function o(r){n[r]||(n[r]={inflow:0,outflow:0})}f.dataset.forEach(([r,a,c])=>{o(r),o(a),n[r].outflow+=c,n[a].inflow+=c});let l=0;for(const r in n){const a=Math.max(n[r].inflow,n[r].outflow);l=Math.max(l,a)}return l});function K(n){return n/H.value*100+t.value.style.chart.nodes.minHeight}function Q(n){const o=t.value.style.chart.nodes.minHeight;return(n-o)/100*H.value}function ee(n){const o={},l={};function r(s,u){o[s]||(o[s]={height:0,level:null,inflow:0,outflow:0}),o[s].level===null&&(o[s].level=u),l[u]||(l[u]=[]),l[u].includes(s)||l[u].push(s)}n.forEach(([s,u,v],y)=>{const g=o[s]?o[s].level:0,x=g+1;r(s,g),r(u,x),o[s].children||(o[s].children=[]),o[s].children.push({target:u,value:v}),o[s].outflow+=v,o[u].inflow+=v}),Object.keys(o).forEach((s,u)=>{o[s].color=N.value[u]||N.value[u%N.value.length]||i.palette[u]||i.palette[u%d.length]});for(const s in o)o[s].height=K(Math.max(o[s].inflow,o[s].outflow)),o[s].name=s;const a={};for(const s in l){let u=0;l[s].forEach((v,y)=>{const g=o[v].height;a[v]={x:parseInt(s,10)*I.value+t.value.style.chart.padding.left,y:u,absoluteY:u,height:g,i:y,color:o[v].color,value:Q(g)},u+=g+z.value})}const c=[];for(const s in o){let u=a[s].absoluteY;o[s].children&&o[s].children.forEach(({target:v,value:y},g)=>{const x=a[v].y,E=a[s],S=a[v],Y=u,D=u+y/o[s].outflow*E.height,q=x,G=x+y/o[v].inflow*S.height,re={id:i.createUid(),source:s,target:v,path:`M ${E.x+p.value} ${Y} L ${E.x+p.value} ${D} L ${S.x} ${G} L ${S.x} ${q} Z`,value:y,sourceColor:o[s].color,targetColor:o[v].color};c.push(re),u+=D-Y,a[v].y+=G-q})}return{nodeCoordinates:a,links:c}}const h=e.computed(()=>{const n=ee(f.dataset);return{nodes:Object.keys(n.nodeCoordinates).map((o,l)=>({...n.nodeCoordinates[o],name:o})),links:n.links}}),te=e.computed(()=>le(h.value.nodes));function le(n){const o={};for(const r in n){const{x:a,height:c}=n[r];o[a]||(o[a]=0),o[a]+=c+z.value}return Math.max(...Object.values(o))}const _=e.computed(()=>{const{top:n,right:o,left:l,bottom:r}=t.value.style.chart.padding,a=f.dataset.length*I.value;return{height:te.value+n+r,width:o+Math.max(...h.value.nodes.map(c=>c.x))+p.value,left:l,top:n,right:a-o,p_top:n,p_bottom:r}});function oe(n){const o={},l={},r=new Set;return f.dataset.forEach(([a,c,s])=>{o[a]||(o[a]=[]),l[c]||(l[c]=[]),o[a].push(c),l[c].push(a)}),o[n]&&o[n].forEach(a=>r.add(a)),l[n]&&l[n].forEach(a=>r.add(a)),Array.from(r).concat(n)}const m=e.ref(null),w=e.ref(null);function ne(n){m.value=oe(n.name),w.value=n.name}function ae(){m.value=null,w.value=null}const O=e.computed(()=>h.value.links.map(({source:n,target:o,sourceColor:l,targetColor:r,value:a})=>({source:n,target:o,sourceColor:l,targetColor:r,value:a})));function M(){e.nextTick(()=>{const n=O.value.map((r,a)=>[[r.source],[r.target],[r.value]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(n),l=i.createCsvContent(o);i.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const n=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],o=O.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},i.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:n,body:o,config:l}});function se(){return h.value}function V(){k.value.showTable=!k.value.showTable}return W({getData:se,generateCsv:M,generateImage:L,generatePdf:F,toggleTable:V}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:T,class:e.normalizeClass(`vue-ui-flow ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`flow_${B.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(ue._sfc_main,{config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_option_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Z),isImaging:e.unref(J),uid:B.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:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:T.value,onToggleFullscreen:R,onGeneratePdf:e.unref(F),onGenerateCsv:M,onGenerateImage:e.unref(L),onToggleTable:V},e.createSlots({_:2},[n.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,n.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,n.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,n.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,n.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(n.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),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),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(i.XMLNS),viewBox:`0 0 ${_.value.width} ${_.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),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(h.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,pe)],8,me))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[l.target,l.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,ye))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:l.absoluteY,height:l.height,width:p.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ne(l),onMouseleave:o[0]||(o[0]=a=>ae()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+p.value/2,y:l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(i.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(i.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+p.value/2,y:l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(i.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})),13,we))),256)),e.renderSlot(n.$slots,"svg",{svg:_.value},void 0,!0)],14,he)),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:2,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),$.value?(e.openBlock(),e.createBlock(ce.default,{key:3,hideDetails:"",config:{open:k.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ie.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:o[1]||(o[1]=l=>k.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ce)]),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)],14,fe))}},$e=ve._export_sfc(xe,[["__scopeId","data-v-f8a1c2bf"]]);exports.default=$e;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as v, onMounted as be, ref as u, openBlock as r, createElementBlock as n, normalizeClass as N, normalizeStyle as F, createVNode as W, createCommentVNode as d, createBlock as S, unref as C, createSlots as me, withCtx as i, renderSlot as h, normalizeProps as z, guardReactiveProps as A, createElementVNode as x, Fragment as Q, renderList as Z, createTextVNode as ee, toDisplayString as I, nextTick as ke } from "vue";
|
|
2
|
-
import { u as Ce, o as xe, e as te, g as we, c as le, t as $e, a as Te, p as L, b as _e, d as Pe, F as Ne, f as O, X as Fe, v as ae, w as Se, n as Ie, q as Le } from "./index-
|
|
3
|
-
import { L as Oe } from "./Legend-
|
|
4
|
-
import { _ as Ee } from "./Title-
|
|
5
|
-
import { _ as Ve } from "./Tooltip-
|
|
6
|
-
import { D as Be } from "./DataTable-
|
|
7
|
-
import { u as De, U as Ge } from "./usePrinter-
|
|
8
|
-
import Me from "./vue-ui-skeleton-
|
|
9
|
-
import We from "./vue-ui-accordion-
|
|
10
|
-
import { u as oe } from "./useNestedProp-
|
|
2
|
+
import { u as Ce, o as xe, e as te, g as we, c as le, t as $e, a as Te, p as L, b as _e, d as Pe, F as Ne, f as O, X as Fe, v as ae, w as Se, n as Ie, q as Le } from "./index-CGb3gF5A.js";
|
|
3
|
+
import { L as Oe } from "./Legend-DThjLfzi.js";
|
|
4
|
+
import { _ as Ee } from "./Title-CfofmWzW.js";
|
|
5
|
+
import { _ as Ve } from "./Tooltip-cIpD1ChA.js";
|
|
6
|
+
import { D as Be } from "./DataTable-BFsn-W_6.js";
|
|
7
|
+
import { u as De, U as Ge } from "./usePrinter-VlAyPtaS.js";
|
|
8
|
+
import Me from "./vue-ui-skeleton-B0udzFdQ.js";
|
|
9
|
+
import We from "./vue-ui-accordion-Br7xhAKF.js";
|
|
10
|
+
import { u as oe } from "./useNestedProp-DCBzUHfz.js";
|
|
11
11
|
import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const Ae = ["id"], He = ["xmlns", "viewBox"], Ue = ["id"], Xe = ["stdDeviation"], Re = ["d", "stroke", "stroke-width"], je = ["d", "stroke", "stroke-width"], qe = ["filter"], Ye = ["d", "stroke", "stroke-width"], Je = ["d", "stroke-width", "onMouseenter", "onClick"], Ke = ["onClick"], Qe = { key: 0 }, Ze = { key: 1 }, et = ["innerHTML"], tt = {
|
|
13
13
|
__name: "vue-ui-galaxy",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BkomIE9L.cjs"),K=require("./Legend-Dl5IYoxK.cjs"),Q=require("./Title-Cj_xubjI.cjs"),Z=require("./Tooltip-CdJ5hegk.cjs"),ee=require("./DataTable-ssrNbONo.cjs"),O=require("./usePrinter-r6uHYEcR.cjs"),te=require("./vue-ui-skeleton-JmGp11-u.cjs"),le=require("./vue-ui-accordion-SXsobrUt.cjs"),z=require("./useNestedProp-BMxXyPbW.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],re=["xmlns","viewBox"],ne=["id"],ue=["stdDeviation"],se=["d","stroke","stroke-width"],ie=["d","stroke","stroke-width"],ce=["filter"],de=["d","stroke","stroke-width"],ve=["d","stroke-width","onMouseenter","onClick"],he=["onClick"],pe={key:0},ge={key:1},ye=["innerHTML"],fe={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(D,{expose:q,emit:B}){const d=D,{vue_ui_galaxy:G}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):d.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})});const y=e.ref(r.createUid()),C=e.ref(null),M=e.ref(null),x=e.ref(!1),w=e.ref(""),i=e.ref(null),S=e.ref(0),t=e.computed(()=>{const l=z.useNestedProp({userConfig:d.config,defaultConfig:G});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||d.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:W,isImaging:U,generatePdf:_,generateImage:P}=O.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),A=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}),$=e.ref({height:180,width:250}),s=e.ref([]);function T(l){s.value.includes(l.id)?s.value=s.value.filter(a=>a!==l.id):s.value.push(l.id),B("selectLegend",f.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const p=e.computed(()=>d.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||A.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?l.values.reduce((o,n)=>o+n,0):0,absoluteValues:l.values||[0],id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function H(){return p.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const c=e.computed(()=>p.value.filter(l=>!s.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),R=e.ref(190),E=e.computed(()=>p.value.filter(l=>!s.value.includes(l.id))),f=e.computed(()=>{const l=[];for(let a=0;a<E.value.length;a+=1){const o=E.value[a];let n=o.value/c.value*R.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/c.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!s.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function X(l){m.value=l,S.value+=1}const N=e.ref(null);function j({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){N.value={datapoint:l,seriesIndex:o,series:p.value,config:t.value},x.value=n,i.value=l.id;let u="";const g=t.value.style.chart.tooltip.customFormat;r.isFunction(g)&&r.functionReturnsString(()=>g({seriesIndex:o,datapoint:l,series:p.value,config:t.value}))?w.value=g({seriesIndex:o,datapoint:l,series:p.value,config:t.value}):(u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),w.value=`<div>${u}</div>`)}const V=e.computed(()=>p.value.map((l,a)=>({...l,proportion:(l.value||0)/d.dataset.map(o=>(o.values||[]).reduce((n,u)=>n+u,0)).reduce((o,n)=>o+n,0),opacity:s.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>T(l),isSegregated:s.value.includes(l.id)}))),Y=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),h=e.computed(()=>{const l=f.value.map(o=>({name:o.name,color:o.color})),a=f.value.map(o=>o.value);return{head:l,body:a}});function F(){e.nextTick(()=>{const l=h.value.head.map((n,u)=>[[n.name],[h.value.body[u]],[isNaN(h.value.body[u]/c.value)?"-":h.value.body[u]/c.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const k=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:c.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=h.value.head.map((u,g)=>{const J=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.value.body[g],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},J,isNaN(h.value.body[g]/c.value)?"-":(h.value.body[g]/c.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};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function L(){v.value.showTable=!v.value.showTable}function I(){v.value.showTooltip=!v.value.showTooltip}return q({getData:H,generatePdf:_,generateCsv:F,generateImage:P,toggleTable:L,toggleTooltip:I}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:C,class:e.normalizeClass(`vue-ui-galaxy ${m.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${y.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Q._sfc_main,{config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref_key:"details",ref:M,key:`user_option_${S.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(W),isImaging:e.unref(U),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:m.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,onToggleFullscreen:X,onGeneratePdf:e.unref(_),onGenerateCsv:F,onGenerateImage:e.unref(P),onToggleTable:L,onToggleTooltip:I},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value}),viewBox:`0 0 ${$.value.width} ${$.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.createElementVNode("filter",{id:`blur_${y.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,ue)],8,ne)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,se)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${i.value&&i.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,ie)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${y.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${i.value&&i.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,de)],8,ce)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:u=>j({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=u=>{x.value=!1,i.value=null}),onClick:u=>B("selectDatapoint",o)},null,40,ve)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:$.value},void 0,!0)],14,re)):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(te.default,{key:3,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(K.Legend,{key:4,legendSet:V.value,config:Y.value,onClickMarker:a[1]||(a[1]=({legend:o})=>T(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:u=>T(o),style:e.normalizeStyle(`opacity:${s.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),s.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",ge," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",pe," ("+e.toDisplayString(isNaN(o.value/c.value)?"-":(o.value/c.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,he)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:V.value},void 0,!0),e.createVNode(Z._sfc_main,{show:v.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,parent:C.value,content:w.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(le.default,{key:5,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ee.DataTable,{colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,ye)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ae))}},me=oe._export_sfc(fe,[["__scopeId","data-v-53c416de"]]);exports.default=me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DFXgoR1T.cjs"),K=require("./Legend-DZhpxKg4.cjs"),Q=require("./Title-Ci74YZxW.cjs"),Z=require("./Tooltip-BNMjZUBc.cjs"),ee=require("./DataTable-BSoyXOFT.cjs"),O=require("./usePrinter-DoFYRZKM.cjs"),te=require("./vue-ui-skeleton-CmABeGyu.cjs"),le=require("./vue-ui-accordion-P9OYffC3.cjs"),z=require("./useNestedProp-CbZUIZc0.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],re=["xmlns","viewBox"],ne=["id"],ue=["stdDeviation"],se=["d","stroke","stroke-width"],ie=["d","stroke","stroke-width"],ce=["filter"],de=["d","stroke","stroke-width"],ve=["d","stroke-width","onMouseenter","onClick"],he=["onClick"],pe={key:0},ge={key:1},ye=["innerHTML"],fe={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(D,{expose:q,emit:B}){const d=D,{vue_ui_galaxy:G}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):d.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})});const y=e.ref(r.createUid()),C=e.ref(null),M=e.ref(null),x=e.ref(!1),w=e.ref(""),i=e.ref(null),S=e.ref(0),t=e.computed(()=>{const l=z.useNestedProp({userConfig:d.config,defaultConfig:G});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||d.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:W,isImaging:U,generatePdf:_,generateImage:P}=O.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),A=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}),$=e.ref({height:180,width:250}),s=e.ref([]);function T(l){s.value.includes(l.id)?s.value=s.value.filter(a=>a!==l.id):s.value.push(l.id),B("selectLegend",f.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const p=e.computed(()=>d.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||A.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?l.values.reduce((o,n)=>o+n,0):0,absoluteValues:l.values||[0],id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function H(){return p.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const c=e.computed(()=>p.value.filter(l=>!s.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),R=e.ref(190),E=e.computed(()=>p.value.filter(l=>!s.value.includes(l.id))),f=e.computed(()=>{const l=[];for(let a=0;a<E.value.length;a+=1){const o=E.value[a];let n=o.value/c.value*R.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/c.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!s.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function X(l){m.value=l,S.value+=1}const N=e.ref(null);function j({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){N.value={datapoint:l,seriesIndex:o,series:p.value,config:t.value},x.value=n,i.value=l.id;let u="";const g=t.value.style.chart.tooltip.customFormat;r.isFunction(g)&&r.functionReturnsString(()=>g({seriesIndex:o,datapoint:l,series:p.value,config:t.value}))?w.value=g({seriesIndex:o,datapoint:l,series:p.value,config:t.value}):(u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),w.value=`<div>${u}</div>`)}const V=e.computed(()=>p.value.map((l,a)=>({...l,proportion:(l.value||0)/d.dataset.map(o=>(o.values||[]).reduce((n,u)=>n+u,0)).reduce((o,n)=>o+n,0),opacity:s.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>T(l),isSegregated:s.value.includes(l.id)}))),Y=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),h=e.computed(()=>{const l=f.value.map(o=>({name:o.name,color:o.color})),a=f.value.map(o=>o.value);return{head:l,body:a}});function F(){e.nextTick(()=>{const l=h.value.head.map((n,u)=>[[n.name],[h.value.body[u]],[isNaN(h.value.body[u]/c.value)?"-":h.value.body[u]/c.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const k=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:c.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=h.value.head.map((u,g)=>{const J=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.value.body[g],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},J,isNaN(h.value.body[g]/c.value)?"-":(h.value.body[g]/c.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};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function L(){v.value.showTable=!v.value.showTable}function I(){v.value.showTooltip=!v.value.showTooltip}return q({getData:H,generatePdf:_,generateCsv:F,generateImage:P,toggleTable:L,toggleTooltip:I}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:C,class:e.normalizeClass(`vue-ui-galaxy ${m.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${y.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Q._sfc_main,{config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref_key:"details",ref:M,key:`user_option_${S.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(W),isImaging:e.unref(U),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:m.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,onToggleFullscreen:X,onGeneratePdf:e.unref(_),onGenerateCsv:F,onGenerateImage:e.unref(P),onToggleTable:L,onToggleTooltip:I},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value}),viewBox:`0 0 ${$.value.width} ${$.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.createElementVNode("filter",{id:`blur_${y.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,ue)],8,ne)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,se)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${i.value&&i.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,ie)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${y.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${i.value&&i.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,de)],8,ce)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:u=>j({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=u=>{x.value=!1,i.value=null}),onClick:u=>B("selectDatapoint",o)},null,40,ve)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:$.value},void 0,!0)],14,re)):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(te.default,{key:3,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(K.Legend,{key:4,legendSet:V.value,config:Y.value,onClickMarker:a[1]||(a[1]=({legend:o})=>T(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:u=>T(o),style:e.normalizeStyle(`opacity:${s.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),s.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",ge," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",pe," ("+e.toDisplayString(isNaN(o.value/c.value)?"-":(o.value/c.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,he)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:V.value},void 0,!0),e.createVNode(Z._sfc_main,{show:v.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,parent:C.value,content:w.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(le.default,{key:5,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ee.DataTable,{colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,ye)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ae))}},me=oe._export_sfc(fe,[["__scopeId","data-v-53c416de"]]);exports.default=me;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BkomIE9L.cjs"),V=require("./useResponsive-B3TrDDIG.cjs"),I=require("./usePrinter-r6uHYEcR.cjs"),T=require("./vue-ui-skeleton-JmGp11-u.cjs"),O=require("./useNestedProp-BMxXyPbW.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Z=["id"],J=["xmlns","viewBox"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["stop-color"],ae=["id"],le=["stdDeviation"],oe=["d","fill","stroke"],re=["d","filter"],ne=["y","width","height","fill"],se=["x","y","text-anchor","font-size","font-weight","fill"],ue=["x","y","font-size","font-weight","fill"],ie={key:1},ce=["x1","y1","x2","y2","stroke","stroke-width"],de=["x1","y1","x2","y2","stroke","stroke-width"],ve=["x1","y1","x2","y2","stroke-width","filter"],he={key:2},ye=["d","fill","stroke","stroke-width"],fe=["cx","cy","fill","r","stroke-width","stroke"],me=["x","y","font-size","fill"],pe={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(_,{expose:X}){const u=_,{vue_ui_gauge:D}=r.useConfig(),b=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),h=e.ref(r.createUid()),Y=e.ref(null),C=e.ref(0),x=e.ref(null),N=e.ref(null),$=e.ref(null),t=e.computed(()=>{const o=O.useNestedProp({userConfig:u.config,defaultConfig:D});return o.theme?{...O.useNestedProp({userConfig:r.themes.vue_ui_gauge[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}),{isPrinting:G,isImaging:R,generatePdf:B,generateImage:E}=I.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),f=e.computed(()=>{if(!b.value||r.objectIsEmpty(u.dataset.series||{}))return{value:0,series:[{from:0,to:1}]};const o=[];(u.dataset.series||[]).forEach(l=>{o.push(l.from||0),o.push(l.to||0)});const n=Math.max(...o);return{...u.dataset,series:(u.dataset.series||[]).map((l,i)=>({...l,color:r.convertColorToHex(l.color)||j.value[i]||r.palette[i],value:((l.to||0)-(l.from||0))/n*100}))}}),d=e.ref(512),a=e.ref({height:358.4,width:d.value,top:0,bottom:358.4,centerX:179.2,centerY:d.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),g=e.ref(0),m=e.ref(0),v=e.ref(t.value.style.chart.animation.use?0:u.dataset.value);e.watch(()=>u.dataset.value,()=>{v.value=t.value.style.chart.animation.use?0:u.dataset.value,M()});const c=e.computed(()=>{const o=a.value.width/2,n=s.value.base,l=Math.PI*((v.value+0-m.value)/(g.value-m.value))+Math.PI;return{x1:o,y1:n,x2:o+s.value.pointerSize*a.value.pointerSize*.9*Math.cos(l),y2:n+s.value.pointerSize*a.value.pointerSize*.9*Math.sin(l)}}),P=e.computed(()=>{const o=a.value.width/2,n=s.value.base,l=Math.PI*((v.value+0-m.value)/(g.value-m.value))+Math.PI,i=o+s.value.pointerSize*a.value.pointerSize*.9*Math.cos(l),z=n+s.value.pointerSize*a.value.pointerSize*.9*Math.sin(l),y=a.value.pointerRadius,w=o+y*Math.cos(l+Math.PI/2),L=n+y*Math.sin(l+Math.PI/2),U=o+y*Math.cos(l-Math.PI/2),W=n+y*Math.sin(l-Math.PI/2);return isNaN(i)?null:`M ${i},${z} ${w},${L} ${U},${W} Z`}),F=e.computed(()=>{for(let o=0;o<f.value.series.length;o+=1){const{color:n,from:l,to:i}=f.value.series[o];if(v.value>=l&&v.value<=i)return n}return"#2D353C"}),S=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiGauge",type:"dataset"}):(r.getMissingDatasetAttributes({datasetObject:u.dataset,requiredAttributes:["value","series"]}).forEach(o=>{r.error({componentName:"VueUiGauge",type:"datasetAttribute",property:o})}),Object.hasOwn(u.dataset,"series")&&(u.dataset.series.length?u.dataset.series.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["from","to"]}).forEach(l=>{r.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:l,index:n})})}):r.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),M(),t.value.responsive){const o=V.throttle(()=>{const{width:n,height:l}=V.useResponsive({chart:x.value,title:t.value.style.chart.title.text?N.value:null,legend:$.value});a.value.width=n,a.value.height=l,a.value.centerX=n/2,a.value.centerY=d.value/2/358.4*l,a.value.bottom=l,a.value.labelFontSize=18/d.value*Math.min(l,n)<10?10:18/d.value*Math.min(l,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/d.value*Math.min(l,n)<14?14:t.value.style.chart.legend.fontSize/d.value*Math.min(l,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/d.value*Math.min(l,n),a.value.trackSize=t.value.style.chart.layout.track.size/d.value*Math.min(l,n),a.value.pointerStrokeWidth=r.translateSize({relator:Math.min(n,l),adjuster:d.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=r.translateSize({relator:Math.max(n,l),adjuster:d.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});S.value=new ResizeObserver(o),S.value.observe(x.value.parentNode)}}),e.onBeforeUnmount(()=>{S.value&&S.value.disconnect()});function M(){const o=[];(f.value.series||[]).forEach(w=>{o.push(w.from||0),o.push(w.to||0)}),g.value=Math.max(...o),m.value=Math.min(...o);const n=String(g.value).length;let l=0,i=(n>2?.01:.001)*t.value.style.chart.animation.speed,z=(n>2?.05:.005)*t.value.style.chart.animation.acceleration;function y(){v.value+=i+l,l+=z,v.value<u.dataset.value?requestAnimationFrame(y):v.value=u.dataset.value}t.value.style.chart.animation.use&&(v.value=m.value,y())}const s=e.computed(()=>{const o=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:o/2.5,gradients:o/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),p=e.computed(()=>r.makeDonut({series:f.value.series},a.value.width/2,s.value.base,s.value.arcs,s.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),A=e.computed(()=>r.makeDonut({series:f.value.series},a.value.width/2,s.value.base,s.value.gradients,s.value.gradients,1,1,1,180,109.9495,2*a.value.trackSize)),k=e.ref(!1);function q(o){k.value=o,C.value+=1}return X({generatePdf:B,generateImage:E}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:x,id:`vue-ui-gauge_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:N,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px;${t.value.userOptions.show?"padding-top:36px":""}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;text-align:center;color:${t.value.style.chart.title.color};font-size:${t.value.style.chart.title.fontSize}px;font-weight:${t.value.style.chart.title.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.title.text),5),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;text-align:center;color:${t.value.style.chart.title.subtitle.color};font-size:${t.value.style.chart.title.subtitle.fontSize}px;font-weight:${t.value.style.chart.title.subtitle.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.title.subtitle.text),5)):e.createCommentVNode("",!0),isNaN(_.dataset.base)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;color:${t.value.style.chart.title.subtitle.color};font-size:${t.value.style.chart.title.subtitle.fontSize}px;font-weight:${t.value.style.chart.title.subtitle.bold?"bold":""}`)},e.toDisplayString(t.value.translations.base)+" : "+e.toDisplayString(_.dataset.base),5))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(I.UserOptions,{ref_key:"details",ref:Y,key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(R),isPrinting:e.unref(G),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:x.value,onToggleFullscreen:q,onGeneratePdf:e.unref(B),onGenerateImage:e.unref(E)},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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(r.opacity)[1]}`},null,8,Q),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(r.opacity)[t.value.style.chart.layout.track.gradientIntensity]}`},null,8,ee),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(r.opacity)[1]}`},null,8,te)],8,K)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,le)],8,ae)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:l.arcSlice,fill:l.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,oe))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:l.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,re))),128)),e.createElementVNode("rect",{x:0,y:s.value.base,width:a.value.width<=0?1e-4:a.value.width,height:a.value.height*.3<=0?1e-4:a.value.height*.3,fill:t.value.style.chart.backgroundColor},null,8,ne)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:l.center.startX,initY:l.center.startY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:l.center.startX,initY:l.center.startY,offset:a.value.markerOffset}).y,"text-anchor":l.center.startX<a.value.width/2-5?"end":l.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(l.from.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,se))),256)),e.createElementVNode("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:p.value.at(-1).endX,initY:p.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:p.value.at(-1).endX,initY:p.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(g.value.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,ue),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",ie,[isNaN(c.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:c.value.x1,y1:c.value.y1,x2:c.value.x2,y2:c.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,ce)),isNaN(c.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:c.value.x1,y1:c.value.y1,x2:c.value.x2,y2:c.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,de)),!isNaN(c.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:c.value.x1,y1:c.value.y1,x2:c.value.x2,y2:c.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,ve)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",he,[P.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:P.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,ye)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:s.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,fe),e.createElementVNode("text",{x:a.value.width/2,y:s.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(t.value.style.chart.legend.prefix)+" "+e.toDisplayString(t.value.style.chart.legend.showPlusSymbol&&v.value>0?"+":"")+e.toDisplayString(v.value.toFixed(t.value.style.chart.legend.roundingValue))+" "+e.toDisplayString(t.value.style.chart.legend.suffix),9,me),e.renderSlot(o.$slots,"svg",{svg:a.value},void 0,!0)],14,J)):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T.default,{key:3,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:$},[e.renderSlot(o.$slots,"legend",{legend:f.value},void 0,!0)],512)],14,Z))}},ge=H._export_sfc(pe,[["__scopeId","data-v-a862b4a9"]]);exports.default=ge;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DFXgoR1T.cjs"),V=require("./useResponsive-B3TrDDIG.cjs"),I=require("./usePrinter-DoFYRZKM.cjs"),T=require("./vue-ui-skeleton-CmABeGyu.cjs"),O=require("./useNestedProp-CbZUIZc0.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Z=["id"],J=["xmlns","viewBox"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["stop-color"],ae=["id"],le=["stdDeviation"],oe=["d","fill","stroke"],re=["d","filter"],ne=["y","width","height","fill"],se=["x","y","text-anchor","font-size","font-weight","fill"],ue=["x","y","font-size","font-weight","fill"],ie={key:1},ce=["x1","y1","x2","y2","stroke","stroke-width"],de=["x1","y1","x2","y2","stroke","stroke-width"],ve=["x1","y1","x2","y2","stroke-width","filter"],he={key:2},ye=["d","fill","stroke","stroke-width"],fe=["cx","cy","fill","r","stroke-width","stroke"],me=["x","y","font-size","fill"],pe={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(_,{expose:X}){const u=_,{vue_ui_gauge:D}=r.useConfig(),b=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),h=e.ref(r.createUid()),Y=e.ref(null),C=e.ref(0),x=e.ref(null),N=e.ref(null),$=e.ref(null),t=e.computed(()=>{const o=O.useNestedProp({userConfig:u.config,defaultConfig:D});return o.theme?{...O.useNestedProp({userConfig:r.themes.vue_ui_gauge[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}),{isPrinting:G,isImaging:R,generatePdf:B,generateImage:E}=I.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),f=e.computed(()=>{if(!b.value||r.objectIsEmpty(u.dataset.series||{}))return{value:0,series:[{from:0,to:1}]};const o=[];(u.dataset.series||[]).forEach(l=>{o.push(l.from||0),o.push(l.to||0)});const n=Math.max(...o);return{...u.dataset,series:(u.dataset.series||[]).map((l,i)=>({...l,color:r.convertColorToHex(l.color)||j.value[i]||r.palette[i],value:((l.to||0)-(l.from||0))/n*100}))}}),d=e.ref(512),a=e.ref({height:358.4,width:d.value,top:0,bottom:358.4,centerX:179.2,centerY:d.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),g=e.ref(0),m=e.ref(0),v=e.ref(t.value.style.chart.animation.use?0:u.dataset.value);e.watch(()=>u.dataset.value,()=>{v.value=t.value.style.chart.animation.use?0:u.dataset.value,M()});const c=e.computed(()=>{const o=a.value.width/2,n=s.value.base,l=Math.PI*((v.value+0-m.value)/(g.value-m.value))+Math.PI;return{x1:o,y1:n,x2:o+s.value.pointerSize*a.value.pointerSize*.9*Math.cos(l),y2:n+s.value.pointerSize*a.value.pointerSize*.9*Math.sin(l)}}),P=e.computed(()=>{const o=a.value.width/2,n=s.value.base,l=Math.PI*((v.value+0-m.value)/(g.value-m.value))+Math.PI,i=o+s.value.pointerSize*a.value.pointerSize*.9*Math.cos(l),z=n+s.value.pointerSize*a.value.pointerSize*.9*Math.sin(l),y=a.value.pointerRadius,w=o+y*Math.cos(l+Math.PI/2),L=n+y*Math.sin(l+Math.PI/2),U=o+y*Math.cos(l-Math.PI/2),W=n+y*Math.sin(l-Math.PI/2);return isNaN(i)?null:`M ${i},${z} ${w},${L} ${U},${W} Z`}),F=e.computed(()=>{for(let o=0;o<f.value.series.length;o+=1){const{color:n,from:l,to:i}=f.value.series[o];if(v.value>=l&&v.value<=i)return n}return"#2D353C"}),S=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiGauge",type:"dataset"}):(r.getMissingDatasetAttributes({datasetObject:u.dataset,requiredAttributes:["value","series"]}).forEach(o=>{r.error({componentName:"VueUiGauge",type:"datasetAttribute",property:o})}),Object.hasOwn(u.dataset,"series")&&(u.dataset.series.length?u.dataset.series.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["from","to"]}).forEach(l=>{r.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:l,index:n})})}):r.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),M(),t.value.responsive){const o=V.throttle(()=>{const{width:n,height:l}=V.useResponsive({chart:x.value,title:t.value.style.chart.title.text?N.value:null,legend:$.value});a.value.width=n,a.value.height=l,a.value.centerX=n/2,a.value.centerY=d.value/2/358.4*l,a.value.bottom=l,a.value.labelFontSize=18/d.value*Math.min(l,n)<10?10:18/d.value*Math.min(l,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/d.value*Math.min(l,n)<14?14:t.value.style.chart.legend.fontSize/d.value*Math.min(l,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/d.value*Math.min(l,n),a.value.trackSize=t.value.style.chart.layout.track.size/d.value*Math.min(l,n),a.value.pointerStrokeWidth=r.translateSize({relator:Math.min(n,l),adjuster:d.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=r.translateSize({relator:Math.max(n,l),adjuster:d.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});S.value=new ResizeObserver(o),S.value.observe(x.value.parentNode)}}),e.onBeforeUnmount(()=>{S.value&&S.value.disconnect()});function M(){const o=[];(f.value.series||[]).forEach(w=>{o.push(w.from||0),o.push(w.to||0)}),g.value=Math.max(...o),m.value=Math.min(...o);const n=String(g.value).length;let l=0,i=(n>2?.01:.001)*t.value.style.chart.animation.speed,z=(n>2?.05:.005)*t.value.style.chart.animation.acceleration;function y(){v.value+=i+l,l+=z,v.value<u.dataset.value?requestAnimationFrame(y):v.value=u.dataset.value}t.value.style.chart.animation.use&&(v.value=m.value,y())}const s=e.computed(()=>{const o=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:o/2.5,gradients:o/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),p=e.computed(()=>r.makeDonut({series:f.value.series},a.value.width/2,s.value.base,s.value.arcs,s.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),A=e.computed(()=>r.makeDonut({series:f.value.series},a.value.width/2,s.value.base,s.value.gradients,s.value.gradients,1,1,1,180,109.9495,2*a.value.trackSize)),k=e.ref(!1);function q(o){k.value=o,C.value+=1}return X({generatePdf:B,generateImage:E}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${k.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:x,id:`vue-ui-gauge_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:N,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px;${t.value.userOptions.show?"padding-top:36px":""}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;text-align:center;color:${t.value.style.chart.title.color};font-size:${t.value.style.chart.title.fontSize}px;font-weight:${t.value.style.chart.title.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.title.text),5),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;text-align:center;color:${t.value.style.chart.title.subtitle.color};font-size:${t.value.style.chart.title.subtitle.fontSize}px;font-weight:${t.value.style.chart.title.subtitle.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.title.subtitle.text),5)):e.createCommentVNode("",!0),isNaN(_.dataset.base)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;color:${t.value.style.chart.title.subtitle.color};font-size:${t.value.style.chart.title.subtitle.fontSize}px;font-weight:${t.value.style.chart.title.subtitle.bold?"bold":""}`)},e.toDisplayString(t.value.translations.base)+" : "+e.toDisplayString(_.dataset.base),5))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(I.UserOptions,{ref_key:"details",ref:Y,key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(R),isPrinting:e.unref(G),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,titles:{...t.value.userOptions.buttonTitles},chartElement:x.value,onToggleFullscreen:q,onGeneratePdf:e.unref(B),onGenerateImage:e.unref(E)},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.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(r.opacity)[1]}`},null,8,Q),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(r.opacity)[t.value.style.chart.layout.track.gradientIntensity]}`},null,8,ee),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(r.opacity)[1]}`},null,8,te)],8,K)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,le)],8,ae)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:l.arcSlice,fill:l.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,oe))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:l.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,re))),128)),e.createElementVNode("rect",{x:0,y:s.value.base,width:a.value.width<=0?1e-4:a.value.width,height:a.value.height*.3<=0?1e-4:a.value.height*.3,fill:t.value.style.chart.backgroundColor},null,8,ne)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:l.center.startX,initY:l.center.startY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:l.center.startX,initY:l.center.startY,offset:a.value.markerOffset}).y,"text-anchor":l.center.startX<a.value.width/2-5?"end":l.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(l.from.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,se))),256)),e.createElementVNode("text",{x:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:p.value.at(-1).endX,initY:p.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(r.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:s.value.base,initX:p.value.at(-1).endX,initY:p.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(g.value.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,ue),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",ie,[isNaN(c.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:c.value.x1,y1:c.value.y1,x2:c.value.x2,y2:c.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,ce)),isNaN(c.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:c.value.x1,y1:c.value.y1,x2:c.value.x2,y2:c.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,de)),!isNaN(c.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:c.value.x1,y1:c.value.y1,x2:c.value.x2,y2:c.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,ve)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",he,[P.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:P.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,ye)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:s.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,fe),e.createElementVNode("text",{x:a.value.width/2,y:s.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(t.value.style.chart.legend.prefix)+" "+e.toDisplayString(t.value.style.chart.legend.showPlusSymbol&&v.value>0?"+":"")+e.toDisplayString(v.value.toFixed(t.value.style.chart.legend.roundingValue))+" "+e.toDisplayString(t.value.style.chart.legend.suffix),9,me),e.renderSlot(o.$slots,"svg",{svg:a.value},void 0,!0)],14,J)):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T.default,{key:3,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:$},[e.renderSlot(o.$slots,"legend",{legend:f.value},void 0,!0)],512)],14,Z))}},ge=H._export_sfc(pe,[["__scopeId","data-v-a862b4a9"]]);exports.default=ge;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed as p, ref as d, watch as he, onMounted as ye, onBeforeUnmount as fe, openBlock as r, createElementBlock as i, normalizeClass as q, normalizeStyle as F, createElementVNode as v, toDisplayString as m, createCommentVNode as g, createBlock as H, unref as h, createSlots as ge, withCtx as E, renderSlot as $, normalizeProps as pe, guardReactiveProps as me, Fragment as O, renderList as A } from "vue";
|
|
2
|
-
import { u as ke, c as be, t as xe, a as we, p as Z, b as _e, o as J, d as Fe, e as N, g as K, m as Q, X as ze, r as j, G as X, B as ee } from "./index-
|
|
2
|
+
import { u as ke, c as be, t as xe, a as we, p as Z, b as _e, o as J, d as Fe, e as N, g as K, m as Q, X as ze, r as j, G as X, B as ee } from "./index-CGb3gF5A.js";
|
|
3
3
|
import { t as Se, u as $e } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { u as Ce, U as Me } from "./usePrinter-
|
|
5
|
-
import Pe from "./vue-ui-skeleton-
|
|
6
|
-
import { u as te } from "./useNestedProp-
|
|
4
|
+
import { u as Ce, U as Me } from "./usePrinter-VlAyPtaS.js";
|
|
5
|
+
import Pe from "./vue-ui-skeleton-B0udzFdQ.js";
|
|
6
|
+
import { u as te } from "./useNestedProp-DCBzUHfz.js";
|
|
7
7
|
import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const Oe = ["id"], Ne = ["xmlns", "viewBox"], Xe = ["id"], Ye = ["stop-color"], Ge = ["stop-color"], Re = ["stop-color"], Ee = ["id"], Ae = ["stdDeviation"], je = ["d", "fill", "stroke"], Be = ["d", "filter"], Ue = ["y", "width", "height", "fill"], De = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], Ve = ["x", "y", "font-size", "font-weight", "fill"], We = { key: 1 }, Le = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Te = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], qe = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], He = { key: 2 }, Ze = ["d", "fill", "stroke", "stroke-width"], Je = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], Ke = ["x", "y", "font-size", "fill"], Qe = {
|
|
9
9
|
__name: "vue-ui-gauge",
|