vue-data-ui 3.17.2 → 3.17.4
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 +228 -228
- package/dist/{A11yDataTable-KcVAX2cP.js → A11yDataTable-BpmuNomI.js} +1 -1
- package/dist/{Arrow-Bn-9n3bm.js → Arrow-dSvLFssU.js} +1 -1
- package/dist/{BaseDraggableDialog-CIb-iD9g.js → BaseDraggableDialog-Di8Hlru3.js} +26 -24
- package/dist/{BaseIcon-Cb3zzG6s.js → BaseIcon-DX0hTWa-.js} +11 -5
- package/dist/{BaseLegendToggle-BQVIawmA.js → BaseLegendToggle-cMP8M2u0.js} +4 -4
- package/dist/BaseScanner-BON3d_Sx.js +38 -0
- package/dist/{BaseZoomControls-DievbOeJ.js → BaseZoomControls-CVSC1-SU.js} +11 -5
- package/dist/{ColorPicker-B0mV4xzu.js → ColorPicker-bAxGcXK0.js} +38 -22
- package/dist/{DataTable-DT2kIdQ6.js → DataTable-cMnb68Ik.js} +15 -11
- package/dist/{Legend-CS7Xo5LK.js → Legend-DGN5lY60.js} +15 -12
- package/dist/{NonSvgPenAndPaper-VyJFyJ6X.js → NonSvgPenAndPaper-B6E0zEYe.js} +34 -12
- package/dist/{PackageVersion-PjmqM4wb.js → PackageVersion-DVvvyQXB.js} +1 -1
- package/dist/{PenAndPaper-Ct3qJ4lA.js → PenAndPaper-CJDoB5H9.js} +87 -27
- package/dist/{Shape-BKRUOeKk.js → Shape-CxJ5_Rre.js} +1 -1
- package/dist/{Slicer-CIHwwuNR.js → Slicer-D7UcO8sN.js} +75 -33
- package/dist/{SlicerPreview-BMx3cqgX.js → SlicerPreview-D_CgrN_7.js} +198 -102
- package/dist/{SparkTooltip-BorBpltj.js → SparkTooltip-D4bM-kfz.js} +5 -5
- package/dist/{Title-BeMKE1cj.js → Title-BbKoiBk2.js} +1 -1
- package/dist/{Tooltip-C8KGyqQk.js → Tooltip-Cvt7Fi0Q.js} +9 -2
- package/dist/{UserOptions-rW2fRf3V.js → UserOptions-DVduN6X7.js} +48 -14
- package/dist/components/arrow.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-heatmap.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-icon.js +1 -1
- package/dist/components/vue-ui-kpi.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-pattern-seed.js +5 -0
- 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/{dom-to-png-CtxhhdWb.js → dom-to-png-DGvx6i5V.js} +21 -6
- package/dist/{exposedLib-DlqmhBx3.js → exposedLib-sJvY1pST.js} +1 -1
- package/dist/{geoProjections-D0Vxsz_O.js → geoProjections-BFq2sOBY.js} +19 -11
- package/dist/{img-LXxMLmCg.js → img-CjTQXS0U.js} +31 -7
- package/dist/{labelUtils-CqTHa20R.js → labelUtils-DX9oyq3C.js} +2 -6
- package/dist/{lib-DBptbyyI.js → lib-DMzrGQHK.js} +337 -124
- package/dist/patternUtils-BINhU4Ky.js +615 -0
- package/dist/{pdf-B4tTdfvl.js → pdf-C4H4o1Cj.js} +11 -2
- package/dist/style.css +1 -1
- package/dist/types/arrow.d.ts +1 -1
- package/dist/types/utils.d.ts +500 -451
- package/dist/types/vue-data-ui.d.ts +2124 -1786
- package/dist/types/vue-ui-3d-bar.d.ts +10 -7
- package/dist/types/vue-ui-accordion.d.ts +2 -4
- package/dist/types/vue-ui-age-pyramid.d.ts +10 -8
- package/dist/types/vue-ui-annotator.d.ts +3 -3
- package/dist/types/vue-ui-bullet.d.ts +10 -7
- package/dist/types/vue-ui-bump.d.ts +9 -6
- package/dist/types/vue-ui-candlestick.d.ts +10 -7
- package/dist/types/vue-ui-carousel-table.d.ts +2 -2
- package/dist/types/vue-ui-chestnut.d.ts +9 -6
- package/dist/types/vue-ui-chord.d.ts +10 -7
- package/dist/types/vue-ui-circle-pack.d.ts +10 -7
- package/dist/types/vue-ui-cursor.d.ts +2 -2
- package/dist/types/vue-ui-dag.d.ts +10 -7
- package/dist/types/vue-ui-dashboard.d.ts +3 -3
- package/dist/types/vue-ui-digits.d.ts +2 -2
- package/dist/types/vue-ui-donut-evolution.d.ts +11 -8
- package/dist/types/vue-ui-donut.d.ts +11 -8
- package/dist/types/vue-ui-dumbbell.d.ts +11 -8
- package/dist/types/vue-ui-flow.d.ts +11 -8
- package/dist/types/vue-ui-funnel.d.ts +11 -8
- package/dist/types/vue-ui-galaxy.d.ts +11 -8
- package/dist/types/vue-ui-gauge.d.ts +11 -8
- package/dist/types/vue-ui-geo.d.ts +13 -6
- package/dist/types/vue-ui-gizmo.d.ts +2 -5
- package/dist/types/vue-ui-heatmap.d.ts +11 -8
- package/dist/types/vue-ui-history-plot.d.ts +11 -8
- package/dist/types/vue-ui-horizontal-bar.d.ts +11 -8
- package/dist/types/vue-ui-icon.d.ts +2 -4
- package/dist/types/vue-ui-kpi.d.ts +2 -4
- package/dist/types/vue-ui-mini-loader.d.ts +4 -4
- package/dist/types/vue-ui-molecule.d.ts +11 -8
- package/dist/types/vue-ui-mood-radar.d.ts +11 -8
- package/dist/types/vue-ui-nested-donuts.d.ts +11 -8
- package/dist/types/vue-ui-onion.d.ts +11 -8
- package/dist/types/vue-ui-parallel-coordinate-plot.d.ts +11 -8
- package/dist/types/vue-ui-pattern-seed.d.ts +14 -0
- package/dist/types/vue-ui-pattern.d.ts +2 -4
- package/dist/types/vue-ui-quadrant.d.ts +11 -8
- package/dist/types/vue-ui-quick-chart.d.ts +11 -8
- package/dist/types/vue-ui-radar.d.ts +11 -8
- package/dist/types/vue-ui-rating.d.ts +4 -4
- package/dist/types/vue-ui-relation-circle.d.ts +11 -8
- package/dist/types/vue-ui-ridgeline.d.ts +11 -8
- package/dist/types/vue-ui-rings.d.ts +11 -8
- package/dist/types/vue-ui-scatter.d.ts +11 -8
- package/dist/types/vue-ui-skeleton.d.ts +2 -4
- package/dist/types/vue-ui-smiley.d.ts +2 -5
- package/dist/types/vue-ui-spark-trend.d.ts +2 -4
- package/dist/types/vue-ui-sparkbar.d.ts +4 -4
- package/dist/types/vue-ui-sparkgauge.d.ts +4 -4
- package/dist/types/vue-ui-sparkhistogram.d.ts +4 -4
- package/dist/types/vue-ui-sparkline.d.ts +4 -4
- package/dist/types/vue-ui-sparkstackbar.d.ts +4 -4
- package/dist/types/vue-ui-stackbar.d.ts +11 -8
- package/dist/types/vue-ui-stackline.d.ts +11 -8
- package/dist/types/vue-ui-strip-plot.d.ts +11 -8
- package/dist/types/vue-ui-table-heatmap.d.ts +4 -4
- package/dist/types/vue-ui-table-sparkline.d.ts +4 -4
- package/dist/types/vue-ui-table.d.ts +4 -4
- package/dist/types/vue-ui-thermometer.d.ts +11 -8
- package/dist/types/vue-ui-timer.d.ts +2 -4
- package/dist/types/vue-ui-tiremarks.d.ts +11 -8
- package/dist/types/vue-ui-treemap.d.ts +11 -8
- package/dist/types/vue-ui-vertical-bar.d.ts +11 -8
- package/dist/types/vue-ui-waffle.d.ts +11 -8
- package/dist/types/vue-ui-wheel.d.ts +11 -8
- package/dist/types/vue-ui-word-cloud.d.ts +11 -8
- package/dist/types/vue-ui-world.d.ts +11 -8
- package/dist/types/vue-ui-xy-canvas.d.ts +11 -8
- package/dist/types/vue-ui-xy.d.ts +9 -6
- package/dist/{useAutoSizeLabelsInsideViewbox-DX7LdvFX.js → useAutoSizeLabelsInsideViewbox-izlGDfwu.js} +1 -1
- package/dist/{useChartAccessibility-9icAAmYg.js → useChartAccessibility-cp6XQtqi.js} +4 -1
- package/dist/{useConfig-C40HvGpD.js → useConfig-DTHxOX6V.js} +2 -8
- package/dist/{useNestedProp-Bf5XFbs8.js → useNestedProp-DH0BEVVS.js} +1 -1
- package/dist/{useObjectBindings-DOokNdQ_.js → useObjectBindings-BjkVidN3.js} +17 -6
- package/dist/{usePanZoom-CDF7rb3o.js → usePanZoom-BbDhcKWf.js} +11 -2
- package/dist/{usePrefersMotion-CUKm8_t8.js → usePrefersMotion-Co0nj1eS.js} +3 -1
- package/dist/{usePrinter-CEpYU3r5.js → usePrinter-C4t8DdQ-.js} +3 -8
- package/dist/{useStableElementSize-DCNs0Tx7.js → useStableElementSize-C48ZVcZQ.js} +4 -1
- package/dist/{useSvgExport-ByUukOZt.js → useSvgExport-BTG4hVPO.js} +154 -34
- package/dist/{useTableResponsive-Cbx-ACcP.js → useTableResponsive-BpfiEtzR.js} +7 -3
- package/dist/{useThemeCheck-D1ZYXUwG.js → useThemeCheck-C9Ccl7U9.js} +4 -2
- package/dist/{useTimeLabelCollider-CIsgDrl9.js → useTimeLabelCollider-D3JeJ6Ye.js} +13 -5
- package/dist/{useTimeLabels-C-A2uZKi.js → useTimeLabels-Cv0tD9In.js} +22 -6
- package/dist/{useUserOptionState-BIvW1Kz7.js → useUserOptionState-B7Ej974k.js} +6 -4
- package/dist/utils.js +28 -25
- package/dist/{vue-data-ui-CGsJdqdx.js → vue-data-ui-C0aMSe2G.js} +138 -72
- package/dist/vue-data-ui.js +103 -99
- package/dist/{vue-ui-3d-bar-Bnm0MPNr.js → vue-ui-3d-bar-CzXlsUEJ.js} +328 -101
- package/dist/{vue-ui-accordion-DDuJT1xA.js → vue-ui-accordion-BHmfmb_6.js} +26 -14
- package/dist/{vue-ui-age-pyramid-vvDMkGxw.js → vue-ui-age-pyramid-DMZ9oYFv.js} +180 -73
- package/dist/{vue-ui-annotator-BdmTltyl.js → vue-ui-annotator-Db4eooqI.js} +162 -53
- package/dist/{vue-ui-bullet-CM5pK6Sj.js → vue-ui-bullet-CEH6eppC.js} +92 -35
- package/dist/{vue-ui-bump-DAo_mV8M.js → vue-ui-bump-JbKFEe2A.js} +205 -102
- package/dist/{vue-ui-candlestick-DsiOmaj1.js → vue-ui-candlestick-BX01sTaY.js} +285 -100
- package/dist/{vue-ui-carousel-table-DUl5G_cg.js → vue-ui-carousel-table-BOAti3gd.js} +66 -29
- package/dist/{vue-ui-chestnut-DMMCHoHB.js → vue-ui-chestnut-B0rhAzCA.js} +277 -88
- package/dist/{vue-ui-chord-75V7kRrX.js → vue-ui-chord-DKIHZ39Z.js} +226 -96
- package/dist/{vue-ui-circle-pack-BGXpEnmN.js → vue-ui-circle-pack-Ct2roluW.js} +196 -111
- package/dist/{vue-ui-cursor-BpPe14qk.js → vue-ui-cursor-B3cJoPku.js} +14 -7
- package/dist/{vue-ui-dag-D20FezGN.js → vue-ui-dag-DCq1VMNd.js} +261 -99
- package/dist/{vue-ui-dashboard-BcafQJ1Y.js → vue-ui-dashboard-BqAYr0Fr.js} +261 -94
- package/dist/{vue-ui-digits-gFYVzPkE.js → vue-ui-digits-D16SQQ4M.js} +6 -6
- package/dist/{vue-ui-donut-Cz7rvM7I.js → vue-ui-donut-d0LLrlKG.js} +532 -157
- package/dist/{vue-ui-donut-evolution-Cp0-8Deg.js → vue-ui-donut-evolution-6sMhQduN.js} +311 -92
- package/dist/{vue-ui-dumbbell-D_13qNsV.js → vue-ui-dumbbell-CUybhrwj.js} +266 -93
- package/dist/{vue-ui-flow-BuaVAVvN.js → vue-ui-flow-BZ-9RFsy.js} +121 -48
- package/dist/{vue-ui-funnel-Cv18o2ax.js → vue-ui-funnel-BJgvIvlz.js} +91 -39
- package/dist/{vue-ui-galaxy-n17IGTDo.js → vue-ui-galaxy-DR9WL985.js} +161 -69
- package/dist/{vue-ui-gauge-2bks6sjR.js → vue-ui-gauge-x96W5OPx.js} +95 -37
- package/dist/{vue-ui-geo-D6BoOtIP.js → vue-ui-geo-qTfYs5qi.js} +113 -43
- package/dist/{vue-ui-gizmo-CV07ZThl.js → vue-ui-gizmo-C8HOirN9.js} +25 -12
- package/dist/{vue-ui-heatmap-DfbRacVm.js → vue-ui-heatmap-Cy9o-A7B.js} +316 -125
- package/dist/{vue-ui-history-plot-5sPJfAue.js → vue-ui-history-plot-j0DMfNPJ.js} +186 -73
- package/dist/{vue-ui-horizontal-bar-BhMvbsvs.js → vue-ui-horizontal-bar-CRScV3rx.js} +151 -56
- package/dist/{vue-ui-kpi-P92uuJ_R.js → vue-ui-kpi-CEx3P3Do.js} +35 -14
- package/dist/{vue-ui-mini-loader-DrROXJIX.js → vue-ui-mini-loader-CyDOoarO.js} +17 -11
- package/dist/{vue-ui-molecule-BI6zROGn.js → vue-ui-molecule-B_19tjnI.js} +226 -120
- package/dist/{vue-ui-mood-radar-Byc_xyhw.js → vue-ui-mood-radar-DrkGtt7m.js} +166 -56
- package/dist/{vue-ui-nested-donuts-BZu1ntbw.js → vue-ui-nested-donuts-C3enuKq1.js} +196 -89
- package/dist/{vue-ui-onion-O2tKgfXh.js → vue-ui-onion-DMMLNXVu.js} +155 -74
- package/dist/{vue-ui-parallel-coordinate-plot-CbDGHCzy.js → vue-ui-parallel-coordinate-plot-YokoI6TP.js} +262 -84
- package/dist/vue-ui-pattern-seed-BcNlxb2i.js +36 -0
- package/dist/{vue-ui-quadrant-CPgUkle7.js → vue-ui-quadrant-D8vI4gIT.js} +240 -88
- package/dist/{vue-ui-quick-chart-CgDH-APs.js → vue-ui-quick-chart-BdwHAQyA.js} +445 -150
- package/dist/{vue-ui-radar-Belp_vQe.js → vue-ui-radar-DQWyecSD.js} +186 -68
- package/dist/{vue-ui-rating-C1f6x_PD.js → vue-ui-rating-DKmEn0VK.js} +30 -11
- package/dist/{vue-ui-relation-circle-AWRDIZzF.js → vue-ui-relation-circle-XQH3QkrI.js} +119 -45
- package/dist/{vue-ui-ridgeline-Cao4_cEs.js → vue-ui-ridgeline-ksI62sSU.js} +349 -85
- package/dist/{vue-ui-rings-Dl462hDH.js → vue-ui-rings-Dwbo1Fro.js} +179 -81
- package/dist/{vue-ui-scatter-BrVEK5YL.js → vue-ui-scatter-GFzM-YYz.js} +282 -102
- package/dist/{vue-ui-skeleton-BsTtcR3x.js → vue-ui-skeleton-xLPY1FKW.js} +161 -144
- package/dist/{vue-ui-smiley-M5Gn70_Z.js → vue-ui-smiley-BLMl69Ca.js} +28 -17
- package/dist/{vue-ui-spark-trend-CbtI2yPI.js → vue-ui-spark-trend-Bkxd18l5.js} +76 -31
- package/dist/{vue-ui-sparkbar-DgrwoANx.js → vue-ui-sparkbar-D2abFa-u.js} +113 -59
- package/dist/{vue-ui-sparkgauge-CepspA5J.js → vue-ui-sparkgauge-D6IF3ZQR.js} +47 -18
- package/dist/{vue-ui-sparkhistogram-BAVAkN0U.js → vue-ui-sparkhistogram-Dl8WlJLW.js} +145 -60
- package/dist/{vue-ui-sparkline-BMcsfaUW.js → vue-ui-sparkline-BY05SDNv.js} +226 -68
- package/dist/{vue-ui-sparkstackbar-BAzr99-y.js → vue-ui-sparkstackbar-BLFjfklb.js} +84 -36
- package/dist/{vue-ui-stackbar-BnepTc3z.js → vue-ui-stackbar-Dw-CI94e.js} +482 -169
- package/dist/{vue-ui-stackline-p3Utm59w.js → vue-ui-stackline-CkgSbKkp.js} +473 -164
- package/dist/{vue-ui-strip-plot-BfYmPTZT.js → vue-ui-strip-plot-P16Y5yN1.js} +239 -132
- package/dist/{vue-ui-table-BNmt2bQy.js → vue-ui-table-BPLypaeX.js} +339 -122
- package/dist/{vue-ui-table-heatmap-C6rSAGDu.js → vue-ui-table-heatmap-CWp_5d1z.js} +89 -25
- package/dist/{vue-ui-table-sparkline-BMt2q1FS.js → vue-ui-table-sparkline-CpjyrPic.js} +127 -47
- package/dist/{vue-ui-thermometer-Bf22bEzP.js → vue-ui-thermometer-B9nc954A.js} +129 -48
- package/dist/{vue-ui-timer-CkEPkE7B.js → vue-ui-timer-BDfbM4vl.js} +32 -15
- package/dist/{vue-ui-tiremarks-ltmjDwug.js → vue-ui-tiremarks-DHV_oSQ0.js} +90 -35
- package/dist/vue-ui-treemap-DLWOi_EG.js +1748 -0
- package/dist/{vue-ui-waffle-AUF7SKGN.js → vue-ui-waffle-CpNJSzAD.js} +206 -87
- package/dist/{vue-ui-wheel-Dn1nmx7r.js → vue-ui-wheel-DqBmaQ6h.js} +231 -61
- package/dist/{vue-ui-word-cloud-Bll30XSc.js → vue-ui-word-cloud-DexRxuh1.js} +443 -350
- package/dist/vue-ui-world-DAJgtvpz.js +14451 -0
- package/dist/{vue-ui-xy-BGC31q8v.js → vue-ui-xy-Cv-50xHj.js} +840 -252
- package/dist/{vue-ui-xy-canvas-BR-Qogdl.js → vue-ui-xy-canvas-BNUX13xH.js} +448 -159
- package/package.json +120 -119
- package/dist/BaseScanner-BhhkKVoj.js +0 -30
- package/dist/vue-ui-treemap-CGbTrwdn.js +0 -1726
- package/dist/vue-ui-world-CiNUxqIq.js +0 -1011
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,479 +1,528 @@
|
|
|
1
|
-
|
|
1
|
+
//--------------------------------------------------------------------------------------------//
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//--------------------------------------------------------------------------------------------//
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Configuration options for cumulative functions
|
|
15
|
-
*/
|
|
16
|
-
export type CumulativeConfig = {
|
|
17
|
-
/**
|
|
18
|
-
* If `true`, invalid inputs are kept (and echoed) in the output.
|
|
19
|
-
* Defaults to `true`.
|
|
20
|
-
*/
|
|
21
|
-
keepInvalid?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* If `true`, invalid inputs are treated as zero when computing the statistic.
|
|
24
|
-
* Defaults to `false`.
|
|
25
|
-
*/
|
|
26
|
-
convertInvalidToZero?: boolean;
|
|
27
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* UTILITY FUNCTION TYPES
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: these types are duplicated in vue-data-ui.d.ts for the legacy import to work.
|
|
7
|
+
* If we ever ship a v4 these types can be forcefully removed from vue-data-ui.ts, with
|
|
8
|
+
* a breaking change.
|
|
9
|
+
*/
|
|
28
10
|
|
|
29
|
-
|
|
30
|
-
* Vue Data UI utility
|
|
31
|
-
* ---
|
|
32
|
-
* Compute the cumulative median of a sequence, optionally echoing or zero-filling invalid inputs.
|
|
33
|
-
* ---
|
|
34
|
-
* @example
|
|
35
|
-
* ```js
|
|
36
|
-
* // Simple usage
|
|
37
|
-
* const arr = [1, 2, 3, 4, 5];
|
|
38
|
-
* const medians = getCumulativeMedian({ values: arr });
|
|
39
|
-
*
|
|
40
|
-
* // Ignore invalid values entirely
|
|
41
|
-
* const arrWithInvalid = [1, null, 2, Infinity, undefined];
|
|
42
|
-
* const mediansNoInvalid = getCumulativeMedian({
|
|
43
|
-
* values: arrWithInvalid,
|
|
44
|
-
* config: { keepInvalid: false }
|
|
45
|
-
* });
|
|
46
|
-
*
|
|
47
|
-
* // Convert invalid values to zero
|
|
48
|
-
* const mediansZeroed = getCumulativeMedian({
|
|
49
|
-
* values: arrWithInvalid,
|
|
50
|
-
* config: { convertInvalidToZero: true }
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* @param {Object} params
|
|
55
|
-
* @param {Array<number|*>} params.values
|
|
56
|
-
* The input sequence. Can include numbers or any “invalid” placeholders.
|
|
57
|
-
* @param {CumulativeConfig} [params.config]
|
|
58
|
-
* Configuration flags to control handling of invalid inputs.
|
|
59
|
-
* @returns {Array<number|*>}
|
|
60
|
-
* An array where each slot is either the cumulative median up to that point,
|
|
61
|
-
* or the original invalid value if `keepInvalid` is `true`.
|
|
62
|
-
*/
|
|
63
|
-
export function getCumulativeMedian<T = unknown>(params: {
|
|
64
|
-
values: Array<number | T>;
|
|
65
|
-
config?: CumulativeConfig;
|
|
66
|
-
}): Array<number | T>;
|
|
11
|
+
//--------------------------------------------------------------------------------------------//
|
|
67
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Configuration options for cumulative functions
|
|
15
|
+
*/
|
|
16
|
+
export type CumulativeConfig = {
|
|
68
17
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* Compute the cumulative median of a sequence, optionally echoing or zero-filling invalid inputs.
|
|
72
|
-
* ---
|
|
73
|
-
* @example
|
|
74
|
-
* ```js
|
|
75
|
-
* // Simple usage
|
|
76
|
-
* const arr = [1, 2, 3, 4, 5];
|
|
77
|
-
* const medians = getCumulativeMedian({ values: arr });
|
|
78
|
-
*
|
|
79
|
-
* // Ignore invalid values entirely
|
|
80
|
-
* const arrWithInvalid = [1, null, 2, Infinity, undefined];
|
|
81
|
-
* const mediansNoInvalid = getCumulativeMedian({
|
|
82
|
-
* values: arrWithInvalid,
|
|
83
|
-
* config: { keepInvalid: false }
|
|
84
|
-
* });
|
|
85
|
-
*
|
|
86
|
-
* // Convert invalid values to zero
|
|
87
|
-
* const mediansZeroed = getCumulativeMedian({
|
|
88
|
-
* values: arrWithInvalid,
|
|
89
|
-
* config: { convertInvalidToZero: true }
|
|
90
|
-
* });
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
* @param {Object} params
|
|
94
|
-
* @param {Array<number|*>} params.values
|
|
95
|
-
* The input sequence. Can include numbers or any “invalid” placeholders.
|
|
96
|
-
* @param {CumulativeConfig} [params.config]
|
|
97
|
-
* Configuration flags to control handling of invalid inputs.
|
|
98
|
-
* @returns {Array<number|*>}
|
|
99
|
-
* An array where each slot is either the cumulative median up to that point,
|
|
100
|
-
* or the original invalid value if `keepInvalid` is `true`.
|
|
18
|
+
* If `true`, invalid inputs are kept (and echoed) in the output.
|
|
19
|
+
* Defaults to `true`.
|
|
101
20
|
*/
|
|
102
|
-
|
|
103
|
-
values: Array<number | T>;
|
|
104
|
-
config?: CumulativeConfig;
|
|
105
|
-
}): Array<number | T>;
|
|
106
|
-
|
|
21
|
+
keepInvalid?: boolean;
|
|
107
22
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* - Handles arrays by making their item type DeepPartial
|
|
23
|
+
* If `true`, invalid inputs are treated as zero when computing the statistic.
|
|
24
|
+
* Defaults to `false`.
|
|
111
25
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
26
|
+
convertInvalidToZero?: boolean;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Vue Data UI utility
|
|
31
|
+
* ---
|
|
32
|
+
* Compute the cumulative median of a sequence, optionally echoing or zero-filling invalid inputs.
|
|
33
|
+
* ---
|
|
34
|
+
* @example
|
|
35
|
+
* ```js
|
|
36
|
+
* // Simple usage
|
|
37
|
+
* const arr = [1, 2, 3, 4, 5];
|
|
38
|
+
* const medians = getCumulativeMedian({ values: arr });
|
|
39
|
+
*
|
|
40
|
+
* // Ignore invalid values entirely
|
|
41
|
+
* const arrWithInvalid = [1, null, 2, Infinity, undefined];
|
|
42
|
+
* const mediansNoInvalid = getCumulativeMedian({
|
|
43
|
+
* values: arrWithInvalid,
|
|
44
|
+
* config: { keepInvalid: false }
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* // Convert invalid values to zero
|
|
48
|
+
* const mediansZeroed = getCumulativeMedian({
|
|
49
|
+
* values: arrWithInvalid,
|
|
50
|
+
* config: { convertInvalidToZero: true }
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} params
|
|
55
|
+
* @param {Array<number|*>} params.values
|
|
56
|
+
* The input sequence. Can include numbers or any “invalid” placeholders.
|
|
57
|
+
* @param {CumulativeConfig} [params.config]
|
|
58
|
+
* Configuration flags to control handling of invalid inputs.
|
|
59
|
+
* @returns {Array<number|*>}
|
|
60
|
+
* An array where each slot is either the cumulative median up to that point,
|
|
61
|
+
* or the original invalid value if `keepInvalid` is `true`.
|
|
62
|
+
*/
|
|
63
|
+
export function getCumulativeMedian<T = unknown>(params: {
|
|
64
|
+
values: Array<number | T>;
|
|
65
|
+
config?: CumulativeConfig;
|
|
66
|
+
}): Array<number | T>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Vue Data UI utility
|
|
70
|
+
* ---
|
|
71
|
+
* Compute the cumulative median of a sequence, optionally echoing or zero-filling invalid inputs.
|
|
72
|
+
* ---
|
|
73
|
+
* @example
|
|
74
|
+
* ```js
|
|
75
|
+
* // Simple usage
|
|
76
|
+
* const arr = [1, 2, 3, 4, 5];
|
|
77
|
+
* const medians = getCumulativeMedian({ values: arr });
|
|
78
|
+
*
|
|
79
|
+
* // Ignore invalid values entirely
|
|
80
|
+
* const arrWithInvalid = [1, null, 2, Infinity, undefined];
|
|
81
|
+
* const mediansNoInvalid = getCumulativeMedian({
|
|
82
|
+
* values: arrWithInvalid,
|
|
83
|
+
* config: { keepInvalid: false }
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* // Convert invalid values to zero
|
|
87
|
+
* const mediansZeroed = getCumulativeMedian({
|
|
88
|
+
* values: arrWithInvalid,
|
|
89
|
+
* config: { convertInvalidToZero: true }
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @param {Object} params
|
|
94
|
+
* @param {Array<number|*>} params.values
|
|
95
|
+
* The input sequence. Can include numbers or any “invalid” placeholders.
|
|
96
|
+
* @param {CumulativeConfig} [params.config]
|
|
97
|
+
* Configuration flags to control handling of invalid inputs.
|
|
98
|
+
* @returns {Array<number|*>}
|
|
99
|
+
* An array where each slot is either the cumulative median up to that point,
|
|
100
|
+
* or the original invalid value if `keepInvalid` is `true`.
|
|
101
|
+
*/
|
|
102
|
+
export function getCumulativeAverage<T = unknown>(params: {
|
|
103
|
+
values: Array<number | T>;
|
|
104
|
+
config?: CumulativeConfig;
|
|
105
|
+
}): Array<number | T>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Recursively makes all properties in T optional.
|
|
109
|
+
* - Leaves functions as-is
|
|
110
|
+
* - Handles arrays by making their item type DeepPartial
|
|
111
|
+
*/
|
|
112
|
+
export type DeepPartial<T> = T extends Function
|
|
113
|
+
? T
|
|
114
|
+
: T extends Array<infer U>
|
|
115
|
+
? Array<DeepPartial<U>>
|
|
116
|
+
: T extends object
|
|
118
117
|
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
119
118
|
: T;
|
|
120
119
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
): T;
|
|
120
|
+
/**
|
|
121
|
+
* Vue Data UI utility
|
|
122
|
+
* ---
|
|
123
|
+
* Merge a partial config with a full default config
|
|
124
|
+
* ---
|
|
125
|
+
* @example
|
|
126
|
+
* const defaultConfig = getVueDataUiConfig('vue_ui_xy');
|
|
127
|
+
* const merged = mergeConfigs({
|
|
128
|
+
* defaultConfig,
|
|
129
|
+
* userConfig: {
|
|
130
|
+
* chart: {
|
|
131
|
+
* backgroundColor: '#FF0000'
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* })
|
|
135
|
+
*/
|
|
136
|
+
export function mergeConfigs<T extends Record<string, any>>({
|
|
137
|
+
defaultConfig,
|
|
138
|
+
userConfig,
|
|
139
|
+
}: {
|
|
140
|
+
defaultConfig: T;
|
|
141
|
+
userConfig: DeepPartial<T>;
|
|
142
|
+
}): T;
|
|
145
143
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Vue Data UI utility
|
|
146
|
+
* ---
|
|
147
|
+
* Generate a straight line path to include in the d attribute of a svg path element
|
|
148
|
+
* ___
|
|
149
|
+
* @example
|
|
150
|
+
* const path = createStraightPath([{x: 1, y: 1}, { x: 2, y: 1.2}])
|
|
151
|
+
*
|
|
152
|
+
* @param points - An array of point objects
|
|
153
|
+
*/
|
|
154
|
+
export const createStraightPath: (points: Point[]) => string;
|
|
157
155
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
156
|
+
/**
|
|
157
|
+
* Vue Data UI utility
|
|
158
|
+
* ---
|
|
159
|
+
* Generate a spline path to include in the d attribute of a svg path element
|
|
160
|
+
* ___
|
|
161
|
+
* @example
|
|
162
|
+
* const path = createSmoothPath([{x: 1, y: 1}, { x: 2, y: 1.2}, { x: 3, y: 0.2 }])
|
|
163
|
+
*
|
|
164
|
+
* @param points - An array of point objects
|
|
165
|
+
*/
|
|
166
|
+
export const createSmoothPath: (points: Point[]) => string;
|
|
169
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Vue Data UI utility
|
|
170
|
+
* ---
|
|
171
|
+
* Create a dataset for VueUiWordCloud from a string
|
|
172
|
+
* ___
|
|
173
|
+
* @example
|
|
174
|
+
* const dataset = createWordCloudDatasetFromPlainText('Lorem Ipsum Dolor', (w) => w.toUpperCase())
|
|
175
|
+
*
|
|
176
|
+
* @param text - The text from which the dataset will be generated
|
|
177
|
+
* @param callback - Optional transform callback to format each word of the dataset
|
|
178
|
+
*/
|
|
179
|
+
export const createWordCloudDatasetFromPlainText: (
|
|
180
|
+
text: string,
|
|
181
|
+
callback?: VueDataUiWordCloudTransformCallback,
|
|
182
|
+
) => VueUiWordCloudDatasetItem[];
|
|
170
183
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
* ___
|
|
176
|
-
* @example
|
|
177
|
-
* const dataset = createWordCloudDatasetFromPlainText('Lorem Ipsum Dolor', (w) => w.toUpperCase())
|
|
178
|
-
*
|
|
179
|
-
* @param text - The text from which the dataset will be generated
|
|
180
|
-
* @param callback - Optional transform callback to format each word of the dataset
|
|
181
|
-
*/
|
|
182
|
-
export const createWordCloudDatasetFromPlainText: (
|
|
183
|
-
text: string,
|
|
184
|
-
callback?: VueDataUiWordCloudTransformCallback
|
|
185
|
-
) => VueUiWordCloudDatasetItem[];
|
|
184
|
+
export type VueDataUiAbbreviatePayload = {
|
|
185
|
+
source: string;
|
|
186
|
+
length?: number;
|
|
187
|
+
};
|
|
186
188
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
/**
|
|
190
|
+
* Vue Data UI utility
|
|
191
|
+
* ---
|
|
192
|
+
* Abbreviate a string to a given length
|
|
193
|
+
* ___
|
|
194
|
+
* @example
|
|
195
|
+
* const label = abbreviate({
|
|
196
|
+
* source: 'Lorem Ipsum Dolor',
|
|
197
|
+
* length: 3
|
|
198
|
+
* })
|
|
199
|
+
*
|
|
200
|
+
* @param source - The string to abbreviate
|
|
201
|
+
* @param length - The number of letters to return (defaults to 3)
|
|
202
|
+
*/
|
|
203
|
+
export const abbreviate: (payload: VueDataUiAbbreviatePayload) => string;
|
|
191
204
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
* @param source - The string to abbreviate
|
|
204
|
-
* @param length - The number of letters to return (defaults to 3)
|
|
205
|
-
*/
|
|
206
|
-
export const abbreviate: (payload: VueDataUiAbbreviatePayload) => string;
|
|
205
|
+
/**
|
|
206
|
+
* Vue Data UI utility
|
|
207
|
+
* ---
|
|
208
|
+
* Get the color palette for a given theme
|
|
209
|
+
* ___
|
|
210
|
+
* @example
|
|
211
|
+
* const palette = getPalette("hack");
|
|
212
|
+
*
|
|
213
|
+
* @param theme - The theme for which the palette is requested (e.g., "hack" | "zen", | "concrete")
|
|
214
|
+
*/
|
|
215
|
+
export const getPalette: (theme: Theme) => string[];
|
|
207
216
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
* @param theme - The theme for which the palette is requested (e.g., "hack" | "zen", | "concrete")
|
|
217
|
-
*/
|
|
218
|
-
export const getPalette: (theme: Theme) => string[];
|
|
217
|
+
export type VueDataUiGetConfigOptions = {
|
|
218
|
+
colorBackground?: string;
|
|
219
|
+
colorTextPrimary?: string;
|
|
220
|
+
colorTextSecondary?: string;
|
|
221
|
+
colorGrid?: string;
|
|
222
|
+
colorBorder?: string;
|
|
223
|
+
};
|
|
219
224
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
/**
|
|
226
|
+
* Vue Data UI utility
|
|
227
|
+
* ---
|
|
228
|
+
* Get the default config for a given component
|
|
229
|
+
* ___
|
|
230
|
+
* @typeParam T - The config type for the component
|
|
231
|
+
* @param key - Component key in snake_case (e.g. `"vue_ui_xy"`).
|
|
232
|
+
* @param options - Optional general color settings
|
|
233
|
+
* @returns The default configuration of type `T`.
|
|
234
|
+
* @example
|
|
235
|
+
* ```ts
|
|
236
|
+
* const defaultConfig = getVueDataUiConfig<VueUiXyConfig>("vue_ui_xy");
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
export const getVueDataUiConfig: <T>(
|
|
240
|
+
key: VueDataUiConfigKey,
|
|
241
|
+
options?: VueDataUiGetConfigOptions,
|
|
242
|
+
) => T;
|
|
227
243
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
244
|
+
/**
|
|
245
|
+
* Vue Data UI utility
|
|
246
|
+
* ---
|
|
247
|
+
* Lightens a color by a specified strength.
|
|
248
|
+
* ___
|
|
249
|
+
* @example
|
|
250
|
+
* const color = lightenColor("#FF0000", 0.25);
|
|
251
|
+
* const color = lightenColor("#FF000080", 0.25);
|
|
252
|
+
* const color = lightenColor("rgb(255,0,0)", 0.25);
|
|
253
|
+
* const color = lightenColor("rgb(255,0,0,0.5)", 0.25);
|
|
254
|
+
* const color = lightenColor("red", 0.25);
|
|
255
|
+
*
|
|
256
|
+
* @param color - The input color. Can be hexadecimal (e.g., "#FF0000", or "#FF000080" with alpha channel), RGB or RGBA, or a named color.
|
|
257
|
+
* @param strength - The strength to lighten the color, typically a value between 0 and 1.
|
|
258
|
+
* @returns The lightened color in hexadecimal format.
|
|
259
|
+
*/
|
|
260
|
+
export const lightenColor: (color: string, strength: number) => string;
|
|
243
261
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Vue Data UI utility
|
|
264
|
+
* ---
|
|
265
|
+
* Darkens a color by a specified strength.
|
|
266
|
+
* ___
|
|
267
|
+
* @example
|
|
268
|
+
* const color = darkenColor("#FF0000", 0.25);
|
|
269
|
+
* const color = darkenColor("#FF000080", 0.25);
|
|
270
|
+
* const color = darkenColor("rgb(255,0,0)", 0.25);
|
|
271
|
+
* const color = darkenColor("rgb(255,0,0,0.5)", 0.25);
|
|
272
|
+
* const color = darkenColor("red", 0.25);
|
|
273
|
+
*
|
|
274
|
+
* @param color - The input color. Can be hexadecimal (e.g., "#FF0000", or "#FF000080" with alpha channel), or RGB or RGBA.
|
|
275
|
+
* @param strength - The strength to darken the color, typically a value between 0 and 1.
|
|
276
|
+
* @returns The darkened color in hexadecimal format.
|
|
277
|
+
*/
|
|
278
|
+
export const darkenColor: (color: string, strength: number) => string;
|
|
261
279
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Vue Data UI utility
|
|
282
|
+
* ---
|
|
283
|
+
* Shifts hue for a given color, by a given strength.
|
|
284
|
+
* ___
|
|
285
|
+
* @example
|
|
286
|
+
* const color = shiftColorHue("#FF0000", 0.25);
|
|
287
|
+
* const color = shiftColorHue("#FF000080", 0.25);
|
|
288
|
+
* const color = shiftColorHue("rgb(255,0,0)", 0.25);
|
|
289
|
+
* const color = shiftColorHue("rgb(255,0,0,0.5)", 0.25);
|
|
290
|
+
* const color = shiftColorHue("red", 0.25);
|
|
291
|
+
*
|
|
292
|
+
* @param color - The input color. Can be hexadecimal (e.g., "#FF0000", or "#FF000080" with alpha channel), or RGB or RGBA.
|
|
293
|
+
* @param strength - The strength to darken the color, typically a value between 0 and 1.
|
|
294
|
+
* @returns The shifted color in hexadecimal format.
|
|
295
|
+
*/
|
|
296
|
+
export const shiftColorHue: (color: string, strength: number) => string;
|
|
279
297
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
* const color = shiftColorHue("#FF0000", 0.25);
|
|
287
|
-
* const color = shiftColorHue("#FF000080", 0.25);
|
|
288
|
-
* const color = shiftColorHue("rgb(255,0,0)", 0.25);
|
|
289
|
-
* const color = shiftColorHue("rgb(255,0,0,0.5)", 0.25);
|
|
290
|
-
* const color = shiftColorHue("red", 0.25);
|
|
291
|
-
*
|
|
292
|
-
* @param color - The input color. Can be hexadecimal (e.g., "#FF0000", or "#FF000080" with alpha channel), or RGB or RGBA.
|
|
293
|
-
* @param strength - The strength to darken the color, typically a value between 0 and 1.
|
|
294
|
-
* @returns The shifted color in hexadecimal format.
|
|
295
|
-
*/
|
|
296
|
-
export const shiftColorHue: (color: string, strength: number) => string;
|
|
298
|
+
export type FormatSmallValueArgs = {
|
|
299
|
+
value: number;
|
|
300
|
+
maxDecimals?: number;
|
|
301
|
+
fallbackFormatter?: (value: number) => string;
|
|
302
|
+
removeTrailingZero?: boolean;
|
|
303
|
+
};
|
|
297
304
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
305
|
+
/**
|
|
306
|
+
* Vue Data UI utility
|
|
307
|
+
* ---
|
|
308
|
+
* Formats numeric values with a controlled number of decimal places,
|
|
309
|
+
* applying maxDecimals for all values when no fallbackFormatter is given,
|
|
310
|
+
* or calling the fallbackFormatter for values ≥ 1 if provided.
|
|
311
|
+
* ___
|
|
312
|
+
* @example
|
|
313
|
+
* // Zero value
|
|
314
|
+
* formatSmallValue({ value: 0 }); // "0"
|
|
315
|
+
*
|
|
316
|
+
* // Values < 1 use minimal decimals
|
|
317
|
+
* formatSmallValue({ value: 0.9 }); // "0.9"
|
|
318
|
+
* formatSmallValue({ value: 0.0042 }); // "0.0042"
|
|
319
|
+
* formatSmallValue({ value: 0.00420001 }); // "0.0042"
|
|
320
|
+
*
|
|
321
|
+
* // Retain trailing zeros
|
|
322
|
+
* formatSmallValue({ value: 0.9, removeTrailingZero: false }); // "0.90"
|
|
323
|
+
*
|
|
324
|
+
* // Values ≥ 1 without fallback apply maxDecimals
|
|
325
|
+
* formatSmallValue({ value: 1.61803, maxDecimals: 3 }); // "1.618"
|
|
326
|
+
*
|
|
327
|
+
* // Values ≥ 1 with fallbackFormatter
|
|
328
|
+
* formatSmallValue({ value: 2.5, fallbackFormatter: v => v.toFixed(1) }); // "2.5"
|
|
329
|
+
*
|
|
330
|
+
* // Negative values
|
|
331
|
+
* formatSmallValue({ value: -0.056 }); // "-0.056"
|
|
332
|
+
*
|
|
333
|
+
* @param {FormatSmallValueArgs} options - Configuration object for formatting.
|
|
334
|
+
* @param {number} options.value - The numeric value to format.
|
|
335
|
+
* @param {number} [options.maxDecimals=4] - Maximum decimal places to use.
|
|
336
|
+
* @param {(value: number) => string} [options.fallbackFormatter] - Formatter for values ≥ 1.
|
|
337
|
+
* @param {boolean} [options.removeTrailingZero=true] - Whether to strip unnecessary trailing zeros.
|
|
338
|
+
* @returns {string} The formatted number as a string.
|
|
339
|
+
*/
|
|
340
|
+
export const formatSmallValue: ({
|
|
341
|
+
value,
|
|
342
|
+
maxDecimals,
|
|
343
|
+
fallbackFormatter,
|
|
344
|
+
removeTrailingZero,
|
|
345
|
+
}: FormatSmallValueArgs) => string;
|
|
304
346
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
* // Zero value
|
|
314
|
-
* formatSmallValue({ value: 0 }); // "0"
|
|
315
|
-
*
|
|
316
|
-
* // Values < 1 use minimal decimals
|
|
317
|
-
* formatSmallValue({ value: 0.9 }); // "0.9"
|
|
318
|
-
* formatSmallValue({ value: 0.0042 }); // "0.0042"
|
|
319
|
-
* formatSmallValue({ value: 0.00420001 }); // "0.0042"
|
|
320
|
-
*
|
|
321
|
-
* // Retain trailing zeros
|
|
322
|
-
* formatSmallValue({ value: 0.9, removeTrailingZero: false }); // "0.90"
|
|
323
|
-
*
|
|
324
|
-
* // Values ≥ 1 without fallback apply maxDecimals
|
|
325
|
-
* formatSmallValue({ value: 1.61803, maxDecimals: 3 }); // "1.618"
|
|
326
|
-
*
|
|
327
|
-
* // Values ≥ 1 with fallbackFormatter
|
|
328
|
-
* formatSmallValue({ value: 2.5, fallbackFormatter: v => v.toFixed(1) }); // "2.5"
|
|
329
|
-
*
|
|
330
|
-
* // Negative values
|
|
331
|
-
* formatSmallValue({ value: -0.056 }); // "-0.056"
|
|
332
|
-
*
|
|
333
|
-
* @param {FormatSmallValueArgs} options - Configuration object for formatting.
|
|
334
|
-
* @param {number} options.value - The numeric value to format.
|
|
335
|
-
* @param {number} [options.maxDecimals=4] - Maximum decimal places to use.
|
|
336
|
-
* @param {(value: number) => string} [options.fallbackFormatter] - Formatter for values ≥ 1.
|
|
337
|
-
* @param {boolean} [options.removeTrailingZero=true] - Whether to strip unnecessary trailing zeros.
|
|
338
|
-
* @returns {string} The formatted number as a string.
|
|
339
|
-
*/
|
|
340
|
-
export const formatSmallValue: ({
|
|
341
|
-
value,
|
|
342
|
-
maxDecimals,
|
|
343
|
-
fallbackFormatter,
|
|
344
|
-
removeTrailingZero
|
|
345
|
-
}: FormatSmallValueArgs) => string
|
|
347
|
+
export type CreateTSpansArgs = {
|
|
348
|
+
content: string;
|
|
349
|
+
fontSize: number;
|
|
350
|
+
fill: string;
|
|
351
|
+
maxWords: number;
|
|
352
|
+
x: number;
|
|
353
|
+
y: number;
|
|
354
|
+
};
|
|
346
355
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
356
|
+
/**
|
|
357
|
+
* Vue Data UI utility
|
|
358
|
+
* ---
|
|
359
|
+
* Creates TSpan elements from a string to break text into multiple lines.
|
|
360
|
+
* The output should be placed with `v-html` inside an SVG `<text>` element.
|
|
361
|
+
* ___
|
|
362
|
+
* @example
|
|
363
|
+
* const textContent = createTSpans({
|
|
364
|
+
* content: "This is an example of multiline text",
|
|
365
|
+
* fontSize: 16,
|
|
366
|
+
* fill: "#1A1A1A",
|
|
367
|
+
* maxWords: 3, // Will create lines of 3 words max
|
|
368
|
+
* x: 10,
|
|
369
|
+
* y: 20
|
|
370
|
+
* });
|
|
371
|
+
*
|
|
372
|
+
* // Usage: <text :x="10" :y="20" fill="#1A1A1A" :font-size="16" v-html="textContent"/>
|
|
373
|
+
*
|
|
374
|
+
* @param {Object} args - The arguments object.
|
|
375
|
+
* @param {string} args.content - The text content to be split into lines.
|
|
376
|
+
* @param {number} args.fontSize - The font size used to determine line spacing.
|
|
377
|
+
* @param {string} args.fill - The fill color for the text.
|
|
378
|
+
* @param {number} args.maxWords - Maximum number of words per line.
|
|
379
|
+
* @param {number} args.x - The x-coordinate for each `tspan` element.
|
|
380
|
+
* @param {number} args.y - The starting y-coordinate for the first `tspan`.
|
|
381
|
+
*
|
|
382
|
+
* @returns {string} A string containing the HTML content to be placed with `v-html` inside an SVG `<text>` element.
|
|
383
|
+
*/
|
|
384
|
+
export const createTSpans: ({
|
|
385
|
+
content,
|
|
386
|
+
fontSize,
|
|
387
|
+
fill,
|
|
388
|
+
maxWords,
|
|
389
|
+
x,
|
|
390
|
+
y,
|
|
391
|
+
}: CreateTSpansArgs) => string;
|
|
355
392
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
393
|
+
/**
|
|
394
|
+
* Vue Data UI composable
|
|
395
|
+
* ---
|
|
396
|
+
* Flattens a reactive config object into computed refs for every leaf property.
|
|
397
|
+
*
|
|
398
|
+
* @template T extends object
|
|
399
|
+
* @param configRef A Vue `Ref` holding your object.
|
|
400
|
+
* @param options Optional settings: `delimiter` (default `"."`) and `skipArrays` (default `true`).
|
|
401
|
+
* @returns An object with flatten config as refs
|
|
402
|
+
*
|
|
403
|
+
* ___
|
|
404
|
+
* @example
|
|
405
|
+
*
|
|
406
|
+
* ```js
|
|
407
|
+
* import { useObjectBindings } from "vue-data-ui";
|
|
408
|
+
*
|
|
409
|
+
* const config = ref({
|
|
410
|
+
* customPalette: ["#CCCCCC", "#1A1A1A"],
|
|
411
|
+
* style: {
|
|
412
|
+
* chart: {
|
|
413
|
+
* backgroundColor: "#FFFFFF",
|
|
414
|
+
* color: "#1A1A1A",
|
|
415
|
+
* },
|
|
416
|
+
* },
|
|
417
|
+
* });
|
|
418
|
+
*
|
|
419
|
+
* const bindings = useObjectBindings(config);
|
|
420
|
+
* ```
|
|
421
|
+
*
|
|
422
|
+
* Then in your template:
|
|
423
|
+
* ```html
|
|
424
|
+
* <template>
|
|
425
|
+
* <div>
|
|
426
|
+
* <input type="color" v-model="bindings['style.chart.backgroundColor']" />
|
|
427
|
+
* </div>
|
|
428
|
+
* </template>
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
export function useObjectBindings(
|
|
432
|
+
configRef: Ref<Record<string, any>>,
|
|
433
|
+
options?: {
|
|
434
|
+
delimiter?: string;
|
|
435
|
+
skipArrays?: boolean;
|
|
436
|
+
},
|
|
437
|
+
): Record<string, Ref<any>>;
|
|
392
438
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
skipArrays?: boolean
|
|
436
|
-
}
|
|
437
|
-
): Record<string, Ref<any>>;
|
|
439
|
+
/**
|
|
440
|
+
* Vue Data UI utility
|
|
441
|
+
* ---
|
|
442
|
+
* Applies a two-stage data correction pipeline to a numeric time series.
|
|
443
|
+
* ---
|
|
444
|
+
*
|
|
445
|
+
* The correction is performed in sequence:
|
|
446
|
+
*
|
|
447
|
+
* 1. Bidirectional Moving Average:
|
|
448
|
+
* Reduces local noise by blending trailing (left-anchored) and leading
|
|
449
|
+
* (right-anchored) averages. This ensures smooth transitions from both
|
|
450
|
+
* fixed endpoints while preserving the first and last values.
|
|
451
|
+
*
|
|
452
|
+
* 2. Forward-Backward Exponential Smoothing (Zero-Phase):
|
|
453
|
+
* Further smooths the signal without introducing phase lag. A forward
|
|
454
|
+
* and backward exponential pass are blended to preserve trend timing
|
|
455
|
+
* and avoid temporal shift artifacts.
|
|
456
|
+
*
|
|
457
|
+
* This utility is designed for visual data refinement,
|
|
458
|
+
* where smoothness is required without distorting boundary values
|
|
459
|
+
* or shifting peaks and transitions.
|
|
460
|
+
*
|
|
461
|
+
* @param {Array<{ value: number | null }>} data
|
|
462
|
+
* The ordered dataset to correct. Each item must contain a numeric `value`.
|
|
463
|
+
*
|
|
464
|
+
* @param {{ averageWindow: number, smoothingTau: number }} settings
|
|
465
|
+
* Configuration object:
|
|
466
|
+
* - `averageWindow`: Half-window size for the moving average.
|
|
467
|
+
* `0` disables the moving average stage.
|
|
468
|
+
* - `smoothingTau`: Time constant controlling smoothing strength.
|
|
469
|
+
* `0` disables the smoothing stage. Higher values produce smoother output.
|
|
470
|
+
*
|
|
471
|
+
* @returns {Array<{ value: number | null }>}
|
|
472
|
+
* A new array with corrected values. The original input array is not mutated.
|
|
473
|
+
*/
|
|
474
|
+
export function applyDataCorrection(
|
|
475
|
+
data: Array<{ value: number | null }>,
|
|
476
|
+
settings: {
|
|
477
|
+
averageWindow: number;
|
|
478
|
+
smoothingTau: number;
|
|
479
|
+
},
|
|
480
|
+
): Array<{ value: number | null }>;
|
|
438
481
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
482
|
+
export type CreatePatternArgs = {
|
|
483
|
+
id: string;
|
|
484
|
+
seed: string | number;
|
|
485
|
+
foregroundColor?: string;
|
|
486
|
+
backgroundColor?: string;
|
|
487
|
+
maxSize?: number;
|
|
488
|
+
minSize?: number;
|
|
489
|
+
disambiguator?: string | number;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Vue Data UI utility
|
|
494
|
+
* ---
|
|
495
|
+
* Creates an SVG <defs> element with a <pattern> markup string for seeded chart patterns.
|
|
496
|
+
* The output can be injected inside an SVG <defs> element, or in tooltips customFormat to apply patterns on tooltip markers.
|
|
497
|
+
* ___
|
|
498
|
+
* @example
|
|
499
|
+
* const patternMarkup = createPatternDef({
|
|
500
|
+
* id: "pattern-1",
|
|
501
|
+
* seed: "Series A",
|
|
502
|
+
* foregroundColor: "#1A1A1A",
|
|
503
|
+
* backgroundColor: "#FFFFFF",
|
|
504
|
+
* minSize: 8,
|
|
505
|
+
* maxSize: 20
|
|
506
|
+
* disambiguator: "pattern-1"
|
|
507
|
+
* });
|
|
508
|
+
*
|
|
509
|
+
* @param {CreatePatternArgs} args - Pattern creation options.
|
|
510
|
+
* @param {string} args.id - Unique SVG pattern identifier.
|
|
511
|
+
* @param {string | number} args.seed - Seed used to deterministically generate the pattern.
|
|
512
|
+
* @param {string} [args.foregroundColor] - Foreground color used for the pattern marks.
|
|
513
|
+
* @param {string} [args.backgroundColor] - Background color for the pattern tile.
|
|
514
|
+
* @param {number} [args.maxSize] - Maximum tile size used during seeded pattern generation.
|
|
515
|
+
* @param {number} [args.minSize] - Minimum tile size used during seeded pattern generation.
|
|
516
|
+
* @param {string | number} args.disambiguator - Additional unique identifier to disambiguate patterns for large datasets
|
|
517
|
+
*
|
|
518
|
+
* @returns {string} SVG <defs> with <pattern> markup as a string.
|
|
519
|
+
*/
|
|
520
|
+
export const createPatternDef: ({
|
|
521
|
+
id,
|
|
522
|
+
seed,
|
|
523
|
+
foregroundColor,
|
|
524
|
+
backgroundColor,
|
|
525
|
+
maxSize,
|
|
526
|
+
minSize,
|
|
527
|
+
disambiguator,
|
|
528
|
+
}: CreatePatternArgs) => string;
|