vue-data-ui 2.4.54 → 2.4.55
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-DeKmbj7B.js → Arrow-D9oPJhO0.js} +1 -1
- package/dist/{Arrow-B10uy-UU.cjs → Arrow-Lu-rJXGl.cjs} +1 -1
- package/dist/{BaseIcon-DtUsvREa.cjs → BaseIcon-DxRKjbz1.cjs} +1 -1
- package/dist/{BaseIcon-Ca67-Cyv.js → BaseIcon-mHeKnX4-.js} +1 -1
- package/dist/{DataTable-BgiV2CfC.js → DataTable-D8MTezlM.js} +2 -2
- package/dist/{DataTable-CwiudM8v.cjs → DataTable-rMMvio1U.cjs} +1 -1
- package/dist/{Legend-TTzHdVeD.cjs → Legend-Ba34oTdO.cjs} +1 -1
- package/dist/{Legend-C1rLFGjN.js → Legend-wr5XLSfL.js} +1 -1
- package/dist/{PackageVersion-B_ULr99C.cjs → PackageVersion-BJi2ywG9.cjs} +1 -1
- package/dist/{PackageVersion-Bp3Bq9Jn.js → PackageVersion-xnKIqody.js} +1 -1
- package/dist/{PenAndPaper-DFNDy1y9.cjs → PenAndPaper-CX6N7FR7.cjs} +1 -1
- package/dist/{PenAndPaper-Cu0Ae0MN.js → PenAndPaper-iek0aH4r.js} +3 -3
- package/dist/{Shape-GWT6Hhcc.cjs → Shape-9v-w5i6N.cjs} +1 -1
- package/dist/{Shape-B_GK3n6y.js → Shape-B_lWjwmP.js} +1 -1
- package/dist/{Slicer-DyNqrpR4.cjs → Slicer--m1nOwbO.cjs} +1 -1
- package/dist/{Slicer-Bi4zZd-A.js → Slicer-Bwg4WzZf.js} +2 -2
- package/dist/{Title-Z93_y2gr.cjs → Title-BWhYDGb-.cjs} +1 -1
- package/dist/{Title-DPlURQtx.js → Title-BecmraNn.js} +1 -1
- package/dist/{Tooltip-C7wb_p0L.js → Tooltip-BZYApG0d.js} +1 -1
- package/dist/{Tooltip-DVfgJ6mM.cjs → Tooltip-cPxZzSgr.cjs} +1 -1
- package/dist/{index-BdlNqn9B.cjs → index-DGcOW0vL.cjs} +1 -1
- package/dist/{index-DH1CMY7m.js → index-Dhlyke5j.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-DDvMHRIf.cjs → useNestedProp-C9KmUVBy.cjs} +1 -1
- package/dist/{useNestedProp-DBnFzAfW.js → useNestedProp-D9eTQKze.js} +1 -1
- package/dist/{usePrinter-C0N1CiBZ.js → usePrinter-BnBk8gnl.js} +1 -1
- package/dist/{usePrinter-DtSijS1B.cjs → usePrinter-DpEuGyLP.cjs} +1 -1
- package/dist/{vue-data-ui-ByVHf_kl.cjs → vue-data-ui-CGGZHtx3.cjs} +1 -1
- package/dist/{vue-data-ui-CXxSOk_7.js → vue-data-ui-aSR5-7gp.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-CVe5jYPi.js → vue-ui-3d-bar-D9pXx9fJ.js} +9 -9
- package/dist/{vue-ui-3d-bar-B7WLQ4Xw.cjs → vue-ui-3d-bar-Dm2wnS6e.cjs} +1 -1
- package/dist/{vue-ui-accordion-azKgDbn4.js → vue-ui-accordion-CGpOsWNN.js} +3 -3
- package/dist/{vue-ui-accordion-Dm8myRhk.cjs → vue-ui-accordion-mtZIFAv9.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BLq5EYnh.cjs → vue-ui-age-pyramid-BcMERmA5.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BW4_XPjw.js → vue-ui-age-pyramid-dbX4WaaY.js} +10 -10
- package/dist/{vue-ui-annotator-BIiP8tfh.cjs → vue-ui-annotator-CY-rCEDB.cjs} +1 -1
- package/dist/{vue-ui-annotator-BXNCscLc.js → vue-ui-annotator-DfRkh1D_.js} +1 -1
- package/dist/{vue-ui-bullet-zqDSLDqP.js → vue-ui-bullet-CUoiQcb5.js} +8 -8
- package/dist/{vue-ui-bullet-oszrU2rQ.cjs → vue-ui-bullet-jsXAmYsX.cjs} +1 -1
- package/dist/{vue-ui-candlestick-EY9e1UXf.cjs → vue-ui-candlestick-BD58hsql.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DlhrXggi.js → vue-ui-candlestick-BLIICgdz.js} +11 -11
- package/dist/{vue-ui-carousel-table-DpN88ZNk.cjs → vue-ui-carousel-table-CCmB_BJ7.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-7w6OlJGJ.js → vue-ui-carousel-table-NUliqwxA.js} +4 -4
- package/dist/{vue-ui-chestnut-jHgtDbmU.js → vue-ui-chestnut-DIPBJ5D2.js} +8 -8
- package/dist/{vue-ui-chestnut-DUceRFNk.cjs → vue-ui-chestnut-vivMozHy.cjs} +1 -1
- package/dist/{vue-ui-cursor-Cq1HIpIa.cjs → vue-ui-cursor-Cgv_2p2T.cjs} +1 -1
- package/dist/{vue-ui-cursor-Dkndm06c.js → vue-ui-cursor-CzLtzn7N.js} +2 -2
- package/dist/{vue-ui-dashboard-NZKZnvIp.cjs → vue-ui-dashboard-CtlrjFxl.cjs} +1 -1
- package/dist/{vue-ui-dashboard-B6_Xkd1u.js → vue-ui-dashboard-DqZVcLlQ.js} +2 -2
- package/dist/{vue-ui-digits-ZFMtrfsc.js → vue-ui-digits-CGFznMkY.js} +2 -2
- package/dist/{vue-ui-digits-DHGYQ4mk.cjs → vue-ui-digits-e1HQVXb9.cjs} +1 -1
- package/dist/{vue-ui-donut-D3Yw-xVC.js → vue-ui-donut-DmLq2iWK.js} +16 -16
- package/dist/{vue-ui-donut-evolution-CzQo7feu.cjs → vue-ui-donut-evolution-4odFZbUM.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-kzFgoErC.js → vue-ui-donut-evolution-DpollzkH.js} +11 -11
- package/dist/vue-ui-donut-z2eOcEI5.cjs +1 -0
- package/dist/{vue-ui-dumbbell-LcWHXAvv.js → vue-ui-dumbbell-DLr4Lh3u.js} +10 -10
- package/dist/{vue-ui-dumbbell-qBYKyZL0.cjs → vue-ui-dumbbell-i7E-B6zN.cjs} +1 -1
- package/dist/{vue-ui-flow-RQrUlBZx.cjs → vue-ui-flow-BuYhmRed.cjs} +1 -1
- package/dist/{vue-ui-flow-CM2CzG9l.js → vue-ui-flow-CosxAYPJ.js} +9 -9
- package/dist/{vue-ui-funnel-CBZO8HbM.cjs → vue-ui-funnel-BNPISgC0.cjs} +1 -1
- package/dist/{vue-ui-funnel-oJgYKMnU.js → vue-ui-funnel-C_2YAtFj.js} +8 -8
- package/dist/{vue-ui-galaxy-C2Y_DDJB.js → vue-ui-galaxy-D1cWyHG9.js} +11 -11
- package/dist/{vue-ui-galaxy-BCVy8Fif.cjs → vue-ui-galaxy-DMOx2Le7.cjs} +1 -1
- package/dist/{vue-ui-gauge--Y59kiK4.js → vue-ui-gauge-Dnq0t_eH.js} +7 -7
- package/dist/{vue-ui-gauge-DdCG-E2p.cjs → vue-ui-gauge-Dw7QvZei.cjs} +1 -1
- package/dist/{vue-ui-gizmo-Rb4ZXTmW.cjs → vue-ui-gizmo-DcT9tTS-.cjs} +1 -1
- package/dist/{vue-ui-gizmo-g2JoyNcP.js → vue-ui-gizmo-vHQVGdpR.js} +3 -3
- package/dist/{vue-ui-heatmap-CSW7Sckl.js → vue-ui-heatmap-CtxQI5Mq.js} +10 -10
- package/dist/{vue-ui-heatmap-CuhK1-fD.cjs → vue-ui-heatmap-D-r7qdj0.cjs} +1 -1
- package/dist/{vue-ui-history-plot-3I1ZczPE.cjs → vue-ui-history-plot-B8pP20QN.cjs} +1 -1
- package/dist/{vue-ui-history-plot-BUh8mFcS.js → vue-ui-history-plot-BjcPvcaK.js} +11 -11
- package/dist/{vue-ui-kpi-BokZ78tj.cjs → vue-ui-kpi-BPwU5pay.cjs} +1 -1
- package/dist/{vue-ui-kpi-DqkHOwnT.js → vue-ui-kpi-BjuKXuQM.js} +3 -3
- package/dist/{vue-ui-mini-loader-DgRUssIh.cjs → vue-ui-mini-loader-DE2NXywp.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-OgezY5bJ.js → vue-ui-mini-loader-DZYw7bD6.js} +2 -2
- package/dist/{vue-ui-molecule-DPme2DL7.js → vue-ui-molecule-A3yHt8cl.js} +11 -11
- package/dist/{vue-ui-molecule-BjZEWe-M.cjs → vue-ui-molecule-B8I4iuBQ.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-qn-DhbDt.cjs → vue-ui-mood-radar-BKtVVOZz.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-C3dVMbCW.js → vue-ui-mood-radar-Dh1qbcXz.js} +11 -11
- package/dist/{vue-ui-nested-donuts-Cz04Q0zc.cjs → vue-ui-nested-donuts-B5ixdGsx.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-B96zg3ew.js → vue-ui-nested-donuts-DPuIU4IX.js} +11 -11
- package/dist/{vue-ui-onion-CVXrJUcF.cjs → vue-ui-onion-BTMaTU2a.cjs} +1 -1
- package/dist/{vue-ui-onion-DqtSzdyq.js → vue-ui-onion-BgcJBzxI.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-BSrrIy_u.cjs → vue-ui-parallel-coordinate-plot-Cye2V8MQ.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-uPB5LMUG.js → vue-ui-parallel-coordinate-plot-Ksh3Tuvx.js} +12 -12
- package/dist/{vue-ui-quadrant-B4Xp90go.js → vue-ui-quadrant-DGBXeeOe.js} +12 -12
- package/dist/{vue-ui-quadrant-DZu-EjEj.cjs → vue-ui-quadrant-DOet5Q47.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CmdJuhrV.js → vue-ui-quick-chart-DQcck_x6.js} +53 -54
- package/dist/{vue-ui-quick-chart-BbmneGkd.cjs → vue-ui-quick-chart-DhCA-7B5.cjs} +5 -5
- package/dist/{vue-ui-radar-C0fJVGMX.js → vue-ui-radar-CI5egNer.js} +12 -12
- package/dist/{vue-ui-radar-Uw9jHF-A.cjs → vue-ui-radar-qk20LKHr.cjs} +1 -1
- package/dist/{vue-ui-rating--WDHkylh.cjs → vue-ui-rating-CYhvKLSi.cjs} +1 -1
- package/dist/{vue-ui-rating-m1AvXMFo.js → vue-ui-rating-Ch2PSMeW.js} +2 -2
- package/dist/{vue-ui-relation-circle-BnGSpsh3.js → vue-ui-relation-circle-G6KC4zs0.js} +7 -7
- package/dist/{vue-ui-relation-circle-46aZfLDY.cjs → vue-ui-relation-circle-t-WDgqtA.cjs} +1 -1
- package/dist/{vue-ui-rings-C5uc13Mz.cjs → vue-ui-rings-DxpkXXwJ.cjs} +1 -1
- package/dist/{vue-ui-rings-BvwB9Pgy.js → vue-ui-rings-NIIfGve4.js} +11 -11
- package/dist/{vue-ui-scatter-CoW5nT_m.js → vue-ui-scatter-BqxcKjb2.js} +12 -12
- package/dist/{vue-ui-scatter-BAxQgdPf.cjs → vue-ui-scatter-DynxMn7l.cjs} +1 -1
- package/dist/{vue-ui-screenshot-CoBL8VvU.cjs → vue-ui-screenshot-BUP9G_uK.cjs} +1 -1
- package/dist/{vue-ui-screenshot-C_s7_D5X.js → vue-ui-screenshot-DreZMmrO.js} +1 -1
- package/dist/{vue-ui-skeleton-DBo32QSA.js → vue-ui-skeleton-DQqwDUqP.js} +3 -3
- package/dist/{vue-ui-skeleton-Czl8iTZQ.cjs → vue-ui-skeleton-D_lU-hWK.cjs} +1 -1
- package/dist/{vue-ui-smiley-D-FU6RGS.cjs → vue-ui-smiley-AGwF1X7u.cjs} +1 -1
- package/dist/{vue-ui-smiley-BQisdetv.js → vue-ui-smiley-CdmO39JE.js} +2 -2
- package/dist/{vue-ui-spark-trend-DMwCqGul.js → vue-ui-spark-trend-BUx5YwEZ.js} +5 -5
- package/dist/{vue-ui-spark-trend-C6d6P8_s.cjs → vue-ui-spark-trend-DD1s6Thz.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-DHpoNSzN.js → vue-ui-sparkbar-KZd6YQwQ.js} +4 -4
- package/dist/{vue-ui-sparkbar-CR3IzauM.cjs → vue-ui-sparkbar-mlrF_QEO.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CeXq_PnB.cjs → vue-ui-sparkgauge-B4J8ZYzs.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CC1Eglzs.js → vue-ui-sparkgauge-Db-d9x9r.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-xIK7lFrl.js → vue-ui-sparkhistogram-B61JDza9.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-X9_zqOZb.cjs → vue-ui-sparkhistogram-DzJ5NNi9.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DgEXD0bt.js → vue-ui-sparkline-P6ubVgp0.js} +4 -4
- package/dist/{vue-ui-sparkline-z8F4XzTG.cjs → vue-ui-sparkline-S6HehQ0a.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-wjQ7KHJm.cjs → vue-ui-sparkstackbar-BDBqoeJQ.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-Co449w2-.js → vue-ui-sparkstackbar-DKtOqh-Y.js} +5 -5
- package/dist/{vue-ui-stackbar-C9Q0eM4s.cjs → vue-ui-stackbar-DCCcEgQZ.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BCjjWZUq.js → vue-ui-stackbar-WShCS9A1.js} +12 -12
- package/dist/{vue-ui-strip-plot-D9nUWA5a.js → vue-ui-strip-plot-Bq3u8k2l.js} +11 -11
- package/dist/{vue-ui-strip-plot-SbdQQDJD.cjs → vue-ui-strip-plot-DH4LQTfB.cjs} +1 -1
- package/dist/{vue-ui-table-4Zx9e6xR.cjs → vue-ui-table-aV4pHrWD.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CQAwn6-B.cjs → vue-ui-table-heatmap-CruECEYA.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Dojf1B9-.js → vue-ui-table-heatmap-DsdyE14x.js} +4 -4
- package/dist/{vue-ui-table-Df6cgK1g.js → vue-ui-table-sJN2rS51.js} +1 -1
- package/dist/{vue-ui-table-sparkline-WSmyQwR2.js → vue-ui-table-sparkline-BlUe2QFV.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DLd74n0T.cjs → vue-ui-table-sparkline-CcsNg6th.cjs} +1 -1
- package/dist/{vue-ui-thermometer-El0SBOq3.js → vue-ui-thermometer-80aa72_6.js} +7 -7
- package/dist/{vue-ui-thermometer-9gklDJUj.cjs → vue-ui-thermometer-ButIh820.cjs} +1 -1
- package/dist/{vue-ui-timer-DDuXYQZM.js → vue-ui-timer-CuUSpISM.js} +5 -5
- package/dist/{vue-ui-timer-BBg7_SOY.cjs → vue-ui-timer-Dk4I7cRn.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-BIyXvipR.cjs → vue-ui-tiremarks-BsYfeNCN.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-BfIV-QDF.js → vue-ui-tiremarks-CQ98xHZ5.js} +7 -7
- package/dist/{vue-ui-treemap-DpshmJwJ.cjs → vue-ui-treemap-CHXb8mBG.cjs} +1 -1
- package/dist/{vue-ui-treemap-BXGSdZ7D.js → vue-ui-treemap-s1nZAhAS.js} +11 -11
- package/dist/{vue-ui-vertical-bar-CWCfyMLl.js → vue-ui-vertical-bar-Dd306Z10.js} +11 -11
- package/dist/{vue-ui-vertical-bar-CKwjHdCp.cjs → vue-ui-vertical-bar-iZWowEik.cjs} +1 -1
- package/dist/{vue-ui-waffle-IvkVZcab.cjs → vue-ui-waffle-BJgSuNVY.cjs} +1 -1
- package/dist/{vue-ui-waffle-qrwD0df7.js → vue-ui-waffle-CQfOCZjf.js} +19 -19
- package/dist/{vue-ui-wheel-BVzCac3i.js → vue-ui-wheel-DB-4Rn84.js} +7 -7
- package/dist/{vue-ui-wheel-DhwjPquK.cjs → vue-ui-wheel-s8UTbo9G.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-CMibfjKu.js → vue-ui-word-cloud-C-l2Z3Dd.js} +10 -10
- package/dist/{vue-ui-word-cloud-DNXgz7Aj.cjs → vue-ui-word-cloud-DvfOJe4M.cjs} +1 -1
- package/dist/{vue-ui-xy-DPybwkIx.cjs → vue-ui-xy-D1Nkk2Gp.cjs} +1 -1
- package/dist/{vue-ui-xy-DRPrnIDh.js → vue-ui-xy-P_VLOaMg.js} +14 -14
- package/dist/{vue-ui-xy-canvas-DmhWHa44.js → vue-ui-xy-canvas-BwNEs-cY.js} +11 -11
- package/dist/{vue-ui-xy-canvas-prkO7IV3.cjs → vue-ui-xy-canvas-CIKl9AXf.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-donut-DFS8YDvi.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BdlNqn9B.cjs"),Ve=require("./Title-Z93_y2gr.cjs"),me=require("./usePrinter-DtSijS1B.cjs"),Ee=require("./Tooltip-DVfgJ6mM.cjs"),Le=require("./Legend-TTzHdVeD.cjs"),Re=require("./vue-ui-skeleton-Czl8iTZQ.cjs"),Ae=require("./DataTable-CwiudM8v.cjs"),Fe=require("./vue-ui-accordion-Dm8myRhk.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./useNestedProp-DDvMHRIf.cjs"),Ie=require("./PackageVersion-B_ULr99C.cjs"),De=require("./PenAndPaper-DFNDy1y9.cjs"),qe=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ke(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function Ce(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Me(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=ke(n,s),v=ke(u,s);return c>=v}}function Ue(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function We(n,d){const s={...d,children:n};return xe(s)}function Ge(n){return(n.x1-n.x0)*(n.y1-n.y0)}function we(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function je(n){const d=Y(n),s=d.width,u=d.height;return Math.min(s,u)}function Xe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function Y(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ye(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=we(v,h);return f.concat(m)}const C=je(h),b=c[0],w=c.slice(1,p);if(Me(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ze(h,g),x=we(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function xe(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Xe(n.children,Ge(n)),s=Ye(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(xe(s[h]));return Ue(c)}}function Ze(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return Ce(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return Ce(p)}}const Je=n=>(e.pushScopeId("data-v-9a178263"),n=n(),e.popScopeId(),n),Ke=["id"],Qe=["xmlns","viewBox"],et={key:0},tt=["id"],ot=["stop-color"],lt=["stop-color"],at=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],nt=["x","y","height","width"],rt={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},ut=Je(()=>e.createElementVNode("br",null,null,-1)),st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},dt={key:1},vt=["innerHTML"],ht={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>te(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:Q,keepUserOptionState:ee}=qe.useUserOptionState({config:t.value});function te(){const o=be.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...be.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=te(),U.value=!t.value.showOnChartHover,Z.value+=1,J.value+=1,K.value+=1},{deep:!0});const{isPrinting:oe,isImaging:le,generatePdf:ae,generateImage:ne}=me.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function re(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),re(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),re(V.value),t.value.responsive){const o=ye.throttle(()=>{const{width:a,height:l}=ye.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ue=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function se(o,a){return o.value/a}function $e(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-se(a,l);return r.lightenHexColor(o,i<0?0:i)}function ie(o,a,l,i){return o.map((y,_)=>{const M=$e(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],y,i),ze=se(y,i);return{...y,color:M,proportion:ze,parentName:l,children:y.children?ie(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>We(ue.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ie(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function ce({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function de({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Ne(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),S=e.ref(!1);function G(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=G(o,l.children);if(i)return i}}return null}function Be(o){if(S.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const $=e.ref(null),ve=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Oe=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function he(o){S.value=!1,$.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ue.value)}const j=e.ref(null);function Pe({datapoint:o,seriesIndex:a}){$.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<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>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function pe(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,_)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[_],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[_],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[_]/L.value)?"-":r.dataLabel({v:N.value.body[_]/L.value*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{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function _e(){return F.value}function fe(){O.value.showTable=!O.value.showTable}function ge(){O.value.showTooltip=!O.value.showTooltip}const H=e.ref(!1);function X(){H.value=!H.value}return d({getData:_e,generateCsv:pe,generateImage:ne,generatePdf:ae,toggleTable:fe,toggleTooltip:ge,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.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;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(Q)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(De.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,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:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ve._sfc_main,{key:`title_${Z.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value&&(e.unref(ee)||e.unref(U))?(e.openBlock(),e.createBlock(me.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(oe),isImaging:e.unref(le),uid:f.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,isFullscreen:b.value,isTooltip:O.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Ne,onGeneratePdf:e.unref(ae),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:fe,onToggleTooltip:ge,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(ee)?e.unref(U)?"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:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ie._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",et,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,ot),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,lt)],8,tt)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ce(l),width:de(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>Be(l),onMouseenter:()=>Pe({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{$.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${$.value?$.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,at),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ce(l),width:de(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",rt,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),ut,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,nt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:S.value,rect:$.value,config:t.value})),void 0,!0)],14,Qe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(oe)||e.unref(le)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Re.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Le.Legend,{key:`legend_${K.value}`,legendSet:ve.value,config:Oe.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>he(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>he(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",dt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,it)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ve.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ee._sfc_main,{show:O.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),v.value?(e.openBlock(),e.createBlock(Fe.default,{key:8,hideDetails:"",config:{open:O.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(Ae.DataTable,{key:`table_${J.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.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=>O.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,vt)]),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)],46,Ke))}},pt=He._export_sfc(ht,[["__scopeId","data-v-9a178263"]]);exports.default=pt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DGcOW0vL.cjs"),Ve=require("./Title-BWhYDGb-.cjs"),me=require("./usePrinter-DpEuGyLP.cjs"),Ee=require("./Tooltip-cPxZzSgr.cjs"),Le=require("./Legend-Ba34oTdO.cjs"),Re=require("./vue-ui-skeleton-D_lU-hWK.cjs"),Ae=require("./DataTable-rMMvio1U.cjs"),Fe=require("./vue-ui-accordion-mtZIFAv9.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./useNestedProp-C9KmUVBy.cjs"),Ie=require("./PackageVersion-BJi2ywG9.cjs"),De=require("./PenAndPaper-CX6N7FR7.cjs"),qe=require("./useUserOptionState-BgepsfED.cjs"),He=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function ke(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function Ce(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Me(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=ke(n,s),v=ke(u,s);return c>=v}}function Ue(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function We(n,d){const s={...d,children:n};return xe(s)}function Ge(n){return(n.x1-n.x0)*(n.y1-n.y0)}function we(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function je(n){const d=Y(n),s=d.width,u=d.height;return Math.min(s,u)}function Xe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function Y(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ye(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=we(v,h);return f.concat(m)}const C=je(h),b=c[0],w=c.slice(1,p);if(Me(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ze(h,g),x=we(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function xe(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Xe(n.children,Ge(n)),s=Ye(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(xe(s[h]));return Ue(c)}}function Ze(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=Y(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return Ce(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return Ce(p)}}const Je=n=>(e.pushScopeId("data-v-9a178263"),n=n(),e.popScopeId(),n),Ke=["id"],Qe=["xmlns","viewBox"],et={key:0},tt=["id"],ot=["stop-color"],lt=["stop-color"],at=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],nt=["x","y","height","width"],rt={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},ut=Je(()=>e.createElementVNode("br",null,null,-1)),st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},dt={key:1},vt=["innerHTML"],ht={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Z=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>te(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:Q,keepUserOptionState:ee}=qe.useUserOptionState({config:t.value});function te(){const o=be.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...be.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=te(),U.value=!t.value.showOnChartHover,Z.value+=1,J.value+=1,K.value+=1},{deep:!0});const{isPrinting:oe,isImaging:le,generatePdf:ae,generateImage:ne}=me.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Te=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),O=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),z=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function re(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),re(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),re(V.value),t.value.responsive){const o=ye.throttle(()=>{const{width:a,height:l}=ye.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ue=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function se(o,a){return o.value/a}function $e(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-se(a,l);return r.lightenHexColor(o,i<0?0:i)}function ie(o,a,l,i){return o.map((y,_)=>{const M=$e(r.convertColorToHex(a)||I.value[_]||r.palette[_]||r.palette[_%r.palette.length],y,i),ze=se(y,i);return{...y,color:M,proportion:ze,parentName:l,children:y.children?ie(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>We(ue.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ie(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:z.value.left*2,y0:z.value.top,x1:z.value.width,y1:z.value.height}));function ce({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function de({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Ne(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:z.value.vbWidth,height:z.value.vbHeight})),S=e.ref(!1);function G(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=G(o,l.children);if(i)return i}}return null}function Be(o){if(S.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const $=e.ref(null),ve=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Oe=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function he(o){S.value=!1,$.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ue.value)}const j=e.ref(null);function Pe({datapoint:o,seriesIndex:a}){$.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<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>`,i+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function pe(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,_)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[_],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[_],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[_]/L.value)?"-":r.dataLabel({v:N.value.body[_]/L.value*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{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function _e(){return F.value}function fe(){O.value.showTable=!O.value.showTable}function ge(){O.value.showTooltip=!O.value.showTooltip}const H=e.ref(!1);function X(){H.value=!H.value}return d({getData:_e,generateCsv:pe,generateImage:ne,generatePdf:ae,toggleTable:fe,toggleTooltip:ge,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.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;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(Q)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(De.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:X},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,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:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ve._sfc_main,{key:`title_${Z.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value&&(e.unref(ee)||e.unref(U))?(e.openBlock(),e.createBlock(me.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(oe),isImaging:e.unref(le),uid:f.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,isFullscreen:b.value,isTooltip:O.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Ne,onGeneratePdf:e.unref(ae),onGenerateCsv:pe,onGenerateImage:e.unref(ne),onToggleTable:fe,onToggleTooltip:ge,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(ee)?e.unref(U)?"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:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ie._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",et,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,ot),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,lt)],8,tt)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ce(l),width:de(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":$.value&&$.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>Be(l),onMouseenter:()=>Pe({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{$.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${$.value?$.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,at),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ce(l),width:de(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",rt,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),ut,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,nt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:z.value,isZoom:S.value,rect:$.value,config:t.value})),void 0,!0)],14,Qe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(oe)||e.unref(le)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Re.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Le.Legend,{key:`legend_${K.value}`,legendSet:ve.value,config:Oe.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>he(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>he(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",dt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,it)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ve.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ee._sfc_main,{show:O.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),v.value?(e.openBlock(),e.createBlock(Fe.default,{key:8,hideDetails:"",config:{open:O.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(Ae.DataTable,{key:`table_${J.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.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=>O.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,vt)]),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)],46,Ke))}},pt=He._export_sfc(ht,[["__scopeId","data-v-9a178263"]]);exports.default=pt;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as k, ref as f, watch as ot, onMounted as lt, onBeforeUnmount as at, openBlock as g, createElementBlock as C, normalizeClass as Fe, normalizeStyle as R, unref as m, createBlock as E, createCommentVNode as O, createSlots as nt, withCtx as x, renderSlot as $, normalizeProps as G, guardReactiveProps as X, createVNode as Ie, Fragment as Le, renderList as Re, createElementVNode as S, toDisplayString as Y, createTextVNode as De, nextTick as st, pushScopeId as rt, popScopeId as ut } from "vue";
|
|
2
|
-
import { u as it, c as Me, t as ct, a as dt, p as T, b as vt, o as ht, e as ft, d as ae, i as ne, f as K, X as pt, l as Ve, G as Be, x as He, y as gt, q as yt, r as mt } from "./index-
|
|
3
|
-
import { _ as bt } from "./Title-
|
|
4
|
-
import { u as wt, U as kt } from "./usePrinter-
|
|
5
|
-
import { _ as Ct } from "./Tooltip-
|
|
6
|
-
import { L as $t } from "./Legend-
|
|
7
|
-
import xt from "./vue-ui-skeleton-
|
|
8
|
-
import { D as Tt } from "./DataTable-
|
|
9
|
-
import _t from "./vue-ui-accordion-
|
|
2
|
+
import { u as it, c as Me, t as ct, a as dt, p as T, b as vt, o as ht, e as ft, d as ae, i as ne, f as K, X as pt, l as Ve, G as Be, x as He, y as gt, q as yt, r as mt } from "./index-Dhlyke5j.js";
|
|
3
|
+
import { _ as bt } from "./Title-BecmraNn.js";
|
|
4
|
+
import { u as wt, U as kt } from "./usePrinter-BnBk8gnl.js";
|
|
5
|
+
import { _ as Ct } from "./Tooltip-BZYApG0d.js";
|
|
6
|
+
import { L as $t } from "./Legend-wr5XLSfL.js";
|
|
7
|
+
import xt from "./vue-ui-skeleton-DQqwDUqP.js";
|
|
8
|
+
import { D as Tt } from "./DataTable-D8MTezlM.js";
|
|
9
|
+
import _t from "./vue-ui-accordion-CGpOsWNN.js";
|
|
10
10
|
import { t as Ot, u as St } from "./useResponsive-CoxXLe23.js";
|
|
11
|
-
import { u as Ue } from "./useNestedProp-
|
|
12
|
-
import { _ as Nt } from "./PackageVersion-
|
|
13
|
-
import { P as zt } from "./PenAndPaper-
|
|
11
|
+
import { u as Ue } from "./useNestedProp-D9eTQKze.js";
|
|
12
|
+
import { _ as Nt } from "./PackageVersion-xnKIqody.js";
|
|
13
|
+
import { P as zt } from "./PenAndPaper-iek0aH4r.js";
|
|
14
14
|
import { u as Pt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { _ as At } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
function We(a, i) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCssVars as at, computed as b, ref as r, watch as Ae, onMounted as lt, onBeforeUnmount as ot, openBlock as u, createElementBlock as i, normalizeClass as U, normalizeStyle as d, unref as c, createBlock as M, createCommentVNode as y, createSlots as nt, withCtx as k, renderSlot as _, normalizeProps as G, guardReactiveProps as H, createElementVNode as n, toDisplayString as v, createVNode as ie, Fragment as W, renderList as j, withKeys as ut, createTextVNode as st } from "vue";
|
|
2
|
-
import { u as rt, c as it, t as dt, a as ct, p as z, b as vt, o as Be, e as Z, v as S, d as de, i as ee, f as I, X as ht, s as ce, w as pt, x as yt, y as gt, q as ft, r as bt } from "./index-
|
|
2
|
+
import { u as rt, c as it, t as dt, a as ct, p as z, b as vt, o as Be, e as Z, v as S, d as de, i as ee, f as I, X as ht, s as ce, w as pt, x as yt, y as gt, q as ft, r as bt } from "./index-Dhlyke5j.js";
|
|
3
3
|
import { t as mt, u as _t } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as kt } from "./Title-
|
|
5
|
-
import { u as xt, U as $t } from "./usePrinter-
|
|
6
|
-
import { _ as Ct } from "./Tooltip-
|
|
7
|
-
import { L as De } from "./Legend-
|
|
8
|
-
import wt from "./vue-ui-skeleton-
|
|
9
|
-
import Tt from "./BaseIcon-
|
|
10
|
-
import Lt from "./vue-ui-accordion-
|
|
11
|
-
import { u as Re } from "./useNestedProp-
|
|
12
|
-
import { _ as Nt } from "./PackageVersion-
|
|
13
|
-
import { P as Pt } from "./PenAndPaper-
|
|
4
|
+
import { _ as kt } from "./Title-BecmraNn.js";
|
|
5
|
+
import { u as xt, U as $t } from "./usePrinter-BnBk8gnl.js";
|
|
6
|
+
import { _ as Ct } from "./Tooltip-BZYApG0d.js";
|
|
7
|
+
import { L as De } from "./Legend-wr5XLSfL.js";
|
|
8
|
+
import wt from "./vue-ui-skeleton-DQqwDUqP.js";
|
|
9
|
+
import Tt from "./BaseIcon-mHeKnX4-.js";
|
|
10
|
+
import Lt from "./vue-ui-accordion-CGpOsWNN.js";
|
|
11
|
+
import { u as Re } from "./useNestedProp-D9eTQKze.js";
|
|
12
|
+
import { _ as Nt } from "./PackageVersion-xnKIqody.js";
|
|
13
|
+
import { P as Pt } from "./PenAndPaper-iek0aH4r.js";
|
|
14
14
|
import { u as St } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { _ as Vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
const Ft = ["id"], Ot = ["onClick"], Mt = ["xmlns", "viewBox"], zt = ["id"], It = ["stop-color"], At = ["stop-color"], Bt = ["x", "y", "width", "height", "fill", "rx"], Dt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], Rt = ["x2", "y1", "y2", "stroke", "stroke-width"], Ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Xt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Et = ["x", "y", "font-size", "fill", "font-weight"], Gt = ["x", "y", "font-size", "fill", "font-weight"], Ht = ["x", "y", "font-size", "fill", "font-weight"], Wt = ["y", "width", "height", "fill", "onMouseenter"], jt = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DGcOW0vL.cjs"),pe=require("./useResponsive-BJ7DTGpm.cjs"),Pe=require("./Title-BWhYDGb-.cjs"),ye=require("./usePrinter-DpEuGyLP.cjs"),ze=require("./Tooltip-cPxZzSgr.cjs"),ge=require("./Legend-Ba34oTdO.cjs"),De=require("./vue-ui-skeleton-D_lU-hWK.cjs"),Fe=require("./BaseIcon-DxRKjbz1.cjs"),Oe=require("./vue-ui-accordion-mtZIFAv9.cjs"),fe=require("./useNestedProp-C9KmUVBy.cjs"),Me=require("./PackageVersion-BJi2ywG9.cjs"),Ie=require("./PenAndPaper-CX6N7FR7.cjs"),Ae=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),qe=["id"],Ue=["onClick"],He=["xmlns","viewBox"],Xe=["id"],je=["stop-color"],Ge=["stop-color"],We=["x","y","width","height","fill","rx"],Ye=["x","y","width","height","fill","rx","stroke","stroke-width"],Ke=["x2","y1","y2","stroke","stroke-width"],Je=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x","y","text-anchor","font-size","fill","font-weight"],Ze=["x","y","font-size","fill","font-weight"],et=["x","y","font-size","fill","font-weight"],tt=["x","y","font-size","fill","font-weight"],lt=["y","width","height","fill","onMouseenter"],at={key:6,class:"vue-data-ui-watermark"},ot=["onClick"],nt={style:"width:100%;padding-top: 36px;position:relative"},rt={class:"vue-ui-data-table"},ut={key:0},st={style:{width:"100%"}},it=["data-cell"],ct={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dt=["data-cell"],vt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ht=["data-cell"],pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yt=["data-cell"],gt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ft=["data-cell"],bt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},mt=["data-cell"],kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ct=["data-cell"],_t={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},xt={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(be,{expose:me,emit:ke}){const y=be;e.useCssVars(l=>({e2a35dee:l.tdo}));const{vue_ui_vertical_bar:Ce}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),C=e.ref(n.createUid()),_e=e.ref(null),D=e.ref(!1),F=e.ref(""),E=e.ref(0),xe=e.ref(null),U=e.ref(0),N=e.ref(null),H=e.ref(null),O=e.ref(null),X=e.ref(null),j=e.ref(null),G=e.ref(0),M=e.ref(0),t=e.computed({get:()=>K(),set:l=>l}),{userOptionsVisible:I,setUserOptionsVisibility:W,keepUserOptionState:Y}=Ae.useUserOptionState({config:t.value});function K(){const l=fe.useNestedProp({userConfig:y.config,defaultConfig:Ce});return l.theme?{...fe.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[l.theme]||y.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>y.config,l=>{t.value=K(),I.value=!t.value.showOnChartHover,oe(),G.value+=1,M.value+=1,s.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,P,{deep:!0});const{isPrinting:J,isImaging:Q,generatePdf:Z,generateImage:ee}=ye.usePrinter({elementId:`vue-ui-vertical-bar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),Ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),te=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),le=e.ref(null),ae=e.ref(!1),we=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{oe()});function oe(){if(n.objectIsEmpty(y.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0),$e(),t.value.responsive){const l=pe.throttle(()=>{const{width:o,height:a}=pe.useResponsive({chart:N.value,title:t.value.style.chart.title.text?H.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:X.value,noTitle:j.value});ue.value=o,s.value=a/E.value-c.value*2});L.value=new ResizeObserver(l),L.value.observe(N.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function $e(){new ResizeObserver(o=>{o.forEach(a=>{ae.value=a.contentRect.width<we.value})}).observe(le.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),ne=e.computed(()=>p.value.sortDesc),_=e.computed(()=>(y.dataset.forEach((l,o)=>{!l.value&&!l.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),l.children&&(n.objectIsEmpty(l.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):l.children.forEach((a,r)=>{[null,void 0].includes(a.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),y.dataset.map((l,o)=>{const a=`vertical_parent_${o}_${C.value}`,r=l.children&&l.children.length>0,v=n.checkNaN(l.value?l.value:r?l.children.map(h=>h.value||0).reduce((h,m)=>h+m,0):0),i=v>=0?1:-1;return{...l,id:a,shape:"square",opacity:f.value.includes(a)?.5:1,value:Math.abs(v),sign:i,hasChildren:r,isChild:!1,segregate:()=>V(a),isSegregated:f.value.includes(a),color:n.convertColorToHex(l.color)||te.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!l.children||!l.children.length?[]:l.children.toSorted((h,m)=>ne.value?m.value-h.value:h.value-m.value).map((h,m)=>({...h,value:n.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:a,parentName:l.name,parentValue:v,parentSign:i,id:`vertical_child_${o}_${m}_${C.value}`,childIndex:m,color:n.convertColorToHex(h.color)||n.convertColorToHex(l.color)||te.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((h,m)=>({...h,isFirstChild:m===0,isLastChild:m===l.children.length-1}))}}).toSorted((l,o)=>ne.value?o.value-l.value:l.value-o.value))),re=e.computed(()=>({cy:"vertical-bar-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":""})),s=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),Se=e.computed(()=>(s.value+c.value)*E.value),ue=e.ref(512),d=e.computed(()=>({width:ue.value,height:Se.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function P(){E.value=x.value.flatMap(l=>l.children&&l.children.length>0?l.children.length:1).reduce((l,o)=>l+o,0)}const f=e.ref([]);function V(l){f.value.includes(l)?f.value=f.value.filter(o=>o!==l):f.value.push(l),P(),ke("selectLegend",x.value)}const x=e.computed(()=>_.value.filter(l=>!f.value.includes(l.id))),b=e.computed(()=>x.value.map(l=>Math.abs(l.value)).reduce((l,o)=>l+o,0));function se(l,o=!1,a=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(l)/b.value*100),s:"%",r:a}):Math.abs(l)/b.value}const w=e.computed(()=>x.value.flatMap(l=>l.hasChildren?l.children:l)),$=e.computed(()=>w.value.map(l=>l.sign).includes(-1)),Ve=e.computed(()=>Math.max(...x.value.flatMap(l=>l.children&&l.children.length?Math.max(...l.children.map(o=>o.value)):l.value)));function k(l){const o=l/Ve.value;return u.value.width/($.value?2:1)*o}function Te(l){return k(l)+u.value.left}function T(l,o){const a=x.value.find(i=>i.id===l.parentId),r=u.value.top+(c.value+s.value)*o,v=a.children.length*(c.value+s.value);return{y:r+v/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:a.name,value:[void 0,NaN,null].includes(a.value)?"":a.sign===1?a.value:-a.value,percentageToTotal:isNaN(a.value/b.value)?"":se(a.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:a.sign}}function Be(){return x.value}const A=e.ref(null),R=e.ref(null);function Ee(l,o){R.value={datapoint:l,seriesIndex:o,series:_.value,config:t.value},D.value=!0,A.value=l.id;let a="";const r=l.isChild?l.parentName:l.name,v=l.isChild?l.name:"",i=t.value.style.chart.tooltip.customFormat;n.isFunction(i)&&n.functionReturnsString(()=>i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}))?F.value=i({datapoint:l,series:_.value,config:t.value,seriesIndex:o}):(a+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
|
|
2
2
|
<div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" rx="2" stroke="none" fill="${l.color}"/></svg> ${r}</div>
|
|
3
3
|
${v?`<div>${v}</div>`:""}
|
|
4
4
|
</div>`,t.value.style.chart.tooltip.showValue&&(a+=`<div>${t.value.translations.value}: <b>${n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.sign===1?l.value:-l.value,n.dataLabel({p:t.value.style.chart.tooltip.prefix,v:l.sign===1?l.value:-l.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(a+=`<div>${t.value.translations.percentageToTotal} : <b>${n.dataLabel({v:Math.abs(l.value)/b.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,l.isChild&&(a+=`<div>${t.value.translations.percentageToSerie}: <b>${n.dataLabel({v:Math.abs(l.value)/Math.abs(l.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),F.value=`<div style="text-align:left">${a}</div>`)}function ie(l,o,a,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const v=n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n.checkNaN(r===-1&&l>=0?-l:l),n.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n.checkNaN(r===-1&&l>=0?-l:l),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:a}),i=`(${se(l,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${v}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${i}`:""}`}const g=e.computed(()=>{const l=[t.value.translations.parentName,t.value.translations.value,t.value.translations.percentageToTotal,t.value.translations.childName,t.value.translations.value,t.value.translations.percentageToSerie,t.value.translations.percentageToTotal],o=w.value.map(a=>a.isChild?a.isFirstChild?{color:a.color,parentName:a.parentName,parentValue:a.parentValue,percentageToTotal:a.parentValue/b.value,childName:a.name,childValue:a.sign===1?a.value:-a.value,childPercentageToParent:Math.abs(a.value)/Math.abs(a.parentValue),childPercentageToTotal:Math.abs(a.value)/b.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:a.name,childValue:a.sign===1?a.value:-a.value,childPercentageToParent:Math.abs(a.value)/Math.abs(a.parentValue),childPercentageToTotal:Math.abs(a.value)/b.value}:{color:a.color,parentName:a.name,parentValue:a.sign===1?a.value:-a.value,percentageToTotal:Math.abs(a.value)/b.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:l,body:o}});function ce(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=g.value.head,a=g.value.body.map(i=>[i.parentName,i.parentValue,i.percentageToTotal,i.childName,i.childValue,i.childPercentageToParent,i.childPercentageToTotal]),r=l.concat([o]).concat(a),v=n.createCsvContent(r);n.downloadCsv({csvContent:v,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const S=e.ref(!1);function Le(l){S.value=l,U.value+=1}function de(){p.value.showTable=!p.value.showTable}function ve(){p.value.sortDesc=!p.value.sortDesc,P()}function he(){p.value.showTooltip=!p.value.showTooltip}const z=e.ref(!1);function q(){z.value=!z.value}return me({getData:Be,recalculateHeight:P,generatePdf:Z,generateCsv:ce,generateImage:ee,toggleTable:de,toggleSort:ve,toggleTooltip:he,toggleAnnotator:q}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${S.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:N,id:`vue-ui-vertical-bar_${C.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%":""}`),onMouseenter:o[5]||(o[5]=()=>e.unref(W)(!0)),onMouseleave:o[6]||(o[6]=()=>e.unref(W)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ie.PenAndPaper,{key:0,parent:N.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:z.value,onClose:q},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:j,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:H,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${G.value}`,config:{title:{cy:"vertical-bar-div-title",...t.value.style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value&&(e.unref(Y)||e.unref(I))?(e.openBlock(),e.createBlock(ye.UserOptions,{ref_key:"details",ref:_e,key:`user_options_${U.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:C.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,hasSort:t.value.userOptions.buttons.sort,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:S.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:z.value,onToggleFullscreen:Le,onGeneratePdf:e.unref(Z),onGenerateCsv:ce,onGenerateImage:e.unref(ee),onToggleTable:de,onToggleSort:ve,onToggleTooltip:he,onToggleAnnotator:q,style:e.normalizeStyle({visibility:e.unref(Y)?e.unref(I)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionSort",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:4,ref_key:"chartLegend",ref:O},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_top_${M.value}`,legendSet:_.value,config:re.value,onClickMarker:o[0]||(o[0]=({legend:a})=>V(a.id))},{item:e.withCtx(({legend:a,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:v=>V(a.id),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:a.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:a,seriesIndex:r})),13,Ue)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("svg",{key:5,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":S.value,"vue-data-ui-fulscreen--off":!S.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Me._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${C.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.03),100-t.value.style.chart.layout.bars.gradientIntensity)},null,8,Ge)],8,Xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(a.sign===1?0:k(a.value)<=0?1e-4:k(a.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(a.value)<=0?1e-4:k(a.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.underlayerColor,rx:t.value.style.chart.layout.bars.borderRadius,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,We)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)($.value?u.value.left+u.value.width/2-(a.sign===1?0:k(a.value)<=0?1e-4:k(a.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(a.value)<=0?1e-4:k(a.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${C.value}_${r})`:e.unref(n.setOpacity)(a.color,t.value.style.chart.layout.bars.fillOpacity),rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?a.color:"none","stroke-width":t.value.style.chart.layout.bars.useStroke?t.value.style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Ye),(!a.isChild||a.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==w.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:u.value.left,y1:s.value+c.value/2+u.value.top+(c.value+s.value)*r,y2:s.value+c.value/2+u.value.top+(c.value+s.value)*r,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Ke)):e.createCommentVNode("",!0),$.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.left+u.value.width/2,x2:u.value.left+u.value.width/2,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Je)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:$.value?u.value.left+u.value.width/2+(a.sign===1?-12:12)+(a.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):Te(a.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!$.value||a.sign===-1?"start":"end","font-size":t.value.style.chart.layout.bars.dataLabels.fontSize,fill:t.value.style.chart.layout.bars.dataLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(ie(a.value,a,r,a.sign)),9,Qe),(a.isChild||!a.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"end",x:u.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.nameLabels.fontSize/2,"font-size":t.value.style.chart.layout.bars.nameLabels.fontSize,fill:t.value.style.chart.layout.bars.nameLabels.color,"font-weight":t.value.style.chart.layout.bars.nameLabels.bold?"bold":"normal"},e.toDisplayString(a.name),9,Ze)):e.createCommentVNode("",!0),a.isChild&&a.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:T(a,r).y,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(T(a,r).name),9,et)):e.createCommentVNode("",!0),a.isChild&&a.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:T(a,r).y+t.value.style.chart.layout.bars.parentLabels.fontSize+6,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(ie(T(a,r).value),T(a,r),r,a.parentSign||a.sign),9,tt)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(c.value+s.value)*r-c.value/2,width:d.value.width<=0?1e-4:d.value.width,height:s.value+c.value<=0?1e-4:s.value+c.value,fill:A.value===a.id?e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity):"transparent",onMouseenter:v=>Ee(a,r),onMouseleave:o[1]||(o[1]=v=>{xe.value=null,D.value=!1,A.value=null})},null,40,lt)]))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],14,He)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(J)||e.unref(Q)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(De.default,{key:7,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"chartLegend",ref:O},[(e.openBlock(),e.createBlock(ge.Legend,{key:`legend_bottom_${M.value}`,legendSet:_.value,config:re.value,onClickMarker:o[2]||(o[2]=({legend:a})=>V(a.id))},{item:e.withCtx(({legend:a,index:r})=>[e.createElementVNode("div",{onClick:v=>V(a.id),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:a.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:a,seriesIndex:r})),13,ot)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:_.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:9,ref_key:"source",ref:X,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:p.value.showTooltip&&D.value&&f.value.length<y.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:F.value,isFullscreen:S.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),B.value?(e.openBlock(),e.createBlock(Oe.default,{key:10,hideDetails:"",config:{open:p.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.createElementVNode("div",{ref_key:"tableContainer",ref:le,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",nt,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:o[3]||(o[3]=a=>p.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(a=>p.value.showTable=!1,["enter"]))},[e.createVNode(Fe.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%","container-type":"inline-size"},class:e.normalizeClass({"vue-ui-responsive":ae.value})},[e.createElementVNode("table",rt,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline}),class:"vue-ui-data-table__caption"},[e.createTextVNode(e.toDisplayString(t.value.style.chart.title.text)+" ",1),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(t.value.style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.head,a=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",st,e.toDisplayString(a),1)],4))),256))],4),e.createElementVNode("tr",null,[e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"∑ "+e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(isNaN(b.value)?"":b.value.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":g.value.head[0]??""},[e.createElementVNode("div",ct,[a.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${a.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.parentName),1)])],12,it),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[1]??""},[e.createElementVNode("div",vt,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(a.parentValue)?"":a.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,dt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[2]??""},[e.createElementVNode("div",pt,e.toDisplayString(["",NaN,void 0].includes(a.percentageToTotal)?"":`${(a.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,ht),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[3]??""},[e.createElementVNode("div",gt,e.toDisplayString(a.childName),1)],12,yt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[4]??""},[e.createElementVNode("div",bt,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(a.childValue)?"":a.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,ft),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[5]??""},[e.createElementVNode("div",kt,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToParent)?"":`${(a.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,mt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[6]??""},[e.createElementVNode("div",_t,e.toDisplayString(["",NaN,void 0].includes(a.childPercentageToTotal)?"":`${(a.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,Ct)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,qe))}},Nt=Re._export_sfc(xt,[["__scopeId","data-v-75fe9d91"]]);exports.default=Nt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BdlNqn9B.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),Ee=require("./Title-Z93_y2gr.cjs"),ge=require("./usePrinter-DtSijS1B.cjs"),Ie=require("./Tooltip-DVfgJ6mM.cjs"),ze=require("./DataTable-CwiudM8v.cjs"),Fe=require("./Legend-TTzHdVeD.cjs"),Oe=require("./vue-ui-skeleton-Czl8iTZQ.cjs"),Ae=require("./vue-ui-accordion-Dm8myRhk.cjs"),me=require("./useNestedProp-DDvMHRIf.cjs"),De=require("./PackageVersion-B_ULr99C.cjs"),qe=require("./PenAndPaper-DFNDy1y9.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=$=>(e.pushScopeId("data-v-ddb68bc6"),$=$(),e.popScopeId(),$),Ue=["id"],je=["xmlns","viewBox"],Ge=["id"],We=["stop-color"],He=["stop-color"],Ye=["id"],Xe=be(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Je=be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ke=[Xe,Je],Qe=["x","y","height","width"],Ze=["height","width"],et=["rx","x","y","height","width","stroke","stroke-width","filter"],tt=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],lt=["x","y","height","width","filter"],at={key:0},ot={key:1},rt={key:2},ut={key:3},nt=["onMouseover","x","y","height","width"],st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},vt={key:1},dt=["innerHTML"],pt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup($,{expose:ke,emit:we}){const p=$,{vue_ui_waffle:Ce}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),xe=e.ref(null),O=e.ref(!1),A=e.ref(""),B=e.ref(null),j=e.ref(0),S=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>ee(),set:l=>l}),{userOptionsVisible:D,setUserOptionsVisibility:Q,keepUserOptionState:Z}=Me.useUserOptionState({config:t.value});function ee(){const l=me.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...me.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=ee(),D.value=!t.value.showOnChartHover,te(),X.value+=1,J.value+=1,K.value+=1},{deep:!0});const E=e.ref(null);function te(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:S.value,title:t.value.style.chart.title.text?G.value:null,legend:t.value.style.chart.legend.show?W.value:null,source:H.value,noTitle:Y.value});k.value.width=o,k.value.height=a,f.value.width=o,f.value.height=a});E.value=new ResizeObserver(l),E.value.observe(S.value.parentNode)}}e.onMounted(()=>{te()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:le,isImaging:ae,generatePdf:oe,generateImage:re}=ge.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),C=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),T=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ne(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,U)=>h+U,0),r=l.map(h=>h/a*o),u=r.map(Math.floor),i=r.map(h=>h%1);let d=o-u.reduce((h,U)=>h+U,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function se(){return p.dataset.map((l,o)=>({...l,color:n.convertColorToHex(l.color)||ue.value[o]||n.palette[o]||n.palette[o%n.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const ie=e.computed(()=>se()),c=e.ref(ie.value);e.watch(()=>p.dataset,l=>{c.value=se()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return ne(l)}),_e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return ne(l)}),L=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:Se.value[o]})))),Ne=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:_e.value[o]})));function $e(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Te=e.computed(()=>{let l=0;return L.value.map((o,a)=>{const r=l,u=r+o.proportion,i=[];for(let d=Math.floor(r);d<Math.floor(u);d+=1)i.push(d);return l=u,{...o,start:r,rects:i}})}),s=e.computed(()=>Te.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),P=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(C.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),x=e.ref(!1),ce=e.ref(null),ve=e.ref(null);function de(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const o=ie.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let r=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){r>u?(cancelAnimationFrame(ce.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),x.value=!1):(x.value=!0,r+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[r]}:d),ce.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=o;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<.1?(cancelAnimationFrame(ve.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),x.value=!1):(x.value=!0,r/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[r]}:i),ve.value=requestAnimationFrame(u))};u()}we("selectLegend",L.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||ue[o]||n.palette[o]||n.palette[o%n.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map((l,o)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((r,u)=>r+u,0)).reduce((a,r)=>a+r,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>de(l.uid),isSegregated:v.value.includes(l.uid)}))),Le=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>L.value.map(l=>l.value).reduce((l,o)=>l+o,0)),q=e.ref(null);function Pe(l){if(v.value.length===p.dataset.length)return;const o=s.value[l];q.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},O.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))A.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";if(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:o.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${u})</span></div>`:r+=`<b>${u}%</b></div>`}A.value=r}}const g=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),o=L.value.map(a=>a.value);return{head:l,body:o}});function M(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function pe(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(o);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),N=e.ref(!1);function Ve(l){N.value=l,j.value+=1}function he(){m.value.showTable=!m.value.showTable}function fe(){m.value.showTooltip=!m.value.showTooltip}const F=e.ref(!1);function R(){F.value=!F.value}return ke({getData:$e,generatePdf:oe,generateCsv:pe,generateImage:re,toggleTable:he,toggleTooltip:fe,toggleAnnotator:R}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${N.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:S,id:`vue-ui-waffle_${b.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%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(Q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:S.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Y,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:G,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(ge.UserOptions,{ref_key:"details",ref:xe,key:`user_options_${j.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:b.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:N.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Ve,onGeneratePdf:e.unref(oe),onGenerateCsv:pe,onGenerateImage:e.unref(re),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:R,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(De._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,We),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,He)],8,Ge))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ke,8,Ye)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[r].color,...s.value[r]},isSelected:[null,void 0].includes(B.value)?!0:s.value[r].serieIndex===B.value})),void 0,!0)],8,Qe))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ze)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,tt))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!x.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&s.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value*t.value.style.chart.layout.grid.size<=0?1e-4:T.value*t.value.style.chart.layout.grid.size,filter:M(s.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${T.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",ot,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a})),1)):e.createCommentVNode("",!0)],4)],8,lt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>Pe(r),onMouseleave:o[0]||(o[0]=u=>{O.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value<=0?1e-4:T.value,fill:"transparent",stroke:"none"},null,40,nt))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,je)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Oe.default,{key:6,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:W},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Fe.Legend,{key:`legend_${K.value}`,legendSet:_.value,config:Le.value,onClickMarker:o[1]||(o[1]=({legend:a})=>de(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,it)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:H,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ie._sfc_main,{show:m.value.showTooltip&&O.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:S.value,content:A.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize,isFullscreen:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),V.value?(e.openBlock(),e.createBlock(Ae.default,{key:8,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ze.DataTable,{key:`table_${J.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,dt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ue))}},ht=Re._export_sfc(pt,[["__scopeId","data-v-ddb68bc6"]]);exports.default=ht;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DGcOW0vL.cjs"),ye=require("./useResponsive-BJ7DTGpm.cjs"),Ee=require("./Title-BWhYDGb-.cjs"),ge=require("./usePrinter-DpEuGyLP.cjs"),Ie=require("./Tooltip-cPxZzSgr.cjs"),ze=require("./DataTable-rMMvio1U.cjs"),Fe=require("./Legend-Ba34oTdO.cjs"),Oe=require("./vue-ui-skeleton-D_lU-hWK.cjs"),Ae=require("./vue-ui-accordion-mtZIFAv9.cjs"),me=require("./useNestedProp-C9KmUVBy.cjs"),De=require("./PackageVersion-BJi2ywG9.cjs"),qe=require("./PenAndPaper-CX6N7FR7.cjs"),Me=require("./useUserOptionState-BgepsfED.cjs"),Re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),be=$=>(e.pushScopeId("data-v-1d032eba"),$=$(),e.popScopeId(),$),Ue=["id"],je=["xmlns","viewBox"],Ge=["id"],We=["stop-color"],He=["stop-color"],Ye=["id"],Xe=be(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Je=be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ke=[Xe,Je],Qe=["x","y","height","width"],Ze=["height","width"],et=["rx","x","y","height","width","stroke","stroke-width","filter"],tt=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],lt=["x","y","height","width","filter"],at={key:0},ot={key:1},rt={key:2},ut={key:3},nt=["onMouseover","x","y","height","width"],st={key:5,class:"vue-data-ui-watermark"},it=["onClick"],ct={key:0},vt={key:1},dt=["innerHTML"],pt={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup($,{expose:ke,emit:we}){const p=$,{vue_ui_waffle:Ce}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),xe=e.ref(null),O=e.ref(!1),A=e.ref(""),B=e.ref(null),j=e.ref(0),S=e.ref(null),G=e.ref(null),W=e.ref(null),H=e.ref(null),Y=e.ref(null),X=e.ref(0),J=e.ref(0),K=e.ref(0),t=e.computed({get:()=>ee(),set:l=>l}),{userOptionsVisible:D,setUserOptionsVisibility:Q,keepUserOptionState:Z}=Me.useUserOptionState({config:t.value});function ee(){const l=me.useNestedProp({userConfig:p.config,defaultConfig:Ce});return l.theme?{...me.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=ee(),D.value=!t.value.showOnChartHover,te(),X.value+=1,J.value+=1,K.value+=1},{deep:!0});const E=e.ref(null);function te(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=ye.throttle(()=>{const{width:o,height:a}=ye.useResponsive({chart:S.value,title:t.value.style.chart.title.text?G.value:null,legend:t.value.style.chart.legend.show?W.value:null,source:H.value,noTitle:Y.value});k.value.width=o,k.value.height=a,f.value.width=o,f.value.height=a});E.value=new ResizeObserver(l),E.value.observe(S.value.parentNode)}}e.onMounted(()=>{te()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});const{isPrinting:le,isImaging:ae,generatePdf:oe,generateImage:re}=ge.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Be=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),ue=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),C=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),T=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),I=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ne(l){const o=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,U)=>h+U,0),r=l.map(h=>h/a*o),u=r.map(Math.floor),i=r.map(h=>h%1);let d=o-u.reduce((h,U)=>h+U,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function se(){return p.dataset.map((l,o)=>({...l,color:n.convertColorToHex(l.color)||ue.value[o]||n.palette[o]||n.palette[o%n.palette.length],uid:`serie_${o}`,absoluteIndex:o}))}const ie=e.computed(()=>se()),c=e.ref(ie.value);e.watch(()=>p.dataset,l=>{c.value=se()},{deep:!0});const Se=e.computed(()=>{const l=c.value.filter((o,a)=>!v.value.includes(o.uid)).map((o,a)=>(o.values||[]).reduce((r,u)=>r+u,0));return ne(l)}),_e=e.computed(()=>{const l=c.value.map((o,a)=>(o.values||[]).reduce((r,u)=>r+u));return ne(l)}),L=e.computed(()=>(p.dataset.forEach((l,o)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:o})}),c.value.filter((l,o)=>!v.value.includes(l.uid)).map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:Se.value[o]})))),Ne=e.computed(()=>c.value.map((l,o)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,r)=>a+r,0),absoluteValues:l.values||[],proportion:_e.value[o]})));function $e(){return Ne.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const Te=e.computed(()=>{let l=0;return L.value.map((o,a)=>{const r=l,u=r+o.proportion,i=[];for(let d=Math.floor(r);d<Math.floor(u);d+=1)i.push(d);return l=u,{...o,start:r,rects:i}})}),s=e.computed(()=>Te.value.flatMap((l,o)=>l.rects.map((a,r)=>({isFirst:r===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:o,absoluteStartIndex:r<3,serieId:l.uid,...l}))).map((l,o)=>({...l,isAbsoluteFirst:o%t.value.style.chart.layout.grid.size===0}))),P=e.computed(()=>{const l=[];for(let o=0;o<t.value.style.chart.layout.grid.size;o+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?o:a,x:(t.value.style.chart.layout.grid.vertical?o:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:o)*(C.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),x=e.ref(!1),ce=e.ref(null),ve=e.ref(null);function de(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const o=ie.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0),a=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let r=a;if(v.value.includes(l)){let i=function(){r>u?(cancelAnimationFrame(ce.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),x.value=!1):(x.value=!0,r+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[r]}:d),ce.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=o;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){r<a/100?(cancelAnimationFrame(ve.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),x.value=!1):(x.value=!0,r/=1.15,c.value=c.value.map(i=>i.uid===l?{...i,values:[r]}:i),ve.value=requestAnimationFrame(u))};u()}we("selectLegend",L.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,o)=>({name:l.name,color:l.color||ue[o]||n.palette[o]||n.palette[o%n.palette.length],value:(l.values||[]).reduce((a,r)=>a+r,0),uid:l.uid,shape:"square"})).map(l=>({...l,proportion:l.value/c.value.map(o=>(o.values||[]).reduce((a,r)=>a+r,0)).reduce((o,a)=>o+a,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>de(l.uid),isSegregated:v.value.includes(l.uid)}))),Le=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>L.value.map(l=>l.value).reduce((l,o)=>l+o,0)),q=e.ref(null);function Pe(l){if(v.value.length===p.dataset.length)return;const o=s.value[l];q.value={datapoint:o,seriesIndex:o.absoluteIndex,series:c.value,config:t.value},O.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value})))A.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:o,series:c.value,config:t.value});else{let r="";if(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(r+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:o.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?r+=`<span>(${u})</span></div>`:r+=`<b>${u}%</b></div>`}A.value=r}}const g=e.computed(()=>{const l=L.value.map(a=>({name:a.name,color:a.color})),o=L.value.map(a=>a.value);return{head:l,body:o}});function M(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function pe(){e.nextTick(()=>{const l=g.value.head.map((r,u)=>[[r.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(o);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],o=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:o,config:a,colNames:r}}),N=e.ref(!1);function Ve(l){N.value=l,j.value+=1}function he(){m.value.showTable=!m.value.showTable}function fe(){m.value.showTooltip=!m.value.showTooltip}const F=e.ref(!1);function R(){F.value=!F.value}return ke({getData:$e,generatePdf:oe,generateCsv:pe,generateImage:re,toggleTable:he,toggleTooltip:fe,toggleAnnotator:R}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${N.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:S,id:`vue-ui-waffle_${b.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%":""}`),onMouseenter:o[3]||(o[3]=()=>e.unref(Q)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(Q)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(qe.PenAndPaper,{key:0,parent:S.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:F.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:Y,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:G,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(Ee._sfc_main,{key:`title_${X.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(ge.UserOptions,{ref_key:"details",ref:xe,key:`user_options_${j.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(ae),uid:b.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:N.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:F.value,onToggleFullscreen:Ve,onGeneratePdf:e.unref(oe),onGenerateCsv:pe,onGenerateImage:e.unref(re),onToggleTable:he,onToggleTooltip:fe,onToggleAnnotator:R,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(De._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,We),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,He)],8,Ge))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Ke,8,Ye)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[r].color,...s.value[r]},isSelected:[null,void 0].includes(B.value)?!0:s.value[r].serieIndex===B.value})),void 0,!0)],8,Qe))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ze)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:C.value<=0?1e-4:C.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${r})`:s.value[r].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:M(s.value[r].serieIndex)},null,8,tt))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!x.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[r].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[r].isAbsoluteFirst&&r%t.value.style.chart.layout.grid.size===0&&s.value[r].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value*t.value.style.chart.layout.grid.size<=0?1e-4:T.value*t.value.style.chart.layout.grid.size,filter:M(s.value[r].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${T.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[r].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[r].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[r].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",ot,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[r].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[r].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[r].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[r],position:a})),1)):e.createCommentVNode("",!0)],4)],8,lt)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>Pe(r),onMouseleave:o[0]||(o[0]=u=>{O.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:I.value<=0?1e-4:I.value,width:T.value<=0?1e-4:T.value,fill:"transparent",stroke:"none"},null,40,nt))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,je)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(ae)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Oe.default,{key:6,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:W},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Fe.Legend,{key:`legend_${K.value}`,legendSet:_.value,config:Le.value,onClickMarker:o[1]||(o[1]=({legend:a})=>de(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:r=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:x.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",vt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",ct," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:x.value}))+") ",1))],12,it)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:H,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ie._sfc_main,{show:m.value.showTooltip&&O.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:S.value,content:A.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize,isFullscreen:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize","isFullscreen"]),V.value?(e.openBlock(),e.createBlock(Ae.default,{key:8,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ze.DataTable,{key:`table_${J.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[2]||(o[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,dt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ue))}},ht=Re._export_sfc(pt,[["__scopeId","data-v-1d032eba"]]);exports.default=ht;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { computed as d, ref as c, watch as ze, onMounted as Ze, onBeforeUnmount as et, openBlock as s, createElementBlock as n, normalizeClass as Ne, normalizeStyle as X, unref as v, createBlock as z, createCommentVNode as f, createSlots as tt, withCtx as b, renderSlot as g, normalizeProps as U, guardReactiveProps as G, createVNode as Be, createElementVNode as k, Fragment as I, renderList as R, toDisplayString as S, createTextVNode as Ve, nextTick as lt, pushScopeId as at, popScopeId as ot } from "vue";
|
|
2
|
-
import { u as ut, c as st, t as rt, a as nt, p as N, o as it, e as re, g as ct, b as vt, i as j, f as x, X as dt, s as ht, w as pt, G as yt, L as ft, d as gt, x as bt, y as mt, q as wt, r as kt } from "./index-
|
|
2
|
+
import { u as ut, c as st, t as rt, a as nt, p as N, o as it, e as re, g as ct, b as vt, i as j, f as x, X as dt, s as ht, w as pt, G as yt, L as ft, d as gt, x as bt, y as mt, q as wt, r as kt } from "./index-Dhlyke5j.js";
|
|
3
3
|
import { t as xt, u as Ct } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as _t } from "./Title-
|
|
5
|
-
import { u as $t, U as Tt } from "./usePrinter-
|
|
6
|
-
import { _ as It } from "./Tooltip-
|
|
7
|
-
import { D as St } from "./DataTable-
|
|
8
|
-
import { L as Pt } from "./Legend-
|
|
9
|
-
import Lt from "./vue-ui-skeleton-
|
|
10
|
-
import Ot from "./vue-ui-accordion-
|
|
11
|
-
import { u as Me } from "./useNestedProp-
|
|
12
|
-
import { _ as At } from "./PackageVersion-
|
|
13
|
-
import { P as Ft } from "./PenAndPaper-
|
|
4
|
+
import { _ as _t } from "./Title-BecmraNn.js";
|
|
5
|
+
import { u as $t, U as Tt } from "./usePrinter-BnBk8gnl.js";
|
|
6
|
+
import { _ as It } from "./Tooltip-BZYApG0d.js";
|
|
7
|
+
import { D as St } from "./DataTable-D8MTezlM.js";
|
|
8
|
+
import { L as Pt } from "./Legend-wr5XLSfL.js";
|
|
9
|
+
import Lt from "./vue-ui-skeleton-DQqwDUqP.js";
|
|
10
|
+
import Ot from "./vue-ui-accordion-CGpOsWNN.js";
|
|
11
|
+
import { u as Me } from "./useNestedProp-D9eTQKze.js";
|
|
12
|
+
import { _ as At } from "./PackageVersion-xnKIqody.js";
|
|
13
|
+
import { P as Ft } from "./PenAndPaper-iek0aH4r.js";
|
|
14
14
|
import { u as zt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { _ as Nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
|
-
const De = (E) => (at("data-v-
|
|
16
|
+
const De = (E) => (at("data-v-1d032eba"), E = E(), ot(), E), Bt = ["id"], Vt = ["xmlns", "viewBox"], Mt = ["id"], Dt = ["stop-color"], Ut = ["stop-color"], Gt = ["id"], Rt = /* @__PURE__ */ De(() => /* @__PURE__ */ k("feGaussianBlur", {
|
|
17
17
|
in: "SourceGraphic",
|
|
18
18
|
stdDeviation: 2
|
|
19
19
|
}, null, -1)), jt = /* @__PURE__ */ De(() => /* @__PURE__ */ k("feColorMatrix", {
|
|
@@ -215,8 +215,8 @@ const De = (E) => (at("data-v-ddb68bc6"), E = E(), ot(), E), Bt = ["id"], Vt = [
|
|
|
215
215
|
p.value.includes(t) ? p.value = p.value.filter((u) => u !== t) : p.value.length < M.value.length - 1 && M.value.length > 1 && p.value.push(t);
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
|
-
const a = Ie.value.find((u) => u.uid === t).values.reduce((u, i) => u + i, 0);
|
|
219
|
-
let o =
|
|
218
|
+
const a = Ie.value.find((u) => u.uid === t).values.reduce((u, i) => u + i, 0), l = h.value.find((u) => u.uid === t).values.reduce((u, i) => u + i, 0);
|
|
219
|
+
let o = l;
|
|
220
220
|
if (p.value.includes(t)) {
|
|
221
221
|
let i = function() {
|
|
222
222
|
o > u ? (cancelAnimationFrame(Se.value), h.value = h.value.map((y, w) => y.uid === t ? {
|
|
@@ -232,10 +232,10 @@ const De = (E) => (at("data-v-ddb68bc6"), E = E(), ot(), E), Bt = ["id"], Vt = [
|
|
|
232
232
|
i();
|
|
233
233
|
} else if (p.value.length < M.value.length - 1 && M.value.length > 1) {
|
|
234
234
|
let u = function() {
|
|
235
|
-
o <
|
|
235
|
+
o < l / 100 ? (cancelAnimationFrame(Pe.value), p.value.push(t), h.value = h.value.map((i, y) => i.uid === t ? {
|
|
236
236
|
...i,
|
|
237
237
|
values: [0]
|
|
238
|
-
} : i), F.value = !1) : (F.value = !0, o /= 1.
|
|
238
|
+
} : i), F.value = !1) : (F.value = !0, o /= 1.15, h.value = h.value.map((i) => i.uid === t ? {
|
|
239
239
|
...i,
|
|
240
240
|
values: [o]
|
|
241
241
|
} : i), Pe.value = requestAnimationFrame(u));
|
|
@@ -255,9 +255,9 @@ const De = (E) => (at("data-v-ddb68bc6"), E = E(), ot(), E), Bt = ["id"], Vt = [
|
|
|
255
255
|
value: (t.values || []).reduce((l, o) => l + o, 0),
|
|
256
256
|
uid: t.uid,
|
|
257
257
|
shape: "square"
|
|
258
|
-
})).map((t
|
|
258
|
+
})).map((t) => ({
|
|
259
259
|
...t,
|
|
260
|
-
proportion: t.value / h.value.map((
|
|
260
|
+
proportion: t.value / h.value.map((a) => (a.values || []).reduce((l, o) => l + o, 0)).reduce((a, l) => a + l, 0),
|
|
261
261
|
opacity: p.value.includes(t.uid) ? 0.5 : 1,
|
|
262
262
|
segregate: () => Le(t.uid),
|
|
263
263
|
isSegregated: p.value.includes(t.uid)
|
|
@@ -800,7 +800,7 @@ const De = (E) => (at("data-v-ddb68bc6"), E = E(), ot(), E), Bt = ["id"], Vt = [
|
|
|
800
800
|
}, 8, ["config"])) : f("", !0)
|
|
801
801
|
], 46, Bt));
|
|
802
802
|
}
|
|
803
|
-
}, xl = /* @__PURE__ */ Nt(sl, [["__scopeId", "data-v-
|
|
803
|
+
}, xl = /* @__PURE__ */ Nt(sl, [["__scopeId", "data-v-1d032eba"]]);
|
|
804
804
|
export {
|
|
805
805
|
xl as default
|
|
806
806
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed as p, ref as s, watch as H, onMounted as re, onBeforeUnmount as ue, openBlock as r, createElementBlock as v, normalizeStyle as A, unref as l, createBlock as w, createCommentVNode as h, createSlots as ie, withCtx as b, renderSlot as f, normalizeProps as I, guardReactiveProps as P, normalizeClass as Y, createVNode as ce, Fragment as ve, renderList as he, toDisplayString as de } from "vue";
|
|
2
|
-
import { u as fe, c as ye, t as pe, o as ge, e as me, w as W, X as ke, i as we, v as q, f as be } from "./index-
|
|
3
|
-
import { _ as Ce } from "./Title-
|
|
4
|
-
import { u as _e, U as Oe } from "./usePrinter-
|
|
2
|
+
import { u as fe, c as ye, t as pe, o as ge, e as me, w as W, X as ke, i as we, v as q, f as be } from "./index-Dhlyke5j.js";
|
|
3
|
+
import { _ as Ce } from "./Title-BecmraNn.js";
|
|
4
|
+
import { u as _e, U as Oe } from "./usePrinter-BnBk8gnl.js";
|
|
5
5
|
import { t as $e, u as xe } from "./useResponsive-CoxXLe23.js";
|
|
6
|
-
import Ae from "./vue-ui-skeleton-
|
|
7
|
-
import { u as V } from "./useNestedProp-
|
|
8
|
-
import { _ as Ie } from "./PackageVersion-
|
|
9
|
-
import { P as Pe } from "./PenAndPaper-
|
|
6
|
+
import Ae from "./vue-ui-skeleton-DQqwDUqP.js";
|
|
7
|
+
import { u as V } from "./useNestedProp-D9eTQKze.js";
|
|
8
|
+
import { _ as Ie } from "./PackageVersion-xnKIqody.js";
|
|
9
|
+
import { P as Pe } from "./PenAndPaper-iek0aH4r.js";
|
|
10
10
|
import { u as Fe } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
11
|
import { _ as Se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const ze = ["id"], Me = ["xmlns", "viewBox"], Ne = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], Te = ["cx", "cy", "r", "stroke", "stroke-width"], Ue = ["x", "y", "font-size", "fill", "font-weight"], Le = {
|