vue-data-ui 2.10.2-beta.1 → 2.10.2
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-Durz-Lij.js → Arrow-B2-rOYz8.js} +1 -1
- package/dist/{Arrow-D_EAhs0m.cjs → Arrow-D6UBVyNr.cjs} +1 -1
- package/dist/{BaseIcon-BnWfrW1B.js → BaseIcon-Br5G8Cdk.js} +1 -1
- package/dist/{BaseIcon-DPT0BaqM.cjs → BaseIcon-DfoJJxST.cjs} +1 -1
- package/dist/{ColorPicker-COqCncYu.js → ColorPicker-CiQzB3a-.js} +3 -3
- package/dist/{ColorPicker-CYaUst4k.cjs → ColorPicker-Dvgprgpv.cjs} +1 -1
- package/dist/{DataTable-DSiJ_YaA.cjs → DataTable-CGucPqAQ.cjs} +1 -1
- package/dist/{DataTable-CyKnS5wp.js → DataTable-Dk-94kK2.js} +2 -2
- package/dist/{Legend-RwWQ6l8r.cjs → Legend-B9aoKeq3.cjs} +1 -1
- package/dist/{Legend-Dj_es4iV.js → Legend-Cx6NYPTA.js} +2 -2
- package/dist/{PackageVersion-vJyd5YD8.js → PackageVersion-BdNfnIm2.js} +1 -1
- package/dist/{PackageVersion-DCriWnX3.cjs → PackageVersion-C2bjLIu9.cjs} +1 -1
- package/dist/{PenAndPaper-lj1PPAzR.cjs → PenAndPaper-CJIFAI78.cjs} +1 -1
- package/dist/{PenAndPaper-BgZ0aAW2.js → PenAndPaper-wrVNMaG8.js} +3 -3
- package/dist/{Shape-BgbyzOCz.cjs → Shape-Cn2RU1NY.cjs} +1 -1
- package/dist/{Shape-0QfdCJdX.js → Shape-vIKj52KP.js} +1 -1
- package/dist/{Slicer-B-i-6x8C.cjs → Slicer-t3EfI94H.cjs} +1 -1
- package/dist/{Slicer-lB3lQUsg.js → Slicer-yki6JqTB.js} +2 -2
- package/dist/{Title-zlQvBTwR.cjs → Title-Bae0QJu7.cjs} +1 -1
- package/dist/{Title-UITSl88n.js → Title-CDYBDpu3.js} +1 -1
- package/dist/{Tooltip-QHKaXOYQ.js → Tooltip-BzsAOdBd.js} +1 -1
- package/dist/{Tooltip-DY4rXOAP.cjs → Tooltip-CfqYTd5O.cjs} +1 -1
- package/dist/{dom-to-png-BoSiNLCZ.cjs → dom-to-png-DgRl9bEH.cjs} +1 -1
- package/dist/{dom-to-png-IpAl2vt0.js → dom-to-png-IAiARGiU.js} +1 -1
- package/dist/{img-1Hu7T2L5.js → img-DaDUVggy.js} +1 -1
- package/dist/{img-DOJMU48p.cjs → img-DxEvbX77.cjs} +1 -1
- package/dist/{index-Br1RehUb.js → index-BI6O7K58.js} +1 -1
- package/dist/{index-DiJiQMBB.cjs → index-DgIVCHLv.cjs} +1 -1
- package/dist/{pdf-C6M_O5rS.js → pdf-DBVNp7s2.js} +1 -1
- package/dist/{pdf-Bg3JLNad.cjs → pdf-Dq3h9PEr.cjs} +1 -1
- package/dist/{useNestedProp-DqEOzYzu.cjs → useNestedProp-CCR03NVM.cjs} +1 -1
- package/dist/{useNestedProp-DXxFHEXa.js → useNestedProp-Cvz4MkSy.js} +1 -1
- package/dist/{usePrinter-Bkd5ycBt.cjs → usePrinter-B2xVvtiy.cjs} +1 -1
- package/dist/{usePrinter-BotFh1ji.js → usePrinter-Jr3eyr8H.js} +3 -3
- package/dist/{vue-data-ui-DmyMMva1.cjs → vue-data-ui-DhWKehHS.cjs} +1 -1
- package/dist/{vue-data-ui-ceT6Ds8c.js → vue-data-ui-bm5wfGa_.js} +62 -62
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BuLR9KPG.cjs → vue-ui-3d-bar-Bpm8dKya.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-D8gTYv2q.js → vue-ui-3d-bar-CHOAZoDV.js} +9 -9
- package/dist/{vue-ui-accordion-P5hXhzth.cjs → vue-ui-accordion-DE1isSE9.cjs} +1 -1
- package/dist/{vue-ui-accordion-BlsQ4IFe.js → vue-ui-accordion-ldF7KsjV.js} +3 -3
- package/dist/{vue-ui-age-pyramid-DQjIgLoF.cjs → vue-ui-age-pyramid-BnHOxOPT.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-C_WRa17B.js → vue-ui-age-pyramid-BuKSta-B.js} +10 -10
- package/dist/{vue-ui-annotator-SHkR_9cj.cjs → vue-ui-annotator-B9j16TKW.cjs} +1 -1
- package/dist/{vue-ui-annotator-BI4gOYbV.js → vue-ui-annotator-BBuH-QB4.js} +2 -2
- package/dist/{vue-ui-bullet-DQnycr6Q.js → vue-ui-bullet-B0C_rPTQ.js} +8 -8
- package/dist/{vue-ui-bullet-Dv-CldQs.cjs → vue-ui-bullet-CRChR0Qe.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Bd9v_ssR.cjs → vue-ui-candlestick-Bq66GLxw.cjs} +1 -1
- package/dist/{vue-ui-candlestick-CxPvkEtR.js → vue-ui-candlestick-By5MsCcS.js} +11 -11
- package/dist/{vue-ui-carousel-table-DuwoXFJH.js → vue-ui-carousel-table-BOtjI2Ov.js} +4 -4
- package/dist/{vue-ui-carousel-table-Dwvy8FmR.cjs → vue-ui-carousel-table-CyywZulq.cjs} +1 -1
- package/dist/{vue-ui-chestnut-1P_kvZFR.js → vue-ui-chestnut-BS2kXrPU.js} +8 -8
- package/dist/{vue-ui-chestnut-Da5lD-jy.cjs → vue-ui-chestnut-D8QPZS8n.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-_d0WvVlg.js → vue-ui-circle-pack-C8m10WZ0.js} +9 -9
- package/dist/{vue-ui-circle-pack-H7fs4aWV.cjs → vue-ui-circle-pack-iOxdB75t.cjs} +1 -1
- package/dist/{vue-ui-cursor-CcxO5N6B.js → vue-ui-cursor-Bn-CCFO0.js} +2 -2
- package/dist/{vue-ui-cursor-CeAtprXI.cjs → vue-ui-cursor-Ccym3tFb.cjs} +1 -1
- package/dist/{vue-ui-dashboard-nLTbt8rE.cjs → vue-ui-dashboard-Cw4IXhXY.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DQql8FoJ.js → vue-ui-dashboard-D-vs2N_7.js} +62 -62
- package/dist/{vue-ui-digits-CIm6jt9J.js → vue-ui-digits-BXBXg7wv.js} +2 -2
- package/dist/{vue-ui-digits-DYzQpKDk.cjs → vue-ui-digits-D66h3nUw.cjs} +1 -1
- package/dist/{vue-ui-donut-CMmo-xas.js → vue-ui-donut-BGZIwC5D.js} +12 -12
- package/dist/{vue-ui-donut-BZBTtRIT.cjs → vue-ui-donut-Bf3THSxi.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CmVkOgHk.js → vue-ui-donut-evolution-5yOibvNM.js} +11 -11
- package/dist/{vue-ui-donut-evolution-BigkaF3K.cjs → vue-ui-donut-evolution-xxrUJzgG.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DNRxfbMB.js → vue-ui-dumbbell-C-KqKhxI.js} +10 -10
- package/dist/{vue-ui-dumbbell-COVwDZf9.cjs → vue-ui-dumbbell-CWn7cNsm.cjs} +1 -1
- package/dist/{vue-ui-flow-CWn5Xgfv.js → vue-ui-flow-D4_2VnaB.js} +9 -9
- package/dist/{vue-ui-flow-C2-V4oXf.cjs → vue-ui-flow-DFxWNRRJ.cjs} +1 -1
- package/dist/{vue-ui-funnel-Caa_fg2B.js → vue-ui-funnel-ADEjZ8yz.js} +9 -9
- package/dist/{vue-ui-funnel-CzUX32Ub.cjs → vue-ui-funnel-DIoqpwbm.cjs} +1 -1
- package/dist/{vue-ui-galaxy-Dh6mXUEh.cjs → vue-ui-galaxy-BRle40mR.cjs} +1 -1
- package/dist/{vue-ui-galaxy-DlPI9C4p.js → vue-ui-galaxy-DLtA9Ebb.js} +11 -11
- package/dist/{vue-ui-gauge-C0-BHMRe.cjs → vue-ui-gauge-B4vEWkRk.cjs} +1 -1
- package/dist/{vue-ui-gauge-DCKwx-39.js → vue-ui-gauge-BVj-IBdi.js} +7 -7
- package/dist/{vue-ui-gizmo-Dbyg4lfp.js → vue-ui-gizmo-BTe8CPyi.js} +3 -3
- package/dist/{vue-ui-gizmo-CBEmt6wS.cjs → vue-ui-gizmo-BwBtkZ5z.cjs} +1 -1
- package/dist/{vue-ui-heatmap-B8aHMTRT.js → vue-ui-heatmap-DrXMOxbe.js} +10 -10
- package/dist/{vue-ui-heatmap-L44qq3tT.cjs → vue-ui-heatmap-VdFtflO6.cjs} +1 -1
- package/dist/{vue-ui-history-plot-cK3Eyct-.cjs → vue-ui-history-plot-B-ScOcEy.cjs} +1 -1
- package/dist/{vue-ui-history-plot-Db9VBFJo.js → vue-ui-history-plot-_DfuZIMP.js} +11 -11
- package/dist/{vue-ui-kpi-3Y6KGCu8.cjs → vue-ui-kpi-DSQV0Kf2.cjs} +1 -1
- package/dist/{vue-ui-kpi-DTVFlqqr.js → vue-ui-kpi-DfFiDtCP.js} +3 -3
- package/dist/{vue-ui-mini-loader-C0-qR0Wv.js → vue-ui-mini-loader-1JZipPcP.js} +2 -2
- package/dist/{vue-ui-mini-loader-DYQjIOkq.cjs → vue-ui-mini-loader-CDOlO_1_.cjs} +1 -1
- package/dist/{vue-ui-molecule-CZYTkXRy.js → vue-ui-molecule-Db_C7mVS.js} +11 -11
- package/dist/{vue-ui-molecule-BsbB0T8n.cjs → vue-ui-molecule-jEcRTe4V.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-Dcgb3cQR.cjs → vue-ui-mood-radar-BoKSTE-Y.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-zWFTh0WG.js → vue-ui-mood-radar-m48vvkft.js} +11 -11
- package/dist/{vue-ui-nested-donuts-Ci2TbHCY.js → vue-ui-nested-donuts-DNhMOryo.js} +11 -11
- package/dist/{vue-ui-nested-donuts-CElXmrE_.cjs → vue-ui-nested-donuts-ihd00Tpn.cjs} +1 -1
- package/dist/{vue-ui-onion-DTYqd0S7.cjs → vue-ui-onion-D9AHOWa5.cjs} +1 -1
- package/dist/{vue-ui-onion-C3w_0U-6.js → vue-ui-onion-YKxsqnI7.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-DmAaG5vE.js → vue-ui-parallel-coordinate-plot-7SCwFkrU.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-DXgrYF8V.cjs → vue-ui-parallel-coordinate-plot-BmO6zenq.cjs} +1 -1
- package/dist/{vue-ui-quadrant-xIalSKQB.js → vue-ui-quadrant-Bi0by7IK.js} +12 -12
- package/dist/{vue-ui-quadrant--MXxqtPm.cjs → vue-ui-quadrant-CAJ4dTBu.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DrEeKIP-.cjs → vue-ui-quick-chart-C37lGqa1.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CSffm4a5.js → vue-ui-quick-chart-DlV0Qv_x.js} +9 -9
- package/dist/{vue-ui-radar-BkYTilrU.js → vue-ui-radar-B14zLIww.js} +12 -12
- package/dist/{vue-ui-radar-Baujx0zJ.cjs → vue-ui-radar-H08KmB3s.cjs} +1 -1
- package/dist/{vue-ui-rating-CoCspb5w.cjs → vue-ui-rating-CYarWaTf.cjs} +1 -1
- package/dist/{vue-ui-rating-D9mcamSQ.js → vue-ui-rating-CdSQUBG6.js} +2 -2
- package/dist/{vue-ui-relation-circle-BOQbjwio.cjs → vue-ui-relation-circle-A4Vw8kYl.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-D1QRMkRv.js → vue-ui-relation-circle-IzAvPPGl.js} +7 -7
- package/dist/{vue-ui-ridgeline-DAhVh2wO.js → vue-ui-ridgeline-BF5X6KQR.js} +12 -12
- package/dist/{vue-ui-ridgeline-evw3STiF.cjs → vue-ui-ridgeline-BaHgOn_p.cjs} +1 -1
- package/dist/{vue-ui-rings-BbaMc09d.js → vue-ui-rings-DUhnXy1h.js} +12 -12
- package/dist/{vue-ui-rings-BhG1riq2.cjs → vue-ui-rings-DnVeMrOw.cjs} +1 -1
- package/dist/{vue-ui-scatter-BA1innim.js → vue-ui-scatter-D7bXuxob.js} +12 -12
- package/dist/{vue-ui-scatter-D2EXkBxx.cjs → vue-ui-scatter-DoGX7iHp.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DEI0qJZY.cjs → vue-ui-skeleton-DeEGdJEn.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BksknW8F.js → vue-ui-skeleton-Dxm7rqic.js} +3 -3
- package/dist/{vue-ui-smiley-D_lDFgTX.js → vue-ui-smiley-95l4UiqT.js} +2 -2
- package/dist/{vue-ui-smiley-B4dNIhTF.cjs → vue-ui-smiley-DmAtXVht.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-JPsaMYzx.cjs → vue-ui-spark-trend-C3CO25Jy.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-YVwnvmen.js → vue-ui-spark-trend-DdH43oVm.js} +5 -5
- package/dist/{vue-ui-sparkbar-P7ab216P.cjs → vue-ui-sparkbar-C2roDWfv.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-COtSp75m.js → vue-ui-sparkbar-DTe3QrR3.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DBTs_fko.js → vue-ui-sparkgauge-BwclNj3C.js} +4 -4
- package/dist/{vue-ui-sparkgauge-BrmBThWX.cjs → vue-ui-sparkgauge-nq6-9TjT.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-Bbui1Mjp.cjs → vue-ui-sparkhistogram-BdWirDjI.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-D9ltgqDi.js → vue-ui-sparkhistogram-Brau127G.js} +5 -5
- package/dist/{vue-ui-sparkline-DkRtUZjr.cjs → vue-ui-sparkline-B2mOJzkG.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DxlyRPM_.js → vue-ui-sparkline-qqfyQyVz.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-CAAfi-lB.cjs → vue-ui-sparkstackbar-BJl9lbBp.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DjrHKvP-.js → vue-ui-sparkstackbar-DLlDU0B2.js} +5 -5
- package/dist/{vue-ui-stackbar-hDFg5vfU.cjs → vue-ui-stackbar-CEvmDjq3.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BQw6lOEm.js → vue-ui-stackbar-RRGnblUm.js} +13 -13
- package/dist/{vue-ui-strip-plot-D5X65rGR.js → vue-ui-strip-plot-C9LKjSkW.js} +11 -11
- package/dist/{vue-ui-strip-plot-BuA2QRro.cjs → vue-ui-strip-plot-Dlsv-yRI.cjs} +1 -1
- package/dist/{vue-ui-table-4x1r1zJ4.js → vue-ui-table-DxdJ151X.js} +3 -3
- package/dist/{vue-ui-table-heatmap-BuGa0tHQ.cjs → vue-ui-table-heatmap-BhxOvDDW.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-gU7N3s52.js → vue-ui-table-heatmap-CzGeU_uL.js} +4 -4
- package/dist/{vue-ui-table-DN4G0Xcv.cjs → vue-ui-table-qULtmHGA.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-B3YUUzDD.cjs → vue-ui-table-sparkline-D1hriLB0.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-CrNEnGwB.js → vue-ui-table-sparkline-DSZhEDKX.js} +5 -5
- package/dist/{vue-ui-thermometer-D5NxA-Pu.cjs → vue-ui-thermometer-Cvnh4jvE.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BRTBFuLr.js → vue-ui-thermometer-Pw4X3Bun.js} +7 -7
- package/dist/{vue-ui-timer-CUdy26j8.cjs → vue-ui-timer-BlmIXPv6.cjs} +1 -1
- package/dist/{vue-ui-timer-DjpkBrmE.js → vue-ui-timer-CvvexEeN.js} +5 -5
- package/dist/{vue-ui-tiremarks-DK1Y5NS-.cjs → vue-ui-tiremarks-BAkMBz3o.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-C3oH7Ida.js → vue-ui-tiremarks-DbZQvV_2.js} +7 -7
- package/dist/{vue-ui-treemap-B9Ttncgf.js → vue-ui-treemap-CF-RjM16.js} +12 -12
- package/dist/{vue-ui-treemap-DeDaY1tK.cjs → vue-ui-treemap-a6b1vWy-.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-jQ534ONL.cjs → vue-ui-vertical-bar-Dm5zMIeE.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-DbGWFmAZ.js → vue-ui-vertical-bar-ZJbSI-xR.js} +12 -12
- package/dist/{vue-ui-waffle-BEAMerlK.js → vue-ui-waffle-I9AKkwb4.js} +12 -12
- package/dist/{vue-ui-waffle-Dlq-kfVb.cjs → vue-ui-waffle-XNiw-qtb.cjs} +1 -1
- package/dist/{vue-ui-wheel-BwxXgxYN.js → vue-ui-wheel-BA7wZUZL.js} +7 -7
- package/dist/{vue-ui-wheel-BpoGeeG1.cjs → vue-ui-wheel-DJUrO6CA.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DRihn0ID.js → vue-ui-word-cloud-BVqb1Yix.js} +11 -11
- package/dist/vue-ui-word-cloud-ByjkRq1g.cjs +1 -0
- package/dist/{vue-ui-world-zCrAoO8x.cjs → vue-ui-world-9nlcZMH1.cjs} +1 -1
- package/dist/{vue-ui-world-BvwaCfKu.js → vue-ui-world-DkYRlp5s.js} +11 -11
- package/dist/{vue-ui-xy-D8ZtpWDi.js → vue-ui-xy-B1HwPMFi.js} +16 -16
- package/dist/{vue-ui-xy-DTbAGaIM.cjs → vue-ui-xy-B4sqGuw6.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-DI6-54yO.cjs → vue-ui-xy-canvas-C-rykR_6.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-DQhK_N_z.js → vue-ui-xy-canvas-CGCtkn9g.js} +12 -12
- package/package.json +1 -1
- package/dist/vue-ui-word-cloud-Bwp55Vjk.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DiJiQMBB.cjs"),_=require("./useNestedProp-DqEOzYzu.cjs"),M=require("./Shape-BgbyzOCz.cjs"),O=require("./vue-ui-skeleton-DEI0qJZY.cjs"),q=require("./PackageVersion-DCriWnX3.cjs"),H=require("./useChartAccessibility-Cm7nkzTG.cjs"),I=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U={key:0},W={key:1},j=["xmlns","viewBox"],P=["width","height"],R=["id"],G=["stop-color"],T=["stop-color"],X=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],Z=["stop-color"],ee={key:1},te=["x","y","height","width","fill","stroke","stroke-width","rx"],le={key:2},oe=["x","y","font-size","font-weight","fill"],ae=["x","y","font-size","fill"],se=["x","y","font-size","fill"],ne=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],re={key:2,ref:"source",dir:"auto"},ie={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:x}){e.useCssVars(o=>({"40b52890":L.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),c=B,f=e.computed(()=>!!c.dataset&&c.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(c.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):c.dataset.forEach((o,r)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:r})})})}const v=e.ref(a.createUid()),t=e.computed({get:()=>b(),set:o=>o}),{svgRef:w}=H.useChartAccessibility({config:t.value.style.title});function b(){const o=_.useNestedProp({userConfig:c.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||c.config,defaultConfig:o})}:o}e.watch(()=>c.config,o=>{t.value=b(),k()},{deep:!0});const u=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,s=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=r-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=r-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:s,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),C=e.computed(()=>Math.max(...c.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/C.value}const i=e.computed(()=>c.dataset.map((o,r)=>{const l=$(o.value||0),s=u.value.drawingHeight*l,d=u.value.drawingWidth/c.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=u.value.centerY-s/2,m=u.value.left+(y/2+r*d),V=u.value.left+r*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),z=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,h):a.setOpacity(t.value.style.bars.colors.negative,h),D=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,A=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,F=m+p/2;return{...o,color:z,gradient:A,height:s,intensity:h,proportion:l,stroke:D,textAnchor:F,trapX:V,unitWidth:d,width:p,x:m,y:g}})),n=e.ref(null),S=x;function N(o,r){S("selectDatapoint",{datapoint:o,index:r})}const L=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-histogram",style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:r[1]||(r[1]=l=>n.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),n.value!==null?(e.openBlock(),e.createElementBlock("span",U,"- "+e.toDisplayString(i.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,i.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:i.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(i.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",W,"("+e.toDisplayString(i.value[n.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:w,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:{overflow:"visible"}},[e.createVNode(q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width,height:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,P)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.positive,.05),l.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,T)],8,R))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.negative,.05),l.intensity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,J)],8,X))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(l.color,.05),l.intensity)},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,Z)],8,K))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,te))),256))])):(e.openBlock(),e.createElementBlock("g",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createBlock(M._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,l.value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:l.value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[n.value],seriesIndex:n.value})),9,oe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,ae)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:u.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,se)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:u.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>n.value=s,onMouseleave:r[0]||(r[0]=d=>n.value=null),stroke:n.value!==null&&n.value===s?t.value.style.selector.stroke:"","stroke-width":n.value!==null&&n.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>N(l,s)},null,40,ne)]))),256))],8,j)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(O.default,{key:3,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},ue=I._export_sfc(ie,[["__scopeId","data-v-c92ac914"]]);exports.default=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DgIVCHLv.cjs"),_=require("./useNestedProp-CCR03NVM.cjs"),M=require("./Shape-Cn2RU1NY.cjs"),O=require("./vue-ui-skeleton-DeEGdJEn.cjs"),q=require("./PackageVersion-C2bjLIu9.cjs"),H=require("./useChartAccessibility-Cm7nkzTG.cjs"),I=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U={key:0},W={key:1},j=["xmlns","viewBox"],P=["width","height"],R=["id"],G=["stop-color"],T=["stop-color"],X=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],Z=["stop-color"],ee={key:1},te=["x","y","height","width","fill","stroke","stroke-width","rx"],le={key:2},oe=["x","y","font-size","font-weight","fill"],ae=["x","y","font-size","fill"],se=["x","y","font-size","fill"],ne=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],re={key:2,ref:"source",dir:"auto"},ie={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:x}){e.useCssVars(o=>({"40b52890":L.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),c=B,f=e.computed(()=>!!c.dataset&&c.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(c.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):c.dataset.forEach((o,r)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:r})})})}const v=e.ref(a.createUid()),t=e.computed({get:()=>b(),set:o=>o}),{svgRef:w}=H.useChartAccessibility({config:t.value.style.title});function b(){const o=_.useNestedProp({userConfig:c.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||c.config,defaultConfig:o})}:o}e.watch(()=>c.config,o=>{t.value=b(),k()},{deep:!0});const u=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,s=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=r-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=r-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:s,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),C=e.computed(()=>Math.max(...c.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/C.value}const i=e.computed(()=>c.dataset.map((o,r)=>{const l=$(o.value||0),s=u.value.drawingHeight*l,d=u.value.drawingWidth/c.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=u.value.centerY-s/2,m=u.value.left+(y/2+r*d),V=u.value.left+r*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),z=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,h):a.setOpacity(t.value.style.bars.colors.negative,h),D=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,A=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,F=m+p/2;return{...o,color:z,gradient:A,height:s,intensity:h,proportion:l,stroke:D,textAnchor:F,trapX:V,unitWidth:d,width:p,x:m,y:g}})),n=e.ref(null),S=x;function N(o,r){S("selectDatapoint",{datapoint:o,index:r})}const L=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-histogram",style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:r[1]||(r[1]=l=>n.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),n.value!==null?(e.openBlock(),e.createElementBlock("span",U,"- "+e.toDisplayString(i.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,i.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:i.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(i.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",W,"("+e.toDisplayString(i.value[n.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:w,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:{overflow:"visible"}},[e.createVNode(q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width,height:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,P)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.positive,.05),l.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,T)],8,R))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.negative,.05),l.intensity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,J)],8,X))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(l.color,.05),l.intensity)},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,Z)],8,K))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,te))),256))])):(e.openBlock(),e.createElementBlock("g",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createBlock(M._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,l.value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:l.value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[n.value],seriesIndex:n.value})),9,oe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,ae)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:u.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,se)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:u.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>n.value=s,onMouseleave:r[0]||(r[0]=d=>n.value=null),stroke:n.value!==null&&n.value===s?t.value.style.selector.stroke:"","stroke-width":n.value!==null&&n.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>N(l,s)},null,40,ne)]))),256))],8,j)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(O.default,{key:3,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},ue=I._export_sfc(ie,[["__scopeId","data-v-c92ac914"]]);exports.default=ue;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCssVars as Z, computed as _, onMounted as ee, ref as N, watch as te, createElementBlock as s, openBlock as a, normalizeStyle as $, createCommentVNode as c, createBlock as D, createElementVNode as h, createTextVNode as le, toDisplayString as p, unref as n, createVNode as ae, renderSlot as I, Fragment as f, renderList as g, normalizeClass as V } from "vue";
|
|
2
|
-
import { u as se, o as oe, e as E, g as ue, c as ie, a as re, s as m, i as H, f as F, X as ne, w as z } from "./index-
|
|
3
|
-
import { u as O } from "./useNestedProp-
|
|
4
|
-
import { _ as ve } from "./Shape-
|
|
5
|
-
import de from "./vue-ui-skeleton-
|
|
6
|
-
import { _ as ce } from "./PackageVersion-
|
|
2
|
+
import { u as se, o as oe, e as E, g as ue, c as ie, a as re, s as m, i as H, f as F, X as ne, w as z } from "./index-BI6O7K58.js";
|
|
3
|
+
import { u as O } from "./useNestedProp-Cvz4MkSy.js";
|
|
4
|
+
import { _ as ve } from "./Shape-vIKj52KP.js";
|
|
5
|
+
import de from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
6
|
+
import { _ as ce } from "./PackageVersion-BdNfnIm2.js";
|
|
7
7
|
import { u as ye } from "./useChartAccessibility-BWojgys7.js";
|
|
8
8
|
import { _ as he } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const fe = { key: 0 }, ge = { key: 1 }, pe = ["xmlns", "viewBox"], me = ["width", "height"], be = ["id"], _e = ["stop-color"], xe = ["stop-color"], ke = ["id"], we = ["stop-color"], $e = ["stop-color"], Ce = ["id"], Le = ["stop-color"], ze = ["stop-color"], Se = { key: 1 }, Ae = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Me = { key: 2 }, Ne = ["x", "y", "font-size", "font-weight", "fill"], De = ["x", "y", "font-size", "fill"], Ie = ["x", "y", "font-size", "fill"], Ve = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], Ee = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DiJiQMBB.cjs"),A=require("./useNestedProp-DqEOzYzu.cjs"),X=require("./vue-ui-skeleton-DEI0qJZY.cjs"),O=require("./useResponsive-DQmBAoBf.cjs"),H=require("./PackageVersion-DCriWnX3.cjs"),U=require("./useChartAccessibility-Cm7nkzTG.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Z={__name:"SparkTooltip",props:{svgRef:{type:Object},x:{type:Number,required:!0},y:{type:Number,required:!0},prevX:{type:Number,required:!0},prevY:{type:Number,required:!0},offsetY:{type:Number,default:0},background:{type:String},backgroundOpacity:{type:Number,default:100},borderRadius:{type:Number,default:2},borderWidth:{type:Number,default:0},borderColor:{type:String,default:"#FFFFFF"},color:{type:String},fontSize:{type:Number}},setup(f){const c=f,w=e.toRef(c.svgRef),u=e.ref(null),y=e.ref(0),p=e.ref(0),m=e.ref(!1),V=e.computed(()=>r.setOpacity(c.background,c.backgroundOpacity)),N=async()=>{if(!w.value||!u.value)return;const t=r.placeHTMLElementAtSVGCoordinates({svgElement:w.value,element:u.value,x:c.x,y:c.y,offsetY:c.offsetY}),g=r.placeHTMLElementAtSVGCoordinates({svgElement:w.value,element:u.value,x:c.prevX,y:c.prevY,offsetY:c.offsetY});!t||!g||(m.value=!1,y.value=g.top,p.value=g.left,await e.nextTick(),setTimeout(()=>{m.value=!0,y.value=t.top,p.value=t.left},50))};return e.onMounted(N),e.watch(()=>[c.x,c.y,c.prevX,c.prevY],()=>N(),{immediate:!0}),(t,g)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tooltipRef",ref:u,class:"vue-data-ui-spark-tooltip",style:e.normalizeStyle({position:"fixed",top:`${y.value}px`,left:`${p.value}px`,pointerEvents:"none",background:V.value,color:c.color,fontSize:`${c.fontSize}px`,borderRadius:`${c.borderRadius}px`,border:`${c.borderWidth}px solid ${c.borderColor}`,transition:m.value?"top 0.3s ease-out, left 0.3s ease-out":"none"})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4))}},J=D._export_sfc(Z,[["__scopeId","data-v-c8e27542"]]),K=["id"],Q=["xmlns","viewBox"],ee=["width","height"],te=["id"],le=["stop-color"],ae=["stop-color"],oe=["id"],re=["stop-color"],ue=["stop-color"],ne=["id"],se=["stop-color"],ie=["stop-color"],de={key:1},ce=["d","fill"],ve=["d","fill"],pe=["d","stroke","stroke-width"],fe=["d","stroke","stroke-width"],ye=["x","y","width","height","fill","rx"],he=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ge=["cx","cy","r","fill","stroke","stroke-width"],ke=["x","y","font-size","font-weight","fill"],be=["x","y","height","width","onMouseenter","onClick"],xe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:c}){const{vue_ui_sparkline:w}=r.useConfig(),u=f,y=e.computed(()=>Array.isArray(u.dataset)&&u.dataset.length>0),p=e.ref(r.createUid()),m=e.ref(null),V=e.ref(null),N=e.ref(null),t=e.computed({get:()=>M(),set:l=>l}),{svgRef:g}=U.useChartAccessibility({config:t.value.style.title});function M(){const l=A.useNestedProp({userConfig:u.config,defaultConfig:w});let o={};return l.theme?o={...A.useNestedProp({userConfig:r.themes.vue_ui_sparkline[l.theme]||u.config,defaultConfig:l})}:o=l,u.config&&r.hasDeepProperty(u.config,"style.scaleMin")?o.style.scaleMin=u.config.style.scaleMin:o.style.scaleMin=null,u.config&&r.hasDeepProperty(u.config,"style.scaleMax")?o.style.scaleMax=u.config.style.scaleMax:o.style.scaleMax=null,o}const L=e.computed(()=>r.largestTriangleThreeBucketsArrayObjects({data:u.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>u.config,l=>{t.value=M(),z(),n.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>u.dataset,l=>{k.value=r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(o=>({...o,value:[void 0].includes(o.value)?null:o.value})),threshold:t.value.downsample.threshold})},{deep:!0});const k=e.ref(W());function W(){return r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(l=>t.value.style.animation.show&&u.dataset.length>1?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const I=e.ref(null);e.onMounted(()=>{if(z(),t.value.style.animation.show&&u.dataset.length>1){let a=function(){o<L.value.length?(k.value.push(L.value[o]),setTimeout(()=>{requestAnimationFrame(a)},l)):k.value=L.value,o+=1};k.value=[];const l=t.value.style.animation.animationFrames/u.dataset.length;let o=0;a()}});function z(){if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiSparkline",type:"dataset"}):u.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{r.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=O.throttle(()=>{const{width:o,height:a}=O.useResponsive({chart:m.value,title:t.value.style.title.show&&u.showInfo?V.value:null,source:N.value});requestAnimationFrame(()=>{n.value.width=o,n.value.height=a,n.value.chartWidth=t.value.style.chartWidth/500*o,n.value.padding=u.forcedPadding/500*o})});I.value=new ResizeObserver(l),I.value.observe(m.value.parentNode)}}const n=e.ref({height:80*u.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:u.forcedPadding}),$=c,s=e.computed(()=>{const{top:l,right:o,bottom:a,left:i}=t.value.style.padding;return{top:l,left:i,right:n.value.width-o,bottom:n.value.height-a,start:u.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?n.value.width-n.value.chartWidth+i:n.value.padding+i,width:u.showInfo&&t.value.style.dataLabel.show?n.value.chartWidth-i-o:n.value.width-n.value.padding-i-o,height:n.value.height-l-a}}),E=e.computed(()=>[null,void 0].includes(t.value.style.scaleMin)?Math.min(...k.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMin),F=e.computed(()=>[null,void 0].includes(t.value.style.scaleMax)?Math.max(...k.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMax),B=e.computed(()=>{const l=E.value>=0?0:E.value;return Math.abs(l)}),P=e.computed(()=>F.value+B.value),x=e.computed(()=>s.value.bottom-s.value.height*S(B.value));function S(l){return isNaN(l/P.value)?0:l/P.value}const b=e.computed(()=>L.value.length-1),v=e.computed(()=>k.value.map((l,o)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0,i=s.value.width/(b.value+1)>n.padding?n.padding:s.value.width/(b.value+1);return{absoluteValue:a,period:l.period,plotValue:a+B.value,toMax:S(a+B.value),x:s.value.start+o*(i>s.value.width/12?s.value.width/12:i),y:s.value.bottom-s.value.height*S(a+B.value),id:`plot_${p.value}_${o}`,color:C.value?t.value.style.bar.color:t.value.style.area.useGradient?r.shiftHue(t.value.style.line.color,.05*(1-o/b.value)):t.value.style.line.color,width:i>s.value.width/12?s.value.width/12:i}})),q=e.computed(()=>{const l={x:v.value[0].x||0,y:(n.value.height||0)-6},o={x:v.value[v.value.length-1].x||0,y:(n.value.height||0)-6},a=[];return v.value.forEach(i=>{a.push(`${i.x||0},${i.y||0} `)}),[l.x,l.y,...a,o.x,o.y].toString()}),d=e.ref(void 0),_=e.ref(void 0);function Y(l,o){d.value=l,_.value||(_.value=l),$("hoverIndex",{index:o})}function j(){_.value=d.value,d.value=void 0,$("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(y.value){const l=v.value.map(a=>a.absoluteValue),o=l.reduce((a,i)=>a+i,0);return{latest:v.value[v.value.length-1].absoluteValue,sum:o,average:o/v.value.length,median:r.calcMedian(l),trend:r.calcLinearProgression(v.value.map(({x:a,y:i,absoluteValue:T})=>({x:a,y:i,value:T}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),R=e.computed(()=>y.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),C=e.computed(()=>t.value.type&&t.value.type==="bar");function G(l,o){$("selectDatapoint",{datapoint:l,index:o})}return(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:m,class:"vue-ui-sparkline",id:p.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:d.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:V,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(d.value?d.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:g,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`),onMouseleave:o[0]||(o[0]=a=>_.value=void 0)},[e.createVNode(H._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,ee)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ae)],8,te),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,re),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,ue)],8,oe),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,se),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ie)],8,ne)]),t.value.style.area.show&&!C.value&&v.value[0]?(e.openBlock(),e.createElementBlock("g",de,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${v.value[0].x},${s.value.bottom} ${e.unref(r.createSmoothPath)(v.value)} L ${v.value.at(-1).x},${s.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${p.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ce)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${q.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${p.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ve))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!C.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(r.createSmoothPath)(v.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,pe)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&!C.value?(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${e.unref(r.createStraightPath)(v.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,fe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[C.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:a.x-a.width/2,y:isNaN(a.absoluteValue>0?a.y:x.value)?0:a.absoluteValue>0?a.y:x.value,width:a.width,height:isNaN(Math.abs(a.y-x.value))?0:Math.abs(a.y-x.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${p.value})`:`url(#sparkline_bar_gradient_neg_${p.value})`,rx:t.value.style.bar.borderRadius},null,8,ye)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(d.value&&a.id===d.value.id||f.selectedIndex===i)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.x,x2:a.x,y1:s.value.top-6,y2:s.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,he)):e.createCommentVNode("",!0)]))),256)),E.value<0?(e.openBlock(),e.createElementBlock("line",{key:4,x1:s.value.start,x2:s.value.start+s.value.width-16,y1:e.unref(r.forceValidValue)(x.value,s.value.bottom),y2:e.unref(r.forceValidValue)(x.value,s.value.bottom),stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[d.value&&a.id===d.value.id||f.selectedIndex===i||f.dataset.length===1?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ge)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:s.value.width+12+t.value.style.dataLabel.offsetX,y:n.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(d.value?e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value}):e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,R.value,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:R.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ke)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(s.value.width/(b.value+1)>n.value.padding?n.value.padding:s.value.width/(b.value+1))/2,y:s.value.top-6,height:s.value.height+6,width:s.value.width/(b.value+1)>n.value.padding?n.value.padding:s.value.width/(b.value+1),fill:"transparent",onMouseenter:T=>Y(a,i),onMouseleave:j,onClick:()=>G(a,i)},null,40,be))),256)),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],44,Q)):e.createCommentVNode("",!0),d.value&&t.value.style.tooltip.show?(e.openBlock(),e.createBlock(J,{key:2,x:d.value.x,y:d.value.y,prevX:_.value.x,prevY:_.value.y,offsetY:t.value.style.plot.radius*3+t.value.style.tooltip.offsetY,svgRef:e.unref(g),background:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderWidth:t.value.style.tooltip.borderWidth,borderColor:t.value.style.tooltip.borderColor,borderRadius:t.value.style.tooltip.borderRadius,backgroundOpacity:t.value.style.tooltip.backgroundOpacity},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip",e.normalizeProps(e.guardReactiveProps({...d.value})),()=>[e.createTextVNode(e.toDisplayString(d.value.period)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value})),1)],!0)]),_:3},8,["x","y","prevX","prevY","offsetY","svgRef","background","color","fontSize","borderWidth","borderColor","borderRadius","backgroundOpacity"])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(X.default,{key:4,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,K))}},_e=D._export_sfc(xe,[["__scopeId","data-v-246ce941"]]);exports.default=_e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DgIVCHLv.cjs"),A=require("./useNestedProp-CCR03NVM.cjs"),X=require("./vue-ui-skeleton-DeEGdJEn.cjs"),O=require("./useResponsive-DQmBAoBf.cjs"),H=require("./PackageVersion-C2bjLIu9.cjs"),U=require("./useChartAccessibility-Cm7nkzTG.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Z={__name:"SparkTooltip",props:{svgRef:{type:Object},x:{type:Number,required:!0},y:{type:Number,required:!0},prevX:{type:Number,required:!0},prevY:{type:Number,required:!0},offsetY:{type:Number,default:0},background:{type:String},backgroundOpacity:{type:Number,default:100},borderRadius:{type:Number,default:2},borderWidth:{type:Number,default:0},borderColor:{type:String,default:"#FFFFFF"},color:{type:String},fontSize:{type:Number}},setup(f){const c=f,w=e.toRef(c.svgRef),u=e.ref(null),y=e.ref(0),p=e.ref(0),m=e.ref(!1),V=e.computed(()=>r.setOpacity(c.background,c.backgroundOpacity)),N=async()=>{if(!w.value||!u.value)return;const t=r.placeHTMLElementAtSVGCoordinates({svgElement:w.value,element:u.value,x:c.x,y:c.y,offsetY:c.offsetY}),g=r.placeHTMLElementAtSVGCoordinates({svgElement:w.value,element:u.value,x:c.prevX,y:c.prevY,offsetY:c.offsetY});!t||!g||(m.value=!1,y.value=g.top,p.value=g.left,await e.nextTick(),setTimeout(()=>{m.value=!0,y.value=t.top,p.value=t.left},50))};return e.onMounted(N),e.watch(()=>[c.x,c.y,c.prevX,c.prevY],()=>N(),{immediate:!0}),(t,g)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tooltipRef",ref:u,class:"vue-data-ui-spark-tooltip",style:e.normalizeStyle({position:"fixed",top:`${y.value}px`,left:`${p.value}px`,pointerEvents:"none",background:V.value,color:c.color,fontSize:`${c.fontSize}px`,borderRadius:`${c.borderRadius}px`,border:`${c.borderWidth}px solid ${c.borderColor}`,transition:m.value?"top 0.3s ease-out, left 0.3s ease-out":"none"})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4))}},J=D._export_sfc(Z,[["__scopeId","data-v-c8e27542"]]),K=["id"],Q=["xmlns","viewBox"],ee=["width","height"],te=["id"],le=["stop-color"],ae=["stop-color"],oe=["id"],re=["stop-color"],ue=["stop-color"],ne=["id"],se=["stop-color"],ie=["stop-color"],de={key:1},ce=["d","fill"],ve=["d","fill"],pe=["d","stroke","stroke-width"],fe=["d","stroke","stroke-width"],ye=["x","y","width","height","fill","rx"],he=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ge=["cx","cy","r","fill","stroke","stroke-width"],ke=["x","y","font-size","font-weight","fill"],be=["x","y","height","width","onMouseenter","onClick"],xe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:c}){const{vue_ui_sparkline:w}=r.useConfig(),u=f,y=e.computed(()=>Array.isArray(u.dataset)&&u.dataset.length>0),p=e.ref(r.createUid()),m=e.ref(null),V=e.ref(null),N=e.ref(null),t=e.computed({get:()=>M(),set:l=>l}),{svgRef:g}=U.useChartAccessibility({config:t.value.style.title});function M(){const l=A.useNestedProp({userConfig:u.config,defaultConfig:w});let o={};return l.theme?o={...A.useNestedProp({userConfig:r.themes.vue_ui_sparkline[l.theme]||u.config,defaultConfig:l})}:o=l,u.config&&r.hasDeepProperty(u.config,"style.scaleMin")?o.style.scaleMin=u.config.style.scaleMin:o.style.scaleMin=null,u.config&&r.hasDeepProperty(u.config,"style.scaleMax")?o.style.scaleMax=u.config.style.scaleMax:o.style.scaleMax=null,o}const L=e.computed(()=>r.largestTriangleThreeBucketsArrayObjects({data:u.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>u.config,l=>{t.value=M(),z(),n.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>u.dataset,l=>{k.value=r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(o=>({...o,value:[void 0].includes(o.value)?null:o.value})),threshold:t.value.downsample.threshold})},{deep:!0});const k=e.ref(W());function W(){return r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(l=>t.value.style.animation.show&&u.dataset.length>1?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const I=e.ref(null);e.onMounted(()=>{if(z(),t.value.style.animation.show&&u.dataset.length>1){let a=function(){o<L.value.length?(k.value.push(L.value[o]),setTimeout(()=>{requestAnimationFrame(a)},l)):k.value=L.value,o+=1};k.value=[];const l=t.value.style.animation.animationFrames/u.dataset.length;let o=0;a()}});function z(){if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiSparkline",type:"dataset"}):u.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{r.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=O.throttle(()=>{const{width:o,height:a}=O.useResponsive({chart:m.value,title:t.value.style.title.show&&u.showInfo?V.value:null,source:N.value});requestAnimationFrame(()=>{n.value.width=o,n.value.height=a,n.value.chartWidth=t.value.style.chartWidth/500*o,n.value.padding=u.forcedPadding/500*o})});I.value=new ResizeObserver(l),I.value.observe(m.value.parentNode)}}const n=e.ref({height:80*u.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:u.forcedPadding}),$=c,s=e.computed(()=>{const{top:l,right:o,bottom:a,left:i}=t.value.style.padding;return{top:l,left:i,right:n.value.width-o,bottom:n.value.height-a,start:u.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?n.value.width-n.value.chartWidth+i:n.value.padding+i,width:u.showInfo&&t.value.style.dataLabel.show?n.value.chartWidth-i-o:n.value.width-n.value.padding-i-o,height:n.value.height-l-a}}),E=e.computed(()=>[null,void 0].includes(t.value.style.scaleMin)?Math.min(...k.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMin),F=e.computed(()=>[null,void 0].includes(t.value.style.scaleMax)?Math.max(...k.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMax),B=e.computed(()=>{const l=E.value>=0?0:E.value;return Math.abs(l)}),P=e.computed(()=>F.value+B.value),x=e.computed(()=>s.value.bottom-s.value.height*S(B.value));function S(l){return isNaN(l/P.value)?0:l/P.value}const b=e.computed(()=>L.value.length-1),v=e.computed(()=>k.value.map((l,o)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0,i=s.value.width/(b.value+1)>n.padding?n.padding:s.value.width/(b.value+1);return{absoluteValue:a,period:l.period,plotValue:a+B.value,toMax:S(a+B.value),x:s.value.start+o*(i>s.value.width/12?s.value.width/12:i),y:s.value.bottom-s.value.height*S(a+B.value),id:`plot_${p.value}_${o}`,color:C.value?t.value.style.bar.color:t.value.style.area.useGradient?r.shiftHue(t.value.style.line.color,.05*(1-o/b.value)):t.value.style.line.color,width:i>s.value.width/12?s.value.width/12:i}})),q=e.computed(()=>{const l={x:v.value[0].x||0,y:(n.value.height||0)-6},o={x:v.value[v.value.length-1].x||0,y:(n.value.height||0)-6},a=[];return v.value.forEach(i=>{a.push(`${i.x||0},${i.y||0} `)}),[l.x,l.y,...a,o.x,o.y].toString()}),d=e.ref(void 0),_=e.ref(void 0);function Y(l,o){d.value=l,_.value||(_.value=l),$("hoverIndex",{index:o})}function j(){_.value=d.value,d.value=void 0,$("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(y.value){const l=v.value.map(a=>a.absoluteValue),o=l.reduce((a,i)=>a+i,0);return{latest:v.value[v.value.length-1].absoluteValue,sum:o,average:o/v.value.length,median:r.calcMedian(l),trend:r.calcLinearProgression(v.value.map(({x:a,y:i,absoluteValue:T})=>({x:a,y:i,value:T}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),R=e.computed(()=>y.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),C=e.computed(()=>t.value.type&&t.value.type==="bar");function G(l,o){$("selectDatapoint",{datapoint:l,index:o})}return(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:m,class:"vue-ui-sparkline",id:p.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:d.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:V,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(d.value?d.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:g,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`),onMouseleave:o[0]||(o[0]=a=>_.value=void 0)},[e.createVNode(H._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,ee)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ae)],8,te),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,re),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,ue)],8,oe),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,se),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ie)],8,ne)]),t.value.style.area.show&&!C.value&&v.value[0]?(e.openBlock(),e.createElementBlock("g",de,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${v.value[0].x},${s.value.bottom} ${e.unref(r.createSmoothPath)(v.value)} L ${v.value.at(-1).x},${s.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${p.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ce)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${q.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${p.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ve))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!C.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(r.createSmoothPath)(v.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,pe)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&!C.value?(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${e.unref(r.createStraightPath)(v.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,fe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[C.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:a.x-a.width/2,y:isNaN(a.absoluteValue>0?a.y:x.value)?0:a.absoluteValue>0?a.y:x.value,width:a.width,height:isNaN(Math.abs(a.y-x.value))?0:Math.abs(a.y-x.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${p.value})`:`url(#sparkline_bar_gradient_neg_${p.value})`,rx:t.value.style.bar.borderRadius},null,8,ye)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(d.value&&a.id===d.value.id||f.selectedIndex===i)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.x,x2:a.x,y1:s.value.top-6,y2:s.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,he)):e.createCommentVNode("",!0)]))),256)),E.value<0?(e.openBlock(),e.createElementBlock("line",{key:4,x1:s.value.start,x2:s.value.start+s.value.width-16,y1:e.unref(r.forceValidValue)(x.value,s.value.bottom),y2:e.unref(r.forceValidValue)(x.value,s.value.bottom),stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[d.value&&a.id===d.value.id||f.selectedIndex===i||f.dataset.length===1?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ge)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:s.value.width+12+t.value.style.dataLabel.offsetX,y:n.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(d.value?e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value}):e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,R.value,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:R.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ke)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(s.value.width/(b.value+1)>n.value.padding?n.value.padding:s.value.width/(b.value+1))/2,y:s.value.top-6,height:s.value.height+6,width:s.value.width/(b.value+1)>n.value.padding?n.value.padding:s.value.width/(b.value+1),fill:"transparent",onMouseenter:T=>Y(a,i),onMouseleave:j,onClick:()=>G(a,i)},null,40,be))),256)),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],44,Q)):e.createCommentVNode("",!0),d.value&&t.value.style.tooltip.show?(e.openBlock(),e.createBlock(J,{key:2,x:d.value.x,y:d.value.y,prevX:_.value.x,prevY:_.value.y,offsetY:t.value.style.plot.radius*3+t.value.style.tooltip.offsetY,svgRef:e.unref(g),background:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderWidth:t.value.style.tooltip.borderWidth,borderColor:t.value.style.tooltip.borderColor,borderRadius:t.value.style.tooltip.borderRadius,backgroundOpacity:t.value.style.tooltip.backgroundOpacity},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip",e.normalizeProps(e.guardReactiveProps({...d.value})),()=>[e.createTextVNode(e.toDisplayString(d.value.period)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value})),1)],!0)]),_:3},8,["x","y","prevX","prevY","offsetY","svgRef","background","color","fontSize","borderWidth","borderColor","borderRadius","backgroundOpacity"])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(X.default,{key:4,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,K))}},_e=D._export_sfc(xe,[["__scopeId","data-v-246ce941"]]);exports.default=_e;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { toRef as ge, ref as g, computed as f, onMounted as ie, watch as q, createElementBlock as d, openBlock as n, normalizeStyle as z, renderSlot as M, nextTick as be, createCommentVNode as h, createBlock as ee, normalizeProps as te, guardReactiveProps as ae, createElementVNode as b, toDisplayString as T, unref as c, createVNode as me, Fragment as E, renderList as B, withCtx as ke, createTextVNode as xe } from "vue";
|
|
2
|
-
import { s as W, a1 as le, u as _e, c as we, a as $e, C as oe, a2 as G, o as Ne, e as ue, g as Le, w as F, a3 as Ce, a4 as Me, X as Se, S as se, R as Ie, a5 as re, i as X, f as j } from "./index-
|
|
3
|
-
import { u as ne } from "./useNestedProp-
|
|
4
|
-
import Ve from "./vue-ui-skeleton-
|
|
2
|
+
import { s as W, a1 as le, u as _e, c as we, a as $e, C as oe, a2 as G, o as Ne, e as ue, g as Le, w as F, a3 as Ce, a4 as Me, X as Se, S as se, R as Ie, a5 as re, i as X, f as j } from "./index-BI6O7K58.js";
|
|
3
|
+
import { u as ne } from "./useNestedProp-Cvz4MkSy.js";
|
|
4
|
+
import Ve from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
5
5
|
import { t as Re, u as ze } from "./useResponsive-Cw4oZ8sQ.js";
|
|
6
|
-
import { _ as We } from "./PackageVersion-
|
|
6
|
+
import { _ as We } from "./PackageVersion-BdNfnIm2.js";
|
|
7
7
|
import { u as Ae } from "./useChartAccessibility-BWojgys7.js";
|
|
8
8
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const Pe = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DiJiQMBB.cjs"),V=require("./useNestedProp-DqEOzYzu.cjs"),U=require("./vue-ui-skeleton-DEI0qJZY.cjs"),M=require("./PackageVersion-DCriWnX3.cjs"),j=require("./Tooltip-DY4rXOAP.cjs"),R=require("./useChartAccessibility-Cm7nkzTG.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),I=["xmlns","viewBox"],W=["id"],Y=["stop-color"],G=["stop-color"],X=["stop-color"],J={id:"stackPill",clipPathUnits:"objectBoundingBox"},K=["fill"],Q={key:0,"clip-path":"url(#stackPill)"},Z=["x","width","height","fill"],ee=["x","width","height","fill","stroke"],te=["onClick","x","width","height","onMouseenter"],le=["width","height","rx"],oe=["onClick"],ae={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},re=["height","width"],ne=["fill"],se={key:4,ref:"source",dir:"auto"},ue={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const{vue_ui_sparkstackbar:L}=a.useConfig(),u=P,F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),C=e.ref(""),t=e.computed({get:()=>$(),set:l=>l}),{svgRef:A}=R.useChartAccessibility({config:t.value.style.title});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{p.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),p=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let v=function(){r+=o/l,r<o?(p.value=p.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(v)):(g.value=!1,p.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,v()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>p.value.map((l,n)=>{const o=l.value||0,r=o/N.value,v=isNaN(r)?0:r,s=v*c.value.width;return{...l,value:o,proportion:v,width:s,proportionLabel:a.dataLabel({v:v*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),_=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<p.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<_.value.length;o+=1)n.push({..._.value[o],start:l}),l+=_.value[o].width;return n}),q=D;function z(l,n){q("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function O({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(C.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,C.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-stackbar",ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{class:"atom-title",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"atom-subtitle",style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:A,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(M._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,Y),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,X)],8,W))),128)),e.createElementVNode("clipPath",J,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,K)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,Z))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,ee))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>O({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=v=>{b.value=!1,m.value=null})},null,42,te))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,le))],8,I)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(U.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:v=>{T(r),z(o,r)}},[e.createElementVNode("div",ae,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,ne)],8,re)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,oe))),256))],4)):e.createCommentVNode("",!0),e.createVNode(j._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:C.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ie=H._export_sfc(ue,[["__scopeId","data-v-7955299f"]]);exports.default=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DgIVCHLv.cjs"),V=require("./useNestedProp-CCR03NVM.cjs"),U=require("./vue-ui-skeleton-DeEGdJEn.cjs"),M=require("./PackageVersion-C2bjLIu9.cjs"),j=require("./Tooltip-CfqYTd5O.cjs"),R=require("./useChartAccessibility-Cm7nkzTG.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),I=["xmlns","viewBox"],W=["id"],Y=["stop-color"],G=["stop-color"],X=["stop-color"],J={id:"stackPill",clipPathUnits:"objectBoundingBox"},K=["fill"],Q={key:0,"clip-path":"url(#stackPill)"},Z=["x","width","height","fill"],ee=["x","width","height","fill","stroke"],te=["onClick","x","width","height","onMouseenter"],le=["width","height","rx"],oe=["onClick"],ae={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},re=["height","width"],ne=["fill"],se={key:4,ref:"source",dir:"auto"},ue={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const{vue_ui_sparkstackbar:L}=a.useConfig(),u=P,F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),C=e.ref(""),t=e.computed({get:()=>$(),set:l=>l}),{svgRef:A}=R.useChartAccessibility({config:t.value.style.title});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{p.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),p=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let v=function(){r+=o/l,r<o?(p.value=p.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(v)):(g.value=!1,p.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,v()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>p.value.map((l,n)=>{const o=l.value||0,r=o/N.value,v=isNaN(r)?0:r,s=v*c.value.width;return{...l,value:o,proportion:v,width:s,proportionLabel:a.dataLabel({v:v*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),_=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<p.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<_.value.length;o+=1)n.push({..._.value[o],start:l}),l+=_.value[o].width;return n}),q=D;function z(l,n){q("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function O({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(C.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,C.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-stackbar",ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{class:"atom-title",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"atom-subtitle",style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:A,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(M._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,Y),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,X)],8,W))),128)),e.createElementVNode("clipPath",J,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,K)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,Z))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,ee))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>O({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=v=>{b.value=!1,m.value=null})},null,42,te))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,le))],8,I)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(U.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:v=>{T(r),z(o,r)}},[e.createElementVNode("div",ae,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,ne)],8,re)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,oe))),256))],4)):e.createCommentVNode("",!0),e.createVNode(j._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:C.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ie=H._export_sfc(ue,[["__scopeId","data-v-7955299f"]]);exports.default=ie;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useSlots as ie, onMounted as Y, computed as m, ref as d, watch as G, createElementBlock as r, openBlock as s, normalizeStyle as v, createCommentVNode as y, createBlock as ce, createVNode as q, createElementVNode as p, toDisplayString as w, unref as C, Fragment as x, renderList as $, normalizeClass as F, withCtx as H, renderSlot as U, normalizeProps as X, guardReactiveProps as J } from "vue";
|
|
2
|
-
import { u as de, c as K, t as ve, p as i, a as pe, d as N, b as ge, o as fe, e as Q, g as he, f as V, X as ye, s as me, w as ke, i as Z, x as be } from "./index-
|
|
3
|
-
import { u as ee } from "./useNestedProp-
|
|
4
|
-
import _e from "./vue-ui-skeleton-
|
|
5
|
-
import { _ as we } from "./PackageVersion-
|
|
6
|
-
import { _ as Ce } from "./Tooltip-
|
|
2
|
+
import { u as de, c as K, t as ve, p as i, a as pe, d as N, b as ge, o as fe, e as Q, g as he, f as V, X as ye, s as me, w as ke, i as Z, x as be } from "./index-BI6O7K58.js";
|
|
3
|
+
import { u as ee } from "./useNestedProp-Cvz4MkSy.js";
|
|
4
|
+
import _e from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
5
|
+
import { _ as we } from "./PackageVersion-BdNfnIm2.js";
|
|
6
|
+
import { _ as Ce } from "./Tooltip-BzsAOdBd.js";
|
|
7
7
|
import { u as xe } from "./useChartAccessibility-BWojgys7.js";
|
|
8
8
|
import { _ as $e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const Se = ["xmlns", "viewBox"], ze = ["id"], Pe = ["stop-color"], De = ["stop-color"], Fe = ["stop-color"], Ne = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DiJiQMBB.cjs"),Te=require("./useNestedProp-DqEOzYzu.cjs"),Me=require("./useResponsive-DQmBAoBf.cjs"),Fe=require("./usePrinter-Bkd5ycBt.cjs"),ot=require("./Slicer-B-i-6x8C.cjs"),rt=require("./Tooltip-DY4rXOAP.cjs"),st=require("./Title-zlQvBTwR.cjs"),nt=require("./Legend-RwWQ6l8r.cjs"),it=require("./vue-ui-accordion-P5hXhzth.cjs"),ut=require("./DataTable-DSiJ_YaA.cjs"),ct=require("./vue-ui-skeleton-DEI0qJZY.cjs"),dt=require("./PackageVersion-DCriWnX3.cjs"),ht=require("./PenAndPaper-lj1PPAzR.cjs"),vt=require("./useUserOptionState-BgepsfED.cjs"),mt=require("./Shape-BgbyzOCz.cjs"),gt=require("./useChartAccessibility-Cm7nkzTG.cjs"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),bt=["id"],ft=["xmlns","viewBox"],pt=["x","y","width","height"],kt={key:1},xt=["id"],wt=["stop-color"],Bt=["stop-color"],Ct=["stop-color"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt=["x1","x2","y1","y2","stroke"],_t=["x1","x2","y1","y2","stroke"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","height","rx","width","fill","stroke","stroke-width"],Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt={key:0},Ft=["x","y","width","rx","height","fill","stroke","stroke-width"],Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x","y","font-size","fill","font-weight"],Ot=["transform","font-size","fill","font-weight"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},qt=["x","y","font-size","font-weight","fill"],Ht=["x","y","font-size","fill","font-weight"],Ut={key:0},Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["x","y","font-size","font-weight","fill"],Gt=["x1","x2","y1","y2","stroke"],Jt=["font-size","font-weight","fill","text-anchor","transform"],Zt={key:0},Kt={key:1},Qt=["text-anchor","font-size","font-weight","fill","transform","onClick"],jt={key:0},ea={key:1},ta=["font-size","font-weight","fill","x","y","onClick"],aa=["x","y","width","height","onClick","onMouseenter","fill"],la=["x","y","width","height","onClick","onMouseenter","fill"],oa={key:4,class:"vue-data-ui-watermark"},ra=["onClick"],sa=["innerHTML"],na={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Pe,emit:Ie}){const{vue_ui_stackbar:Re}=u.useConfig(),Oe=e.useSlots(),h=G,J=Ie,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),F=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),Z=e.ref(null),K=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),P=e.ref(null),_=e.ref(!1),De=e.ref(0),Ae=e.ref(0),qe=e.ref(0),M=e.ref(null);e.onMounted(()=>{j()});const t=e.computed({get:()=>ce(),set:l=>l}),{userOptionsVisible:Q,setUserOptionsVisibility:ne,keepUserOptionState:ie}=vt.useUserOptionState({config:t.value}),{svgRef:ue}=gt.useChartAccessibility({config:t.value.style.chart.title});function ce(){const l=Te.useNestedProp({userConfig:h.config,defaultConfig:Re});let r={};return l.theme?r={...Te.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:r=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>h.config,l=>{t.value=ce(),Q.value=!t.value.userOptions.showOnChartHover,j(),De.value+=1,Ae.value+=1,qe.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{be()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:de,isImaging:he,generatePdf:ve,generateImage:me}=Fe.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar",options:t.value.userOptions.print}),q=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ge=e.ref(null),ye=e.ref(null);e.onMounted(()=>{j()});function j(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:r,height:a}=Me.useResponsive({chart:F.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{q.value.width=r,q.value.height=a,clearTimeout(ye.value),ye.value=setTimeout(()=>{_.value=!0},10)})});ge.value=new ResizeObserver(l),ge.value.observe(F.value.parentNode)}fe()}const s=e.computed(()=>{const{height:l,width:r}=q.value,{right:a}=q.value.paddingRatio,o=t.value.style.chart.padding.top,i=r-r*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=r-b-r*a,N=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,r)=>{const a=u.convertColorToHex(l.color)||He.value[r]||u.palette[r]||u.palette[r%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function be(){fe()}async function fe(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ue(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function Ue(l){const r=Math.max(...h.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),We=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(c.value.start,c.value.end)),H=e.computed(()=>{const l=S.value.filter(r=>!f.value.includes(r.id));return{positive:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...H.value.positive),r=Math.min(...H.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const i=Math.max(...H.value.positive)||0,n=Math.min(...H.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,$e=w.value[0]?w.value[0].zero:s.value.bottom,Ve=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(O=>!f.value.includes(O.id)).map(O=>{const B=O.series.slice(c.value.start,c.value.end),Ze=O.signedSeries.slice(c.value.start,c.value.end),Ke=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=$e-x-l[m],l[m]+=x):(x=p*k,V=$e+a[m],a[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=Ve+r[m],r[m]+=x):(x=X*k,V=Ve-Math.abs(x)-o[m],o[m]+=Math.abs(x)),V}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),at=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),lt=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/lt),series:B,signedSeries:Ze,x:Ke,y:je,height:tt,horizontal_width:at,horizontal_y:Qe,horizontal_x:et}})}),pe=e.computed(()=>We.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function U(l,r,a,o,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ke(l,r,a,o){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function xe(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:L.value[l]})}function we(l){P.value=l,D.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id}));Z.value={datapoint:a,seriesIndex:l,config:t.value,series:g.value};const o=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(r)&&u.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))K.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{R+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DgIVCHLv.cjs"),Te=require("./useNestedProp-CCR03NVM.cjs"),Me=require("./useResponsive-DQmBAoBf.cjs"),Fe=require("./usePrinter-B2xVvtiy.cjs"),ot=require("./Slicer-t3EfI94H.cjs"),rt=require("./Tooltip-CfqYTd5O.cjs"),st=require("./Title-Bae0QJu7.cjs"),nt=require("./Legend-B9aoKeq3.cjs"),it=require("./vue-ui-accordion-DE1isSE9.cjs"),ut=require("./DataTable-CGucPqAQ.cjs"),ct=require("./vue-ui-skeleton-DeEGdJEn.cjs"),dt=require("./PackageVersion-C2bjLIu9.cjs"),ht=require("./PenAndPaper-CJIFAI78.cjs"),vt=require("./useUserOptionState-BgepsfED.cjs"),mt=require("./Shape-Cn2RU1NY.cjs"),gt=require("./useChartAccessibility-Cm7nkzTG.cjs"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),bt=["id"],ft=["xmlns","viewBox"],pt=["x","y","width","height"],kt={key:1},xt=["id"],wt=["stop-color"],Bt=["stop-color"],Ct=["stop-color"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt=["x1","x2","y1","y2","stroke"],_t=["x1","x2","y1","y2","stroke"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","height","rx","width","fill","stroke","stroke-width"],Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt={key:0},Ft=["x","y","width","rx","height","fill","stroke","stroke-width"],Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x","y","font-size","fill","font-weight"],Ot=["transform","font-size","fill","font-weight"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},qt=["x","y","font-size","font-weight","fill"],Ht=["x","y","font-size","fill","font-weight"],Ut={key:0},Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["x","y","font-size","font-weight","fill"],Gt=["x1","x2","y1","y2","stroke"],Jt=["font-size","font-weight","fill","text-anchor","transform"],Zt={key:0},Kt={key:1},Qt=["text-anchor","font-size","font-weight","fill","transform","onClick"],jt={key:0},ea={key:1},ta=["font-size","font-weight","fill","x","y","onClick"],aa=["x","y","width","height","onClick","onMouseenter","fill"],la=["x","y","width","height","onClick","onMouseenter","fill"],oa={key:4,class:"vue-data-ui-watermark"},ra=["onClick"],sa=["innerHTML"],na={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Pe,emit:Ie}){const{vue_ui_stackbar:Re}=u.useConfig(),Oe=e.useSlots(),h=G,J=Ie,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),F=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),Z=e.ref(null),K=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),P=e.ref(null),_=e.ref(!1),De=e.ref(0),Ae=e.ref(0),qe=e.ref(0),M=e.ref(null);e.onMounted(()=>{j()});const t=e.computed({get:()=>ce(),set:l=>l}),{userOptionsVisible:Q,setUserOptionsVisibility:ne,keepUserOptionState:ie}=vt.useUserOptionState({config:t.value}),{svgRef:ue}=gt.useChartAccessibility({config:t.value.style.chart.title});function ce(){const l=Te.useNestedProp({userConfig:h.config,defaultConfig:Re});let r={};return l.theme?r={...Te.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:r=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>h.config,l=>{t.value=ce(),Q.value=!t.value.userOptions.showOnChartHover,j(),De.value+=1,Ae.value+=1,qe.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{be()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:de,isImaging:he,generatePdf:ve,generateImage:me}=Fe.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar",options:t.value.userOptions.print}),q=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ge=e.ref(null),ye=e.ref(null);e.onMounted(()=>{j()});function j(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:r,height:a}=Me.useResponsive({chart:F.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{q.value.width=r,q.value.height=a,clearTimeout(ye.value),ye.value=setTimeout(()=>{_.value=!0},10)})});ge.value=new ResizeObserver(l),ge.value.observe(F.value.parentNode)}fe()}const s=e.computed(()=>{const{height:l,width:r}=q.value,{right:a}=q.value.paddingRatio,o=t.value.style.chart.padding.top,i=r-r*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=r-b-r*a,N=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,r)=>{const a=u.convertColorToHex(l.color)||He.value[r]||u.palette[r]||u.palette[r%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function be(){fe()}async function fe(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ue(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function Ue(l){const r=Math.max(...h.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),We=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(c.value.start,c.value.end)),H=e.computed(()=>{const l=S.value.filter(r=>!f.value.includes(r.id));return{positive:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...H.value.positive),r=Math.min(...H.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const i=Math.max(...H.value.positive)||0,n=Math.min(...H.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,$e=w.value[0]?w.value[0].zero:s.value.bottom,Ve=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(O=>!f.value.includes(O.id)).map(O=>{const B=O.series.slice(c.value.start,c.value.end),Ze=O.signedSeries.slice(c.value.start,c.value.end),Ke=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=$e-x-l[m],l[m]+=x):(x=p*k,V=$e+a[m],a[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=Ve+r[m],r[m]+=x):(x=X*k,V=Ve-Math.abs(x)-o[m],o[m]+=Math.abs(x)),V}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),at=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),lt=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/lt),series:B,signedSeries:Ze,x:Ke,y:je,height:tt,horizontal_width:at,horizontal_y:Qe,horizontal_x:et}})}),pe=e.computed(()=>We.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function U(l,r,a,o,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ke(l,r,a,o){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function xe(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:L.value[l]})}function we(l){P.value=l,D.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id}));Z.value={datapoint:a,seriesIndex:l,config:t.value,series:g.value};const o=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(r)&&u.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))K.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{R+=`
|
|
2
2
|
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
3
|
<svg viewBox="0 0 60 60" height="14" width="14"><rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${p.id})`:p.color}"/>${Oe.pattern?`<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${C.value}_${p.absoluteIndex})"/>`:""}</svg>
|
|
4
4
|
${p.name}${i||n?":":""} ${i?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:p.value,s:t.value.style.chart.bars.dataLabels.suffix,r:E}):""} ${$[0]}${n?u.dataLabel({v:isNaN(p.value/o)?0:Math.abs(p.value)/o*100,s:"%",r:N}):""}${$[1]}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { useSlots as Pt, computed as w, ref as g, onMounted as at, watch as lt, nextTick as he, createElementBlock as s, openBlock as o, unref as b, normalizeStyle as U, normalizeClass as te, createBlock as q, createCommentVNode as v, renderSlot as x, createElementVNode as Y, createVNode as ae, createSlots as rt, withCtx as z, normalizeProps as V, guardReactiveProps as F, Fragment as h, renderList as y, mergeProps as _e, toDisplayString as S, createTextVNode as At } from "vue";
|
|
2
|
-
import { u as Vt, c as ot, t as Ft, p as ve, a as Dt, C as de, b as Et, o as Ht, e as st, g as Wt, d as Bt, aj as ye, ag as it, D as nt, X as Ut, l as Yt, a5 as ge, G as ut, f as X, x as ct, q as Xt, r as Gt, i as ht, y as Jt } from "./index-
|
|
3
|
-
import { u as vt } from "./useNestedProp-
|
|
2
|
+
import { u as Vt, c as ot, t as Ft, p as ve, a as Dt, C as de, b as Et, o as Ht, e as st, g as Wt, d as Bt, aj as ye, ag as it, D as nt, X as Ut, l as Yt, a5 as ge, G as ut, f as X, x as ct, q as Xt, r as Gt, i as ht, y as Jt } from "./index-BI6O7K58.js";
|
|
3
|
+
import { u as vt } from "./useNestedProp-Cvz4MkSy.js";
|
|
4
4
|
import { t as qt, u as Zt } from "./useResponsive-Cw4oZ8sQ.js";
|
|
5
|
-
import { u as Kt, U as Qt } from "./usePrinter-
|
|
6
|
-
import { S as jt } from "./Slicer-
|
|
7
|
-
import { _ as ea } from "./Tooltip-
|
|
8
|
-
import { _ as ta } from "./Title-
|
|
9
|
-
import { L as aa } from "./Legend-
|
|
10
|
-
import la from "./vue-ui-accordion-
|
|
11
|
-
import { D as ra } from "./DataTable-
|
|
12
|
-
import oa from "./vue-ui-skeleton-
|
|
13
|
-
import { _ as sa } from "./PackageVersion-
|
|
14
|
-
import { _ as ia } from "./PenAndPaper-
|
|
5
|
+
import { u as Kt, U as Qt } from "./usePrinter-Jr3eyr8H.js";
|
|
6
|
+
import { S as jt } from "./Slicer-yki6JqTB.js";
|
|
7
|
+
import { _ as ea } from "./Tooltip-BzsAOdBd.js";
|
|
8
|
+
import { _ as ta } from "./Title-CDYBDpu3.js";
|
|
9
|
+
import { L as aa } from "./Legend-Cx6NYPTA.js";
|
|
10
|
+
import la from "./vue-ui-accordion-ldF7KsjV.js";
|
|
11
|
+
import { D as ra } from "./DataTable-Dk-94kK2.js";
|
|
12
|
+
import oa from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
13
|
+
import { _ as sa } from "./PackageVersion-BdNfnIm2.js";
|
|
14
|
+
import { _ as ia } from "./PenAndPaper-wrVNMaG8.js";
|
|
15
15
|
import { u as na } from "./useUserOptionState-BIvW1Kz7.js";
|
|
16
|
-
import { _ as ua } from "./Shape-
|
|
16
|
+
import { _ as ua } from "./Shape-vIKj52KP.js";
|
|
17
17
|
import { u as ca } from "./useChartAccessibility-BWojgys7.js";
|
|
18
18
|
import { _ as ha } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
19
19
|
const va = ["id"], da = ["xmlns", "viewBox"], ya = ["x", "y", "width", "height"], ga = { key: 1 }, ba = ["id"], fa = ["stop-color"], ma = ["stop-color"], pa = ["stop-color"], xa = ["x1", "x2", "y1", "y2", "stroke"], ka = ["x1", "x2", "y1", "y2", "stroke"], wa = ["x1", "x2", "y1", "y2", "stroke"], _a = ["x1", "x2", "y1", "y2", "stroke"], za = { key: 0 }, Ca = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], La = { key: 0 }, $a = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], Sa = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Ma = { key: 0 }, Ta = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Na = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ia = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Oa = ["x", "y", "font-size", "fill", "font-weight"], Ra = ["transform", "font-size", "fill", "font-weight"], Pa = ["x", "y", "font-size", "fill", "font-weight"], Aa = { key: 0 }, Va = ["x", "y", "font-size", "font-weight", "fill"], Fa = ["x", "y", "font-size", "fill", "font-weight"], Da = { key: 0 }, Ea = ["x", "y", "font-size", "font-weight", "fill"], Ha = ["x1", "x2", "y1", "y2", "stroke"], Wa = ["x", "y", "font-size", "font-weight", "fill"], Ba = ["x1", "x2", "y1", "y2", "stroke"], Ua = ["font-size", "font-weight", "fill", "text-anchor", "transform"], Ya = { key: 0 }, Xa = { key: 1 }, Ga = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Ja = { key: 0 }, qa = { key: 1 }, Za = ["font-size", "font-weight", "fill", "x", "y", "onClick"], Ka = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Qa = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], ja = {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as f, ref as n, watch as Ue, onMounted as Ve, onBeforeUnmount as Ee, createElementBlock as u, openBlock as s, unref as v, normalizeStyle as B, normalizeClass as M, createBlock as T, createCommentVNode as c, createVNode as _e, createSlots as He, withCtx as y, renderSlot as p, normalizeProps as P, guardReactiveProps as z, createElementVNode as k, Fragment as g, renderList as w, toDisplayString as L, mergeProps as Be, createTextVNode as Xe, nextTick as je } from "vue";
|
|
2
|
-
import { u as Ye, c as ee, t as qe, p as A, a as Je, o as Ke, e as te, g as Te, b as Qe, d as Le, v as Ze, D as et, f as X, X as tt, i as le, l as lt, h as at, x as Ae, F as ot, q as st, r as rt, y as ut } from "./index-
|
|
2
|
+
import { u as Ye, c as ee, t as qe, p as A, a as Je, o as Ke, e as te, g as Te, b as Qe, d as Le, v as Ze, D as et, f as X, X as tt, i as le, l as lt, h as at, x as Ae, F as ot, q as st, r as rt, y as ut } from "./index-BI6O7K58.js";
|
|
3
3
|
import { t as it, u as nt } from "./useResponsive-Cw4oZ8sQ.js";
|
|
4
|
-
import { _ as vt } from "./Title-
|
|
5
|
-
import { u as ct, U as ht } from "./usePrinter-
|
|
6
|
-
import { _ as dt } from "./Tooltip-
|
|
7
|
-
import { D as pt } from "./DataTable-
|
|
8
|
-
import ft from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as yt } from "./Shape-
|
|
10
|
-
import bt from "./vue-ui-accordion-
|
|
11
|
-
import { u as Se } from "./useNestedProp-
|
|
12
|
-
import { _ as mt } from "./PackageVersion-
|
|
13
|
-
import { _ as gt } from "./PenAndPaper-
|
|
4
|
+
import { _ as vt } from "./Title-CDYBDpu3.js";
|
|
5
|
+
import { u as ct, U as ht } from "./usePrinter-Jr3eyr8H.js";
|
|
6
|
+
import { _ as dt } from "./Tooltip-BzsAOdBd.js";
|
|
7
|
+
import { D as pt } from "./DataTable-Dk-94kK2.js";
|
|
8
|
+
import ft from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
9
|
+
import { _ as yt } from "./Shape-vIKj52KP.js";
|
|
10
|
+
import bt from "./vue-ui-accordion-ldF7KsjV.js";
|
|
11
|
+
import { u as Se } from "./useNestedProp-Cvz4MkSy.js";
|
|
12
|
+
import { _ as mt } from "./PackageVersion-BdNfnIm2.js";
|
|
13
|
+
import { _ as gt } from "./PenAndPaper-wrVNMaG8.js";
|
|
14
14
|
import { u as kt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { u as xt } from "./useChartAccessibility-BWojgys7.js";
|
|
16
16
|
import { _ as wt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DiJiQMBB.cjs"),re=require("./useResponsive-DQmBAoBf.cjs"),ge=require("./Title-zlQvBTwR.cjs"),se=require("./usePrinter-Bkd5ycBt.cjs"),ke=require("./Tooltip-DY4rXOAP.cjs"),xe=require("./DataTable-DSiJ_YaA.cjs"),Ce=require("./vue-ui-skeleton-DEI0qJZY.cjs"),we=require("./Shape-BgbyzOCz.cjs"),Be=require("./vue-ui-accordion-P5hXhzth.cjs"),ne=require("./useNestedProp-DqEOzYzu.cjs"),Se=require("./PackageVersion-DCriWnX3.cjs"),$e=require("./PenAndPaper-lj1PPAzR.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),_e=require("./useChartAccessibility-Cm7nkzTG.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Le=["id"],Pe=["xmlns","viewBox"],Ee=["x","y","width","height"],Ae={key:1},ze={key:0},Ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Oe={key:1},Fe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],De=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x1","x2","y1","y2","stroke","stroke-width"],Ie=["x","y","fill","font-size"],We=["x","y","font-size","fill"],qe=["fill","font-size","transform"],Re=["fill","font-size","x","y"],Ge=["x1","x2","y1","y2","stroke"],Ue=["cx","cy","fill"],He=["cx","cy","fill"],je=["id"],Xe=["stop-color"],Ye=["stop-color"],Je=["stop-color"],Ke={key:0},Qe=["x","y","font-size","fill"],Ze={key:5,class:"vue-data-ui-watermark"},et=["innerHTML"],tt={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ue,{expose:ie,emit:ce}){const{vue_ui_strip_plot:ve}=r.useConfig(),v=ue,de=ce,p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),g=e.ref(null),D=e.ref(null),M=e.ref(null),I=e.ref(null),W=e.ref(!1),q=e.ref(0),R=e.ref(0),t=e.computed({get:()=>j(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:G,keepUserOptionState:U}=Ne.useUserOptionState({config:t.value}),{svgRef:H}=_e.useChartAccessibility({config:t.value.style.chart.title});function j(){const l=ne.useNestedProp({userConfig:v.config,defaultConfig:ve});return l.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=j(),A.value=!t.value.userOptions.showOnChartHover,X(),q.value+=1,R.value+=1,c.value.dataLabels.show=t.value.style.chart.labels.bestPlotLabel.show,c.value.showTable=t.value.table.show,c.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const C=e.ref(null);e.onMounted(()=>{X()});function X(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=re.throttle(()=>{const{width:s,height:o}=re.useResponsive({chart:g.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:I.value});requestAnimationFrame(()=>{w.value=o,y.value.width=s,y.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})})});C.value=new ResizeObserver(l),C.value.observe(g.value.parentNode)}W.value=!0,setTimeout(()=>{k.value=!1},pe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=se.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot",options:t.value.userOptions.print}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Z=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),pe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),z=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),f=e.computed(()=>r.calculateNiceScale(z.value.min<0?z.value.min:0,z.value.max,t.value.style.chart.grid.scaleSteps)),fe=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))*a.value.height}))}))),ee=e.computed(()=>f.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function me({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function te(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,m)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[m],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),b=e.ref(!1);function ye(l){b.value=l,F.value+=1}function be(){return h.value}function le(){c.value.showTable=!c.value.showTable}function oe(){c.value.dataLabels.show=!c.value.dataLabels.show}function ae(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ie({getData:be,generatePdf:K,generateCsv:te,generateImage:Q,toggleTable:le,toggleLabels:oe,toggleTooltip:ae,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:g,class:e.normalizeClass(`vue-ui-strip-plot ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(G)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock($e._sfc_main,{key:0,svgRef:e.unref(H),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(U)||e.unref(A))?(e.openBlock(),e.createBlock(se.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(J),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(K),onGenerateCsv:te,onGenerateImage:e.unref(Q),onToggleTable:le,onToggleLabels:oe,onToggleTooltip:ae,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(U)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:n})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:n})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:H,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(Se._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Ee)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ae,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ve))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Fe))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,De),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Me)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(ee.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Ie))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,We))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,qe)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Re)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ue),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,He)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Je)],8,je))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createBlock(we._sfc_main,e.mergeProps({plot:{x:u.x,y:W.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>me({datapoint:u,seriesIndex:m}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>de("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${m*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},{ref_for:!0},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:m}):""),13,Qe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,Pe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ke._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:E.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Be.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(xe.DataTable,{key:`table_${R.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,et)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Le))}},lt=Te._export_sfc(tt,[["__scopeId","data-v-409e2195"]]);exports.default=lt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DgIVCHLv.cjs"),re=require("./useResponsive-DQmBAoBf.cjs"),ge=require("./Title-Bae0QJu7.cjs"),se=require("./usePrinter-B2xVvtiy.cjs"),ke=require("./Tooltip-CfqYTd5O.cjs"),xe=require("./DataTable-CGucPqAQ.cjs"),Ce=require("./vue-ui-skeleton-DeEGdJEn.cjs"),we=require("./Shape-Cn2RU1NY.cjs"),Be=require("./vue-ui-accordion-DE1isSE9.cjs"),ne=require("./useNestedProp-CCR03NVM.cjs"),Se=require("./PackageVersion-C2bjLIu9.cjs"),$e=require("./PenAndPaper-CJIFAI78.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),_e=require("./useChartAccessibility-Cm7nkzTG.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Le=["id"],Pe=["xmlns","viewBox"],Ee=["x","y","width","height"],Ae={key:1},ze={key:0},Ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Oe={key:1},Fe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],De=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x1","x2","y1","y2","stroke","stroke-width"],Ie=["x","y","fill","font-size"],We=["x","y","font-size","fill"],qe=["fill","font-size","transform"],Re=["fill","font-size","x","y"],Ge=["x1","x2","y1","y2","stroke"],Ue=["cx","cy","fill"],He=["cx","cy","fill"],je=["id"],Xe=["stop-color"],Ye=["stop-color"],Je=["stop-color"],Ke={key:0},Qe=["x","y","font-size","fill"],Ze={key:5,class:"vue-data-ui-watermark"},et=["innerHTML"],tt={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ue,{expose:ie,emit:ce}){const{vue_ui_strip_plot:ve}=r.useConfig(),v=ue,de=ce,p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),g=e.ref(null),D=e.ref(null),M=e.ref(null),I=e.ref(null),W=e.ref(!1),q=e.ref(0),R=e.ref(0),t=e.computed({get:()=>j(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:G,keepUserOptionState:U}=Ne.useUserOptionState({config:t.value}),{svgRef:H}=_e.useChartAccessibility({config:t.value.style.chart.title});function j(){const l=ne.useNestedProp({userConfig:v.config,defaultConfig:ve});return l.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=j(),A.value=!t.value.userOptions.showOnChartHover,X(),q.value+=1,R.value+=1,c.value.dataLabels.show=t.value.style.chart.labels.bestPlotLabel.show,c.value.showTable=t.value.table.show,c.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const C=e.ref(null);e.onMounted(()=>{X()});function X(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=re.throttle(()=>{const{width:s,height:o}=re.useResponsive({chart:g.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:I.value});requestAnimationFrame(()=>{w.value=o,y.value.width=s,y.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})})});C.value=new ResizeObserver(l),C.value.observe(g.value.parentNode)}W.value=!0,setTimeout(()=>{k.value=!1},pe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=se.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot",options:t.value.userOptions.print}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Z=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),pe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),z=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),f=e.computed(()=>r.calculateNiceScale(z.value.min<0?z.value.min:0,z.value.max,t.value.style.chart.grid.scaleSteps)),fe=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))*a.value.height}))}))),ee=e.computed(()=>f.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function me({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function te(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,m)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[m],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),b=e.ref(!1);function ye(l){b.value=l,F.value+=1}function be(){return h.value}function le(){c.value.showTable=!c.value.showTable}function oe(){c.value.dataLabels.show=!c.value.dataLabels.show}function ae(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ie({getData:be,generatePdf:K,generateCsv:te,generateImage:Q,toggleTable:le,toggleLabels:oe,toggleTooltip:ae,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:g,class:e.normalizeClass(`vue-ui-strip-plot ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(G)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock($e._sfc_main,{key:0,svgRef:e.unref(H),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(U)||e.unref(A))?(e.openBlock(),e.createBlock(se.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(J),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(K),onGenerateCsv:te,onGenerateImage:e.unref(Q),onToggleTable:le,onToggleLabels:oe,onToggleTooltip:ae,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(U)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:n})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:n})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:H,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(Se._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Ee)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ae,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ve))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Fe))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,De),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Me)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(ee.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Ie))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,We))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,qe)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Re)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ue),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,He)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Je)],8,je))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createBlock(we._sfc_main,e.mergeProps({plot:{x:u.x,y:W.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>me({datapoint:u,seriesIndex:m}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>de("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${m*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},{ref_for:!0},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:m}):""),13,Qe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,Pe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ke._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:E.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Be.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(xe.DataTable,{key:`table_${R.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,et)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Le))}},lt=Te._export_sfc(tt,[["__scopeId","data-v-409e2195"]]);exports.default=lt;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a3 as z, A as P, l as T, r as U, f as V, h as X, q as j, z as Y, d as W, G as J, u as K, p as Z } from "./index-
|
|
2
|
-
import q from "./vue-ui-xy-
|
|
3
|
-
import Q from "./vue-ui-donut-
|
|
1
|
+
import { a3 as z, A as P, l as T, r as U, f as V, h as X, q as j, z as Y, d as W, G as J, u as K, p as Z } from "./index-BI6O7K58.js";
|
|
2
|
+
import q from "./vue-ui-xy-B1HwPMFi.js";
|
|
3
|
+
import Q from "./vue-ui-donut-BGZIwC5D.js";
|
|
4
4
|
import { resolveComponent as x, createElementBlock as u, openBlock as c, normalizeStyle as g, createElementVNode as a, createCommentVNode as b, toDisplayString as d, Fragment as I, renderList as _, normalizeClass as p, createTextVNode as w, withDirectives as O, vModelText as S, withKeys as L, withModifiers as A, vModelSelect as $, createBlock as E, createVNode as ee } from "vue";
|
|
5
5
|
import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const se = {
|