vue-data-ui 2.4.69 → 2.4.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/{Arrow-C5_AZWgS.cjs → Arrow-B4T6F0Q-.cjs} +1 -1
- package/dist/{Arrow-DMsTP48l.js → Arrow-N3xFD65D.js} +1 -1
- package/dist/{BaseIcon-yMi3y63c.cjs → BaseIcon-CAsWmn3X.cjs} +1 -1
- package/dist/{BaseIcon-gqw-kBfn.js → BaseIcon-D-UKDgjn.js} +1 -1
- package/dist/{DataTable-BA6JBH7V.cjs → DataTable-CY8wYhvy.cjs} +1 -1
- package/dist/{DataTable-NeqGIRml.js → DataTable-DPeuneOh.js} +2 -2
- package/dist/{Legend-CzglCc_A.js → Legend-BvGqIXVZ.js} +2 -2
- package/dist/{Legend-BDfMwVoo.cjs → Legend-CYuhb0PP.cjs} +1 -1
- package/dist/{PackageVersion-DSZLavzR.js → PackageVersion-BWyr7kAX.js} +1 -1
- package/dist/{PackageVersion-C371VguR.cjs → PackageVersion-CEHy6dLD.cjs} +1 -1
- package/dist/{PenAndPaper-CEhzQ-Fa.cjs → PenAndPaper--vMes7_g.cjs} +1 -1
- package/dist/{PenAndPaper-i5Ed26C_.js → PenAndPaper-BFVJi7-v.js} +3 -3
- package/dist/{Shape-DxzKdbbj.js → Shape-BtwbxjIw.js} +1 -1
- package/dist/{Shape-8zvpZJV8.cjs → Shape-NS_4od1k.cjs} +1 -1
- package/dist/{Slicer-DvYZWFNV.js → Slicer-C7m6owvG.js} +2 -2
- package/dist/{Slicer-Cpyn8JzS.cjs → Slicer-Cn_Jhg4Z.cjs} +1 -1
- package/dist/{Title-D7pWg7pV.cjs → Title-Ct1AFzwA.cjs} +1 -1
- package/dist/{Title-CsI8WO_W.js → Title-P0Dd2k62.js} +1 -1
- package/dist/{Tooltip-Bd_maafT.cjs → Tooltip-Bbb_oXZ2.cjs} +1 -1
- package/dist/{Tooltip-CnBGAyVu.js → Tooltip-kI9lsKQk.js} +1 -1
- package/dist/index-CDbl3nHi.cjs +9 -0
- package/dist/{index-DFRfhtBB.js → index-c1hnhYfV.js} +8338 -4533
- 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-TaLS7x3B.cjs → useNestedProp-BaEkcxlF.cjs} +1 -1
- package/dist/{useNestedProp-DXIkhDlu.js → useNestedProp-CGSgnhXD.js} +1 -1
- package/dist/{usePrinter-CjzJ4n07.cjs → usePrinter-DW-eWQbz.cjs} +1 -1
- package/dist/{usePrinter-Ci-0jc4Q.js → usePrinter-VLD0kjns.js} +1 -1
- package/dist/{vue-data-ui-Bl2iCdfV.cjs → vue-data-ui-CwDPE8Oy.cjs} +1 -1
- package/dist/{vue-data-ui-BId7y_Mx.js → vue-data-ui-Dj9mkE8h.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DhCuk-BU.js → vue-ui-3d-bar-BvKbGzct.js} +9 -9
- package/dist/{vue-ui-3d-bar-B1wEuFHP.cjs → vue-ui-3d-bar-CZ_H_Ort.cjs} +1 -1
- package/dist/{vue-ui-accordion-kIB72ifr.js → vue-ui-accordion-WE2vM_c9.js} +3 -3
- package/dist/{vue-ui-accordion-CJz0LvsL.cjs → vue-ui-accordion-cPXglVwE.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-CbuqeZnD.js → vue-ui-age-pyramid-2_Esdk68.js} +10 -10
- package/dist/{vue-ui-age-pyramid-B3iwA5sn.cjs → vue-ui-age-pyramid-CP3ZYQRg.cjs} +1 -1
- package/dist/{vue-ui-annotator-BDWhKozG.cjs → vue-ui-annotator-D78gkFCb.cjs} +1 -1
- package/dist/{vue-ui-annotator-BZCaLvkQ.js → vue-ui-annotator-_DY9i-jv.js} +1 -1
- package/dist/{vue-ui-bullet-C3uBv5bN.js → vue-ui-bullet-DpGiFwFz.js} +8 -8
- package/dist/{vue-ui-bullet-BxTE3LXp.cjs → vue-ui-bullet-La8gwBSn.cjs} +1 -1
- package/dist/{vue-ui-candlestick-D7jF0o0O.cjs → vue-ui-candlestick-9E0cl6YC.cjs} +1 -1
- package/dist/{vue-ui-candlestick-B9i1dBdh.js → vue-ui-candlestick-CjLJ2mSo.js} +11 -11
- package/dist/{vue-ui-carousel-table-Bx7ESKAV.js → vue-ui-carousel-table-CcLxgNmE.js} +4 -4
- package/dist/{vue-ui-carousel-table-Bl1fMlDQ.cjs → vue-ui-carousel-table-Dds0y3bB.cjs} +1 -1
- package/dist/{vue-ui-chestnut-C9HdoCSj.js → vue-ui-chestnut-BGCKqGeJ.js} +8 -8
- package/dist/{vue-ui-chestnut-DECLKp6Z.cjs → vue-ui-chestnut-CYRzvXm4.cjs} +1 -1
- package/dist/{vue-ui-cursor-DWWeiW19.js → vue-ui-cursor-CIpRQKNA.js} +2 -2
- package/dist/{vue-ui-cursor-BMUiMsc8.cjs → vue-ui-cursor-DsGMHjdu.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CBP-ej_J.cjs → vue-ui-dashboard-C9uV8m0l.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Dj0tzPP2.js → vue-ui-dashboard-vzINAFKO.js} +2 -2
- package/dist/{vue-ui-digits-5nnKCSms.js → vue-ui-digits-5pKusVfB.js} +2 -2
- package/dist/{vue-ui-digits-BCS02GTb.cjs → vue-ui-digits-D7L4mVDQ.cjs} +1 -1
- package/dist/{vue-ui-donut-BlcHXAxm.js → vue-ui-donut-C3yNTWSD.js} +12 -12
- package/dist/{vue-ui-donut-pPekHmDy.cjs → vue-ui-donut-CfVskBpJ.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DHXxMH-b.js → vue-ui-donut-evolution-BJbckdFI.js} +11 -11
- package/dist/{vue-ui-donut-evolution-DvTQGoLx.cjs → vue-ui-donut-evolution-CoGIWZla.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BZ8qgVb8.cjs → vue-ui-dumbbell-B6zi81dT.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-TtP4KlyF.js → vue-ui-dumbbell-CR_EOGDj.js} +10 -10
- package/dist/{vue-ui-flow-CujmalLt.cjs → vue-ui-flow-7Pe2hnO2.cjs} +1 -1
- package/dist/{vue-ui-flow-BrFxF35H.js → vue-ui-flow-bYyrf1gH.js} +9 -9
- package/dist/{vue-ui-funnel-DJlPhpde.js → vue-ui-funnel-BPbhMvf2.js} +9 -9
- package/dist/{vue-ui-funnel-C_obm54V.cjs → vue-ui-funnel-C1b0_0pJ.cjs} +1 -1
- package/dist/{vue-ui-galaxy-LxPI8q9R.js → vue-ui-galaxy-BToN6RNA.js} +11 -11
- package/dist/{vue-ui-galaxy-DwsaWCXO.cjs → vue-ui-galaxy-D1h1ygAs.cjs} +1 -1
- package/dist/{vue-ui-gauge-C0NdJ9Ia.cjs → vue-ui-gauge-CNxd-r5C.cjs} +1 -1
- package/dist/{vue-ui-gauge-DranKx6C.js → vue-ui-gauge-Ceq5pwk-.js} +7 -7
- package/dist/{vue-ui-gizmo-DHOeLNci.cjs → vue-ui-gizmo-DWkq62O3.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D3ndRdYD.js → vue-ui-gizmo-DbElBwkm.js} +3 -3
- package/dist/{vue-ui-heatmap-Cm8W7Dys.js → vue-ui-heatmap-BXRF06ON.js} +10 -10
- package/dist/{vue-ui-heatmap-DB8u6HgL.cjs → vue-ui-heatmap-BrnLgp5m.cjs} +1 -1
- package/dist/{vue-ui-history-plot-uELxtVth.cjs → vue-ui-history-plot-CDHowMiE.cjs} +1 -1
- package/dist/{vue-ui-history-plot-Cq9YqGnM.js → vue-ui-history-plot-D-9ukthf.js} +11 -11
- package/dist/{vue-ui-kpi-CRHe2REQ.js → vue-ui-kpi-BlMuQuwt.js} +3 -3
- package/dist/{vue-ui-kpi-FjM8iSl7.cjs → vue-ui-kpi-BsgILHej.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-dDpJx-m5.js → vue-ui-mini-loader-B2dATbai.js} +2 -2
- package/dist/{vue-ui-mini-loader-C8NvI7in.cjs → vue-ui-mini-loader-DE4E1rOh.cjs} +1 -1
- package/dist/{vue-ui-molecule-CUSGIHY0.js → vue-ui-molecule-BD5g9GDi.js} +11 -11
- package/dist/{vue-ui-molecule-fni74OlL.cjs → vue-ui-molecule-VJdcfXRg.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-MpFNWMFA.js → vue-ui-mood-radar-CUFTQRHI.js} +11 -11
- package/dist/{vue-ui-mood-radar-gJw6bWbk.cjs → vue-ui-mood-radar-DjK1rd7_.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-B3sZE_G9.cjs → vue-ui-nested-donuts-B1vXjhXt.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-ETh4agoG.js → vue-ui-nested-donuts-Bj0ixTzU.js} +11 -11
- package/dist/{vue-ui-onion-DVfW3gYs.cjs → vue-ui-onion-Be3dCMPm.cjs} +1 -1
- package/dist/{vue-ui-onion-B3sFtPEh.js → vue-ui-onion-Djvbmccm.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-DZPTlC2C.cjs → vue-ui-parallel-coordinate-plot-BZGIlOko.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-_YrbS2Ot.js → vue-ui-parallel-coordinate-plot-Wl0rWNwV.js} +12 -12
- package/dist/{vue-ui-quadrant-Bzsw-j6-.js → vue-ui-quadrant-5EI0lHH8.js} +12 -12
- package/dist/{vue-ui-quadrant-P4DB-L94.cjs → vue-ui-quadrant-OMxtVOol.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BaOHACaH.cjs → vue-ui-quick-chart-BWAmjYZk.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DDpATYTY.js → vue-ui-quick-chart-DthUf3zm.js} +9 -9
- package/dist/vue-ui-radar-BXp5pJwA.cjs +1 -0
- package/dist/{vue-ui-radar-A11AnshE.js → vue-ui-radar-kS3kEqr7.js} +128 -128
- package/dist/{vue-ui-rating-Dh7PWB5T.cjs → vue-ui-rating-Bb4taywB.cjs} +1 -1
- package/dist/{vue-ui-rating-Cg3aLKP5.js → vue-ui-rating-nXra4COp.js} +2 -2
- package/dist/{vue-ui-relation-circle-_Xzg29lP.cjs → vue-ui-relation-circle-7y-gznkO.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-Cq5RkCYF.js → vue-ui-relation-circle-_0tbRheN.js} +7 -7
- package/dist/{vue-ui-rings-BMDVvidk.js → vue-ui-rings-AwK0LT8K.js} +12 -12
- package/dist/{vue-ui-rings-D1Y_jZBB.cjs → vue-ui-rings-DL_uxm3k.cjs} +1 -1
- package/dist/{vue-ui-scatter-DgPkE7TL.cjs → vue-ui-scatter-C5ZzNcZo.cjs} +1 -1
- package/dist/{vue-ui-scatter-CIrjFYLK.js → vue-ui-scatter-Cy4oyzSE.js} +12 -12
- package/dist/{vue-ui-screenshot-l9NTRkgA.js → vue-ui-screenshot-B94g6UvH.js} +1 -1
- package/dist/{vue-ui-screenshot-1Grc0XMU.cjs → vue-ui-screenshot-CSz2xpyV.cjs} +1 -1
- package/dist/{vue-ui-skeleton-D1jE0ISk.js → vue-ui-skeleton-BiAyTdIj.js} +3 -3
- package/dist/{vue-ui-skeleton-BuofGRaV.cjs → vue-ui-skeleton-DccfcP2M.cjs} +1 -1
- package/dist/{vue-ui-smiley-BdSbWL_G.cjs → vue-ui-smiley-6oeUxwkD.cjs} +1 -1
- package/dist/{vue-ui-smiley-D1Mi7uAq.js → vue-ui-smiley-Bo-ByV7s.js} +2 -2
- package/dist/{vue-ui-spark-trend-CR2z0kye.js → vue-ui-spark-trend-CVbl6zbW.js} +5 -5
- package/dist/{vue-ui-spark-trend-At9CCqYl.cjs → vue-ui-spark-trend-DPQigxMH.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BUBCOtVB.js → vue-ui-sparkbar-BRAkYvlb.js} +4 -4
- package/dist/{vue-ui-sparkbar-CqxubKTj.cjs → vue-ui-sparkbar-CrG_iymk.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DZjpRTEk.cjs → vue-ui-sparkgauge-DFkJZIpt.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-UrUPvCG0.js → vue-ui-sparkgauge-Dy8Di8Fk.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-DdJV7BsH.js → vue-ui-sparkhistogram-ByYe2ApH.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-6JRI1e1G.cjs → vue-ui-sparkhistogram-kizOE0sI.cjs} +1 -1
- package/dist/{vue-ui-sparkline-B7y6I298.js → vue-ui-sparkline-Bx5zBaUb.js} +4 -4
- package/dist/{vue-ui-sparkline-Cg_j6FTl.cjs → vue-ui-sparkline-CZ54vPZB.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CgdF-SXv.js → vue-ui-sparkstackbar-D1n9ycoR.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-CNCkTjH_.cjs → vue-ui-sparkstackbar-Dnh9Wmwk.cjs} +1 -1
- package/dist/{vue-ui-stackbar-Csn5vCNb.cjs → vue-ui-stackbar-Co36xw25.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BIRIZYFP.js → vue-ui-stackbar-DAJsmHse.js} +13 -13
- package/dist/{vue-ui-strip-plot-CHCpJRfA.js → vue-ui-strip-plot-D6YFSsPG.js} +11 -11
- package/dist/{vue-ui-strip-plot-CkH9WvKQ.cjs → vue-ui-strip-plot-Q3K-b7VS.cjs} +1 -1
- package/dist/{vue-ui-table-zRlhKohy.js → vue-ui-table-DBk8g3Bs.js} +1 -1
- package/dist/{vue-ui-table-heatmap-D02l49ix.js → vue-ui-table-heatmap-De7qDtci.js} +4 -4
- package/dist/{vue-ui-table-heatmap-iZ8H71tR.cjs → vue-ui-table-heatmap-YoQuniKw.cjs} +1 -1
- package/dist/{vue-ui-table-CTbc1yvM.cjs → vue-ui-table-j3Ym9Km1.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-Dc7mN_C8.js → vue-ui-table-sparkline-BmYjar6g.js} +5 -5
- package/dist/{vue-ui-table-sparkline-BkHKbfrt.cjs → vue-ui-table-sparkline-CyBzmpr7.cjs} +1 -1
- package/dist/{vue-ui-thermometer-C_5SMeEW.cjs → vue-ui-thermometer-1SmFY-CI.cjs} +1 -1
- package/dist/{vue-ui-thermometer-kGzu22te.js → vue-ui-thermometer-BvUbzXLa.js} +7 -7
- package/dist/{vue-ui-timer-CmuvWCme.cjs → vue-ui-timer-BpjUTuOU.cjs} +1 -1
- package/dist/{vue-ui-timer-B0v8QaVa.js → vue-ui-timer-D9uVxF_C.js} +5 -5
- package/dist/{vue-ui-tiremarks-OTtTHXf6.cjs → vue-ui-tiremarks-BQF3ak_6.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CChreK3x.js → vue-ui-tiremarks-V8g_zUaB.js} +7 -7
- package/dist/{vue-ui-treemap-BoQD8g4v.js → vue-ui-treemap-BnnAwwYN.js} +11 -11
- package/dist/{vue-ui-treemap-O266l90L.cjs → vue-ui-treemap-FbHFwpPz.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BRLNgtgK.js → vue-ui-vertical-bar-Cvq1Y3mD.js} +12 -12
- package/dist/{vue-ui-vertical-bar-BQ-xJ97N.cjs → vue-ui-vertical-bar-DIA9zb29.cjs} +1 -1
- package/dist/{vue-ui-waffle-D1HKu70-.cjs → vue-ui-waffle-4mqNhUjX.cjs} +1 -1
- package/dist/{vue-ui-waffle-CFiLYs8P.js → vue-ui-waffle-Bcn1ufKm.js} +12 -12
- package/dist/{vue-ui-wheel-5bACM6QK.cjs → vue-ui-wheel-1xKki40n.cjs} +1 -1
- package/dist/{vue-ui-wheel-BRoClqtT.js → vue-ui-wheel-Cm5dzB-b.js} +7 -7
- package/dist/{vue-ui-word-cloud-DnyQbnIi.js → vue-ui-word-cloud-BPlfNdCZ.js} +10 -10
- package/dist/{vue-ui-word-cloud-fgbjz9bU.cjs → vue-ui-word-cloud-CIomS4Rm.cjs} +1 -1
- package/dist/{vue-ui-xy-ZEU2B2fb.js → vue-ui-xy-CKeq1JdU.js} +14 -14
- package/dist/{vue-ui-xy-DAj9Ku9m.cjs → vue-ui-xy-Cu1-2Lvl.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-B15ivB1n.js → vue-ui-xy-canvas-B9MvlWhR.js} +11 -11
- package/dist/{vue-ui-xy-canvas-BpKXOm1J.cjs → vue-ui-xy-canvas-DM7CW018.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-1dw8ypqh.cjs +0 -9
- package/dist/vue-ui-radar-BkdUD8i3.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-1dw8ypqh.cjs"),Ce=require("./useResponsive-BJ7DTGpm.cjs"),se=require("./BaseIcon-yMi3y63c.cjs"),Ge=require("./Tooltip-Bd_maafT.cjs"),ze=require("./usePrinter-CjzJ4n07.cjs"),Xe=require("./Slicer-Cpyn8JzS.cjs"),Ye=require("./vue-ui-skeleton-BuofGRaV.cjs"),Ne=require("./useNestedProp-TaLS7x3B.cjs"),Ze=require("./PackageVersion-C371VguR.cjs"),Je=require("./PenAndPaper-CEhzQ-Fa.cjs"),Qe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ke=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function et({dataset:d,barLineSwitch:w=6}){let h=null,B=null,N=0;if((typeof d=="number"||typeof d=="string")&&console.warn(`The provided dataset (${d}) is not sufficient to build a chart`),K(d)&&(P(d)&&(d.length<w?h=S.BAR:h=S.LINE,B=d,N=d.length),ce(d))){if(!lt(d))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(d[0]),j=Object.values(d[0]);if(!U.some(A=>at(A)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;Ve(j,A=>typeof A=="number")&&(h=S.DONUT,B=d),Ve(j,A=>Array.isArray(A)&&P(A))&&($e(d)>w?h=S.LINE:h=S.BAR,N=$e(d),B=d.map(A=>({...A,data:ot(A,F=>P(F))}))),d=d.map(A=>Fe(A)),B=B.map(A=>Fe(A))}return K(d)&&[...new Set(d.flatMap(U=>Array.isArray(U)))][0],{dataset:d,type:h,usableDataset:B,maxSeriesLength:N}}function Pe(d){return!d||K(d)&&!d.length}function K(d){return Array.isArray(d)}function P(d){if(!K(d)||Pe(d))return!1;const w=d.map(h=>Number(h));return![...new Set(w.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ce(d){return!K(d)||Pe(d)||!![...new Set(d.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!d.map(h=>Object.keys(h).length>0).includes(!1)}function tt(d,w){const h=Object.keys(d).sort(),B=Object.keys(w).sort();if(h.length!==B.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],M=B[N];if(V!==M||typeof d[V]!=typeof w[M])return!1}return!0}function lt(d){if(d.length<=1)return!0;for(let w=0;w<d.length;w+=1)for(let h=w+1;h<d.length;h+=1)if(!tt(d[w],d[h]))return!1;return!0}function at(d){return Ke.includes(d.toUpperCase())}function Ve(d,w){let h=[];for(let B=0;B<d.length;B+=1)h.push(w(d[B]));return h.includes(!0)}function $e(d){return Math.max(...[...d].flatMap(w=>Object.values(w).filter(h=>P(h)).map(h=>h.length)))}function ot(d,w){return Object.values(d).filter(h=>w(h))[0]}function Fe(d){const w={};for(let h in d)d.hasOwnProperty(h)&&(w[h.toUpperCase()]=d[h]);return w}const Ie=d=>(e.pushScopeId("data-v-ccb29683"),d=d(),e.popScopeId(),d),nt=["id"],rt=["xmlns","viewBox"],it=["x","y","width","height"],ut=["x","y","width","height"],st=["width","height"],ct=["id"],dt=["id"],vt=Ie(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),mt=["id"],ht=["flood-color"],ft={key:0,class:"donut-label-connectors"},pt=["d","stroke","stroke-width","filter"],kt=["cx","cy","r","fill","filter"],gt={class:"donut"},yt=["d","fill","stroke","stroke-width","filter"],xt=["d","onMouseenter","onClick"],St={key:1,class:"donut-labels quick-animation"},bt=["cx","cy","fill","stroke","filter"],Bt=["text-anchor","x","y","fill","font-size","filter"],wt=["text-anchor","x","y","fill","font-size","filter"],Et={key:2,class:"donut-hollow quick-animation"},At=["x","y","font-size","fill"],Lt=["x","y","font-size","fill"],_t={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t=["x1","x2","y1","y2","stroke","stroke-width"],Ft={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x","y","font-size","fill"],Tt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["font-size","text-anchor","fill","transform"],Dt={class:"plots"},Mt={class:"line-plot-series"},Ut=["d","stroke","stroke-width"],qt=["d","stroke","stroke-width"],Wt=["d","stroke","stroke-width"],Ht=["d","stroke","stroke-width"],jt=["cx","cy","fill","stroke"],Gt={key:4,class:"dataLabels"},Xt=["font-size","fill","x","y"],Yt={class:"tooltip-traps"},Zt=["x","y","height","width","fill","onMouseenter","onClick"],Jt={key:0,class:"line-grid"},Qt=["x1","x2","y1","y2","stroke","stroke-width"],Kt=["x1","x2","y1","y2","stroke","stroke-width"],el={key:1,class:"line-axis"},tl=["x1","x2","y1","y2","stroke","stroke-width"],ll=["x1","x2","y1","y2","stroke","stroke-width"],al={key:2,class:"yLabels"},ol=["x1","x2","y1","y2","stroke","stroke-width"],nl=["x","y","font-size","fill"],rl={key:3,class:"periodLabels"},il=["x1","x2","y1","y2","stroke","stroke-width"],ul=["font-size","text-anchor","transform","fill"],sl={class:"plots"},cl=["x","width","height","y","fill","stroke","stroke-width"],dl=["to"],vl=["from","to"],ml={key:4,class:"dataLabels"},hl=["x","y","font-size","fill"],fl={class:"tooltip-traps"},pl=["x","y","height","width","fill","onMouseenter","onClick"],kl={key:6,class:"axis-labels"},gl={key:0},yl=["font-size","fill","x","y"],xl={key:1},Sl=["font-size","fill","x","y"],bl={key:2},Bl=["font-size","fill","transform"],wl={key:3},El=["font-size","fill","transform"],Al={key:6,class:"vue-data-ui-watermark"},Ll=["onClick"],_l=["onClick"],Cl=["onClick"],zl={key:1,class:"vue-ui-quick-chart-not-processable"},Nl=Ie(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),Vl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(d,{expose:w,emit:h}){const B=d,{vue_ui_quick_chart:N}=i.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),A=e.ref(i.createUid()),F=e.ref(!1),G=e.ref(null),T=e.ref(""),$=e.ref(null),me=e.ref(null),he=e.ref(null),x=e.ref([]),fe=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>ge(),set:a=>a}),Te=e.computed(()=>t.value.showUserOptionsOnChartHover),pe=e.computed(()=>t.value.keepUserOptionsStateOnChartLeave),te=e.ref(!t.value.showUserOptionsOnChartHover);function ke(a=!1){Te.value&&(te.value=a)}function ge(){const a=Ne.useNestedProp({userConfig:B.config,defaultConfig:N});let s={};return a.theme?s={...Ne.useNestedProp({userConfig:i.themes.vue_ui_quick_chart[a.theme]||B.config,defaultConfig:a}),customPalette:i.themePalettes[a.theme]||i.palette}:s=a,B.config&&i.hasDeepProperty(B.config,"zoomStartIndex")?s.zoomStartIndex=B.config.zoomStartIndex:s.zoomStartIndex=null,B.config&&i.hasDeepProperty(B.config,"zoomEndIndex")?s.zoomEndIndex=B.config.zoomEndIndex:s.zoomEndIndex=null,s}e.watch(()=>B.config,a=>{t.value=ge(),k.value.width=t.value.width,k.value.height=t.value.height,te.value=!t.value.showUserOptionsOnChartHover,Se()},{deep:!0}),e.watch(()=>B.dataset,a=>{f.value=Y.value,g.value.start=0,g.value.end=f.value.maxSeriesLength,ee.value+=1},{deep:!0});const X=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),Y=e.computed(()=>{const a=et({dataset:i.sanitizeArray(B.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return a||console.error("VueUiQuickChart : Dataset is not processable"),a}),f=e.ref(Y.value),Oe=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,a=>{a||i.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:le,isImaging:ae,generatePdf:ye,generateImage:xe}=ze.usePrinter({elementId:`${b.value}_${A.value}`,fileName:t.value.title||b.value}),Re=e.computed(()=>t.value.showUserOptions&&!t.value.title),k=e.ref({width:t.value.width,height:t.value.height}),oe=e.ref({showTooltip:t.value.showTooltip}),ne=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(t.value.responsive){const a=Ce.throttle(()=>{const{width:s,height:l}=Ce.useResponsive({chart:V.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&f.value.maxSeriesLength>1?j.value:null,source:me.value,noTitle:he.value});k.value.width=s,k.value.height=l});ne.value=new ResizeObserver(a),ne.value.observe(V.value.parentNode)}Le()}e.onBeforeUnmount(()=>{ne.value&&ne.value.disconnect()});const De=e.computed(()=>{switch(b.value){case S.LINE:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.BAR:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.DONUT:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;default:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`}});function be(a){return[...a].map(s=>s.value).reduce((s,l)=>s+l,0)}function Z(a){return t.value.blurOnHover&&![null,void 0].includes($.value)&&$.value!==a?`url(#blur_${A.value})`:""}function Be(a,s){x.value.includes(a)?x.value=x.value.filter(l=>l!==a):x.value.length<s&&x.value.push(a)}const we=e.ref(null),Ee=e.ref(null),re=e.ref(!1);function Me(a,s){re.value=!0;let l=a.value;const r=Y.value.dataset.find((u,m)=>a.id===`donut_${m}`).VALUE;if(x.value.includes(a.id)){let u=function(){l>r?(re.value=!1,cancelAnimationFrame(Ee.value),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},Ee.value=requestAnimationFrame(u))};x.value=x.value.filter(m=>m!==a.id),u()}else if(s.length>1){let u=function(){l<r/100?(re.value=!1,cancelAnimationFrame(we.value),x.value.push(a.id),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:0,VALUE:0}:m)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},we.value=requestAnimationFrame(u))};u()}}const I=e.ref(null);function Ue(a){I.value=a}const Ae=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),E=e.computed(()=>{if(b.value!==S.DONUT)return null;const a=f.value.dataset.map((o,n)=>({...o,value:o.VALUE||o.DATA||o.SERIE||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`donut_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],immutableValue:o.value}));function s(o,n){return i.dataLabel({v:isNaN(o.value/be(n))?0:o.value/be(n)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(o){return o.proportion*100>t.value.donutHideLabelUnderPercentage}function r(o,n){const y=Y.value.dataset.find((L,C)=>`donut_${C}`===o).VALUE;return Math.abs(String(Number(y.toFixed(0))).length-String(Number(n.toFixed(0))).length)}function u({datapoint:o,seriesIndex:n}){G.value={datapoint:o,seriesIndex:n,config:t.value,dataset:a},$.value=o.id;const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:o,seriesIndex:n,series:a,config:t.value})))T.value=y({datapoint:o,seriesIndex:n,series:a,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,p+=`<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="${o.color}"/></svg>`,p+=`<b>${i.applyDataLabel(t.value.formatter,o.value,i.dataLabel({p:t.value.valuePrefix,v:o.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:o,seriesIndex:n})}</b>`,p+=`<span>(${i.dataLabel({v:o.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,T.value=`<div>${p}</div>`}F.value=!0}function m(){F.value=!1,$.value=null,I.value=null}const _={centerX:k.value.width/2,centerY:k.value.height/2},z=a.filter(o=>!x.value.includes(o.id)).map(o=>o.value||0).reduce((o,n)=>o+n,0),W=a.map((o,n)=>({...o,proportion:(o.value||0)/z,value:o.value||0,absoluteValue:Y.value.dataset.find((y,p)=>`donut_${p}`===o.id).VALUE})),O=k.value.width/2,H=k.value.height/2,R=k.value.height*t.value.donutRadiusRatio;return{dataset:W.filter(o=>!x.value.includes(o.id)),legend:W,drawingArea:_,displayArcPercentage:s,isArcBigEnough:l,useTooltip:u,killTooltip:m,getSpaces:r,total:z,cx:O,cy:H,radius:R,chart:i.makeDonut({series:a.filter(o=>!x.value.includes(o.id))},O,H,R,R,1.99999,2,1,360,105.25,k.value.height*Ae.value)}}),g=e.ref({start:0,end:f.value.maxSeriesLength});function qe(){Le()}const q=e.ref(null);async function Le(){(t.value.zoomStartIndex!==null||t.value.zoomEndIndex!==null)&&q.value?(t.value.zoomStartIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setStartValue(t.value.zoomStartIndex)),t.value.zoomEndIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setEndValue(We(t.value.zoomEndIndex+1)))):(g.value={start:0,end:f.value.maxSeriesLength},ee.value+=1)}function We(a){const s=f.value.maxSeriesLength;return a>s?s:a<0||t.value.zoomStartIndex!==null&&a<t.value.zoomStartIndex?t.value.zoomStartIndex!==null?t.value.zoomStartIndex+1:1:a}const He=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let a=[];P(f.value.dataset)&&(a=f.value.dataset),ce(f.value.dataset)&&(a=f.value.dataset.map((u,m)=>({values:u.VALUE||u.DATA||u.SERIE||u.SERIES||u.VALUES||u.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(u=>!x.value.includes(u.id)));const s=P(a)?a.length:Math.max(...a.map(u=>u.values.length));let l=[];if(P(a))l=a;else for(let u=0;u<s;u+=1)l.push(a.map(m=>m.values[u]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(u=>u+(r<0?Math.abs(r):0))}),v=e.computed(()=>{if(b.value!==S.LINE)return null;const a={height:k.value.height,width:k.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:a.width-t.value.xyPaddingRight,bottom:a.height-t.value.xyPaddingBottom,width:a.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:a.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(g.value.start,g.value.end),absoluteIndices:f.value.dataset.map((o,n)=>n).slice(g.value.start,g.value.end),name:t.value.title,color:X.value[t.value.paletteStartIndex]||i.palette[t.value.paletteStartIndex],id:"line_0"}]),ce(f.value.dataset)&&(l=f.value.dataset.map((o,n)=>({...o,values:o.VALUE||o.DATA||o.SERIE||o.SERIES||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`line_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],values:o.values.slice(g.value.start,g.value.end),absoluteIndices:o.values.map((y,p)=>p).slice(g.value.start,g.value.end)})));const r={max:Math.max(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),min:Math.min(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),maxSeries:Math.max(...l.map(o=>o.values.length))},u=i.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,_=r.max<0?s.top:s.bottom-m/(u.max+m)*s.height,z=s.width/r.maxSeries,W=u.ticks.map(o=>({y:s.bottom-s.height*((o+m)/(u.max+m)),x:s.left-8,value:o})),O=l.map((o,n)=>({...o,coordinates:o.values.map((y,p)=>({x:s.left+z*(p+1)-z/2,y:s.bottom-(y+m)/(u.max+m)*s.height,value:y}))})).map(o=>{let n=[];return o.coordinates.forEach(y=>{n.push(`${y.x},${y.y} `)}),{...o,linePath:n.join(" ")}});function H(o){$.value=o,I.value=o;const n=l.map(p=>({...p,value:p.values[o],absoluteIndex:p.absoluteIndices[o]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:n,seriesIndex:o,config:t.value,dataset:l};const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:n,seriesIndex:o,series:l,config:t.value})))T.value=y({datapoint:n,seriesIndex:o,series:l,config:t.value});else{let p="";t.value.xyPeriods[n[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[n[0].absoluteIndex]}</div>`),n.forEach((L,C)=>{p+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CDbl3nHi.cjs"),Ce=require("./useResponsive-BJ7DTGpm.cjs"),se=require("./BaseIcon-CAsWmn3X.cjs"),Ge=require("./Tooltip-Bbb_oXZ2.cjs"),ze=require("./usePrinter-DW-eWQbz.cjs"),Xe=require("./Slicer-Cn_Jhg4Z.cjs"),Ye=require("./vue-ui-skeleton-DccfcP2M.cjs"),Ne=require("./useNestedProp-BaEkcxlF.cjs"),Ze=require("./PackageVersion-CEHy6dLD.cjs"),Je=require("./PenAndPaper--vMes7_g.cjs"),Qe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ke=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function et({dataset:d,barLineSwitch:w=6}){let h=null,B=null,N=0;if((typeof d=="number"||typeof d=="string")&&console.warn(`The provided dataset (${d}) is not sufficient to build a chart`),K(d)&&(P(d)&&(d.length<w?h=S.BAR:h=S.LINE,B=d,N=d.length),ce(d))){if(!lt(d))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(d[0]),j=Object.values(d[0]);if(!U.some(A=>at(A)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;Ve(j,A=>typeof A=="number")&&(h=S.DONUT,B=d),Ve(j,A=>Array.isArray(A)&&P(A))&&($e(d)>w?h=S.LINE:h=S.BAR,N=$e(d),B=d.map(A=>({...A,data:ot(A,F=>P(F))}))),d=d.map(A=>Fe(A)),B=B.map(A=>Fe(A))}return K(d)&&[...new Set(d.flatMap(U=>Array.isArray(U)))][0],{dataset:d,type:h,usableDataset:B,maxSeriesLength:N}}function Pe(d){return!d||K(d)&&!d.length}function K(d){return Array.isArray(d)}function P(d){if(!K(d)||Pe(d))return!1;const w=d.map(h=>Number(h));return![...new Set(w.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ce(d){return!K(d)||Pe(d)||!![...new Set(d.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!d.map(h=>Object.keys(h).length>0).includes(!1)}function tt(d,w){const h=Object.keys(d).sort(),B=Object.keys(w).sort();if(h.length!==B.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],M=B[N];if(V!==M||typeof d[V]!=typeof w[M])return!1}return!0}function lt(d){if(d.length<=1)return!0;for(let w=0;w<d.length;w+=1)for(let h=w+1;h<d.length;h+=1)if(!tt(d[w],d[h]))return!1;return!0}function at(d){return Ke.includes(d.toUpperCase())}function Ve(d,w){let h=[];for(let B=0;B<d.length;B+=1)h.push(w(d[B]));return h.includes(!0)}function $e(d){return Math.max(...[...d].flatMap(w=>Object.values(w).filter(h=>P(h)).map(h=>h.length)))}function ot(d,w){return Object.values(d).filter(h=>w(h))[0]}function Fe(d){const w={};for(let h in d)d.hasOwnProperty(h)&&(w[h.toUpperCase()]=d[h]);return w}const Ie=d=>(e.pushScopeId("data-v-ccb29683"),d=d(),e.popScopeId(),d),nt=["id"],rt=["xmlns","viewBox"],it=["x","y","width","height"],ut=["x","y","width","height"],st=["width","height"],ct=["id"],dt=["id"],vt=Ie(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),mt=["id"],ht=["flood-color"],ft={key:0,class:"donut-label-connectors"},pt=["d","stroke","stroke-width","filter"],kt=["cx","cy","r","fill","filter"],gt={class:"donut"},yt=["d","fill","stroke","stroke-width","filter"],xt=["d","onMouseenter","onClick"],St={key:1,class:"donut-labels quick-animation"},bt=["cx","cy","fill","stroke","filter"],Bt=["text-anchor","x","y","fill","font-size","filter"],wt=["text-anchor","x","y","fill","font-size","filter"],Et={key:2,class:"donut-hollow quick-animation"},At=["x","y","font-size","fill"],Lt=["x","y","font-size","fill"],_t={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t=["x1","x2","y1","y2","stroke","stroke-width"],Ft={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x","y","font-size","fill"],Tt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["font-size","text-anchor","fill","transform"],Dt={class:"plots"},Mt={class:"line-plot-series"},Ut=["d","stroke","stroke-width"],qt=["d","stroke","stroke-width"],Wt=["d","stroke","stroke-width"],Ht=["d","stroke","stroke-width"],jt=["cx","cy","fill","stroke"],Gt={key:4,class:"dataLabels"},Xt=["font-size","fill","x","y"],Yt={class:"tooltip-traps"},Zt=["x","y","height","width","fill","onMouseenter","onClick"],Jt={key:0,class:"line-grid"},Qt=["x1","x2","y1","y2","stroke","stroke-width"],Kt=["x1","x2","y1","y2","stroke","stroke-width"],el={key:1,class:"line-axis"},tl=["x1","x2","y1","y2","stroke","stroke-width"],ll=["x1","x2","y1","y2","stroke","stroke-width"],al={key:2,class:"yLabels"},ol=["x1","x2","y1","y2","stroke","stroke-width"],nl=["x","y","font-size","fill"],rl={key:3,class:"periodLabels"},il=["x1","x2","y1","y2","stroke","stroke-width"],ul=["font-size","text-anchor","transform","fill"],sl={class:"plots"},cl=["x","width","height","y","fill","stroke","stroke-width"],dl=["to"],vl=["from","to"],ml={key:4,class:"dataLabels"},hl=["x","y","font-size","fill"],fl={class:"tooltip-traps"},pl=["x","y","height","width","fill","onMouseenter","onClick"],kl={key:6,class:"axis-labels"},gl={key:0},yl=["font-size","fill","x","y"],xl={key:1},Sl=["font-size","fill","x","y"],bl={key:2},Bl=["font-size","fill","transform"],wl={key:3},El=["font-size","fill","transform"],Al={key:6,class:"vue-data-ui-watermark"},Ll=["onClick"],_l=["onClick"],Cl=["onClick"],zl={key:1,class:"vue-ui-quick-chart-not-processable"},Nl=Ie(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),Vl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(d,{expose:w,emit:h}){const B=d,{vue_ui_quick_chart:N}=i.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),A=e.ref(i.createUid()),F=e.ref(!1),G=e.ref(null),T=e.ref(""),$=e.ref(null),me=e.ref(null),he=e.ref(null),x=e.ref([]),fe=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>ge(),set:a=>a}),Te=e.computed(()=>t.value.showUserOptionsOnChartHover),pe=e.computed(()=>t.value.keepUserOptionsStateOnChartLeave),te=e.ref(!t.value.showUserOptionsOnChartHover);function ke(a=!1){Te.value&&(te.value=a)}function ge(){const a=Ne.useNestedProp({userConfig:B.config,defaultConfig:N});let s={};return a.theme?s={...Ne.useNestedProp({userConfig:i.themes.vue_ui_quick_chart[a.theme]||B.config,defaultConfig:a}),customPalette:i.themePalettes[a.theme]||i.palette}:s=a,B.config&&i.hasDeepProperty(B.config,"zoomStartIndex")?s.zoomStartIndex=B.config.zoomStartIndex:s.zoomStartIndex=null,B.config&&i.hasDeepProperty(B.config,"zoomEndIndex")?s.zoomEndIndex=B.config.zoomEndIndex:s.zoomEndIndex=null,s}e.watch(()=>B.config,a=>{t.value=ge(),k.value.width=t.value.width,k.value.height=t.value.height,te.value=!t.value.showUserOptionsOnChartHover,Se()},{deep:!0}),e.watch(()=>B.dataset,a=>{f.value=Y.value,g.value.start=0,g.value.end=f.value.maxSeriesLength,ee.value+=1},{deep:!0});const X=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),Y=e.computed(()=>{const a=et({dataset:i.sanitizeArray(B.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return a||console.error("VueUiQuickChart : Dataset is not processable"),a}),f=e.ref(Y.value),Oe=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,a=>{a||i.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:le,isImaging:ae,generatePdf:ye,generateImage:xe}=ze.usePrinter({elementId:`${b.value}_${A.value}`,fileName:t.value.title||b.value}),Re=e.computed(()=>t.value.showUserOptions&&!t.value.title),k=e.ref({width:t.value.width,height:t.value.height}),oe=e.ref({showTooltip:t.value.showTooltip}),ne=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(t.value.responsive){const a=Ce.throttle(()=>{const{width:s,height:l}=Ce.useResponsive({chart:V.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&f.value.maxSeriesLength>1?j.value:null,source:me.value,noTitle:he.value});k.value.width=s,k.value.height=l});ne.value=new ResizeObserver(a),ne.value.observe(V.value.parentNode)}Le()}e.onBeforeUnmount(()=>{ne.value&&ne.value.disconnect()});const De=e.computed(()=>{switch(b.value){case S.LINE:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.BAR:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.DONUT:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;default:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`}});function be(a){return[...a].map(s=>s.value).reduce((s,l)=>s+l,0)}function Z(a){return t.value.blurOnHover&&![null,void 0].includes($.value)&&$.value!==a?`url(#blur_${A.value})`:""}function Be(a,s){x.value.includes(a)?x.value=x.value.filter(l=>l!==a):x.value.length<s&&x.value.push(a)}const we=e.ref(null),Ee=e.ref(null),re=e.ref(!1);function Me(a,s){re.value=!0;let l=a.value;const r=Y.value.dataset.find((u,m)=>a.id===`donut_${m}`).VALUE;if(x.value.includes(a.id)){let u=function(){l>r?(re.value=!1,cancelAnimationFrame(Ee.value),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},Ee.value=requestAnimationFrame(u))};x.value=x.value.filter(m=>m!==a.id),u()}else if(s.length>1){let u=function(){l<r/100?(re.value=!1,cancelAnimationFrame(we.value),x.value.push(a.id),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:0,VALUE:0}:m)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},we.value=requestAnimationFrame(u))};u()}}const I=e.ref(null);function Ue(a){I.value=a}const Ae=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),E=e.computed(()=>{if(b.value!==S.DONUT)return null;const a=f.value.dataset.map((o,n)=>({...o,value:o.VALUE||o.DATA||o.SERIE||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`donut_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],immutableValue:o.value}));function s(o,n){return i.dataLabel({v:isNaN(o.value/be(n))?0:o.value/be(n)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(o){return o.proportion*100>t.value.donutHideLabelUnderPercentage}function r(o,n){const y=Y.value.dataset.find((L,C)=>`donut_${C}`===o).VALUE;return Math.abs(String(Number(y.toFixed(0))).length-String(Number(n.toFixed(0))).length)}function u({datapoint:o,seriesIndex:n}){G.value={datapoint:o,seriesIndex:n,config:t.value,dataset:a},$.value=o.id;const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:o,seriesIndex:n,series:a,config:t.value})))T.value=y({datapoint:o,seriesIndex:n,series:a,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,p+=`<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="${o.color}"/></svg>`,p+=`<b>${i.applyDataLabel(t.value.formatter,o.value,i.dataLabel({p:t.value.valuePrefix,v:o.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:o,seriesIndex:n})}</b>`,p+=`<span>(${i.dataLabel({v:o.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,T.value=`<div>${p}</div>`}F.value=!0}function m(){F.value=!1,$.value=null,I.value=null}const _={centerX:k.value.width/2,centerY:k.value.height/2},z=a.filter(o=>!x.value.includes(o.id)).map(o=>o.value||0).reduce((o,n)=>o+n,0),W=a.map((o,n)=>({...o,proportion:(o.value||0)/z,value:o.value||0,absoluteValue:Y.value.dataset.find((y,p)=>`donut_${p}`===o.id).VALUE})),O=k.value.width/2,H=k.value.height/2,R=k.value.height*t.value.donutRadiusRatio;return{dataset:W.filter(o=>!x.value.includes(o.id)),legend:W,drawingArea:_,displayArcPercentage:s,isArcBigEnough:l,useTooltip:u,killTooltip:m,getSpaces:r,total:z,cx:O,cy:H,radius:R,chart:i.makeDonut({series:a.filter(o=>!x.value.includes(o.id))},O,H,R,R,1.99999,2,1,360,105.25,k.value.height*Ae.value)}}),g=e.ref({start:0,end:f.value.maxSeriesLength});function qe(){Le()}const q=e.ref(null);async function Le(){(t.value.zoomStartIndex!==null||t.value.zoomEndIndex!==null)&&q.value?(t.value.zoomStartIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setStartValue(t.value.zoomStartIndex)),t.value.zoomEndIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setEndValue(We(t.value.zoomEndIndex+1)))):(g.value={start:0,end:f.value.maxSeriesLength},ee.value+=1)}function We(a){const s=f.value.maxSeriesLength;return a>s?s:a<0||t.value.zoomStartIndex!==null&&a<t.value.zoomStartIndex?t.value.zoomStartIndex!==null?t.value.zoomStartIndex+1:1:a}const He=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let a=[];P(f.value.dataset)&&(a=f.value.dataset),ce(f.value.dataset)&&(a=f.value.dataset.map((u,m)=>({values:u.VALUE||u.DATA||u.SERIE||u.SERIES||u.VALUES||u.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(u=>!x.value.includes(u.id)));const s=P(a)?a.length:Math.max(...a.map(u=>u.values.length));let l=[];if(P(a))l=a;else for(let u=0;u<s;u+=1)l.push(a.map(m=>m.values[u]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(u=>u+(r<0?Math.abs(r):0))}),v=e.computed(()=>{if(b.value!==S.LINE)return null;const a={height:k.value.height,width:k.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:a.width-t.value.xyPaddingRight,bottom:a.height-t.value.xyPaddingBottom,width:a.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:a.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(g.value.start,g.value.end),absoluteIndices:f.value.dataset.map((o,n)=>n).slice(g.value.start,g.value.end),name:t.value.title,color:X.value[t.value.paletteStartIndex]||i.palette[t.value.paletteStartIndex],id:"line_0"}]),ce(f.value.dataset)&&(l=f.value.dataset.map((o,n)=>({...o,values:o.VALUE||o.DATA||o.SERIE||o.SERIES||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`line_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],values:o.values.slice(g.value.start,g.value.end),absoluteIndices:o.values.map((y,p)=>p).slice(g.value.start,g.value.end)})));const r={max:Math.max(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),min:Math.min(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),maxSeries:Math.max(...l.map(o=>o.values.length))},u=i.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,_=r.max<0?s.top:s.bottom-m/(u.max+m)*s.height,z=s.width/r.maxSeries,W=u.ticks.map(o=>({y:s.bottom-s.height*((o+m)/(u.max+m)),x:s.left-8,value:o})),O=l.map((o,n)=>({...o,coordinates:o.values.map((y,p)=>({x:s.left+z*(p+1)-z/2,y:s.bottom-(y+m)/(u.max+m)*s.height,value:y}))})).map(o=>{let n=[];return o.coordinates.forEach(y=>{n.push(`${y.x},${y.y} `)}),{...o,linePath:n.join(" ")}});function H(o){$.value=o,I.value=o;const n=l.map(p=>({...p,value:p.values[o],absoluteIndex:p.absoluteIndices[o]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:n,seriesIndex:o,config:t.value,dataset:l};const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:n,seriesIndex:o,series:l,config:t.value})))T.value=y({datapoint:n,seriesIndex:o,series:l,config:t.value});else{let p="";t.value.xyPeriods[n[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[n[0].absoluteIndex]}</div>`),n.forEach((L,C)=>{p+=`
|
|
2
2
|
<div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${L.color}"/></svg>
|
|
4
4
|
<span>${L.name}:</span>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ref as L, computed as U, watch as Ne, onMounted as St, onBeforeUnmount as wt, nextTick as Ce, openBlock as a, createElementBlock as l, normalizeClass as re, normalizeStyle as N, createBlock as Ie, createCommentVNode as f, unref as g, createSlots as At, withCtx as Q, renderSlot as F, normalizeProps as G, guardReactiveProps as se, toDisplayString as O, createVNode as ve, createElementVNode as _, Fragment as p, renderList as $, mergeProps as Fe, pushScopeId as _t, popScopeId as zt } from "vue";
|
|
2
|
-
import { u as Lt, c as $t, t as Ct, a as It, p as V, C as lt, b as Et, J as Pt, e as Tt, d as Me, m as Ot, D as ot, X as Rt, j as Nt, k as xe, n as Ue, i as X, f as B, R as nt, v as Z, x as Ee, y as Be } from "./index-
|
|
2
|
+
import { u as Lt, c as $t, t as Ct, a as It, p as V, C as lt, b as Et, J as Pt, e as Tt, d as Me, m as Ot, D as ot, X as Rt, j as Nt, k as xe, n as Ue, i as X, f as B, R as nt, v as Z, x as Ee, y as Be } from "./index-c1hnhYfV.js";
|
|
3
3
|
import { t as Ft, u as Mt } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import Pe from "./BaseIcon-
|
|
5
|
-
import { _ as Ut } from "./Tooltip-
|
|
6
|
-
import { u as Bt, U as Dt } from "./usePrinter-
|
|
7
|
-
import { S as Vt } from "./Slicer-
|
|
8
|
-
import qt from "./vue-ui-skeleton-
|
|
9
|
-
import { u as it } from "./useNestedProp-
|
|
10
|
-
import { _ as Wt } from "./PackageVersion-
|
|
11
|
-
import { P as jt } from "./PenAndPaper-
|
|
4
|
+
import Pe from "./BaseIcon-D-UKDgjn.js";
|
|
5
|
+
import { _ as Ut } from "./Tooltip-kI9lsKQk.js";
|
|
6
|
+
import { u as Bt, U as Dt } from "./usePrinter-VLD0kjns.js";
|
|
7
|
+
import { S as Vt } from "./Slicer-C7m6owvG.js";
|
|
8
|
+
import qt from "./vue-ui-skeleton-BiAyTdIj.js";
|
|
9
|
+
import { u as it } from "./useNestedProp-CGSgnhXD.js";
|
|
10
|
+
import { _ as Wt } from "./PackageVersion-BWyr7kAX.js";
|
|
11
|
+
import { P as jt } from "./PenAndPaper-BFVJi7-v.js";
|
|
12
12
|
import { _ as Ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const A = {
|
|
14
14
|
LINE: "LINE",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CDbl3nHi.cjs"),ne=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./Title-Ct1AFzwA.cjs"),se=require("./usePrinter-DW-eWQbz.cjs"),Be=require("./Tooltip-Bbb_oXZ2.cjs"),Pe=require("./vue-ui-sparkbar-CrG_iymk.cjs"),_e=require("./Legend-CYuhb0PP.cjs"),$e=require("./DataTable-CY8wYhvy.cjs"),xe=require("./vue-ui-skeleton-DccfcP2M.cjs"),Ne=require("./vue-ui-accordion-cPXglVwE.cjs"),ue=require("./useNestedProp-BaEkcxlF.cjs"),Te=require("./PackageVersion-CEHy6dLD.cjs"),Se=require("./PenAndPaper--vMes7_g.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Fe=["id"],Oe=["xmlns","viewBox"],Ae=["width","height"],Le=["id"],ze=["stop-color"],Ie=["stop-color"],Re={key:1},qe=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:0},Ue=["d","stroke","stroke-width"],De=["d","stroke","stroke-width"],Ge={key:2},We=["x","y","text-anchor","font-size","fill","onMouseenter"],He=["points","stroke","stroke-width"],je=["points","stroke","stroke-width","fill"],Xe={key:3},Ye=["cx","cy","fill","r","stroke"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0,style:{"max-width":"200px",margin:"0 auto"}},Ze={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ie,{expose:ce,emit:de}){const d=ie,{vue_ui_radar:ve}=n.useConfig(),C=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),f=e.ref(n.createUid()),pe=e.ref(null),x=e.ref(!1),N=e.ref(""),L=e.ref(0),m=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(null),M=e.ref(0),U=e.ref(0),D=e.ref(0),t=e.computed({get:()=>H(),set:o=>o}),{userOptionsVisible:T,setUserOptionsVisibility:G,keepUserOptionState:W}=Ee.useUserOptionState({config:t.value});function H(){const o=ue.useNestedProp({userConfig:d.config,defaultConfig:ve});return o.theme?{...ue.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}e.watch(()=>d.config,o=>{t.value=H(),T.value=!t.value.showOnChartHover,j(),M.value+=1,U.value+=1,D.value+=1},{deep:!0});const B=e.ref(null);function j(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ne.throttle(()=>{const{width:a,height:l}=ne.useResponsive({chart:m.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?I.value:null,source:R.value,noTitle:q.value});u.value.width=a,u.value.height=l});B.value=new ResizeObserver(o),B.value.observe(m.value.parentNode)}}e.onMounted(()=>{j()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=se.usePrinter({elementId:`vue-ui-radar_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ge=e.computed(()=>({style:{backgroundColor:"#FFFFFF00",animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),u=e.ref({height:312,width:512}),i=e.ref([]),w=e.ref(null),y=e.ref(!1);function Z(o){y.value=!0,i.value.includes(o)?(w.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,w.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),de("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function fe(){return k.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${f.value}_${a}`,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>C.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${f.value}_${a}`,formatter:o.formatter||null})):[]),ee=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),te=e.computed(()=>p.value.length),S=e.computed(()=>Math.min(u.value.width,u.value.height)/3),oe=e.computed(()=>n.createPolygonPath({plot:{x:u.value.width/2,y:u.value.height/2},radius:S.value,sides:te.value,rotation:0})),me=e.computed(()=>{const o=[];for(let a=0;a<S.value;a+=S.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),g=e.computed(()=>oe.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>ye({centerX:u.value.width/2,centerY:u.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||ee.value)}));return{...o,...p.value[a],plots:l}}));function E({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>u.value.width/2&&(o+=12,l="start"),o<u.value.width/2&&(o-=12,l="end"),a>u.value.height/2&&(a+=20),a<u.value.height/2&&(a-=12),a===u.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function ye({centerX:o,centerY:a,apexX:l,apexY:r,proportion:s}){return{x:o+(l-o)*s,y:a+(r-a)*s}}const k=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||ee.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,s)=>r+s,0)/p.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>Z(l),isSegregated:i.value.includes(l)}))}),ke=e.computed(()=>({cy:"radar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),P=e.computed(()=>{const o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...k.value],a=d.dataset.series.map(r=>[r.name,n.applyDataLabel(r.formatter,r.target,n.dataLabel({p:r.prefix,v:r.target,s:r.suffix,r:t.value.table.td.roundingValue})),...r.values.map((s,c)=>`${n.applyDataLabel(r.formatter,s,n.dataLabel({p:v.value[c].prefix,v:s,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(s/r.target)?"":n.dataLabel({v:s/r.target*100,s:"%",r:t.value.table.td.roundingPercentage})})`)]),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{head:o,body:a,config:l,colNames:o}}),_=e.ref(null),V=e.ref([]),F=e.ref(null);function be(o,a){V.value=[],_.value=a,x.value=!0;let l="";F.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value})))N.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let s=0;s<o.values.length;s+=1)i.value.includes(s)||V.value.push({name:v.value[s].name,value:o.values[s]/o.target*100,color:v.value[s].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[s].prefix??"",v:o.values[s],s:v.value[s].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});N.value=l}}function ae(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...k.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,tt)=>[c.name,c.target,...c.values.flatMap(A=>[A,isNaN(A/c.target)?"":A/c.target*100])]),r=o.concat([a]).concat(l),s=n.createCsvContent(r);n.downloadCsv({csvContent:s,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const b=e.ref(!1);function Ce(o){b.value=o,L.value+=1}function le(){h.value.showTable=!h.value.showTable}function re(){h.value.showTooltip=!h.value.showTooltip}const $=e.ref(!1);function O(){$.value=!$.value}return ce({getData:fe,generatePdf:J,generateCsv:ae,generateImage:K,toggleTable:le,toggleTooltip:re,toggleAnnotator:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:m,id:`vue-ui-radar_${f.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),onMouseenter:a[3]||(a[3]=()=>e.unref(G)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Se.PenAndPaper,{key:0,parent:m.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:q,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${M.value}`,config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&C.value&&(e.unref(W)||e.unref(T))?(e.openBlock(),e.createBlock(se.UserOptions,{ref_key:"details",ref:pe,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Y),isPrinting:e.unref(X),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(J),onGenerateCsv:ae,onGenerateImage:e.unref(K),onToggleTable:le,onToggleTooltip:re,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(W)?e.unref(T)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Te._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width<=0?10:u.value.width,height:u.value.height<=0?10:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Ae)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.05),t.value.style.chart.layout.dataPolygon.opacity)},null,8,ze),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ie)],8,Le))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.width/2,y1:u.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,qe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:u.value.width/2,y:u.value.height/2},radius:l,sides:te.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Ue))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:oe.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,De),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:E(l).x,y:E(l).y,"text-anchor":E(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:s=>be(l,r),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,_.value=null})},e.toDisplayString(l.name),41,We))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,He)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${f.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity),class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,je)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(s,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:_.value!==null&&_.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===c&&t.value.useCssAnimation})},null,10,Ye))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:u.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(_e.Legend,{key:`legend_${D.value}`,legendSet:k.value,config:ke.value,onClickMarker:a[1]||(a[1]=({i:l})=>Z(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:s=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({v:l.totalProportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})),13,Ke)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:k.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:R,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:h.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,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:N.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(Pe.default,{dataset:V.value,config:ge.value,backgroundOpacity:0},null,8,["dataset","config"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isFullscreen","isCustom"]),C.value?(e.openBlock(),e.createBlock(Ne.default,{key:8,hideDetails:"",config:{open:h.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock($e.DataTable,{key:`table_${U.value}`,colNames:P.value.colNames,head:P.value.head,body:P.value.body,config:P.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]=l=>h.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Fe))}},et=Ve._export_sfc(Ze,[["__scopeId","data-v-7a50d021"]]);exports.default=et;
|