vue-data-ui 2.3.74 → 2.3.76
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-DK6F5Fq3.cjs → Arrow-D7M4-bW7.cjs} +1 -1
- package/dist/{Arrow-CYCrAySW.js → Arrow-DY9RKUmG.js} +1 -1
- package/dist/{BaseIcon-DBHVtm3A.cjs → BaseIcon-DB7Apwv_.cjs} +1 -1
- package/dist/{BaseIcon-kBIAYqUO.js → BaseIcon-rwm-10Hu.js} +1 -1
- package/dist/{DataTable-BNFSPjhv.cjs → DataTable-CsNozyz7.cjs} +1 -1
- package/dist/{DataTable-CKdV-L0e.js → DataTable-e2fnfjXV.js} +2 -2
- package/dist/{Legend-Cj7T-DqJ.js → Legend-5cQ0xZjK.js} +1 -1
- package/dist/{Legend-Do2kcWFT.cjs → Legend-DgFd-O0m.cjs} +1 -1
- package/dist/{Shape-Bo8ZjViG.js → Shape-CiTElr_0.js} +1 -1
- package/dist/{Shape-DRDUAe_o.cjs → Shape-yPECDLiP.cjs} +1 -1
- package/dist/{Slicer-D8jHSP7U.cjs → Slicer-DaZgCKV7.cjs} +1 -1
- package/dist/{Slicer-4nGKvUYF.js → Slicer-DwBBu3kB.js} +2 -2
- package/dist/{Title-D5cATWsL.cjs → Title-3EduyW4p.cjs} +1 -1
- package/dist/{Title-DZjnxQdN.js → Title-gUz6GDA3.js} +1 -1
- package/dist/{Tooltip-B8yLaegk.cjs → Tooltip-DScSrYXJ.cjs} +1 -1
- package/dist/{Tooltip--kgFEVZs.js → Tooltip-DfSM1mNP.js} +1 -1
- package/dist/{index-D_32ZGWd.cjs → index-BTgtr0F8.cjs} +1 -1
- package/dist/{index-C8SH0f2u.js → index-CaV1s-yZ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-BvvH633N.cjs → useNestedProp-CisbRRo_.cjs} +1 -1
- package/dist/{useNestedProp-lS_T5lM3.js → useNestedProp-tWCzZrLx.js} +1 -1
- package/dist/{usePrinter-BouFNHWR.cjs → usePrinter-DzTaA1eh.cjs} +1 -1
- package/dist/{usePrinter-Dj50NAxo.js → usePrinter-rvJyT65A.js} +1 -1
- package/dist/{vue-data-ui-v_BbbLtJ.cjs → vue-data-ui-BGkWRPUY.cjs} +1 -1
- package/dist/{vue-data-ui-DoXqU7xC.js → vue-data-ui-BO89gTtq.js} +57 -57
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-CnoPOJHm.js → vue-ui-3d-bar-CcTMIHiB.js} +499 -486
- package/dist/vue-ui-3d-bar-DzmcGuqh.cjs +19 -0
- package/dist/{vue-ui-accordion-Cka6b_Up.cjs → vue-ui-accordion-7e4Myhcg.cjs} +1 -1
- package/dist/{vue-ui-accordion-YHleIgkV.js → vue-ui-accordion-CpzGQ63y.js} +3 -3
- package/dist/vue-ui-age-pyramid-C7qr9EwB.cjs +1 -0
- package/dist/{vue-ui-age-pyramid-CENg8fDg.js → vue-ui-age-pyramid-D71ZLkVV.js} +182 -169
- package/dist/{vue-ui-annotator-VJOLUkqJ.js → vue-ui-annotator-B8Iu6cYt.js} +1 -1
- package/dist/{vue-ui-annotator-ByYg6QMs.cjs → vue-ui-annotator-BKQrweqm.cjs} +1 -1
- package/dist/{vue-ui-candlestick-CHsGD3bx.js → vue-ui-candlestick-Bx4QVkY0.js} +295 -279
- package/dist/vue-ui-candlestick-DAc1FQ-i.cjs +2 -0
- package/dist/vue-ui-carousel-table-uFRqkghO.cjs +1 -0
- package/dist/{vue-ui-carousel-table-RAtX3VBu.js → vue-ui-carousel-table-xuQG6bcH.js} +146 -129
- package/dist/{vue-ui-chestnut-B5GQX0J_.js → vue-ui-chestnut-Bo6rDcU7.js} +215 -204
- package/dist/vue-ui-chestnut-DJkm72oD.cjs +6 -0
- package/dist/{vue-ui-cursor-DnZqLj21.cjs → vue-ui-cursor-BQbeuW-k.cjs} +1 -1
- package/dist/{vue-ui-cursor-CMm7XSSG.js → vue-ui-cursor-C0KOqEOq.js} +2 -2
- package/dist/{vue-ui-dashboard-DgEQJnLr.cjs → vue-ui-dashboard-0Hsjx-bO.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Ck_5L3eu.js → vue-ui-dashboard-BT71xS7P.js} +2 -2
- package/dist/{vue-ui-digits--ULH35um.js → vue-ui-digits-BRqpKYvD.js} +2 -2
- package/dist/{vue-ui-digits-UvwUdi6U.cjs → vue-ui-digits-C2ReH6w0.cjs} +1 -1
- package/dist/{vue-ui-donut-QQ1fWWvc.js → vue-ui-donut-NQW-3prf.js} +376 -362
- package/dist/vue-ui-donut-evolution-DOe-cwLi.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-Cx8kBB_7.js → vue-ui-donut-evolution-jbXQQGTc.js} +270 -255
- package/dist/vue-ui-donut-v81suIOX.cjs +1 -0
- package/dist/vue-ui-dumbbell-DXQSg6wa.cjs +9 -0
- package/dist/{vue-ui-dumbbell-BYvwHpU8.js → vue-ui-dumbbell-Dyz8xdtC.js} +232 -213
- package/dist/vue-ui-flow-BL3JWW1m.js +481 -0
- package/dist/vue-ui-flow-UqSNwH9d.cjs +1 -0
- package/dist/vue-ui-galaxy-DTQWGvRH.cjs +1 -0
- package/dist/{vue-ui-galaxy-B0L57aec.js → vue-ui-galaxy-Dx9nsOuM.js} +175 -162
- package/dist/vue-ui-gauge-BUB7H0qA.cjs +1 -0
- package/dist/vue-ui-gauge-CLaKGi0-.js +500 -0
- package/dist/vue-ui-gizmo-Kitfqu0J.cjs +1 -0
- package/dist/{vue-ui-gizmo-D2RfM55X.js → vue-ui-gizmo-of-4s5HG.js} +66 -53
- package/dist/{vue-ui-heatmap-DKM0DH41.js → vue-ui-heatmap-BIzjOMXO.js} +157 -143
- package/dist/vue-ui-heatmap-DUw2350O.cjs +1 -0
- package/dist/vue-ui-kpi-By3YPwgo.js +98 -0
- package/dist/vue-ui-kpi-DyL2Hcz-.cjs +1 -0
- package/dist/{vue-ui-mini-loader-CLP19Txv.cjs → vue-ui-mini-loader-C048-8Kd.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-MywnWlYI.js → vue-ui-mini-loader-DnK3V2z2.js} +2 -2
- package/dist/{vue-ui-molecule-CLI9iTRE.js → vue-ui-molecule-BfhbIqa5.js} +177 -167
- package/dist/vue-ui-molecule-D-ahly6R.cjs +1 -0
- package/dist/vue-ui-mood-radar-DD8R9BpJ.cjs +1 -0
- package/dist/{vue-ui-mood-radar-O30wZo9a.js → vue-ui-mood-radar-DXxEKr3x.js} +172 -161
- package/dist/{vue-ui-nested-donuts-D8o4TqTt.js → vue-ui-nested-donuts-BdUdHFd-.js} +377 -364
- package/dist/vue-ui-nested-donuts-C7qM_FRw.cjs +17 -0
- package/dist/{vue-ui-onion-Hmcke6xB.js → vue-ui-onion-D0vF5jBt.js} +191 -177
- package/dist/vue-ui-onion-DX3gofXZ.cjs +5 -0
- package/dist/{vue-ui-parallel-coordinate-plot-CyChE3NP.js → vue-ui-parallel-coordinate-plot-CTZY-pY8.js} +298 -284
- package/dist/vue-ui-parallel-coordinate-plot-DEx5kFYd.cjs +8 -0
- package/dist/{vue-ui-quadrant-DimTQdAj.js → vue-ui-quadrant-ByY8GP3y.js} +347 -334
- package/dist/vue-ui-quadrant-CgApzie6.cjs +1 -0
- package/dist/{vue-ui-quick-chart-DxJvENid.js → vue-ui-quick-chart-DTxJ__7j.js} +483 -469
- package/dist/vue-ui-quick-chart-DWZEgUJF.cjs +15 -0
- package/dist/{vue-ui-radar-D_FieunT.js → vue-ui-radar-5UBmAU6W.js} +202 -189
- package/dist/vue-ui-radar-DEED0rTz.cjs +1 -0
- package/dist/{vue-ui-rating-BHW2Onru.cjs → vue-ui-rating-Ce_Ewqtl.cjs} +1 -1
- package/dist/{vue-ui-rating-DF1BpH4E.js → vue-ui-rating-Dr6jquxh.js} +2 -2
- package/dist/vue-ui-relation-circle-BU8i2miI.js +322 -0
- package/dist/vue-ui-relation-circle-CRcQ6Zcy.cjs +1 -0
- package/dist/{vue-ui-rings-BqS-iece.js → vue-ui-rings-Ctl3Jywh.js} +203 -189
- package/dist/vue-ui-rings-OQ8a1Ruw.cjs +2 -0
- package/dist/vue-ui-scatter-B8StSjt8.cjs +1 -0
- package/dist/{vue-ui-scatter-Dns49Nht.js → vue-ui-scatter-BwJ_koWT.js} +284 -270
- package/dist/{vue-ui-screenshot-5Gsnd0Wr.js → vue-ui-screenshot-BS3L5vhN.js} +1 -1
- package/dist/{vue-ui-screenshot---q062Kd.cjs → vue-ui-screenshot-bAVk3EPl.cjs} +1 -1
- package/dist/{vue-ui-skeleton-fVPw-oIR.cjs → vue-ui-skeleton-CMQzFTs9.cjs} +1 -1
- package/dist/{vue-ui-skeleton-B4eWLjH3.js → vue-ui-skeleton-CvFX_ExX.js} +2 -2
- package/dist/{vue-ui-smiley-B8Tyunn3.js → vue-ui-smiley-CGYZpNt9.js} +2 -2
- package/dist/{vue-ui-smiley-YfHmv0rQ.cjs → vue-ui-smiley-sF8QIso1.cjs} +1 -1
- package/dist/vue-ui-spark-trend-B4XSSKl9.js +263 -0
- package/dist/vue-ui-spark-trend-CdIoxaqb.cjs +1 -0
- package/dist/{vue-ui-sparkbar-9DBvdYn7.js → vue-ui-sparkbar-BbsJGDMZ.js} +95 -87
- package/dist/vue-ui-sparkbar-C3i1K7hi.cjs +1 -0
- package/dist/vue-ui-sparkgauge-BKyQoI7C.cjs +1 -0
- package/dist/vue-ui-sparkgauge-D4w_i_QJ.js +178 -0
- package/dist/{vue-ui-sparkhistogram-BBUVmco4.js → vue-ui-sparkhistogram-CYybrW-6.js} +79 -68
- package/dist/vue-ui-sparkhistogram-CvTYEmbz.cjs +1 -0
- package/dist/vue-ui-sparkline-CDowaDRS.cjs +1 -0
- package/dist/{vue-ui-sparkline-CeqNV6Re.js → vue-ui-sparkline-DjN1SVdO.js} +142 -123
- package/dist/{vue-ui-sparkstackbar-C3GMC1eW.js → vue-ui-sparkstackbar-BLMhJxaN.js} +120 -104
- package/dist/vue-ui-sparkstackbar-BZ2bESBi.cjs +1 -0
- package/dist/{vue-ui-stackbar-DyGPrFxi.js → vue-ui-stackbar-BTKOHUYc.js} +235 -222
- package/dist/vue-ui-stackbar-DRHaJFR8.cjs +6 -0
- package/dist/vue-ui-strip-plot-DxQxFbWg.cjs +1 -0
- package/dist/{vue-ui-strip-plot-y1AnVJmq.js → vue-ui-strip-plot-o6GTsGAT.js} +246 -232
- package/dist/{vue-ui-table-xWvAQS-s.cjs → vue-ui-table-BFIj1Rgh.cjs} +1 -1
- package/dist/{vue-ui-table-B4kfykAO.js → vue-ui-table-CnquiTpr.js} +1 -1
- package/dist/vue-ui-table-heatmap-CCGK12Fa.cjs +1 -0
- package/dist/{vue-ui-table-heatmap-YZRSzwRM.js → vue-ui-table-heatmap-CZRIwv-Q.js} +106 -95
- package/dist/{vue-ui-table-sparkline-C0v2r4Kf.js → vue-ui-table-sparkline-B3zEeq6Z.js} +151 -138
- package/dist/vue-ui-table-sparkline-DYmgfHz4.cjs +1 -0
- package/dist/{vue-ui-thermometer-D5qurIy7.js → vue-ui-thermometer-BopiohUh.js} +116 -104
- package/dist/vue-ui-thermometer-CzPRBt6c.cjs +1 -0
- package/dist/vue-ui-timer-Bonw69Lt.cjs +64 -0
- package/dist/{vue-ui-timer-VWjovnKL.js → vue-ui-timer-C7WkW8hK.js} +191 -176
- package/dist/{vue-ui-tiremarks-jH6cdQOJ.js → vue-ui-tiremarks-BurRtFv4.js} +115 -103
- package/dist/vue-ui-tiremarks-DkIGfq8t.cjs +1 -0
- package/dist/vue-ui-treemap-CalhJmnp.cjs +1 -0
- package/dist/{vue-ui-treemap-BCc5sQLB.js → vue-ui-treemap-DWy4voIr.js} +251 -237
- package/dist/{vue-ui-vertical-bar-2In_g5iC.js → vue-ui-vertical-bar-CJW1YhtY.js} +314 -299
- package/dist/vue-ui-vertical-bar-rwWp-sai.cjs +4 -0
- package/dist/{vue-ui-waffle-OzU830VX.js → vue-ui-waffle-DB7X6nTS.js} +285 -265
- package/dist/vue-ui-waffle-faQMBYNx.cjs +1 -0
- package/dist/vue-ui-wheel-BzjbGP6a.cjs +1 -0
- package/dist/vue-ui-wheel-CryKap2E.js +255 -0
- package/dist/vue-ui-word-cloud-COqUkvei.js +512 -0
- package/dist/vue-ui-word-cloud-DJN9I4q4.cjs +1 -0
- package/dist/vue-ui-xy-BmA0tspd.cjs +3 -0
- package/dist/{vue-ui-xy-DuJtYXKl.js → vue-ui-xy-b1Z_HPsx.js} +300 -274
- package/dist/{vue-ui-xy-canvas-CKibMJHh.js → vue-ui-xy-canvas-BgbLnY5B.js} +345 -327
- package/dist/vue-ui-xy-canvas-DOM2Kq_s.cjs +9 -0
- package/package.json +1 -1
- package/dist/vue-ui-3d-bar-CwCEoPX-.cjs +0 -19
- package/dist/vue-ui-age-pyramid-GqCNpd_h.cjs +0 -1
- package/dist/vue-ui-candlestick-TdNVq_FX.cjs +0 -2
- package/dist/vue-ui-carousel-table-yXUSFk2u.cjs +0 -1
- package/dist/vue-ui-chestnut-EJj-dQSY.cjs +0 -6
- package/dist/vue-ui-donut-BqUBysA_.cjs +0 -1
- package/dist/vue-ui-donut-evolution-BXtEnop4.cjs +0 -1
- package/dist/vue-ui-dumbbell-CjIh7KTm.cjs +0 -9
- package/dist/vue-ui-flow-hp0Hpuhn.js +0 -469
- package/dist/vue-ui-flow-u29zqSQj.cjs +0 -1
- package/dist/vue-ui-galaxy-DE1HbBi-.cjs +0 -1
- package/dist/vue-ui-gauge-B_IZrsfj.cjs +0 -1
- package/dist/vue-ui-gauge-CPyyn7cL.js +0 -488
- package/dist/vue-ui-gizmo-DR4gacOL.cjs +0 -1
- package/dist/vue-ui-heatmap-DMB_eUpA.cjs +0 -1
- package/dist/vue-ui-kpi-BAxAY13T.js +0 -84
- package/dist/vue-ui-kpi-BD21xshi.cjs +0 -1
- package/dist/vue-ui-molecule-BNsWckH-.cjs +0 -1
- package/dist/vue-ui-mood-radar-BsWE1f8R.cjs +0 -1
- package/dist/vue-ui-nested-donuts-CYyUtXs2.cjs +0 -17
- package/dist/vue-ui-onion-D7TXJu5w.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-BqZB7xKn.cjs +0 -8
- package/dist/vue-ui-quadrant-BPDTvxlT.cjs +0 -1
- package/dist/vue-ui-quick-chart-C_-ut0if.cjs +0 -15
- package/dist/vue-ui-radar-C5Kq19hg.cjs +0 -1
- package/dist/vue-ui-relation-circle-4kIYttRI.js +0 -310
- package/dist/vue-ui-relation-circle-DHMHHsqY.cjs +0 -1
- package/dist/vue-ui-rings-BqPS8NKl.cjs +0 -2
- package/dist/vue-ui-scatter-BLVcdf3d.cjs +0 -1
- package/dist/vue-ui-spark-trend-Dpv6am0Z.cjs +0 -1
- package/dist/vue-ui-spark-trend-Em9OqYyG.js +0 -251
- package/dist/vue-ui-sparkbar-BuSuwQYl.cjs +0 -1
- package/dist/vue-ui-sparkgauge-BN5feBzp.js +0 -167
- package/dist/vue-ui-sparkgauge-DKtUZMv1.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-BmuusW02.cjs +0 -1
- package/dist/vue-ui-sparkline-Blzv-tIQ.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-D__WDEMv.cjs +0 -1
- package/dist/vue-ui-stackbar-DFqJ5K_q.cjs +0 -6
- package/dist/vue-ui-strip-plot-z9fjJ6Dj.cjs +0 -1
- package/dist/vue-ui-table-heatmap-CGKecjtm.cjs +0 -1
- package/dist/vue-ui-table-sparkline-CHFZG3Tg.cjs +0 -1
- package/dist/vue-ui-thermometer-DoOxxVW1.cjs +0 -1
- package/dist/vue-ui-timer-D63zHe-I.cjs +0 -64
- package/dist/vue-ui-tiremarks-Cp8YEmXh.cjs +0 -1
- package/dist/vue-ui-treemap-DJrdEFW5.cjs +0 -1
- package/dist/vue-ui-vertical-bar-BfJJqN_z.cjs +0 -4
- package/dist/vue-ui-waffle-A2gmRbq0.cjs +0 -1
- package/dist/vue-ui-wheel-C9QXzWu1.js +0 -242
- package/dist/vue-ui-wheel-DGSh9VKq.cjs +0 -1
- package/dist/vue-ui-word-cloud-C2ZaVlfO.js +0 -498
- package/dist/vue-ui-word-cloud-DPFB1MYk.cjs +0 -1
- package/dist/vue-ui-xy-C-2-aijE.cjs +0 -3
- package/dist/vue-ui-xy-canvas-D7wf3xab.cjs +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("./index-BTgtr0F8.cjs"),c=require("./useResponsive-B3TrDDIG.cjs"),Ze=require("./Tooltip-DScSrYXJ.cjs"),Ge=require("./Legend-DgFd-O0m.cjs"),je=require("./Title-3EduyW4p.cjs"),Je=require("./Slicer-DaZgCKV7.cjs"),ze=require("./usePrinter-DzTaA1eh.cjs"),Ke=require("./vue-ui-accordion-7e4Myhcg.cjs"),Qe=require("./DataTable-CsNozyz7.cjs"),et=require("./vue-ui-skeleton-CMQzFTs9.cjs"),$e=require("./useNestedProp-CisbRRo_.cjs"),tt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),at=["id"],lt=["onClick"],ot={key:2,class:"vue-data-ui-watermark"},rt=["innerHTML"],ut={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(J,{expose:Te,emit:Me}){const P=J,{vue_ui_xy_canvas:Pe}=n.useConfig(),U=a.ref(n.createUid()),D=a.ref(null),C=a.ref(null),E=a.ref(null),i=a.ref(null),g=a.ref(1),z=a.ref(1),_=a.ref(!1),f=a.ref(null),H=a.ref(""),K=a.ref(null),k=a.ref([]),I=a.ref(1),R=a.ref(!0),w=a.ref(!0),X=a.ref(null),Q=a.ref(0),ee=a.ref(0),A=a.ref(!1),te=a.ref(null),ae=a.ref(null),le=a.ref(null),oe=a.ref(0),re=a.ref(0),ue=a.ref(0),Z=a.computed(()=>!!P.dataset&&P.dataset.length),t=a.computed({get:()=>ne(),set:e=>e});function ne(){const e=$e.useNestedProp({userConfig:P.config,defaultConfig:Pe});return e.theme?{...$e.useNestedProp({userConfig:n.themes.vue_ui_xy_canvas[e.theme]||P.config,defaultConfig:e}),customPalette:n.themePalettes[e.theme]||n.palette}:e}a.watch(()=>P.config,e=>{t.value=ne(),pe(),oe.value+=1,re.value+=1,ue.value+=1},{deep:!0});const se=a.ref(t.value.style.chart.aspectRatio),{isPrinting:ie,isImaging:ve,generatePdf:ce,generateImage:de}=ze.usePrinter({elementId:`xy_canvas_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),s=a.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Re(e){A.value=e,ee.value+=1}const he=a.computed(()=>n.convertCustomPalette(t.value.customPalette)),$=a.computed(()=>N.value?Math.max(...N.value.filter((e,o)=>!k.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),l=a.computed(()=>{const e=g.value-g.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:g.value,canvasHeight:z.value,left:g.value*t.value.style.chart.paddingProportions.left,top:z.value*t.value.style.chart.paddingProportions.top,right:g.value-g.value*t.value.style.chart.paddingProportions.right,bottom:z.value-z.value*t.value.style.chart.paddingProportions.bottom,width:e,height:z.value-z.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(u.value.end-u.value.start)}});function fe(e,o){return e/o}function Ie({hasAutoScale:e,series:o,min:r,max:d,scale:h,yOffset:p,individualHeight:v,stackIndex:m=null}){return o.map((L,j)=>{const S=h.min<0?Math.abs(h.min):0,T=fe(L+S,S+h.max);let M,O;e&&(M=Math.abs(h.min),O=fe(L+M,h.max+M));let B=0;return m===null?B=l.value.bottom-l.value.height*(e?O:T):B=l.value.bottom-p-v*(e?O:T),{x:l.value.left+l.value.slot*j+l.value.slot/2,y:B,value:L}})}const b=a.computed(()=>{const e=Math.min(...N.value.filter((v,m)=>!k.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(u.value.start,u.value.end))),o=Math.max(...N.value.filter((v,m)=>!k.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(u.value.start,u.value.end))),r=n.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),d=r.min<0?Math.abs(r.min):0,h=l.value.bottom-l.value.height*(d/(r.max+d)),p=r.ticks.map(v=>({y:l.value.bottom-l.value.height*((v+d)/(r.max+d)),x:l.value.left-8,value:v}));return{absoluteMin:d,max:o,min:e,scale:r,yLabels:p,zero:h}}),Ne=a.computed(()=>y.value.map(e=>`
|
|
2
|
+
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
|
|
3
|
+
<svg viewBox="0 0 10 10" height="12" width="12">
|
|
4
|
+
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
|
|
5
|
+
</svg>
|
|
6
|
+
<span>${e.name?e.name+": ":""}</span>
|
|
7
|
+
<span>${n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.series[f.value],n.dataLabel({p:e.prefix||"",v:e.series[f.value],s:e.suffix||"",r:e.rounding||0}),{datapoint:e,seriesIndex:f.value})}</span>
|
|
8
|
+
</div>
|
|
9
|
+
`)),N=a.computed(()=>P.dataset.map((e,o)=>({...e,series:n.sanitizeArray(e.series),absoluteIndex:o,color:n.convertColorToHex(e.color||he.value[o]||n.palette[o]||n.palette[o%n.palette.length])})));a.watch($,e=>{e&&ye()});const y=a.computed(()=>n.assignStackRatios(N.value.filter((e,o)=>!k.value.includes(e.absoluteIndex))).map((e,o)=>({...e,series:e.series.slice(u.value.start,u.value.end)})).map((e,o)=>{let r=Math.min(...e.series)||0,d=Math.max(...e.series)||1;r===d&&(r=r>=0?d-1:r,d=d>=0?d:r+1);const p={ratios:e.series.filter(F=>![null,void 0].includes(F)).map(F=>(F-r)/(d-r)),valueMin:r,valueMax:d},v=e.scaleSteps||t.value.style.chart.scale.ticks;let m;e.autoScaling?m=n.calculateNiceScale(p.valueMin,p.valueMax,v):m=n.calculateNiceScale(p.valueMin<0?p.valueMin:0,p.valueMax<=0?0:p.valueMax,v);const L=s.value.stacked?l.value.height*(1-e.cumulatedStackRatio):0,j=s.value.stacked?l.value.height/t.value.style.chart.stackGap:0,S=s.value.stacked?l.value.height*e.stackRatio-j:l.value.height,T=m.min<0?Math.abs(m.min):0;let M;e.autoScaling&&s.value.stacked&&d<=0?M=l.value.bottom-L-S:M=l.value.bottom-L-S*(T/(m.max+T));const O=m.ticks.map((F,Ae)=>({y:l.value.bottom-L-S*(Ae/(m.ticks.length-1)),x:l.value.left-8,value:F})),B=Ie({hasAutoScale:s.value.stacked&&e.autoScaling,series:e.series,min:s.value.stacked?r:b.value.min,max:s.value.stacked?d:b.value.max,scale:s.value.stacked?m:b.value.scale,yOffset:L,individualHeight:S,stackIndex:s.value.stacked?o:null});return{...e,coordinatesLine:B,min:r,max:d,localScale:m,localZero:M,localMin:T,localYLabels:O,yOffset:L,individualHeight:S}})),u=a.ref({start:0,end:$.value});function ye(){u.value={start:0,end:$.value},Q.value+=1}const Ee=a.computed(()=>y.value.filter(e=>["line","plot",void 0].includes(e.type))),x=a.computed(()=>y.value.filter(e=>e.type==="bar"));function Oe(){if(!C.value)return;const e=E.value.offsetWidth,o=E.value.offsetHeight;C.value.width=e*I.value*2,C.value.height=o*I.value*2,g.value=e*I.value*2,z.value=o*I.value*2,i.value.scale(I.value,I.value),G()}function Be(){if(i.value.fillStyle=t.value.style.chart.backgroundColor,i.value.fillRect(0,0,l.value.canvasWidth,l.value.canvasHeight),s.value.stacked)t.value.style.chart.grid.y.verticalLines.show&&u.value.end-u.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength&&y.value.forEach(e=>{for(let o=0;o<u.value.end-u.value.start+1;o+=1)c.line(i.value,[{x:l.value.left+l.value.slot*o,y:l.value.bottom-e.yOffset-e.individualHeight},{x:l.value.left+l.value.slot*o,y:l.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.y.verticalLines.color})}),t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?y.value.forEach(e=>{e.localYLabels.forEach((o,r)=>{r<e.localYLabels.length-1&&c.rect(i.value,[{x:l.value.left,y:o.y},{x:l.value.right,y:o.y},{x:l.value.right,y:e.localYLabels[r+1].y},{x:l.value.left,y:e.localYLabels[r+1].y}],{fillColor:r%2===0?"transparent":t.value.style.chart.grid.x.horizontalLines.color+n.opacity[t.value.style.chart.grid.x.horizontalLines.opacity],strokeColor:"transparent"})})}):y.value.forEach(e=>{e.localYLabels.slice(u.value.start,u.value.end).forEach(o=>{c.line(i.value,[{x:l.value.left,y:o.y},{x:l.value.right,y:o.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})})),t.value.style.chart.grid.zeroLine.show&&y.value.forEach(e=>{c.line(i.value,[{x:l.value.left,y:e.localZero},{x:l.value.right,y:e.localZero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]})}),t.value.style.chart.grid.y.axisLabels.show&&y.value.forEach(e=>{c.line(i.value,[{x:l.value.left,y:l.value.bottom-e.yOffset},{x:l.value.left,y:l.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),c.line(i.value,[{x:l.value.right,y:l.value.bottom-e.yOffset},{x:l.value.right,y:l.value.bottom-e.yOffset-e.individualHeight}],{color:e.color}),e.localYLabels.forEach((o,r)=>{c.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,o.value,n.dataLabel({p:e.prefix||t.value.style.chart.grid.y.axisLabels.prefix||"",v:o.value,s:e.suffix||t.value.style.chart.grid.y.axisLabels.suffix||"",r:e.rounding||t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:o,seriesIndex:r}),o.x+t.value.style.chart.grid.y.axisLabels.offsetX,o.y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:e.color})})}),y.value.forEach(e=>{c.text(i.value,e.name,g.value/35,l.value.bottom-e.yOffset-e.individualHeight/2,{align:"center",rotation:-90,color:e.color,font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`})});else{if(t.value.style.chart.grid.y.verticalLines.show&&u.value.end-u.value.start<t.value.style.chart.grid.y.verticalLines.hideUnderXLength)for(let e=0;e<u.value.end-u.value.start+1;e+=1)c.line(i.value,[{x:l.value.left+l.value.slot*e,y:l.value.top},{x:l.value.left+l.value.slot*e,y:l.value.bottom}],{color:t.value.style.chart.grid.y.verticalLines.color});t.value.style.chart.grid.x.horizontalLines.show&&(t.value.style.chart.grid.x.horizontalLines.alternate?b.value.yLabels.forEach((e,o)=>{o<b.value.yLabels.length-1&&c.rect(i.value,[{x:l.value.left,y:e.y},{x:l.value.right,y:e.y},{x:l.value.right,y:b.value.yLabels[o+1].y},{x:l.value.left,y:b.value.yLabels[o+1].y}],{fillColor:o%2===0?"transparent":t.value.style.chart.grid.x.horizontalLines.color+n.opacity[t.value.style.chart.grid.x.horizontalLines.opacity],strokeColor:"transparent"})}):b.value.yLabels.forEach(e=>{c.line(i.value,[{x:l.value.left,y:e.y},{x:l.value.right,y:e.y}],{color:t.value.style.chart.grid.x.horizontalLines.color})})),t.value.style.chart.grid.y.showAxis&&c.line(i.value,[{x:l.value.left,y:l.value.top},{x:l.value.left,y:l.value.bottom}],{color:t.value.style.chart.grid.y.axisColor,lineWidth:t.value.style.chart.grid.y.axisThickness}),t.value.style.chart.grid.x.showAxis&&c.line(i.value,[{x:l.value.left,y:l.value.bottom},{x:l.value.right,y:l.value.bottom}],{color:t.value.style.chart.grid.x.axisColor,lineWidth:t.value.style.chart.grid.x.axisThickness}),t.value.style.chart.grid.zeroLine.show&&c.line(i.value,[{x:l.value.left,y:b.value.zero},{x:l.value.right,y:b.value.zero}],{color:t.value.style.chart.grid.zeroLine.color,lineDash:t.value.style.chart.grid.zeroLine.dashed?[10,10]:[0,0]}),t.value.style.chart.grid.y.axisLabels.show&&b.value.yLabels.forEach((e,o)=>{c.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.value,n.dataLabel({p:t.value.style.chart.grid.y.axisLabels.prefix||"",v:e.value,s:t.value.style.chart.grid.y.axisLabels.suffix||"",r:t.value.style.chart.grid.y.axisLabels.rounding||0}),{datapoint:e,seriesIndex:o}),e.x+t.value.style.chart.grid.y.axisLabels.offsetX,e.y,{align:"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.axisLabels.color})})}t.value.style.chart.grid.y.axisName&&c.text(i.value,t.value.style.chart.grid.y.axisName,g.value-g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio*1.2,l.value.bottom-l.value.height/2,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center",rotation:90}),t.value.style.chart.grid.x.axisName&&c.text(i.value,t.value.style.chart.grid.x.axisName,g.value/2,z.value,{font:`${Math.round(g.value/40*t.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.color,align:"center"})}function Fe(e){for(let o=0;o<e.coordinatesLine.length;o+=1){const r=(f.value===o?g.value/150:t.value.style.chart.line.plots.show?g.value/200:0)*t.value.style.chart.line.plots.radiusRatio;c.circle(i.value,{x:e.coordinatesLine[o].x,y:e.coordinatesLine[o].y},r,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}}function De(e){for(let o=0;o<e.coordinatesLine.length;o+=1)c.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[o].value,n.dataLabel({p:e.prefix||"",v:e.coordinatesLine[o].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[o],seriesIndex:o}),e.coordinatesLine[o].x,e.coordinatesLine[o].y+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(g.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})}function _e(){for(let e=u.value.start;e<u.value.end;e+=1)(u.value.end-u.value.start<t.value.style.chart.grid.y.timeLabels.modulo||u.value.end-u.value.start>=t.value.style.chart.grid.y.timeLabels.modulo&&(e%Math.floor((u.value.end-u.value.start)/t.value.style.chart.grid.y.timeLabels.modulo)===0||e===f.value+u.value.start))&&c.text(i.value,t.value.style.chart.grid.y.timeLabels.values[e]||e+1,l.value.left+l.value.slot*(e-u.value.start)+l.value.slot/2,l.value.bottom+g.value/t.value.style.chart.grid.y.timeLabels.offsetY,{align:t.value.style.chart.grid.y.timeLabels.rotation===0?"center":t.value.style.chart.grid.y.timeLabels.rotation>0?"left":"right",font:`${Math.round(g.value/40*t.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.grid.y.timeLabels.color+n.opacity[f.value!==null?f.value+u.value.start===e?100:20:100],rotation:t.value.style.chart.grid.y.timeLabels.rotation})}function ge(){c.line(i.value,[{x:l.value.left+l.value.slot*f.value+l.value.slot/2,y:l.value.top},{x:l.value.left+l.value.slot*f.value+l.value.slot/2,y:l.value.bottom}],{color:t.value.style.chart.selector.color,lineDash:t.value.style.chart.selector.dashed?[8,8]:[0,0],lineWidth:2,linceCap:"round"})}function He(){x.value.forEach((e,o)=>{for(let r=0;r<e.coordinatesLine.length;r+=1)c.rect(i.value,[{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o)),y:s.value.stacked?e.localZero:b.value.zero},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.8/(s.value.stacked?1:x.value.length),y:s.value.stacked?e.localZero:b.value.zero},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.8/(s.value.stacked?1:x.value.length),y:e.coordinatesLine[r].y},{x:l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o)),y:e.coordinatesLine[r].y}],{strokeColor:t.value.style.chart.backgroundColor,gradient:{type:"linear",start:{x:e.coordinatesLine[r].x,y:e.coordinatesLine[r].y},end:{x:e.coordinatesLine[r].x,y:s.value.stacked?e.localZero:b.value.zero},stops:[{offset:0,color:e.color},{offset:1,color:n.lightenHexColor(e.color,.5)}]}}),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&c.text(i.value,n.applyDataLabel(t.value.style.chart.dataLabels.formatter,e.coordinatesLine[r].value,n.dataLabel({p:e.prefix||"",v:e.coordinatesLine[r].value,s:e.suffix||"",r:e.rounding||0}),{datapoint:e.coordinatesLine[r],seriesIndex:r}),l.value.left+l.value.slot*r+l.value.slot/10+(s.value.stacked?0:l.value.slot/x.value.length*o-(o===0?0:l.value.slot/(5*x.value.length)*o))+l.value.slot*.4/(s.value.stacked?1:x.value.length),(e.coordinatesLine[r].value<0?s.value.stacked?e.localZero:b.value.zero:e.coordinatesLine[r].y)+t.value.style.chart.dataLabels.offsetY,{align:"center",font:`${Math.round(g.value/40*t.value.style.chart.dataLabels.fontSizeRatio)}px ${t.value.style.fontFamily}`,color:t.value.style.chart.dataLabels.useSerieColor?e.color:t.value.style.chart.dataLabels.color,strokeColor:t.value.style.chart.backgroundColor,lineWidth:.8})})}function We(e){e.useArea?s.value.stacked?c.polygon(i.value,[{x:e.coordinatesLine[0].x,y:e.localZero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:e.localZero}],{fillColor:e.color+n.opacity[t.value.style.chart.area.opacity],strokeColor:"transparent"}):c.polygon(i.value,[{x:e.coordinatesLine[0].x,y:b.value.zero},...e.coordinatesLine,{x:e.coordinatesLine.at(-1).x,y:b.value.zero}],{fillColor:e.color+n.opacity[t.value.style.chart.area.opacity],strokeColor:"transparent"}):c.line(i.value,e.coordinatesLine,{color:e.color,lineWidth:3})}function qe(){y.value.forEach((e,o)=>{c.line(i.value,[{x:l.value.left,y:l.value.bottom-e.yOffset},{x:l.value.right,y:l.value.bottom-e.yOffset}],{color:t.value.style.chart.grid.x.horizontalLines.color,lineWidth:1})})}function G(){Be(),R.value?(w.value&&f.value!==null&&t.value.style.chart.selector.show&&ge(),He(),s.value.stacked&&t.value.style.chart.grid.x.showAxis&&qe(),Ee.value.forEach(e=>{(e.type==="line"||!e.type)&&We(e),w.value&&(Fe(e),s.value.showDataLabels&&[!0,void 0].includes(e.dataLabels)&&De(e))}),X.value=c.cloneCanvas(C.value)):(X.value&&i.value.drawImage(X.value,0,0),w.value&&f.value!==null&&t.value.style.chart.selector.show&&ge(),w.value&&f.value!==null&&y.value.forEach(e=>{if(e.type==="line"||!e.type||e.type==="plot"){if(!e.coordinatesLine[f.value])return;e.coordinatesLine[f.value].x!==void 0&&e.coordinatesLine[f.value].y!==void 0&&c.circle(i.value,{x:e.coordinatesLine[f.value].x,y:e.coordinatesLine[f.value].y},g.value/150*t.value.style.chart.line.plots.radiusRatio,{color:t.value.style.chart.backgroundColor,fillStyle:e.color,strokeColor:"transparent"})}})),t.value.style.chart.grid.y.timeLabels.show&&_e(),R.value=!1}const W=c.debounce(()=>{w.value=!0,Oe()},$.value>200?10:1,!w.value);function Ve(e){const{left:o}=C.value.getBoundingClientRect(),r=e.clientX-o;if(r*2<l.value.left||r*2>l.value.right){_.value=!1,f.value=null;return}const d=r*2-l.value.left;if(f.value=Math.floor(d/l.value.slot),_.value=!0,!w.value)return;let h="";const p=t.value.style.chart.tooltip.customFormat;n.isFunction(p)&&n.functionReturnsString(()=>p({seriesIndex:f.value,datapoint:y.value.map(v=>({shape:v.shape||null,name:v.name,color:v.color,type:v.type||"line",value:v.series.find((m,L)=>L===f.value)})),series:y.value,config:t.value}))?H.value=p({seriesIndex:f.value,datapoint:y.value.map(v=>({shape:v.shape||null,name:v.name,color:v.color,type:v.type||"line",value:v.series.find((m,L)=>L===f.value)})),series:y.value,config:t.value}):(t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[f.value]&&(h+=`<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; width:100%">${t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[f.value]}</div>`),h+=Ne.value.join(""),H.value=h),w.value=!1}a.watch(()=>f.value,e=>{W()}),a.watch(()=>u.value,e=>{R.value=!0,G()},{deep:!0}),a.watch(()=>s.value.showDataLabels,e=>{R.value=!0,G()}),a.watch(()=>s.value.stacked,e=>{R.value=!0,w.value=!0,W()});function Ye(){_.value=!1,f.value=null,H.value=""}const q=a.ref(null),V=a.ref(null);a.onMounted(()=>{pe()});function pe(){if(n.objectIsEmpty(P.dataset)?n.error({componentName:"VueUiXyCanvas",type:"dataset"}):C.value&&(i.value=C.value.getContext("2d",{willReadFrequently:!0})),t.value.responsive){const e=c.throttle(()=>{const{width:o,height:r}=c.useResponsive({chart:D.value,title:t.value.style.chart.title.text?te.value:null,legend:t.value.style.chart.legend.show?ae.value:null,slicer:t.value.style.chart.zoom.show&&$.value>1?le.value:null});se.value=`${o} / ${r}`});q.value=new ResizeObserver(e),q.value.observe(D.value.parentNode)}V.value=new ResizeObserver(e=>{for(const o of e)o.contentBoxSize&&E.value&&(R.value=!0,W())}),V.value.observe(E.value)}a.onBeforeUnmount(()=>{V.value&&V.value.disconnect(),q.value&&q.value.disconnect()});function me(e){Me("selectLegend",y.value.find(o=>o.absoluteIndex===e)),k.value.includes(e)?k.value=k.value.filter(o=>o!==e):k.value.push(e),R.value=!0,W()}const be=a.computed(()=>N.value.map((e,o)=>({...e,name:e.name,color:n.convertColorToHex(e.color)||he.value[o]||n.palette[o]||n.palette[o%n.palette.length],shape:e.shape||"circle",prefix:e.prefix||"",suffix:e.suffix||"",rounding:e.rounding||0})).map(e=>({...e,opacity:k.value.includes(e.absoluteIndex)?.5:1,segregate:()=>me(e.absoluteIndex),isSegregated:k.value.includes(e.absoluteIndex)}))),Ue=a.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),Y=a.computed(()=>{const e=[""].concat(y.value.map(h=>h.name)).concat(' <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>');let o=[];for(let h=0;h<$.value;h+=1){const p=y.value.map(v=>v.series[h]??0).reduce((v,m)=>v+m,0);o.push([t.value.style.chart.grid.y.timeLabels.values.slice(u.value.start,u.value.end)[h]??h+1].concat(y.value.map(v=>(v.series[h]??0).toFixed(t.value.table.rounding))).concat((p??0).toFixed(t.value.table.rounding)))}const r={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},d=[t.value.table.columnNames.period].concat(y.value.map(h=>h.name)).concat(t.value.table.columnNames.total);return{head:e,body:o.slice(0,u.value.end-u.value.start),config:r,colNames:d}}),xe=a.computed(()=>{if(y.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const e=y.value.map(r=>({label:r.name,color:r.color,type:r.type})),o=[];for(let r=u.value.start;r<u.value.end;r+=1){const d=[t.value.style.chart.grid.y.timeLabels.values[r]||r+1];y.value.forEach(h=>{d.push(Number((h.series[r]||0).toFixed(t.value.table.rounding)))}),o.push(d)}return{head:e,body:o}});function Le(){const e=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=["",...xe.value.head.map(p=>p.label)],r=xe.value.body,d=e.concat([o]).concat(r),h=n.createCsvContent(d);n.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-xy-canvas"})}function Xe(){return y.value}function ke(){s.value.showTable=!s.value.showTable}function Ce(){s.value.showDataLabels=!s.value.showDataLabels}function we(){s.value.stacked=!s.value.stacked}function Se(){s.value.showTooltip=!s.value.showTooltip}return Te({getData:Xe,generateCsv:Le,generatePdf:ce,generateImage:de,toggleTable:ke,toggleLabels:Ce,toggleStack:we,toggleTooltip:Se}),(e,o)=>(a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(`width:100%; position: relative;${t.value.responsive?"height: 100%":""}`),ref_key:"xy",ref:D,id:`xy_canvas_${U.value}`,class:a.normalizeClass(`vue-ui-donut ${A.value?"vue-data-ui-wrapper-fullscreen":""}`)},[t.value.style.chart.title.text?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:te,style:a.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};`)},[(a.openBlock(),a.createBlock(je._sfc_main,{key:`title_${oe.value}`,config:{title:{cy:"xy-canvas-title",...t.value.style.chart.title},subtitle:{cy:"xy-canvas-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):a.createCommentVNode("",!0),t.value.userOptions.show&&Z.value?(a.openBlock(),a.createBlock(ze.UserOptions,{ref:"details",key:`user_option_${ee.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:a.unref(ie),isImaging:a.unref(ve),uid:U.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,hasLabel:t.value.userOptions.buttons.labels,hasStack:J.dataset.length>1&&t.value.userOptions.buttons.stack,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasTable:u.value.end-u.value.start<200&&t.value.userOptions.buttons.table,isFullscreen:A.value,isTooltip:s.value.showTooltip,isStacked:s.value.stacked,titles:{...t.value.userOptions.buttonTitles},chartElement:D.value,onToggleFullscreen:Re,onGeneratePdf:a.unref(ce),onGenerateCsv:Le,onGenerateImage:a.unref(de),onToggleTable:ke,onToggleLabels:Ce,onToggleStack:we,onToggleTooltip:Se},a.createSlots({_:2},[e.$slots.optionTooltip?{name:"optionTooltip",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,e.$slots.optionPdf?{name:"optionPdf",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,e.$slots.optionCsv?{name:"optionCsv",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,e.$slots.optionImg?{name:"optionImg",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,e.$slots.optionTable?{name:"optionTable",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,e.$slots.optionLabels?{name:"optionLabels",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,e.$slots.optionStack?{name:"optionStack",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"optionStack",{},void 0,!0)]),key:"6"}:void 0,e.$slots.optionFullscreen?{name:"optionFullscreen",fn:a.withCtx(({toggleFullscreen:r,isFullscreen:d})=>[a.renderSlot(e.$slots,"optionFullscreen",a.normalizeProps(a.guardReactiveProps({toggleFullscreen:r,isFullscreen:d})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasLabel","hasStack","hasFullscreen","hasTable","isFullscreen","isTooltip","isStacked","titles","chartElement","onGeneratePdf","onGenerateImage"])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"vue-ui-xy-canvas",style:a.normalizeStyle(`position: relative; aspect-ratio: ${se.value}`),ref_key:"container",ref:E},[Z.value?(a.openBlock(),a.createElementBlock("canvas",{key:0,ref_key:"canvas",ref:C,style:{width:"100%",height:"100%"},onMousemove:o[0]||(o[0]=r=>Ve(r)),onMouseleave:Ye},null,544)):(a.openBlock(),a.createBlock(et.default,{key:1,config:{type:"line",style:{backgroundColor:t.value.style.chart.backgroundColor,line:{axis:{color:"#CCCCCC"},path:{color:"#CCCCCC",strokeWidth:.5}}}}},null,8,["config"])),a.createVNode(Ze._sfc_main,{show:s.value.showTooltip&&_.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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:H.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,isCustom:a.unref(n.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":a.withCtx(()=>[a.renderSlot(e.$slots,"tooltip-before",a.normalizeProps(a.guardReactiveProps({...K.value})),void 0,!0)]),"tooltip-after":a.withCtx(()=>[a.renderSlot(e.$slots,"tooltip-after",a.normalizeProps(a.guardReactiveProps({...K.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","position","offsetY","parent","content","backgroundOpacity","isCustom"])],4),a.createElementVNode("div",{ref_key:"chartSlicer",ref:le,style:a.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&$.value>1?(a.openBlock(),a.createBlock(Je.Slicer,{key:`slicer_${Q.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.y.timeLabels.values[u.value.start]?t.value.style.chart.grid.y.timeLabels.values[u.value.start]:"",labelRight:t.value.style.chart.grid.y.timeLabels.values[u.value.end-1]?t.value.style.chart.grid.y.timeLabels.values[u.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:$.value,min:0,valueStart:u.value.start,valueEnd:u.value.end,start:u.value.start,"onUpdate:start":o[1]||(o[1]=r=>u.value.start=r),end:u.value.end,"onUpdate:end":o[2]||(o[2]=r=>u.value.end=r),onReset:ye},{"reset-action":a.withCtx(({reset:r})=>[a.renderSlot(e.$slots,"reset-action",a.normalizeProps(a.guardReactiveProps({reset:r})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):a.createCommentVNode("",!0)],4),a.createElementVNode("div",{ref_key:"chartLegend",ref:ae},[t.value.style.chart.legend.show&&Z.value?(a.openBlock(),a.createBlock(Ge.Legend,{legendSet:be.value,config:Ue.value,key:`legend_${ue.value}`,onClickMarker:o[3]||(o[3]=({i:r})=>me(r))},{item:a.withCtx(({legend:r,index:d})=>[a.createElementVNode("div",{onClick:h=>r.segregate(),style:a.normalizeStyle(`opacity:${k.value.includes(d)?.5:1}`)},a.toDisplayString(r.name),13,lt)]),_:1},8,["legendSet","config"])):a.renderSlot(e.$slots,"legend",{key:1,legend:be.value},void 0,!0)],512),e.$slots.watermark?(a.openBlock(),a.createElementBlock("div",ot,[a.renderSlot(e.$slots,"watermark",a.normalizeProps(a.guardReactiveProps({isPrinting:a.unref(ie)||a.unref(ve)})),void 0,!0)])):a.createCommentVNode("",!0),u.value.end-u.value.start<200?(a.openBlock(),a.createBlock(Ke.default,{key:3,hideDetails:"",config:{open:s.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:a.withCtx(()=>[(a.openBlock(),a.createBlock(Qe.DataTable,{key:`table_${re.value}`,colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.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[4]||(o[4]=r=>s.value.showTable=!1)},{th:a.withCtx(({th:r})=>[a.createElementVNode("div",{innerHTML:r},null,8,rt)]),td:a.withCtx(({td:r})=>[a.createTextVNode(a.toDisplayString(r),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):a.createCommentVNode("",!0)],14,at))}},nt=tt._export_sfc(ut,[["__scopeId","data-v-24379a68"]]);exports.default=nt;
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-D_32ZGWd.cjs"),se=require("./Title-D5cATWsL.cjs"),Z=require("./usePrinter-BouFNHWR.cjs"),ue=require("./vue-ui-skeleton-fVPw-oIR.cjs"),ie=require("./DataTable-BNFSPjhv.cjs"),ce=require("./vue-ui-accordion-Cka6b_Up.cjs"),Y=require("./useNestedProp-BvvH633N.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),P=N=>(e.pushScopeId("data-v-06e93dd9"),N=N(),e.popScopeId(),N),he=["id"],ve=["xmlns","viewBox"],pe=["id"],fe=["stop-color"],ke=["stop-color"],me=["id"],ye=["stop-color"],ge=["stop-color"],$e=["id"],_e=["stop-color"],xe=["stop-color"],Be=["id"],be=["stop-color"],Ce=["stop-color"],Ee=["stop-color"],we={key:0},Ne=["id"],Ve=["stop-color"],Fe=["stop-color"],Me=["id"],Se=["stop-color"],De=["stop-color"],Pe=["id"],Le=["stop-color"],Te=["stop-color"],ze=["id"],je=P(()=>e.createElementVNode("stop",{offset:"0%","stop-color":"#FFFFFF"},null,-1)),Oe=P(()=>e.createElementVNode("stop",{offset:"100%","stop-color":"#FFFFFF33"},null,-1)),He=[je,Oe],Ie=["x","y","font-size","font-weight","fill"],We=["x","y"],Ge=["d","stroke"],Ae=["d","stroke"],qe={key:3},Ue={key:0},Xe=["stroke-dasharray","d","stroke","stroke-width"],Re=["stroke-dasharray","d","stroke","stroke-width"],Ze=["stroke-dasharray","d","stroke","stroke-width"],Ye=["stroke-dasharray","d","stroke","stroke-width"],Je={key:1},Ke=["d","stroke","stroke-width","fill"],Qe=["d","stroke","stroke-width","fill"],et=["d","stroke","stroke-width","fill"],tt={key:2},lt=["d","fill","onMouseenter","onClick"],ot=["d","fill","onMouseenter","onClick"],rt=["d","fill","onMouseenter","onClick"],nt=["d","onMouseenter","onClick"],at=["d"],st=["d","stroke"],ut=["onClick"],it=["stroke","d"],ct=["cx","cy","fill","stroke"],dt=["x","y","width","height"],ht={key:1},vt=["d","stroke"],pt=["d","fill","stroke"],ft=["id"],kt=["stop-color"],mt=P(()=>e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF20"},null,-1)),yt=["stop-color"],gt=["cx","cy","fill"],$t=["cx","cy","fill"],_t={key:0},xt=["text-anchor","x","y","fill","font-size"],Bt=["text-anchor","x","y","fill","font-size"],bt={key:2},Ct=["d","fill","stroke"],Et={key:4},wt={key:0},Nt=["stroke-dasharray","d","stroke","stroke-width"],Vt=["stroke-dasharray","d","stroke","stroke-width"],Ft=["stroke-dasharray","d","stroke","stroke-width"],Mt=["stroke-dasharray","d","stroke","stroke-width"],St=["d","stroke","stroke-width","fill"],Dt=["d","stroke","stroke-width","fill"],Pt={key:1},Lt=["onClick"],Tt=["id"],zt=["stop-color"],jt=["stop-color"],Ot=["id"],Ht=["stop-color"],It=["stop-color"],Wt=["stop-color"],Gt=["stop-color"],At=["stop-color"],qt=["onMouseenter","onClick","d","fill"],Ut=["onMouseenter","onClick","d"],Xt=["onMouseenter","onClick","d","fill"],Rt=["onClick"],Zt=["stroke","d"],Yt=["cx","cy","fill","stroke"],Jt=["x","y","width","height"],Kt={key:1},Qt=["d","stroke"],el=["d","fill","stroke"],tl=["id"],ll=["stop-color"],ol=P(()=>e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF20"},null,-1)),rl=["stop-color"],nl=["cx","cy","fill"],al=["cx","cy","fill"],sl={key:0},ul=["text-anchor","x","y","fill","font-size"],il=["text-anchor","x","y","fill","font-size"],cl={key:2},dl=["d","fill","stroke"],hl={key:3,class:"vue-data-ui-watermark"},vl=["innerHTML"],pl={__name:"vue-ui-3d-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectDatapoint"],setup(N,{expose:J,emit:F}){const f=N,{vue_ui_3d_bar:K}=u.useConfig(),M=e.computed(()=>!!f.dataset&&Object.keys(f.dataset).length),m=e.ref(u.createUid()),Q=e.ref(null),z=e.ref(null),b=e.ref(!1),l=e.computed(()=>{const i=Y.useNestedProp({userConfig:f.config,defaultConfig:K});return i.theme?{...Y.useNestedProp({userConfig:u.themes.vue_ui_3d_bar[i.theme]||f.config,defaultConfig:i}),customPalette:u.themePalettes[i.theme]||u.palette}:i}),{isPrinting:j,isImaging:O,generatePdf:H,generateImage:I}=Z.usePrinter({elementId:`3d_bar_${m.value}`,fileName:l.value.style.chart.title.text||"vue-ui-3d-bar"}),ee=e.computed(()=>u.convertCustomPalette(l.value.customPalette)),S=e.ref({showTable:l.value.table.show}),$=e.computed(()=>f.dataset.series&&f.dataset.series.length),r=e.computed(()=>({height:l.value.style.chart.box.dimensions.height,width:l.value.style.chart.box.dimensions.width,absoluteWidth:l.value.style.chart.box.dimensions.width*($.value?2:1),top:l.value.style.chart.box.dimensions.top,bottom:l.value.style.chart.box.dimensions.bottom,left:l.value.style.chart.box.dimensions.left,right:l.value.style.chart.box.dimensions.right,perspective:l.value.style.chart.box.dimensions.perspective})),g=e.computed(()=>{if($.value){const i=f.dataset.series.map(o=>o.value||0).reduce((o,a)=>o+a,0),n=f.dataset.series.map((o,a)=>({...o,id:u.createUid(),proportion:(o.value||0)/i,color:u.convertColorToHex(o.color)||ee.value[a]||u.palette[a]||u.palette[a%u.palette.length],breakdown:o.breakdown?o.breakdown.sort((s,p)=>p.value-s.value):null})).sort((o,a)=>a.value-o.value),t=[];let c=0;for(let o=0;o<n.length;o+=1)t.push({...n[o],fill:te(c,n[o].proportion,n[o].breakdown,n[o].color)}),c+=n[o].proportion;return t}return null}),x=e.computed(()=>({right:`M${r.value.width/2},${r.value.top} ${r.value.width-r.value.right}, ${r.value.top+r.value.perspective} ${r.value.width-r.value.right},${r.value.height-r.value.bottom-r.value.perspective} ${r.value.width/2},${r.value.height-r.value.bottom}`,left:`M${r.value.width/2},${r.value.top} ${r.value.left},${r.value.top+r.value.perspective} ${r.value.left},${r.value.height-r.value.bottom-r.value.perspective} ${r.value.width/2},${r.value.height-r.value.bottom}`,side:`M${r.value.width/2},${r.value.height-r.value.bottom} ${r.value.width/2},${r.value.top+r.value.perspective*2}`,topSides:`M${r.value.left},${r.value.top+r.value.perspective} ${r.value.width/2},${r.value.top+r.value.perspective*2} ${r.value.width-r.value.right},${r.value.top+r.value.perspective}`,tubeTop:`M${r.value.left},${r.value.top+r.value.perspective} C ${r.value.left},${r.value.top-r.value.perspective/3} ${r.value.width-r.value.right},${r.value.top-r.value.perspective/3} ${r.value.width-r.value.right},${r.value.top+r.value.perspective} C ${r.value.width-r.value.right},${r.value.top+r.value.perspective*2.3} ${r.value.left},${r.value.top+r.value.perspective*2.3} ${r.value.left},${r.value.top+r.value.perspective}`,tubeLeft:`M${r.value.left},${r.value.top+r.value.perspective} ${r.value.left},${r.value.height-r.value.bottom-r.value.perspective}`,tubeRight:`M${r.value.width-r.value.right},${r.value.top+r.value.perspective} ${r.value.width-r.value.right},${r.value.height-r.value.bottom-r.value.perspective}`,tubeBottom:`M${r.value.width-r.value.right},${r.value.height-r.value.bottom-r.value.perspective} C ${r.value.width-r.value.right},${r.value.height} ${r.value.left},${r.value.height} ${r.value.left},${r.value.height-r.value.bottom-r.value.perspective}`})),E=e.ref(l.value.style.chart.animation.use?0:f.dataset.percentage);e.onMounted(()=>{u.objectIsEmpty(f.dataset)?u.error({componentName:"VueUi3dBar",type:"dataset"}):f.dataset.series?f.dataset.series.forEach((o,a)=>{u.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(s=>{u.error({componentName:"VueUi3dBar",type:"datasetSerieAttribute",property:s,index:a})}),o.breakdown&&o.breakdown.forEach((s,p)=>{u.getMissingDatasetAttributes({datasetObject:s,requiredAttributes:["name","value"]}).forEach(k=>{u.error({componentName:"VueUi3dBar",type:"datasetSerieAttribute",property:k,index:`${a} - ${p}`})})})}):u.getMissingDatasetAttributes({datasetObject:f.dataset,requiredAttributes:["percentage"]}).forEach(o=>{u.error({componentName:"VueUi3dBar",type:"datasetAttribute",property:o})});let i=0,n=l.value.style.chart.animation.speed,t=.005*l.value.style.chart.animation.acceleration;function c(){E.value+=n+i,i+=t,E.value<f.dataset.percentage?requestAnimationFrame(c):E.value=f.dataset.percentage}l.value.style.chart.animation.use&&(E.value=0,c())});function te(i,n,t,c){const o=r.value.height-r.value.bottom-r.value.top-r.value.perspective*2,{width:a,height:s,bottom:p,right:k,left:h,perspective:v}=r.value,d=p+o*i,T=s-d-v-o*n/2,re=T>r.value.height/2?"top":"bottom",q=64,ne=!!t;let U=null,X=null;return ne&&(t=t.map((R,ae)=>({...R,value:R.value||0,color:u.lightenHexColor(c,ae/t.length)})),U=u.makeDonut({series:t},a+r.value.absoluteWidth/4-14,re==="top"?T-q:T+q,28,28,1.99999,2,1,360,105.25,14),X=u.makeDonut({series:t},a-k+20,s-d-v-o*n/2,6,6,1.99999,2,1,360,105.25,6)),{donut:U,miniDonut:X,sidePointer:{x:a-k,y:s-d-v-o*n/2,topY:s-d-v-o*n,height:o*n},apexBottom:{y:s-d,x:a/2},apexTop:{y:s-d-o*n,x:a/2},right:`M${a/2},${s-d} ${a/2},${s-d-o*n} ${a-k},${s-d-v-o*n} ${a-k},${s-d-v}Z`,left:`M${a/2},${s-d} ${a/2},${s-d-o*n} ${h}, ${s-d-v-o*n} ${h},${s-d-v}Z`,liningTop:`M${h},${s-d-v-o*n} ${a/2},${s-d-o*n} ${a-k},${s-d-v-o*n}`,liningTopShade:`M${h},${s-d-v-o*n-.5} ${a/2},${s-d-o*n-.5} ${a-k},${s-d-v-o*n-.5}`,top:`M${a/2},${s-d-o*n} ${h},${s-d-v-o*n} ${a/2},${s-d-v*2-o*n} ${a-k},${s-d-v-o*n} Z`,tubeTop:`M${h},${s-d-o*n-v} C ${h},${s-d-o*n-v*2.5} ${a-k},${s-d-o*n-v*2.5} ${a-k},${s-d-o*n-v} C ${a-k},${s-d-o*n+v/2} ${h},${s-d-o*n+v/2} ${h},${s-d-o*n-v}`,bottomTubeTop:`M ${a-k-.5},${s-d-v} C ${a-k-.5},${s-d+v/2} ${h},${s-d+v/2} ${h+.5},${s-d-v}`,tubeBody:`M
|
|
2
|
-
${h},${s-d-o*n-v}
|
|
3
|
-
C ${h},${s-d-o*n+v/2}
|
|
4
|
-
${a-k},${s-d-o*n+v/2}
|
|
5
|
-
${a-k},${s-d-o*n-v}
|
|
6
|
-
L${a-k},${s-d-v}
|
|
7
|
-
C
|
|
8
|
-
${a-k},${s-d+v/2}
|
|
9
|
-
${h},${s-d+v/2}
|
|
10
|
-
${h},${s-d-v}Z`}}const V=e.computed(()=>{const i=E.value/100,n=r.value.height-r.value.bottom-r.value.top-r.value.perspective*2,{width:t,height:c,bottom:o,right:a,left:s,perspective:p}=r.value,h=o+n*0;return{right:`M${t/2},${c-h} ${t/2},${c-h-n*i} ${t-a},${c-h-p-n*i} ${t-a},${c-h-p}Z`,left:`M${t/2},${c-h} ${t/2},${c-h-n*i} ${s}, ${c-h-p-n*i} ${s},${c-h-p}Z`,top:`M${t/2},${c-h-n*i} ${s},${c-h-p-n*i} ${t/2},${c-h-p*2-n*i} ${t-a},${c-h-p-n*i} Z`,tubeTop:`M${s},${c-h-n*i-p} C ${s},${c-h-n*i-p*2.5} ${t-a},${c-h-n*i-p*2.5} ${t-a},${c-h-n*i-p} C ${t-a},${c-h-n*i+p/2} ${s},${c-h-n*i+p/2} ${s},${c-h-n*i-p}`,tubeBody:`M
|
|
11
|
-
${s},${c-h-n*i-p}
|
|
12
|
-
C ${s},${c-h-n*i+p/2}
|
|
13
|
-
${t-a},${c-h-n*i+p/2}
|
|
14
|
-
${t-a},${c-h-n*i-p}
|
|
15
|
-
L${t-a},${c-p*1.5}
|
|
16
|
-
C
|
|
17
|
-
${t-a},${c}
|
|
18
|
-
${s},${c}
|
|
19
|
-
${s},${c-h-p}Z`}}),y=e.ref(null);function _(i,n=!1){F("selectDatapoint",i),n||(y.value=i.id),n&&b.value&&(b.value=!1),n&&!b.value&&(b.value=!0)}function C(){b.value||(y.value=null)}function w(i,n,t=!1){const c=f.dataset.series.map(s=>s.value||0).reduce((s,p)=>s+p,0),o=isNaN(i.value/c)?0:i.value/c*100,a=isNaN(i.value/W(n))?0:i.value/W(n)*100;return t?a:o.toFixed(0)+"%"}function W(i){return[...i].map(n=>n.value).reduce((n,t)=>n+t,0)}const L=e.ref(!1);function le(i){L.value=i}function oe(){return $.value?g.value:f.dataset.percentage}const B=e.computed(()=>{if($.value){const i=g.value.flatMap(t=>t.breakdown&&t.breakdown.length?[{name:t.name,color:t.color},...t.breakdown.map((c,o)=>({name:c.name,color:u.lightenHexColor(t.color,o/t.breakdown.length)}))]:{name:t.name,color:t.color}),n=g.value.flatMap(t=>t.breakdown&&t.breakdown.length?[t.value,...t.breakdown.map(c=>c.value)]:t.value);return{head:i,body:n}}else return null});function G(){if(!$.value){console.warn("VueUi3dBar : CSV download is only available in stack mode (providing dataset.series instead of dataset.percentage)");return}e.nextTick(()=>{const i=g.value.map(o=>o.value).reduce((o,a)=>o+a,0),n=B.value.head.map((o,a)=>[[o.name],[B.value.body[a]],[isNaN(B.value.body[a]/i)?"-":B.value.body[a]/i*100]]),t=[[l.value.style.chart.title.text],[l.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(n),c=u.createCsvContent(t);u.downloadCsv({csvContent:c,title:l.value.style.chart.title.text||"vue-ui-3d-bar"})})}const D=e.computed(()=>{const i=g.value.map(a=>a.value).reduce((a,s)=>a+s,0),n=[' <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>',u.dataLabel({p:l.value.style.chart.legend.prefix,v:i,s:l.value.style.chart.legend.suffix,r:l.value.table.td.roundingValue}),"100%"],t=B.value.head.map((a,s)=>{const p=u.dataLabel({p:l.value.style.chart.legend.prefix,v:B.value.body[s],s:l.value.style.chart.legend.suffix,r:l.value.table.td.roundingValue});return[{color:a.color,name:a.name},p,isNaN(B.value.body[s]/i)?"-":u.dataLabel({v:B.value.body[s]/i*100,s:"%",r:l.value.table.td.roundingPercentage})]}),c={th:{backgroundColor:l.value.table.th.backgroundColor,color:l.value.table.th.color,outline:l.value.table.th.outline},td:{backgroundColor:l.value.table.td.backgroundColor,color:l.value.table.td.color,outline:l.value.table.td.outline},breakpoint:l.value.table.responsiveBreakpoint,shape:l.value.style.shape==="tube"?"circle":"square"};return{colNames:[l.value.table.columnNames.series,l.value.table.columnNames.value,l.value.table.columnNames.percentage],head:n,body:t,config:c}});function A(){S.value.showTable=!S.value.showTable}return J({generateCsv:G,generatePdf:H,generateImage:I,getData:oe,toggleTable:A}),(i,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"bar3dChart",ref:z,class:e.normalizeClass("vue-ui-3d-bar"),style:e.normalizeStyle(`font-family:${l.value.style.fontFamily};width:100%; text-align:center;background:${l.value.style.chart.backgroundColor}`),id:`3d_bar_${m.value}`},[l.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${l.value.style.chart.backgroundColor}`)},[e.createVNode(se._sfc_main,{config:{title:{cy:"3dBar-div-title",...l.value.style.chart.title},subtitle:{cy:"3dBar-div-subtitle",...l.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),l.value.userOptions.show&&M.value?(e.openBlock(),e.createBlock(Z.UserOptions,{key:1,ref_key:"details",ref:Q,backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(O),uid:m.value,hasPdf:l.value.userOptions.buttons.pdf,hasTable:!!$.value&&l.value.userOptions.buttons.table,hasXls:!!$.value&&l.value.userOptions.buttons.csv,hasImg:l.value.userOptions.buttons.img,hasFullscreen:l.value.userOptions.buttons.fullscreen,titles:{...l.value.userOptions.buttonTitles},chartElement:z.value,onToggleFullscreen:le,onGeneratePdf:e.unref(H),onGenerateCsv:G,onGenerateImage:e.unref(I),onToggleTable:A},e.createSlots({_:2},[i.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,i.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,i.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,i.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,i.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:t,isFullscreen:c})=>[e.renderSlot(i.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:t,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasTable","hasXls","hasImg","hasFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":L.value,"vue-data-ui-fulscreen--off":!L.value}),viewBox:`0 0 ${r.value.absoluteWidth} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${l.value.style.chart.backgroundColor};color:${l.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_top${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,fe),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}`},null,8,ke)],8,pe),e.createElementVNode("radialGradient",{id:`gradient_left${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}33`},null,8,ge)],8,me),e.createElementVNode("radialGradient",{id:`gradient_right${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}33`},null,8,xe)],8,$e),e.createElementVNode("linearGradient",{id:`gradient_tube_body${m.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${l.value.style.chart.bar.color}`},null,8,be),e.createElementVNode("stop",{offset:"75%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}66`},null,8,Ee)],8,Be)]),$.value?(e.openBlock(),e.createElementBlock("defs",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,t=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`grad_top_${t.id}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.lightenHexColor)(t.color,.5)}DD`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.color}`},null,8,Fe)],8,Ne))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,t=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`grad_left_${t.id}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.color}DD`},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.darkenHexColor)(t.color,.5)}FF`},null,8,De)],8,Me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,t=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`grad_right_${t.id}`},[e.createElementVNode("stop",{offset:"2%","stop-color":`${e.unref(u.lightenHexColor)(t.color,.5)}FF`},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.color}DD`},null,8,Te)],8,Pe))),256)),e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`vertical_line_${m.value}`},He,8,ze)])):e.createCommentVNode("",!0),l.value.style.chart.dataLabel.show&&![null,void 0].includes(f.dataset.percentage)&&[null,void 0].includes(f.dataset.series)?(e.openBlock(),e.createElementBlock("text",{key:1,x:r.value.width/2,y:r.value.top-l.value.style.chart.dataLabel.fontSize/2,"font-size":l.value.style.chart.dataLabel.fontSize,"font-weight":l.value.style.chart.dataLabel.bold?"bold":"normal",fill:l.value.style.chart.dataLabel.color,"text-anchor":"middle"},e.toDisplayString(e.unref(u.dataLabel)({v:E.value,s:"%",r:l.value.style.chart.dataLabel.rounding})),9,Ie)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("g",{key:2,onClick:n[0]||(n[0]=t=>{b.value=!1,y.value=null}),"data-html2canvas-ignore":"",style:{cursor:"pointer"}},[e.createElementVNode("rect",{x:r.value.width/2-6,y:r.value.top-20,height:12,width:12,fill:"transparent"},null,8,We),e.createElementVNode("path",{d:`M${r.value.width/2-6},${r.value.top-20} ${r.value.width/2+6},${r.value.top-9}`,stroke:l.value.style.chart.color,"stroke-linecap":"round","stroke-width":"1"},null,8,Ge),e.createElementVNode("path",{d:`M${r.value.width/2+6},${r.value.top-20} ${r.value.width/2-6},${r.value.top-9}`,stroke:l.value.style.chart.color,"stroke-linecap":"round","stroke-width":"1"},null,8,Ae)])):e.createCommentVNode("",!0),!l.value.style.shape||l.value.style.shape==="bar"?(e.openBlock(),e.createElementBlock("g",qe,[$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",Ue,[e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.right,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Xe),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.left,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Re),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.side,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Ze),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.topSides,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Ye)])),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",Je,[e.createElementVNode("path",{d:V.value.right,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_right${m.value})`},null,8,Ke),e.createElementVNode("path",{d:V.value.left,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_left${m.value})`},null,8,Qe),e.createElementVNode("path",{d:V.value.top,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_top${m.value})`},null,8,et)])),$.value?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:.3:1}`),class:"vue-ui-3d-bar-stack"},[e.createElementVNode("path",{d:t.fill.right,fill:`url(#grad_right_${t.id})`,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:C},null,40,lt),e.createElementVNode("path",{d:t.fill.left,fill:`url(#grad_left_${t.id})`,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:C},null,40,ot),e.createElementVNode("path",{d:t.fill.top,fill:`url(#grad_top_${t.id})`,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:C},null,40,rt),e.createElementVNode("path",{d:t.fill.liningTop,stroke:"#FFFFFF","stroke-width":"0.5","stroke-linecap":"round",fill:"none",onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:C},null,40,nt),e.createElementVNode("path",{d:`M ${t.fill.apexTop.x},${t.fill.apexTop.y} ${t.fill.apexBottom.x},${t.fill.apexBottom.y}`,stroke:"#FFFFFF","stroke-width":"0.5","stroke-linecap":"round"},null,8,at)],4))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",null,[c!==g.value.length-1?(e.openBlock(),e.createElementBlock("path",{key:0,d:t.fill.liningTopShade,stroke:l.value.style.chart.bar.shadeColor,"stroke-width":"0.5","stroke-linecap":"round",fill:"none",style:{"pointer-events":"none"}},null,8,st)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:0:t.proportion*100>l.value.style.chart.legend.hideUnderPercentage?1:0}`),onClick:o=>F("selectDatapoint",t)},[e.createElementVNode("path",{stroke:l.value.style.chart.color,"stroke-dasharray":"1","stroke-width":"0.5","stroke-linecap":"round",d:`M${t.fill.sidePointer.x},${t.fill.sidePointer.y} ${t.fill.sidePointer.x+20},${t.fill.sidePointer.y}`},null,8,it),!t.fill.miniDonut||y.value?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:t.fill.sidePointer.x+20,cy:t.fill.sidePointer.y,r:2,fill:t.color,stroke:l.value.style.chart.backgroundColor},null,8,ct)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("foreignObject",{x:t.fill.sidePointer.x+30,y:t.fill.sidePointer.y-l.value.style.chart.legend.fontSize,width:r.value.absoluteWidth/2-12,height:l.value.style.chart.legend.fontSize*2,style:{overflow:"visible",position:"relative"}},[l.value.style.chart.legend.showDefault?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`height: 100%; width: 100%; display: flex; flex-direction: row; flex-wrap: wrap; align-items:center;justify-content: flex-start; font-size:${l.value.style.chart.legend.fontSize}px; text-align:left; line-height: ${l.value.style.chart.legend.fontSize}px; color:${l.value.style.chart.legend.color}`)},e.toDisplayString(t.name)+": "+e.toDisplayString(e.unref(u.dataLabel)({v:t.proportion*100,s:"%",r:l.value.style.chart.legend.roundingPercentage}))+" ("+e.toDisplayString(e.unref(u.applyDataLabel)(l.value.style.chart.dataLabel.formatter,t.value,e.unref(u.dataLabel)({p:l.value.style.chart.legend.prefix,v:t.value,s:l.value.style.chart.legend.suffix,r:l.value.style.chart.legend.roundingValue}),{datapoint:t,seriesIndex:c}))+") ",5)):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"legend",e.normalizeProps(e.guardReactiveProps({datapoint:t,config:l.value,dataset:g.value})),void 0,!0)],8,dt)),t.fill.donut&&y.value===t.id?(e.openBlock(),e.createElementBlock("g",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[w(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(u.calcNutArrowPath)(o,{x:o.cx,y:o.cy},0,8,!1,!0,.5),stroke:o.color,class:"vue-ui-donut-arc-path","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,vt)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":1},null,8,pt))),256)),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`hollow_gradient_${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,kt),mt,e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,yt)],8,ft)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:28,fill:`url(#hollow_gradient_${m.value})`},null,8,gt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:14,fill:l.value.style.chart.backgroundColor},null,8,$t))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[w(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("g",_t,[e.createElementVNode("text",{"text-anchor":e.unref(u.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(u.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(u.calcMarkerOffsetY)(o,12,12),fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(w(o,t.fill.donut))+" ("+e.toDisplayString(e.unref(u.applyDataLabel)(l.value.style.chart.dataLabel.formatter,o.value,e.unref(u.dataLabel)({p:l.value.style.chart.legend.prefix,v:o.value,s:l.value.style.chart.legend.suffix,r:l.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:a}))+") ",9,xt),e.createElementVNode("text",{"text-anchor":e.unref(u.calcMarkerOffsetX)(o).anchor,x:e.unref(u.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(u.calcMarkerOffsetY)(o,12,12)+l.value.style.chart.legend.fontSize/1.5,fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(o.name),9,Bt)])):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.fill.miniDonut&&!y.value?(e.openBlock(),e.createElementBlock("g",bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.miniDonut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":.5},null,8,Ct))),256))])):e.createCommentVNode("",!0)],12,ut))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),l.value.style.shape==="tube"?(e.openBlock(),e.createElementBlock("g",Et,[$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",wt,[e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeTop,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Nt),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeLeft,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Vt),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeRight,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Ft),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeBottom,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Mt),e.createElementVNode("path",{d:V.value.tubeTop,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_top${m.value})`},null,8,St),e.createElementVNode("path",{d:V.value.tubeBody,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_tube_body${m.value})`},null,8,Dt)])),$.value?(e.openBlock(),e.createElementBlock("g",Pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:.3:1}`),class:"vue-ui-3d-bar-stack",onClick:o=>F("selectDatapoint",t)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_tube_top_${t.id}`,fx:"10%",cy:"55%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.lightenHexColor)(t.color,.5)}DD`},null,8,zt),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.darkenHexColor)(t.color,.1)}DD`},null,8,jt)],8,Tt),e.createElementVNode("linearGradient",{id:`gradient_tube_body_${t.id}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.color}`},null,8,Ht),e.createElementVNode("stop",{offset:"10%","stop-color":`${e.unref(u.darkenHexColor)(t.color,.7)}FF`},null,8,It),e.createElementVNode("stop",{offset:"25%","stop-color":`${e.unref(u.darkenHexColor)(t.color,.5)}FF`},null,8,Wt),e.createElementVNode("stop",{offset:"75%","stop-color":`${t.color}DD`},null,8,Gt),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.lightenHexColor)(t.color,.7)}FF`},null,8,At)],8,Ot)]),e.createElementVNode("path",{onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:C,d:t.fill.tubeBody,stroke:"#FFFFFF","stroke-width":.5,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_tube_body_${t.id})`},null,40,qt),c>0?(e.openBlock(),e.createElementBlock("path",{key:0,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:C,d:t.fill.bottomTubeTop,stroke:"#000000","stroke-width":.5,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,40,Ut)):e.createCommentVNode("",!0),e.createElementVNode("path",{onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:C,d:t.fill.tubeTop,stroke:"#FFFFFF","stroke-width":.5,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_tube_top_${t.id})`},null,40,Xt)],12,Lt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:0:t.proportion*100>l.value.style.chart.legend.hideUnderPercentage?1:0}`),onClick:o=>F("selectDatapoint",t)},[e.createElementVNode("path",{stroke:l.value.style.chart.color,"stroke-dasharray":"1","stroke-width":"0.5","stroke-linecap":"round",d:`M${t.fill.sidePointer.x},${t.fill.sidePointer.y} ${t.fill.sidePointer.x+20},${t.fill.sidePointer.y}`},null,8,Zt),!t.fill.miniDonut||y.value?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:t.fill.sidePointer.x+20,cy:t.fill.sidePointer.y,r:2,fill:t.color,stroke:l.value.style.chart.backgroundColor},null,8,Yt)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("foreignObject",{x:t.fill.sidePointer.x+30,y:t.fill.sidePointer.y-l.value.style.chart.legend.fontSize,width:r.value.absoluteWidth/2-12,height:l.value.style.chart.legend.fontSize*2,style:{overflow:"visible",position:"relative"}},[l.value.style.chart.legend.showDefault?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`height: 100%; width: 100%; display: flex; flex-direction: row; flex-wrap: wrap; align-items:center;justify-content: flex-start; font-size:${l.value.style.chart.legend.fontSize}px; text-align:left; line-height: ${l.value.style.chart.legend.fontSize}px; color:${l.value.style.chart.legend.color}`)},e.toDisplayString(t.name)+": "+e.toDisplayString(e.unref(u.dataLabel)({v:t.proportion*100,s:"%",r:l.value.style.chart.legend.roundingPercentage}))+" ("+e.toDisplayString(e.unref(u.applyDataLabel)(l.value.style.chart.dataLabel.formatter,t.value,e.unref(u.dataLabel)({p:l.value.style.chart.legend.prefix,v:t.value,s:l.value.style.chart.legend.suffix,r:l.value.style.chart.legend.roundingValue}),{datapoint:t,seriesIndex:c}))+") ",5)):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"legend",e.normalizeProps(e.guardReactiveProps({datapoint:t,config:l.value,dataset:g.value})),void 0,!0)],8,Jt)),t.fill.donut&&y.value===t.id?(e.openBlock(),e.createElementBlock("g",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[w(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(u.calcNutArrowPath)(o,{x:o.cx,y:o.cy},0,8,!1,!0,.5),stroke:o.color,class:"vue-ui-donut-arc-path","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Qt)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":1},null,8,el))),256)),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`hollow_gradient_${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,ll),ol,e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,rl)],8,tl)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:28,fill:`url(#hollow_gradient_${m.value})`},null,8,nl))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:14,fill:l.value.style.chart.backgroundColor},null,8,al))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[w(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("g",sl,[e.createElementVNode("text",{"text-anchor":e.unref(u.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(u.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(u.calcMarkerOffsetY)(o,12,12),fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(w(o,t.fill.donut))+" ("+e.toDisplayString(e.unref(u.applyDataLabel)(l.value.style.chart.dataLabel.formatter,o.value,e.unref(u.dataLabel)({p:l.value.style.chart.legend.prefix,v:o.value,s:l.value.style.chart.legend.suffix,r:l.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:a}))+") ",9,ul),e.createElementVNode("text",{"text-anchor":e.unref(u.calcMarkerOffsetX)(o).anchor,x:e.unref(u.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(u.calcMarkerOffsetY)(o,12,12)+l.value.style.chart.legend.fontSize/1.5,fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(o.name),9,il)])):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.fill.miniDonut&&!y.value?(e.openBlock(),e.createElementBlock("g",cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.miniDonut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":.5},null,8,dl))),256))])):e.createCommentVNode("",!0)],12,Rt))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"svg",{svg:r.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),i.$slots.watermark?(e.openBlock(),e.createElementBlock("div",hl,[e.renderSlot(i.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:4,config:{type:"bar3d",style:{backgroundColor:l.value.style.chart.backgroundColor,bar3d:{color:"#CCCCCC"}}}},null,8,["config"])),M.value&&$.value?(e.openBlock(),e.createBlock(ce.default,{key:5,hideDetails:"",config:{open:S.value.showTable,maxHeight:1e4,body:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color},head:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ie.DataTable,{colNames:D.value.colNames,head:D.value.head,body:D.value.body,config:D.value.config,title:`${l.value.style.chart.title.text}${l.value.style.chart.title.subtitle.text?` : ${l.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=t=>S.value.showTable=!1)},{th:e.withCtx(({th:t})=>[e.createElementVNode("div",{innerHTML:t,style:{display:"flex","align-items":"center"}},null,8,vl)]),td:e.withCtx(({td:t})=>[e.createTextVNode(e.toDisplayString(t.name||t),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,he))}},fl=de._export_sfc(pl,[["__scopeId","data-v-06e93dd9"]]);exports.default=fl;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("./index-D_32ZGWd.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),j=require("./Title-D5cATWsL.cjs"),D=require("./usePrinter-BouFNHWR.cjs"),Y=require("./Tooltip-B8yLaegk.cjs"),J=require("./DataTable-BNFSPjhv.cjs"),K=require("./vue-ui-skeleton-fVPw-oIR.cjs"),Q=require("./vue-ui-accordion-Cka6b_Up.cjs"),M=require("./useNestedProp-BvvH633N.cjs"),Z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=["id"],te=["xmlns","viewBox"],le=["id"],ae=["stop-color"],oe=["stop-color"],se=["id"],ie=["stop-color"],re=["stop-color"],ue=["x","y","width","height","fill","rx"],ne=["x","y","width","height","fill","rx"],de=["x","y","width","height","fill","rx"],ve=["x","y","width","height","fill","rx"],ce={key:0},ye=["x","y","fill","font-size","font-weight"],he=["x","y","fill","font-size","font-weight"],fe={key:1},ge=["x","y","font-size","fill","font-weight"],pe={key:2},be={key:0},xe=["x1","x2","y1","y2","stroke","stroke-width"],me=["x1","x2","y1","y2","stroke","stroke-width"],ke=["x1","x2","y1","y2","stroke","stroke-width"],we=["x","y","font-size","fill","font-weight"],Ce=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x","y","font-size","fill","font-weight"],Ne=["x","y","font-size","fill","font-weight"],Le=["x","y","width","height","fill","onMouseover"],Se={key:3,class:"vue-data-ui-watermark"},Te={__name:"vue-ui-age-pyramid",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(N,{expose:O}){const d=N,{vue_ui_age_pyramid:R}=s.useConfig(),x=t.computed(()=>!!d.dataset&&d.dataset.length),v=t.ref(s.createUid()),q=t.ref(null),w=t.ref(!1),C=t.ref(""),m=t.ref(null),L=t.ref(0),g=t.ref(null),S=t.ref(null),e=t.computed(()=>{const l=M.useNestedProp({userConfig:d.config,defaultConfig:R});return l.theme?{...M.useNestedProp({userConfig:s.themes.vue_ui_age_pyramid[l.theme]||d.config,defaultConfig:l})}:l}),T=t.ref(null);t.onMounted(()=>{if(s.objectIsEmpty(d.dataset)&&s.error({componentName:"VueUiAgePyramid",type:"dataset"}),e.value.responsive){const l=F.throttle(()=>{const{width:r,height:a}=F.useResponsive({chart:g.value,title:e.value.style.title.text?S.value:null});n.value.width=r,n.value.height=a});T.value=new ResizeObserver(l),T.value.observe(g.value.parentNode)}});const{isPrinting:$,isImaging:B,generatePdf:A,generateImage:E}=D.usePrinter({elementId:`vue-ui-age-pyramid_${v.value}`,fileName:e.value.style.title.text||"vue-ui-age-pyramid"}),c=t.ref({showTable:e.value.table.show,showTooltip:e.value.style.tooltip.show}),n=t.ref({height:e.value.style.height,width:e.value.style.width}),i=t.computed(()=>{const l=n.value.width-e.value.style.layout.padding.right-e.value.style.layout.padding.left,r=e.value.style.layout.padding.left,a=n.value.width-e.value.style.layout.padding.right;return{top:e.value.style.layout.padding.top,left:r,right:a,bottom:n.value.height-e.value.style.layout.padding.bottom,width:l,height:n.value.height-e.value.style.layout.padding.top-e.value.style.layout.padding.bottom,centerX:e.value.style.layout.padding.left+l/2,leftChart:{width:l/2-e.value.style.layout.centerSlit.width,right:r+l/2-e.value.style.layout.centerSlit.width},rightChart:{width:l/2-e.value.style.layout.centerSlit.width,left:r+l/2+e.value.style.layout.centerSlit.width}}}),G=t.computed(()=>d.dataset.map(l=>e.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),y=t.computed(()=>{const l=U(p.value/5),r=[],a=[];for(let o=0;o<=5;o+=1){const u=l*o,I=l*(o-5);r.push({value:u,x:i.value.left+i.value.width/2+e.value.style.layout.centerSlit.width+u/p.value*i.value.leftChart.width}),a.push({value:Math.abs(I),x:i.value.left+i.value.width/2+I/p.value*i.value.leftChart.width-e.value.style.layout.centerSlit.width})}return{right:r,left:a}});function U(l){if(l===0)return 0;const a=10**Math.floor(Math.log10(Math.abs(l)));let o;return l<0,o=Math.round(l/a)*a,o}const p=t.computed(()=>Math.max(...d.dataset.flatMap(l=>l.slice(-2).map(r=>s.checkNaN(r))))),h=t.computed(()=>d.dataset.length),W=t.computed(()=>d.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/p.value},right:{value:l[3],proportionToMax:l[3]/p.value}}))),f=t.computed(()=>W.value.map((l,r)=>{const a=i.value.top+i.value.height/h.value*r,o=i.value.height/h.value-e.value.style.layout.bars.gap;return{segment:l.segment,age:l.age,left:{...l.left,y:a,color:e.value.style.layout.bars.left.color,x:i.value.leftChart.right-l.left.proportionToMax*i.value.leftChart.width,width:s.checkNaN(l.left.proportionToMax*i.value.leftChart.width),height:o},right:{...l.right,y:a,color:e.value.style.layout.bars.right.color,x:i.value.rightChart.left,width:s.checkNaN(l.right.proportionToMax*i.value.rightChart.width),height:o}}})),_=t.ref(null);function H(l,r){m.value=l,_.value={datapoint:r,seriesIndex:l,series:f.value,config:e.value};const a=e.value.style.tooltip.customFormat;if(s.isFunction(a)&&s.functionReturnsString(()=>a({seriesIndex:l,datapoint:{segment:r[0],index:r[1],left:r[2],right:r[3]},series:f.value,config:e.value})))C.value=a({seriesIndex:l,datapoint:{segment:r[0],index:r[1],left:r[2],right:r[3]},series:f.value,config:e.value});else{let o="";const u=f.value[l];o+=`<div><b>${u.segment}</b></div>`,o+=`<div>${e.value.translations.age}: ${s.applyDataLabel(e.value.style.layout.dataLabels.yAxis.formatter,s.checkNaN(u.age),s.dataLabel({v:s.checkNaN(u.age)}),{datapoint:r,seriesIndex:l})}</div>`,o+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`,o+='<div style="display:flex; flex-direction:row;gap:12px">',o+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${v.value})`:e.value.style.layout.bars.left.color}"/></svg><div>${e.value.translations.female}</div><div><b>${s.applyDataLabel(e.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.left.value),s.dataLabel({v:s.checkNaN(u.left.value)}),{datapoint:r,seriesIndex:l})}</b></div></div>`,o+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${v.value})`:e.value.style.layout.bars.right.color}"/></svg><div>${e.value.translations.male}</div><div><b>${s.applyDataLabel(e.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.right.value),s.dataLabel({v:s.checkNaN(u.right.value)}),{datapoint:r,seriesIndex:l})}</b></div></div>`,o+="</div>",o+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}"><div>${e.value.translations.total}</div><div><b>${s.applyDataLabel(e.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.right.value)+s.checkNaN(u.left.value),s.dataLabel({v:s.checkNaN(u.right.value)+s.checkNaN(u.left.value)}),{datapoint:r,seriesIndex:l})}</b></div></div>`,o+="</div>",C.value=`<div>${o}</div>`}w.value=!0}function z(){t.nextTick(()=>{const l=[e.value.translations.year,e.value.translations.age,e.value.translations.female,e.value.translations.male,e.value.translations.total],r=d.dataset.map(u=>[u[0],u[1],u[2],u[3],u[2]+u[3]]),a=[[e.value.style.title.text],[e.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(r),o=s.createCsvContent(a);s.downloadCsv({csvContent:o,title:e.value.style.title.text||"vue-ui-heatmap"})})}const k=t.computed(()=>{const l=[e.value.translations.year,e.value.translations.age,e.value.translations.female,e.value.translations.male,e.value.translations.total],r=d.dataset.map(o=>[o[0],o[1],o[2].toLocaleString(),o[3].toLocaleString(),(o[2]+o[3]).toLocaleString()]),a={th:{backgroundColor:e.value.table.th.backgroundColor,color:e.value.table.th.color,outline:e.value.table.th.outline},td:{backgroundColor:e.value.table.td.backgroundColor,color:e.value.table.td.color,outline:e.value.table.td.outline},breakpoint:e.value.table.responsiveBreakpoint};return{head:l,body:r,config:a,colNames:l}}),b=t.ref(!1);function X(l){b.value=l,L.value+=1}function V(){c.value.showTable=!c.value.showTable}function P(){c.value.showTooltip=!c.value.showTooltip}return O({generatePdf:A,generateCsv:z,generateImage:E,toggleTable:V,toggleTooltip:P}),(l,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(`vue-ui-age-pyramid ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"agePyramid",ref:g,id:`vue-ui-age-pyramid_${v.value}`,style:t.normalizeStyle(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.title.text?"":"padding-top:36px"};background:${e.value.style.backgroundColor};${e.value.responsive?"height:100%":""}`)},[e.value.style.title.text?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:S,style:t.normalizeStyle(`width:100%;background:${e.value.style.backgroundColor}`)},[t.createVNode(j._sfc_main,{config:{title:{cy:"pyramid-div-title",...e.value.style.title},subtitle:{cy:"pyramid-div-subtitle",...e.value.style.title.subtitle}}},null,8,["config"])],4)):t.createCommentVNode("",!0),e.value.userOptions.show&&x.value?(t.openBlock(),t.createBlock(D.UserOptions,{ref_key:"details",ref:q,key:`user_options_${L.value}`,backgroundColor:e.value.style.backgroundColor,color:e.value.style.color,isImaging:t.unref(B),isPrinting:t.unref($),uid:v.value,hasTooltip:e.value.userOptions.buttons.tooltip&&e.value.style.tooltip.show,hasPdf:e.value.userOptions.buttons.pdf,hasXls:e.value.userOptions.buttons.csv,hasImg:e.value.userOptions.buttons.img,hasTable:e.value.userOptions.buttons.table,hasFullscreen:e.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:c.value.showTooltip,titles:{...e.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:t.unref(A),onGenerateCsv:z,onGenerateImage:t.unref(E),onToggleTable:V,onToggleTooltip:P},t.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:t.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[t.renderSlot(l.$slots,"optionFullscreen",t.normalizeProps(t.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("svg",{key:2,xmlns:t.unref(s.XMLNS),class:t.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:t.normalizeStyle(`max-width:100%;overflow:visible;background:${e.value.style.backgroundColor};color:${e.value.style.color}`)},[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:`age_pyramid_left_${v.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[t.createElementVNode("stop",{offset:"0%","stop-color":e.value.style.layout.bars.left.color},null,8,ae),t.createElementVNode("stop",{offset:"100%","stop-color":`${t.unref(s.shiftHue)(e.value.style.layout.bars.left.color,e.value.style.layout.bars.gradient.shiftHue)}${t.unref(s.opacity)[100-e.value.style.layout.bars.gradient.intensity]}`},null,8,oe)],8,le),t.createElementVNode("linearGradient",{id:`age_pyramid_right_${v.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[t.createElementVNode("stop",{offset:"0%","stop-color":`${t.unref(s.shiftHue)(e.value.style.layout.bars.right.color,e.value.style.layout.bars.gradient.shiftHue)}${t.unref(s.opacity)[100-e.value.style.layout.bars.gradient.intensity]}`},null,8,ie),t.createElementVNode("stop",{offset:"100%","stop-color":e.value.style.layout.bars.right.color},null,8,re)],8,se)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,(a,o)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("rect",{x:a.left.x,y:a.left.y,width:t.unref(s.checkNaN)(a.left.width<=0?1e-4:a.left.width),height:a.left.height<=0?1e-4:a.left.height,fill:e.value.style.layout.bars.gradient.underlayer,rx:e.value.style.layout.bars.borderRadius},null,8,ue),t.createElementVNode("rect",{x:a.left.x,y:a.left.y,width:a.left.width<=0?1e-4:a.left.width,height:a.left.height<=0?1e-4:a.left.height,fill:e.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${v.value})`:a.left.color,rx:e.value.style.layout.bars.borderRadius},null,8,ne),t.createElementVNode("rect",{x:a.right.x,y:a.right.y,width:a.right.width<=0?1e-4:a.right.width,height:a.right.height<=0?1e-4:a.right.height,fill:e.value.style.layout.bars.gradient.underlayer,rx:e.value.style.layout.bars.borderRadius},null,8,de),t.createElementVNode("rect",{x:a.right.x,y:a.right.y,width:a.right.width<=0?1e-4:a.right.width,height:a.right.height<=0?1e-4:a.right.height,fill:e.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${v.value})`:a.right.color,rx:e.value.style.layout.bars.borderRadius},null,8,ve)]))),256)),t.createElementVNode("g",null,[e.value.style.layout.dataLabels.sideTitles.show?(t.openBlock(),t.createElementBlock("g",ce,[t.createElementVNode("text",{x:i.value.left,y:i.value.top+e.value.style.layout.dataLabels.sideTitles.offsetY,fill:e.value.style.layout.dataLabels.sideTitles.useSideColor?e.value.style.layout.bars.left.color:e.value.style.layout.dataLabels.sideTitles.color,"font-size":e.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"start","font-weight":e.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},t.toDisplayString(e.value.translations.female),9,ye),t.createElementVNode("text",{x:i.value.right,y:i.value.top+e.value.style.layout.dataLabels.sideTitles.offsetY,fill:e.value.style.layout.dataLabels.sideTitles.useSideColor?e.value.style.layout.bars.right.color:e.value.style.layout.dataLabels.sideTitles.color,"font-size":e.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"end","font-weight":e.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},t.toDisplayString(e.value.translations.male),9,he)])):t.createCommentVNode("",!0),e.value.style.layout.dataLabels.yAxis.show?(t.openBlock(),t.createElementBlock("g",fe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(G.value,(a,o)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[o%e.value.style.layout.dataLabels.yAxis.showEvery===0?(t.openBlock(),t.createElementBlock("text",{key:0,x:i.value.centerX,y:i.value.top+i.value.height/h.value*o+e.value.style.layout.dataLabels.yAxis.fontSize/3,"text-anchor":"middle","font-size":e.value.style.layout.dataLabels.yAxis.fontSize,fill:e.value.style.layout.dataLabels.yAxis.color,"font-weight":e.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},t.toDisplayString(t.unref(s.applyDataLabel)(e.value.style.layout.dataLabels.yAxis.formatter,a,t.unref(s.dataLabel)({v:a}),{datapoint:a,seriesIndex:o})),9,ge)):t.createCommentVNode("",!0)],64))),256))])):t.createCommentVNode("",!0),e.value.style.layout.dataLabels.xAxis.show?(t.openBlock(),t.createElementBlock("g",pe,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("g",be,[t.createElementVNode("line",{x1:y.value.right[0].x,x2:y.value.right.at(-1).x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,xe),t.createElementVNode("line",{x1:y.value.left[0].x,x2:y.value.left.at(-1).x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,me)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value.right,(a,o)=>(t.openBlock(),t.createElementBlock("g",null,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("line",{key:0,x1:a.x,x2:a.x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,ke)):t.createCommentVNode("",!0),t.createElementVNode("text",{x:a.x,y:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(t.unref(s.applyDataLabel)(e.value.style.layout.dataLabels.xAxis.formatter,a.value/e.value.style.layout.dataLabels.xAxis.scale,t.unref(s.dataLabel)({v:a.value/e.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,we)]))),256)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value.left,(a,o)=>(t.openBlock(),t.createElementBlock("g",null,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("line",{key:0,x1:a.x,x2:a.x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ce)):t.createCommentVNode("",!0),t.createElementVNode("text",{x:a.x,y:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(t.unref(s.applyDataLabel)(e.value.style.layout.dataLabels.xAxis.formatter,a.value/e.value.style.layout.dataLabels.xAxis.scale,t.unref(s.dataLabel)({v:a.value/e.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,_e)]))),256)),t.createElementVNode("text",{x:i.value.right,y:n.value.height,"text-anchor":"end","font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(e.value.style.layout.dataLabels.xAxis.translation),9,Ne)])):t.createCommentVNode("",!0)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.dataset,(a,o)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("rect",{x:i.value.left,y:i.value.top+i.value.height/h.value*o-e.value.style.layout.bars.gap/2,width:i.value.width<=0?1e-4:i.value.width,height:i.value.height/h.value<=0?1e-4:i.value.height/h.value,fill:m.value!==null&&m.value===o?`${e.value.style.highlighter.color}${t.unref(s.opacity)[e.value.style.highlighter.opacity]}`:"transparent",onMouseover:u=>H(o,a),onMouseleave:r[0]||(r[0]=u=>{m.value=null,w.value=!1})},null,40,Le)]))),256)),t.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,te)):t.createCommentVNode("",!0),l.$slots.watermark?(t.openBlock(),t.createElementBlock("div",Se,[t.renderSlot(l.$slots,"watermark",t.normalizeProps(t.guardReactiveProps({isPrinting:t.unref($)||t.unref(B)})),void 0,!0)])):t.createCommentVNode("",!0),x.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(K.default,{key:4,config:{type:"pyramid",style:{backgroundColor:e.value.style.backgroundColor,pyramid:{color:"#CCCCCC"}}}},null,8,["config"])),t.renderSlot(l.$slots,"legend",{legend:f.value},void 0,!0),t.createVNode(Y._sfc_main,{show:c.value.showTooltip&&w.value,backgroundColor:e.value.style.tooltip.backgroundColor,color:e.value.style.tooltip.color,borderRadius:e.value.style.tooltip.borderRadius,borderColor:e.value.style.tooltip.borderColor,borderWidth:e.value.style.tooltip.borderWidth,fontSize:e.value.style.tooltip.fontSize,backgroundOpacity:e.value.style.tooltip.backgroundOpacity,position:e.value.style.tooltip.position,offsetY:e.value.style.tooltip.offsetY,parent:g.value,content:C.value,isCustom:e.value.style.tooltip.customFormat&&typeof e.value.style.tooltip.customFormat=="function"},{"tooltip-before":t.withCtx(()=>[t.renderSlot(l.$slots,"tooltip-before",t.normalizeProps(t.guardReactiveProps({..._.value})),void 0,!0)]),"tooltip-after":t.withCtx(()=>[t.renderSlot(l.$slots,"tooltip-after",t.normalizeProps(t.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),x.value?(t.openBlock(),t.createBlock(Q.default,{key:5,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color},head:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color}}},{content:t.withCtx(()=>[t.createVNode(J.DataTable,{colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${e.value.style.title.text}${e.value.style.title.subtitle.text?` : ${e.value.style.title.subtitle.text}`:""}`,onClose:r[1]||(r[1]=a=>c.value.showTable=!1)},{th:t.withCtx(({th:a})=>[t.createTextVNode(t.toDisplayString(a),1)]),td:t.withCtx(({td:a})=>[t.createTextVNode(t.toDisplayString(a),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):t.createCommentVNode("",!0)],14,ee))}},$e=Z._export_sfc(Te,[["__scopeId","data-v-4660f4e6"]]);exports.default=$e;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-D_32ZGWd.cjs"),J=require("./useResponsive-B3TrDDIG.cjs"),ye=require("./Title-D5cATWsL.cjs"),K=require("./usePrinter-BouFNHWR.cjs"),he=require("./Tooltip-B8yLaegk.cjs"),pe=require("./DataTable-BNFSPjhv.cjs"),fe=require("./vue-ui-skeleton-fVPw-oIR.cjs"),ge=require("./Slicer-D8jHSP7U.cjs"),me=require("./vue-ui-accordion-Cka6b_Up.cjs"),Q=require("./useNestedProp-BvvH633N.cjs"),ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["id"],be=["xmlns","viewBox"],we={key:0},Ce=["id"],Ne=["stop-color"],$e=["stop-color"],_e=["stop-color"],Be=["id"],Se=["stop-color"],Ve=["stop-color"],Ee=["stop-color"],ze={key:0},Te=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:1},Le=["x1","x2","y1","y2","stroke","stroke-width"],Re=["x","y","font-size","fill","font-weight"],Pe={key:2},Ie=["transform","text-anchor","font-size","fill","font-weight"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Me={key:0},Ue=["cx","cy","r","fill"],De=["cx","cy","r","fill"],qe={key:1},We=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],He=["x","y","height","width","fill","rx"],je=["x","y","height","width","fill","rx","stroke","stroke-width"],Xe=["x","y","height","width","fill","onMouseover"],Ye={key:3,class:"vue-data-ui-watermark"},Je=["innerHTML"],Ke={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(f,{expose:Z}){const h=f,{vue_ui_candlestick:ee}=i.useConfig(),m=e.computed(()=>!!h.dataset&&h.dataset.length),y=e.ref(i.createUid()),te=e.ref(null),_=e.ref(!1),B=e.ref(""),S=e.ref(void 0),T=e.ref(0),F=e.ref(0),k=e.ref(null),A=e.ref(null),L=e.ref(null),R=e.ref(null),t=e.computed(()=>{const o=Q.useNestedProp({userConfig:h.config,defaultConfig:ee});return o.theme?{...Q.useNestedProp({userConfig:i.themes.vue_ui_candlestick[o.theme]||h.config,defaultConfig:o})}:o}),n=e.ref({height:t.value.style.height,width:t.value.style.width,xAxisFontSize:t.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:t.value.style.layout.grid.yAxis.dataLabels.fontSize}),b=e.ref(null);e.onMounted(()=>{if(i.objectIsEmpty(h.dataset)&&i.error({componentName:"VueUiCandlestick",type:"dataset"}),t.value.responsive){const o=J.throttle(()=>{const{width:u,height:l}=J.useResponsive({chart:k.value,title:t.value.style.title.text?A.value:null,slicer:R.value,legend:L.value});n.value.width=u,n.value.height=l,n.value.xAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:t.value.style.width,source:t.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),n.value.yAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:t.value.style.width,source:t.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(o),b.value.observe(k.value.parentNode)}}),e.onBeforeUnmount(()=>{b.value&&b.value.disconnect()});const{isPrinting:P,isImaging:I,generatePdf:O,generateImage:M}=K.usePrinter({elementId:`vue-ui-candlestick_${y.value}`,fileName:t.value.style.title.text||"vue-ui-candlestick"}),p=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),s=e.computed(()=>{const{top:o,right:u,bottom:l,left:a}=t.value.style.layout.padding;return{top:o,right:n.value.width-u,left:a,bottom:n.value.height-l,width:n.value.width-a-u,height:n.value.height-o-l}}),V=e.computed(()=>h.dataset.length),d=e.ref({start:0,end:V.value}),U=e.computed(()=>h.dataset.slice(d.value.start,d.value.end)),E=e.computed(()=>(h.dataset.forEach((o,u)=>{[null,void 0].includes(o[0])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:u}),[null,void 0].includes(o[1])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:u}),[null,void 0].includes(o[2])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:u}),[null,void 0].includes(o[3])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:u}),[null,void 0].includes(o[4])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:u}),[null,void 0].includes(o[5])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:u})}),U.value.map(o=>({period:o[0],open:o[1],high:o[2],low:o[3],last:o[4],volume:o[5]})))),r=e.computed(()=>s.value.width/U.value.length),D=e.computed(()=>({max:Math.max(...E.value.map(o=>o.high)),min:0})),g=e.computed(()=>i.calculateNiceScale(D.value.min,D.value.max,t.value.style.layout.grid.yAxis.dataLabels.steps));function w(o,u){return{...o,x:i.checkNaN(s.value.left+u*r.value+r.value/2),y:i.checkNaN(s.value.top+(1-o/g.value.max)*s.value.height),value:i.checkNaN(o)}}const c=e.computed(()=>E.value.map((o,u)=>{const l=w(o.open,u),a=w(o.high,u),v=w(o.low,u),N=w(o.last,u),$=o.last>o.open;return{period:o.period,open:l,high:a,low:v,last:N,volume:o.volume,isBullish:$}}));function le(o){return i.checkNaN(o/g.value.max)}const oe=e.computed(()=>g.value.ticks.map(o=>({y:s.value.bottom-s.value.height*le(o),value:i.checkNaN(o)}))),ae=e.computed(()=>E.value.map(o=>o.period)),z=e.ref(null);function ue(o,u){S.value=o,z.value={datapoint:u,seriesIndex:o,series:c.value,config:t.value};const l=t.value.style.tooltip.customFormat;if(i.isFunction(l)&&i.functionReturnsString(()=>l({seriesIndex:o,datapoint:u,series:c.value,config:t.value})))B.value=l({seriesIndex:o,datapoint:u,series:c.value,config:t.value});else if(t.value.style.tooltip.show){let a="";const{period:v,open:N,high:$,low:H,last:j,volume:X,isBullish:Y}=c.value[o],{period:Ze,open:re,high:ne,low:de,last:ce,volume:ve}=t.value.translations;a+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${t.value.style.layout.candle.borderRadius*3}" stroke="${t.value.style.layout.candle.stroke}" stroke-width="${t.value.style.layout.candle.strokeWidth}"
|
|
2
|
-
fill="${t.value.style.layout.candle.gradient.show?Y?`url(#bullish_gradient_${y.value})`:`url(#bearish_gradient_${y.value})`:Y?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg>${v}</div>`,a+=`${ve} : <b>${isNaN(X)?"-":Number(X.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,a+=`<div>${re}: <b>${t.value.style.tooltip.prefix} ${isNaN(N.value)?"-":Number(N.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ne}: <b>${t.value.style.tooltip.prefix} ${isNaN($.value)?"-":Number($.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${de}: <b>${t.value.style.tooltip.prefix} ${isNaN(H.value)?"-":Number(H.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ce}: <b>${t.value.style.tooltip.prefix} ${isNaN(j.value)?"-":Number(j.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+="</div>",B.value=`<div style="text-align:right">${a}</div>`}_.value=!0}function ie(){d.value={start:0,end:V.value},F.value+=1}function q(){e.nextTick(()=>{const o=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume],u=c.value.map(v=>[v.period,v.open.value,v.high.value,v.low.value,v.last.value,v.volume]),l=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([o]).concat(u),a=i.createCsvContent(l);i.downloadCsv({csvContent:a,title:t.value.style.title.text||"vue-ui-candlestick"})})}const C=e.computed(()=>{const o=c.value.map(a=>[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" :rx="${t.value.style.layout.candle.borderRadius*3}" fill="${t.value.style.layout.candle.gradient.show?a.isBullish?`url(#bullish_gradient_${y.value}`:`url(#bearish_gradient_${y.value})`:a.isBullish?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg> ${a.period}`,`${t.value.table.td.prefix} ${isNaN(a.open.value)?"-":Number(a.open.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.high.value)?"-":Number(a.high.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.low.value)?"-":Number(a.low.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.last.value)?"-":Number(a.last.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${isNaN(a.volume)?"-":a.volume.toLocaleString()}`]),u={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},l=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume];return{head:l,body:o,config:u,colNames:l}}),x=e.ref(!1);function se(o){x.value=o,T.value+=1}function W(){p.value.showTable=!p.value.showTable}function G(){p.value.showTooltip=!p.value.showTooltip}return Z({generatePdf:O,generateCsv:q,generateImage:M,toggleTable:W,toggleTooltip:G}),(o,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"candlestickChart",ref:k,class:e.normalizeClass(`vue-ui-candlestick ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`position:relative;font-family:${t.value.style.fontFamily}; text-align:center;${t.value.style.title.text?"":"padding-top:36px"};background:${t.value.style.backgroundColor}; ${t.value.responsive?"height: 100%":""}`),id:`vue-ui-candlestick_${y.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor}`)},[e.createVNode(ye._sfc_main,{config:{title:{cy:"candlestick-div-title",...t.value.style.title},subtitle:{cy:"candlestick-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref_key:"details",ref:te,key:`user_options_${T.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(I),isPrinting:e.unref(P),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.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:x.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,onToggleFullscreen:se,onGeneratePdf:e.unref(O),onGenerateCsv:q,onGenerateImage:e.unref(M),onToggleTable:W,onToggleTooltip:G},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:a})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.backgroundColor};color:${t.value.style.color}`)},[c.value.length>0?(e.openBlock(),e.createElementBlock("g",we,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`bearish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bearish},null,8,Ne),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,$e),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bearish,.05)}66`},null,8,_e)],8,Ce),e.createElementVNode("linearGradient",{id:`bullish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bullish},null,8,Se),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bullish,.05)}66`},null,8,Ee)],8,Be)]),t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",ze,[e.createElementVNode("line",{x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Te),e.createElementVNode("line",{x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe)])):e.createCommentVNode("",!0),t.value.style.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=g.value.min&&l.value<=g.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:s.value.left,x2:s.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Le)):e.createCommentVNode("",!0),l.value>=g.value.min&&l.value<=g.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.left-8+t.value.style.layout.grid.yAxis.dataLabels.offsetX,y:l.y+n.value.yAxisFontSize/3,"font-size":n.value.yAxisFontSize,"text-anchor":"end",fill:t.value.style.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.prefix)+" "+e.toDisplayString(e.unref(i.canShowValue)(l.value)?l.value.toFixed(t.value.style.layout.grid.yAxis.dataLabels.roundingValue):"")+" "+e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.suffix),9,Re)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.value.style.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{transform:`translate(${s.value.left+r.value*a+r.value/2}, ${s.value.bottom+n.value.xAxisFontSize*2+t.value.style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${t.value.style.layout.grid.xAxis.dataLabels.rotation})`,"text-anchor":t.value.style.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":n.value.xAxisFontSize,fill:t.value.style.layout.grid.xAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.xAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(l),9,Ie)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("line",{x1:l.open.x,x2:l.open.x,y1:l.high.y,y2:l.low.y,stroke:t.value.style.layout.wick.stroke,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Oe),t.value.style.layout.wick.extremity.shape==="circle"?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("circle",{cx:l.high.x,cy:l.high.y,r:t.value.style.layout.wick.extremity.size==="auto"?r.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,Ue),e.createElementVNode("circle",{cx:l.low.x,cy:l.low.y,r:t.value.style.layout.wick.extremity.size==="auto"?r.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,De)])):e.createCommentVNode("",!0),t.value.style.layout.wick.extremity.shape==="line"?(e.openBlock(),e.createElementBlock("g",qe,[e.createElementVNode("line",{x1:l.high.x-(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:l.high.x+(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:l.high.y,y2:l.high.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,We),e.createElementVNode("line",{x1:l.low.x-(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:l.low.x+(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:l.low.y,y2:l.low.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Ge)])):e.createCommentVNode("",!0)]))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:l.open.x-r.value/2+r.value*(1-t.value.style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:r.value*t.value.style.layout.candle.widthRatio<=0?1e-4:r.value*t.value.style.layout.candle.widthRatio,fill:t.value.style.layout.candle.gradient.underlayer,rx:t.value.style.layout.candle.borderRadius,stroke:"none"},null,8,He))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:l.open.x-r.value/2+r.value*(1-t.value.style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:r.value*t.value.style.layout.candle.widthRatio<=0?1e-4:r.value*t.value.style.layout.candle.widthRatio,fill:l.isBullish?t.value.style.layout.candle.gradient.show?`url(#bullish_gradient_${y.value})`:t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.gradient.show?`url(#bearish_gradient_${y.value})`:t.value.style.layout.candle.colors.bearish,rx:t.value.style.layout.candle.borderRadius,stroke:t.value.style.layout.candle.stroke,"stroke-width":t.value.style.layout.candle.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,je))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+a*r.value,y:s.value.top,height:s.value.height<=0?1e-4:s.value.height,width:r.value<=0?1e-4:r.value,fill:S.value===a?`${t.value.style.layout.selector.color}${e.unref(i.opacity)[t.value.style.layout.selector.opacity]}`:"transparent",onMouseover:v=>ue(a,l),onMouseleave:u[0]||(u[0]=v=>{S.value=void 0,_.value=!1})},null,40,Xe))),256))])])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:n.value},void 0,!0)],14,be)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ye,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(P)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(fe.default,{key:4,config:{type:"candlesticks",style:{backgroundColor:t.value.style.backgroundColor,candlesticks:{axis:{color:"#CCCCCC"},candle:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.zoom.show&&m.value?(e.openBlock(),e.createElementBlock("div",{key:5,ref_key:"chartSlicer",ref:R},[(e.openBlock(),e.createBlock(ge.Slicer,{key:`slicer_${F.value}`,background:t.value.style.zoom.color,borderColor:t.value.style.backgroundColor,fontSize:t.value.style.zoom.fontSize,useResetSlot:t.value.style.zoom.useResetSlot,labelLeft:f.dataset[d.value.start]?f.dataset[d.value.start][0]:f.dataset[0][0],labelRight:f.dataset[d.value.end-1]?f.dataset[d.value.end-1][0]:f.dataset.at(-1)[0],textColor:t.value.style.color,inputColor:t.value.style.zoom.color,selectColor:t.value.style.zoom.highlightColor,max:V.value,min:0,valueStart:d.value.start,valueEnd:d.value.end,start:d.value.start,"onUpdate:start":u[1]||(u[1]=l=>d.value.start=l),end:d.value.end,"onUpdate:end":u[2]||(u[2]=l=>d.value.end=l),onReset:ie},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"]))],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"chartLegend",ref:L},[e.renderSlot(o.$slots,"legend",{legend:c.value},void 0,!0)],512),e.createVNode(he._sfc_main,{show:p.value.showTooltip&&_.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:k.value,content:B.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),m.value?(e.openBlock(),e.createBlock(me.default,{key:6,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:u[3]||(u[3]=l=>p.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,Je)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,xe))}},Qe=ke._export_sfc(Ke,[["__scopeId","data-v-1e4cee2b"]]);exports.default=Qe;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-D_32ZGWd.cjs"),te=require("./useNestedProp-BvvH633N.cjs"),D=require("./usePrinter-BouFNHWR.cjs"),oe=require("./vue-ui-skeleton-fVPw-oIR.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],le=["height"],re=["data-cell","height"],ie={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(c,{expose:G}){const l=c,{vue_ui_carousel_table:j}=u.useConfig(),A=e.ref(u.createUid()),z=e.ref(!1),m=e.ref(!!l.dataset);e.onMounted(()=>{u.objectIsEmpty(l.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||u.objectIsEmpty(l.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),m.value=!1),(!l.dataset.body||u.objectIsEmpty(l.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),m.value=!1))});const t=e.computed(()=>te.useNestedProp({userConfig:l.config,defaultConfig:j})),{isPrinting:I,isImaging:P,generatePdf:X,generateImage:F}=D.usePrinter({elementId:`carousel-table_${A.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),s=e.ref({showAnimation:t.value.animation.use}),i=e.ref(null),N=e.ref(null),h=e.ref(null),g=e.ref(null),b=e.ref(0),B=e.ref(0),$=e.ref(!1),y=e.ref(null),v=e.ref(null),k=e.ref(0);function R(){y.value&&(v.value={elements:y.value.getElementsByTagName("tr"),heights:Array.from(y.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(R);const J=e.computed(()=>!v.value||!v.value.heights.length?0:Math.max(...v.value.heights)+b.value+B.value),K=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),Q=e.computed(()=>(t.value.tbody.tr.height+t.value.tbody.tr.td.padding.top+t.value.tbody.tr.td.padding.bottom+t.value.tbody.tr.border.size*2)*K.value+b.value+B.value),w=e.ref(0),C=e.ref(null),T=e.ref(0),p=e.ref(!1),O=e.ref(0);e.onMounted(()=>{h.value&&(b.value=h.value.getBoundingClientRect().height),g.value&&(B.value=g.value.getBoundingClientRect().height),s.value.showAnimation&&v.value&&V()}),e.onMounted(()=>{if(i.value){let a=function(){const r=o.getBoundingClientRect().bottom;n.forEach(d=>{d.getBoundingClientRect().top<r?d.style.visibility="hidden":d.style.visibility="visible"})};const o=i.value.querySelector("thead"),n=Array.from(y.value.querySelectorAll("tr"));i.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{i.value.removeEventListener("scroll",a)})}});function W(o){z.value=o,O.value+=1}function V(){!C.value&&!p.value&&(C.value=requestAnimationFrame(L))}function Y(){if(!i.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=i.value;return o+a>=n}function L(o){if(p.value)return;T.value||(T.value=o),o-T.value>=t.value.animation.speedMs&&(w.value+=v.value.heights[k.value],(Y()||k.value>=v.value.heights.length)&&(w.value=0,k.value=-1),k.value+=1,i.value&&i.value.scrollTo({top:w.value,behavior:"smooth"}),T.value=o),C.value=requestAnimationFrame(L)}function f(){p.value=!0,cancelAnimationFrame(C.value),C.value=null}e.onBeforeUnmount(f);function x(){!p.value||!s.value.showAnimation||(p.value=!1,T.value=0,V())}function Z(){t.value.animation.pauseOnHover&&f()}const S=e.ref(null);function _(){f(),clearTimeout(S.value)}function M(){clearTimeout(S.value),S.value=setTimeout(x,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(s.value.showAnimation=!0,x()):(s.value.showAnimation=!1,f())});const ee=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{$.value=a.contentRect.width<ee.value}),b.value=h.value?h.value.getBoundingClientRect().height:0,B.value=g.value?g.value.getBoundingClientRect().height:0,k.value=0,R()});i.value&&o.observe(i.value)});function q(){X()}function H(){s.value.showAnimation=!s.value.showAnimation,s.value.showAnimation?x():f()}function U(){e.nextTick(()=>{const o=l.dataset.head.map((r,d)=>[[l.dataset.body[d]]]),n=[[t.value.caption.text],[l.dataset.head.map(r=>[r])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return G({pauseAnimation:f,resumeAnimation:x,toggleAnimation:H,generateCsv:U,generatePdf:q,generateImage:F}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:N},[e.createElementVNode("div",{ref_key:"tableContainer",ref:i,id:`carousel-table_${A.value}`,style:e.normalizeStyle({height:e.unref(I)||e.unref(P)?"auto":`${Math.max(Q.value,J.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":$.value,"is-playing":!p.value}),onMouseenter:n[0]||(n[0]=a=>Z()),onMouseleave:n[1]||(n[1]=a=>x()),onTouchstart:n[2]||(n[2]=a=>_()),onTouchend:n[3]||(n[3]=a=>M()),onTouchcancel:n[4]||(n[4]=a=>M())},[m.value?(e.openBlock(),e.createElementBlock("table",{key:0,class:"vue-data-ui-carousel-table",style:e.normalizeStyle({...t.value.style,border:`${t.value.border.size}px solid ${t.value.border.color}`,width:"100%",borderCollapse:"collapse"})},[e.createElementVNode("caption",{ref_key:"caption",ref:h,class:"vue-data-ui-carousel-table-caption",style:e.normalizeStyle({...t.value.caption.style,fontFamily:"inherit",position:"sticky",top:0,zIndex:2,paddingTop:t.value.caption.padding.top+"px",paddingRight:t.value.caption.padding.right+"px",paddingBottom:t.value.caption.padding.bottom+"px",paddingLeft:t.value.caption.padding.left+"px",boxShadow:$.value?t.value.thead.tr.style.boxShadow:"none",minHeight:"36px"})},[e.createTextVNode(e.toDisplayString(t.value.caption.text&&!o.$slots.caption?t.value.caption.text:"")+" ",1),e.renderSlot(o.$slots,"caption",{},void 0,!0)],4),e.createElementVNode("thead",{style:e.normalizeStyle({...t.value.thead.style,position:"sticky",top:`${b.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:g,role:"row",style:e.normalizeStyle({...t.value.thead.tr.style,border:t.value.thead.tr.border.size?`${t.value.thead.tr.border.size}px solid ${t.value.thead.tr.border.color}`:"none",boxShadow:$.value?"none":t.value.thead.tr.style.boxShadow}),height:`${t.value.thead.tr.height}px`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.dataset.head,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${r}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":a)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:a,colIndex:r})),void 0,!0)],4))),128))],12,le)],4),c.dataset.body&&c.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:y,style:e.normalizeStyle({clipPath:"inset(0,0,0,0)"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.dataset.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(d,E)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":c.dataset.head[E]||"",style:e.normalizeStyle({...t.value.tbody.tr.td.style,border:`${t.value.tbody.tr.td.border.size}px solid ${t.value.tbody.tr.td.border.color}`,backgroundColor:t.value.tbody.tr.td.style.backgroundColor+e.unref(u.opacity)[r%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100],paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":d)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:d,rowIndex:r,colIndex:E})),void 0,!0)],12,re))),256))],4))),256))],4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ne),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_option_${O.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(I),isImaging:e.unref(P),uid:A.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!s.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:z.value,chartElement:N.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:q,onGenerateCsv:U,onGenerateImage:e.unref(F),onToggleAnimation:H,onToggleFullscreen:W},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","titles","onGenerateImage"])):e.createCommentVNode("",!0)],512))}},ue=ae._export_sfc(ie,[["__scopeId","data-v-f722c10b"]]);exports.default=ue;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-D_32ZGWd.cjs"),Y=require("./usePrinter-BouFNHWR.cjs"),ce=require("./vue-ui-skeleton-fVPw-oIR.cjs"),ie=require("./BaseIcon-DBHVtm3A.cjs"),de=require("./vue-ui-accordion-Cka6b_Up.cjs"),H=require("./useNestedProp-BvvH633N.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],he=["xmlns","viewBox"],pe={key:0},fe=["fill","font-weight","font-size","x","y"],me=["fill","font-weight","font-size","x","y"],be=["id"],ge=["stop-color"],ke=["stop-color"],_e=["id"],xe=["stop-color"],Be=["stop-color"],Ee=["id"],Ne=["stop-color"],Se=["stop-color"],ze=["stop-color"],Ce=["id"],we=["stop-color"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],Le=["stop-color"],De=["stop-color"],Ie={key:1},Me=["x","y","font-size","font-weight","fill"],Pe=["x","y","font-size","font-weight","fill"],Oe=["d","stroke"],Re=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","stroke","stroke-width","onClick"],je={key:2},Ae=["x","y","font-size","fill","onClick"],Ge={key:0},Ue=["x","y","fill","font-size","font-weight"],qe=["x","y","height","width","fill","rx","onClick"],Ye=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],He={key:3},We=["x","y","fill","font-size","onClick"],Ke=["d","stroke"],Je=["cx","cy","fill","onClick"],Qe=["fill","cx","cy","r","onClick"],Ze={key:4},et=["x","y","font-size","font-weight","fill"],tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["y","height","width"],at={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},ot={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},nt={viewBox:"0 0 20 20",height:"16",width:"16"},rt=["fill"],st={key:6},ut=["y","height","width"],ct={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},it={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},dt={viewBox:"0 0 20 20",height:"16",width:"16"},yt=["fill"],vt=["d","stroke"],ht=["cx","cy","fill"],pt=["cx","cy","fill"],ft=["d","stroke"],mt=["cx","cy","fill"],bt=["cx","cy","fill"],gt=["x","y","fill","font-size","font-weight"],kt=["x","y","fill","font-size","font-weight"],_t=["x","text-anchor","y","fill","font-size"],xt=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],Nt=["x","text-anchor","y","fill","font-size"],St=["x","y","font-size","fill"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt={key:2,class:"vue-data-ui-watermark"},Vt={style:{"padding-top":"36px",position:"relative"}},$t={class:"vue-ui-data-table"},Tt={key:0},Ft=["data-cell"],Lt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Dt={key:0},It={key:1},Mt=["data-cell"],Pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ot={key:0},Rt={key:1},Xt=["data-cell"],jt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},At={key:0},Gt={key:1},Ut=["data-cell"],qt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Yt={key:0},Ht={key:1},Wt=["data-cell"],Kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Jt={key:0},Qt={key:1},Zt=["data-cell"],el={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},tl={key:0},ll={key:1},al=["data-cell"],ol={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},nl={key:0},rl={key:1},sl=["data-cell"],ul={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},cl=["data-cell"],il={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dl=["data-cell"],yl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vl=["data-cell"],hl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},pl=["data-cell"],fl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ml={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(W,{expose:K,emit:S}){const _=W;e.useCssVars(a=>({"5c2f10c9":a.tdo}));const{vue_ui_chestnut:J}=o.useConfig(),C=e.computed(()=>!!_.dataset&&_.dataset.length),h=e.ref(o.createUid()),D=e.ref(null),Q=e.ref(null),I=e.ref(0),t=e.computed(()=>{const a=H.useNestedProp({userConfig:_.config,defaultConfig:J});return a.theme?{...H.useNestedProp({userConfig:o.themes.vue_ui_chestnut[a.theme]||_.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}),{isPrinting:M,isImaging:P,generatePdf:O,generateImage:R}=Y.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),T=e.ref(null),X=e.ref(!1),Z=e.computed(()=>t.value.table.responsiveBreakpoint),r=e.ref({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),f=e.computed(()=>({left:r.value.padding.left,top:r.value.padding.top,right:r.value.width-r.value.padding.right,bottom:r.value.height-r.value.padding.bottom,width:r.value.width-(r.value.padding.left+r.value.padding.right),height:r.value.height-(r.value.padding.top+r.value.padding.bottom),seedX:r.value.padding.left+64})),k=e.computed(()=>C.value?_.dataset.flatMap(a=>(a.branches||[]).map(s=>s.value||0)).reduce((a,s)=>a+s,0):0),m=e.computed(()=>(_.dataset.forEach((a,s)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${n}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{o.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${n} - ${i}`})})})})}),_.dataset.map((a,s)=>{const l=(a.branches||[]).map(n=>n.value||0).reduce((n,d)=>n+d,0);return{...a,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:(a.branches||[]).map((n,d)=>({...n,rootName:a.name,rootIndex:s,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],value:n.value>=0?n.value:0,id:n.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:n.value/l,type:"branch",breakdown:(n.breakdown||[]).map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/k.value,branchName:n.name,branchValue:n.value,branchToTotal:n.value/k.value,branchToRoot:n.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/k.value,nutToRoot:i.value/l,nutToBranch:i.value/n.value},...i,type:"nut",branchName:n.name,rootName:a.name,branchTotal:n.value>=0?n.value:0,proportionToBranch:i.value/n.value,proportionToRoot:i.value/l,proportionToTree:i.value/k.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:o.convertColorToHex(i.color)||$.value[y]||o.palette[y]||o.palette[y%o.palette.length],value:i.value>=0?i.value:0}))}))}})));function ee(){return m.value}const te=e.computed(()=>m.value.flatMap(a=>a.branches).length),le=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),ae=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),j=e.computed(()=>256+r.value.padding.left),E=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,n=a.total/le.value*(l>64?64:l);return{...a,x:f.value.seedX,y:f.value.top+f.value.height/m.value.length*(s+1)-(f.value.height/m.value.length/2+r.value.gap/2),r:n<r.value.branchSize/2?r.value.branchSize/2:n}})),oe=e.computed(()=>t.value.style.chart.layout.branches.widthRatio<=0?.1:t.value.style.chart.layout.branches.widthRatio>1.8?1.8:t.value.style.chart.layout.branches.widthRatio),ne=e.computed(()=>E.value.flatMap(a=>a.branches)),x=e.computed(()=>ne.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+f.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:j.value,x2:384*a.value/ae.value*oe.value+j.value})));function F(a){const s=E.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const c=e.ref(null),B=e.ref(null),v=e.ref(null),b=e.ref(null);function p(){c.value=null,v.value=null,b.value=null}function g(a){return b.value?b.value===null?!0:a.type==="root"?a.id===b.value.id:a.rootIndex===b.value.rootIndex:c.value===null&&v.value===null?!0:a.type==="nut"?c.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||c.value&&c.value.rootIndex===a.rootIndex:!1}function A(a){p(),e.nextTick(()=>{c.value=a,v.value=a,B.value=o.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),S("selectNut",a.breakdown)})}function N(){c.value=null,B.value=null,S("selectNut",null)}function L(a){v.value&&v.value.id===a.id?(v.value=null,p(),S("selectBranch",null)):(p(),v.value=a,S("selectBranch",a))}function G(a){b.value&&b.value.id===a.id?(p(),S("selectRoot",null)):(p(),b.value=a,S("selectRoot",a))}function re(){return f.value.bottom-(c.value.y1+180)<0?0:f.value.bottom}function z(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function se(){const a=new ResizeObserver(s=>{s.forEach(l=>{X.value=l.contentRect.width<Z.value})});T.value&&a.observe(T.value)}e.onMounted(()=>{o.objectIsEmpty(_.dataset)&&o.error({componentName:"VueUiChestnut",type:"dataset"});const a=te.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,se()});const u=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,n)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,gl)=>y.table)));return{head:a,body:s}});function U(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",k.value],[""]],s=u.value.head,l=u.value.body.map((i,y)=>[u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootName,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootValue,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchName,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchValue,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),n=a.concat([s]).concat(l),d=o.createCsvContent(n);o.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ue(a){V.value=a,I.value+=1}function q(){w.value.showTable=!w.value.showTable}return K({getData:ee,generatePdf:O,generateCsv:U,generateImage:R,toggleTable:q}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:D,id:`vue-ui-chestnut_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;padding-top:36px;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(Y.UserOptions,{ref_key:"details",ref:Q,key:`user_options_${I.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(P),isPrinting:e.unref(M),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:D.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(O),onGenerateCsv:U,onGenerateImage:e.unref(R),onToggleTable:q},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&C.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.layout.title.text?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",fill:t.value.style.chart.layout.title.color,"font-weight":t.value.style.chart.layout.title.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.fontSize,x:r.value.width/2,y:12+t.value.style.chart.layout.title.fontSize+t.value.style.chart.layout.title.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.text),9,fe)):e.createCommentVNode("",!0),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",fill:t.value.style.chart.layout.title.subtitle.color,"font-weight":t.value.style.chart.layout.title.subtitle.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.subtitle.fontSize,x:r.value.width/2,y:48+t.value.style.chart.layout.title.subtitle.fontSize+t.value.style.chart.layout.title.subtitle.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,me)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(l.color,.05)}${e.unref(o.opacity)[100-t.value.style.chart.layout.roots.gradientIntensity]}`},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ke)],8,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`branch_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,xe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(o.shiftHue)(l.color,.02)}${e.unref(o.opacity)[100-t.value.style.chart.layout.branches.gradientIntensity]}`},null,8,Be)],8,_e))),256)),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nutpick_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(o.opacity)[0]}`},null,8,Ne),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(o.opacity)[t.value.style.chart.layout.nuts.selected.gradientIntensity]}`},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(o.opacity)[0]}`},null,8,ze)],8,Ee),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(o.opacity)[0]}`},null,8,we),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(o.opacity)[t.value.style.chart.layout.nuts.gradientIntensity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(o.opacity)[0]}`},null,8,$e)],8,Ce),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_underlayer_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(o.opacity)[100]}`},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(o.opacity)[60]}`},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(o.opacity)[0]}`},null,8,De)],8,Te)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Ie,[e.createElementVNode("text",{x:f.value.seedX,y:32+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,Me),e.createElementVNode("text",{x:f.value.seedX,y:38+t.value.style.chart.layout.grandTotal.fontSize+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.grandTotal.formatter,k.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.grandTotal.prefix,v:k.value,s:t.value.style.chart.layout.grandTotal.suffix,r:t.value.style.chart.layout.grandTotal.roundingValue}))),9,Pe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(n,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
2
|
-
${l.x1},${l.y1+d}
|
|
3
|
-
C${l.x1-20},${l.y1+d}
|
|
4
|
-
${l.x1-80},${l.y1+d}
|
|
5
|
-
${F(l).x+F(l).r/2}, ${F(l).y}
|
|
6
|
-
`,stroke:`${l.color}${e.unref(o.opacity)[t.value.style.chart.layout.links.opacity]}`,fill:"none","stroke-width":"2","shape-rendering":"cirspEdges",style:e.normalizeStyle(`opacity:${g(l)?1:0}`),onClick:p},null,12,Oe))),256))]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,l=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,r:l.r,fill:t.value.style.chart.layout.roots.underlayerColor,stroke:"none",style:e.normalizeStyle(`cursor:pointer; opacity:${g(l)?1:.05}`)},null,12,Re))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(l,n)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,r:l.r,fill:t.value.style.chart.layout.roots.useGradient?`url(#root_gradient_${h.value}_${l.rootIndex})`:l.color,stroke:t.value.style.chart.layout.roots.stroke,"stroke-width":t.value.style.chart.layout.roots.strokeWidth,style:e.normalizeStyle(`cursor:pointer; opacity:${g(l)?1:.05}`),onClick:d=>G(l)},null,12,Xe))),256)),t.value.style.chart.layout.roots.labels.show?(e.openBlock(),e.createElementBlock("g",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(l,n)=>(e.openBlock(),e.createElementBlock("text",{x:l.x,y:l.y+t.value.style.chart.layout.roots.labels.fontSize/2.6,"text-anchor":"middle","font-size":t.value.style.chart.layout.roots.labels.fontSize,fill:t.value.style.chart.layout.roots.labels.adaptColorToBackground?e.unref(o.adaptColorToBackground)(l.color):t.value.style.chart.layout.roots.labels.color,"font-weight":"bold",style:e.normalizeStyle(`cursor:pointer; opacity:${g(l)?1:.05}`),onClick:d=>G(l)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.roots.labels.formatter,l.total,e.unref(o.dataLabel)({p:t.value.style.chart.layout.roots.labels.prefix,v:l.total,s:t.value.style.chart.layout.roots.labels.suffix,r:t.value.style.chart.layout.roots.labels.roundingValue}),{datapoint:l})),13,Ae))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,l=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&l.rootIndex===c.value.rootIndex||v.value&&l.rootIndex===v.value.rootIndex||b.value&&l.rootIndex===b.value.rootIndex?(e.openBlock(),e.createElementBlock("g",Ge,[e.createElementVNode("text",{x:l.x,y:l.y+l.r+24,"text-anchor":"middle",fill:t.value.style.chart.layout.roots.labels.name.color,"font-size":t.value.style.chart.layout.roots.labels.name.fontSize,"font-weight":t.value.style.chart.layout.roots.labels.name.bold?"bold":"normal",onClick:p},e.toDisplayString(l.name),9,Ue)])):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,l=>(e.openBlock(),e.createElementBlock("rect",{x:l.x1,y:l.y1,height:r.value.branchSize,width:l.x2-l.x1,fill:t.value.style.chart.layout.branches.underlayerColor,rx:t.value.style.chart.layout.branches.borderRadius,stroke:"none",style:e.normalizeStyle(`opacity:${g(l)?1:.05}`),onClick:n=>L(l)},null,12,qe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,n)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x1,y:l.y1,height:r.value.branchSize,width:l.x2-l.x1,fill:t.value.style.chart.layout.branches.useGradient?`url(#branch_gradient_${h.value}_${l.rootIndex})`:l.color,rx:t.value.style.chart.layout.branches.borderRadius,stroke:t.value.style.chart.layout.branches.stroke,"stroke-width":t.value.style.chart.layout.branches.strokeWidth,style:e.normalizeStyle(`cursor:pointer; opacity:${g(l)?1:.05}`),onClick:d=>L(l)},null,12,Ye))),256)),t.value.style.chart.layout.branches.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,l=>(e.openBlock(),e.createElementBlock("g",null,[l.proportionToRoot*100>t.value.style.chart.layout.branches.labels.dataLabels.hideUnderValue?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.x1+6,y:l.y1+r.value.branchSize/1.5,"text-anchor":"start",fill:e.unref(o.adaptColorToBackground)(l.color),"font-size":t.value.style.chart.layout.branches.labels.dataLabels.fontSize,"font-weight":"bold",style:e.normalizeStyle(`cursor:pointer; opacity:${g(l)?1:.05}`),onClick:n=>L(l)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.branches.labels.dataLabels.formatter,l.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.branches.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.branches.labels.dataLabels.suffix,r:t.value.style.chart.layout.branches.labels.dataLabels.roundingValue}),{datapoint:l})),13,We)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o.makeDonut)({series:l.breakdown,base:1},l.x2+24+t.value.style.chart.layout.nuts.offsetX,l.y1+r.value.branchSize/2,r.value.branchSize/3,r.value.branchSize/3),(d,i)=>(e.openBlock(),e.createElementBlock("path",{d:d.path,stroke:d.color,"stroke-width":10,fill:"none",style:e.normalizeStyle(`opacity:${g(l)?1:.1}`)},null,12,Ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,d=>(e.openBlock(),e.createElementBlock("circle",{cx:d.x2+24+t.value.style.chart.layout.nuts.offsetX,cy:d.y1+r.value.branchSize/2,r:6,fill:t.value.style.chart.backgroundColor,onClick:i=>A(d),style:{cursor:"pointer"}},null,8,Je))),256)),e.createElementVNode("circle",{fill:t.value.style.chart.layout.nuts.useGradient?`url(#nut_${h.value})`:"transparent",cx:l.x2+24+t.value.style.chart.layout.nuts.offsetX,cy:l.y1+r.value.branchSize/2,r:r.value.branchSize/2+2,onClick:d=>A(l),style:e.normalizeStyle(`cursor:pointer;opacity:${g(l)?1:.1}`)},null,12,Qe)]))),256)),t.value.style.chart.layout.branches.labels.show&&!v.value?(e.openBlock(),e.createElementBlock("g",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,l=>(e.openBlock(),e.createElementBlock("text",{x:l.x2+r.value.branchSize+24+t.value.style.chart.layout.nuts.offsetX,y:l.y1+r.value.branchSize/2+5,"font-size":t.value.style.chart.layout.branches.labels.fontSize,"font-weight":t.value.style.chart.layout.branches.labels.bold?"bold":"normal",fill:t.value.style.chart.layout.branches.labels.color,"text-anchor":"start",style:e.normalizeStyle(`opacity:${g(l)?1:.1}`)},e.toDisplayString(l.name),13,et))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:256+r.value.padding.left,x2:256+r.value.padding.left,y1:f.value.top,y2:f.value.bottom,stroke:t.value.style.chart.layout.verticalSeparator.stroke,"stroke-width":t.value.style.chart.layout.verticalSeparator.strokeWidth},null,8,tt),!c.value&&!v.value?(e.openBlock(),e.createElementBlock("foreignObject",{key:5,x:0,y:f.value.bottom,height:r.value.height-f.value.bottom,width:r.value.width,style:{overflow:"visible"},onClick:p},[e.createElementVNode("div",at,[e.createElementVNode("div",ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,l=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${t.value.style.chart.layout.legend.fontSize}px;`)},[(e.openBlock(),e.createElementBlock("svg",nt,[e.createElementVNode("circle",{cx:"10",cy:"10",r:"10",fill:l.color,stroke:"none"},null,8,rt)])),e.createElementVNode("span",null,e.toDisplayString(l.name)+":",1),e.createElementVNode("b",null,e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.roots.labels.formatter,l.total,e.unref(o.dataLabel)({p:t.value.style.chart.layout.legend.prefix,v:l.total,s:t.value.style.chart.layout.legend.suffix,r:t.value.style.chart.layout.legend.roundingValue}),{datapoint:l})),1),e.createTextVNode(" ("+e.toDisplayString(e.unref(o.dataLabel)({v:l.total/k.value*100,s:"%",r:t.value.style.chart.layout.legend.roundingPercentage}))+") ",1)],4))),256))])])],8,lt)):e.createCommentVNode("",!0),c.value&&B.value?(e.openBlock(),e.createElementBlock("g",st,[(e.openBlock(),e.createElementBlock("foreignObject",{x:0,y:re(),height:r.value.height-f.value.bottom,width:r.value.width,style:{overflow:"visible"},onClick:p},[e.createElementVNode("div",ct,[e.createElementVNode("b",null,e.toDisplayString(c.value.name),1),e.createElementVNode("div",it,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.breakdown,(l,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${t.value.style.chart.layout.legend.fontSize}px;`)},[(e.openBlock(),e.createElementBlock("svg",dt,[e.createElementVNode("circle",{cx:"10",cy:"10",r:"10",fill:l.color,stroke:"none"},null,8,yt)])),e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString(l.name)+": ",1),e.createElementVNode("b",null,e.toDisplayString(t.value.style.chart.layout.legend.prefix)+" "+e.toDisplayString(l.value.toFixed(t.value.style.chart.layout.nuts.selected.labels.roundingValue))+" "+e.toDisplayString(t.value.style.chart.layout.legend.suffix),1),e.createTextVNode(" ("+e.toDisplayString((l.proportionToBranch*100).toFixed(t.value.style.chart.layout.nuts.selected.labels.roundingPercentage))+"%)",1)])],4))),256))])])],8,ut)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,l=>(e.openBlock(),e.createElementBlock("g",null,[z(l)?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(o.calcNutArrowPath)(l),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},null,10,vt)):e.createCommentVNode("",!0)]))),256)),e.createElementVNode("circle",{cx:c.value.x2+24+t.value.style.chart.layout.nuts.offsetX,cy:c.value.y1+r.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${h.value})`,onClick:N,class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},null,10,ht),e.createElementVNode("circle",{cx:c.value.x2+24+t.value.style.chart.layout.nuts.offsetX,cy:c.value.y1+r.value.branchSize/2,r:118,fill:t.value.style.chart.backgroundColor,onClick:N,class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},null,10,pt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,l=>(e.openBlock(),e.createElementBlock("path",{d:l.path,stroke:l.color,"stroke-width":64,fill:"none",onClick:N,class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},null,10,ft))),256)),e.createElementVNode("circle",{cx:c.value.x2+24+t.value.style.chart.layout.nuts.offsetX,cy:c.value.y1+r.value.branchSize/2,r:100,fill:`url(#nutpick_${h.value})`,onClick:N,class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},null,10,mt),e.createElementVNode("circle",{cx:c.value.x2+24+t.value.style.chart.layout.nuts.offsetX,cy:c.value.y1+r.value.branchSize/2,r:48,fill:t.value.style.chart.backgroundColor,onClick:N,class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},null,10,bt),e.createElementVNode("text",{x:c.value.x2+24+t.value.style.chart.layout.nuts.offsetX,y:c.value.y1+8,fill:t.value.style.chart.layout.nuts.selected.labels.core.total.color,"font-size":t.value.style.chart.layout.nuts.selected.labels.core.total.fontSize,"font-weight":t.value.style.chart.layout.nuts.selected.labels.core.total.bold?"bold":"normal","text-anchor":"middle",onClick:N,class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},e.toDisplayString(t.value.translations.total),11,gt),e.createElementVNode("text",{x:c.value.x2+24+t.value.style.chart.layout.nuts.offsetX,y:c.value.y1+36,fill:t.value.style.chart.layout.nuts.selected.labels.core.value.color,"font-size":t.value.style.chart.layout.nuts.selected.labels.core.value.fontSize,"font-weight":t.value.style.chart.layout.nuts.selected.labels.core.value.bold?"bold":"normal","text-anchor":"middle",onClick:N,class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.nuts.selected.labels.dataLabels.formatter,c.value.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.nuts.selected.labels.core.value.prefix,v:c.value.value,s:t.value.style.chart.layout.nuts.selected.labels.core.value.suffix,r:t.value.style.chart.layout.nuts.selected.roundingValue}),{datapoint:c.value})),11,kt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[z(l)?(e.openBlock(),e.createElementBlock("text",{key:0,x:e.unref(o.calcMarkerOffsetX)(l).x,"text-anchor":e.unref(o.calcMarkerOffsetX)(l).anchor,y:e.unref(o.calcMarkerOffsetY)(l),fill:l.color,"font-size":t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.nuts.selected.labels.dataLabels.bold?"bold":""}`),class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")}," ⬤ ",14,_t)):e.createCommentVNode("",!0),z(l)?(e.openBlock(),e.createElementBlock("text",{key:1,x:e.unref(o.calcMarkerOffsetX)(l,!0).x,"text-anchor":e.unref(o.calcMarkerOffsetX)(l,!0).anchor,y:e.unref(o.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.nuts.selected.labels.dataLabels.color,"font-size":t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.nuts.selected.labels.dataLabels.bold?"bold":""}`),class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},e.toDisplayString(c.value.breakdown[n].name),15,xt)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[z(l)?(e.openBlock(),e.createElementBlock("text",{key:0,x:e.unref(o.calcMarkerOffsetX)(l,!0).x,"text-anchor":e.unref(o.calcMarkerOffsetX)(l).anchor,y:e.unref(o.calcMarkerOffsetY)(l)+t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.nuts.selected.labels.dataLabels.color,"font-size":t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.nuts.selected.labels.dataLabels.bold?"bold":""}`),class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},e.toDisplayString(e.unref(o.dataLabel)({v:c.value.breakdown[n].value/c.value.value*100,s:"%",r:t.value.style.chart.layout.nuts.selected.labels.roundingPercentage}))+" "+e.toDisplayString(t.value.translations.of)+" "+e.toDisplayString(c.value.breakdown[n].branchName)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.nuts.selected.labels.dataLabels.formatter,c.value.breakdown[n].value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.nuts.selected.labels.dataLabels.prefix,v:c.value.breakdown[n].value,s:t.value.style.chart.layout.nuts.selected.labels.dataLabels.suffix,r:t.value.style.chart.layout.nuts.selected.roundingValue}),{datapoint:B.value,seriesIndex:n})),15,Bt)):e.createCommentVNode("",!0),z(l)?(e.openBlock(),e.createElementBlock("text",{key:1,x:e.unref(o.calcMarkerOffsetX)(l,!0).x,"text-anchor":e.unref(o.calcMarkerOffsetX)(l).anchor,y:e.unref(o.calcMarkerOffsetY)(l)+t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize*2,fill:t.value.style.chart.layout.nuts.selected.labels.dataLabels.color,"font-size":t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.nuts.selected.labels.dataLabels.bold?"bold":""}`),class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},e.toDisplayString(e.unref(o.dataLabel)({v:c.value.breakdown[n].proportionToRoot*100,s:"%",r:t.value.style.chart.layout.nuts.selected.labels.roundingPercentage}))+" "+e.toDisplayString(t.value.translations.of)+" "+e.toDisplayString(c.value.breakdown[n].rootName),15,Et)):e.createCommentVNode("",!0),z(l)?(e.openBlock(),e.createElementBlock("text",{key:2,x:e.unref(o.calcMarkerOffsetX)(l,!0).x,"text-anchor":e.unref(o.calcMarkerOffsetX)(l).anchor,y:e.unref(o.calcMarkerOffsetY)(l)+t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize*3,fill:t.value.style.chart.layout.nuts.selected.labels.dataLabels.color,"font-size":t.value.style.chart.layout.nuts.selected.labels.dataLabels.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.nuts.selected.labels.dataLabels.bold?"bold":""}`),class:e.normalizeClass(t.value.style.chart.layout.nuts.selected.useMotion?"vue-ui-chestnut-animated":"")},e.toDisplayString(e.unref(o.dataLabel)({v:c.value.breakdown[n].proportionToTree*100,s:"%",r:t.value.style.chart.layout.nuts.selected.labels.roundingPercentage}))+" "+e.toDisplayString(t.value.translations.proportionToTree),15,Nt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,l=>(e.openBlock(),e.createElementBlock("g",null,[v.value&&v.value.id===l.id&&!c.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.x1+6,y:l.y1+r.value.branchSize+24,"font-weight":"bold","text-anchor":"start","font-size":t.value.style.chart.layout.branches.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.branches.labels.color,onClick:p},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.branches.labels.dataLabels.formatter,l.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.branches.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.branches.labels.dataLabels.suffix,r:t.value.style.chart.layout.branches.labels.dataLabels.roundingValue}),{datapoint:l})),9,St)):e.createCommentVNode("",!0),v.value&&v.value.id===l.id&&!c.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:l.x1+6,y:l.y1+r.value.branchSize+48,"text-anchor":"start","font-size":t.value.style.chart.layout.branches.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.branches.labels.color,onClick:p},e.toDisplayString(e.unref(o.dataLabel)({v:l.proportionToRoot*100,s:"%",r:t.value.style.chart.layout.branches.labels.dataLabels.roundingPercentage}))+" "+e.toDisplayString(t.value.translations.of)+" "+e.toDisplayString(l.rootName),9,zt)):e.createCommentVNode("",!0),v.value&&v.value.id===l.id&&!c.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.x1+6,y:l.y1+r.value.branchSize+72,"text-anchor":"start","font-size":t.value.style.chart.layout.branches.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.branches.labels.color,onClick:p},e.toDisplayString(e.unref(o.dataLabel)({v:l.value/k.value*100,s:"%",r:t.value.style.chart.layout.branches.labels.dataLabels.roundingPercentage}))+" "+e.toDisplayString(t.value.translations.proportionToTree),9,Ct)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(a.$slots,"svg",{svg:r.value},void 0,!0)],14,he)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",wt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(M)||e.unref(P)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ce.default,{key:3,config:{type:"chestnut",style:{backgroundColor:t.value.style.chart.backgroundColor,chestnut:{color:"#CCCCCC"}}}},null,8,["config"])),e.renderSlot(a.$slots,"legend",{legend:m.value},void 0,!0),C.value?(e.openBlock(),e.createBlock(de.default,{key:4,hideDetails:"",config:{open:w.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:T,class:"vue-ui-chestnut-table"},[e.createElementVNode("div",Vt,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; left: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:s[0]||(s[0]=l=>w.value.showTable=!1),onKeypress:s[1]||(s[1]=e.withKeys(l=>w.value.showTable=!1,["enter"]))},[e.createVNode(ie.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%"},class:e.normalizeClass({"vue-ui-responsive":X.value})},[e.createElementVNode("table",$t,[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.layout.title.text)+" ",1),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",Tt,e.toDisplayString(t.value.style.chart.layout.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(u.value.head,l=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},e.toDisplayString(l),5))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value.body,(l,n)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%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}`),"data-cell":u.value.head[0]},[e.createElementVNode("div",Lt,[u.value.body[n-1]&&u.value.body[n-1].rootName===l.rootName?(e.openBlock(),e.createElementBlock("span",Dt)):(e.openBlock(),e.createElementBlock("span",It,e.toDisplayString(l.rootName),1))])],12,Ft),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[1]},[e.createElementVNode("div",Pt,[u.value.body[n-1]&&u.value.body[n-1].rootName===l.rootName?(e.openBlock(),e.createElementBlock("span",Ot)):(e.openBlock(),e.createElementBlock("span",Rt,e.toDisplayString(l.rootValue.toFixed(t.value.table.td.roundingValue)),1))])],12,Mt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[2]},[e.createElementVNode("div",jt,[u.value.body[n-1]&&u.value.body[n-1].rootName===l.rootName?(e.openBlock(),e.createElementBlock("span",At)):(e.openBlock(),e.createElementBlock("span",Gt,e.toDisplayString((l.rootToTotal*100).toFixed(t.value.table.td.roundingPercentage))+"% ",1))])],12,Xt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[3]},[e.createElementVNode("div",qt,[u.value.body[n-1]&&u.value.body[n-1].branchName===l.branchName?(e.openBlock(),e.createElementBlock("span",Yt)):(e.openBlock(),e.createElementBlock("span",Ht,e.toDisplayString(l.branchName),1))])],12,Ut),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[4]},[e.createElementVNode("div",Kt,[u.value.body[n-1]&&u.value.body[n-1].branchName===l.branchName?(e.openBlock(),e.createElementBlock("span",Jt)):(e.openBlock(),e.createElementBlock("span",Qt,e.toDisplayString(l.branchValue.toFixed(t.value.table.td.roundingValue)),1))])],12,Wt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[5]},[e.createElementVNode("div",el,[u.value.body[n-1]&&u.value.body[n-1].branchName===l.branchName?(e.openBlock(),e.createElementBlock("span",tl)):(e.openBlock(),e.createElementBlock("span",ll,e.toDisplayString((l.branchToRoot*100).toFixed(t.value.table.td.roundingPercentage))+"% ",1))])],12,Zt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[6]},[e.createElementVNode("div",ol,[u.value.body[n-1]&&u.value.body[n-1].branchName===l.branchName?(e.openBlock(),e.createElementBlock("span",nl)):(e.openBlock(),e.createElementBlock("span",rl,e.toDisplayString((l.branchToTotal*100).toFixed(t.value.table.td.roundingPercentage))+"% ",1))])],12,al),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[7]},[e.createElementVNode("div",ul,e.toDisplayString(l.nutName),1)],12,sl),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[8]},[e.createElementVNode("div",il,e.toDisplayString(l.nutValue.toFixed(t.value.table.td.roundingValue)),1)],12,cl),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[9]},[e.createElementVNode("div",yl,e.toDisplayString((l.nutToBranch*100).toFixed(t.value.table.td.roundingPercentage))+"% ",1)],12,dl),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[10]},[e.createElementVNode("div",hl,e.toDisplayString((l.nutToRoot*100).toFixed(t.value.table.td.roundingPercentage))+"% ",1)],12,vl),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":u.value.head[11]},[e.createElementVNode("div",fl,e.toDisplayString((l.nutToTotal*100).toFixed(t.value.table.td.roundingPercentage))+"% ",1)],12,pl)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ve))}},bl=ye._export_sfc(ml,[["__scopeId","data-v-3571ba27"]]);exports.default=bl;
|