vue-data-ui 3.29.1 → 3.29.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +265 -273
- package/dist/{PackageVersion-BbZ3wNGs.js → PackageVersion-D8aPzzvh.js} +1 -1
- package/dist/SlicerPreview-BVgz_p4G.js +1 -0
- package/dist/{XyAnalysisOptions-BpjGs_2b.js → XyAnalysisOptions-TrM-d1cV.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-label.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/package-C5OjoKoX.js +1 -0
- package/dist/{render-common-Bc3-uPjM.js → render-common-D_b9nsiP.js} +1 -1
- package/dist/ssr/vue-ui-donut.js +1 -1
- package/dist/ssr/vue-ui-xy.js +1 -1
- package/dist/ssr.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +126 -9
- package/dist/types/vue-ui-world.d.ts +4 -0
- package/dist/{useConfig-CBXrYhMI.js → useConfig-CXhXxWjB.js} +1 -1
- package/dist/useLoading-DoqqfnmS.js +1 -0
- package/dist/useObjectBindings-BCep9t8A.js +1 -0
- package/dist/usePanZoom-DlEcNgCv.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-KUM8DuFn.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BXDDF5Hq.js → vue-ui-3d-bar-Qk10B6Cd.js} +1 -1
- package/dist/{vue-ui-accordion-CV2dxsXB.js → vue-ui-accordion-D3uT1Ynv.js} +1 -1
- package/dist/{vue-ui-age-pyramid-BDoFrY4Y.js → vue-ui-age-pyramid-DrI34mhm.js} +1 -1
- package/dist/{vue-ui-annotator-DBItXQjx.js → vue-ui-annotator-aP1DFNt9.js} +1 -1
- package/dist/{vue-ui-bullet-iOGIwd8G.js → vue-ui-bullet-CKFpHbob.js} +1 -1
- package/dist/{vue-ui-bump-CYYE7AYx.js → vue-ui-bump-3DZDFqlN.js} +1 -1
- package/dist/{vue-ui-candlestick-fQbKxfp6.js → vue-ui-candlestick-D-pcBKMb.js} +1 -1
- package/dist/{vue-ui-carousel-table-DUUhomv3.js → vue-ui-carousel-table-jc4H5Csu.js} +1 -1
- package/dist/{vue-ui-chestnut-D7bO1IIi.js → vue-ui-chestnut-DuY5XkX5.js} +1 -1
- package/dist/{vue-ui-chord-Cwg9Vjnn.js → vue-ui-chord-B7OK3qHh.js} +1 -1
- package/dist/{vue-ui-circle-pack-C18kRERE.js → vue-ui-circle-pack-B8jc9sHP.js} +1 -1
- package/dist/{vue-ui-cursor-BxBeDqnb.js → vue-ui-cursor-IwoqyrxC.js} +1 -1
- package/dist/{vue-ui-dag-BMBSp7ua.js → vue-ui-dag-Ji8-v6L0.js} +1 -1
- package/dist/{vue-ui-dashboard-wDPL7yQw.js → vue-ui-dashboard-WIwFoyCz.js} +1 -1
- package/dist/{vue-ui-digits-CVpi-dBr.js → vue-ui-digits-DG2jj43S.js} +1 -1
- package/dist/{vue-ui-donut-BJumteL7.js → vue-ui-donut-BZHm9bc7.js} +1 -1
- package/dist/{vue-ui-donut-D5LOpVST.js → vue-ui-donut-Cp_rDJUY.js} +1 -1
- package/dist/{vue-ui-donut-evolution-DNY_zpSw.js → vue-ui-donut-evolution-_Kdf1mvb.js} +1 -1
- package/dist/{vue-ui-dumbbell-CT22NxlP.js → vue-ui-dumbbell-7IaXl-8-.js} +1 -1
- package/dist/{vue-ui-flow-ihpQN8B4.js → vue-ui-flow-DR_wI1D2.js} +1 -1
- package/dist/{vue-ui-funnel-CydmxKNq.js → vue-ui-funnel-BN1pctHJ.js} +1 -1
- package/dist/{vue-ui-galaxy-CDdpiwLH.js → vue-ui-galaxy-Hh7hGC7B.js} +1 -1
- package/dist/{vue-ui-gauge-Cu6cz42H.js → vue-ui-gauge-BLRxKref.js} +1 -1
- package/dist/{vue-ui-geo-DAtuaLrb.js → vue-ui-geo-CCgF74O9.js} +1 -1
- package/dist/{vue-ui-gizmo-C-MEb9P1.js → vue-ui-gizmo-Crc_ZyI6.js} +1 -1
- package/dist/{vue-ui-graph-CyySb2SE.js → vue-ui-graph-BKP_eWfb.js} +1 -1
- package/dist/{vue-ui-heatmap-CcWLxTbW.js → vue-ui-heatmap-ClwqkUxt.js} +1 -1
- package/dist/{vue-ui-hill-mvdRA1RD.js → vue-ui-hill-GDmqAoJ5.js} +1 -1
- package/dist/{vue-ui-history-plot-AL9z3mC6.js → vue-ui-history-plot-ApFEePsd.js} +1 -1
- package/dist/{vue-ui-horizontal-bar-D2IV9phG.js → vue-ui-horizontal-bar-ny2bvg06.js} +1 -1
- package/dist/{vue-ui-kpi-ZCJekvYX.js → vue-ui-kpi-Bp1e999m.js} +1 -1
- package/dist/{vue-ui-label-CAMjkZc2.js → vue-ui-label-W0ITGnQa.js} +1 -1
- package/dist/{vue-ui-mini-loader-B15gWQp1.js → vue-ui-mini-loader-BBsXG6nD.js} +1 -1
- package/dist/{vue-ui-molecule-H88Xsomv.js → vue-ui-molecule-DxtTUaLQ.js} +1 -1
- package/dist/{vue-ui-mood-radar-De_2I7pq.js → vue-ui-mood-radar-j0d3TK6F.js} +1 -1
- package/dist/{vue-ui-nested-donuts-DGWgyIoR.js → vue-ui-nested-donuts-B5uZ3ysI.js} +1 -1
- package/dist/{vue-ui-onion-QidVWMud.js → vue-ui-onion-CNh69F7R.js} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DFw19TpK.js → vue-ui-parallel-coordinate-plot-2SQJp8f0.js} +1 -1
- package/dist/{vue-ui-quadrant-CeMOzfdY.js → vue-ui-quadrant-Bhgpb3cX.js} +1 -1
- package/dist/{vue-ui-quick-chart-Tyt1WdUW.js → vue-ui-quick-chart-Bfe2UmN_.js} +1 -1
- package/dist/{vue-ui-radar-C4U7ohC4.js → vue-ui-radar-3dYXgEMZ.js} +1 -1
- package/dist/{vue-ui-rating-BbHvfFsG.js → vue-ui-rating-CwD4CB9M.js} +1 -1
- package/dist/{vue-ui-relation-circle-zoBhpcTB.js → vue-ui-relation-circle-BG6-M08A.js} +1 -1
- package/dist/{vue-ui-ridgeline-C9ECt2cC.js → vue-ui-ridgeline-C0iY3yTj.js} +1 -1
- package/dist/{vue-ui-rings-kYvvKGXk.js → vue-ui-rings-B_J_Gfrt.js} +1 -1
- package/dist/{vue-ui-scatter-Bs5NhtfK.js → vue-ui-scatter-Cehkxo2z.js} +1 -1
- package/dist/{vue-ui-skeleton-BSM40fOT.js → vue-ui-skeleton-D-hfKRUc.js} +1 -1
- package/dist/{vue-ui-smiley-BvkpUjyE.js → vue-ui-smiley-B34VeonG.js} +1 -1
- package/dist/{vue-ui-spark-trend-DmJHx3aj.js → vue-ui-spark-trend--Dt7macD.js} +1 -1
- package/dist/{vue-ui-sparkbar-6wKyKgYy.js → vue-ui-sparkbar-DzGe_dfJ.js} +1 -1
- package/dist/{vue-ui-sparkgauge-BnZZ2zhe.js → vue-ui-sparkgauge-BqcV18vm.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-C9cyazhH.js → vue-ui-sparkhistogram-TdoHtGYT.js} +1 -1
- package/dist/{vue-ui-sparkline-a1e4A-Gl.js → vue-ui-sparkline-Eet_Atf1.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-BTEpVODr.js → vue-ui-sparkstackbar-B1SX-oPW.js} +1 -1
- package/dist/{vue-ui-stackbar-BplckX2c.js → vue-ui-stackbar-BsEWtYRO.js} +1 -1
- package/dist/{vue-ui-stackline-1KSn7Lw-.js → vue-ui-stackline-B5hG3Qg4.js} +1 -1
- package/dist/{vue-ui-strip-plot-ZCX50Scf.js → vue-ui-strip-plot-eWnUp_6Y.js} +1 -1
- package/dist/{vue-ui-table-BRwwKG0f.js → vue-ui-table-G7KEKsPH.js} +1 -1
- package/dist/{vue-ui-table-heatmap-2csQOE2c.js → vue-ui-table-heatmap-CpviNfWA.js} +1 -1
- package/dist/{vue-ui-table-sparkline-VLptltwn.js → vue-ui-table-sparkline-BDS0VE4_.js} +1 -1
- package/dist/{vue-ui-thermometer-DUocWNhm.js → vue-ui-thermometer-C-jpJjJ8.js} +1 -1
- package/dist/{vue-ui-timer-DfFRykEz.js → vue-ui-timer-DNAmPraQ.js} +2 -2
- package/dist/{vue-ui-tiremarks-BBtWpWBE.js → vue-ui-tiremarks-9om1K_xI.js} +1 -1
- package/dist/{vue-ui-treemap-Bz1FshtF.js → vue-ui-treemap-DjpsD5YK.js} +1 -1
- package/dist/{vue-ui-waffle-C7SVznJl.js → vue-ui-waffle-C7i07E9j.js} +1 -1
- package/dist/{vue-ui-wheel-BaZ08ojL.js → vue-ui-wheel-DagrJGMA.js} +1 -1
- package/dist/{vue-ui-word-cloud-BOUVu-F2.js → vue-ui-word-cloud-DEa-Eg43.js} +1 -1
- package/dist/vue-ui-world-UE0OI7Nw.js +6 -0
- package/dist/{vue-ui-xy-CGuTzofF.js → vue-ui-xy-BlxUkwlc.js} +3 -3
- package/dist/{vue-ui-xy-CmQ5D8Rm.js → vue-ui-xy-D7jTqz17.js} +1 -1
- package/dist/{vue-ui-xy-canvas-FULC8M7D.js → vue-ui-xy-canvas-C8Xi5Bad.js} +1 -1
- package/dist/vue_ui_3d_bar-a0FfmmtP.js +1 -0
- package/dist/vue_ui_age_pyramid-D7NsLedn.js +1 -0
- package/dist/vue_ui_bullet-BkBSdYu0.js +1 -0
- package/dist/vue_ui_bump-B9xVuU__.js +1 -0
- package/dist/vue_ui_candlestick-BWWbdIyT.js +1 -0
- package/dist/vue_ui_chestnut-RJBM3mVF.js +1 -0
- package/dist/vue_ui_chord-Dtr5fUsF.js +1 -0
- package/dist/vue_ui_circle_pack-BbM0742M.js +1 -0
- package/dist/vue_ui_dag-fH3SPZmq.js +1 -0
- package/dist/vue_ui_donut-D72uP7v_.js +1 -0
- package/dist/vue_ui_donut_evolution-DNbU1-O1.js +1 -0
- package/dist/vue_ui_dumbbell-Do6-Spsn.js +1 -0
- package/dist/vue_ui_flow-N2kD68UX.js +1 -0
- package/dist/vue_ui_funnel-C7smZrMr.js +1 -0
- package/dist/vue_ui_galaxy-iCWLHLBY.js +1 -0
- package/dist/vue_ui_gauge-7ZBefvwi.js +1 -0
- package/dist/vue_ui_geo-C0X_5tfx.js +1 -0
- package/dist/vue_ui_graph-B82JmqZx.js +1 -0
- package/dist/vue_ui_heatmap-DxrGop3z.js +1 -0
- package/dist/vue_ui_hill-B6vghkYj.js +1 -0
- package/dist/vue_ui_history_plot-BZ5TtPPB.js +1 -0
- package/dist/vue_ui_horizontal_bar-_jcrdeQR.js +1 -0
- package/dist/vue_ui_label-ByQC3K-q.js +1 -0
- package/dist/vue_ui_molecule-DYWXPxKs.js +1 -0
- package/dist/vue_ui_mood_radar-BSOkyeXz.js +1 -0
- package/dist/vue_ui_nested_donuts-BTu965IJ.js +1 -0
- package/dist/vue_ui_onion-B32NW6YW.js +1 -0
- package/dist/vue_ui_parallel_coordinate_plot-BhzmL7XF.js +1 -0
- package/dist/vue_ui_quadrant-CZEw2s9q.js +1 -0
- package/dist/vue_ui_quick_chart-B_UHYuFd.js +1 -0
- package/dist/vue_ui_radar-BujJL_m0.js +1 -0
- package/dist/vue_ui_relation_circle-Bd8SWF0Z.js +1 -0
- package/dist/vue_ui_ridgeline-Bea0vgUJ.js +1 -0
- package/dist/vue_ui_rings-CTMi6U5j.js +1 -0
- package/dist/vue_ui_scatter-7_MRCcGv.js +1 -0
- package/dist/vue_ui_spark_trend-CW5mVKj6.js +1 -0
- package/dist/vue_ui_sparkbar-C55ZEqe2.js +1 -0
- package/dist/vue_ui_sparkgauge-B3uHUGBP.js +1 -0
- package/dist/vue_ui_sparkhistogram-Cp_MUg0f.js +1 -0
- package/dist/vue_ui_sparkline-B5nV1OJG.js +1 -0
- package/dist/vue_ui_sparkstackbar-BIJlKzOE.js +1 -0
- package/dist/vue_ui_stackbar-DvSDT3Je.js +1 -0
- package/dist/vue_ui_stackline-D3XX6Wzc.js +1 -0
- package/dist/vue_ui_strip_plot-BcrT-Tvm.js +1 -0
- package/dist/vue_ui_table_heatmap-BtRnWTud.js +1 -0
- package/dist/vue_ui_table_sparkline-DZQYAsyS.js +1 -0
- package/dist/vue_ui_thermometer-DsLnfqd2.js +1 -0
- package/dist/vue_ui_tiremarks-v9pVlb9O.js +1 -0
- package/dist/vue_ui_treemap-Bgcc2FKO.js +1 -0
- package/dist/vue_ui_vertical_bar-DG0MDW9k.js +1 -0
- package/dist/vue_ui_waffle-ChvE90eL.js +1 -0
- package/dist/vue_ui_wheel-CCkSsMkm.js +1 -0
- package/dist/vue_ui_word_cloud-BCZlF5jp.js +1 -0
- package/dist/vue_ui_world-DohVGEJ_.js +1 -0
- package/dist/vue_ui_xy-CKoNRS4H.js +1 -0
- package/dist/vue_ui_xy_canvas-DfwwPUBo.js +1 -0
- package/package.json +1 -1
- package/dist/SlicerPreview-Ks9FNVzh.js +0 -1
- package/dist/package-BsppqqRX.js +0 -1
- package/dist/useLoading-BwiplGDB.js +0 -1
- package/dist/useObjectBindings-DDUobNFp.js +0 -1
- package/dist/usePanZoom-CTGk8aJt.js +0 -1
- package/dist/vue-data-ui-CMig_4IZ.js +0 -1
- package/dist/vue-ui-world-E2JfHzRD.js +0 -19
- package/dist/vue_ui_3d_bar-Dm8zmL8w.js +0 -1
- package/dist/vue_ui_age_pyramid-DXJeenVU.js +0 -1
- package/dist/vue_ui_bullet-Biewiy1l.js +0 -1
- package/dist/vue_ui_bump-DZoGcET0.js +0 -1
- package/dist/vue_ui_candlestick-DpPpEElM.js +0 -1
- package/dist/vue_ui_chestnut-BKcntsvv.js +0 -1
- package/dist/vue_ui_chord-Crjq1pgV.js +0 -1
- package/dist/vue_ui_circle_pack-DarCZyF2.js +0 -1
- package/dist/vue_ui_dag-B-4OxeQQ.js +0 -1
- package/dist/vue_ui_donut-B2W2nyAS.js +0 -1
- package/dist/vue_ui_donut_evolution-BvIyBtun.js +0 -1
- package/dist/vue_ui_dumbbell-DyyFLbhQ.js +0 -1
- package/dist/vue_ui_flow-aeVlnSsc.js +0 -1
- package/dist/vue_ui_funnel-CWrEr790.js +0 -1
- package/dist/vue_ui_galaxy-DvaSrGxT.js +0 -1
- package/dist/vue_ui_gauge-Brc1-auP.js +0 -1
- package/dist/vue_ui_geo-COGanKF8.js +0 -1
- package/dist/vue_ui_graph-31AYnh4c.js +0 -1
- package/dist/vue_ui_heatmap-Q8YMKNq2.js +0 -1
- package/dist/vue_ui_hill-Dbv_VVlr.js +0 -1
- package/dist/vue_ui_history_plot-C0kFJh-f.js +0 -1
- package/dist/vue_ui_horizontal_bar-uuJ0_9O6.js +0 -1
- package/dist/vue_ui_label-D3BzxTFQ.js +0 -1
- package/dist/vue_ui_molecule-VokyVu8q.js +0 -1
- package/dist/vue_ui_mood_radar-i6r1Gp6v.js +0 -1
- package/dist/vue_ui_nested_donuts-BAb9o0Ro.js +0 -1
- package/dist/vue_ui_onion-BMjwCChN.js +0 -1
- package/dist/vue_ui_parallel_coordinate_plot-Wb2Xmpjs.js +0 -1
- package/dist/vue_ui_quadrant-DbLNBD92.js +0 -1
- package/dist/vue_ui_quick_chart-KljadV9E.js +0 -1
- package/dist/vue_ui_radar-Pd3xOzjc.js +0 -1
- package/dist/vue_ui_relation_circle-BLo4XQFQ.js +0 -1
- package/dist/vue_ui_ridgeline-BIaWjw_v.js +0 -1
- package/dist/vue_ui_rings-C0puwNW1.js +0 -1
- package/dist/vue_ui_scatter-4as114Wa.js +0 -1
- package/dist/vue_ui_spark_trend-BgPQfeCz.js +0 -1
- package/dist/vue_ui_sparkbar-CvcZ5nwT.js +0 -1
- package/dist/vue_ui_sparkgauge-D3xirz2w.js +0 -1
- package/dist/vue_ui_sparkhistogram-E6G1761_.js +0 -1
- package/dist/vue_ui_sparkline-DKZdnbap.js +0 -1
- package/dist/vue_ui_sparkstackbar-DZX34uPS.js +0 -1
- package/dist/vue_ui_stackbar-BrAzeA3Y.js +0 -1
- package/dist/vue_ui_stackline-CBl7ydff.js +0 -1
- package/dist/vue_ui_strip_plot-uxKGttVC.js +0 -1
- package/dist/vue_ui_table_heatmap-DVMDsaVJ.js +0 -1
- package/dist/vue_ui_table_sparkline-BQO5A9u8.js +0 -1
- package/dist/vue_ui_thermometer-BAFdvXZW.js +0 -1
- package/dist/vue_ui_tiremarks-LwElhY5p.js +0 -1
- package/dist/vue_ui_treemap-JB0DfAmd.js +0 -1
- package/dist/vue_ui_vertical_bar-BLyflvlz.js +0 -1
- package/dist/vue_ui_waffle-BVf3Wcda.js +0 -1
- package/dist/vue_ui_wheel-bdYAONK7.js +0 -1
- package/dist/vue_ui_word_cloud-Dn2Ffjxb.js +0 -1
- package/dist/vue_ui_xy-BfaXjpvS.js +0 -1
- package/dist/vue_ui_xy_canvas-cQVme5sy.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as ee}from"./tableIntegration-CNoJ1CIY.js";import{t as te}from"./chartImage-DPGnEuYM.js";import{n as ne}from"./resolveChartConfig-0IvbmIE_.js";import{$ as re,D as ie,Dt as ae,Et as oe,Ft as se,Ht as ce,J as le,Q as ue,S as de,T as fe,X as pe,_ as me,at as he,i as ge,in as _e,nt as ve,qt as ye,r as be,rn as xe,t as Se,tn as Ce,w as we}from"./lib-rPeBMZrn.js";import{n as Te,t as Ee}from"./useHints-C-TwxM0Y.js";import{t as De}from"./useConfig-CBXrYhMI.js";import{t as Oe}from"./useSvgLabelLayout-42Kats14.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./useChartExport-BZts4KFb.js";import{t as Me}from"./useTransitions-ChGGrtrv.js";import{t as Ne}from"./useChartAccessibility-DOMuYJfm.js";import{t as Pe}from"./useTimeLabelCollider-BTybMUFi.js";import{n as Fe}from"./Title-BliHuXfT.js";import{t as Ie}from"./vue_ui_history_plot-C0kFJh-f.js";import{t as Le}from"./Legend-W9YVYVX-.js";import{t as Re}from"./BaseScanner-m6QR9rwD.js";import{t as ze}from"./A11yDataTable-DWNlWXzs.js";import{t as Be}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ve}from"./DefGrad-DKMq1REY.js";import{t as He}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,Teleport as Ue,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as qe,nextTick as Je,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onBeforeUnmount as Ye,onMounted as Xe,openBlock as y,reactive as Ze,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Qe,shallowRef as $e,toDisplayString as C,unref as w,watch as T,withCtx as E}from"vue";var et=/* @__PURE__ */ e({default:()=>zt}),tt=[`id`],nt=[`id`],rt=[`id`],it={style:{position:`relative`}},at=[`xmlns`,`viewBox`,`aria-describedby`],ot=[`x`,`y`,`width`,`height`],st={key:1},ct=[`id`,`x1`,`y1`,`x2`,`y2`],lt=[`stop-color`,`offset`],ut={key:2},dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft={key:3},pt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],mt=[`x`,`y`,`fill`,`font-size`],ht=[`transform`,`font-size`,`fill`,`font-weight`],gt={key:6},_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt={key:7},yt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],bt=[`transform`,`fill`,`font-size`,`text-anchor`],xt=[`x`,`y`,`font-size`,`fill`,`font-weight`],St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],wt=[`d`,`stroke`,`stroke-width`],Tt=[`d`,`stroke`,`stroke-width`],Et=[`cx`,`cy`,`fill`,`r`],Dt=[`cx`,`cy`,`fill`,`r`,`stroke`,`stroke-width`],Ot={key:1},kt=[`transform`,`font-size`,`fill`,`font-weight`],At=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],jt={key:2},Mt=[`transform`,`font-size`,`font-weight`,`fill`],Nt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],Pt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ft={key:5,class:`vue-data-ui-watermark`},It=[`id`],Lt=[`onClick`],Rt={style:{display:`flex`,"align-items":`center`}},zt=/*#__PURE__*/ He({__name:`vue-ui-history-plot`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:He,emit:et}){let zt=m(()=>import(`./Tooltip-B432XpvC.js`)),Bt=m(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Vt=m(()=>import(`./vue-ui-accordion-CV2dxsXB.js`).then(e=>e.n)),Ht=m(()=>import(`./DataTable-KeuZB1JM.js`)),Ut=m(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Wt=m(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Gt=m(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),Kt=m(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_history_plot:qt}=De(),D=e,O=b(null),Jt=b(null),Yt=b(null),Xt=b(0),Zt=$e(null),Qt=b(null),k=b(pe()),$t=b(!1),en=b(``),A=b([]),tn=b(!1),j=b(null),M=b(!1),nn=b(null),rn=b(!1),an=b(null),on=b(null),sn=b(null),cn=b(null),ln=b(null),un=b(null),N=b(null),P=b(null),dn=b({x:0,y:0}),fn=b(`pointer`),pn=b(!1),mn=l(()=>Array.from(D.dataset,e=>{let t=e&&typeof e==`object`?Object.keys(e):[],n=[`name`,`values`].filter(e=>!t.includes(e)),r=Array.isArray(e?.values),i=r?Array.from(e.values,e=>({x:Number.isFinite(e?.x),y:Number.isFinite(e?.y)})):[];return{missing:n,array:r,points:i,valid:!n.length&&r&&i.every(e=>e.x&&e.y)}})),hn=l(()=>D.dataset.length>0&&mn.value.every(e=>e.valid)),gn=et,_n=b(!1),F=null,vn=!1,yn=$e(null);function bn(){Zt.value?.disconnect(),Zt.value=null,F!==null&&cancelAnimationFrame(F),F=null}function xn(){if(bn(),yn.value=null,_n.value=!1,!L.value.responsive||!O.value?.parentNode)return;let e=new ResizeObserver(t);function t(){vn||Zt.value!==e||(F!==null&&cancelAnimationFrame(F),F=requestAnimationFrame(()=>{if(vn||Zt.value!==e)return;F=null;let{width:t,height:n}=Ae({chart:O.value,title:H.value.title.text?Jt.value:null,noTitle:Qt.value,legend:H.value.legend.show?Yt.value:null,source:nn.value});yn.value={width:Math.max(.1,t),height:Math.max(.1,n)},_n.value=!0}))}Zt.value=e,e.observe(O.value.parentNode);for(let t of[Jt.value,Yt.value,nn.value,Qt.value])t&&e.observe(t);t()}Xe(()=>{rn.value=!0,xn()}),Ye(()=>{vn=!0,bn()});function Sn(){return ne(D.config,qt,Ie)}let Cn=l(()=>Ze(Sn())),I=l(()=>!!D.config.loading||!hn.value),wn=l(()=>_e({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,axes:{x:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}},y:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}}},grid:{xAxis:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A50`},yAxis:{stroke:`#6A6A6A`},verticalLines:{stroke:`#6A6A6A50`}},legend:{backgroundColor:`transparent`},paths:{useSerieColor:!1,stroke:`#6A6A6A`},plots:{stroke:`#6A6A6A`,indexLabels:{show:!1},labels:{show:!1}}}}},userConfig:Cn.value.skeletonConfig??{}})),L=l(()=>I.value?Ze(_e({defaultConfig:Cn.value,userConfig:wn.value})):Cn.value),Tn=l(()=>I.value?D.config.skeletonDataset??[{name:``,color:`#CACACA`,values:[{label:``,x:1,y:9},{label:``,x:4,y:1},{label:``,x:7,y:9},{label:``,x:9,y:4}]}]:D.dataset),R=l(()=>Cn.value.debug),z=l(()=>L.value.style.chart.plots),B=l(()=>L.value.style.chart.grid),V=l(()=>L.value.style.chart.axes),H=l(()=>L.value.style.chart);Te({config:()=>L.value,dataset:()=>D.dataset,component:`VueUiHistoryPlot`,rules:[Ee.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display.`]}]});let{transitionEnabled:U}=Me({config:()=>L.value.transitions,dataset:()=>D.dataset}),En=l(()=>L.value.userOptions.useCursorPointer),Dn=b(!L.value.userOptions.showOnChartHover),On=l(()=>L.value.userOptions.keepStateOnChartLeave);function kn(e=!1){L.value.userOptions.showOnChartHover&&(Dn.value=e)}T(()=>L.value.userOptions.showOnChartHover,e=>{Dn.value=!e});let{svgRef:W}=Ne({config:H.value.title});T([mn,R],()=>{D.dataset.length||he({componentName:`VueUiHistoryPlot`,type:`dataset`,debug:R.value}),mn.value.forEach((e,t)=>{e.missing.forEach(e=>he({componentName:`VueUiHistoryPlot`,type:`datasetSerieAttribute`,property:e,index:t,debug:R.value})),R.value&&(!e.missing.includes(`values`)&&!e.array&&console.warn(`VueUiHistoryPlot: dataset[${t}].values must be an array.`),e.points.forEach((e,n)=>{for(let r of[`x`,`y`])e[r]||console.warn(`VueUiHistoryPlot: dataset[${t}].values[${n}].${r} must be a finite number.`)}))})},{immediate:!0}),T([()=>L.value.responsive,()=>H.value.title.text,()=>H.value.legend.show,()=>H.value.legend.position,Jt,Yt,nn,Qt],xn,{flush:`post`});let{isPrinting:An,isImaging:jn,generatePdf:Mn,generateImage:Nn}=ke({elementId:`history_plot_${k.value}`,fileName:H.value.title.text||`vue-ui-history-plot`,options:L.value.userOptions.print}),Pn=l(()=>L.value.userOptions.show&&!H.value.title.text),Fn=l(()=>we(L.value.customPalette)),G=b({showTable:L.value.table.show,showTooltip:H.value.tooltip.show});T(()=>L.value.table.show,e=>{G.value.showTable=e}),T(()=>H.value.tooltip.show,e=>{G.value.showTooltip=e});let K=l(()=>yn.value||{width:H.value.width,height:H.value.height}),In=l(()=>K.value.width),Ln=l(()=>K.value.height),{metrics:Rn,ready:zn,settling:q,update:Bn}=Oe({svgRef:W,canMeasure:()=>!L.value.responsive||_n.value,initialMetrics:{scaleLabelsWidth:0,yAxisLabelWidth:0,xAxisLabelHeight:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:e(un.value).textWidth,yAxisLabelWidth:e(cn.value).rotatedWidth,xAxisLabelHeight:e(sn.value).height,timeLabelsHeight:e(ln.value).height})});function Vn(){let e=Rn.value.scaleLabelsWidth,t=Rn.value.yAxisLabelWidth;return e+t+(t?24:0)}let Hn=l(()=>Rn.value.xAxisLabelHeight+Rn.value.timeLabelsHeight+(sn.value?Y.value.xAxisName/2:0)),J=l(()=>{let e=z.value.radius,t=H.value.padding.left+Vn()+V.value.y.name.offsetX,n=H.value.padding.top+e,r=K.value.width-H.value.padding.right-e-V.value.y.name.offsetX,i=K.value.height-H.value.padding.bottom-Hn.value-e-V.value.x.name.offsetY;return{left:t,top:n,right:r,bottom:i,width:r-t,height:i-n}}),Y=l(()=>{let e=(e,t)=>L.value.responsive&&L.value.responsiveProportionalSizing&&yn.value?xe({relator:Math.min(K.value.width,K.value.height),adjuster:600,source:e,threshold:t,fallback:t}):e;return{plots:e(z.value.radius,3),indexLabels:e(z.value.indexLabels.fontSize,6),labels:e(z.value.labels.fontSize,6),xAxisLabels:e(V.value.x.labels.fontSize,6),xAxisName:e(V.value.x.name.fontSize,6),yAxisLabels:e(V.value.y.labels.fontSize,6),yAxisName:e(V.value.y.name.fontSize,6)}}),Un=/* @__PURE__ */ new Map;function Wn(e){return Un.has(e)||Un.set(e,pe()),Un.get(e)}let Gn=/* @__PURE__ */ new Map,Kn=l(()=>{let e=/* @__PURE__ */ new Set;function t(t){return e.add(t),Wn(t)}let n=/* @__PURE__ */ new Map,r=Tn.value.map((e,r)=>{let i=e?.id==null?e?.name==null?`index:${r}`:`name:${e.name}`:`id:${typeof e.id}:${e.id}`,a=n.get(i)||0;return n.set(i,a+1),t(`${I.value?`skeleton`:`data`}:${i}:${a}`)}),i=Tn.value.map((e,n)=>{let i=/* @__PURE__ */ new Map;return(Array.isArray(e?.values)?e.values:[]).map((e,a)=>{let o=e?.id==null?e?.label?`label:${e.label}`:`index:${a}`:`id:${typeof e.id}:${e.id}`,s=i.get(o)||0;return i.set(o,s+1),t(`${r[n]}:${o}:${s}`)})});for(let t of Gn.get(I.value)||[])e.has(t)||Un.delete(t);return Gn.set(I.value,e),{series:r,plots:i}}),qn=l(()=>Kn.value.series),Jn=l(()=>Kn.value.plots),X=l(()=>qn.value.flatMap((e,t)=>A.value.includes(e)?[t]:[])),Yn=l(()=>Tn.value.map((e,t)=>{let n=Array.isArray(e.temperatureColors)&&e.temperatureColors.length?e.temperatureColors.map(e=>de(e)):void 0;return{...e,color:e.color?de(e.color):Fn.value[t]||ce[t]||ce[t%ce.length],temperatureColors:n,temperatureAngle:Xn(e.temperatureAngle),temperatureIndependant:e.temperatureIndependant===!0,usePlotTemperatureColors:e.usePlotTemperatureColors!==!1,seriesIndex:t}}));function Xn(e=0){let t=Number(e);return Number.isFinite(t)?(t%360+360)%360:0}let Zn=l(()=>Yn.value.filter(e=>!X.value.includes(e.seriesIndex))),Qn=l(()=>{let e=1/0,t=-1/0,n=1/0,r=-1/0;for(let i of Zn.value)for(let a of i.values)e=Math.min(e,a.x),t=Math.max(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.y);return{minX:Math.min(0,Number.isFinite(e)?e:0),maxX:Number.isFinite(t)?t:1,minY:Math.min(0,Number.isFinite(n)?n:0),maxY:Number.isFinite(r)?r:1}});function $n(e,t,n){let r=Number.isFinite(e.scaleMin)?e.scaleMin:t,i=Number.isFinite(e.scaleMax)?e.scaleMax:n,a=Math.min(r,i),o=Math.max(r,i);return me(a===o?a-(a?Math.abs(a)*.1:0):a,a===o?o+(o?Math.abs(o)*.1:1):o,Math.max(2,e.ticks||2))}let Z=l(()=>{let e=$n(V.value.x,Qn.value.minX,Qn.value.maxX),t=$n(V.value.y,Qn.value.minY,Qn.value.maxY);return{x:e,y:t,tickX:e.ticks.map(t=>({x:J.value.left+(t-e.min)/(e.max-e.min)*J.value.width,y1:J.value.top,y2:J.value.bottom,value:t})),tickY:t.ticks.map(e=>({y:J.value.bottom-(e-t.min)/(t.max-t.min)*J.value.height,x1:J.value.left,x2:J.value.right,value:e}))}});function er(e){let t=Z.value.x.min<0?Math.abs(Z.value.x.min):Z.value.x.min>0?-Z.value.x.min:0;return J.value.left+((e||0)+t)/(Z.value.x.max+t)*J.value.width}function tr(e){let t=Z.value.y.min<0?Math.abs(Z.value.y.min):Z.value.y.min>0?-Z.value.y.min:0;return J.value.bottom-((e||0)+t)/(Z.value.y.max+t)*J.value.height}let Q=l(()=>Zn.value.map((e,t)=>{let n=e.values.map((t,n)=>({valueX:t.x,valueY:t.y,label:t.label,x:er(t.x),y:tr(t.y),color:e.color,seriesName:e.name,id:Jn.value[e.seriesIndex][n]})),r=e.smooth?fe(n):n.map(e=>`${e.x},${e.y} `).join(``).trim();return{...e,gradientIndex:t,plots:n,path:n.length?`M${r}`:``}})),nr=l(()=>{if(j.value===null||N.value===null)return Q.value;let e=Q.value.findIndex(e=>e.seriesIndex===N.value);if(e===-1)return Q.value;let t=Q.value[e];return[...Q.value.slice(0,e),...Q.value.slice(e+1),t]}),rr=l(()=>Q.value.some(e=>ir(e)));function ir(e){return Array.isArray(e?.temperatureColors)&&e.temperatureColors.length}function ar(e){return ir(e)&&e.usePlotTemperatureColors}function or(e){let t=Array.isArray(e?.plots)?e.plots:[];if(!t.length)return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0};let n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e of t)n=Math.min(n,e.x),r=Math.max(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.y);return{minX:n,maxX:r,minY:i,maxY:a,width:r-n,height:a-i}}function sr(){let e=J.value;return{minX:e.left,maxX:e.right,minY:e.top,maxY:e.bottom,width:e.width,height:e.height}}function cr(e){return e?.temperatureIndependant?or(e):sr()}function lr(e){let t=Xn(e?.temperatureAngle)*Math.PI/180,n=Math.sin(t),r=Math.cos(t),i=cr(e),a=i.minX+i.width/2,o=i.minY+i.height/2,s=(Math.abs(n)*i.width+Math.abs(r)*i.height)/2||1;return{x1:a-n*s,y1:o-r*s,x2:a+n*s,y2:o+r*s}}let ur=l(()=>{let e=/* @__PURE__ */ new Map;for(let t of Q.value){if(!ir(t))continue;let n=lr(t),{x1:r,y1:i,x2:a,y2:o}=n,s=a-r,ee=o-i,te=s*s+ee*ee,ne=/* @__PURE__ */ new Map;if(ar(t))for(let e of t.plots){let n=te?Math.min(1,Math.max(0,((e.x-r)*s+(e.y-i)*ee)/te)):0;ne.set(e.id,oe({colors:t.temperatureColors,ratio:n}))}e.set(t.seriesIndex,{coordinates:n,colors:ne})}return e});function dr(e){return ur.value.get(e.seriesIndex)?.coordinates}function fr(e,t){return ur.value.get(e.seriesIndex)?.colors.get(t.id)??e.color}function pr(e,t){return`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${k.value}`}function mr(e,t,n){return ar(e)?z.value.gradient.show?`url(#${pr(e,t)})`:fr(e,t):z.value.gradient.show?`url(#gradient_${n}_${k.value})`:t.color}function hr(e,t){return ar(e)?fr(e,t):e.color}function gr(e,t){return z.value.indexLabels.adaptColorToBackground?be(hr(e,t)):z.value.indexLabels.color}function _r(e,t){let n=Q.value.find(t=>t.seriesIndex===e);return n&&ar(n)?fr(n,t):t.color}function vr(e){return ir(e)?`url(#temperature_grad_history_${e.seriesIndex}_${k.value})`:H.value.paths.useSerieColor?e.color:H.value.paths.stroke}function yr(e){return j.value===null||N.value===e?1:Math.min(1,z.value.unselectedOpacity)}function br(){X.value.length?A.value=[]:Dr.value.forEach(e=>{A.value.push(qn.value[e.seriesIndex])}),gn(`selectLegend`,Q.value)}function xr(e){X.value.includes(e)?A.value=A.value.filter(t=>t!==qn.value[e]):A.value.push(qn.value[e]),gn(`selectLegend`,Q.value)}function Sr(e){return Yn.value.length?Yn.value.find(t=>t.name===e)||(R.value&&console.warn(`VueUiHistoryPlot - Series name not found "${e}"`),null):(R.value&&console.warn(`VueUiHistoryPlot - There are no series to show.`),null)}function Cr(e){let t=Sr(e);t!==null&&X.value.includes(t.seriesIndex)&&xr(t.seriesIndex)}function wr(e){let t=Sr(e);t!==null&&(X.value.includes(t.seriesIndex)||xr(t.seriesIndex))}T(qn,e=>{I.value||(A.value=A.value.filter(t=>e.includes(t)))});let $=l(()=>Q.value.filter(e=>e.plots.length)),Tr=l(()=>{let e=/* @__PURE__ */ new Map;for(let t of Q.value)t.plots.forEach((n,r)=>e.set(n.id,{serie:t,plot:n,plotIndex:r}));return e}),Er=b(null),Dr=l(()=>Yn.value.map(e=>{let t=ir(e)?e.temperatureColors:null;return{...e,gradientColors:t,opacity:X.value.includes(e.seriesIndex)?.5:1,segregate:()=>xr(e.seriesIndex),isSegregated:X.value.includes(e.seriesIndex),shape:t?`gradient`:`circle`}})),Or=l(()=>({cy:`history-plot-div-legend`,backgroundColor:H.value.legend.backgroundColor,color:H.value.legend.color,fontSize:H.value.legend.fontSize,paddingBottom:12,fontWeight:H.value.legend.bold?`bold`:``}));function kr({datapoint:e,plotIndex:t,seriesIndex:n}){I.value||(L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),gn(`selectDatapoint`,e))}function Ar(e){tn.value=e,Xt.value+=1}let jr=b(null);function Mr({datapoint:e,plotIndex:t,seriesIndex:n}){L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),(fn.value!==`keyboard`||N.value!==n||P.value!==t)&&ii()}function Nr(e,t){if(vn||!W.value)return;let n=Q.value.find(t=>t.seriesIndex===e);if(!n)return;let r=n.plots[t];if(!r)return;let i=Ce(r.x,r.y,W.value);i&&(dn.value=i)}function Pr({datapoint:e,plotIndex:t,seriesIndex:n,triggerMode:r=`pointer`}){I.value||(L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),Er.value=e.id,N.value=n,P.value=t,fn.value=r,j.value=e,Fr({datapoint:e,plotIndex:t,seriesIndex:n}),$t.value=!0,r===`keyboard`&&Je(()=>{Er.value===e.id&&Nr(n,t)}))}function Fr({datapoint:e,plotIndex:t,seriesIndex:n}){let r=_r(n,e),i={...e,color:r};jr.value={datapoint:i,color:r,seriesIndex:n,plotIndex:t,config:L.value,series:Yn.value},j.value=e;let a=H.value.tooltip.customFormat;if(M.value=!1,ae(a))try{let e=a({seriesIndex:n,datapoint:i,color:r,plotIndex:t,series:Yn.value,config:L.value});typeof e==`string`&&(en.value=e,M.value=!0)}catch{console.warn(`Custom format cannot be applied.`),M.value=!1}if(!M.value){let t=``;t+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;border-bottom:1px solid ${H.value.tooltip.borderColor};margin-bottom:3px;padding-bottom:6px;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${r}"/></svg><span>${e.seriesName}</span></div>`,t+=`<div>${e.label}</div>`,t+=`<div>${V.value.x.name.text||`x`}: ${ge(V.value.x.labels.formatter,e.valueX,re({p:V.value.x.labels.prefix,v:e.valueX,s:V.value.x.labels.suffix,r:V.value.x.labels.rounding}))}</div>`,t+=`<div>${V.value.y.name.text||`y`}: ${ge(V.value.y.labels.formatter,e.valueY,re({p:V.value.y.labels.prefix,v:e.valueY,s:V.value.y.labels.suffix,r:V.value.y.labels.rounding}))}</div>`,en.value=`<div>${t}</div>`}}T([Q,()=>H.value.tooltip,I],()=>{if(!Er.value)return;let e=Tr.value.get(Er.value);if(!e||I.value){ii();return}let{plot:t,serie:n,plotIndex:r}=e;j.value=t,N.value=n.seriesIndex,P.value=r,Fr({datapoint:t,seriesIndex:n.seriesIndex,plotIndex:r}),fn.value===`keyboard`&&Nr(n.seriesIndex,r)},{flush:`post`});let Ir=l(()=>{let e=[L.value.table.columnNames.series,L.value.table.columnNames.datapoint,L.value.table.columnNames.x,L.value.table.columnNames.y];return{head:e,body:Q.value.flatMap(e=>e.plots.map(e=>[{color:e.color,name:e.seriesName},e.label,ge(V.value.x.labels.formatter,e.valueX,re({p:V.value.x.labels.prefix,v:e.valueX,s:V.value.x.labels.suffix,r:V.value.x.labels.rounding})),ge(V.value.y.labels.formatter,e.valueY,re({p:V.value.y.labels.prefix,v:e.valueY,s:V.value.y.labels.suffix,r:V.value.y.labels.rounding}))])),config:{th:{backgroundColor:L.value.table.th.backgroundColor,color:L.value.table.th.color,outline:L.value.table.th.outline},td:{backgroundColor:L.value.table.td.backgroundColor,color:L.value.table.td.color,outline:L.value.table.td.outline},breakpoint:L.value.table.responsiveBreakpoint},colNames:e}});function Lr(e=null){Je(()=>{let t=[[L.value.table.columnNames.series],[L.value.table.columnNames.datapoint],[L.value.table.columnNames.x],[L.value.table.columnNames.y]],n=Q.value.flatMap(e=>e.plots.map(e=>[[e.seriesName],[e.label],[e.valueX],[e.valueY]])),r=[[H.value.title.text],[H.value.title.subtitle.text],t].concat(n),i=ie(r);e?e(i):ve({csvContent:i,title:H.value.title.text||`vue-ui-history-plot`})})}let Rr=b(!1);function zr(){Rr.value=!Rr.value}function Br(){G.value.showTable=!G.value.showTable}function Vr(){G.value.showTooltip=!G.value.showTooltip}function Hr(){return Q.value}let Ur=te(O,()=>H.value.title.text),Wr=l(()=>Z.value.tickX),Gr=l(()=>({start:0,end:Z.value.tickX.length}));Pe({timeLabelsEls:ln,timeLabels:Wr,slicer:Gr,configRef:L,rotationPath:[`style`,`chart`,`axes`,`x`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`axes`,`x`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:In,height:Ln,targetClass:`.vue-ui-history-plot-x-axis-scale`,rotation:V.value.x.labels.autoRotate.angle});let Kr=l(()=>ee({config:L,style:H,mutableConfig:G,dialog:Kt,accordion:Vt,isFullscreen:tn,parent:O,maxWidth:800}));T([()=>G.value.showTable,an],([e])=>{an.value&&s(e,L,an)},{flush:`post`});function qr(){G.value.showTable=!1,on.value&&on.value.setTableIconState(!1)}let Jr=l(()=>H.value.backgroundColor),Yr=l(()=>H.value.legend),Xr=l(()=>H.value.title),{isCallbackImaging:Zr,isCallbackSvg:Qr,generateSvg:$r,onGenerateImage:ei}=je({svg:W,title:Xr,legend:Yr,legendItems:Dr,backgroundColor:Jr,getSvgCallback:()=>L.value.userOptions.callbacks.svg,generateImage:Nn});async function ti(){gn(`copyAlt`,{config:L.value,dataset:Q.value}),L.value.userOptions.callbacks.altCopy?await Promise.resolve(L.value.userOptions.callbacks.altCopy({config:L.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let ni=l(()=>({head:Ir.value.head,body:Ir.value.body.map(e=>[e[0]?.name||``,e[1],e[2],e[3]]),caption:L.value.a11y.translations.tableCaption,notice:L.value.a11y.translations.tableAvailable}));function ri(e){return $.value.findIndex(t=>t.seriesIndex===e)}function ii(e=!1){e&&j.value&&L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:{...j.value,plotIndex:P.value,seriesIndex:N.value},seriesIndex:N.value}),Er.value=null,N.value=null,P.value=null,fn.value=`pointer`,$t.value=!1,j.value=null,jr.value=null,en.value=``,M.value=!1}function ai(){ii(!0)}function oi(){ii(),pn.value=!0}function si(){ai(),pn.value=!1}function ci(e,t){if(!e?.plots?.length)return null;let n=e.plots.length;return(t%n+n)%n}function li({seriesIndex:e,plotIndex:t,direction:n}){if(!$.value.length)return null;let r=ri(e);if(r===-1)return null;if(n===`up`||n===`down`){let e=$.value[r];if(!e?.plots?.length)return null;let i=ci(e,t+(n===`up`?-1:1));return{seriesIndex:e.seriesIndex,plotIndex:i}}if(n===`left`||n===`right`){let e=((r+(n===`left`?-1:1))%$.value.length+$.value.length)%$.value.length,i=$.value[e];if(!i?.plots?.length)return null;let a=Math.min(t,i.plots.length-1);return{seriesIndex:i.seriesIndex,plotIndex:a}}return null}function ui(e){if(!W.value||Rr.value||I.value||document.activeElement!==W.value||!$.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){ai();return}if(a){if(N.value===null||P.value===null)return;let e=$.value.find(e=>e.seriesIndex===N.value)?.plots?.[P.value];if(!e)return;kr({datapoint:e,plotIndex:P.value,seriesIndex:N.value});return}let s=null;if(N.value===null||P.value===null){let e=$.value[0];if(!e?.plots?.length)return;s={seriesIndex:e.seriesIndex,plotIndex:0}}else r?s=li({seriesIndex:N.value,plotIndex:P.value,direction:`up`}):i?s=li({seriesIndex:N.value,plotIndex:P.value,direction:`down`}):t?s=li({seriesIndex:N.value,plotIndex:P.value,direction:`left`}):n&&(s=li({seriesIndex:N.value,plotIndex:P.value,direction:`right`}));if(!s)return;let ee=$.value.find(e=>e.seriesIndex===s.seriesIndex)?.plots?.[s.plotIndex];ee&&Pr({datapoint:ee,plotIndex:s.plotIndex,seriesIndex:s.seriesIndex,triggerMode:`keyboard`})}return He({getData:Hr,getImage:Ur,generatePdf:Mn,generateCsv:Lr,generateImage:Nn,generateSvg:$r,hideSeries:wr,showSeries:Cr,toggleTable:Br,toggleTooltip:Vr,toggleAnnotator:zr,toggleFullscreen:Ar,copyAlt:ti}),T(()=>[K.value,Y.value,V.value,H.value,L.value.style.fontFamily,D.dataset,_n.value,un.value,ln.value,sn.value,cn.value],Bn,{flush:`post`,deep:!0}),(e,s)=>(y(),f(`div`,{id:`history_plot_${k.value}`,ref_key:`historyPlotChart`,ref:O,class:g({"vue-data-ui-component":!0,"vue-ui-history-plot":!0,"vue-data-ui-wrapper-fullscreen":tn.value}),style:v(`background:${H.value.backgroundColor};color:${H.value.color};font-family:${L.value.style.fontFamily}; position: relative; ${L.value.responsive?`height: 100%`:``}`),onMouseenter:s[2]||=()=>kn(!0),onMouseleave:s[3]||=()=>kn(!1)},[p(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[p(`p`,null,C(L.value.a11y.translations.keyboardNavigation),1)],8,nt),L.value.a11y.includeTable&&ni.value.body.length?(y(),u(ze,{key:0,uid:k.value,head:ni.value.head,body:ni.value.body,caption:ni.value.caption,notice:ni.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):d(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),L.value.userOptions.buttons.annotator?(y(),u(w(Ut),qe({key:1},w(a)(L.value.userOptions.annotator),{svgRef:w(W),backgroundColor:H.value.backgroundColor,color:H.value.color,active:Rr.value,isCursorPointer:En.value,palette:L.value.userOptions.annotatorPalette,onClose:zr}),We({_:2},[x(w(o),t=>({name:t,fn:E(n=>[S(e.$slots,t,_(h(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Pn.value?(y(),f(`div`,{key:2,ref_key:`noTitle`,ref:Qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),H.value.title.text?(y(),f(`div`,{key:3,ref_key:`chartTitle`,ref:Jt,class:`vue-ui-xy-title`,style:v(`font-family:${L.value.style.fontFamily}`)},[Ke(Fe,{config:{title:{cy:`history-plot-div-title`,...H.value.title},subtitle:{cy:`history-plot-div-subtitle`,...H.value.title.subtitle}}},null,8,[`config`])],4)):d(``,!0),p(`div`,{id:`legend-top-${k.value}`},null,8,rt),L.value.userOptions.show&&hn.value&&(On.value||Dn.value)?(y(),u(w(Wt),qe({ref_key:`userOptionsRef`,ref:on,key:`user_option_${Xt.value}`,backgroundColor:H.value.backgroundColor,color:H.value.color,isPrinting:w(An),isImaging:w(jn),uid:k.value,hasTooltip:H.value.tooltip.show&&L.value.userOptions.buttons.tooltip,hasLabel:!1,isFullscreen:tn.value,chartElement:O.value},w(n)(L.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isTooltip:G.value.showTooltip,isAnnotation:Rr.value,tableDialog:L.value.table.useDialog,isCursorPointer:En.value,onToggleFullscreen:Ar,onGeneratePdf:w(Mn),onGenerateCsv:Lr,onGenerateImage:w(ei),onGenerateSvg:w($r),onToggleTable:Br,onToggleTooltip:Vr,onToggleAnnotator:zr,onCopyAlt:ti,style:{visibility:On.value?Dn.value?`visible`:`hidden`:`visible`}}),We({_:2},[x(w(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[S(e.$slots,t,_(h(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`chartElement`,`isTooltip`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),p(`div`,it,[(y(),f(`svg`,{ref_key:`svgRef`,ref:W,xmlns:w(Se),viewBox:`0 0 ${K.value.width<0?.1:K.value.width} ${K.value.height<0?.1:K.value.height}`,style:v(`max-width:100%;overflow:visible;background:transparent;color:${H.value.color};visibility:${w(zn)?`visible`:`hidden`}`),"aria-describedby":`chart-instructions-${k.value}`,tabindex:`0`,onFocus:oi,onBlur:si,onKeydown:ui},[Ke(w(Gt)),S(e.$slots,`svg-underlayer`,{svg:{...K.value,drawingArea:J.value,isPrintingImg:w(An)||w(jn)||w(Zr),isPrintingSvg:w(Qr)}},void 0,!0),e.$slots[`chart-background`]?(y(),f(`foreignObject`,{key:0,x:J.value.left,y:J.value.top,width:J.value.width<=0?10:J.value.width,height:J.value.height<=0?10:J.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,ot)):d(``,!0),z.value.gradient.show||rr.value?(y(),f(`defs`,st,[z.value.gradient.show?(y(!0),f(c,{key:0},x(Q.value,(e,t)=>(y(),u(Ve,{t:`radial`,key:`gradient_${t}_${k.value}`,id:`gradient_${t}_${k.value}`,fy:`30%`,stops:[[`10%`,w(se)(e.color,z.value.gradient.intensity/100),1],[`90%`,w(ue)(e.color,.1),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)):d(``,!0),(y(!0),f(c,null,x(Q.value,e=>(y(),f(c,{key:`temperature_grad_history_template_${e.seriesIndex}_${k.value}`},[z.value.gradient.show&&ar(e)?(y(!0),f(c,{key:0},x(e.plots,t=>(y(),u(Ve,{t:`radial`,key:`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${k.value}`,id:pr(e,t),fy:`30%`,stops:[[`10%`,w(se)(fr(e,t),z.value.gradient.intensity/100),1],[`90%`,w(ue)(fr(e,t),.1),1],[`100%`,fr(e,t),1]]},null,8,[`id`,`stops`]))),128)):d(``,!0),ir(e)?(y(),f(`linearGradient`,{key:1,id:`temperature_grad_history_${e.seriesIndex}_${k.value}`,gradientUnits:`userSpaceOnUse`,x1:dr(e).x1,y1:dr(e).y1,x2:dr(e).x2,y2:dr(e).y2},[(y(!0),f(c,null,x(e.temperatureColors,(t,n)=>(y(),f(`stop`,{key:`temperature_grad_history_stop_${e.seriesIndex}_${n}_${k.value}`,"stop-color":t,offset:e.temperatureColors.length===1?`0%`:w(ye)(n,e.temperatureColors.length)},null,8,lt))),128))],8,ct)):d(``,!0)],64))),128))])):d(``,!0),B.value.verticalLines.show?(y(),f(`g`,ut,[(y(!0),f(c,null,x(Z.value.tickX,e=>(y(),f(`line`,{x1:e.x,x2:e.x,y1:e.y1,y2:e.y2,stroke:B.value.verticalLines.stroke,"stroke-width":B.value.verticalLines.strokeWidth,"stroke-linecap":`round`},null,8,dt))),256))])):d(``,!0),V.value.y.labels.show?(y(),f(`g`,ft,[(y(!0),f(c,null,x(Z.value.tickY,e=>(y(),f(`line`,{stroke:B.value.verticalLines.stroke,"stroke-width":B.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:J.value.left-5,x2:J.value.left,y1:e.y,y2:e.y},null,8,pt))),256))])):d(``,!0),V.value.y.labels.show?(y(),f(`g`,{key:4,ref_key:`yAxisScales`,ref:un},[(y(!0),f(c,null,x(Z.value.tickY,e=>(y(),f(`text`,{x:J.value.left+V.value.y.labels.offsetX-4-z.value.radius,y:e.y+Y.value.yAxisLabels/3,fill:V.value.y.labels.color,"font-size":Y.value.yAxisLabels,"text-anchor":`end`},C(w(ge)(V.value.y.labels.formatter,e.value,w(re)({p:V.value.y.labels.prefix,v:e.value,s:V.value.y.labels.suffix,r:V.value.y.labels.rounding}))),9,mt))),256))],512)):d(``,!0),V.value.y.name.text?(y(),f(`text`,{key:5,ref_key:`yAxisLabel`,ref:cn,transform:`translate(${Y.value.yAxisName}, ${K.value.height/2+V.value.y.name.offsetY}), rotate(-90)`,"font-size":Y.value.yAxisName,fill:V.value.y.name.color,"font-weight":V.value.y.name.bold?`bold`:`normal`,"text-anchor":`middle`},C(V.value.y.name.text),9,ht)):d(``,!0),B.value.horizontalLines.show?(y(),f(`g`,gt,[(y(!0),f(c,null,x(Z.value.tickY,e=>(y(),f(`line`,{x1:e.x1,x2:e.x2,y1:e.y,y2:e.y,stroke:B.value.horizontalLines.stroke,"stroke-width":B.value.horizontalLines.strokeWidth,"stroke-linecap":`round`},null,8,_t))),256))])):d(``,!0),V.value.x.labels.show?(y(),f(`g`,vt,[(y(!0),f(c,null,x(Z.value.tickX,e=>(y(),f(`line`,{stroke:B.value.verticalLines.stroke,"stroke-width":B.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:e.x,x2:e.x,y1:J.value.bottom,y2:J.value.bottom+5},null,8,yt))),256))])):d(``,!0),V.value.x.labels.show?(y(),f(`g`,{key:8,ref_key:`xAxisScales`,ref:ln},[(y(!0),f(c,null,x(Z.value.tickX,e=>(y(),f(`text`,{class:`vue-ui-history-plot-x-axis-scale`,transform:`translate(${e.x}, ${J.value.bottom+V.value.x.labels.offsetY+Y.value.xAxisLabels+z.value.radius}), rotate(${V.value.x.labels.rotation})`,fill:V.value.x.labels.color,"font-size":Y.value.xAxisLabels,"text-anchor":V.value.x.labels.rotation>0?`start`:V.value.x.labels.rotation<0?`end`:`middle`},C(w(ge)(V.value.x.labels.formatter,e.value,w(re)({p:V.value.x.labels.prefix,v:e.value,s:V.value.x.labels.suffix,r:V.value.x.labels.rounding}))),9,bt))),256))],512)):d(``,!0),V.value.x.name.text?(y(),f(`text`,{key:9,ref_key:`xAxisLabel`,ref:sn,x:K.value.width/2+V.value.x.name.offsetX,y:K.value.height,"font-size":Y.value.xAxisName,fill:V.value.x.name.color,"font-weight":V.value.x.name.bold?`bold`:`normal`,"text-anchor":`middle`},C(V.value.x.name.text),9,xt)):d(``,!0),B.value.xAxis.show?(y(),f(`line`,{key:10,x1:J.value.left,x2:J.value.left+J.value.width,y1:J.value.bottom,y2:J.value.bottom,stroke:B.value.xAxis.stroke,"stroke-width":B.value.xAxis.strokeWidth,"stroke-linecap":`round`},null,8,St)):d(``,!0),B.value.yAxis.show?(y(),f(`line`,{key:11,x1:J.value.left,x2:J.value.left,y1:J.value.top,y2:J.value.bottom,stroke:B.value.yAxis.stroke,"stroke-width":B.value.yAxis.strokeWidth,"stroke-linecap":`round`},null,8,Ct)):d(``,!0),(y(!0),f(c,null,x(nr.value,e=>(y(),f(`g`,{key:`history_plot_serie_${e.seriesIndex}_${k.value}`},[H.value.paths.show?(y(),f(`g`,{key:0,style:v({opacity:yr(e.seriesIndex)})},[p(`path`,{class:g({"vue-data-ui-transition":w(U)&&!w(q)}),d:e.path,stroke:H.value.backgroundColor,"stroke-width":H.value.paths.strokeWidth+4,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,wt),p(`path`,{class:g({"vue-data-ui-transition":w(U)&&!w(q)}),d:e.path,stroke:vr(e),"stroke-width":H.value.paths.strokeWidth,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,Tt)],4)):d(``,!0),(y(!0),f(c,null,x(e.plots,e=>(y(),f(`circle`,{cx:e.x,cy:e.y,fill:H.value.backgroundColor,r:Y.value.plots,stroke:`none`,class:g({"vue-data-ui-transition":w(U)&&!w(q)})},null,10,Et))),256)),(y(!0),f(c,null,x(e.plots,t=>(y(),f(`circle`,{cx:t.x,cy:t.y,fill:mr(e,t,e.gradientIndex),r:Y.value.plots,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,class:g({"vue-data-ui-transition":w(U)&&!w(q)}),style:v({opacity:yr(e.seriesIndex)})},null,14,Dt))),256)),z.value.labels.show?(y(),f(`g`,Ot,[(y(!0),f(c,null,x(e.plots,(t,n)=>(y(),f(`g`,{key:`plab_${n}`},[String(t.label).includes(`
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as ee}from"./tableIntegration-CNoJ1CIY.js";import{t as te}from"./chartImage-DPGnEuYM.js";import{n as ne}from"./resolveChartConfig-0IvbmIE_.js";import{$ as re,D as ie,Dt as ae,Et as oe,Ft as se,Ht as ce,J as le,Q as ue,S as de,T as fe,X as pe,_ as me,at as he,i as ge,in as _e,nt as ve,qt as ye,r as be,rn as xe,t as Se,tn as Ce,w as we}from"./lib-rPeBMZrn.js";import{n as Te,t as Ee}from"./useHints-C-TwxM0Y.js";import{t as De}from"./useConfig-CXhXxWjB.js";import{t as Oe}from"./useSvgLabelLayout-42Kats14.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./useChartExport-BZts4KFb.js";import{t as Me}from"./useTransitions-ChGGrtrv.js";import{t as Ne}from"./useChartAccessibility-DOMuYJfm.js";import{t as Pe}from"./useTimeLabelCollider-BTybMUFi.js";import{n as Fe}from"./Title-BliHuXfT.js";import{t as Ie}from"./vue_ui_history_plot-BZ5TtPPB.js";import{t as Le}from"./Legend-W9YVYVX-.js";import{t as Re}from"./BaseScanner-m6QR9rwD.js";import{t as ze}from"./A11yDataTable-DWNlWXzs.js";import{t as Be}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ve}from"./DefGrad-DKMq1REY.js";import{t as He}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,Teleport as Ue,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as qe,nextTick as Je,normalizeClass as g,normalizeProps as _,normalizeStyle as v,onBeforeUnmount as Ye,onMounted as Xe,openBlock as y,reactive as Ze,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Qe,shallowRef as $e,toDisplayString as C,unref as w,watch as T,withCtx as E}from"vue";var et=/* @__PURE__ */ e({default:()=>zt}),tt=[`id`],nt=[`id`],rt=[`id`],it={style:{position:`relative`}},at=[`xmlns`,`viewBox`,`aria-describedby`],ot=[`x`,`y`,`width`,`height`],st={key:1},ct=[`id`,`x1`,`y1`,`x2`,`y2`],lt=[`stop-color`,`offset`],ut={key:2},dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft={key:3},pt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],mt=[`x`,`y`,`fill`,`font-size`],ht=[`transform`,`font-size`,`fill`,`font-weight`],gt={key:6},_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt={key:7},yt=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],bt=[`transform`,`fill`,`font-size`,`text-anchor`],xt=[`x`,`y`,`font-size`,`fill`,`font-weight`],St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],wt=[`d`,`stroke`,`stroke-width`],Tt=[`d`,`stroke`,`stroke-width`],Et=[`cx`,`cy`,`fill`,`r`],Dt=[`cx`,`cy`,`fill`,`r`,`stroke`,`stroke-width`],Ot={key:1},kt=[`transform`,`font-size`,`fill`,`font-weight`],At=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],jt={key:2},Mt=[`transform`,`font-size`,`font-weight`,`fill`],Nt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],Pt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ft={key:5,class:`vue-data-ui-watermark`},It=[`id`],Lt=[`onClick`],Rt={style:{display:`flex`,"align-items":`center`}},zt=/*#__PURE__*/ He({__name:`vue-ui-history-plot`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:He,emit:et}){let zt=m(()=>import(`./Tooltip-B432XpvC.js`)),Bt=m(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Vt=m(()=>import(`./vue-ui-accordion-D3uT1Ynv.js`).then(e=>e.n)),Ht=m(()=>import(`./DataTable-KeuZB1JM.js`)),Ut=m(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Wt=m(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Gt=m(()=>import(`./PackageVersion-D8aPzzvh.js`).then(e=>e.t)),Kt=m(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_history_plot:qt}=De(),D=e,O=b(null),Jt=b(null),Yt=b(null),Xt=b(0),Zt=$e(null),Qt=b(null),k=b(pe()),$t=b(!1),en=b(``),A=b([]),tn=b(!1),j=b(null),M=b(!1),nn=b(null),rn=b(!1),an=b(null),on=b(null),sn=b(null),cn=b(null),ln=b(null),un=b(null),N=b(null),P=b(null),dn=b({x:0,y:0}),fn=b(`pointer`),pn=b(!1),mn=l(()=>Array.from(D.dataset,e=>{let t=e&&typeof e==`object`?Object.keys(e):[],n=[`name`,`values`].filter(e=>!t.includes(e)),r=Array.isArray(e?.values),i=r?Array.from(e.values,e=>({x:Number.isFinite(e?.x),y:Number.isFinite(e?.y)})):[];return{missing:n,array:r,points:i,valid:!n.length&&r&&i.every(e=>e.x&&e.y)}})),hn=l(()=>D.dataset.length>0&&mn.value.every(e=>e.valid)),gn=et,_n=b(!1),F=null,vn=!1,yn=$e(null);function bn(){Zt.value?.disconnect(),Zt.value=null,F!==null&&cancelAnimationFrame(F),F=null}function xn(){if(bn(),yn.value=null,_n.value=!1,!L.value.responsive||!O.value?.parentNode)return;let e=new ResizeObserver(t);function t(){vn||Zt.value!==e||(F!==null&&cancelAnimationFrame(F),F=requestAnimationFrame(()=>{if(vn||Zt.value!==e)return;F=null;let{width:t,height:n}=Ae({chart:O.value,title:H.value.title.text?Jt.value:null,noTitle:Qt.value,legend:H.value.legend.show?Yt.value:null,source:nn.value});yn.value={width:Math.max(.1,t),height:Math.max(.1,n)},_n.value=!0}))}Zt.value=e,e.observe(O.value.parentNode);for(let t of[Jt.value,Yt.value,nn.value,Qt.value])t&&e.observe(t);t()}Xe(()=>{rn.value=!0,xn()}),Ye(()=>{vn=!0,bn()});function Sn(){return ne(D.config,qt,Ie)}let Cn=l(()=>Ze(Sn())),I=l(()=>!!D.config.loading||!hn.value),wn=l(()=>_e({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,axes:{x:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}},y:{scaleMin:0,scaleMax:10,labels:{show:!1},name:{text:``}}},grid:{xAxis:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A50`},yAxis:{stroke:`#6A6A6A`},verticalLines:{stroke:`#6A6A6A50`}},legend:{backgroundColor:`transparent`},paths:{useSerieColor:!1,stroke:`#6A6A6A`},plots:{stroke:`#6A6A6A`,indexLabels:{show:!1},labels:{show:!1}}}}},userConfig:Cn.value.skeletonConfig??{}})),L=l(()=>I.value?Ze(_e({defaultConfig:Cn.value,userConfig:wn.value})):Cn.value),Tn=l(()=>I.value?D.config.skeletonDataset??[{name:``,color:`#CACACA`,values:[{label:``,x:1,y:9},{label:``,x:4,y:1},{label:``,x:7,y:9},{label:``,x:9,y:4}]}]:D.dataset),R=l(()=>Cn.value.debug),z=l(()=>L.value.style.chart.plots),B=l(()=>L.value.style.chart.grid),V=l(()=>L.value.style.chart.axes),H=l(()=>L.value.style.chart);Te({config:()=>L.value,dataset:()=>D.dataset,component:`VueUiHistoryPlot`,rules:[Ee.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display.`]}]});let{transitionEnabled:U}=Me({config:()=>L.value.transitions,dataset:()=>D.dataset}),En=l(()=>L.value.userOptions.useCursorPointer),Dn=b(!L.value.userOptions.showOnChartHover),On=l(()=>L.value.userOptions.keepStateOnChartLeave);function kn(e=!1){L.value.userOptions.showOnChartHover&&(Dn.value=e)}T(()=>L.value.userOptions.showOnChartHover,e=>{Dn.value=!e});let{svgRef:W}=Ne({config:H.value.title});T([mn,R],()=>{D.dataset.length||he({componentName:`VueUiHistoryPlot`,type:`dataset`,debug:R.value}),mn.value.forEach((e,t)=>{e.missing.forEach(e=>he({componentName:`VueUiHistoryPlot`,type:`datasetSerieAttribute`,property:e,index:t,debug:R.value})),R.value&&(!e.missing.includes(`values`)&&!e.array&&console.warn(`VueUiHistoryPlot: dataset[${t}].values must be an array.`),e.points.forEach((e,n)=>{for(let r of[`x`,`y`])e[r]||console.warn(`VueUiHistoryPlot: dataset[${t}].values[${n}].${r} must be a finite number.`)}))})},{immediate:!0}),T([()=>L.value.responsive,()=>H.value.title.text,()=>H.value.legend.show,()=>H.value.legend.position,Jt,Yt,nn,Qt],xn,{flush:`post`});let{isPrinting:An,isImaging:jn,generatePdf:Mn,generateImage:Nn}=ke({elementId:`history_plot_${k.value}`,fileName:H.value.title.text||`vue-ui-history-plot`,options:L.value.userOptions.print}),Pn=l(()=>L.value.userOptions.show&&!H.value.title.text),Fn=l(()=>we(L.value.customPalette)),G=b({showTable:L.value.table.show,showTooltip:H.value.tooltip.show});T(()=>L.value.table.show,e=>{G.value.showTable=e}),T(()=>H.value.tooltip.show,e=>{G.value.showTooltip=e});let K=l(()=>yn.value||{width:H.value.width,height:H.value.height}),In=l(()=>K.value.width),Ln=l(()=>K.value.height),{metrics:Rn,ready:zn,settling:q,update:Bn}=Oe({svgRef:W,canMeasure:()=>!L.value.responsive||_n.value,initialMetrics:{scaleLabelsWidth:0,yAxisLabelWidth:0,xAxisLabelHeight:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:e(un.value).textWidth,yAxisLabelWidth:e(cn.value).rotatedWidth,xAxisLabelHeight:e(sn.value).height,timeLabelsHeight:e(ln.value).height})});function Vn(){let e=Rn.value.scaleLabelsWidth,t=Rn.value.yAxisLabelWidth;return e+t+(t?24:0)}let Hn=l(()=>Rn.value.xAxisLabelHeight+Rn.value.timeLabelsHeight+(sn.value?Y.value.xAxisName/2:0)),J=l(()=>{let e=z.value.radius,t=H.value.padding.left+Vn()+V.value.y.name.offsetX,n=H.value.padding.top+e,r=K.value.width-H.value.padding.right-e-V.value.y.name.offsetX,i=K.value.height-H.value.padding.bottom-Hn.value-e-V.value.x.name.offsetY;return{left:t,top:n,right:r,bottom:i,width:r-t,height:i-n}}),Y=l(()=>{let e=(e,t)=>L.value.responsive&&L.value.responsiveProportionalSizing&&yn.value?xe({relator:Math.min(K.value.width,K.value.height),adjuster:600,source:e,threshold:t,fallback:t}):e;return{plots:e(z.value.radius,3),indexLabels:e(z.value.indexLabels.fontSize,6),labels:e(z.value.labels.fontSize,6),xAxisLabels:e(V.value.x.labels.fontSize,6),xAxisName:e(V.value.x.name.fontSize,6),yAxisLabels:e(V.value.y.labels.fontSize,6),yAxisName:e(V.value.y.name.fontSize,6)}}),Un=/* @__PURE__ */ new Map;function Wn(e){return Un.has(e)||Un.set(e,pe()),Un.get(e)}let Gn=/* @__PURE__ */ new Map,Kn=l(()=>{let e=/* @__PURE__ */ new Set;function t(t){return e.add(t),Wn(t)}let n=/* @__PURE__ */ new Map,r=Tn.value.map((e,r)=>{let i=e?.id==null?e?.name==null?`index:${r}`:`name:${e.name}`:`id:${typeof e.id}:${e.id}`,a=n.get(i)||0;return n.set(i,a+1),t(`${I.value?`skeleton`:`data`}:${i}:${a}`)}),i=Tn.value.map((e,n)=>{let i=/* @__PURE__ */ new Map;return(Array.isArray(e?.values)?e.values:[]).map((e,a)=>{let o=e?.id==null?e?.label?`label:${e.label}`:`index:${a}`:`id:${typeof e.id}:${e.id}`,s=i.get(o)||0;return i.set(o,s+1),t(`${r[n]}:${o}:${s}`)})});for(let t of Gn.get(I.value)||[])e.has(t)||Un.delete(t);return Gn.set(I.value,e),{series:r,plots:i}}),qn=l(()=>Kn.value.series),Jn=l(()=>Kn.value.plots),X=l(()=>qn.value.flatMap((e,t)=>A.value.includes(e)?[t]:[])),Yn=l(()=>Tn.value.map((e,t)=>{let n=Array.isArray(e.temperatureColors)&&e.temperatureColors.length?e.temperatureColors.map(e=>de(e)):void 0;return{...e,color:e.color?de(e.color):Fn.value[t]||ce[t]||ce[t%ce.length],temperatureColors:n,temperatureAngle:Xn(e.temperatureAngle),temperatureIndependant:e.temperatureIndependant===!0,usePlotTemperatureColors:e.usePlotTemperatureColors!==!1,seriesIndex:t}}));function Xn(e=0){let t=Number(e);return Number.isFinite(t)?(t%360+360)%360:0}let Zn=l(()=>Yn.value.filter(e=>!X.value.includes(e.seriesIndex))),Qn=l(()=>{let e=1/0,t=-1/0,n=1/0,r=-1/0;for(let i of Zn.value)for(let a of i.values)e=Math.min(e,a.x),t=Math.max(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.y);return{minX:Math.min(0,Number.isFinite(e)?e:0),maxX:Number.isFinite(t)?t:1,minY:Math.min(0,Number.isFinite(n)?n:0),maxY:Number.isFinite(r)?r:1}});function $n(e,t,n){let r=Number.isFinite(e.scaleMin)?e.scaleMin:t,i=Number.isFinite(e.scaleMax)?e.scaleMax:n,a=Math.min(r,i),o=Math.max(r,i);return me(a===o?a-(a?Math.abs(a)*.1:0):a,a===o?o+(o?Math.abs(o)*.1:1):o,Math.max(2,e.ticks||2))}let Z=l(()=>{let e=$n(V.value.x,Qn.value.minX,Qn.value.maxX),t=$n(V.value.y,Qn.value.minY,Qn.value.maxY);return{x:e,y:t,tickX:e.ticks.map(t=>({x:J.value.left+(t-e.min)/(e.max-e.min)*J.value.width,y1:J.value.top,y2:J.value.bottom,value:t})),tickY:t.ticks.map(e=>({y:J.value.bottom-(e-t.min)/(t.max-t.min)*J.value.height,x1:J.value.left,x2:J.value.right,value:e}))}});function er(e){let t=Z.value.x.min<0?Math.abs(Z.value.x.min):Z.value.x.min>0?-Z.value.x.min:0;return J.value.left+((e||0)+t)/(Z.value.x.max+t)*J.value.width}function tr(e){let t=Z.value.y.min<0?Math.abs(Z.value.y.min):Z.value.y.min>0?-Z.value.y.min:0;return J.value.bottom-((e||0)+t)/(Z.value.y.max+t)*J.value.height}let Q=l(()=>Zn.value.map((e,t)=>{let n=e.values.map((t,n)=>({valueX:t.x,valueY:t.y,label:t.label,x:er(t.x),y:tr(t.y),color:e.color,seriesName:e.name,id:Jn.value[e.seriesIndex][n]})),r=e.smooth?fe(n):n.map(e=>`${e.x},${e.y} `).join(``).trim();return{...e,gradientIndex:t,plots:n,path:n.length?`M${r}`:``}})),nr=l(()=>{if(j.value===null||N.value===null)return Q.value;let e=Q.value.findIndex(e=>e.seriesIndex===N.value);if(e===-1)return Q.value;let t=Q.value[e];return[...Q.value.slice(0,e),...Q.value.slice(e+1),t]}),rr=l(()=>Q.value.some(e=>ir(e)));function ir(e){return Array.isArray(e?.temperatureColors)&&e.temperatureColors.length}function ar(e){return ir(e)&&e.usePlotTemperatureColors}function or(e){let t=Array.isArray(e?.plots)?e.plots:[];if(!t.length)return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0};let n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e of t)n=Math.min(n,e.x),r=Math.max(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.y);return{minX:n,maxX:r,minY:i,maxY:a,width:r-n,height:a-i}}function sr(){let e=J.value;return{minX:e.left,maxX:e.right,minY:e.top,maxY:e.bottom,width:e.width,height:e.height}}function cr(e){return e?.temperatureIndependant?or(e):sr()}function lr(e){let t=Xn(e?.temperatureAngle)*Math.PI/180,n=Math.sin(t),r=Math.cos(t),i=cr(e),a=i.minX+i.width/2,o=i.minY+i.height/2,s=(Math.abs(n)*i.width+Math.abs(r)*i.height)/2||1;return{x1:a-n*s,y1:o-r*s,x2:a+n*s,y2:o+r*s}}let ur=l(()=>{let e=/* @__PURE__ */ new Map;for(let t of Q.value){if(!ir(t))continue;let n=lr(t),{x1:r,y1:i,x2:a,y2:o}=n,s=a-r,ee=o-i,te=s*s+ee*ee,ne=/* @__PURE__ */ new Map;if(ar(t))for(let e of t.plots){let n=te?Math.min(1,Math.max(0,((e.x-r)*s+(e.y-i)*ee)/te)):0;ne.set(e.id,oe({colors:t.temperatureColors,ratio:n}))}e.set(t.seriesIndex,{coordinates:n,colors:ne})}return e});function dr(e){return ur.value.get(e.seriesIndex)?.coordinates}function fr(e,t){return ur.value.get(e.seriesIndex)?.colors.get(t.id)??e.color}function pr(e,t){return`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${k.value}`}function mr(e,t,n){return ar(e)?z.value.gradient.show?`url(#${pr(e,t)})`:fr(e,t):z.value.gradient.show?`url(#gradient_${n}_${k.value})`:t.color}function hr(e,t){return ar(e)?fr(e,t):e.color}function gr(e,t){return z.value.indexLabels.adaptColorToBackground?be(hr(e,t)):z.value.indexLabels.color}function _r(e,t){let n=Q.value.find(t=>t.seriesIndex===e);return n&&ar(n)?fr(n,t):t.color}function vr(e){return ir(e)?`url(#temperature_grad_history_${e.seriesIndex}_${k.value})`:H.value.paths.useSerieColor?e.color:H.value.paths.stroke}function yr(e){return j.value===null||N.value===e?1:Math.min(1,z.value.unselectedOpacity)}function br(){X.value.length?A.value=[]:Dr.value.forEach(e=>{A.value.push(qn.value[e.seriesIndex])}),gn(`selectLegend`,Q.value)}function xr(e){X.value.includes(e)?A.value=A.value.filter(t=>t!==qn.value[e]):A.value.push(qn.value[e]),gn(`selectLegend`,Q.value)}function Sr(e){return Yn.value.length?Yn.value.find(t=>t.name===e)||(R.value&&console.warn(`VueUiHistoryPlot - Series name not found "${e}"`),null):(R.value&&console.warn(`VueUiHistoryPlot - There are no series to show.`),null)}function Cr(e){let t=Sr(e);t!==null&&X.value.includes(t.seriesIndex)&&xr(t.seriesIndex)}function wr(e){let t=Sr(e);t!==null&&(X.value.includes(t.seriesIndex)||xr(t.seriesIndex))}T(qn,e=>{I.value||(A.value=A.value.filter(t=>e.includes(t)))});let $=l(()=>Q.value.filter(e=>e.plots.length)),Tr=l(()=>{let e=/* @__PURE__ */ new Map;for(let t of Q.value)t.plots.forEach((n,r)=>e.set(n.id,{serie:t,plot:n,plotIndex:r}));return e}),Er=b(null),Dr=l(()=>Yn.value.map(e=>{let t=ir(e)?e.temperatureColors:null;return{...e,gradientColors:t,opacity:X.value.includes(e.seriesIndex)?.5:1,segregate:()=>xr(e.seriesIndex),isSegregated:X.value.includes(e.seriesIndex),shape:t?`gradient`:`circle`}})),Or=l(()=>({cy:`history-plot-div-legend`,backgroundColor:H.value.legend.backgroundColor,color:H.value.legend.color,fontSize:H.value.legend.fontSize,paddingBottom:12,fontWeight:H.value.legend.bold?`bold`:``}));function kr({datapoint:e,plotIndex:t,seriesIndex:n}){I.value||(L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),gn(`selectDatapoint`,e))}function Ar(e){tn.value=e,Xt.value+=1}let jr=b(null);function Mr({datapoint:e,plotIndex:t,seriesIndex:n}){L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),(fn.value!==`keyboard`||N.value!==n||P.value!==t)&&ii()}function Nr(e,t){if(vn||!W.value)return;let n=Q.value.find(t=>t.seriesIndex===e);if(!n)return;let r=n.plots[t];if(!r)return;let i=Ce(r.x,r.y,W.value);i&&(dn.value=i)}function Pr({datapoint:e,plotIndex:t,seriesIndex:n,triggerMode:r=`pointer`}){I.value||(L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:{...e,plotIndex:t,seriesIndex:n},seriesIndex:n}),Er.value=e.id,N.value=n,P.value=t,fn.value=r,j.value=e,Fr({datapoint:e,plotIndex:t,seriesIndex:n}),$t.value=!0,r===`keyboard`&&Je(()=>{Er.value===e.id&&Nr(n,t)}))}function Fr({datapoint:e,plotIndex:t,seriesIndex:n}){let r=_r(n,e),i={...e,color:r};jr.value={datapoint:i,color:r,seriesIndex:n,plotIndex:t,config:L.value,series:Yn.value},j.value=e;let a=H.value.tooltip.customFormat;if(M.value=!1,ae(a))try{let e=a({seriesIndex:n,datapoint:i,color:r,plotIndex:t,series:Yn.value,config:L.value});typeof e==`string`&&(en.value=e,M.value=!0)}catch{console.warn(`Custom format cannot be applied.`),M.value=!1}if(!M.value){let t=``;t+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;border-bottom:1px solid ${H.value.tooltip.borderColor};margin-bottom:3px;padding-bottom:6px;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${r}"/></svg><span>${e.seriesName}</span></div>`,t+=`<div>${e.label}</div>`,t+=`<div>${V.value.x.name.text||`x`}: ${ge(V.value.x.labels.formatter,e.valueX,re({p:V.value.x.labels.prefix,v:e.valueX,s:V.value.x.labels.suffix,r:V.value.x.labels.rounding}))}</div>`,t+=`<div>${V.value.y.name.text||`y`}: ${ge(V.value.y.labels.formatter,e.valueY,re({p:V.value.y.labels.prefix,v:e.valueY,s:V.value.y.labels.suffix,r:V.value.y.labels.rounding}))}</div>`,en.value=`<div>${t}</div>`}}T([Q,()=>H.value.tooltip,I],()=>{if(!Er.value)return;let e=Tr.value.get(Er.value);if(!e||I.value){ii();return}let{plot:t,serie:n,plotIndex:r}=e;j.value=t,N.value=n.seriesIndex,P.value=r,Fr({datapoint:t,seriesIndex:n.seriesIndex,plotIndex:r}),fn.value===`keyboard`&&Nr(n.seriesIndex,r)},{flush:`post`});let Ir=l(()=>{let e=[L.value.table.columnNames.series,L.value.table.columnNames.datapoint,L.value.table.columnNames.x,L.value.table.columnNames.y];return{head:e,body:Q.value.flatMap(e=>e.plots.map(e=>[{color:e.color,name:e.seriesName},e.label,ge(V.value.x.labels.formatter,e.valueX,re({p:V.value.x.labels.prefix,v:e.valueX,s:V.value.x.labels.suffix,r:V.value.x.labels.rounding})),ge(V.value.y.labels.formatter,e.valueY,re({p:V.value.y.labels.prefix,v:e.valueY,s:V.value.y.labels.suffix,r:V.value.y.labels.rounding}))])),config:{th:{backgroundColor:L.value.table.th.backgroundColor,color:L.value.table.th.color,outline:L.value.table.th.outline},td:{backgroundColor:L.value.table.td.backgroundColor,color:L.value.table.td.color,outline:L.value.table.td.outline},breakpoint:L.value.table.responsiveBreakpoint},colNames:e}});function Lr(e=null){Je(()=>{let t=[[L.value.table.columnNames.series],[L.value.table.columnNames.datapoint],[L.value.table.columnNames.x],[L.value.table.columnNames.y]],n=Q.value.flatMap(e=>e.plots.map(e=>[[e.seriesName],[e.label],[e.valueX],[e.valueY]])),r=[[H.value.title.text],[H.value.title.subtitle.text],t].concat(n),i=ie(r);e?e(i):ve({csvContent:i,title:H.value.title.text||`vue-ui-history-plot`})})}let Rr=b(!1);function zr(){Rr.value=!Rr.value}function Br(){G.value.showTable=!G.value.showTable}function Vr(){G.value.showTooltip=!G.value.showTooltip}function Hr(){return Q.value}let Ur=te(O,()=>H.value.title.text),Wr=l(()=>Z.value.tickX),Gr=l(()=>({start:0,end:Z.value.tickX.length}));Pe({timeLabelsEls:ln,timeLabels:Wr,slicer:Gr,configRef:L,rotationPath:[`style`,`chart`,`axes`,`x`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`axes`,`x`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:In,height:Ln,targetClass:`.vue-ui-history-plot-x-axis-scale`,rotation:V.value.x.labels.autoRotate.angle});let Kr=l(()=>ee({config:L,style:H,mutableConfig:G,dialog:Kt,accordion:Vt,isFullscreen:tn,parent:O,maxWidth:800}));T([()=>G.value.showTable,an],([e])=>{an.value&&s(e,L,an)},{flush:`post`});function qr(){G.value.showTable=!1,on.value&&on.value.setTableIconState(!1)}let Jr=l(()=>H.value.backgroundColor),Yr=l(()=>H.value.legend),Xr=l(()=>H.value.title),{isCallbackImaging:Zr,isCallbackSvg:Qr,generateSvg:$r,onGenerateImage:ei}=je({svg:W,title:Xr,legend:Yr,legendItems:Dr,backgroundColor:Jr,getSvgCallback:()=>L.value.userOptions.callbacks.svg,generateImage:Nn});async function ti(){gn(`copyAlt`,{config:L.value,dataset:Q.value}),L.value.userOptions.callbacks.altCopy?await Promise.resolve(L.value.userOptions.callbacks.altCopy({config:L.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let ni=l(()=>({head:Ir.value.head,body:Ir.value.body.map(e=>[e[0]?.name||``,e[1],e[2],e[3]]),caption:L.value.a11y.translations.tableCaption,notice:L.value.a11y.translations.tableAvailable}));function ri(e){return $.value.findIndex(t=>t.seriesIndex===e)}function ii(e=!1){e&&j.value&&L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:{...j.value,plotIndex:P.value,seriesIndex:N.value},seriesIndex:N.value}),Er.value=null,N.value=null,P.value=null,fn.value=`pointer`,$t.value=!1,j.value=null,jr.value=null,en.value=``,M.value=!1}function ai(){ii(!0)}function oi(){ii(),pn.value=!0}function si(){ai(),pn.value=!1}function ci(e,t){if(!e?.plots?.length)return null;let n=e.plots.length;return(t%n+n)%n}function li({seriesIndex:e,plotIndex:t,direction:n}){if(!$.value.length)return null;let r=ri(e);if(r===-1)return null;if(n===`up`||n===`down`){let e=$.value[r];if(!e?.plots?.length)return null;let i=ci(e,t+(n===`up`?-1:1));return{seriesIndex:e.seriesIndex,plotIndex:i}}if(n===`left`||n===`right`){let e=((r+(n===`left`?-1:1))%$.value.length+$.value.length)%$.value.length,i=$.value[e];if(!i?.plots?.length)return null;let a=Math.min(t,i.plots.length-1);return{seriesIndex:i.seriesIndex,plotIndex:a}}return null}function ui(e){if(!W.value||Rr.value||I.value||document.activeElement!==W.value||!$.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){ai();return}if(a){if(N.value===null||P.value===null)return;let e=$.value.find(e=>e.seriesIndex===N.value)?.plots?.[P.value];if(!e)return;kr({datapoint:e,plotIndex:P.value,seriesIndex:N.value});return}let s=null;if(N.value===null||P.value===null){let e=$.value[0];if(!e?.plots?.length)return;s={seriesIndex:e.seriesIndex,plotIndex:0}}else r?s=li({seriesIndex:N.value,plotIndex:P.value,direction:`up`}):i?s=li({seriesIndex:N.value,plotIndex:P.value,direction:`down`}):t?s=li({seriesIndex:N.value,plotIndex:P.value,direction:`left`}):n&&(s=li({seriesIndex:N.value,plotIndex:P.value,direction:`right`}));if(!s)return;let ee=$.value.find(e=>e.seriesIndex===s.seriesIndex)?.plots?.[s.plotIndex];ee&&Pr({datapoint:ee,plotIndex:s.plotIndex,seriesIndex:s.seriesIndex,triggerMode:`keyboard`})}return He({getData:Hr,getImage:Ur,generatePdf:Mn,generateCsv:Lr,generateImage:Nn,generateSvg:$r,hideSeries:wr,showSeries:Cr,toggleTable:Br,toggleTooltip:Vr,toggleAnnotator:zr,toggleFullscreen:Ar,copyAlt:ti}),T(()=>[K.value,Y.value,V.value,H.value,L.value.style.fontFamily,D.dataset,_n.value,un.value,ln.value,sn.value,cn.value],Bn,{flush:`post`,deep:!0}),(e,s)=>(y(),f(`div`,{id:`history_plot_${k.value}`,ref_key:`historyPlotChart`,ref:O,class:g({"vue-data-ui-component":!0,"vue-ui-history-plot":!0,"vue-data-ui-wrapper-fullscreen":tn.value}),style:v(`background:${H.value.backgroundColor};color:${H.value.color};font-family:${L.value.style.fontFamily}; position: relative; ${L.value.responsive?`height: 100%`:``}`),onMouseenter:s[2]||=()=>kn(!0),onMouseleave:s[3]||=()=>kn(!1)},[p(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[p(`p`,null,C(L.value.a11y.translations.keyboardNavigation),1)],8,nt),L.value.a11y.includeTable&&ni.value.body.length?(y(),u(ze,{key:0,uid:k.value,head:ni.value.head,body:ni.value.body,caption:ni.value.caption,notice:ni.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):d(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),L.value.userOptions.buttons.annotator?(y(),u(w(Ut),qe({key:1},w(a)(L.value.userOptions.annotator),{svgRef:w(W),backgroundColor:H.value.backgroundColor,color:H.value.color,active:Rr.value,isCursorPointer:En.value,palette:L.value.userOptions.annotatorPalette,onClose:zr}),We({_:2},[x(w(o),t=>({name:t,fn:E(n=>[S(e.$slots,t,_(h(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Pn.value?(y(),f(`div`,{key:2,ref_key:`noTitle`,ref:Qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),H.value.title.text?(y(),f(`div`,{key:3,ref_key:`chartTitle`,ref:Jt,class:`vue-ui-xy-title`,style:v(`font-family:${L.value.style.fontFamily}`)},[Ke(Fe,{config:{title:{cy:`history-plot-div-title`,...H.value.title},subtitle:{cy:`history-plot-div-subtitle`,...H.value.title.subtitle}}},null,8,[`config`])],4)):d(``,!0),p(`div`,{id:`legend-top-${k.value}`},null,8,rt),L.value.userOptions.show&&hn.value&&(On.value||Dn.value)?(y(),u(w(Wt),qe({ref_key:`userOptionsRef`,ref:on,key:`user_option_${Xt.value}`,backgroundColor:H.value.backgroundColor,color:H.value.color,isPrinting:w(An),isImaging:w(jn),uid:k.value,hasTooltip:H.value.tooltip.show&&L.value.userOptions.buttons.tooltip,hasLabel:!1,isFullscreen:tn.value,chartElement:O.value},w(n)(L.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator`),{isTooltip:G.value.showTooltip,isAnnotation:Rr.value,tableDialog:L.value.table.useDialog,isCursorPointer:En.value,onToggleFullscreen:Ar,onGeneratePdf:w(Mn),onGenerateCsv:Lr,onGenerateImage:w(ei),onGenerateSvg:w($r),onToggleTable:Br,onToggleTooltip:Vr,onToggleAnnotator:zr,onCopyAlt:ti,style:{visibility:On.value?Dn.value?`visible`:`hidden`:`visible`}}),We({_:2},[x(w(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:E(n=>[S(e.$slots,t,_(h(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`chartElement`,`isTooltip`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),p(`div`,it,[(y(),f(`svg`,{ref_key:`svgRef`,ref:W,xmlns:w(Se),viewBox:`0 0 ${K.value.width<0?.1:K.value.width} ${K.value.height<0?.1:K.value.height}`,style:v(`max-width:100%;overflow:visible;background:transparent;color:${H.value.color};visibility:${w(zn)?`visible`:`hidden`}`),"aria-describedby":`chart-instructions-${k.value}`,tabindex:`0`,onFocus:oi,onBlur:si,onKeydown:ui},[Ke(w(Gt)),S(e.$slots,`svg-underlayer`,{svg:{...K.value,drawingArea:J.value,isPrintingImg:w(An)||w(jn)||w(Zr),isPrintingSvg:w(Qr)}},void 0,!0),e.$slots[`chart-background`]?(y(),f(`foreignObject`,{key:0,x:J.value.left,y:J.value.top,width:J.value.width<=0?10:J.value.width,height:J.value.height<=0?10:J.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,ot)):d(``,!0),z.value.gradient.show||rr.value?(y(),f(`defs`,st,[z.value.gradient.show?(y(!0),f(c,{key:0},x(Q.value,(e,t)=>(y(),u(Ve,{t:`radial`,key:`gradient_${t}_${k.value}`,id:`gradient_${t}_${k.value}`,fy:`30%`,stops:[[`10%`,w(se)(e.color,z.value.gradient.intensity/100),1],[`90%`,w(ue)(e.color,.1),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)):d(``,!0),(y(!0),f(c,null,x(Q.value,e=>(y(),f(c,{key:`temperature_grad_history_template_${e.seriesIndex}_${k.value}`},[z.value.gradient.show&&ar(e)?(y(!0),f(c,{key:0},x(e.plots,t=>(y(),u(Ve,{t:`radial`,key:`temperature_plot_grad_history_${e.seriesIndex}_${t.id}_${k.value}`,id:pr(e,t),fy:`30%`,stops:[[`10%`,w(se)(fr(e,t),z.value.gradient.intensity/100),1],[`90%`,w(ue)(fr(e,t),.1),1],[`100%`,fr(e,t),1]]},null,8,[`id`,`stops`]))),128)):d(``,!0),ir(e)?(y(),f(`linearGradient`,{key:1,id:`temperature_grad_history_${e.seriesIndex}_${k.value}`,gradientUnits:`userSpaceOnUse`,x1:dr(e).x1,y1:dr(e).y1,x2:dr(e).x2,y2:dr(e).y2},[(y(!0),f(c,null,x(e.temperatureColors,(t,n)=>(y(),f(`stop`,{key:`temperature_grad_history_stop_${e.seriesIndex}_${n}_${k.value}`,"stop-color":t,offset:e.temperatureColors.length===1?`0%`:w(ye)(n,e.temperatureColors.length)},null,8,lt))),128))],8,ct)):d(``,!0)],64))),128))])):d(``,!0),B.value.verticalLines.show?(y(),f(`g`,ut,[(y(!0),f(c,null,x(Z.value.tickX,e=>(y(),f(`line`,{x1:e.x,x2:e.x,y1:e.y1,y2:e.y2,stroke:B.value.verticalLines.stroke,"stroke-width":B.value.verticalLines.strokeWidth,"stroke-linecap":`round`},null,8,dt))),256))])):d(``,!0),V.value.y.labels.show?(y(),f(`g`,ft,[(y(!0),f(c,null,x(Z.value.tickY,e=>(y(),f(`line`,{stroke:B.value.verticalLines.stroke,"stroke-width":B.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:J.value.left-5,x2:J.value.left,y1:e.y,y2:e.y},null,8,pt))),256))])):d(``,!0),V.value.y.labels.show?(y(),f(`g`,{key:4,ref_key:`yAxisScales`,ref:un},[(y(!0),f(c,null,x(Z.value.tickY,e=>(y(),f(`text`,{x:J.value.left+V.value.y.labels.offsetX-4-z.value.radius,y:e.y+Y.value.yAxisLabels/3,fill:V.value.y.labels.color,"font-size":Y.value.yAxisLabels,"text-anchor":`end`},C(w(ge)(V.value.y.labels.formatter,e.value,w(re)({p:V.value.y.labels.prefix,v:e.value,s:V.value.y.labels.suffix,r:V.value.y.labels.rounding}))),9,mt))),256))],512)):d(``,!0),V.value.y.name.text?(y(),f(`text`,{key:5,ref_key:`yAxisLabel`,ref:cn,transform:`translate(${Y.value.yAxisName}, ${K.value.height/2+V.value.y.name.offsetY}), rotate(-90)`,"font-size":Y.value.yAxisName,fill:V.value.y.name.color,"font-weight":V.value.y.name.bold?`bold`:`normal`,"text-anchor":`middle`},C(V.value.y.name.text),9,ht)):d(``,!0),B.value.horizontalLines.show?(y(),f(`g`,gt,[(y(!0),f(c,null,x(Z.value.tickY,e=>(y(),f(`line`,{x1:e.x1,x2:e.x2,y1:e.y,y2:e.y,stroke:B.value.horizontalLines.stroke,"stroke-width":B.value.horizontalLines.strokeWidth,"stroke-linecap":`round`},null,8,_t))),256))])):d(``,!0),V.value.x.labels.show?(y(),f(`g`,vt,[(y(!0),f(c,null,x(Z.value.tickX,e=>(y(),f(`line`,{stroke:B.value.verticalLines.stroke,"stroke-width":B.value.verticalLines.strokeWidth,"stroke-linecap":`round`,x1:e.x,x2:e.x,y1:J.value.bottom,y2:J.value.bottom+5},null,8,yt))),256))])):d(``,!0),V.value.x.labels.show?(y(),f(`g`,{key:8,ref_key:`xAxisScales`,ref:ln},[(y(!0),f(c,null,x(Z.value.tickX,e=>(y(),f(`text`,{class:`vue-ui-history-plot-x-axis-scale`,transform:`translate(${e.x}, ${J.value.bottom+V.value.x.labels.offsetY+Y.value.xAxisLabels+z.value.radius}), rotate(${V.value.x.labels.rotation})`,fill:V.value.x.labels.color,"font-size":Y.value.xAxisLabels,"text-anchor":V.value.x.labels.rotation>0?`start`:V.value.x.labels.rotation<0?`end`:`middle`},C(w(ge)(V.value.x.labels.formatter,e.value,w(re)({p:V.value.x.labels.prefix,v:e.value,s:V.value.x.labels.suffix,r:V.value.x.labels.rounding}))),9,bt))),256))],512)):d(``,!0),V.value.x.name.text?(y(),f(`text`,{key:9,ref_key:`xAxisLabel`,ref:sn,x:K.value.width/2+V.value.x.name.offsetX,y:K.value.height,"font-size":Y.value.xAxisName,fill:V.value.x.name.color,"font-weight":V.value.x.name.bold?`bold`:`normal`,"text-anchor":`middle`},C(V.value.x.name.text),9,xt)):d(``,!0),B.value.xAxis.show?(y(),f(`line`,{key:10,x1:J.value.left,x2:J.value.left+J.value.width,y1:J.value.bottom,y2:J.value.bottom,stroke:B.value.xAxis.stroke,"stroke-width":B.value.xAxis.strokeWidth,"stroke-linecap":`round`},null,8,St)):d(``,!0),B.value.yAxis.show?(y(),f(`line`,{key:11,x1:J.value.left,x2:J.value.left,y1:J.value.top,y2:J.value.bottom,stroke:B.value.yAxis.stroke,"stroke-width":B.value.yAxis.strokeWidth,"stroke-linecap":`round`},null,8,Ct)):d(``,!0),(y(!0),f(c,null,x(nr.value,e=>(y(),f(`g`,{key:`history_plot_serie_${e.seriesIndex}_${k.value}`},[H.value.paths.show?(y(),f(`g`,{key:0,style:v({opacity:yr(e.seriesIndex)})},[p(`path`,{class:g({"vue-data-ui-transition":w(U)&&!w(q)}),d:e.path,stroke:H.value.backgroundColor,"stroke-width":H.value.paths.strokeWidth+4,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,wt),p(`path`,{class:g({"vue-data-ui-transition":w(U)&&!w(q)}),d:e.path,stroke:vr(e),"stroke-width":H.value.paths.strokeWidth,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,Tt)],4)):d(``,!0),(y(!0),f(c,null,x(e.plots,e=>(y(),f(`circle`,{cx:e.x,cy:e.y,fill:H.value.backgroundColor,r:Y.value.plots,stroke:`none`,class:g({"vue-data-ui-transition":w(U)&&!w(q)})},null,10,Et))),256)),(y(!0),f(c,null,x(e.plots,t=>(y(),f(`circle`,{cx:t.x,cy:t.y,fill:mr(e,t,e.gradientIndex),r:Y.value.plots,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,class:g({"vue-data-ui-transition":w(U)&&!w(q)}),style:v({opacity:yr(e.seriesIndex)})},null,14,Dt))),256)),z.value.labels.show?(y(),f(`g`,Ot,[(y(!0),f(c,null,x(e.plots,(t,n)=>(y(),f(`g`,{key:`plab_${n}`},[String(t.label).includes(`
|
|
2
2
|
`)?(y(),f(`text`,{key:1,class:g({"vue-data-ui-transition":w(U)&&!w(q)}),transform:`translate(${t.x+z.value.labels.offsetX}, ${t.y+z.value.labels.offsetY+Y.value.plots+Y.value.labels})`,"font-size":Y.value.labels,fill:z.value.labels.color,"font-weight":z.value.labels.bold?`bold`:`normal`,"text-anchor":`middle`,style:v({opacity:yr(e.seriesIndex)}),innerHTML:w(le)({content:String(t.label),fontSize:Y.value.labels,fill:z.value.labels.color,x:0,y:0})},null,14,At)):(y(),f(`text`,{key:0,class:g({"vue-data-ui-transition":w(U)&&!w(q)}),transform:`translate(${t.x+z.value.labels.offsetX}, ${t.y+z.value.labels.offsetY+Y.value.plots+Y.value.labels})`,"font-size":Y.value.labels,fill:z.value.labels.color,"font-weight":z.value.labels.bold?`bold`:`normal`,"text-anchor":`middle`,style:v({opacity:yr(e.seriesIndex)})},C(t.label),15,kt))]))),128))])):d(``,!0),z.value.indexLabels.show?(y(),f(`g`,jt,[(y(!0),f(c,null,x(e.plots,(t,n)=>(y(),f(`text`,{key:`lab_${n}`,class:g({"vue-data-ui-transition":w(U)&&!w(q)}),transform:`translate(${t.x+z.value.indexLabels.offsetX}, ${t.y+z.value.indexLabels.offsetY+Y.value.indexLabels/3})`,"font-size":Y.value.indexLabels,"font-weight":z.value.indexLabels.bold?`bold`:`normal`,fill:gr(e,t),"text-anchor":`middle`,style:v({opacity:yr(e.seriesIndex)})},C(z.value.indexLabels.startAtZero?n:n+1),15,Mt))),128))])):d(``,!0)]))),128)),(y(!0),f(c,null,x(nr.value,e=>(y(),f(`g`,{key:`history_plot_trap_serie_${e.seriesIndex}_${k.value}`},[(y(!0),f(c,null,x(e.plots,(t,n)=>(y(),f(`circle`,{cx:t.x,cy:t.y,fill:`transparent`,r:Y.value.plots,stroke:`none`,onMouseenter:r=>Pr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex,triggerMode:`pointer`}),onMouseleave:r=>Mr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex}),onClick:r=>kr({datapoint:t,plotIndex:n,seriesIndex:e.seriesIndex})},null,40,Nt))),256))]))),128)),S(e.$slots,`svg`,{svg:{...K.value,drawingArea:J.value,isPrintingImg:w(An)||w(jn)||w(Zr),isPrintingSvg:w(Qr)}},void 0,!0)],44,at)),e.$slots.hint?(y(),f(`div`,Pt,[S(e.$slots,`hint`,_(h({hint:L.value.a11y.translations.keyboardNavigation,isVisible:pn.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(y(),f(`div`,Ft,[S(e.$slots,`watermark`,_(h({isPrinting:w(An)||w(jn)||w(Zr)||w(Qr)})),void 0,!0)])):d(``,!0),p(`div`,{id:`legend-bottom-${k.value}`},null,8,It),rn.value&&(H.value.legend.show||e.$slots.legend)?(y(),u(Ue,{key:6,to:H.value.legend.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[p(`div`,{ref_key:`chartLegend`,ref:Yt},[S(e.$slots,`legend`,{legend:Dr.value},()=>[H.value.legend.show&&hn.value?(y(),u(Le,{key:0,legendSet:Dr.value,config:Or.value,isCursorPointer:En.value,onClickMarker:s[0]||=({legend:e})=>{xr(e.seriesIndex)}},{item:E(({legend:e,index:t})=>[p(`div`,{onClick:t=>e.segregate(),style:v(`opacity:${X.value.includes(e.seriesIndex)?.5:1}`)},C(e.name),13,Lt)]),legendToggle:E(()=>[Dr.value.length>2&&H.value.legend.selectAllToggle.show&&!I.value?(y(),u(Be,{key:0,backgroundColor:H.value.legend.selectAllToggle.backgroundColor,color:H.value.legend.selectAllToggle.color,fontSize:H.value.legend.fontSize,checked:X.value.length>0,isCursorPointer:En.value,onToggle:br},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):d(``,!0)]),_:1},8,[`legendSet`,`config`,`isCursorPointer`])):d(``,!0)],!0)],512)],8,[`to`])):d(``,!0),e.$slots.source?(y(),f(`div`,{key:7,ref_key:`source`,ref:nn,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),Ke(w(zt),{teleportTo:H.value.tooltip.teleportTo,show:G.value.showTooltip&&$t.value,backgroundColor:H.value.tooltip.backgroundColor,color:H.value.tooltip.color,fontSize:H.value.tooltip.fontSize,borderRadius:H.value.tooltip.borderRadius,borderColor:H.value.tooltip.borderColor,borderWidth:H.value.tooltip.borderWidth,backgroundOpacity:H.value.tooltip.backgroundOpacity,position:H.value.tooltip.position,offsetX:H.value.tooltip.offsetX,offsetY:H.value.tooltip.offsetY,parent:O.value,content:en.value,isCustom:M.value,isFullscreen:tn.value,smooth:H.value.tooltip.smooth,backdropFilter:H.value.tooltip.backdropFilter,smoothForce:H.value.tooltip.smoothForce,smoothSnapThreshold:H.value.tooltip.smoothSnapThreshold,isA11yMode:fn.value===`keyboard`,a11yPosition:dn.value},{"tooltip-before":E(()=>[S(e.$slots,`tooltip-before`,_(h({...jr.value})),void 0,!0)]),tooltip:E(()=>[S(e.$slots,`tooltip`,_(h({...jr.value})),void 0,!0)]),"tooltip-after":E(()=>[S(e.$slots,`tooltip-after`,_(h({...jr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isCustom`,`isFullscreen`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),hn.value&&L.value.userOptions.buttons.table?(y(),u(Qe(Kr.value.component),qe({key:8},Kr.value.props,{ref_key:`tableUnit`,ref:an,onClose:qr}),We({content:E(()=>[Ke(w(Ht),{colNames:Ir.value.colNames,head:Ir.value.head,body:Ir.value.body,config:Ir.value.config,title:L.value.table.useDialog?``:Kr.value.title,withCloseButton:!L.value.table.useDialog,isCursorPointer:En.value,onClose:qr},{th:E(({th:e})=>[p(`div`,Rt,C(e),1)]),td:E(({td:e})=>[Ge(C(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[L.value.table.useDialog?{name:`title`,fn:E(()=>[Ge(C(Kr.value.title),1)]),key:`0`}:void 0,L.value.table.useDialog?{name:`actions`,fn:E(()=>[p(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[1]||=e=>Lr(L.value.userOptions.callbacks.csv),style:v({cursor:En.value?`pointer`:`default`})},[Ke(w(Bt),{name:`fileCsv`,stroke:Kr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):d(``,!0),S(e.$slots,`skeleton`,{},()=>[I.value?(y(),u(Re,{key:0})):d(``,!0)],!0)],46,tt))}},[[`__scopeId`,`data-v-fa284a3f`]]);export{et as n,zt as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as ee}from"./chartImage-DPGnEuYM.js";import{$ as l,D as te,Dt as ne,Ht as u,J as re,Jt as ie,S as ae,X as oe,Yt as se,Zt as ce,at as le,b as d,i as ue,in as de,nn as fe,nt as pe,t as me,tn as he,vt as ge,w as _e,wt as ve,zt as ye}from"./lib-rPeBMZrn.js";import{c as be}from"./canvas-lib-22VpOI4_.js";import{n as xe,t as Se}from"./useHints-C-TwxM0Y.js";import{t as Ce}from"./useConfig-CBXrYhMI.js";import{t as we}from"./useLoading-BwiplGDB.js";import{t as Te}from"./usePrinter-DVf3YcG5.js";import{t as Ee}from"./useResponsive-CENUxfEL.js";import{t as De}from"./useNestedProp-DnGoh-XS.js";import{t as Oe}from"./useThemeCheck-BKNRbGeC.js";import{t as ke}from"./useChartExport-BZts4KFb.js";import{t as Ae}from"./useTransitions-ChGGrtrv.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./useUserOptionState-CXlFnwPv.js";import{t as Ne}from"./useChartAccessibility-DOMuYJfm.js";import{t as Pe}from"./Shape-CRe8woTu.js";import{n as Fe}from"./Title-BliHuXfT.js";import{t as Ie}from"./vue_ui_horizontal_bar-uuJ0_9O6.js";import{t as Le}from"./Legend-W9YVYVX-.js";import{t as Re}from"./vue-ui-accordion-CV2dxsXB.js";import{t as ze}from"./BaseScanner-m6QR9rwD.js";import{t as Be}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ve}from"./A11yDataTable-DWNlWXzs.js";import{t as He}from"./DefGrad-DKMq1REY.js";import{t as Ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as f,computed as p,createBlock as m,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as qe,guardReactiveProps as v,mergeProps as y,nextTick as Je,normalizeClass as b,normalizeProps as Ye,normalizeStyle as x,onBeforeUnmount as Xe,onMounted as Ze,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as Qe,toDisplayString as E,toRefs as $e,unref as D,useCssVars as et,useSlots as tt,watch as nt,withCtx as O,withKeys as rt}from"vue";var it=/* @__PURE__ */ e({default:()=>Ft}),at=[`id`],ot=[`id`],st=[`onClick`],ct={style:{position:`relative`}},lt=[`xmlns`,`viewBox`,`aria-describedby`],ut={class:`vue-data-ui-g`},dt=[`width`,`height`],ft={key:1},pt=[`y`,`width`,`height`,`fill`,`rx`],mt=[`fill`,`rx`],ht=[`fill`,`rx`,`stroke`,`stroke-width`],gt=[`fill`,`rx`,`stroke`,`stroke-width`],_t=[`stroke`,`stroke-width`,`d`],vt=[`stroke`,`stroke-width`,`d`],yt=[`y`,`height`,`width`,`fill`],bt=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],xt=[`transform`,`font-size`,`fill`,`font-weight`],St=[`transform`,`font-size`,`font-weight`,`innerHTML`],Ct=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],wt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],Tt=[`y`,`width`,`height`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Et={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Dt={key:7,class:`vue-data-ui-watermark`},Ot=[`onClick`],kt={style:`width:100%;padding-top: 36px;position:relative`},At={class:`vue-ui-data-table`},jt={key:0},Mt={style:{width:`100%`}},Nt=[`data-cell`],Pt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ft=/*#__PURE__*/ Ue({__name:`vue-ui-horizontal-bar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`,`selectDatapoint`],setup(e,{expose:Ue,emit:it}){et(e=>({v4c8b2a51:e.tdo}));let Ft=qe(()=>import(`./Tooltip-B432XpvC.js`)),It=qe(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Lt=qe(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Rt=qe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),zt=qe(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),Bt=qe(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_vertical_bar:Vt}=Ce(),{isThemeValid:Ht,warnInvalidTheme:Ut}=Oe(),Wt=tt(),k=e,Gt=p(()=>!!k.dataset?.length),A=C(oe()),Kt=C(!1),qt=C(``),Jt=C(null),Yt=C(0),j=C(null),Xt=C(null),Zt=C(null),Qt=C(null),$t=C(null),en=C(0),tn=C(0),nn=C(null),rn=C(null),an=C(null),M=C([]),on={none:0,asc:1,desc:2},N=C(0),sn=C(0),cn=null,ln=null,P=C(null),un=C({x:0,y:0}),dn=C(`pointer`),fn=it,F=C(Sn()),I=p(()=>F.value.style.chart.layout.bars),L=p(()=>F.value.style.chart.layout),R=p(()=>F.value.style.chart.tooltip),z=p(()=>F.value.style.chart);xe({config:()=>F.value,dataset:()=>k.dataset,component:`VueUiHorizontalBar`,rules:[Se.emptyArray,{test:e=>e.length>50||e.some(e=>e.children&&e.children.length>50),message:[`👀 There are > 50 series / bars, which will probably force users to scroll. Consider:`,``,`▶️ Grouping small values into an "Other" category.`,``,`▶️ Using filters, or several instances of the component with subsets of related series.`]}]});let{transitionEnabled:B}=Ae({config:()=>F.value.transitions,dataset:()=>k.dataset}),V=p(()=>F.value.userOptions.useCursorPointer),pn=p(()=>k.config?.skeletonDataset??[{name:``,value:6,color:`#d9d9d9`},{name:``,value:5,color:`#d9d9d9`},{name:``,value:4,color:`#d9d9d9`},{name:``,value:3,color:`#d9d9d9`},{name:``,value:2,color:`#d9d9d9`},{name:``,value:1,color:`#d9d9d9`}]),mn=p(()=>de({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{bars:{offsetX:110,dataLabels:{color:`transparent`,value:{prefix:``,suffix:``,formatter:null}},nameLabels:{color:`transparent`}},separators:{color:`#7A7A7A`}},legend:{show:!0,backgroundColor:`transparent`,color:`transparent`,prefix:``,suffix:``,formatter:null},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:F.value.skeletonConfig??{}})),{loading:hn,FINAL_DATASET:gn,manualLoading:_n}=we({...$e(k),FINAL_CONFIG:F,prepareConfig:Sn,callback:()=>{Promise.resolve().then(async()=>{K.value.showTable=F.value.table.show,Pn()})},skeletonDataset:pn.value,skeletonConfig:de({defaultConfig:F.value,userConfig:mn.value})}),{userOptionsVisible:vn,setUserOptionsVisibility:yn,keepUserOptionState:bn}=Me({config:F.value}),{svgRef:xn}=Ne({config:z.value.title});function Sn(){let e=De({userConfig:k.config,defaultConfig:Vt}),t={},n=e.theme;if(n){if(!Ht.value(e))Ut(e),t=e;else{let r=De({userConfig:Ie[n]||k.config,defaultConfig:e});t={...De({userConfig:k.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:fe[n]||u}}}else t=e;for(let e of[`datapointEnter`,`datapointLeave`,`datapointClick`])t.events[e]=ve(k.config,`events.${e}`)?k.config.events[e]:null;return t}let H=C(z.value.width),U=C(z.value.height),W=C(I.value.gap),Cn=ce(k.config);nt(()=>k.config,(e,t)=>{let n=ce(e),r=n!==Cn;Cn=n;let i=Sn();r?(hn.value||(F.value=i),vn.value=!F.value.userOptions.showOnChartHover,en.value+=1,tn.value+=1,K.value.showTable=F.value.table.show,N.value=on[I.value.sort]??0,K.value.showTooltip=R.value.show,H.value=z.value.width,U.value=z.value.height,W.value=I.value.gap):(F.value.style.chart.tooltip=i.style.chart.tooltip,K.value.showTooltip=F.value.style.chart.tooltip.show)},{deep:!0}),nt(()=>k.dataset,e=>{Array.isArray(e)&&e.length>0&&(_n.value=!1)},{deep:!0});let{isPrinting:wn,isImaging:Tn,generatePdf:En,generateImage:Dn}=Te({elementId:`vue-ui-vertical-bar_${A.value}`,fileName:z.value.title.text||`vue-ui-vertical-bar`,options:F.value.userOptions.print}),On=p(()=>F.value.userOptions.show&&!z.value.title.text),kn=p(()=>_e(F.value.customPalette)),An=C(null),jn=p(()=>F.value.table.responsiveBreakpoint),Mn=p(()=>F.value.debug),G=C(null),Nn=C(null);function Pn(){if(j.value&&(ye(k.dataset)&&(le({componentName:`VueUiVerticalBar`,type:`dataset`,debug:Mn.value}),_n.value=!0),ye(k.dataset)||(_n.value=F.value.loading),F.value.responsive)){let e=be(()=>{let{width:e,height:t}=Ee({chart:j.value,title:z.value.title.text?Xt.value:null,legend:z.value.legend.show?Zt.value:null,source:Qt.value,noTitle:$t.value});requestAnimationFrame(async()=>{U.value=t,H.value=e})});G.value&&(Nn.value&&G.value.unobserve(Nn.value),G.value.disconnect()),G.value=new ResizeObserver(e),Je(()=>{Nn.value=j.value?.parentNode,Nn.value&&G.value.observe(Nn.value)})}}Xe(()=>{G.value&&(Nn.value&&G.value.unobserve(Nn.value),G.value.disconnect())});let K=C({showTable:F.value.table.show,showTooltip:R.value.show}),Fn=p(()=>N.value===0),In=p(()=>N.value===2),q=p(()=>(gn.value.forEach((e,t)=>{!e.value&&!e.children&&le({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`value (index ${t})`,debug:Mn.value}),e.children&&(ye(e.children)?le({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`children (index ${t})`,debug:Mn.value}):e.children.forEach((e,t)=>{[null,void 0].includes(e.name)&&le({componentName:`VueUiVerticalBar`,type:`datasetSerieAttribute`,property:`name`,key:`children`,index:t,debug:Mn.value})}))}),gn.value.map((e,t)=>{let n=`vertical_parent_${t}_${A.value}`,r=e.children&&e.children.length>0,i=d(e.value?e.value:r?e.children.map(e=>e.value||0).reduce((e,t)=>e+t,0):0),a=i>=0?1:-1;return{...e,id:n,absoluteIndex:t,shape:`square`,opacity:M.value.includes(n)?.5:1,value:Math.abs(i),sign:a,hasChildren:r,isChild:!1,segregate:()=>$n(n),isSegregated:M.value.includes(n),color:ae(e.color)||kn.value[t]||u[t]||u[t%u.length],children:!e.children||!e.children.length?[]:e.children.toSorted(Fn.value?()=>0:(e,t)=>In.value?t.value-e.value:e.value-t.value).map((r,o)=>({...r,value:d(Math.abs(r.value)),absoluteIndex:t,sign:r.value>=0?1:-1,isChild:!0,parentId:n,parentName:e.name,parentValue:i,parentSign:a,id:`vertical_child_${t}_${o}_${A.value}`,childIndex:o,isFirstChild:o===0,isLastChild:o===e.children.length-1,color:ae(r.color)||ae(e.color)||kn.value[t]||u[t]||u[t%u.length]}))}}).toSorted(Fn.value?()=>0:(e,t)=>In.value?t.value-e.value:e.value-t.value))),J=p(()=>q.value.filter(e=>!M.value.includes(e.id)));function Ln(e){return e.flatMap(e=>e.hasChildren?e.children:e)}let Y=p(()=>Ln(J.value)),Rn=p(()=>Ln(q.value)),zn=p(()=>Y.value.length),Bn=p(()=>({cy:`vertical-bar-div-legend`,backgroundColor:z.value.legend.backgroundColor,color:z.value.legend.color,fontSize:z.value.legend.fontSize,paddingBottom:12,fontWeight:z.value.legend.bold?`bold`:``})),Vn=p(()=>I.value.parentLabels.show?I.value.parentLabels.fontSize*3+I.value.parentLabels.paddingBottom:0),Hn=p(()=>{let e=[],t=0;return Y.value.forEach((n,r)=>{n.isChild&&n.childIndex===0&&I.value.parentLabels.show&&(t+=1),e[r]=t}),e}),X=p(()=>{let e=Math.max(0,...Hn.value)*Vn.value;return(U.value-24-(zn.value-1)*W.value-e)/zn.value}),Z=p(()=>({width:H.value,height:U.value,padding:{top:12,left:128+I.value.offsetX,right:64+I.value.paddingRight,bottom:12}})),Un=C(0);function Wn(){Je(()=>{if(!an.value){Un.value=0;return}let e=Array.from(an.value.querySelectorAll(`text`)).reduce((e,t)=>{let n=t.getBBox?.().width??t.getComputedTextLength();return n>e?n:e},0);Un.value=e+12})}nt(()=>[Y.value,H.value,U.value,I.value.nameLabels,I.value.offsetX],()=>Wn(),{deep:!0}),Ze(()=>{Wn()});function Gn(){return typeof document>`u`?null:(cn||(cn=document.createElement(`canvas`),ln=cn.getContext(`2d`)),ln)}function Kn(e){let t=String(e??``),n=I.value,r=n.dataLabels.fontSize,i=n.dataLabels.bold?700:400,a=F.value.style.fontFamily,o=Gn();return o?(o.font=`${i} ${r}px ${a}`,o.measureText(t).width):t.length*r*.6}function qn(){return Y.value.length?Math.max(...Y.value.map(e=>Math.abs(e.value))):0}let Jn=p(()=>{sn.value;let e=I.value,t=Un.value+Math.abs(e.nameLabels.offsetX)+e.offsetX,n=Z.value.width-Z.value.padding.right,r=Math.max(0,n-t-e.offsetX),i=Z.value.width-40,a=qn(),o=Y.value.map((e,t)=>({serie:e,textWidth:Kn(xr(e.value,e,t,e.sign))}));if(!o.length||r<=0)return{left:0,right:0};if(!o.some(({serie:e})=>e.sign===-1)){let n=o.reduce((n,{serie:o,textWidth:s})=>{let c=a?Math.abs(o.value)/a:0;if(c<=0||s<=0)return n;let ee=(t+r*c+3+e.dataLabels.offsetX+s-i)/c;return Math.max(n,ee)},0);return{left:0,right:Math.ceil(Math.min(r,Math.max(0,n)))}}let s=t+r/2,c=-1/0,ee=1/0;o.forEach(({serie:t,textWidth:n})=>{if(t.sign===-1){let t=s+12+e.dataLabels.offsetX+n;ee=Math.min(ee,i-t);return}let r=s-12-e.dataLabels.offsetX-n;c=Math.max(c,40-r)});let l=0;l=c>ee?(c+ee)/2:Math.min(ee,Math.max(c,0));let te=l*2;return te>=0?{left:Math.ceil(Math.min(r,te)),right:0}:{left:0,right:Math.ceil(Math.min(r,-te))}}),Yn=p(()=>Jn.value.right),Xn=p(()=>Jn.value.left);function Zn(){sn.value+=1}Ze(()=>{typeof document<`u`&&document.fonts&&(document.fonts.ready.then(Zn),document.fonts.addEventListener?.(`loadingdone`,Zn))}),Xe(()=>{typeof document<`u`&&document.fonts&&document.fonts.removeEventListener?.(`loadingdone`,Zn),cn=null,ln=null});let Q=p(()=>{let e=Un.value+Math.abs(I.value.nameLabels.offsetX)+Xn.value+I.value.offsetX,t=Z.value.width-Z.value.padding.right,n=Math.max(0,t-e-Yn.value-I.value.offsetX);return{top:Z.value.padding.top,bottom:Z.value.padding.top+Z.value.height,left:e,right:t,width:n,fullHeight:Z.value.padding.top+Z.value.padding.bottom+Z.value.height}});function Qn(){M.value.length?M.value=[]:q.value.forEach(e=>{M.value.push(e.id)}),fn(`selectLegend`,J.value)}async function $n(e){if(M.value.includes(e))M.value=M.value.filter(t=>t!==e);else{if(M.value.length===q.value.length-1)return;M.value.push(e)}fn(`selectLegend`,J.value)}function er(e){return q.value.length?q.value.find(t=>t.name===e)||(Mn.value&&console.warn(`VueUiHorizontalBar - Series name not found "${e}"`),null):(Mn.value&&console.warn(`VueUiHorizontalBar - There are no series to show.`),null)}function tr(e){let t=er(e);t!==null&&M.value.includes(t.id)&&$n(t.id)}function nr(e){let t=er(e);t!==null&&(M.value.includes(t.id)||$n(t.id))}let $=p(()=>J.value.map(e=>Math.abs(e.value)).reduce((e,t)=>e+t,0));function rr(e,t=!1,n=0){return t?l({v:d(Math.abs(e)/$.value*100),s:`%`,r:n}):Math.abs(e)/$.value}let ir=p(()=>Y.value.some(e=>e.sign===-1)),ar=p(()=>Math.max(...Y.value.map(e=>e.value)));function or(e){let t=e/ar.value;return d(Q.value.width/(ir.value?2:1)*t)}function sr(e){return or(e)+Q.value.left}function cr(e){return Q.value.top+(W.value+X.value)*e+Hn.value[e]*Vn.value}let lr=p(()=>Y.value.map((e,t)=>{let n=or(e.value),r=n<=0?1e-4:n;return{x:d(ir.value?Q.value.left+Q.value.width/2-(e.sign===1?0:r):Q.value.left),y:cr(t),width:d(r),height:X.value<=0?1e-4:X.value}})),ur=p(()=>{let e=new Map(J.value.map(e=>[e.id,e]));return Y.value.map((t,n)=>{if(!t.isChild)return null;let r=e.get(t.parentId);return{y:cr(n)-Vn.value+I.value.parentLabels.fontSize,name:r.name,value:[void 0,NaN,null].includes(r.value)?``:r.sign===1?r.value:-r.value,percentageToTotal:isNaN(r.value/$.value)?``:rr(r.value,!0,I.value.dataLabels.percentage.roundingPercentage),sign:r.sign}})});function dr(e,t){return ur.value[t]}function fr(){return J.value}function pr(e,t){return dr(e,t).name}function mr(e,t){let n=dr(e,t);return xr(n.value,n,t,e.parentSign||e.sign)}let hr=C(null),gr=C(null);function _r({datapoint:e,seriesIndex:t}){fn(`selectDatapoint`,e),F.value.events.datapointClick&&F.value.events.datapointClick({datapoint:e,seriesIndex:t})}function vr({datapoint:e,seriesIndex:t}){F.value.events.datapointLeave&&F.value.events.datapointLeave({datapoint:e,seriesIndex:t}),Jt.value=null,Kt.value=!1,hr.value=null,P.value===t&&(P.value=null)}function yr(e,t,n=`pointer`){dn.value=n,F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:e,datpoint:e,seriesIndex:t}),P.value=t,Jt.value=e,gr.value={datapoint:e,seriesIndex:t,series:q.value,config:F.value},Kt.value=!0,hr.value=e.id;let r=``,i=e.isChild?e.parentName:e.name,a=e.isChild?e.name:``,o=R.value.customFormat,s=ne(o)?o({datapoint:e,series:q.value,config:F.value,seriesIndex:t}):null;typeof s==`string`?qt.value=s:(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${R.value.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{t as ee}from"./chartImage-DPGnEuYM.js";import{$ as l,D as te,Dt as ne,Ht as u,J as re,Jt as ie,S as ae,X as oe,Yt as se,Zt as ce,at as le,b as d,i as ue,in as de,nn as fe,nt as pe,t as me,tn as he,vt as ge,w as _e,wt as ve,zt as ye}from"./lib-rPeBMZrn.js";import{c as be}from"./canvas-lib-22VpOI4_.js";import{n as xe,t as Se}from"./useHints-C-TwxM0Y.js";import{t as Ce}from"./useConfig-CXhXxWjB.js";import{t as we}from"./useLoading-DoqqfnmS.js";import{t as Te}from"./usePrinter-DVf3YcG5.js";import{t as Ee}from"./useResponsive-CENUxfEL.js";import{t as De}from"./useNestedProp-DnGoh-XS.js";import{t as Oe}from"./useThemeCheck-BKNRbGeC.js";import{t as ke}from"./useChartExport-BZts4KFb.js";import{t as Ae}from"./useTransitions-ChGGrtrv.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./useUserOptionState-CXlFnwPv.js";import{t as Ne}from"./useChartAccessibility-DOMuYJfm.js";import{t as Pe}from"./Shape-CRe8woTu.js";import{n as Fe}from"./Title-BliHuXfT.js";import{t as Ie}from"./vue_ui_horizontal_bar-_jcrdeQR.js";import{t as Le}from"./Legend-W9YVYVX-.js";import{t as Re}from"./vue-ui-accordion-D3uT1Ynv.js";import{t as ze}from"./BaseScanner-m6QR9rwD.js";import{t as Be}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ve}from"./A11yDataTable-DWNlWXzs.js";import{t as He}from"./DefGrad-DKMq1REY.js";import{t as Ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as f,computed as p,createBlock as m,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as qe,guardReactiveProps as v,mergeProps as y,nextTick as Je,normalizeClass as b,normalizeProps as Ye,normalizeStyle as x,onBeforeUnmount as Xe,onMounted as Ze,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as Qe,toDisplayString as E,toRefs as $e,unref as D,useCssVars as et,useSlots as tt,watch as nt,withCtx as O,withKeys as rt}from"vue";var it=/* @__PURE__ */ e({default:()=>Ft}),at=[`id`],ot=[`id`],st=[`onClick`],ct={style:{position:`relative`}},lt=[`xmlns`,`viewBox`,`aria-describedby`],ut={class:`vue-data-ui-g`},dt=[`width`,`height`],ft={key:1},pt=[`y`,`width`,`height`,`fill`,`rx`],mt=[`fill`,`rx`],ht=[`fill`,`rx`,`stroke`,`stroke-width`],gt=[`fill`,`rx`,`stroke`,`stroke-width`],_t=[`stroke`,`stroke-width`,`d`],vt=[`stroke`,`stroke-width`,`d`],yt=[`y`,`height`,`width`,`fill`],bt=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],xt=[`transform`,`font-size`,`fill`,`font-weight`],St=[`transform`,`font-size`,`font-weight`,`innerHTML`],Ct=[`transform`,`font-size`,`fill`,`font-weight`,`innerHTML`],wt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],Tt=[`y`,`width`,`height`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Et={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Dt={key:7,class:`vue-data-ui-watermark`},Ot=[`onClick`],kt={style:`width:100%;padding-top: 36px;position:relative`},At={class:`vue-ui-data-table`},jt={key:0},Mt={style:{width:`100%`}},Nt=[`data-cell`],Pt={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ft=/*#__PURE__*/ Ue({__name:`vue-ui-horizontal-bar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`,`selectDatapoint`],setup(e,{expose:Ue,emit:it}){et(e=>({v4c8b2a51:e.tdo}));let Ft=qe(()=>import(`./Tooltip-B432XpvC.js`)),It=qe(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Lt=qe(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Rt=qe(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),zt=qe(()=>import(`./PackageVersion-D8aPzzvh.js`).then(e=>e.t)),Bt=qe(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_vertical_bar:Vt}=Ce(),{isThemeValid:Ht,warnInvalidTheme:Ut}=Oe(),Wt=tt(),k=e,Gt=p(()=>!!k.dataset?.length),A=C(oe()),Kt=C(!1),qt=C(``),Jt=C(null),Yt=C(0),j=C(null),Xt=C(null),Zt=C(null),Qt=C(null),$t=C(null),en=C(0),tn=C(0),nn=C(null),rn=C(null),an=C(null),M=C([]),on={none:0,asc:1,desc:2},N=C(0),sn=C(0),cn=null,ln=null,P=C(null),un=C({x:0,y:0}),dn=C(`pointer`),fn=it,F=C(Sn()),I=p(()=>F.value.style.chart.layout.bars),L=p(()=>F.value.style.chart.layout),R=p(()=>F.value.style.chart.tooltip),z=p(()=>F.value.style.chart);xe({config:()=>F.value,dataset:()=>k.dataset,component:`VueUiHorizontalBar`,rules:[Se.emptyArray,{test:e=>e.length>50||e.some(e=>e.children&&e.children.length>50),message:[`👀 There are > 50 series / bars, which will probably force users to scroll. Consider:`,``,`▶️ Grouping small values into an "Other" category.`,``,`▶️ Using filters, or several instances of the component with subsets of related series.`]}]});let{transitionEnabled:B}=Ae({config:()=>F.value.transitions,dataset:()=>k.dataset}),V=p(()=>F.value.userOptions.useCursorPointer),pn=p(()=>k.config?.skeletonDataset??[{name:``,value:6,color:`#d9d9d9`},{name:``,value:5,color:`#d9d9d9`},{name:``,value:4,color:`#d9d9d9`},{name:``,value:3,color:`#d9d9d9`},{name:``,value:2,color:`#d9d9d9`},{name:``,value:1,color:`#d9d9d9`}]),mn=p(()=>de({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{bars:{offsetX:110,dataLabels:{color:`transparent`,value:{prefix:``,suffix:``,formatter:null}},nameLabels:{color:`transparent`}},separators:{color:`#7A7A7A`}},legend:{show:!0,backgroundColor:`transparent`,color:`transparent`,prefix:``,suffix:``,formatter:null},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:F.value.skeletonConfig??{}})),{loading:hn,FINAL_DATASET:gn,manualLoading:_n}=we({...$e(k),FINAL_CONFIG:F,prepareConfig:Sn,callback:()=>{Promise.resolve().then(async()=>{K.value.showTable=F.value.table.show,Pn()})},skeletonDataset:pn.value,skeletonConfig:de({defaultConfig:F.value,userConfig:mn.value})}),{userOptionsVisible:vn,setUserOptionsVisibility:yn,keepUserOptionState:bn}=Me({config:F.value}),{svgRef:xn}=Ne({config:z.value.title});function Sn(){let e=De({userConfig:k.config,defaultConfig:Vt}),t={},n=e.theme;if(n){if(!Ht.value(e))Ut(e),t=e;else{let r=De({userConfig:Ie[n]||k.config,defaultConfig:e});t={...De({userConfig:k.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:fe[n]||u}}}else t=e;for(let e of[`datapointEnter`,`datapointLeave`,`datapointClick`])t.events[e]=ve(k.config,`events.${e}`)?k.config.events[e]:null;return t}let H=C(z.value.width),U=C(z.value.height),W=C(I.value.gap),Cn=ce(k.config);nt(()=>k.config,(e,t)=>{let n=ce(e),r=n!==Cn;Cn=n;let i=Sn();r?(hn.value||(F.value=i),vn.value=!F.value.userOptions.showOnChartHover,en.value+=1,tn.value+=1,K.value.showTable=F.value.table.show,N.value=on[I.value.sort]??0,K.value.showTooltip=R.value.show,H.value=z.value.width,U.value=z.value.height,W.value=I.value.gap):(F.value.style.chart.tooltip=i.style.chart.tooltip,K.value.showTooltip=F.value.style.chart.tooltip.show)},{deep:!0}),nt(()=>k.dataset,e=>{Array.isArray(e)&&e.length>0&&(_n.value=!1)},{deep:!0});let{isPrinting:wn,isImaging:Tn,generatePdf:En,generateImage:Dn}=Te({elementId:`vue-ui-vertical-bar_${A.value}`,fileName:z.value.title.text||`vue-ui-vertical-bar`,options:F.value.userOptions.print}),On=p(()=>F.value.userOptions.show&&!z.value.title.text),kn=p(()=>_e(F.value.customPalette)),An=C(null),jn=p(()=>F.value.table.responsiveBreakpoint),Mn=p(()=>F.value.debug),G=C(null),Nn=C(null);function Pn(){if(j.value&&(ye(k.dataset)&&(le({componentName:`VueUiVerticalBar`,type:`dataset`,debug:Mn.value}),_n.value=!0),ye(k.dataset)||(_n.value=F.value.loading),F.value.responsive)){let e=be(()=>{let{width:e,height:t}=Ee({chart:j.value,title:z.value.title.text?Xt.value:null,legend:z.value.legend.show?Zt.value:null,source:Qt.value,noTitle:$t.value});requestAnimationFrame(async()=>{U.value=t,H.value=e})});G.value&&(Nn.value&&G.value.unobserve(Nn.value),G.value.disconnect()),G.value=new ResizeObserver(e),Je(()=>{Nn.value=j.value?.parentNode,Nn.value&&G.value.observe(Nn.value)})}}Xe(()=>{G.value&&(Nn.value&&G.value.unobserve(Nn.value),G.value.disconnect())});let K=C({showTable:F.value.table.show,showTooltip:R.value.show}),Fn=p(()=>N.value===0),In=p(()=>N.value===2),q=p(()=>(gn.value.forEach((e,t)=>{!e.value&&!e.children&&le({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`value (index ${t})`,debug:Mn.value}),e.children&&(ye(e.children)?le({componentName:`VueUiVerticalBar`,type:`datasetAttributeEmpty`,property:`children (index ${t})`,debug:Mn.value}):e.children.forEach((e,t)=>{[null,void 0].includes(e.name)&&le({componentName:`VueUiVerticalBar`,type:`datasetSerieAttribute`,property:`name`,key:`children`,index:t,debug:Mn.value})}))}),gn.value.map((e,t)=>{let n=`vertical_parent_${t}_${A.value}`,r=e.children&&e.children.length>0,i=d(e.value?e.value:r?e.children.map(e=>e.value||0).reduce((e,t)=>e+t,0):0),a=i>=0?1:-1;return{...e,id:n,absoluteIndex:t,shape:`square`,opacity:M.value.includes(n)?.5:1,value:Math.abs(i),sign:a,hasChildren:r,isChild:!1,segregate:()=>$n(n),isSegregated:M.value.includes(n),color:ae(e.color)||kn.value[t]||u[t]||u[t%u.length],children:!e.children||!e.children.length?[]:e.children.toSorted(Fn.value?()=>0:(e,t)=>In.value?t.value-e.value:e.value-t.value).map((r,o)=>({...r,value:d(Math.abs(r.value)),absoluteIndex:t,sign:r.value>=0?1:-1,isChild:!0,parentId:n,parentName:e.name,parentValue:i,parentSign:a,id:`vertical_child_${t}_${o}_${A.value}`,childIndex:o,isFirstChild:o===0,isLastChild:o===e.children.length-1,color:ae(r.color)||ae(e.color)||kn.value[t]||u[t]||u[t%u.length]}))}}).toSorted(Fn.value?()=>0:(e,t)=>In.value?t.value-e.value:e.value-t.value))),J=p(()=>q.value.filter(e=>!M.value.includes(e.id)));function Ln(e){return e.flatMap(e=>e.hasChildren?e.children:e)}let Y=p(()=>Ln(J.value)),Rn=p(()=>Ln(q.value)),zn=p(()=>Y.value.length),Bn=p(()=>({cy:`vertical-bar-div-legend`,backgroundColor:z.value.legend.backgroundColor,color:z.value.legend.color,fontSize:z.value.legend.fontSize,paddingBottom:12,fontWeight:z.value.legend.bold?`bold`:``})),Vn=p(()=>I.value.parentLabels.show?I.value.parentLabels.fontSize*3+I.value.parentLabels.paddingBottom:0),Hn=p(()=>{let e=[],t=0;return Y.value.forEach((n,r)=>{n.isChild&&n.childIndex===0&&I.value.parentLabels.show&&(t+=1),e[r]=t}),e}),X=p(()=>{let e=Math.max(0,...Hn.value)*Vn.value;return(U.value-24-(zn.value-1)*W.value-e)/zn.value}),Z=p(()=>({width:H.value,height:U.value,padding:{top:12,left:128+I.value.offsetX,right:64+I.value.paddingRight,bottom:12}})),Un=C(0);function Wn(){Je(()=>{if(!an.value){Un.value=0;return}let e=Array.from(an.value.querySelectorAll(`text`)).reduce((e,t)=>{let n=t.getBBox?.().width??t.getComputedTextLength();return n>e?n:e},0);Un.value=e+12})}nt(()=>[Y.value,H.value,U.value,I.value.nameLabels,I.value.offsetX],()=>Wn(),{deep:!0}),Ze(()=>{Wn()});function Gn(){return typeof document>`u`?null:(cn||(cn=document.createElement(`canvas`),ln=cn.getContext(`2d`)),ln)}function Kn(e){let t=String(e??``),n=I.value,r=n.dataLabels.fontSize,i=n.dataLabels.bold?700:400,a=F.value.style.fontFamily,o=Gn();return o?(o.font=`${i} ${r}px ${a}`,o.measureText(t).width):t.length*r*.6}function qn(){return Y.value.length?Math.max(...Y.value.map(e=>Math.abs(e.value))):0}let Jn=p(()=>{sn.value;let e=I.value,t=Un.value+Math.abs(e.nameLabels.offsetX)+e.offsetX,n=Z.value.width-Z.value.padding.right,r=Math.max(0,n-t-e.offsetX),i=Z.value.width-40,a=qn(),o=Y.value.map((e,t)=>({serie:e,textWidth:Kn(xr(e.value,e,t,e.sign))}));if(!o.length||r<=0)return{left:0,right:0};if(!o.some(({serie:e})=>e.sign===-1)){let n=o.reduce((n,{serie:o,textWidth:s})=>{let c=a?Math.abs(o.value)/a:0;if(c<=0||s<=0)return n;let ee=(t+r*c+3+e.dataLabels.offsetX+s-i)/c;return Math.max(n,ee)},0);return{left:0,right:Math.ceil(Math.min(r,Math.max(0,n)))}}let s=t+r/2,c=-1/0,ee=1/0;o.forEach(({serie:t,textWidth:n})=>{if(t.sign===-1){let t=s+12+e.dataLabels.offsetX+n;ee=Math.min(ee,i-t);return}let r=s-12-e.dataLabels.offsetX-n;c=Math.max(c,40-r)});let l=0;l=c>ee?(c+ee)/2:Math.min(ee,Math.max(c,0));let te=l*2;return te>=0?{left:Math.ceil(Math.min(r,te)),right:0}:{left:0,right:Math.ceil(Math.min(r,-te))}}),Yn=p(()=>Jn.value.right),Xn=p(()=>Jn.value.left);function Zn(){sn.value+=1}Ze(()=>{typeof document<`u`&&document.fonts&&(document.fonts.ready.then(Zn),document.fonts.addEventListener?.(`loadingdone`,Zn))}),Xe(()=>{typeof document<`u`&&document.fonts&&document.fonts.removeEventListener?.(`loadingdone`,Zn),cn=null,ln=null});let Q=p(()=>{let e=Un.value+Math.abs(I.value.nameLabels.offsetX)+Xn.value+I.value.offsetX,t=Z.value.width-Z.value.padding.right,n=Math.max(0,t-e-Yn.value-I.value.offsetX);return{top:Z.value.padding.top,bottom:Z.value.padding.top+Z.value.height,left:e,right:t,width:n,fullHeight:Z.value.padding.top+Z.value.padding.bottom+Z.value.height}});function Qn(){M.value.length?M.value=[]:q.value.forEach(e=>{M.value.push(e.id)}),fn(`selectLegend`,J.value)}async function $n(e){if(M.value.includes(e))M.value=M.value.filter(t=>t!==e);else{if(M.value.length===q.value.length-1)return;M.value.push(e)}fn(`selectLegend`,J.value)}function er(e){return q.value.length?q.value.find(t=>t.name===e)||(Mn.value&&console.warn(`VueUiHorizontalBar - Series name not found "${e}"`),null):(Mn.value&&console.warn(`VueUiHorizontalBar - There are no series to show.`),null)}function tr(e){let t=er(e);t!==null&&M.value.includes(t.id)&&$n(t.id)}function nr(e){let t=er(e);t!==null&&(M.value.includes(t.id)||$n(t.id))}let $=p(()=>J.value.map(e=>Math.abs(e.value)).reduce((e,t)=>e+t,0));function rr(e,t=!1,n=0){return t?l({v:d(Math.abs(e)/$.value*100),s:`%`,r:n}):Math.abs(e)/$.value}let ir=p(()=>Y.value.some(e=>e.sign===-1)),ar=p(()=>Math.max(...Y.value.map(e=>e.value)));function or(e){let t=e/ar.value;return d(Q.value.width/(ir.value?2:1)*t)}function sr(e){return or(e)+Q.value.left}function cr(e){return Q.value.top+(W.value+X.value)*e+Hn.value[e]*Vn.value}let lr=p(()=>Y.value.map((e,t)=>{let n=or(e.value),r=n<=0?1e-4:n;return{x:d(ir.value?Q.value.left+Q.value.width/2-(e.sign===1?0:r):Q.value.left),y:cr(t),width:d(r),height:X.value<=0?1e-4:X.value}})),ur=p(()=>{let e=new Map(J.value.map(e=>[e.id,e]));return Y.value.map((t,n)=>{if(!t.isChild)return null;let r=e.get(t.parentId);return{y:cr(n)-Vn.value+I.value.parentLabels.fontSize,name:r.name,value:[void 0,NaN,null].includes(r.value)?``:r.sign===1?r.value:-r.value,percentageToTotal:isNaN(r.value/$.value)?``:rr(r.value,!0,I.value.dataLabels.percentage.roundingPercentage),sign:r.sign}})});function dr(e,t){return ur.value[t]}function fr(){return J.value}function pr(e,t){return dr(e,t).name}function mr(e,t){let n=dr(e,t);return xr(n.value,n,t,e.parentSign||e.sign)}let hr=C(null),gr=C(null);function _r({datapoint:e,seriesIndex:t}){fn(`selectDatapoint`,e),F.value.events.datapointClick&&F.value.events.datapointClick({datapoint:e,seriesIndex:t})}function vr({datapoint:e,seriesIndex:t}){F.value.events.datapointLeave&&F.value.events.datapointLeave({datapoint:e,seriesIndex:t}),Jt.value=null,Kt.value=!1,hr.value=null,P.value===t&&(P.value=null)}function yr(e,t,n=`pointer`){dn.value=n,F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:e,datpoint:e,seriesIndex:t}),P.value=t,Jt.value=e,gr.value={datapoint:e,seriesIndex:t,series:q.value,config:F.value},Kt.value=!0,hr.value=e.id;let r=``,i=e.isChild?e.parentName:e.name,a=e.isChild?e.name:``,o=R.value.customFormat,s=ne(o)?o({datapoint:e,series:q.value,config:F.value,seriesIndex:t}):null;typeof s==`string`?qt.value=s:(r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${R.value.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
|
|
2
2
|
<div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="${e.color}"/>${Wt.pattern?`<rect x="0" y="0" height="60" width="60" rx="5" stroke="none" fill="url(#pattern_${A.value}_${e.absoluteIndex})"/>`:``}</svg> ${i}</div>
|
|
3
3
|
${a?`<div>${a}</div>`:``}
|
|
4
4
|
</div>`,R.value.showValue&&(r+=`<div>${F.value.translations.value}: <b>${ue(I.value.dataLabels.value.formatter,e.sign===1?e.value:-e.value,l({p:R.value.prefix,v:e.sign===1?e.value:-e.value,s:R.value.suffix,r:R.value.roundingValue}),{datapoint:e,seriesIndex:t})}</b></div>`),R.value.showPercentage&&(r+=`<div>${F.value.translations.percentageToTotal} : <b>${l({v:Math.abs(e.value)/$.value*100,s:`%`,r:R.value.roundingPercentage})}</b></div>`,e.isChild&&(r+=`<div>${F.value.translations.percentageToSerie}: <b>${l({v:Math.abs(e.value)/Math.abs(e.parentValue)*100,s:`%`,r:R.value.roundingPercentage})}</b></div>`)),qt.value=`<div style="text-align:left">${r}</div>`)}function br({legend:e,index:t}){let n=z.value.legend;return n.showValue?`${e.name}: ${ue(I.value.dataLabels.value.formatter,e.value,l({p:n.prefix,v:e.value,s:n.suffix,r:n.roundingValue}),{datapoint:e,seriesIndex:t})}`:e.name}function xr(e,t,n,r){if(!I.value.dataLabels.value.show)return``;let i=ue(I.value.dataLabels.value.formatter,d(r===-1&&e>=0?-e:e),l({p:I.value.dataLabels.value.prefix,v:d(r===-1&&e>=0?-e:e),s:I.value.dataLabels.value.suffix,r:I.value.dataLabels.value.roundingValue}),{datapoint:t,seriesIndex:n}),a=`(${rr(e,!0,I.value.dataLabels.percentage.roundingPercentage)})`;return`${i}${I.value.dataLabels.percentage.show?` ${a}`:``}`}let Sr=p(()=>({head:[F.value.translations.parentName,F.value.translations.value,F.value.translations.percentageToTotal,F.value.translations.childName,F.value.translations.value,F.value.translations.percentageToSerie,F.value.translations.percentageToTotal],body:Y.value.map(e=>e.isChild?{color:e.isFirstChild?e.color:``,parentName:e.isFirstChild?e.parentName:``,parentValue:e.isFirstChild?e.parentValue:``,percentageToTotal:e.isFirstChild?e.parentValue/$.value:``,childName:e.name,childValue:e.sign===1?e.value:-e.value,childPercentageToParent:Math.abs(e.value)/Math.abs(e.parentValue),childPercentageToTotal:Math.abs(e.value)/$.value}:{color:e.color,parentName:e.name,parentValue:e.sign===1?e.value:-e.value,percentageToTotal:Math.abs(e.value)/$.value,childName:``,childValue:``,childPercentageToParent:``,childPercentageToTotal:``})})),Cr=[{key:`parentName`,type:`name`},{key:`parentValue`,type:`value`},{key:`percentageToTotal`,type:`percentage`},{key:`childName`,type:`name`},{key:`childValue`,type:`value`},{key:`childPercentageToParent`,type:`percentage`},{key:`childPercentageToTotal`,type:`percentage`}];function wr(e,t){let n=e[t.key],r=F.value.table.td,i=[``,NaN,void 0].includes(n);return t.type===`value`?`${E(r.prefix)}${i?``:n.toFixed(r.roundingValue)}${E(r.suffix)}`:t.type===`percentage`?i?``:`${(n*100).toFixed(r.roundingPercentage)}%`:n}function Tr(e=null){let t=[[z.value.title.text],[z.value.title.subtitle.text],[``]],n=Sr.value.head,r=Sr.value.body.map(e=>Cr.map(t=>e[t.key])),i=t.concat([n]).concat(r),a=te(i);e?e(a):pe({csvContent:a,title:z.value.title.text||`vue-ui-vertical-bar`})}let Er=C(!1);function Dr(e){Er.value=e,Yt.value+=1}function Or(){K.value.showTable=!K.value.showTable}Ze(()=>{[`none`,`asc`,`desc`].includes(I.value.sort)||le({componentName:`VueUiVerticalBar`,type:`attributeWrongValue`,property:`style.chart.layout.bars.sort`,key:I.value.sort}),N.value=on[I.value.sort]??0});function kr(){N.value+=1,N.value>2&&(N.value=0)}function Ar(){kr()}function jr(){K.value.showTooltip=!K.value.showTooltip}let Mr=C(!1);function Nr(){Mr.value=!Mr.value}let Pr=ee(j,()=>z.value.title.text),Fr=p(()=>c({config:F,style:z,mutableConfig:K,dialog:Bt,accordion:Re,isFullscreen:Er,parent:j,maxWidth:800,isCursorPointer:V}));nt(()=>K.value.showTable,e=>s(e,F,nn));let{isResponsive:Ir}=je(An,jn);function Lr(){K.value.showTable=!1,rn.value&&rn.value.setTableIconState(!1)}let Rr=p(()=>q.value.map((e,t)=>({...e,shape:`square`,display:`${e.name}: ${ue(I.value.dataLabels.value.formatter,e.value,l({p:z.value.legend.prefix,v:e.value,s:z.value.legend.suffix,r:z.value.legend.roundingValue}),{datapoint:e,seriesIndex:t})}`}))),zr=p(()=>z.value.backgroundColor),Br=p(()=>z.value.legend),Vr=p(()=>z.value.title),Hr=p(()=>Rr.value.map(e=>({...e,name:e.display}))),{isCallbackImaging:Ur,isCallbackSvg:Wr,generateSvg:Gr,onGenerateImage:Kr}=ke({svg:xn,title:Vr,legend:Br,legendItems:Hr,backgroundColor:zr,getSvgCallback:()=>F.value.userOptions.callbacks.svg,generateImage:Dn});function qr(){console.warn(`[autoSize]: this legacy method can be safely removed as it has no impact.`)}async function Jr(){fn(`copyAlt`,{config:F.value,dataset:J.value}),F.value.userOptions.callbacks.altCopy?await Promise.resolve(F.value.userOptions.callbacks.altCopy({config:F.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Yr=C(!1);function Xr(){P.value=null,Yr.value=!0}function Zr(){P.value=null,Kt.value=!1,Yr.value=!1}function Qr(){if(P.value===null)return;let e=Y.value[P.value];e&&vr({datapoint:e,seriesIndex:P.value}),P.value=null,dn.value=`pointer`}function $r(e){if(!xn.value||Mr.value||document.activeElement!==xn.value)return;let t=e.key===`ArrowRight`||e.key===`ArrowDown`,n=e.key===`ArrowLeft`||e.key===`ArrowUp`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;let a=Y.value.length;if(!a)return;if(e.preventDefault(),e.stopPropagation(),i){Qr();return}if(r){if(P.value===null)return;let e=Y.value[P.value];if(!e)return;_r({datapoint:e,seriesIndex:P.value});return}let o=P.value,s=Jt.value?Y.value.findIndex(e=>e.id===Jt.value.id):null;o!==null&&o>=0&&o<a?t?(o+=1,o>=a&&(o=0)):n&&(--o,o<0&&(o=a-1)):s!==null&&s>=0&&s<a?(o=t?s+1:s-1,o>=a&&(o=0),o<0&&(o=a-1)):o=t?0:a-1;let c=Y.value[o];c&&(P.value=o,ei(c),yr(c,o,`keyboard`))}function ei(e){if(!e)return;let t=Y.value.findIndex(t=>t.id===e.id);if(t<0)return;let n=Q.value.right,r=lr.value[t].y;if(!Number.isFinite(n)||!Number.isFinite(r))return;let i=he(n,r,xn.value);i&&(un.value=i)}let ti=p(()=>({head:Sr.value.head,body:Sr.value.body.map(e=>[e.parentName,e.parentValue===``?``:l({v:e.parentValue,r:I.value.dataLabels.value.roundingValue,p:I.value.dataLabels.value.prefix,s:I.value.dataLabels.value.suffix}),e.percentageToTotal===``?``:l({v:e.percentageToTotal*100,r:I.value.dataLabels.percentage.roundingPercentage,s:`%`}),e.childName,e.childValue===``?``:l({v:e.childValue,r:I.value.dataLabels.value.roundingValue,p:I.value.dataLabels.value.prefix,s:I.value.dataLabels.value.suffix}),e.childPercentageToParent===``?``:l({v:e.childPercentageToParent*100,r:I.value.dataLabels.percentage.roundingPercentage,s:`%`}),e.childPercentageToTotal===``?``:l({v:e.childPercentageToTotal*100,r:I.value.dataLabels.percentage.roundingPercentage,s:`%`})]),caption:F.value.a11y.translations.tableCaption,notice:F.value.a11y.translations.tableAvailable}));return Ue({autoSize:qr,getData:fr,getImage:Pr,generatePdf:En,generateCsv:Tr,generateImage:Dn,generateSvg:Gr,hideSeries:nr,showSeries:tr,toggleTable:Or,toggleSort:Ar,toggleTooltip:jr,toggleAnnotator:Nr,toggleFullscreen:Dr,copyAlt:Jr}),(e,s)=>(S(),g(`div`,{class:b(`vue-data-ui-component vue-ui-vertical-bar ${Er.value?`vue-data-ui-wrapper-fullscreen`:``} ${F.value.useCssAnimation?``:`vue-ui-dna`} ${F.value.responsive?`vue-ui-vertical-bar-autosize`:``}`),ref_key:`verticalBarChart`,ref:j,id:`vue-ui-vertical-bar_${A.value}`,style:x(`font-family:${F.value.style.fontFamily};width:100%; text-align:center;background:${z.value.backgroundColor};height:100%`),onMouseenter:s[3]||=()=>D(yn)(!0),onMouseleave:s[4]||=()=>D(yn)(!1)},[_(`p`,{id:`chart-instructions-${A.value}`,class:`sr-only`},E(F.value.a11y.translations.keyboardNavigation),9,ot),F.value.a11y.includeTable&&ti.value.body.length?(S(),m(Ve,{key:0,uid:A.value,head:ti.value.head,body:ti.value.body,caption:ti.value.caption,notice:ti.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):h(``,!0),F.value.userOptions.buttons.annotator?(S(),m(D(Lt),y({key:1},D(a)(F.value.userOptions.annotator),{svgRef:D(xn),backgroundColor:z.value.backgroundColor,color:z.value.color,active:Mr.value,isCursorPointer:V.value,palette:F.value.userOptions.annotatorPalette,onClose:Nr}),We({_:2},[w(D(o),t=>({name:t,fn:O(n=>[T(e.$slots,t,Ye(v(D(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):h(``,!0),On.value?(S(),g(`div`,{key:2,ref_key:`noTitle`,ref:$t,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):h(``,!0),z.value.title.text?(S(),g(`div`,{key:3,ref_key:`chartTitle`,ref:Xt,style:`width:100%;background:transparent;padding-bottom:12px`},[(S(),m(Fe,{key:`title_${en.value}`,config:{title:{cy:`vertical-bar-div-title`,...z.value.title},subtitle:{cy:`vertical-bar-div-subtitle`,...z.value.title.subtitle}}},null,8,[`config`]))],512)):h(``,!0),F.value.userOptions.show&&Gt.value&&(D(bn)||D(vn))?(S(),m(D(Rt),y({ref_key:`userOptionsRef`,ref:rn,backgroundColor:z.value.backgroundColor,color:z.value.color,key:`user_options_${Yt.value}`,isImaging:D(Tn),isPrinting:D(wn),uid:A.value,hasTooltip:F.value.userOptions.buttons.tooltip&&R.value.show,isFullscreen:Er.value,isTooltip:K.value.showTooltip,chartElement:j.value},D(n)(F.value.userOptions,`pdf csv img svg table fullscreen altCopy annotator sort`),{isAnnotation:Mr.value,tableDialog:F.value.table.useDialog,isCursorPointer:V.value,onToggleFullscreen:Dr,onGeneratePdf:D(En),onGenerateCsv:Tr,onGenerateImage:D(Kr),onGenerateSvg:D(Gr),onToggleTable:Or,onToggleSort:Ar,onToggleTooltip:jr,onToggleAnnotator:Nr,onCopyAlt:Jr,style:{visibility:D(bn)?D(vn)?`visible`:`hidden`:`visible`}}),We({_:2},[w(D(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionSort optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:O(n=>[T(e.$slots,t,Ye(v(D(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):h(``,!0),e.$slots.legend&&z.value.legend.show&&z.value.legend.position===`top`?T(e.$slots,`legend`,{legend:q.value},void 0,!0,5):h(``,!0),!e.$slots.legend&&z.value.legend.show&&z.value.legend.position===`top`?(S(),g(`div`,{key:6,ref_key:`chartLegend`,ref:Zt},[(S(),m(Le,{key:`legend_top_${tn.value}`,legendSet:q.value,config:Bn.value,onClickMarker:s[0]||=({legend:e})=>$n(e.id)},We({item:O(({legend:e,index:t})=>[_(`div`,{onClick:t=>$n(e.id),style:x(`opacity:${M.value.includes(e.id)?.5:1}`)},E(br({legend:e,index:t})),13,st)]),legendToggle:O(()=>[q.value.length>2&&z.value.legend.selectAllToggle.show&&!D(hn)?(S(),m(Be,{key:0,backgroundColor:z.value.legend.selectAllToggle.backgroundColor,color:z.value.legend.selectAllToggle.color,fontSize:z.value.legend.fontSize,checked:M.value.length>0,onToggle:Qn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`])):h(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:O(({legend:e,index:t})=>[Ke(Pe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${A.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`]))],512)):h(``,!0),_(`div`,ct,[(S(),g(`svg`,{ref_key:`svgRef`,ref:xn,xmlns:D(me),class:b({"vue-data-ui-fullscreen--on":Er.value,"vue-data-ui-fulscreen--off":!Er.value,"vue-data-ui-no-transition":!D(B)}),viewBox:`0 0 ${H.value} ${U.value}`,style:x(`max-width:100%;overflow:visible;background:transparent;color:${z.value.color}`),tabindex:`0`,"aria-describedby":`chart-instructions-${A.value}`,onFocus:Xr,onBlur:Zr,onKeydown:$r},[_(`g`,ut,[Ke(D(zt)),T(e.$slots,`svg-underlayer`,{svg:{...Z.value,drawingArea:Q.value,isPrintingImg:D(wn)||D(Tn)||D(Ur),isPrintingSvg:D(Wr)}},void 0,!0),e.$slots[`chart-background`]?(S(),g(`foreignObject`,{key:0,x:0,y:0,width:H.value,height:U.value,style:{pointerEvents:`none`}},[T(e.$slots,`chart-background`,{},void 0,!0)],8,dt)):h(``,!0),_(`defs`,null,[(S(!0),g(f,null,w(Y.value,(e,t)=>(S(),m(He,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`vertical_bar_gradient_${A.value}_${t}`,key:`vertical_bar_gradient_${A.value}_${t}`,stops:[[`0%`,e.color,1],[`100%`,D(ie)(D(se)(e.color,.03),100-I.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(S(),g(`g`,ft,[(S(!0),g(f,null,w(Y.value,t=>(S(),g(`defs`,null,[T(e.$slots,`pattern`,y({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${A.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):h(``,!0),I.value.rowColor?(S(!0),g(f,{key:2},w(Y.value,(e,t)=>(S(),g(`g`,{key:`row_${e.id}`},[_(`rect`,{x:0,y:cr(t),width:H.value,height:X.value<=0?1e-4:X.value,fill:I.value.rowColor,rx:I.value.rowRadius,style:{pointerEvents:`none`},class:b({"vue-data-ui-transition":D(B)})},null,10,pt)]))),128)):h(``,!0),(S(!0),g(f,null,w(Y.value,(e,t)=>(S(),g(`g`,{key:`underlayer_${e.id}`},[_(`rect`,y({ref_for:!0},lr.value[t],{fill:I.value.underlayerColor,rx:I.value.borderRadius,class:{"vue-data-ui-transition":D(B)}}),null,16,mt)]))),128)),(S(!0),g(f,null,w(Y.value,(t,n)=>(S(),g(`g`,{key:`barloop_${t.id}`},[_(`rect`,y({ref_for:!0},lr.value[n],{fill:I.value.useGradient?`url(#vertical_bar_gradient_${A.value}_${n})`:D(ie)(t.color,I.value.fillOpacity),rx:I.value.borderRadius,stroke:I.value.useStroke?t.color:`none`,"stroke-width":I.value.useStroke?I.value.strokeWidth:0,class:{"vue-data-ui-transition":D(B)}}),null,16,ht),e.$slots.pattern?(S(),g(`rect`,y({key:0,ref_for:!0},lr.value[n],{fill:`url(#pattern_${A.value}_${t.absoluteIndex})`,rx:I.value.borderRadius,stroke:I.value.useStroke?t.color:`none`,"stroke-width":I.value.useStroke?I.value.strokeWidth:0,class:{"vue-data-ui-transition":D(B)}}),null,16,gt)):h(``,!0),(!t.isChild||t.isLastChild)&&L.value.separators.show&&n!==Y.value.length-1?(S(),g(`path`,{key:1,stroke:L.value.separators.color,"stroke-width":L.value.separators.strokeWidth,"stroke-linecap":`round`,class:b({"vue-data-ui-transition":D(B)}),d:`M${H.value}, ${X.value+W.value/2+cr(n)} ${L.value.separators.fullWidth?0:Q.value.left}, ${X.value+W.value/2+cr(n)}`},null,10,_t)):h(``,!0),ir.value&&L.value.separators.show?(S(),g(`path`,{key:2,stroke:L.value.separators.color,"stroke-width":L.value.separators.strokeWidth,"stroke-linecap":`round`,class:b({"vue-data-ui-transition":D(B)}),d:`M${Q.value.left+Q.value.width/2}, ${Q.value.top} ${Q.value.left+Q.value.width/2}, ${Q.value.bottom}`},null,10,vt)):h(``,!0)]))),128)),_(`g`,null,[(S(!0),g(f,null,w(Y.value,(e,t)=>(S(),g(`g`,{key:`pn_${e.id}`,class:`vue-ui-horizontal-bar-parent-label`},[e.isChild&&e.childIndex===0&&I.value.parentLabels.show?(S(),g(`rect`,{key:0,class:b([`vue-ui-horizontal-bar-parent-marker`,{"vue-data-ui-transition":D(B)}]),x:2,y:dr(e,t).y-I.value.parentLabels.fontSize/1.5,height:I.value.parentLabels.fontSize/1.5,width:I.value.parentLabels.fontSize/1.5,rx:1,fill:e.color},null,10,yt)):h(``,!0),e.isChild&&e.childIndex===0&&I.value.parentLabels.show?(S(),g(`text`,{key:1,class:b({"vue-data-ui-transition":D(B)}),transform:`translate(${I.value.parentLabels.offsetX+I.value.parentLabels.fontSize}, ${dr(e,t).y})`,"font-size":I.value.parentLabels.fontSize,fill:I.value.parentLabels.color,"font-weight":I.value.parentLabels.bold?`bold`:`normal`,"text-anchor":`start`,innerHTML:D(re)({content:`${pr(e,t)}`,fontSize:I.value.parentLabels.fontSize,fill:L.value.bars.parentLabels.color,x:0,y:0,translateY:!1})},null,10,bt)):h(``,!0),e.isChild&&e.childIndex===0&&I.value.parentLabels.show?(S(),g(`text`,{key:2,class:b({"vue-data-ui-transition":D(B)}),transform:`translate(${I.value.parentLabels.offsetX+I.value.parentLabels.fontSize}, ${dr(e,t).y+D(ge)(pr(e,t))*I.value.parentLabels.fontSize*1.1})`,"font-size":I.value.parentLabels.fontSize,fill:I.value.parentLabels.color,"font-weight":I.value.dataLabels.bold?`bold`:`normal`,"text-anchor":`start`},E(mr(e,t)),11,xt)):h(``,!0)]))),128))]),_(`g`,{ref_key:`childLabels`,ref:an},[(S(!0),g(f,null,w(Rn.value,(e,t)=>(S(),g(`g`,{key:`cl_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[(e.isChild||!e.hasChildren)&&I.value.nameLabels.show?(S(),g(`text`,{key:0,"text-anchor":`start`,class:b({"vue-data-ui-transition":D(B)}),transform:`translate(${Math.abs(I.value.nameLabels.offsetX)}, ${D(d)(Q.value.top+(W.value+X.value)*t+X.value/2+I.value.nameLabels.fontSize/2+Hn.value[t]*Vn.value)})`,"font-size":I.value.nameLabels.fontSize,fill:`transparent`,"font-weight":I.value.nameLabels.bold?`bold`:`normal`,style:{"user-select":`none`},innerHTML:D(re)({content:e.name,fontSize:I.value.nameLabels.fontSize,fill:`transparent`,x:0,y:0,translateY:!0})},null,10,St)):h(``,!0)]))),128))],512),_(`g`,null,[(S(!0),g(f,null,w(Y.value,(e,t)=>(S(),g(`g`,{key:`vislab_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[(e.isChild||!e.hasChildren)&&I.value.nameLabels.show?(S(),g(`text`,{key:0,class:b({"vue-data-ui-transition":D(B)}),"text-anchor":`end`,transform:`translate(${Q.value.left+I.value.nameLabels.offsetX-6}, ${Q.value.top+(W.value+X.value)*t+X.value/2+I.value.nameLabels.fontSize/3+Hn.value[t]*Vn.value})`,"font-size":I.value.nameLabels.fontSize,fill:I.value.nameLabels.color,"font-weight":I.value.nameLabels.bold?`bold`:`normal`,innerHTML:D(re)({content:e.name,fontSize:I.value.nameLabels.fontSize,fill:L.value.bars.nameLabels.color,x:0,y:0,translateY:!0})},null,10,Ct)):h(``,!0)]))),128))]),_(`g`,null,[(S(!0),g(f,null,w(Y.value,(e,t)=>(S(),g(`g`,{key:`sdl_${e.id}`,class:`vue-ui-horizontal-bar-child-label`},[_(`text`,{class:b({"vue-data-ui-transition":D(B)}),transform:`translate(${ir.value?Q.value.left+Q.value.width/2+(e.sign===1?-12:12)+(e.sign===1?-L.value.bars.dataLabels.offsetX:L.value.bars.dataLabels.offsetX):Math.min(sr(e.value)+3+z.value.layout.bars.dataLabels.offsetX,Q.value.right-2)},${Q.value.top+(W.value+X.value)*t+X.value/2+Hn.value[t]*Vn.value+I.value.dataLabels.fontSize/3})`,"text-anchor":!ir.value||e.sign===-1?`start`:`end`,"font-size":I.value.dataLabels.fontSize,fill:I.value.dataLabels.color,"font-weight":I.value.dataLabels.bold?`bold`:`normal`},E(xr(e.value,e,t,e.sign)),11,wt)]))),128))]),(S(!0),g(f,null,w(Y.value,(e,t)=>(S(),g(`g`,null,[_(`rect`,{x:0,y:Q.value.top+(W.value+X.value)*t-W.value/2+Hn.value[t]*Vn.value,width:H.value,height:X.value+W.value<=0?1e-4:X.value+W.value,fill:hr.value===e.id?D(ie)(L.value.highlighter.color,L.value.highlighter.opacity):`transparent`,onMouseenter:n=>yr(e,t,`pointer`),onMouseleave:n=>vr({datapoint:e,seriesIndex:t}),onClick:n=>_r({datapoint:e,seriesIndex:t})},null,40,Tt)]))),256)),T(e.$slots,`svg`,{svg:{...Z.value,drawingArea:Q.value,isPrintingImg:D(wn)||D(Tn)||D(Ur),isPrintingSvg:D(Wr)}},void 0,!0)])],46,lt)),e.$slots.hint?(S(),g(`div`,Et,[T(e.$slots,`hint`,Ye(v({hint:F.value.a11y.translations.keyboardNavigation,isVisible:Yr.value})),void 0,!0)])):h(``,!0)]),e.$slots.watermark?(S(),g(`div`,Dt,[T(e.$slots,`watermark`,Ye(v({isPrinting:D(wn)||D(Tn)||D(Ur)||D(Wr)})),void 0,!0)])):h(``,!0),e.$slots.legend&&z.value.legend.show&&z.value.legend.position===`bottom`?T(e.$slots,`legend`,{legend:q.value},void 0,!0,8):h(``,!0),!e.$slots.legend&&z.value.legend.show&&z.value.legend.position===`bottom`?(S(),g(`div`,{key:9,ref_key:`chartLegend`,ref:Zt},[(S(),m(Le,{key:`legend_bottom_${tn.value}`,legendSet:q.value,config:Bn.value,isCursorPointer:V.value,onClickMarker:s[1]||=({legend:e})=>$n(e.id)},We({item:O(({legend:e,index:t})=>[_(`div`,{onClick:t=>$n(e.id),style:x(`opacity:${M.value.includes(e.id)?.5:1}`)},E(br({legend:e,index:t})),13,Ot)]),legendToggle:O(()=>[q.value.length>2&&z.value.legend.selectAllToggle.show&&!D(hn)?(S(),m(Be,{key:0,backgroundColor:z.value.legend.selectAllToggle.backgroundColor,color:z.value.legend.selectAllToggle.color,fontSize:z.value.legend.fontSize,checked:M.value.length>0,isCursorPointer:V.value,onToggle:Qn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):h(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:O(({legend:e,index:t})=>[Ke(Pe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${A.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`]))],512)):h(``,!0),e.$slots.source?(S(),g(`div`,{key:10,ref_key:`source`,ref:Qt,dir:`auto`},[T(e.$slots,`source`,{},void 0,!0)],512)):h(``,!0),Ke(D(Ft),{teleportTo:R.value.teleportTo,show:K.value.showTooltip&&Kt.value&&M.value.length<k.dataset.length,backgroundColor:R.value.backgroundColor,color:R.value.color,borderRadius:R.value.borderRadius,borderColor:R.value.borderColor,borderWidth:R.value.borderWidth,fontSize:R.value.fontSize,backgroundOpacity:R.value.backgroundOpacity,position:R.value.position,offsetX:R.value.offsetX,offsetY:R.value.offsetY,parent:j.value,content:qt.value,isFullscreen:Er.value,isCustom:R.value.customFormat&&typeof R.value.customFormat==`function`,smooth:R.value.smooth,backdropFilter:R.value.backdropFilter,smoothForce:R.value.smoothForce,smoothSnapThreshold:R.value.smoothSnapThreshold,isA11yMode:dn.value===`keyboard`,a11yPosition:un.value},{"tooltip-before":O(()=>[T(e.$slots,`tooltip-before`,Ye(v({...gr.value})),void 0,!0)]),tooltip:O(()=>[T(e.$slots,`tooltip`,Ye(v({...gr.value})),void 0,!0)]),"tooltip-after":O(()=>[T(e.$slots,`tooltip-after`,Ye(v({...gr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Gt.value&&F.value.userOptions.buttons.table?(S(),m(Qe(Fr.value.component),y({key:11},Fr.value.props,{ref_key:`tableUnit`,ref:nn,onClose:Lr}),We({content:O(()=>[_(`div`,{ref_key:`tableContainer`,ref:An,class:`vue-ui-vertical-bar-table atom-data-table`,style:x(`${F.value.table.useDialog?``:`max-height: 300px; margin-top: 24px`}`)},[_(`div`,kt,[F.value.table.useDialog?h(``,!0):(S(),g(`div`,{key:0,role:`button`,tabindex:`0`,style:x(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${V.value?`pointer`:`default`}; background:${F.value.table.th.backgroundColor};`),onClick:Lr,onKeypress:rt(Lr,[`enter`])},[Ke(D(It),{name:`close`,stroke:F.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),_(`div`,{style:{width:`100%`,"container-type":`inline-size`},class:b({"vue-ui-responsive":D(Ir)})},[_(`table`,At,[F.value.table.useDialog?h(``,!0):(S(),g(`caption`,{key:0,style:x({backgroundColor:F.value.table.th.backgroundColor,color:F.value.table.th.color,outline:F.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Ge(E(z.value.title.text)+` `,1),z.value.title.subtitle.text?(S(),g(`span`,jt,E(z.value.title.subtitle.text),1)):h(``,!0)],4)),_(`thead`,null,[_(`tr`,{role:`row`,style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color}`)},[(S(!0),g(f,null,w(Sr.value.head,e=>(S(),g(`th`,{style:x(`outline:${F.value.table.th.outline}`)},[_(`div`,Mt,E(e),1)],4))),256))],4),_(`tr`,null,[_(`th`,{style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color};outline:${F.value.table.th.outline}`)},null,4),_(`th`,{style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color};outline:${F.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},` ∑ `+E(F.value.table.td.prefix)+E(isNaN($.value)?``:$.value.toFixed(F.value.table.td.roundingValue))+E(F.value.table.td.suffix),5),_(`th`,{style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color};outline:${F.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},` 100% `,4),_(`th`,{style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color};outline:${F.value.table.th.outline}`)},null,4),_(`th`,{style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color};outline:${F.value.table.th.outline}`)},null,4),_(`th`,{style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color};outline:${F.value.table.th.outline}`)},null,4),_(`th`,{style:x(`background:${F.value.table.th.backgroundColor};color:${F.value.table.th.color};outline:${F.value.table.th.outline}`)},null,4)])]),_(`tbody`,null,[(S(!0),g(f,null,w(Sr.value.body,(e,t)=>(S(),g(`tr`,{class:b({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:x(`background:${F.value.table.td.backgroundColor};color:${F.value.table.td.color}`)},[(S(),g(f,null,w(Cr,(t,n)=>_(`td`,{key:t.key,class:`vue-ui-data-table__tbody__td`,style:x(n===0?`outline:${F.value.table.td.outline};font-variant-numeric: tabular-nums;`:`outline:${F.value.table.td.outline}`),"data-cell":Sr.value.head[n]??``},[_(`div`,Pt,[n===0?(S(),g(f,{key:0},[e.color?(S(),g(`span`,{key:0,style:x(`color:${e.color};margin-right:3px`)},`⬤`,4)):h(``,!0),_(`span`,null,E(e.parentName),1)],64)):(S(),g(f,{key:1},[Ge(E(wr(e,t)),1)],64))])],12,Nt)),64))],6))),256))])])],2)])],4)]),_:2},[F.value.table.useDialog?{name:`title`,fn:O(()=>[Ge(E(Fr.value.title),1)]),key:`0`}:void 0,F.value.table.useDialog?{name:`actions`,fn:O(()=>[_(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[2]||=e=>Tr(F.value.userOptions.callbacks.csv),style:x({cursor:V.value?`pointer`:`default`})},[Ke(D(It),{name:`fileCsv`,stroke:Fr.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):h(``,!0),T(e.$slots,`skeleton`,{},()=>[D(hn)?(S(),m(ze,{key:0})):h(``,!0)],!0)],46,at))}},[[`__scopeId`,`data-v-8c7e8645`]]);export{it as n,Ft as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{t as n}from"./useNestedProp-DnGoh-XS.js";import{$ as r,X as i,i as a}from"./lib-rPeBMZrn.js";import{t as o}from"./useConfig-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{t as n}from"./useNestedProp-DnGoh-XS.js";import{$ as r,X as i,i as a}from"./lib-rPeBMZrn.js";import{t as o}from"./useConfig-CXhXxWjB.js";import{n as s,t as c}from"./useHints-C-TwxM0Y.js";import{t as l}from"./usePrefersMotion-XLHwega2.js";import{Fragment as u,computed as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createTextVNode as h,createVNode as g,defineAsyncComponent as _,normalizeClass as v,normalizeStyle as y,onMounted as b,openBlock as x,ref as S,renderSlot as C,toDisplayString as w,unref as T,useSlots as E,watch as D}from"vue";var O=/* @__PURE__ */ e({default:()=>M}),k=[`aria-labelledby`],A=[`id`],j=[`aria-label`],M={__name:`vue-ui-kpi`,props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(e){let O=_(()=>import(`./vue-ui-digits-DG2jj43S.js`).then(e=>e.n)),{vue_ui_kpi:M}=o(),N=l(),P=e,F=d({get:()=>z(),set:e=>e});s({config:()=>F.value,dataset:()=>P.dataset,component:`VueUiKpi`,rules:[c.noHint]});let I=E(),L=d(()=>F.value.debug),R=S(i());b(()=>{I[`chart-background`]&&L.value&&console.warn(`VueUiKpi does not support the #chart-background slot.`)});function z(){return n({userConfig:P.config,defaultConfig:M})}D(()=>P.config,e=>{F.value=z(),W()},{deep:!0});let B=S((P.dataset,P.dataset)),V=S(F.value.useAnimation?F.value.animationValueStart:B.value),H=t(),U=e=>{if(H.cancel(),H.isDisposed())return;let t=F.value.animationFrames,n=Math.abs(e-V.value)/t;if(!F.value.useAnimation||N.value||!Number.isFinite(n)||n<=0){V.value=e;return}function r(){V.value<e?V.value=Math.min(V.value+n,e):V.value>e&&(V.value=Math.max(V.value-n,e)),V.value!==e&&H.request(r)}r()};b(()=>{W()});function W(){H.cancel(),F.value.useAnimation&&!N.value?(V.value=F.value.animationValueStart,U(P.dataset)):V.value=P.dataset}return D(()=>P.dataset,e=>{F.value.useAnimation&&!N.value?U(e):(H.cancel(),V.value=e)}),D(N,e=>{e&&(H.cancel(),V.value=P.dataset)}),(t,n)=>(x(),p(`div`,{class:v(`vue-data-ui-component vue-ui-kpi ${F.value.layoutClass}`),style:y(`background:${F.value.backgroundColor}; ${F.value.layoutCss}`),"aria-labelledby":`kpi-title-${R.value}`},[F.value.title||t.$slots.title?(x(),p(`div`,{key:0,class:v(`vue-ui-kpi-title ${F.value.titleClass}`),style:y(`font-family: ${F.value.fontFamily}; font-size:${F.value.titleFontSize}px; color:${F.value.titleColor}; font-weight:${F.value.titleBold?`bold`:`normal`}; ${F.value.titleCss}`),id:`kpi-title-${R.value}`},[C(t.$slots,`title`,{comment:e.dataset}),h(` `+w(F.value.title),1)],14,A)):f(``,!0),C(t.$slots,`comment-before`,{comment:e.dataset}),m(`div`,{class:v(`vue-ui-kpi-value ${F.value.valueClass}`),style:y(`font-family: ${F.value.fontFamily}; font-size:${F.value.valueFontSize}px; color:${F.value.valueColor}; font-weight:${F.value.valueBold?`bold`:`normal`}; ${F.value.valueCss}`),role:`status`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":V.value.toFixed(F.value.valueRounding)},[C(t.$slots,`value`,{comment:e.dataset}),F.value.analogDigits.show?(x(),p(`div`,{key:0,style:y({height:F.value.analogDigits.height+`px`})},[g(T(O),{dataset:Number(V.value.toFixed(F.value.valueRounding)),config:{backgroundColor:F.value.backgroundColor,digits:{color:F.value.analogDigits.color,skeletonColor:F.value.analogDigits.skeletonColor}}},null,8,[`dataset`,`config`])],4)):(x(),p(u,{key:1},[h(w(T(a)(F.value.formatter,V.value,T(r)({p:F.value.prefix,v:V.value,s:F.value.suffix,r:F.value.valueRounding}))),1)],64))],14,j),C(t.$slots,`comment-after`,{comment:e.dataset})],14,k))}};export{O as n,M as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./Shape-CRe8woTu.js";import{t as n}from"./vue_ui_label-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./Shape-CRe8woTu.js";import{t as n}from"./vue_ui_label-ByQC3K-q.js";import{t as r}from"./useConfig-CXhXxWjB.js";import{t as i}from"./useNestedProp-DnGoh-XS.js";import{t as a}from"./useThemeCheck-BKNRbGeC.js";import{X as o,kt as s,x as c}from"./lib-rPeBMZrn.js";import{t as l}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as ee,getCurrentInstance as te,guardReactiveProps as ne,nextTick as h,normalizeClass as re,normalizeProps as ie,normalizeStyle as ae,onBeforeUnmount as oe,onMounted as se,openBlock as g,ref as _,renderList as ce,renderSlot as le,toDisplayString as ue,unref as de,useTemplateRef as v,watch as fe,withModifiers as pe}from"vue";var me=/* @__PURE__ */ e({default:()=>D}),he=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ge=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],_e=[`id`,`data-position`,`data-overflow`,`data-overlap`,`data-target-x`,`data-target-y`,`data-box-position-x`,`data-box-position-y`,`data-link-length`,`data-box-show`,`data-box-max-width`,`data-box-padding-top`,`data-box-padding-right`,`data-box-padding-bottom`,`data-box-padding-left`,`data-drag-enabled`,`data-drag-handle-position`,`data-drag-handle-size`],ve=[`x`,`y`,`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`],ye=[`x`,`y`,`width`,`height`,`rx`,`aria-label`],be=[`font-size`,`font-weight`,`text-anchor`,`fill`],xe=[`x`,`y`],Se=[`font-size`,`font-weight`,`text-anchor`,`fill`],Ce=[`x`,`y`],we=[`aria-label`],Te=[`x`,`y`,`width`,`height`],Ee=[`x`,`y`,`width`,`height`,`rx`],De=[`d`,`stroke`,`stroke-width`],Oe=[`d`,`stroke`,`stroke-width`,`opacity`],ke=8,y=4,Ae=12,je=24,Me=1,Ne=10,b=`__vueUiLabelLayoutOrder`,Pe=`__vueUiLabelNextLayoutOrder`,x=`__vueUiLabelLayoutRaf`,Fe=`__vueUiLabelSetLayoutRect`,Ie=`__vueUiLabelMeasureElement`,Le=`__vueUiLabelEmitDragEnd`,S=`__vueUiLabelPersistedOffset`,C=`__vueUiLabelDragRequestedOffset`,w=`__vueUiLabelDragging`,Re=`__vueUiLabelDragPriority`,ze=`__vueUiLabelNextDragPriority`,Be=`__vueUiLabelLastLayoutRect`,T=`__vueUiLabelLastLayoutOffset`,E=`__vueUiLabelDisplacedLabels`,D=/*#__PURE__*/ l({__name:`vue-ui-label`,props:{dataset:{type:Object,default(){return{x:null,y:null,position:{x:null,y:null}}}},config:{type:Object,default(){return{}}}},emits:[`dragStart`,`drag`,`dragEnd`,`click`,`mouseenter`,`mouseleave`,`focus`,`blur`],setup(e,{expose:l,emit:me}){let D=e,O=me,{vue_ui_label:Ve}=r(),{isThemeValid:He,warnInvalidTheme:Ue}=a();function We(){let e=i({userConfig:D.config,defaultConfig:Ve}),t={},r=e.theme;return r?He.value(e)?t=i({userConfig:n[r]||D.config,defaultConfig:e}):(Ue(e),t=e):t=e,t}let k=d(()=>We()),Ge=te(),Ke=o(),qe=v(`wrapperRef`),A=v(`labelRef`),Je=v(`contentRef`),Ye=v(`boxRef`),Xe=v(`titleTextRef`),Ze=v(`contentTextRef`),j=_(null),M=_(null),N=_(null),P=_({x:0,y:0}),Qe=_(!1),F=_(!1),$e=_(`pointer`),et=d(()=>k.value.title.fontSize),tt=d(()=>k.value.title.lineHeight),nt=d(()=>k.value.content.fontSize),rt=d(()=>k.value.content.lineHeight),it=d(()=>k.value.title.gap),at=d(()=>k.value.drag.handleWidth),ot=d(()=>k.value.collisionGap),st=null,ct=null,I=null,L={inputType:null,touchId:null,startPointer:null,startOffset:null,lastRequestedOffset:null},lt=d(()=>({x:D.dataset?.x??null,y:D.dataset?.y??null})),R=d(()=>s(lt.value.x)&&s(lt.value.y)),z=d(()=>Number(lt.value.x)),B=d(()=>Number(lt.value.y)),V=d(()=>k.value.link),H=d(()=>k.value.box),ut=d(()=>k.value.drag),U=d(()=>k.value.title.marker),dt=d(()=>k.value.overlap===!0),W=d(()=>ut.value?.enable===!0),ft=d(()=>!!(Ge?.vnode?.props??{}).onClick),pt=d(()=>ft.value),mt=d(()=>[String(k.value.title?.text??``).trim(),String(k.value.content?.text??``).trim()].filter(Boolean).join(`, `)||`Label`),ht=d(()=>`Move ${mt.value}`),gt=`label_${Ke}_drag_instructions`,_t=d(()=>k.value.a11y.translations.keyboardNavigation),vt=d(()=>s(ut.value?.iconSize)?Math.max(0,Number(ut.value.iconSize)):0),yt=d(()=>vt.value*.15),bt=d(()=>{let e=ut.value?.handlePosition;return[`left`,`right`,`top`,`bottom`].includes(e)?e:`left`}),xt=d(()=>{let e=D.dataset?.position;return!e||!s(e.x)||!s(e.y)?null:{x:Number(e.x),y:Number(e.y)}}),St=d(()=>Qe.value?null:xt.value),Ct=d(()=>s(V.value.length)?Math.max(0,Number(V.value.length)):ke),wt=d(()=>Hn(k.value.title.textAlign)),Tt=d(()=>Hn(k.value.content.textAlign)),Et=d(()=>Un(wt.value)),Dt=d(()=>Un(Tt.value)),Ot=d(()=>U.value?.color!==null&&U.value?.color!==void 0&&String(k.value.title.text??``)!==``),kt=d(()=>Ot.value&&s(U.value?.size)?Math.max(0,Number(U.value.size)):0),At=d(()=>kt.value/2),jt=d(()=>U.value?.beforeText!==!1),Mt=d(()=>Ot.value&&kt.value>0?6:0),Nt=d(()=>kt.value>0?kt.value+Mt.value:0),G=d(()=>{let e=H.value.padding??{};return{top:s(e.top)?Math.max(0,Number(e.top)):0,right:s(e.right)?Math.max(0,Number(e.right)):0,bottom:s(e.bottom)?Math.max(0,Number(e.bottom)):0,left:s(e.left)?Math.max(0,Number(e.left)):0}}),Pt=d(()=>s(H.value.borderWidth)?Math.max(0,Number(H.value.borderWidth)):0),Ft=d(()=>s(H.value.borderRadius)?Math.max(0,Number(H.value.borderRadius)):0),K=d(()=>s(H.value.maxWidth)?Math.max(0,Number(H.value.maxWidth)):null),It=d(()=>W.value&&H.value.show?at.value:0),Lt=d(()=>[`left`,`right`].includes(bt.value)),Rt=d(()=>{if(!H.value.show||!s(K.value)||K.value<=0)return null;let e=Lt.value?It.value:0;return Math.max(1,K.value-G.value.left-G.value.right-e)}),zt=d(()=>Rt.value?Math.max(1,Rt.value-Nt.value):null),q=d(()=>{if(!H.value.show||!N.value)return null;let e=Pt.value/2,t=Math.max(0,N.value.width-Pt.value),n=Math.max(0,N.value.height-Pt.value);return{x:N.value.x+e,y:N.value.y+e,width:t,height:n,rx:Math.min(Ft.value,t/2,n/2)}}),Bt=d(()=>{if(!W.value||!q.value)return null;let e=bt.value,t=[`left`,`right`].includes(e),n=Math.min(at.value,Math.max(0,t?q.value.width:q.value.height));if(n<=0||q.value.width<=0||q.value.height<=0)return null;let r=q.value.x,i=q.value.y,a=q.value.width,o=q.value.height,s=``,c=``;if(e===`left`||e===`right`){a=n,r=e===`left`?q.value.x:q.value.x+q.value.width-n;let t=e===`left`?r+n:r,l=r+n/2,u=i+o/2;s=`
|
|
2
2
|
M ${t} ${i}
|
|
3
3
|
V ${i+o}
|
|
4
4
|
`;let d=vt.value,f=yt.value/2,p=Math.max(0,d/2-f),m=d*.14;c=[-.7,0,.7].flatMap(e=>{let t=u+p*e;return[`M ${l-m} ${t} h 0`,`M ${l+m} ${t} h 0`]}).join(` `)}else{o=n,i=e===`top`?q.value.y:q.value.y+q.value.height-n;let t=e===`top`?i+n:i,l=r+a/2,u=i+n/2;s=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-DnGoh-XS.js";import{t as n}from"./lib-rPeBMZrn.js";import{n as r,t as i}from"./useHints-C-TwxM0Y.js";import{t as a}from"./useConfig-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-DnGoh-XS.js";import{t as n}from"./lib-rPeBMZrn.js";import{n as r,t as i}from"./useHints-C-TwxM0Y.js";import{t as a}from"./useConfig-CXhXxWjB.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,normalizeStyle as d,openBlock as f,ref as p,unref as m,useCssVars as h}from"vue";var g=/* @__PURE__ */ e({default:()=>E}),_=[`xmlns`,`viewBox`],v={key:0},y=[`stroke`],b=[`stroke`],x=[`stroke`],S={key:1},C=[`stroke`],w={key:2},T=[`stroke`],E=/*#__PURE__*/ o({__name:`vue-ui-mini-loader`,props:{config:{type:Object,default(){return{}}}},setup(e){h(e=>({v5fadbcf2:j.value,v488061db:M.value,v2e2d4bba:N.value}));let{vue_ui_mini_loader:o}=a(),g=e,E=s(()=>t({userConfig:g.config,defaultConfig:o}));r({config:()=>E.value,dataset:()=>[],component:`VueUiMiniLoader`,rules:[i.noHint]});let D=p({onion:`-10 -10 84 84`,line:`-10 -10 112 84`,bar:`-10 -10 106 84`}),O=s(()=>({gutter:`stroke:${E.value.line.gutterColor};opacity:${E.value.line.gutterOpacity};`,gutterBlur:`filter:blur(${E.value.line.gutterBlur}px);`})),k=s(()=>({gutter:`stroke:${E.value.bar.gutterColor};opacity:${E.value.bar.gutterOpacity};`,gutterBlur:`filter:blur(${E.value.bar.gutterBlur}px);`})),A=s(()=>({gutter:`stroke:${E.value.onion.gutterColor};opacity:${E.value.onion.gutterOpacity};`,gutterBlur:`filter:blur(${E.value.onion.gutterBlur}px);`})),j=s(()=>`blur(${E.value.onion.trackBlur}px) hue-rotate(${E.value.onion.trackHueRotate}deg)`),M=s(()=>`blur(${E.value.line.trackBlur}px) hue-rotate(${E.value.line.trackHueRotate}deg)`),N=s(()=>`blur(${E.value.bar.trackBlur}px) hue-rotate(${E.value.bar.trackHueRotate}deg)`);return(e,t)=>(f(),l(`svg`,{class:`vue-data-ui-component vue-ui-mini-loader`,xmlns:m(n),viewBox:D.value[E.value.type],style:{background:`transparent`},width:`100%`},[E.value.type===`onion`?(f(),l(`g`,v,[u(`path`,{d:`M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(A.value.gutter+A.value.gutterBlur)},null,4),u(`path`,{d:`M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(A.value.gutter+A.value.gutterBlur)},null,4),u(`path`,{d:`M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(A.value.gutter+A.value.gutterBlur)},null,4),u(`path`,{d:`M 3 32 C 3 45 12 62 32 62 A 1 1 0 0 0 32 3`,stroke:E.value.onion.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`onion-animated`},null,8,y),u(`path`,{d:`M 13 32 C 13 39 19 52 32 52 A 1 1 0 0 0 32 13`,stroke:E.value.onion.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`onion-animated`},null,8,b),u(`path`,{d:`M 23 32 C 23 37 26.5 41 32 41 A 1 1 0 0 0 32 25`,stroke:E.value.onion.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`onion-animated`},null,8,x)])):c(``,!0),E.value.type===`line`?(f(),l(`g`,S,[u(`path`,{d:`M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(O.value.gutter+O.value.gutterBlur)},null,4),u(`path`,{d:`M 3 62 C 6 57 6 48 11 45 C 16 44 17 53 22 52 C 27 49 25 32 30 31 C 34 29 37 47 42 47 C 46 47 45 38 49 36 C 53 34 56 45 61 45 C 66 45 65 24 69 24 C 73 22 75 35 79 34 C 84 34 83 11 91 5`,stroke:E.value.line.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`line-animated`},null,8,C)])):c(``,!0),E.value.type===`bar`?(f(),l(`g`,w,[u(`path`,{d:`M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5`,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,style:d(k.value.gutter+k.value.gutterBlur)},null,4),u(`path`,{d:`M 3 62 L 3 44 M 12 62 L 12 49 M 21 62 L 21 37 M 30 62 L 30 29 M 39 62 L 39 43 M 48 62 L 48 16 M 57 62 L 57 24 M 66 62 L 66 35 M 75 62 L 75 20 M 84 62 L 84 5`,stroke:E.value.bar.trackColor,"stroke-width":`4`,fill:`none`,"stroke-linecap":`round`,class:`bar-animated`},null,8,T)])):c(``,!0)],8,_))}},[[`__scopeId`,`data-v-5266752a`]]);export{g as n,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as ee,r as i,t as a}from"./annotationSlots-OLiW25XN.js";import{n as o}from"./annotationViewport-X8fvs7pz.js";import{n as te,t as s}from"./tableIntegration-CNoJ1CIY.js";import{t as ne}from"./chartImage-DPGnEuYM.js";import{n as c}from"./resolveChartConfig-0IvbmIE_.js";import{D as re,Dt as ie,Ft as ae,Ht as oe,M as se,S as ce,X as le,Zt as ue,at as de,et as fe,in as pe,nt as me,pt as he,t as ge,w as _e,zt as ve}from"./lib-rPeBMZrn.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./useConfig-CBXrYhMI.js";import{t as Se}from"./useLoading-BwiplGDB.js";import{t as Ce}from"./usePrinter-DVf3YcG5.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./vue_ui_molecule-VokyVu8q.js";import{t as Oe}from"./usePanZoom-CTGk8aJt.js";import{t as ke}from"./BaseScanner-m6QR9rwD.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as Me,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as m,createTextVNode as Ne,createVNode as h,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as v,nextTick as y,normalizeClass as Pe,normalizeProps as b,normalizeStyle as x,onMounted as Fe,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as Ie,toDisplayString as E,toRefs as Le,unref as D,useCssVars as Re,watch as O,withCtx as k}from"vue";var ze=/* @__PURE__ */ e({default:()=>Je}),Be=[`id`],Ve={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},He={key:2,style:`width:100%;background:transparent;`},Ue=[`xmlns`,`viewBox`],We=[`width`,`height`],Ge={key:4,class:`vue-data-ui-watermark`},Ke={key:5,"data-dom-to-png-ignore":``,class:`reset-wrapper`},qe={key:6,ref:`source`,dir:`auto`},Je=/*#__PURE__*/ je({__name:`vue-ui-molecule`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectNode`,`copyAlt`],setup(e,{expose:je,emit:ze}){Re(e=>({v452ef5ad:ln.value}));let Je=g(()=>import(`./Title-BliHuXfT.js`).then(e=>e.t)),Ye=g(()=>import(`./Tooltip-B432XpvC.js`)),Xe=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ze=g(()=>import(`./vue-ui-accordion-CV2dxsXB.js`).then(e=>e.n)),Qe=g(()=>import(`./DataTable-KeuZB1JM.js`)),$e=g(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),et=g(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),tt=g(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),nt=g(()=>import(`./RecursiveLinks-CZtG6uWg.js`)),rt=g(()=>import(`./RecursiveLabels-B0d04xSj.js`)),it=g(()=>import(`./RecursiveCircles-BftI1kwF.js`)),at=g(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_molecule:ot}=xe(),A=e,st=ze,ct=l(()=>!!A.dataset&&A.dataset.length);Fe(()=>{ut()});let lt=l(()=>P.value.debug);function ut(){ve(A.dataset)&&de({componentName:`VueUiMolecule`,type:`dataset`,debug:lt.value})}let dt=C(le()),j=C(!1),M=C(``),N=C(null),ft=C(0),pt=C(0),mt=C(0),ht=C(null),gt=C(null),P=C(B()),F=l(()=>P.value.style.chart.tooltip),I=l(()=>P.value.style.chart),L=l(()=>P.value.userOptions);ye({config:()=>P.value,dataset:()=>A.dataset,component:`VueUiMolecule`,rules:[be.emptyArray,{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length===0,message:[`👀 There are no children nodes attached to the root node. Consider:`,``,`▶️ Adding children nodes to the root node.`]},{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length>8,message:[`👀 The number of children nodes > 8, some nodes might overlap. Consider:`,``,`▶️ Grouping data into broader categories.`]}]});let R=l(()=>P.value.userOptions.useCursorPointer),_t=l(()=>pe({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#6A6A6A`},links:{stroke:`#6A6A6A80`}}}},userConfig:P.value.skeletonConfig??{}})),{loading:vt,FINAL_DATASET:yt}=Se({...Le(A),FINAL_CONFIG:P,prepareConfig:B,skeletonDataset:A.config?.skeletonDataset??[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]}]}],skeletonConfig:pe({defaultConfig:P.value,userConfig:_t.value})}),{userOptionsVisible:bt,setUserOptionsVisibility:xt,keepUserOptionState:St}=Te({config:P.value}),{svgRef:z}=Ee({config:I.value.title});function B(){return c(A.config,ot,De)}let Ct=ue(A.config);O(()=>A.config,e=>{let t=ue(e),n=t!==Ct;Ct=t;let r=B();n?(P.value=r,bt.value=!P.value.userOptions.showOnChartHover,ut(),pt.value+=1,mt.value+=1,U.value.showTable=P.value.table.show,U.value.showTooltip=F.value.show,U.value.showZoom=I.value.zoom.show):(P.value.style.chart.tooltip=r.style.chart.tooltip,U.value.showTooltip=P.value.style.chart.tooltip.show)},{deep:!0});let wt=C(0),Tt=()=>{wt.value+=1};O([()=>vt.value,()=>yt.value],async([e])=>{e||(await y(),W.value=jt(),await y(),Tt(),await y(),Zt({x:0,y:0,width:400,height:400}),Yt(!1))},{flush:`post`,deep:!1});let{isPrinting:V,isImaging:H,generatePdf:Et,generateImage:Dt}=Ce({elementId:`cluster_${dt.value}`,fileName:I.value.title.text||`vue-ui-molecule`,options:P.value.userOptions.print}),Ot=l(()=>P.value.userOptions.show&&!I.value.title.text),kt=l(()=>_e(P.value.customPalette)),U=C({showTable:P.value.table.show,showDataLabels:!0,showTooltip:F.value.show,showZoom:I.value.zoom.show});O(P,()=>{U.value={showTable:P.value.table.show,showDataLabels:!0,showTooltip:F.value.show,showZoom:I.value.zoom.show}},{immediate:!0});function At(e,t=0){return Array.isArray(e)&&e.length>0&&e[0].nodes?At(e[0].nodes,t+1):t}function jt(){let e=At(yt.value),t=100,n=t;for(let r=0;r<e;r+=1)t/=1,n+=t;return{height:n,width:n}}let W=C(jt());function Mt(e,t={x:-W.value.width/2.43,y:W.value.height/2},n=W.value.width/1.1,r=24,ee=0,i=0,a=`#BBBBBB`,o=0){if(!Array.isArray(e)||e.length===0)return e;let te=se({plot:t,radius:n,sides:e.length,rotation:ee});return e.forEach((e,t)=>{let s=te.coordinates[t],ne=e.color?(()=>{let t=ce(e.color);return t.startsWith(`#`)?t:`#${t}`})():null,c;ne?c=ne:o===0?c=a:o===1?(c=kt.value[i]||oe[i]||a,i+=1):c=a,e.polygonPath={coordinates:[s]},e.circleRadius=r,e.color=c,e.strokeWidth=Math.min(I.value.links.strokeWidth/(o+1),r/2),e.uid=le(),Array.isArray(e.nodes)&&e.nodes.length&&(e.nodes=Mt(e.nodes,s,n/2.9,r/2.2,ee+Math.PI*t/e.nodes.length,i,c,o+1))}),e}function Nt(e){let t=/* @__PURE__ */ new Set;function n(e){e.forEach(e=>{if(!e.color)return;let r=e.color;/^#?[0-9A-F]{6}$/i.test(r)||(r=ce(r)),r.startsWith(`#`)||(r=`#${r}`),t.add(r),Array.isArray(e.nodes)&&e.nodes.length&&n(e.nodes)})}n(e);let r={};return Array.from(t).forEach(e=>{let t=e.slice(1);r[e]=`gradient_${t}`}),r}let Pt=l(()=>Nt(G.value)),G=l(()=>Mt(fe(yt.value))),K=C(null);function Ft(e){K.value={datapoint:e,seriesIndex:-1,series:G.value,config:P.value};let t=F.value.customFormat;if(ie(t)&&he(()=>t({seriesIndex:-1,datapoint:e,series:G.value,config:P.value})))M.value=t({seriesIndex:-1,datapoint:e,series:G.value,config:P.value});else{let t=``;t+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${e.color}">⬤</div><div>${e.name}</div></div>`,e.details&&(t+=`<div style="width:100%;border-top:1px solid ${F.value.borderColor};margin-top: 2px">${e.details}</div>`),M.value=`<div style="font-family:inherit">${t}</div>`}}let q=C(null),J=C(null),It=C(null);function Lt(e){It.value=q.value,q.value=e,e?P.value.events.datapointEnter&&P.value.events.datapointEnter({datapoint:e,seriesIndex:-1}):P.value.events.datapointLeave&&P.value.events.datapointLeave({datapoint:It.value||q.value,seriesIndex:-1}),e?(j.value=!0,Ft(e),J.value=e.uid):(j.value=!1,M.value=``,J.value=null)}function Rt(e){let t=[];function n(e){e.forEach(e=>{let r={name:e.name,details:e.details||`-`,ancestor:e.ancestor&&e.ancestor.name||`-`,color:e.color||``};t.push(r),e.nodes&&e.nodes.length>0&&n(e.nodes,e.name)})}return n(e),t}let zt=l(()=>Rt(G.value)),Y=l(()=>({head:[P.value.table.translations.nodeName,P.value.table.translations.details,P.value.table.translations.ancestor],body:zt.value.map((e,t)=>[{color:e.color,name:e.name},e.details,e.ancestor||``]),config:{th:{backgroundColor:P.value.table.th.backgroundColor,color:P.value.table.th.color,outline:P.value.table.th.outline},td:{backgroundColor:P.value.table.td.backgroundColor,color:P.value.table.td.color,outline:P.value.table.td.outline},breakpoint:P.value.table.responsiveBreakpoint},colNames:[P.value.table.translations.nodeName,P.value.table.translations.details,P.value.table.translations.ancestor]}));function Bt(e=null){y(()=>{let t=Y.value.body.map((e,t)=>[[e[0].name],[e[1]],[e[2]]]),n=[[I.value.title.text],[I.value.title.subtitle.text],[[...Y.value.head]]].concat(t),r=re(n);e?e(r):me({csvContent:r,title:I.value.title.text||`vue-ui-molecule`})})}function Vt(){return G.value}let X=C(!1);function Ht(e){X.value=e,ft.value+=1}function Ut(){U.value.showTable=!U.value.showTable}function Wt(){U.value.showDataLabels=!U.value.showDataLabels}function Gt(){U.value.showTooltip=!U.value.showTooltip}function Kt(){U.value.showZoom=!U.value.showZoom}let Z=C(!1);function qt(){Z.value=!Z.value}let Jt=l(()=>!Z.value&&U.value.showZoom),{viewBox:Q,resetZoom:Yt,isZoom:Xt,setInitialViewBox:Zt}=Oe(z,{x:0,y:0,width:Math.max(10,W.value.width),height:Math.max(10,W.value.height)},I.value.zoom.speed,Jt);function Qt(e){P.value.events.datapointClick&&P.value.events.datapointClick({datapoint:e,seriesIndex:-1}),st(`selectNode`,e)}let $t=ne(N,()=>I.value.title.text),$=l(()=>s({config:P,style:I,mutableConfig:U,dialog:at,accordion:Ze,isFullscreen:X,parent:N,maxWidth:800,isCursorPointer:R}));O(()=>U.value.showTable,e=>te(e,P,ht));function en(){U.value.showTable=!1,gt.value&>.value.setTableIconState(!1)}let tn=l(()=>I.value.backgroundColor),nn=l(()=>I.value.title),{isCallbackImaging:rn,isCallbackSvg:an,generateSvg:on,onGenerateImage:sn}=we({svg:z,title:nn,legend:null,legendItems:null,backgroundColor:tn,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:Dt});async function cn(){st(`copyAlt`,{config:P.value,dataset:G.value}),P.value.userOptions.callbacks.altCopy?await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let ln=l(()=>I.value.color);je({getData:Vt,getImage:$t,generatePdf:Et,generateCsv:Bt,generateImage:Dt,generateSvg:on,toggleTable:Ut,toggleLabels:Wt,toggleTooltip:Gt,toggleAnnotator:qt,toggleFullscreen:Ht,toggleZoom:Kt,copyAlt:cn});let un=l(()=>o(P.value.userOptions?.annotator?.followZoom,Q.value));return(e,o)=>(S(),f(`div`,{ref_key:`moleculeChart`,ref:N,class:Pe(`vue-data-ui-component vue-ui-molecule ${X.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:x(`font-family:${P.value.style.fontFamily};width:100%; text-align:center;background:${I.value.backgroundColor}`),id:`cluster_${dt.value}`,onMouseleave:o[2]||=e=>{q.value=null,J.value=null,D(xt)(!1)},onMouseenter:o[3]||=()=>D(xt)(!0)},[L.value.buttons.annotator&&D(z)?(S(),u(D($e),v({key:0},D(i)(L.value.annotator),{svgRef:D(z),followZoom:P.value.userOptions?.annotator?.followZoom,annotationViewport:un.value,backgroundColor:I.value.backgroundColor,color:I.value.color,active:Z.value,isCursorPointer:R.value,onClose:qt}),m({_:2},[w(D(a),t=>({name:t,fn:k(n=>[T(e.$slots,t,b(_(D(ee)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`])):d(``,!0),Ot.value?(S(),f(`div`,Ve,null,512)):d(``,!0),I.value.title.text?(S(),f(`div`,He,[(S(),u(D(Je),{key:`title_${pt.value}`,config:{title:{cy:`molecule-div-title`,...I.value.title},subtitle:{cy:`molecule-div-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))])):d(``,!0),L.value.show&&ct.value&&(D(St)||D(bt))?(S(),u(D(et),v({ref_key:`userOptionsRef`,ref:gt,key:`user_options_${ft.value}`,backgroundColor:I.value.backgroundColor,color:I.value.color,isPrinting:D(V),isImaging:D(H),uid:dt.value,hasTooltip:L.value.buttons.tooltip&&F.value.show,isTooltip:U.value.showTooltip,isFullscreen:X.value,chartElement:N.value},D(n)(L.value,`pdf csv img svg labels table fullscreen altCopy annotator zoom`),{isAnnotation:Z.value,tableDialog:P.value.table.useDialog,isZoom:U.value.showZoom,isCursorPointer:R.value,onToggleFullscreen:Ht,onGeneratePdf:D(Et),onGenerateCsv:Bt,onGenerateImage:D(sn),onGenerateSvg:D(on),onToggleTable:Ut,onToggleLabels:Wt,onToggleTooltip:Gt,onToggleAnnotator:qt,onToggleZoom:Kt,onCopyAlt:cn,style:{visibility:D(St)?D(bt)?`visible`:`hidden`:`visible`}}),m({_:2},[w(D(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:k(n=>[T(e.$slots,t,b(_(D(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),(S(),f(`svg`,{ref_key:`svgRef`,ref:z,key:`svg_${wt.value}`,xmlns:D(ge),viewBox:`${D(Q).x} ${D(Q).y} ${D(Q).width} ${D(Q).height}`,class:Pe({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),style:x(`overflow: hidden; background:transparent;color:${I.value.color}`)},[h(D(tt)),T(e.$slots,`svg-underlayer`,{svg:{...W.value,drawingArea:{...D(Q)},isPrintingImg:D(V)||D(H)||D(rn),isPrintingSvg:D(an)}},void 0,!0),e.$slots[`chart-background`]?(S(),f(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[T(e.$slots,`chart-background`,{},void 0,!0)],8,We)):d(``,!0),p(`defs`,null,[(S(!0),f(Me,null,w(Object.keys(Pt.value),(e,t)=>(S(),u(Ae,{t:`radial`,id:`gradient_${e}`,key:`gradient_${e}_${t}`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,D(ae)(e,.5),1],[`100%`,e,1]]},null,8,[`id`,`stops`]))),128))]),h(D(nt),{dataset:G.value,color:I.value.links.stroke,backgroundColor:I.value.backgroundColor,useChildColor:I.value.links.useChildColor},null,8,[`dataset`,`color`,`backgroundColor`,`useChildColor`]),h(D(it),{dataset:G.value,hoveredUid:J.value,stroke:I.value.nodes.stroke,strokeHovered:I.value.nodes.strokeHovered,onClick:Qt,onHover:Lt},{node:k(({node:t})=>[T(e.$slots,`node`,b(_({node:t})),void 0,!0)]),"node-svg":k(({nodeSvg:t})=>[T(e.$slots,`node-svg`,b(_({nodeSvg:t})),void 0,!0)]),_:3},8,[`dataset`,`hoveredUid`,`stroke`,`strokeHovered`]),U.value.showDataLabels&&!D(vt)?(S(),u(D(rt),{key:1,dataset:G.value,color:I.value.color,hoveredUid:J.value},null,8,[`dataset`,`color`,`hoveredUid`])):d(``,!0),T(e.$slots,`svg`,{svg:{...W.value,drawingArea:{...D(Q)},isPrintingImg:D(V)||D(H)||D(rn),isPrintingSvg:D(an)}},void 0,!0)],14,Ue)),e.$slots.watermark?(S(),f(`div`,Ge,[T(e.$slots,`watermark`,b(_({isPrinting:D(V)||D(H)||D(rn)||D(an)})),void 0,!0)])):d(``,!0),D(Xt)?(S(),f(`div`,Ke,[T(e.$slots,`reset-action`,{reset:D(Yt)},()=>[p(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:x({background:I.value.backgroundColor,cursor:R.value?`pointer`:`default`}),onClick:o[0]||=e=>D(Yt)(!0)},[h(D(Xe),{name:`refresh`,stroke:I.value.color},null,8,[`stroke`])],4)],!0)])):d(``,!0),e.$slots.source?(S(),f(`div`,qe,[T(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),h(D(Ye),{teleportTo:F.value.teleportTo,show:U.value.showTooltip&&j.value,backgroundColor:F.value.backgroundColor,color:F.value.color,borderRadius:F.value.borderRadius,borderColor:F.value.borderColor,borderWidth:F.value.borderWidth,fontSize:F.value.fontSize,backgroundOpacity:F.value.backgroundOpacity,position:F.value.position,offsetX:F.value.offsetX,offsetY:F.value.offsetY,parent:N.value,content:M.value,isFullscreen:X.value,isCustom:F.value.customFormat&&typeof F.value.customFormat==`function`,smooth:F.value.smooth,backdropFilter:F.value.backdropFilter,smoothForce:F.value.smoothForce,smoothSnapThreshold:F.value.smoothSnapThreshold},{"tooltip-before":k(()=>[T(e.$slots,`tooltip-before`,b(_({...K.value})),void 0,!0)]),tooltip:k(()=>[T(e.$slots,`tooltip`,b(_({...K.value})),void 0,!0)]),"tooltip-after":k(()=>[T(e.$slots,`tooltip-after`,b(_({...K.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`]),ct.value&&L.value.buttons.table?(S(),u(Ie($.value.component),v({key:7},$.value.props,{ref_key:`tableUnit`,ref:ht,onClose:en}),m({content:k(()=>[(S(),u(D(Qe),{key:`table_${mt.value}`,colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.value.config,title:P.value.table.useDialog?``:$.value.title,withCloseButton:!P.value.table.useDialog,isCursorPointer:R.value,onClose:en},{th:k(({th:e})=>[p(`div`,null,E(e),1)]),td:k(({td:e})=>[Ne(E(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[P.value.table.useDialog?{name:`title`,fn:k(()=>[Ne(E($.value.title),1)]),key:`0`}:void 0,P.value.table.useDialog?{name:`actions`,fn:k(()=>[p(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:o[1]||=e=>Bt(L.value.callbacks.csv),style:x({cursor:R.value?`pointer`:`default`})},[h(D(Xe),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):d(``,!0),T(e.$slots,`skeleton`,{},()=>[D(vt)?(S(),u(ke,{key:0})):d(``,!0)],!0)],46,Be))}},[[`__scopeId`,`data-v-cf33e049`]]);export{ze as n,Je as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as ee,r as i,t as a}from"./annotationSlots-OLiW25XN.js";import{n as o}from"./annotationViewport-X8fvs7pz.js";import{n as te,t as s}from"./tableIntegration-CNoJ1CIY.js";import{t as ne}from"./chartImage-DPGnEuYM.js";import{n as c}from"./resolveChartConfig-0IvbmIE_.js";import{D as re,Dt as ie,Ft as ae,Ht as oe,M as se,S as ce,X as le,Zt as ue,at as de,et as fe,in as pe,nt as me,pt as he,t as ge,w as _e,zt as ve}from"./lib-rPeBMZrn.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./useConfig-CXhXxWjB.js";import{t as Se}from"./useLoading-DoqqfnmS.js";import{t as Ce}from"./usePrinter-DVf3YcG5.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{t as De}from"./vue_ui_molecule-DYWXPxKs.js";import{t as Oe}from"./usePanZoom-DlEcNgCv.js";import{t as ke}from"./BaseScanner-m6QR9rwD.js";import{t as Ae}from"./DefGrad-DKMq1REY.js";import{t as je}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as Me,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as m,createTextVNode as Ne,createVNode as h,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as v,nextTick as y,normalizeClass as Pe,normalizeProps as b,normalizeStyle as x,onMounted as Fe,openBlock as S,ref as C,renderList as w,renderSlot as T,resolveDynamicComponent as Ie,toDisplayString as E,toRefs as Le,unref as D,useCssVars as Re,watch as O,withCtx as k}from"vue";var ze=/* @__PURE__ */ e({default:()=>Je}),Be=[`id`],Ve={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},He={key:2,style:`width:100%;background:transparent;`},Ue=[`xmlns`,`viewBox`],We=[`width`,`height`],Ge={key:4,class:`vue-data-ui-watermark`},Ke={key:5,"data-dom-to-png-ignore":``,class:`reset-wrapper`},qe={key:6,ref:`source`,dir:`auto`},Je=/*#__PURE__*/ je({__name:`vue-ui-molecule`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectNode`,`copyAlt`],setup(e,{expose:je,emit:ze}){Re(e=>({v452ef5ad:ln.value}));let Je=g(()=>import(`./Title-BliHuXfT.js`).then(e=>e.t)),Ye=g(()=>import(`./Tooltip-B432XpvC.js`)),Xe=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ze=g(()=>import(`./vue-ui-accordion-D3uT1Ynv.js`).then(e=>e.n)),Qe=g(()=>import(`./DataTable-KeuZB1JM.js`)),$e=g(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),et=g(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),tt=g(()=>import(`./PackageVersion-D8aPzzvh.js`).then(e=>e.t)),nt=g(()=>import(`./RecursiveLinks-CZtG6uWg.js`)),rt=g(()=>import(`./RecursiveLabels-B0d04xSj.js`)),it=g(()=>import(`./RecursiveCircles-BftI1kwF.js`)),at=g(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_molecule:ot}=xe(),A=e,st=ze,ct=l(()=>!!A.dataset&&A.dataset.length);Fe(()=>{ut()});let lt=l(()=>P.value.debug);function ut(){ve(A.dataset)&&de({componentName:`VueUiMolecule`,type:`dataset`,debug:lt.value})}let dt=C(le()),j=C(!1),M=C(``),N=C(null),ft=C(0),pt=C(0),mt=C(0),ht=C(null),gt=C(null),P=C(B()),F=l(()=>P.value.style.chart.tooltip),I=l(()=>P.value.style.chart),L=l(()=>P.value.userOptions);ye({config:()=>P.value,dataset:()=>A.dataset,component:`VueUiMolecule`,rules:[be.emptyArray,{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length===0,message:[`👀 There are no children nodes attached to the root node. Consider:`,``,`▶️ Adding children nodes to the root node.`]},{test:e=>e[0]&&e[0].nodes&&e[0].nodes.length>8,message:[`👀 The number of children nodes > 8, some nodes might overlap. Consider:`,``,`▶️ Grouping data into broader categories.`]}]});let R=l(()=>P.value.userOptions.useCursorPointer),_t=l(()=>pe({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#6A6A6A`},links:{stroke:`#6A6A6A80`}}}},userConfig:P.value.skeletonConfig??{}})),{loading:vt,FINAL_DATASET:yt}=Se({...Le(A),FINAL_CONFIG:P,prepareConfig:B,skeletonDataset:A.config?.skeletonDataset??[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]},{name:`_`,color:`#CACACA`,nodes:[{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`},{name:`_`,color:`#CACACA`}]}]}],skeletonConfig:pe({defaultConfig:P.value,userConfig:_t.value})}),{userOptionsVisible:bt,setUserOptionsVisibility:xt,keepUserOptionState:St}=Te({config:P.value}),{svgRef:z}=Ee({config:I.value.title});function B(){return c(A.config,ot,De)}let Ct=ue(A.config);O(()=>A.config,e=>{let t=ue(e),n=t!==Ct;Ct=t;let r=B();n?(P.value=r,bt.value=!P.value.userOptions.showOnChartHover,ut(),pt.value+=1,mt.value+=1,U.value.showTable=P.value.table.show,U.value.showTooltip=F.value.show,U.value.showZoom=I.value.zoom.show):(P.value.style.chart.tooltip=r.style.chart.tooltip,U.value.showTooltip=P.value.style.chart.tooltip.show)},{deep:!0});let wt=C(0),Tt=()=>{wt.value+=1};O([()=>vt.value,()=>yt.value],async([e])=>{e||(await y(),W.value=jt(),await y(),Tt(),await y(),Zt({x:0,y:0,width:400,height:400}),Yt(!1))},{flush:`post`,deep:!1});let{isPrinting:V,isImaging:H,generatePdf:Et,generateImage:Dt}=Ce({elementId:`cluster_${dt.value}`,fileName:I.value.title.text||`vue-ui-molecule`,options:P.value.userOptions.print}),Ot=l(()=>P.value.userOptions.show&&!I.value.title.text),kt=l(()=>_e(P.value.customPalette)),U=C({showTable:P.value.table.show,showDataLabels:!0,showTooltip:F.value.show,showZoom:I.value.zoom.show});O(P,()=>{U.value={showTable:P.value.table.show,showDataLabels:!0,showTooltip:F.value.show,showZoom:I.value.zoom.show}},{immediate:!0});function At(e,t=0){return Array.isArray(e)&&e.length>0&&e[0].nodes?At(e[0].nodes,t+1):t}function jt(){let e=At(yt.value),t=100,n=t;for(let r=0;r<e;r+=1)t/=1,n+=t;return{height:n,width:n}}let W=C(jt());function Mt(e,t={x:-W.value.width/2.43,y:W.value.height/2},n=W.value.width/1.1,r=24,ee=0,i=0,a=`#BBBBBB`,o=0){if(!Array.isArray(e)||e.length===0)return e;let te=se({plot:t,radius:n,sides:e.length,rotation:ee});return e.forEach((e,t)=>{let s=te.coordinates[t],ne=e.color?(()=>{let t=ce(e.color);return t.startsWith(`#`)?t:`#${t}`})():null,c;ne?c=ne:o===0?c=a:o===1?(c=kt.value[i]||oe[i]||a,i+=1):c=a,e.polygonPath={coordinates:[s]},e.circleRadius=r,e.color=c,e.strokeWidth=Math.min(I.value.links.strokeWidth/(o+1),r/2),e.uid=le(),Array.isArray(e.nodes)&&e.nodes.length&&(e.nodes=Mt(e.nodes,s,n/2.9,r/2.2,ee+Math.PI*t/e.nodes.length,i,c,o+1))}),e}function Nt(e){let t=/* @__PURE__ */ new Set;function n(e){e.forEach(e=>{if(!e.color)return;let r=e.color;/^#?[0-9A-F]{6}$/i.test(r)||(r=ce(r)),r.startsWith(`#`)||(r=`#${r}`),t.add(r),Array.isArray(e.nodes)&&e.nodes.length&&n(e.nodes)})}n(e);let r={};return Array.from(t).forEach(e=>{let t=e.slice(1);r[e]=`gradient_${t}`}),r}let Pt=l(()=>Nt(G.value)),G=l(()=>Mt(fe(yt.value))),K=C(null);function Ft(e){K.value={datapoint:e,seriesIndex:-1,series:G.value,config:P.value};let t=F.value.customFormat;if(ie(t)&&he(()=>t({seriesIndex:-1,datapoint:e,series:G.value,config:P.value})))M.value=t({seriesIndex:-1,datapoint:e,series:G.value,config:P.value});else{let t=``;t+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${e.color}">⬤</div><div>${e.name}</div></div>`,e.details&&(t+=`<div style="width:100%;border-top:1px solid ${F.value.borderColor};margin-top: 2px">${e.details}</div>`),M.value=`<div style="font-family:inherit">${t}</div>`}}let q=C(null),J=C(null),It=C(null);function Lt(e){It.value=q.value,q.value=e,e?P.value.events.datapointEnter&&P.value.events.datapointEnter({datapoint:e,seriesIndex:-1}):P.value.events.datapointLeave&&P.value.events.datapointLeave({datapoint:It.value||q.value,seriesIndex:-1}),e?(j.value=!0,Ft(e),J.value=e.uid):(j.value=!1,M.value=``,J.value=null)}function Rt(e){let t=[];function n(e){e.forEach(e=>{let r={name:e.name,details:e.details||`-`,ancestor:e.ancestor&&e.ancestor.name||`-`,color:e.color||``};t.push(r),e.nodes&&e.nodes.length>0&&n(e.nodes,e.name)})}return n(e),t}let zt=l(()=>Rt(G.value)),Y=l(()=>({head:[P.value.table.translations.nodeName,P.value.table.translations.details,P.value.table.translations.ancestor],body:zt.value.map((e,t)=>[{color:e.color,name:e.name},e.details,e.ancestor||``]),config:{th:{backgroundColor:P.value.table.th.backgroundColor,color:P.value.table.th.color,outline:P.value.table.th.outline},td:{backgroundColor:P.value.table.td.backgroundColor,color:P.value.table.td.color,outline:P.value.table.td.outline},breakpoint:P.value.table.responsiveBreakpoint},colNames:[P.value.table.translations.nodeName,P.value.table.translations.details,P.value.table.translations.ancestor]}));function Bt(e=null){y(()=>{let t=Y.value.body.map((e,t)=>[[e[0].name],[e[1]],[e[2]]]),n=[[I.value.title.text],[I.value.title.subtitle.text],[[...Y.value.head]]].concat(t),r=re(n);e?e(r):me({csvContent:r,title:I.value.title.text||`vue-ui-molecule`})})}function Vt(){return G.value}let X=C(!1);function Ht(e){X.value=e,ft.value+=1}function Ut(){U.value.showTable=!U.value.showTable}function Wt(){U.value.showDataLabels=!U.value.showDataLabels}function Gt(){U.value.showTooltip=!U.value.showTooltip}function Kt(){U.value.showZoom=!U.value.showZoom}let Z=C(!1);function qt(){Z.value=!Z.value}let Jt=l(()=>!Z.value&&U.value.showZoom),{viewBox:Q,resetZoom:Yt,isZoom:Xt,setInitialViewBox:Zt}=Oe(z,{x:0,y:0,width:Math.max(10,W.value.width),height:Math.max(10,W.value.height)},I.value.zoom.speed,Jt);function Qt(e){P.value.events.datapointClick&&P.value.events.datapointClick({datapoint:e,seriesIndex:-1}),st(`selectNode`,e)}let $t=ne(N,()=>I.value.title.text),$=l(()=>s({config:P,style:I,mutableConfig:U,dialog:at,accordion:Ze,isFullscreen:X,parent:N,maxWidth:800,isCursorPointer:R}));O(()=>U.value.showTable,e=>te(e,P,ht));function en(){U.value.showTable=!1,gt.value&>.value.setTableIconState(!1)}let tn=l(()=>I.value.backgroundColor),nn=l(()=>I.value.title),{isCallbackImaging:rn,isCallbackSvg:an,generateSvg:on,onGenerateImage:sn}=we({svg:z,title:nn,legend:null,legendItems:null,backgroundColor:tn,getSvgCallback:()=>P.value.userOptions.callbacks.svg,generateImage:Dt});async function cn(){st(`copyAlt`,{config:P.value,dataset:G.value}),P.value.userOptions.callbacks.altCopy?await Promise.resolve(P.value.userOptions.callbacks.altCopy({config:P.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let ln=l(()=>I.value.color);je({getData:Vt,getImage:$t,generatePdf:Et,generateCsv:Bt,generateImage:Dt,generateSvg:on,toggleTable:Ut,toggleLabels:Wt,toggleTooltip:Gt,toggleAnnotator:qt,toggleFullscreen:Ht,toggleZoom:Kt,copyAlt:cn});let un=l(()=>o(P.value.userOptions?.annotator?.followZoom,Q.value));return(e,o)=>(S(),f(`div`,{ref_key:`moleculeChart`,ref:N,class:Pe(`vue-data-ui-component vue-ui-molecule ${X.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:x(`font-family:${P.value.style.fontFamily};width:100%; text-align:center;background:${I.value.backgroundColor}`),id:`cluster_${dt.value}`,onMouseleave:o[2]||=e=>{q.value=null,J.value=null,D(xt)(!1)},onMouseenter:o[3]||=()=>D(xt)(!0)},[L.value.buttons.annotator&&D(z)?(S(),u(D($e),v({key:0},D(i)(L.value.annotator),{svgRef:D(z),followZoom:P.value.userOptions?.annotator?.followZoom,annotationViewport:un.value,backgroundColor:I.value.backgroundColor,color:I.value.color,active:Z.value,isCursorPointer:R.value,onClose:qt}),m({_:2},[w(D(a),t=>({name:t,fn:k(n=>[T(e.$slots,t,b(_(D(ee)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`])):d(``,!0),Ot.value?(S(),f(`div`,Ve,null,512)):d(``,!0),I.value.title.text?(S(),f(`div`,He,[(S(),u(D(Je),{key:`title_${pt.value}`,config:{title:{cy:`molecule-div-title`,...I.value.title},subtitle:{cy:`molecule-div-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))])):d(``,!0),L.value.show&&ct.value&&(D(St)||D(bt))?(S(),u(D(et),v({ref_key:`userOptionsRef`,ref:gt,key:`user_options_${ft.value}`,backgroundColor:I.value.backgroundColor,color:I.value.color,isPrinting:D(V),isImaging:D(H),uid:dt.value,hasTooltip:L.value.buttons.tooltip&&F.value.show,isTooltip:U.value.showTooltip,isFullscreen:X.value,chartElement:N.value},D(n)(L.value,`pdf csv img svg labels table fullscreen altCopy annotator zoom`),{isAnnotation:Z.value,tableDialog:P.value.table.useDialog,isZoom:U.value.showZoom,isCursorPointer:R.value,onToggleFullscreen:Ht,onGeneratePdf:D(Et),onGenerateCsv:Bt,onGenerateImage:D(sn),onGenerateSvg:D(on),onToggleTable:Ut,onToggleLabels:Wt,onToggleTooltip:Gt,onToggleAnnotator:qt,onToggleZoom:Kt,onCopyAlt:cn,style:{visibility:D(St)?D(bt)?`visible`:`hidden`:`visible`}}),m({_:2},[w(D(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:k(n=>[T(e.$slots,t,b(_(D(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),(S(),f(`svg`,{ref_key:`svgRef`,ref:z,key:`svg_${wt.value}`,xmlns:D(ge),viewBox:`${D(Q).x} ${D(Q).y} ${D(Q).width} ${D(Q).height}`,class:Pe({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),style:x(`overflow: hidden; background:transparent;color:${I.value.color}`)},[h(D(tt)),T(e.$slots,`svg-underlayer`,{svg:{...W.value,drawingArea:{...D(Q)},isPrintingImg:D(V)||D(H)||D(rn),isPrintingSvg:D(an)}},void 0,!0),e.$slots[`chart-background`]?(S(),f(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[T(e.$slots,`chart-background`,{},void 0,!0)],8,We)):d(``,!0),p(`defs`,null,[(S(!0),f(Me,null,w(Object.keys(Pt.value),(e,t)=>(S(),u(Ae,{t:`radial`,id:`gradient_${e}`,key:`gradient_${e}_${t}`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,D(ae)(e,.5),1],[`100%`,e,1]]},null,8,[`id`,`stops`]))),128))]),h(D(nt),{dataset:G.value,color:I.value.links.stroke,backgroundColor:I.value.backgroundColor,useChildColor:I.value.links.useChildColor},null,8,[`dataset`,`color`,`backgroundColor`,`useChildColor`]),h(D(it),{dataset:G.value,hoveredUid:J.value,stroke:I.value.nodes.stroke,strokeHovered:I.value.nodes.strokeHovered,onClick:Qt,onHover:Lt},{node:k(({node:t})=>[T(e.$slots,`node`,b(_({node:t})),void 0,!0)]),"node-svg":k(({nodeSvg:t})=>[T(e.$slots,`node-svg`,b(_({nodeSvg:t})),void 0,!0)]),_:3},8,[`dataset`,`hoveredUid`,`stroke`,`strokeHovered`]),U.value.showDataLabels&&!D(vt)?(S(),u(D(rt),{key:1,dataset:G.value,color:I.value.color,hoveredUid:J.value},null,8,[`dataset`,`color`,`hoveredUid`])):d(``,!0),T(e.$slots,`svg`,{svg:{...W.value,drawingArea:{...D(Q)},isPrintingImg:D(V)||D(H)||D(rn),isPrintingSvg:D(an)}},void 0,!0)],14,Ue)),e.$slots.watermark?(S(),f(`div`,Ge,[T(e.$slots,`watermark`,b(_({isPrinting:D(V)||D(H)||D(rn)||D(an)})),void 0,!0)])):d(``,!0),D(Xt)?(S(),f(`div`,Ke,[T(e.$slots,`reset-action`,{reset:D(Yt)},()=>[p(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:x({background:I.value.backgroundColor,cursor:R.value?`pointer`:`default`}),onClick:o[0]||=e=>D(Yt)(!0)},[h(D(Xe),{name:`refresh`,stroke:I.value.color},null,8,[`stroke`])],4)],!0)])):d(``,!0),e.$slots.source?(S(),f(`div`,qe,[T(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),h(D(Ye),{teleportTo:F.value.teleportTo,show:U.value.showTooltip&&j.value,backgroundColor:F.value.backgroundColor,color:F.value.color,borderRadius:F.value.borderRadius,borderColor:F.value.borderColor,borderWidth:F.value.borderWidth,fontSize:F.value.fontSize,backgroundOpacity:F.value.backgroundOpacity,position:F.value.position,offsetX:F.value.offsetX,offsetY:F.value.offsetY,parent:N.value,content:M.value,isFullscreen:X.value,isCustom:F.value.customFormat&&typeof F.value.customFormat==`function`,smooth:F.value.smooth,backdropFilter:F.value.backdropFilter,smoothForce:F.value.smoothForce,smoothSnapThreshold:F.value.smoothSnapThreshold},{"tooltip-before":k(()=>[T(e.$slots,`tooltip-before`,b(_({...K.value})),void 0,!0)]),tooltip:k(()=>[T(e.$slots,`tooltip`,b(_({...K.value})),void 0,!0)]),"tooltip-after":k(()=>[T(e.$slots,`tooltip-after`,b(_({...K.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`]),ct.value&&L.value.buttons.table?(S(),u(Ie($.value.component),v({key:7},$.value.props,{ref_key:`tableUnit`,ref:ht,onClose:en}),m({content:k(()=>[(S(),u(D(Qe),{key:`table_${mt.value}`,colNames:Y.value.colNames,head:Y.value.head,body:Y.value.body,config:Y.value.config,title:P.value.table.useDialog?``:$.value.title,withCloseButton:!P.value.table.useDialog,isCursorPointer:R.value,onClose:en},{th:k(({th:e})=>[p(`div`,null,E(e),1)]),td:k(({td:e})=>[Ne(E(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[P.value.table.useDialog?{name:`title`,fn:k(()=>[Ne(E($.value.title),1)]),key:`0`}:void 0,P.value.table.useDialog?{name:`actions`,fn:k(()=>[p(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:o[1]||=e=>Bt(L.value.callbacks.csv),style:x({cursor:R.value?`pointer`:`default`})},[h(D(Xe),{name:`fileCsv`,stroke:$.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):d(``,!0),T(e.$slots,`skeleton`,{},()=>[D(vt)?(S(),u(ke,{key:0})):d(``,!0)],!0)],46,Be))}},[[`__scopeId`,`data-v-cf33e049`]]);export{ze as n,Je as t};
|