@lobehub/charts 5.7.0 → 5.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AccuracyBarChart/index.d.mts +62 -0
- package/es/AccuracyBarChart/index.mjs +326 -0
- package/es/AccuracyBarChart/index.mjs.map +1 -0
- package/es/AccuracyBarChart/styles.d.mts +14 -0
- package/es/AccuracyBarChart/styles.mjs +71 -0
- package/es/AccuracyBarChart/styles.mjs.map +1 -0
- package/es/AreaChart/index.d.mts +13 -0
- package/es/AreaChart/index.mjs +308 -0
- package/es/AreaChart/index.mjs.map +1 -0
- package/es/AreaChart/styles.d.mts +9 -0
- package/es/AreaChart/styles.mjs +28 -0
- package/es/AreaChart/styles.mjs.map +1 -0
- package/es/BarChart/index.d.mts +11 -0
- package/es/BarChart/index.mjs +290 -0
- package/es/BarChart/index.mjs.map +1 -0
- package/es/BarChart/{renderShape.d.ts → renderShape.d.mts} +3 -1
- package/es/BarChart/renderShape.mjs +28 -0
- package/es/BarChart/renderShape.mjs.map +1 -0
- package/es/BarChart/styles.d.mts +9 -0
- package/es/BarChart/styles.mjs +28 -0
- package/es/BarChart/styles.mjs.map +1 -0
- package/es/BarList/index.d.mts +32 -0
- package/es/BarList/index.mjs +128 -0
- package/es/BarList/index.mjs.map +1 -0
- package/es/BarList/styles.d.mts +13 -0
- package/es/BarList/styles.mjs +63 -0
- package/es/BarList/styles.mjs.map +1 -0
- package/es/BenchmarkColumnChart/index.d.mts +144 -0
- package/es/BenchmarkColumnChart/index.mjs +514 -0
- package/es/BenchmarkColumnChart/index.mjs.map +1 -0
- package/es/BenchmarkColumnChart/styles.d.mts +19 -0
- package/es/BenchmarkColumnChart/styles.mjs +129 -0
- package/es/BenchmarkColumnChart/styles.mjs.map +1 -0
- package/es/BenchmarkRankingChart/index.d.mts +91 -0
- package/es/BenchmarkRankingChart/index.mjs +347 -0
- package/es/BenchmarkRankingChart/index.mjs.map +1 -0
- package/es/BenchmarkRankingChart/styles.d.mts +36 -0
- package/es/BenchmarkRankingChart/styles.mjs +265 -0
- package/es/BenchmarkRankingChart/styles.mjs.map +1 -0
- package/es/BenchmarkScatterChart/index.d.mts +148 -0
- package/es/BenchmarkScatterChart/index.mjs +668 -0
- package/es/BenchmarkScatterChart/index.mjs.map +1 -0
- package/es/BenchmarkScatterChart/styles.d.mts +28 -0
- package/es/BenchmarkScatterChart/styles.mjs +193 -0
- package/es/BenchmarkScatterChart/styles.mjs.map +1 -0
- package/es/BenchmarkScatterChart/{utils.d.ts → utils.d.mts} +32 -29
- package/es/BenchmarkScatterChart/utils.mjs +214 -0
- package/es/BenchmarkScatterChart/utils.mjs.map +1 -0
- package/es/ComposedChart/index.d.mts +6 -0
- package/es/ComposedChart/index.mjs +254 -0
- package/es/ComposedChart/index.mjs.map +1 -0
- package/es/ComposedChart/styles.d.mts +9 -0
- package/es/ComposedChart/styles.mjs +28 -0
- package/es/ComposedChart/styles.mjs.map +1 -0
- package/es/ComposedChart/types.d.mts +71 -0
- package/es/ComposedChart/types.mjs +0 -0
- package/es/DataBars/CategoryBar.d.mts +17 -0
- package/es/DataBars/CategoryBar.mjs +146 -0
- package/es/DataBars/CategoryBar.mjs.map +1 -0
- package/es/DataBars/DeltaBar.d.mts +16 -0
- package/es/DataBars/DeltaBar.mjs +102 -0
- package/es/DataBars/DeltaBar.mjs.map +1 -0
- package/es/DataBars/MarkerBar.d.mts +19 -0
- package/es/DataBars/MarkerBar.mjs +74 -0
- package/es/DataBars/MarkerBar.mjs.map +1 -0
- package/es/DataBars/ProgressBar.d.mts +15 -0
- package/es/DataBars/ProgressBar.mjs +53 -0
- package/es/DataBars/ProgressBar.mjs.map +1 -0
- package/es/DataBars/index.d.mts +5 -0
- package/es/DataBars/index.mjs +5 -0
- package/es/DataBars/styles.d.mts +10 -0
- package/es/DataBars/styles.mjs +31 -0
- package/es/DataBars/styles.mjs.map +1 -0
- package/es/DonutChart/DonutChartTooltip.d.mts +14 -0
- package/es/DonutChart/DonutChartTooltip.mjs +25 -0
- package/es/DonutChart/DonutChartTooltip.mjs.map +1 -0
- package/es/DonutChart/index.d.mts +33 -0
- package/es/DonutChart/index.mjs +160 -0
- package/es/DonutChart/index.mjs.map +1 -0
- package/es/DonutChart/inputParser.d.mts +5 -0
- package/es/DonutChart/inputParser.mjs +8 -0
- package/es/DonutChart/inputParser.mjs.map +1 -0
- package/es/DonutChart/renderInactiveShape.d.mts +4 -0
- package/es/DonutChart/renderInactiveShape.mjs +22 -0
- package/es/DonutChart/renderInactiveShape.mjs.map +1 -0
- package/es/DonutChart/styles.d.mts +9 -0
- package/es/DonutChart/styles.mjs +28 -0
- package/es/DonutChart/styles.mjs.map +1 -0
- package/es/FunnelChart/ArrowRightIcon.d.mts +8 -0
- package/es/FunnelChart/ArrowRightIcon.mjs +14 -0
- package/es/FunnelChart/ArrowRightIcon.mjs.map +1 -0
- package/es/FunnelChart/index.d.mts +21 -0
- package/es/FunnelChart/index.mjs +421 -0
- package/es/FunnelChart/index.mjs.map +1 -0
- package/es/FunnelChart/styles.d.mts +9 -0
- package/es/FunnelChart/styles.mjs +28 -0
- package/es/FunnelChart/styles.mjs.map +1 -0
- package/es/FunnelChart/types.d.mts +31 -0
- package/es/FunnelChart/types.mjs +0 -0
- package/es/Heatmaps/Calendar.d.mts +21 -0
- package/es/Heatmaps/Calendar.mjs +108 -0
- package/es/Heatmaps/Calendar.mjs.map +1 -0
- package/es/Heatmaps/ChartLabels.d.mts +17 -0
- package/es/Heatmaps/ChartLabels.mjs +84 -0
- package/es/Heatmaps/ChartLabels.mjs.map +1 -0
- package/es/Heatmaps/Footer.d.mts +24 -0
- package/es/Heatmaps/Footer.mjs +81 -0
- package/es/Heatmaps/Footer.mjs.map +1 -0
- package/es/Heatmaps/index.d.mts +31 -0
- package/es/Heatmaps/index.mjs +188 -0
- package/es/Heatmaps/index.mjs.map +1 -0
- package/es/Heatmaps/styles.d.mts +10 -0
- package/es/Heatmaps/styles.mjs +47 -0
- package/es/Heatmaps/styles.mjs.map +1 -0
- package/es/Legend/LegendItem.d.mts +12 -0
- package/es/Legend/LegendItem.mjs +65 -0
- package/es/Legend/LegendItem.mjs.map +1 -0
- package/es/Legend/ScrollButton.d.mts +11 -0
- package/es/Legend/ScrollButton.mjs +50 -0
- package/es/Legend/ScrollButton.mjs.map +1 -0
- package/es/Legend/index.d.mts +16 -0
- package/es/Legend/index.mjs +152 -0
- package/es/Legend/index.mjs.map +1 -0
- package/es/LineChart/index.d.mts +11 -0
- package/es/LineChart/index.mjs +271 -0
- package/es/LineChart/index.mjs.map +1 -0
- package/es/LineChart/styles.d.mts +9 -0
- package/es/LineChart/styles.mjs +28 -0
- package/es/LineChart/styles.mjs.map +1 -0
- package/es/RadarChart/index.d.mts +27 -0
- package/es/RadarChart/index.mjs +157 -0
- package/es/RadarChart/index.mjs.map +1 -0
- package/es/RadarChart/styles.d.mts +8 -0
- package/es/RadarChart/styles.mjs +23 -0
- package/es/RadarChart/styles.mjs.map +1 -0
- package/es/ScatterChart/ScatterChartTooltip.d.mts +19 -0
- package/es/ScatterChart/ScatterChartTooltip.mjs +52 -0
- package/es/ScatterChart/ScatterChartTooltip.mjs.map +1 -0
- package/es/ScatterChart/ScatterChartTooltipRow.d.mts +10 -0
- package/es/ScatterChart/ScatterChartTooltipRow.mjs +36 -0
- package/es/ScatterChart/ScatterChartTooltipRow.mjs.map +1 -0
- package/es/ScatterChart/index.d.mts +58 -0
- package/es/ScatterChart/index.mjs +241 -0
- package/es/ScatterChart/index.mjs.map +1 -0
- package/es/ScatterChart/{renderShape.d.ts → renderShape.d.mts} +4 -1
- package/es/ScatterChart/renderShape.mjs +18 -0
- package/es/ScatterChart/renderShape.mjs.map +1 -0
- package/es/ScatterChart/styles.d.mts +9 -0
- package/es/ScatterChart/styles.mjs +28 -0
- package/es/ScatterChart/styles.mjs.map +1 -0
- package/es/SparkChart/SparkAreaChart.d.mts +14 -0
- package/es/SparkChart/SparkAreaChart.mjs +109 -0
- package/es/SparkChart/SparkAreaChart.mjs.map +1 -0
- package/es/SparkChart/SparkBarChart.d.mts +11 -0
- package/es/SparkChart/SparkBarChart.mjs +69 -0
- package/es/SparkChart/SparkBarChart.mjs.map +1 -0
- package/es/SparkChart/SparkLineChart.d.mts +12 -0
- package/es/SparkChart/SparkLineChart.mjs +73 -0
- package/es/SparkChart/SparkLineChart.mjs.map +1 -0
- package/es/SparkChart/index.d.mts +4 -0
- package/es/SparkChart/index.mjs +4 -0
- package/es/Tracker/TrackerBlock.d.mts +11 -0
- package/es/Tracker/TrackerBlock.mjs +52 -0
- package/es/Tracker/TrackerBlock.mjs.map +1 -0
- package/es/Tracker/index.d.mts +21 -0
- package/es/Tracker/index.mjs +69 -0
- package/es/Tracker/index.mjs.map +1 -0
- package/es/Tracker/styles.d.mts +8 -0
- package/es/Tracker/styles.mjs +24 -0
- package/es/Tracker/styles.mjs.map +1 -0
- package/es/common/BaseAnimationTimingProps.d.mts +10 -0
- package/es/common/BaseAnimationTimingProps.mjs +0 -0
- package/es/common/BaseChartProps.d.mts +61 -0
- package/es/common/BaseChartProps.mjs +0 -0
- package/es/common/BaseSparkChartProps.d.mts +17 -0
- package/es/common/BaseSparkChartProps.mjs +0 -0
- package/es/common/ChartLegend.d.mts +8 -0
- package/es/common/ChartLegend.mjs +32 -0
- package/es/common/ChartLegend.mjs.map +1 -0
- package/es/common/ChartTooltip/ChartTooltipFrame.d.mts +8 -0
- package/es/common/ChartTooltip/ChartTooltipFrame.mjs +27 -0
- package/es/common/ChartTooltip/ChartTooltipFrame.mjs.map +1 -0
- package/es/common/ChartTooltip/ChartTooltipRow.d.mts +10 -0
- package/es/common/ChartTooltip/ChartTooltipRow.mjs +51 -0
- package/es/common/ChartTooltip/ChartTooltipRow.mjs.map +1 -0
- package/es/common/ChartTooltip/index.d.mts +18 -0
- package/es/common/ChartTooltip/index.mjs +50 -0
- package/es/common/ChartTooltip/index.mjs.map +1 -0
- package/es/common/CustomTooltipProps.d.mts +15 -0
- package/es/common/CustomTooltipProps.mjs +0 -0
- package/es/common/CustomYAxisTick.d.mts +18 -0
- package/es/common/CustomYAxisTick.mjs +24 -0
- package/es/common/CustomYAxisTick.mjs.map +1 -0
- package/es/common/NoData.d.mts +13 -0
- package/es/common/NoData.mjs +25 -0
- package/es/common/NoData.mjs.map +1 -0
- package/es/common/benchmark/index.d.mts +3 -0
- package/es/common/benchmark/{index.js → index.mjs} +1 -1
- package/es/common/benchmark/types.d.mts +125 -0
- package/es/common/benchmark/types.mjs +0 -0
- package/es/common/benchmark/{utils.d.ts → utils.d.mts} +38 -36
- package/es/common/benchmark/utils.mjs +115 -0
- package/es/common/benchmark/utils.mjs.map +1 -0
- package/es/common/{utils.d.ts → utils.d.mts} +3 -0
- package/es/common/utils.mjs +36 -0
- package/es/common/utils.mjs.map +1 -0
- package/es/hooks/useOnWindowResize.d.mts +6 -0
- package/es/hooks/useOnWindowResize.mjs +18 -0
- package/es/hooks/useOnWindowResize.mjs.map +1 -0
- package/es/hooks/usePrefersReducedMotion.d.mts +4 -0
- package/es/hooks/usePrefersReducedMotion.mjs +24 -0
- package/es/hooks/usePrefersReducedMotion.mjs.map +1 -0
- package/es/hooks/useThemeColorRange.d.mts +4 -0
- package/es/hooks/useThemeColorRange.mjs +28 -0
- package/es/hooks/useThemeColorRange.mjs.map +1 -0
- package/es/index.d.mts +34 -0
- package/es/index.mjs +28 -0
- package/es/types/{charts.d.ts → charts.d.mts} +26 -26
- package/es/types/charts.mjs +12 -0
- package/es/types/charts.mjs.map +1 -0
- package/es/utils/{calendar.d.ts → calendar.d.mts} +21 -18
- package/es/utils/calendar.mjs +154 -0
- package/es/utils/calendar.mjs.map +1 -0
- package/es/utils/getMaxLabelLength.d.mts +13 -0
- package/es/utils/getMaxLabelLength.mjs +48 -0
- package/es/utils/getMaxLabelLength.mjs.map +1 -0
- package/es/utils/{index.d.ts → index.d.mts} +4 -1
- package/es/utils/index.mjs +19 -0
- package/es/utils/index.mjs.map +1 -0
- package/es/utils/{theme.d.ts → theme.d.mts} +3 -0
- package/es/utils/theme.mjs +33 -0
- package/es/utils/theme.mjs.map +1 -0
- package/package.json +144 -4
- package/es/AccuracyBarChart/index.d.ts +0 -60
- package/es/AccuracyBarChart/index.js +0 -454
- package/es/AccuracyBarChart/index.mdx +0 -52
- package/es/AccuracyBarChart/styles.d.ts +0 -11
- package/es/AccuracyBarChart/styles.js +0 -18
- package/es/AreaChart/index.d.ts +0 -11
- package/es/AreaChart/index.js +0 -430
- package/es/AreaChart/index.mdx +0 -49
- package/es/AreaChart/styles.d.ts +0 -6
- package/es/AreaChart/styles.js +0 -13
- package/es/BarChart/index.d.ts +0 -9
- package/es/BarChart/index.js +0 -392
- package/es/BarChart/index.mdx +0 -73
- package/es/BarChart/renderShape.js +0 -34
- package/es/BarChart/styles.d.ts +0 -6
- package/es/BarChart/styles.js +0 -13
- package/es/BarList/index.d.ts +0 -29
- package/es/BarList/index.js +0 -174
- package/es/BarList/index.mdx +0 -34
- package/es/BarList/styles.d.ts +0 -10
- package/es/BarList/styles.js +0 -18
- package/es/BenchmarkColumnChart/index.d.ts +0 -140
- package/es/BenchmarkColumnChart/index.js +0 -686
- package/es/BenchmarkColumnChart/index.mdx +0 -66
- package/es/BenchmarkColumnChart/styles.d.ts +0 -16
- package/es/BenchmarkColumnChart/styles.js +0 -23
- package/es/BenchmarkRankingChart/index.d.ts +0 -87
- package/es/BenchmarkRankingChart/index.js +0 -455
- package/es/BenchmarkRankingChart/index.mdx +0 -59
- package/es/BenchmarkRankingChart/styles.d.ts +0 -33
- package/es/BenchmarkRankingChart/styles.js +0 -41
- package/es/BenchmarkScatterChart/index.d.ts +0 -145
- package/es/BenchmarkScatterChart/index.js +0 -857
- package/es/BenchmarkScatterChart/index.mdx +0 -61
- package/es/BenchmarkScatterChart/styles.d.ts +0 -25
- package/es/BenchmarkScatterChart/styles.js +0 -33
- package/es/BenchmarkScatterChart/utils.js +0 -353
- package/es/ComposedChart/index.d.ts +0 -5
- package/es/ComposedChart/index.js +0 -335
- package/es/ComposedChart/index.mdx +0 -43
- package/es/ComposedChart/styles.d.ts +0 -6
- package/es/ComposedChart/styles.js +0 -13
- package/es/ComposedChart/types.d.ts +0 -68
- package/es/ComposedChart/types.js +0 -1
- package/es/DataBars/CategoryBar.d.ts +0 -15
- package/es/DataBars/CategoryBar.js +0 -201
- package/es/DataBars/DeltaBar.d.ts +0 -13
- package/es/DataBars/DeltaBar.js +0 -117
- package/es/DataBars/MarkerBar.d.ts +0 -16
- package/es/DataBars/MarkerBar.js +0 -94
- package/es/DataBars/ProgressBar.d.ts +0 -12
- package/es/DataBars/ProgressBar.js +0 -71
- package/es/DataBars/index.d.ts +0 -4
- package/es/DataBars/index.js +0 -4
- package/es/DataBars/index.mdx +0 -36
- package/es/DataBars/styles.d.ts +0 -7
- package/es/DataBars/styles.js +0 -14
- package/es/DonutChart/DonutChartTooltip.d.ts +0 -11
- package/es/DonutChart/DonutChartTooltip.js +0 -26
- package/es/DonutChart/index.d.ts +0 -31
- package/es/DonutChart/index.js +0 -232
- package/es/DonutChart/index.mdx +0 -48
- package/es/DonutChart/inputParser.d.ts +0 -2
- package/es/DonutChart/inputParser.js +0 -9
- package/es/DonutChart/renderInactiveShape.d.ts +0 -2
- package/es/DonutChart/renderInactiveShape.js +0 -27
- package/es/DonutChart/styles.d.ts +0 -6
- package/es/DonutChart/styles.js +0 -13
- package/es/FunnelChart/ArrowRightIcon.d.ts +0 -5
- package/es/FunnelChart/ArrowRightIcon.js +0 -22
- package/es/FunnelChart/index.d.ts +0 -19
- package/es/FunnelChart/index.js +0 -499
- package/es/FunnelChart/index.mdx +0 -21
- package/es/FunnelChart/styles.d.ts +0 -6
- package/es/FunnelChart/styles.js +0 -13
- package/es/FunnelChart/types.d.ts +0 -28
- package/es/FunnelChart/types.js +0 -1
- package/es/Heatmaps/Calendar.d.ts +0 -18
- package/es/Heatmaps/Calendar.js +0 -155
- package/es/Heatmaps/ChartLabels.d.ts +0 -15
- package/es/Heatmaps/ChartLabels.js +0 -106
- package/es/Heatmaps/Footer.d.ts +0 -22
- package/es/Heatmaps/Footer.js +0 -105
- package/es/Heatmaps/index.d.ts +0 -28
- package/es/Heatmaps/index.js +0 -227
- package/es/Heatmaps/index.mdx +0 -70
- package/es/Heatmaps/styles.d.ts +0 -7
- package/es/Heatmaps/styles.js +0 -14
- package/es/Legend/LegendItem.d.ts +0 -10
- package/es/Legend/LegendItem.js +0 -58
- package/es/Legend/ScrollButton.d.ts +0 -9
- package/es/Legend/ScrollButton.js +0 -63
- package/es/Legend/index.d.ts +0 -14
- package/es/Legend/index.js +0 -184
- package/es/Legend/index.mdx +0 -13
- package/es/LineChart/index.d.ts +0 -9
- package/es/LineChart/index.js +0 -388
- package/es/LineChart/index.mdx +0 -49
- package/es/LineChart/styles.d.ts +0 -6
- package/es/LineChart/styles.js +0 -13
- package/es/RadarChart/index.d.ts +0 -24
- package/es/RadarChart/index.js +0 -254
- package/es/RadarChart/index.mdx +0 -52
- package/es/RadarChart/styles.d.ts +0 -5
- package/es/RadarChart/styles.js +0 -12
- package/es/ScatterChart/ScatterChartTooltip.d.ts +0 -16
- package/es/ScatterChart/ScatterChartTooltip.js +0 -76
- package/es/ScatterChart/ScatterChartTooltipRow.d.ts +0 -7
- package/es/ScatterChart/ScatterChartTooltipRow.js +0 -40
- package/es/ScatterChart/index.d.ts +0 -56
- package/es/ScatterChart/index.js +0 -342
- package/es/ScatterChart/index.mdx +0 -49
- package/es/ScatterChart/renderShape.js +0 -18
- package/es/ScatterChart/styles.d.ts +0 -6
- package/es/ScatterChart/styles.js +0 -13
- package/es/SparkChart/SparkAreaChart.d.ts +0 -12
- package/es/SparkChart/SparkAreaChart.js +0 -148
- package/es/SparkChart/SparkBarChart.d.ts +0 -9
- package/es/SparkChart/SparkBarChart.js +0 -106
- package/es/SparkChart/SparkLineChart.d.ts +0 -10
- package/es/SparkChart/SparkLineChart.js +0 -110
- package/es/SparkChart/index.d.ts +0 -3
- package/es/SparkChart/index.js +0 -3
- package/es/SparkChart/index.mdx +0 -29
- package/es/Tracker/TrackerBlock.d.ts +0 -8
- package/es/Tracker/TrackerBlock.js +0 -64
- package/es/Tracker/index.d.ts +0 -18
- package/es/Tracker/index.js +0 -105
- package/es/Tracker/index.mdx +0 -41
- package/es/Tracker/styles.d.ts +0 -5
- package/es/Tracker/styles.js +0 -12
- package/es/common/BaseAnimationTimingProps.d.ts +0 -7
- package/es/common/BaseAnimationTimingProps.js +0 -1
- package/es/common/BaseChartProps.d.ts +0 -58
- package/es/common/BaseChartProps.js +0 -1
- package/es/common/BaseSparkChartProps.d.ts +0 -14
- package/es/common/BaseSparkChartProps.js +0 -1
- package/es/common/ChartLegend.d.ts +0 -5
- package/es/common/ChartLegend.js +0 -40
- package/es/common/ChartTooltip/ChartTooltipFrame.d.ts +0 -6
- package/es/common/ChartTooltip/ChartTooltipFrame.js +0 -32
- package/es/common/ChartTooltip/ChartTooltipRow.d.ts +0 -8
- package/es/common/ChartTooltip/ChartTooltipRow.js +0 -55
- package/es/common/ChartTooltip/index.d.ts +0 -15
- package/es/common/ChartTooltip/index.js +0 -66
- package/es/common/CustomTooltipProps.d.ts +0 -12
- package/es/common/CustomTooltipProps.js +0 -1
- package/es/common/CustomYAxisTick.d.ts +0 -15
- package/es/common/CustomYAxisTick.js +0 -27
- package/es/common/NoData.d.ts +0 -10
- package/es/common/NoData.js +0 -24
- package/es/common/benchmark/index.d.ts +0 -2
- package/es/common/benchmark/types.d.ts +0 -122
- package/es/common/benchmark/types.js +0 -1
- package/es/common/benchmark/utils.js +0 -159
- package/es/common/utils.js +0 -85
- package/es/hooks/useOnWindowResize.d.ts +0 -3
- package/es/hooks/useOnWindowResize.js +0 -15
- package/es/hooks/usePrefersReducedMotion.d.ts +0 -1
- package/es/hooks/usePrefersReducedMotion.js +0 -28
- package/es/hooks/useThemeColorRange.d.ts +0 -1
- package/es/hooks/useThemeColorRange.js +0 -8
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -22
- package/es/types/charts.js +0 -8
- package/es/types/global.d.ts +0 -9
- package/es/utils/calendar.js +0 -199
- package/es/utils/getMaxLabelLength.d.ts +0 -10
- package/es/utils/getMaxLabelLength.js +0 -110
- package/es/utils/index.js +0 -32
- package/es/utils/theme.js +0 -40
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparkAreaChart.mjs","names":["ReChartsAreaChart"],"sources":["../../src/SparkChart/SparkAreaChart.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox } from '@lobehub/ui';\nimport { Skeleton } from '@lobehub/ui/base-ui';\nimport { css, cssVar, cx } from 'antd-style';\nimport { forwardRef } from 'react';\nimport { Area, AreaChart as ReChartsAreaChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';\nimport { AxisDomain } from 'recharts/types/util/types';\n\nimport BaseSparkChartProps from '@/common/BaseSparkChartProps';\nimport NoData from '@/common/NoData';\nimport { constructCategoryColors, getYAxisDomain } from '@/common/utils';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { CurveType } from '@/types/charts';\n\nexport interface SparkAreaChartProps extends BaseSparkChartProps {\n connectNulls?: boolean;\n curveType?: CurveType;\n loading?: boolean;\n showGradient?: boolean;\n stack?: boolean;\n}\n\nconst SparkAreaChart = forwardRef<HTMLDivElement, SparkAreaChartProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n\n const {\n data = [],\n categories = [],\n index,\n stack = false,\n colors = themeColorRange,\n showAnimation = false,\n animationDuration = 900,\n showGradient = true,\n curveType = 'linear',\n connectNulls = false,\n noDataText = <div />,\n autoMinValue = false,\n loading,\n minValue,\n maxValue,\n className,\n width = 112,\n height = 48,\n style,\n ...rest\n } = props;\n\n if (loading || !data) return <Skeleton height={height} width={width} />;\n\n const categoryColors = constructCategoryColors(categories, colors);\n const yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);\n\n return (\n <Flexbox\n className={className}\n height={height}\n ref={ref}\n style={{ position: 'relative', ...style }}\n width={width}\n {...rest}\n >\n <ResponsiveContainer>\n {data?.length ? (\n <ReChartsAreaChart data={data} margin={{ bottom: 1, left: 1, right: 1, top: 1 }}>\n <YAxis domain={yAxisDomain as AxisDomain} hide />\n <XAxis dataKey={index} hide />\n {categories.map((category) => {\n return (\n <defs key={category}>\n {showGradient ? (\n <linearGradient\n className={cx(css`\n color: ${categoryColors.get(category) ?? cssVar.colorPrimary};\n `)}\n id={categoryColors.get(category)}\n x1=\"0\"\n x2=\"0\"\n y1=\"0\"\n y2=\"1\"\n >\n <stop offset=\"5%\" stopColor=\"currentColor\" stopOpacity={0.4} />\n <stop offset=\"95%\" stopColor=\"currentColor\" stopOpacity={0} />\n </linearGradient>\n ) : (\n <linearGradient\n className={cx(css`\n color: ${categoryColors.get(category) ?? cssVar.colorPrimary};\n `)}\n id={categoryColors.get(category)}\n x1=\"0\"\n x2=\"0\"\n y1=\"0\"\n y2=\"1\"\n >\n <stop stopColor=\"currentColor\" stopOpacity={0.3} />\n </linearGradient>\n )}\n </defs>\n );\n })}\n {categories.map((category) => (\n <Area\n animationDuration={animationDuration}\n className={cx(css`\n stroke: ${categoryColors.get(category) ?? cssVar.colorPrimary};\n `)}\n connectNulls={connectNulls}\n dataKey={category}\n dot={false}\n fill={`url(#${categoryColors.get(category)})`}\n isAnimationActive={showAnimation}\n key={category}\n name={category}\n stackId={stack ? 'a' : undefined}\n stroke=\"\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeOpacity={1}\n strokeWidth={2}\n type={curveType}\n />\n ))}\n </ReChartsAreaChart>\n ) : (\n <NoData noDataText={noDataText} />\n )}\n </ResponsiveContainer>\n </Flexbox>\n );\n});\n\nSparkAreaChart.displayName = 'AreaChart';\n\nexport default SparkAreaChart;\n"],"mappings":";;;;;;;;;;;AAuBA,MAAM,iBAAiB,YAAiD,OAAO,QAAQ;CACrF,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,EACJ,OAAO,CAAC,GACR,aAAa,CAAC,GACd,OACA,QAAQ,OACR,SAAS,iBACT,gBAAgB,OAChB,oBAAoB,KACpB,eAAe,MACf,YAAY,UACZ,eAAe,OACf,aAAa,oBAAC,OAAD,CAAM,CAAA,GACnB,eAAe,OACf,SACA,UACA,UACA,WACA,QAAQ,KACR,SAAS,IACT,OACA,GAAG,SACD;CAEJ,IAAI,WAAW,CAAC,MAAM,OAAO,oBAAC,UAAD;EAAkB;EAAe;CAAQ,CAAA;CAEtE,MAAM,iBAAiB,wBAAwB,YAAY,MAAM;CACjE,MAAM,cAAc,eAAe,cAAc,UAAU,QAAQ;CAEnE,OACE,oBAAC,SAAD;EACa;EACH;EACH;EACL,OAAO;GAAE,UAAU;GAAY,GAAG;EAAM;EACjC;EACP,GAAI;EAEJ,UAAA,oBAAC,qBAAD,EAAA,UACG,MAAM,SACL,qBAACA,WAAD;GAAyB;GAAM,QAAQ;IAAE,QAAQ;IAAG,MAAM;IAAG,OAAO;IAAG,KAAK;GAAE;GAA9E,UAAA;IACE,oBAAC,OAAD;KAAO,QAAQ;KAA2B,MAAA;IAAM,CAAA;IAChD,oBAAC,OAAD;KAAO,SAAS;KAAO,MAAA;IAAM,CAAA;IAC5B,WAAW,KAAK,aAAa;KAC5B,OACE,oBAAC,QAAD,EAAA,UACG,eACC,qBAAC,kBAAD;MACE,WAAW,GAAG,GAAG;iCACN,eAAe,IAAI,QAAQ,KAAK,OAAO,aAAa;uBAC9D;MACD,IAAI,eAAe,IAAI,QAAQ;MAC/B,IAAG;MACH,IAAG;MACH,IAAG;MACH,IAAG;MARL,UAAA,CAUE,oBAAC,QAAD;OAAM,QAAO;OAAK,WAAU;OAAe,aAAa;MAAM,CAAA,GAC9D,oBAAC,QAAD;OAAM,QAAO;OAAM,WAAU;OAAe,aAAa;MAAI,CAAA,CAC/C;KAEhB,CAAA,IAAA,oBAAC,kBAAD;MACE,WAAW,GAAG,GAAG;iCACN,eAAe,IAAI,QAAQ,KAAK,OAAO,aAAa;uBAC9D;MACD,IAAI,eAAe,IAAI,QAAQ;MAC/B,IAAG;MACH,IAAG;MACH,IAAG;MACH,IAAG;MAEH,UAAA,oBAAC,QAAD;OAAM,WAAU;OAAe,aAAa;MAAM,CAAA;KACpC,CAAA,EAEd,GA7BK,QA6BL;IAEV,CAAC;IACA,WAAW,KAAK,aACf,oBAAC,MAAD;KACqB;KACnB,WAAW,GAAG,GAAG;4BACL,eAAe,IAAI,QAAQ,KAAK,OAAO,aAAa;iBAC/D;KACa;KACd,SAAS;KACT,KAAK;KACL,MAAM,QAAQ,eAAe,IAAI,QAAQ,EAAE;KAC3C,mBAAmB;KAEnB,MAAM;KACN,SAAS,QAAQ,MAAM,KAAA;KACvB,QAAO;KACP,eAAc;KACd,gBAAe;KACf,eAAe;KACf,aAAa;KACb,MAAM;IACP,GATM,QASN,CACF;GACgB;EAEnB,CAAA,IAAA,oBAAC,QAAD,EAAoB,WAAa,CAAA,EAEhB,CAAA;CACd,CAAA;AAEb,CAAC;AAED,eAAe,cAAc"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseSparkChartProps from "../common/BaseSparkChartProps.mjs";
|
|
2
|
+
//#region src/SparkChart/SparkBarChart.d.ts
|
|
3
|
+
export interface SparkBarChartProps extends BaseSparkChartProps {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
relative?: boolean;
|
|
6
|
+
stack?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const SparkBarChart: import("react").ForwardRefExoticComponent<SparkBarChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SparkBarChart as default };
|
|
11
|
+
//# sourceMappingURL=SparkBarChart.d.mts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useThemeColorRange } from "../hooks/useThemeColorRange.mjs";
|
|
3
|
+
import NoData from "../common/NoData.mjs";
|
|
4
|
+
import { constructCategoryColors, getYAxisDomain } from "../common/utils.mjs";
|
|
5
|
+
import { Flexbox } from "@lobehub/ui";
|
|
6
|
+
import { Skeleton } from "@lobehub/ui/base-ui";
|
|
7
|
+
import { css, cssVar, cx } from "antd-style";
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import { Bar, BarChart, ResponsiveContainer, XAxis, YAxis } from "recharts";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/SparkChart/SparkBarChart.tsx
|
|
12
|
+
const SparkBarChart = forwardRef((props, ref) => {
|
|
13
|
+
const themeColorRange = useThemeColorRange();
|
|
14
|
+
const { data = [], categories = [], index, colors = themeColorRange, stack = false, relative = false, animationDuration = 900, showAnimation = false, noDataText = /* @__PURE__ */ jsx("div", {}), loading, autoMinValue = false, minValue, maxValue, className, width = 112, height = 48, style, ...rest } = props;
|
|
15
|
+
if (loading || !data) return /* @__PURE__ */ jsx(Skeleton, {
|
|
16
|
+
height,
|
|
17
|
+
width
|
|
18
|
+
});
|
|
19
|
+
const categoryColors = constructCategoryColors(categories, colors);
|
|
20
|
+
const yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
|
|
21
|
+
return /* @__PURE__ */ jsx(Flexbox, {
|
|
22
|
+
className,
|
|
23
|
+
height,
|
|
24
|
+
ref,
|
|
25
|
+
style: {
|
|
26
|
+
position: "relative",
|
|
27
|
+
...style
|
|
28
|
+
},
|
|
29
|
+
width,
|
|
30
|
+
...rest,
|
|
31
|
+
children: /* @__PURE__ */ jsx(ResponsiveContainer, { children: data?.length ? /* @__PURE__ */ jsxs(BarChart, {
|
|
32
|
+
data,
|
|
33
|
+
margin: {
|
|
34
|
+
bottom: 0,
|
|
35
|
+
left: -1.5,
|
|
36
|
+
right: -1.5,
|
|
37
|
+
top: 0
|
|
38
|
+
},
|
|
39
|
+
stackOffset: relative ? "expand" : "none",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
42
|
+
domain: yAxisDomain,
|
|
43
|
+
hide: true
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
46
|
+
dataKey: index,
|
|
47
|
+
hide: true
|
|
48
|
+
}),
|
|
49
|
+
categories.map((category) => /* @__PURE__ */ jsx(Bar, {
|
|
50
|
+
animationDuration,
|
|
51
|
+
className: cx(css`
|
|
52
|
+
fill: ${categoryColors.get(category) ?? cssVar.colorPrimary};
|
|
53
|
+
`),
|
|
54
|
+
dataKey: category,
|
|
55
|
+
fill: "",
|
|
56
|
+
isAnimationActive: showAnimation,
|
|
57
|
+
name: category,
|
|
58
|
+
stackId: stack || relative ? "a" : void 0,
|
|
59
|
+
type: "linear"
|
|
60
|
+
}, category))
|
|
61
|
+
]
|
|
62
|
+
}) : /* @__PURE__ */ jsx(NoData, { noDataText }) })
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
SparkBarChart.displayName = "SparkBarChart";
|
|
66
|
+
//#endregion
|
|
67
|
+
export { SparkBarChart as default };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=SparkBarChart.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparkBarChart.mjs","names":["ReChartsBarChart"],"sources":["../../src/SparkChart/SparkBarChart.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox } from '@lobehub/ui';\nimport { Skeleton } from '@lobehub/ui/base-ui';\nimport { css, cssVar, cx } from 'antd-style';\nimport { forwardRef } from 'react';\nimport { Bar, BarChart as ReChartsBarChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';\nimport { AxisDomain } from 'recharts/types/util/types';\n\nimport BaseSparkChartProps from '@/common/BaseSparkChartProps';\nimport NoData from '@/common/NoData';\nimport { constructCategoryColors, getYAxisDomain } from '@/common/utils';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\n\nexport interface SparkBarChartProps extends BaseSparkChartProps {\n loading?: boolean;\n relative?: boolean;\n stack?: boolean;\n}\n\nconst SparkBarChart = forwardRef<HTMLDivElement, SparkBarChartProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n const {\n data = [],\n categories = [],\n index,\n colors = themeColorRange,\n stack = false,\n relative = false,\n animationDuration = 900,\n showAnimation = false,\n noDataText = <div />,\n loading,\n autoMinValue = false,\n minValue,\n maxValue,\n className,\n width = 112,\n height = 48,\n style,\n ...rest\n } = props;\n\n if (loading || !data) return <Skeleton height={height} width={width} />;\n\n const categoryColors = constructCategoryColors(categories, colors);\n const yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);\n\n return (\n <Flexbox\n className={className}\n height={height}\n ref={ref}\n style={{ position: 'relative', ...style }}\n width={width}\n {...rest}\n >\n <ResponsiveContainer>\n {data?.length ? (\n <ReChartsBarChart\n data={data}\n margin={{ bottom: 0, left: -1.5, right: -1.5, top: 0 }}\n stackOffset={relative ? 'expand' : 'none'}\n >\n <YAxis domain={yAxisDomain as AxisDomain} hide />\n <XAxis dataKey={index} hide />\n {categories.map((category) => (\n <Bar\n animationDuration={animationDuration}\n className={cx(css`\n fill: ${categoryColors.get(category) ?? cssVar.colorPrimary};\n `)}\n dataKey={category}\n fill=\"\"\n isAnimationActive={showAnimation}\n key={category}\n name={category}\n stackId={stack || relative ? 'a' : undefined}\n type=\"linear\"\n />\n ))}\n </ReChartsBarChart>\n ) : (\n <NoData noDataText={noDataText} />\n )}\n </ResponsiveContainer>\n </Flexbox>\n );\n});\n\nSparkBarChart.displayName = 'SparkBarChart';\n\nexport default SparkBarChart;\n"],"mappings":";;;;;;;;;;;AAoBA,MAAM,gBAAgB,YAAgD,OAAO,QAAQ;CACnF,MAAM,kBAAkB,mBAAmB;CAC3C,MAAM,EACJ,OAAO,CAAC,GACR,aAAa,CAAC,GACd,OACA,SAAS,iBACT,QAAQ,OACR,WAAW,OACX,oBAAoB,KACpB,gBAAgB,OAChB,aAAa,oBAAC,OAAD,CAAM,CAAA,GACnB,SACA,eAAe,OACf,UACA,UACA,WACA,QAAQ,KACR,SAAS,IACT,OACA,GAAG,SACD;CAEJ,IAAI,WAAW,CAAC,MAAM,OAAO,oBAAC,UAAD;EAAkB;EAAe;CAAQ,CAAA;CAEtE,MAAM,iBAAiB,wBAAwB,YAAY,MAAM;CACjE,MAAM,cAAc,eAAe,cAAc,UAAU,QAAQ;CAEnE,OACE,oBAAC,SAAD;EACa;EACH;EACH;EACL,OAAO;GAAE,UAAU;GAAY,GAAG;EAAM;EACjC;EACP,GAAI;EAEJ,UAAA,oBAAC,qBAAD,EAAA,UACG,MAAM,SACL,qBAACA,UAAD;GACQ;GACN,QAAQ;IAAE,QAAQ;IAAG,MAAM;IAAM,OAAO;IAAM,KAAK;GAAE;GACrD,aAAa,WAAW,WAAW;GAHrC,UAAA;IAKE,oBAAC,OAAD;KAAO,QAAQ;KAA2B,MAAA;IAAM,CAAA;IAChD,oBAAC,OAAD;KAAO,SAAS;KAAO,MAAA;IAAM,CAAA;IAC5B,WAAW,KAAK,aACf,oBAAC,KAAD;KACqB;KACnB,WAAW,GAAG,GAAG;0BACP,eAAe,IAAI,QAAQ,KAAK,OAAO,aAAa;iBAC7D;KACD,SAAS;KACT,MAAK;KACL,mBAAmB;KAEnB,MAAM;KACN,SAAS,SAAS,WAAW,MAAM,KAAA;KACnC,MAAK;IACN,GAJM,QAIN,CACF;GACe;EAElB,CAAA,IAAA,oBAAC,QAAD,EAAoB,WAAa,CAAA,EAEhB,CAAA;CACd,CAAA;AAEb,CAAC;AAED,cAAc,cAAc"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CurveType } from "../types/charts.mjs";
|
|
2
|
+
import BaseSparkChartProps from "../common/BaseSparkChartProps.mjs";
|
|
3
|
+
//#region src/SparkChart/SparkLineChart.d.ts
|
|
4
|
+
export interface SparkLineChartProps extends BaseSparkChartProps {
|
|
5
|
+
connectNulls?: boolean;
|
|
6
|
+
curveType?: CurveType;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const SparkLineChart: import("react").ForwardRefExoticComponent<SparkLineChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SparkLineChart as default };
|
|
12
|
+
//# sourceMappingURL=SparkLineChart.d.mts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useThemeColorRange } from "../hooks/useThemeColorRange.mjs";
|
|
3
|
+
import NoData from "../common/NoData.mjs";
|
|
4
|
+
import { constructCategoryColors, getYAxisDomain } from "../common/utils.mjs";
|
|
5
|
+
import { Flexbox } from "@lobehub/ui";
|
|
6
|
+
import { Skeleton } from "@lobehub/ui/base-ui";
|
|
7
|
+
import { css, cssVar, cx } from "antd-style";
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import { Line, LineChart, ResponsiveContainer, XAxis, YAxis } from "recharts";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/SparkChart/SparkLineChart.tsx
|
|
12
|
+
const SparkLineChart = forwardRef((props, ref) => {
|
|
13
|
+
const themeColorRange = useThemeColorRange();
|
|
14
|
+
const { data = [], categories = [], index, colors = themeColorRange, animationDuration = 900, showAnimation = false, curveType = "linear", connectNulls = false, noDataText = /* @__PURE__ */ jsx("div", {}), autoMinValue = false, minValue, maxValue, className, width = 112, height = 48, style, loading, ...rest } = props;
|
|
15
|
+
if (loading || !data) return /* @__PURE__ */ jsx(Skeleton, {
|
|
16
|
+
height,
|
|
17
|
+
width
|
|
18
|
+
});
|
|
19
|
+
const categoryColors = constructCategoryColors(categories, colors);
|
|
20
|
+
const yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
|
|
21
|
+
return /* @__PURE__ */ jsx(Flexbox, {
|
|
22
|
+
className,
|
|
23
|
+
height,
|
|
24
|
+
ref,
|
|
25
|
+
style: {
|
|
26
|
+
position: "relative",
|
|
27
|
+
...style
|
|
28
|
+
},
|
|
29
|
+
width,
|
|
30
|
+
...rest,
|
|
31
|
+
children: /* @__PURE__ */ jsx(ResponsiveContainer, { children: data?.length ? /* @__PURE__ */ jsxs(LineChart, {
|
|
32
|
+
data,
|
|
33
|
+
margin: {
|
|
34
|
+
bottom: 1,
|
|
35
|
+
left: 1,
|
|
36
|
+
right: 1,
|
|
37
|
+
top: 1
|
|
38
|
+
},
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
41
|
+
domain: yAxisDomain,
|
|
42
|
+
hide: true
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
45
|
+
dataKey: index,
|
|
46
|
+
hide: true
|
|
47
|
+
}),
|
|
48
|
+
categories.map((category) => /* @__PURE__ */ jsx(Line, {
|
|
49
|
+
animationDuration,
|
|
50
|
+
className: cx(css`
|
|
51
|
+
stroke: ${categoryColors.get(category) ?? cssVar.colorPrimary};
|
|
52
|
+
`),
|
|
53
|
+
connectNulls,
|
|
54
|
+
dataKey: category,
|
|
55
|
+
dot: false,
|
|
56
|
+
isAnimationActive: showAnimation,
|
|
57
|
+
name: category,
|
|
58
|
+
stroke: "",
|
|
59
|
+
strokeLinecap: "round",
|
|
60
|
+
strokeLinejoin: "round",
|
|
61
|
+
strokeOpacity: 1,
|
|
62
|
+
strokeWidth: 2,
|
|
63
|
+
type: curveType
|
|
64
|
+
}, category))
|
|
65
|
+
]
|
|
66
|
+
}) : /* @__PURE__ */ jsx(NoData, { noDataText }) })
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
SparkLineChart.displayName = "SparkLineChart";
|
|
70
|
+
//#endregion
|
|
71
|
+
export { SparkLineChart as default };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=SparkLineChart.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparkLineChart.mjs","names":["ReChartsLineChart"],"sources":["../../src/SparkChart/SparkLineChart.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox } from '@lobehub/ui';\nimport { Skeleton } from '@lobehub/ui/base-ui';\nimport { css, cssVar, cx } from 'antd-style';\nimport { forwardRef } from 'react';\nimport { Line, LineChart as ReChartsLineChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';\nimport { AxisDomain } from 'recharts/types/util/types';\n\nimport BaseSparkChartProps from '@/common/BaseSparkChartProps';\nimport NoData from '@/common/NoData';\nimport { constructCategoryColors, getYAxisDomain } from '@/common/utils';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { CurveType } from '@/types/charts';\n\nexport interface SparkLineChartProps extends BaseSparkChartProps {\n connectNulls?: boolean;\n curveType?: CurveType;\n loading?: boolean;\n}\n\nconst SparkLineChart = forwardRef<HTMLDivElement, SparkLineChartProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n const {\n data = [],\n categories = [],\n index,\n colors = themeColorRange,\n animationDuration = 900,\n showAnimation = false,\n curveType = 'linear',\n connectNulls = false,\n noDataText = <div />,\n autoMinValue = false,\n minValue,\n maxValue,\n className,\n width = 112,\n height = 48,\n style,\n loading,\n ...rest\n } = props;\n\n if (loading || !data) return <Skeleton height={height} width={width} />;\n\n const categoryColors = constructCategoryColors(categories, colors);\n const yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);\n\n return (\n <Flexbox\n className={className}\n height={height}\n ref={ref}\n style={{ position: 'relative', ...style }}\n width={width}\n {...rest}\n >\n <ResponsiveContainer>\n {data?.length ? (\n <ReChartsLineChart data={data} margin={{ bottom: 1, left: 1, right: 1, top: 1 }}>\n <YAxis domain={yAxisDomain as AxisDomain} hide />\n <XAxis dataKey={index} hide />\n {categories.map((category) => (\n <Line\n animationDuration={animationDuration}\n className={cx(css`\n stroke: ${categoryColors.get(category) ?? cssVar.colorPrimary};\n `)}\n connectNulls={connectNulls}\n dataKey={category}\n dot={false}\n isAnimationActive={showAnimation}\n key={category}\n name={category}\n stroke=\"\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeOpacity={1}\n strokeWidth={2}\n type={curveType}\n />\n ))}\n </ReChartsLineChart>\n ) : (\n <NoData noDataText={noDataText} />\n )}\n </ResponsiveContainer>\n </Flexbox>\n );\n});\n\nSparkLineChart.displayName = 'SparkLineChart';\n\nexport default SparkLineChart;\n"],"mappings":";;;;;;;;;;;AAqBA,MAAM,iBAAiB,YAAiD,OAAO,QAAQ;CACrF,MAAM,kBAAkB,mBAAmB;CAC3C,MAAM,EACJ,OAAO,CAAC,GACR,aAAa,CAAC,GACd,OACA,SAAS,iBACT,oBAAoB,KACpB,gBAAgB,OAChB,YAAY,UACZ,eAAe,OACf,aAAa,oBAAC,OAAD,CAAM,CAAA,GACnB,eAAe,OACf,UACA,UACA,WACA,QAAQ,KACR,SAAS,IACT,OACA,SACA,GAAG,SACD;CAEJ,IAAI,WAAW,CAAC,MAAM,OAAO,oBAAC,UAAD;EAAkB;EAAe;CAAQ,CAAA;CAEtE,MAAM,iBAAiB,wBAAwB,YAAY,MAAM;CACjE,MAAM,cAAc,eAAe,cAAc,UAAU,QAAQ;CAEnE,OACE,oBAAC,SAAD;EACa;EACH;EACH;EACL,OAAO;GAAE,UAAU;GAAY,GAAG;EAAM;EACjC;EACP,GAAI;EAEJ,UAAA,oBAAC,qBAAD,EAAA,UACG,MAAM,SACL,qBAACA,WAAD;GAAyB;GAAM,QAAQ;IAAE,QAAQ;IAAG,MAAM;IAAG,OAAO;IAAG,KAAK;GAAE;GAA9E,UAAA;IACE,oBAAC,OAAD;KAAO,QAAQ;KAA2B,MAAA;IAAM,CAAA;IAChD,oBAAC,OAAD;KAAO,SAAS;KAAO,MAAA;IAAM,CAAA;IAC5B,WAAW,KAAK,aACf,oBAAC,MAAD;KACqB;KACnB,WAAW,GAAG,GAAG;4BACL,eAAe,IAAI,QAAQ,KAAK,OAAO,aAAa;iBAC/D;KACa;KACd,SAAS;KACT,KAAK;KACL,mBAAmB;KAEnB,MAAM;KACN,QAAO;KACP,eAAc;KACd,gBAAe;KACf,eAAe;KACf,aAAa;KACb,MAAM;IACP,GARM,QAQN,CACF;GACgB;EAEnB,CAAA,IAAA,oBAAC,QAAD,EAAoB,WAAa,CAAA,EAEhB,CAAA;CACd,CAAA;AAEb,CAAC;AAED,eAAe,cAAc"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import SparkAreaChart, { SparkAreaChartProps } from "./SparkAreaChart.mjs";
|
|
2
|
+
import SparkBarChart, { SparkBarChartProps } from "./SparkBarChart.mjs";
|
|
3
|
+
import SparkLineChart, { SparkLineChartProps } from "./SparkLineChart.mjs";
|
|
4
|
+
export { SparkAreaChart, type SparkAreaChartProps, SparkBarChart, type SparkBarChartProps, SparkLineChart, type SparkLineChartProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/Tracker/TrackerBlock.d.ts
|
|
3
|
+
export interface TrackerBlockProps {
|
|
4
|
+
color?: 'success' | 'warning' | 'error' | string;
|
|
5
|
+
key?: string | number;
|
|
6
|
+
tooltip?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const TrackerBlock: import("react").ForwardRefExoticComponent<Omit<TrackerBlockProps & import("@lobehub/ui").FlexBasicProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TrackerBlock as default };
|
|
11
|
+
//# sourceMappingURL=TrackerBlock.d.mts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Flexbox } from "@lobehub/ui";
|
|
3
|
+
import { Tooltip } from "@lobehub/ui/base-ui";
|
|
4
|
+
import { createStaticStyles, cssVar } from "antd-style";
|
|
5
|
+
import { forwardRef, useMemo } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/Tracker/TrackerBlock.tsx
|
|
8
|
+
const styles = createStaticStyles(({ css }) => ({ block: css`
|
|
9
|
+
background: ${cssVar.colorFill};
|
|
10
|
+
|
|
11
|
+
&:first-child {
|
|
12
|
+
border-top-left-radius: ${cssVar.borderRadiusSM};
|
|
13
|
+
border-bottom-left-radius: ${cssVar.borderRadiusSM};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:last-child {
|
|
17
|
+
border-top-right-radius: ${cssVar.borderRadiusSM};
|
|
18
|
+
border-bottom-right-radius: ${cssVar.borderRadiusSM};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
}
|
|
24
|
+
` }));
|
|
25
|
+
const TrackerBlock = forwardRef(({ color, tooltip, width, style, ...rest }, ref) => {
|
|
26
|
+
const blockColor = useMemo(() => {
|
|
27
|
+
switch (color) {
|
|
28
|
+
case "success": return cssVar.colorSuccess;
|
|
29
|
+
case "warning": return cssVar.colorWarning;
|
|
30
|
+
case "error": return cssVar.colorError;
|
|
31
|
+
default: return color;
|
|
32
|
+
}
|
|
33
|
+
}, [color]);
|
|
34
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
35
|
+
title: tooltip,
|
|
36
|
+
children: /* @__PURE__ */ jsx(Flexbox, {
|
|
37
|
+
className: styles.block,
|
|
38
|
+
height: "100%",
|
|
39
|
+
ref,
|
|
40
|
+
style: {
|
|
41
|
+
background: blockColor,
|
|
42
|
+
...style
|
|
43
|
+
},
|
|
44
|
+
width: width || "100%",
|
|
45
|
+
...rest
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { TrackerBlock as default };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=TrackerBlock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackerBlock.mjs","names":[],"sources":["../../src/Tracker/TrackerBlock.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { Tooltip } from '@lobehub/ui/base-ui';\nimport { createStaticStyles, cssVar } from 'antd-style';\nimport { ReactNode, forwardRef, useMemo } from 'react';\n\nconst styles = createStaticStyles(({ css }) => ({\n block: css`\n background: ${cssVar.colorFill};\n\n &:first-child {\n border-top-left-radius: ${cssVar.borderRadiusSM};\n border-bottom-left-radius: ${cssVar.borderRadiusSM};\n }\n\n &:last-child {\n border-top-right-radius: ${cssVar.borderRadiusSM};\n border-bottom-right-radius: ${cssVar.borderRadiusSM};\n }\n\n &:hover {\n opacity: 0.5;\n }\n `,\n}));\n\nexport interface TrackerBlockProps {\n color?: 'success' | 'warning' | 'error' | string;\n key?: string | number;\n tooltip?: ReactNode;\n}\n\nconst TrackerBlock = forwardRef<HTMLDivElement, TrackerBlockProps & FlexboxProps>(\n ({ color, tooltip, width, style, ...rest }, ref) => {\n const blockColor = useMemo(() => {\n switch (color) {\n case 'success': {\n return cssVar.colorSuccess;\n }\n case 'warning': {\n return cssVar.colorWarning;\n }\n case 'error': {\n return cssVar.colorError;\n }\n default: {\n return color;\n }\n }\n }, [color]);\n\n return (\n <Tooltip title={tooltip}>\n <Flexbox\n className={styles.block}\n height={'100%'}\n ref={ref}\n style={{ background: blockColor, ...style }}\n width={width || '100%'}\n {...rest}\n />\n </Tooltip>\n );\n },\n);\n\nexport default TrackerBlock;\n"],"mappings":";;;;;;;AAOA,MAAM,SAAS,oBAAoB,EAAE,WAAW,EAC9C,OAAO,GAAG;kBACM,OAAO,UAAU;;;gCAGH,OAAO,eAAe;mCACnB,OAAO,eAAe;;;;iCAIxB,OAAO,eAAe;oCACnB,OAAO,eAAe;;;;;;IAO1D,EAAE;AAQF,MAAM,eAAe,YAClB,EAAE,OAAO,SAAS,OAAO,OAAO,GAAG,QAAQ,QAAQ;CAClD,MAAM,aAAa,cAAc;EAC/B,QAAQ,OAAR;GACE,KAAK,WACH,OAAO,OAAO;GAEhB,KAAK,WACH,OAAO,OAAO;GAEhB,KAAK,SACH,OAAO,OAAO;GAEhB,SACE,OAAO;EAEX;CACF,GAAG,CAAC,KAAK,CAAC;CAEV,OACE,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,oBAAC,SAAD;GACE,WAAW,OAAO;GAClB,QAAQ;GACH;GACL,OAAO;IAAE,YAAY;IAAY,GAAG;GAAM;GAC1C,OAAO,SAAS;GAChB,GAAI;EACL,CAAA;CACM,CAAA;AAEb,CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TrackerBlockProps } from "./TrackerBlock.mjs";
|
|
2
|
+
import { FlexboxProps } from "@lobehub/ui";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
//#region src/Tracker/index.d.ts
|
|
5
|
+
interface DataItem extends TrackerBlockProps {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface TrackerProps extends FlexboxProps {
|
|
9
|
+
blockGap?: number | string;
|
|
10
|
+
blockHeight?: number | string;
|
|
11
|
+
blockWidth?: number | string;
|
|
12
|
+
customTooltip?: (payload: DataItem) => ReactNode;
|
|
13
|
+
data: DataItem[];
|
|
14
|
+
leftLabel?: ReactNode;
|
|
15
|
+
onValueChange?: (payload: DataItem) => void;
|
|
16
|
+
rightLabel?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const Tracker: import("react").ForwardRefExoticComponent<Omit<TrackerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Tracker as default };
|
|
21
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import TrackerBlock from "./TrackerBlock.mjs";
|
|
3
|
+
import { styles } from "./styles.mjs";
|
|
4
|
+
import { Flexbox } from "@lobehub/ui";
|
|
5
|
+
import { TooltipGroup } from "@lobehub/ui/base-ui";
|
|
6
|
+
import { cx } from "antd-style";
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/Tracker/index.tsx
|
|
10
|
+
const Tracker = forwardRef((props, ref) => {
|
|
11
|
+
const { data = [], className, height, width = "fit-content", blockWidth = 12, blockHeight = 40, blockGap = 4, customTooltip, onValueChange, leftLabel, rightLabel, style, ...rest } = props;
|
|
12
|
+
const content = /* @__PURE__ */ jsx(TooltipGroup, { children: data.map((item, idx) => /* @__PURE__ */ jsx(TrackerBlock, {
|
|
13
|
+
color: item.color,
|
|
14
|
+
height: blockHeight,
|
|
15
|
+
onClick: () => onValueChange?.(item),
|
|
16
|
+
style: { cursor: onValueChange ? "pointer" : "default" },
|
|
17
|
+
tooltip: customTooltip ? customTooltip(item) : item.tooltip,
|
|
18
|
+
width: blockWidth
|
|
19
|
+
}, item.key ?? idx)) });
|
|
20
|
+
if (leftLabel || rightLabel) return /* @__PURE__ */ jsxs(Flexbox, {
|
|
21
|
+
className,
|
|
22
|
+
gap: 8,
|
|
23
|
+
height,
|
|
24
|
+
ref,
|
|
25
|
+
style: {
|
|
26
|
+
position: "relative",
|
|
27
|
+
...style
|
|
28
|
+
},
|
|
29
|
+
width,
|
|
30
|
+
...rest,
|
|
31
|
+
children: [/* @__PURE__ */ jsxs(Flexbox, {
|
|
32
|
+
align: "center",
|
|
33
|
+
horizontal: true,
|
|
34
|
+
justify: "space-between",
|
|
35
|
+
width: "100%",
|
|
36
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
37
|
+
className: cx(styles.strongLabel, styles.emphasis),
|
|
38
|
+
children: leftLabel
|
|
39
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: cx(styles.label, styles.emphasis),
|
|
41
|
+
style: { textAlign: "right" },
|
|
42
|
+
children: rightLabel
|
|
43
|
+
})]
|
|
44
|
+
}), /* @__PURE__ */ jsx(Flexbox, {
|
|
45
|
+
align: "center",
|
|
46
|
+
gap: blockGap,
|
|
47
|
+
height: blockHeight,
|
|
48
|
+
horizontal: true,
|
|
49
|
+
width: "100%",
|
|
50
|
+
children: content
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ jsx(Flexbox, {
|
|
54
|
+
align: "center",
|
|
55
|
+
className,
|
|
56
|
+
gap: blockGap,
|
|
57
|
+
height: height || blockHeight,
|
|
58
|
+
horizontal: true,
|
|
59
|
+
ref,
|
|
60
|
+
width,
|
|
61
|
+
...rest,
|
|
62
|
+
children: content
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
Tracker.displayName = "Tracker";
|
|
66
|
+
//#endregion
|
|
67
|
+
export { Tracker as default };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/Tracker/index.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { TooltipGroup } from '@lobehub/ui/base-ui';\nimport { cx } from 'antd-style';\nimport { ReactNode, forwardRef } from 'react';\n\nimport TrackerBlock, { TrackerBlockProps } from './TrackerBlock';\nimport { styles } from './styles';\n\ninterface DataItem extends TrackerBlockProps {\n [key: string]: any;\n}\n\nexport interface TrackerProps extends FlexboxProps {\n blockGap?: number | string;\n blockHeight?: number | string;\n blockWidth?: number | string;\n customTooltip?: (payload: DataItem) => ReactNode;\n data: DataItem[];\n leftLabel?: ReactNode;\n onValueChange?: (payload: DataItem) => void;\n rightLabel?: ReactNode;\n}\n\nconst Tracker = forwardRef<HTMLDivElement, TrackerProps>((props, ref) => {\n const {\n data = [],\n className,\n height,\n width = 'fit-content',\n blockWidth = 12,\n blockHeight = 40,\n blockGap = 4,\n customTooltip,\n onValueChange,\n leftLabel,\n rightLabel,\n style,\n ...rest\n } = props;\n\n const content = (\n <TooltipGroup>\n {data.map((item, idx) => (\n <TrackerBlock\n color={item.color}\n height={blockHeight}\n key={item.key ?? idx}\n onClick={() => onValueChange?.(item)}\n style={{\n cursor: onValueChange ? 'pointer' : 'default',\n }}\n tooltip={customTooltip ? customTooltip(item) : item.tooltip}\n width={blockWidth}\n />\n ))}\n </TooltipGroup>\n );\n\n if (leftLabel || rightLabel) {\n return (\n <Flexbox\n className={className}\n gap={8}\n height={height}\n ref={ref}\n style={{ position: 'relative', ...style }}\n width={width}\n {...rest}\n >\n <Flexbox align={'center'} horizontal justify={'space-between'} width={'100%'}>\n <div className={cx(styles.strongLabel, styles.emphasis)}>{leftLabel}</div>\n <div className={cx(styles.label, styles.emphasis)} style={{ textAlign: 'right' }}>\n {rightLabel}\n </div>\n </Flexbox>\n <Flexbox align={'center'} gap={blockGap} height={blockHeight} horizontal width={'100%'}>\n {content}\n </Flexbox>\n </Flexbox>\n );\n }\n\n return (\n <Flexbox\n align={'center'}\n className={className}\n gap={blockGap}\n height={height || blockHeight}\n horizontal\n ref={ref}\n width={width}\n {...rest}\n >\n {content}\n </Flexbox>\n );\n});\n\nTracker.displayName = 'Tracker';\n\nexport default Tracker;\n"],"mappings":";;;;;;;;;AAyBA,MAAM,UAAU,YAA0C,OAAO,QAAQ;CACvE,MAAM,EACJ,OAAO,CAAC,GACR,WACA,QACA,QAAQ,eACR,aAAa,IACb,cAAc,IACd,WAAW,GACX,eACA,eACA,WACA,YACA,OACA,GAAG,SACD;CAEJ,MAAM,UACJ,oBAAC,cAAD,EAAA,UACG,KAAK,KAAK,MAAM,QACf,oBAAC,cAAD;EACE,OAAO,KAAK;EACZ,QAAQ;EAER,eAAe,gBAAgB,IAAI;EACnC,OAAO,EACL,QAAQ,gBAAgB,YAAY,UACtC;EACA,SAAS,gBAAgB,cAAc,IAAI,IAAI,KAAK;EACpD,OAAO;CACR,GAPM,KAAK,OAAO,GAOlB,CACF,EACW,CAAA;CAGhB,IAAI,aAAa,YACf,OACE,qBAAC,SAAD;EACa;EACX,KAAK;EACG;EACH;EACL,OAAO;GAAE,UAAU;GAAY,GAAG;EAAM;EACjC;EACP,GAAI;EAPN,UAAA,CASE,qBAAC,SAAD;GAAS,OAAO;GAAU,YAAA;GAAW,SAAS;GAAiB,OAAO;GAAtE,UAAA,CACE,oBAAC,OAAD;IAAK,WAAW,GAAG,OAAO,aAAa,OAAO,QAAQ;IAAI,UAAA;GAAe,CAAA,GACzE,oBAAC,OAAD;IAAK,WAAW,GAAG,OAAO,OAAO,OAAO,QAAQ;IAAG,OAAO,EAAE,WAAW,QAAQ;IAC5E,UAAA;GACE,CAAA,CACE;EACT,CAAA,GAAA,oBAAC,SAAD;GAAS,OAAO;GAAU,KAAK;GAAU,QAAQ;GAAa,YAAA;GAAW,OAAO;GAC7E,UAAA;EACM,CAAA,CACF;;CAIb,OACE,oBAAC,SAAD;EACE,OAAO;EACI;EACX,KAAK;EACL,QAAQ,UAAU;EAClB,YAAA;EACK;EACE;EACP,GAAI;EAEH,UAAA;CACM,CAAA;AAEb,CAAC;AAED,QAAQ,cAAc"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createStaticStyles } from "antd-style";
|
|
2
|
+
//#region src/Tracker/styles.ts
|
|
3
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
4
|
+
emphasis: css`
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
text-overflow: ellipsis;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
`,
|
|
9
|
+
label: css`
|
|
10
|
+
font-size: 12px;
|
|
11
|
+
line-height: 16px;
|
|
12
|
+
color: ${cssVar.colorTextDescription};
|
|
13
|
+
`,
|
|
14
|
+
strongLabel: css`
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
line-height: 16px;
|
|
18
|
+
fill: ${cssVar.colorTextSecondary};
|
|
19
|
+
`
|
|
20
|
+
}));
|
|
21
|
+
//#endregion
|
|
22
|
+
export { styles };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=styles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.mjs","names":[],"sources":["../../src/Tracker/styles.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n emphasis: css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n label: css`\n font-size: 12px;\n line-height: 16px;\n color: ${cssVar.colorTextDescription};\n `,\n strongLabel: css`\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n fill: ${cssVar.colorTextSecondary};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,UAAU,GAAG;;;;;CAKb,OAAO,GAAG;;;aAGC,OAAO,qBAAqB;;CAEvC,aAAa,GAAG;;;;YAIN,OAAO,mBAAmB;;AAEtC,EAAE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/common/BaseAnimationTimingProps.d.ts
|
|
2
|
+
interface BaseAnimationTimingProps {
|
|
3
|
+
animationDuration?: number;
|
|
4
|
+
height?: string | number;
|
|
5
|
+
showAnimation?: boolean;
|
|
6
|
+
width?: string | number;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BaseAnimationTimingProps as default };
|
|
10
|
+
//# sourceMappingURL=BaseAnimationTimingProps.d.mts.map
|
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { NoDataProps } from "./NoData.mjs";
|
|
2
|
+
import { IntervalType, LabelFormatter, ValueFormatter } from "../types/charts.mjs";
|
|
3
|
+
import BaseAnimationTimingProps from "./BaseAnimationTimingProps.mjs";
|
|
4
|
+
import { CustomTooltipProps } from "./CustomTooltipProps.mjs";
|
|
5
|
+
import { ComponentType, HTMLAttributes } from "react";
|
|
6
|
+
import { AxisDomain } from "recharts/types/util/types";
|
|
7
|
+
//#region src/common/BaseChartProps.d.ts
|
|
8
|
+
type FixedProps = {
|
|
9
|
+
categoryClicked: string;
|
|
10
|
+
eventType: 'dot' | 'category' | 'bar' | 'slice' | 'bubble';
|
|
11
|
+
};
|
|
12
|
+
type BaseEventProps = FixedProps & {
|
|
13
|
+
[key: string]: number | string;
|
|
14
|
+
};
|
|
15
|
+
export type EventProps = BaseEventProps | null | undefined;
|
|
16
|
+
interface BaseChartProps extends BaseAnimationTimingProps, HTMLAttributes<HTMLDivElement> {
|
|
17
|
+
allowDecimals?: boolean;
|
|
18
|
+
autoMinValue?: boolean;
|
|
19
|
+
categories: string[];
|
|
20
|
+
colors?: string[];
|
|
21
|
+
customCategories?: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
};
|
|
24
|
+
customTooltip?: ComponentType<CustomTooltipProps>;
|
|
25
|
+
data: any[];
|
|
26
|
+
enableLegendSlider?: boolean;
|
|
27
|
+
height?: string | number;
|
|
28
|
+
index: string;
|
|
29
|
+
intervalType?: IntervalType;
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
maxValue?: number;
|
|
32
|
+
minValue?: number;
|
|
33
|
+
noDataText?: NoDataProps['noDataText'];
|
|
34
|
+
onValueChange?: (value: EventProps) => void;
|
|
35
|
+
rotateLabelX?: {
|
|
36
|
+
angle: number;
|
|
37
|
+
verticalShift?: number;
|
|
38
|
+
xAxisHeight?: number;
|
|
39
|
+
};
|
|
40
|
+
showGridLines?: boolean;
|
|
41
|
+
showLegend?: boolean;
|
|
42
|
+
showTooltip?: boolean;
|
|
43
|
+
showXAxis?: boolean;
|
|
44
|
+
showYAxis?: boolean;
|
|
45
|
+
startEndOnly?: boolean;
|
|
46
|
+
tickGap?: number;
|
|
47
|
+
valueFormatter?: ValueFormatter;
|
|
48
|
+
width?: string | number;
|
|
49
|
+
xAxisLabel?: string;
|
|
50
|
+
xAxisLabelFormatter?: LabelFormatter;
|
|
51
|
+
yAxisAlign?: 'left' | 'right';
|
|
52
|
+
/**
|
|
53
|
+
* Forward to recharts `YAxis.domain`. When set, overrides `autoMinValue` / `minValue` / `maxValue`.
|
|
54
|
+
*/
|
|
55
|
+
yAxisDomain?: AxisDomain;
|
|
56
|
+
yAxisLabel?: string;
|
|
57
|
+
yAxisWidth?: number;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { BaseChartProps as default };
|
|
61
|
+
//# sourceMappingURL=BaseChartProps.d.mts.map
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NoDataProps } from "./NoData.mjs";
|
|
2
|
+
import BaseAnimationTimingProps from "./BaseAnimationTimingProps.mjs";
|
|
3
|
+
import { HTMLAttributes } from "react";
|
|
4
|
+
//#region src/common/BaseSparkChartProps.d.ts
|
|
5
|
+
interface BaseSparkChartProps extends BaseAnimationTimingProps, HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
autoMinValue?: boolean;
|
|
7
|
+
categories: string[];
|
|
8
|
+
colors?: string[];
|
|
9
|
+
data: any[];
|
|
10
|
+
index: string;
|
|
11
|
+
maxValue?: number;
|
|
12
|
+
minValue?: number;
|
|
13
|
+
noDataText?: NoDataProps['noDataText'];
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { BaseSparkChartProps as default };
|
|
17
|
+
//# sourceMappingURL=BaseSparkChartProps.d.mts.map
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
//#region src/common/ChartLegend.d.ts
|
|
3
|
+
declare const ChartLegend: ({ payload }: any, categoryColors: Map<string, string>, setLegendHeight: Dispatch<SetStateAction<number>>, activeLegend: string | undefined, onClick?: (category: string, color: string) => void, enableLegendSlider?: boolean, customCategories?: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { ChartLegend as default };
|
|
8
|
+
//# sourceMappingURL=ChartLegend.d.mts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Legend from "../Legend/index.mjs";
|
|
2
|
+
import { useOnWindowResize } from "../hooks/useOnWindowResize.mjs";
|
|
3
|
+
import { Flexbox } from "@lobehub/ui";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/common/ChartLegend.tsx
|
|
7
|
+
const calculateHeight = (height) => height ? Number(height) + 20 : 60;
|
|
8
|
+
const ChartLegend = ({ payload }, categoryColors, setLegendHeight, activeLegend, onClick, enableLegendSlider, customCategories) => {
|
|
9
|
+
const legendRef = useRef(null);
|
|
10
|
+
useOnWindowResize(() => {
|
|
11
|
+
setLegendHeight(calculateHeight(legendRef.current?.clientHeight));
|
|
12
|
+
});
|
|
13
|
+
const filteredPayload = payload.filter((item) => item.type !== "none");
|
|
14
|
+
return /* @__PURE__ */ jsx(Flexbox, {
|
|
15
|
+
align: "center",
|
|
16
|
+
horizontal: true,
|
|
17
|
+
justify: "flex-end",
|
|
18
|
+
ref: legendRef,
|
|
19
|
+
children: /* @__PURE__ */ jsx(Legend, {
|
|
20
|
+
activeLegend,
|
|
21
|
+
categories: filteredPayload.map((entry) => entry.value),
|
|
22
|
+
colors: filteredPayload.map((entry) => categoryColors.get(entry.value)),
|
|
23
|
+
customCategories,
|
|
24
|
+
enableLegendSlider,
|
|
25
|
+
onClickLegendItem: onClick
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ChartLegend as default };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=ChartLegend.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartLegend.mjs","names":[],"sources":["../../src/common/ChartLegend.tsx"],"sourcesContent":["import { Flexbox } from '@lobehub/ui';\nimport { Dispatch, SetStateAction, useRef } from 'react';\n\nimport Legend from '@/Legend';\nimport { useOnWindowResize } from '@/hooks/useOnWindowResize';\n\nconst calculateHeight = (height: number | undefined) =>\n height\n ? Number(height) + 20 // 20px extra padding\n : 60; // default height\n\nconst ChartLegend = (\n { payload }: any,\n categoryColors: Map<string, string>,\n setLegendHeight: Dispatch<SetStateAction<number>>,\n activeLegend: string | undefined,\n onClick?: (category: string, color: string) => void,\n enableLegendSlider?: boolean,\n customCategories?: {\n [key: string]: string;\n },\n) => {\n const legendRef = useRef<HTMLDivElement>(null);\n\n useOnWindowResize(() => {\n setLegendHeight(calculateHeight(legendRef.current?.clientHeight));\n });\n\n const filteredPayload = payload.filter((item: any) => item.type !== 'none');\n\n return (\n <Flexbox align={'center'} horizontal justify={'flex-end'} ref={legendRef}>\n <Legend\n activeLegend={activeLegend}\n categories={filteredPayload.map((entry: any) => entry.value)}\n colors={filteredPayload.map((entry: any) => categoryColors.get(entry.value))}\n customCategories={customCategories}\n enableLegendSlider={enableLegendSlider}\n onClickLegendItem={onClick}\n />\n </Flexbox>\n );\n};\n\nexport default ChartLegend;\n"],"mappings":";;;;;;AAMA,MAAM,mBAAmB,WACvB,SACI,OAAO,MAAM,IAAI,KACjB;AAEN,MAAM,eACJ,EAAE,WACF,gBACA,iBACA,cACA,SACA,oBACA,qBAGG;CACH,MAAM,YAAY,OAAuB,IAAI;CAE7C,wBAAwB;EACtB,gBAAgB,gBAAgB,UAAU,SAAS,YAAY,CAAC;CAClE,CAAC;CAED,MAAM,kBAAkB,QAAQ,QAAQ,SAAc,KAAK,SAAS,MAAM;CAE1E,OACE,oBAAC,SAAD;EAAS,OAAO;EAAU,YAAA;EAAW,SAAS;EAAY,KAAK;EAC7D,UAAA,oBAAC,QAAD;GACgB;GACd,YAAY,gBAAgB,KAAK,UAAe,MAAM,KAAK;GAC3D,QAAQ,gBAAgB,KAAK,UAAe,eAAe,IAAI,MAAM,KAAK,CAAC;GACzD;GACE;GACpB,mBAAmB;EACpB,CAAA;CACM,CAAA;AAEb"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/common/ChartTooltip/ChartTooltipFrame.d.ts
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
container: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const ChartTooltipFrame: import("react").NamedExoticComponent<import("@lobehub/ui").FlexBasicProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { ChartTooltipFrame as default };
|
|
8
|
+
//# sourceMappingURL=ChartTooltipFrame.d.mts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Flexbox } from "@lobehub/ui";
|
|
2
|
+
import { createStaticStyles } from "antd-style";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/common/ChartTooltip/ChartTooltipFrame.tsx
|
|
6
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({ container: css`
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
|
|
9
|
+
width: max-content;
|
|
10
|
+
min-width: 160px;
|
|
11
|
+
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
12
|
+
border-radius: ${cssVar.borderRadiusLG};
|
|
13
|
+
|
|
14
|
+
background: ${cssVar.colorBgElevated};
|
|
15
|
+
box-shadow: ${cssVar.boxShadow};
|
|
16
|
+
` }));
|
|
17
|
+
const ChartTooltipFrame = memo(({ children, ...rest }) => {
|
|
18
|
+
return /* @__PURE__ */ jsx(Flexbox, {
|
|
19
|
+
className: styles.container,
|
|
20
|
+
...rest,
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ChartTooltipFrame, ChartTooltipFrame as default, styles };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=ChartTooltipFrame.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartTooltipFrame.mjs","names":[],"sources":["../../../src/common/ChartTooltip/ChartTooltipFrame.tsx"],"sourcesContent":["import { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { createStaticStyles } from 'antd-style';\nimport { memo } from 'react';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n container: css`\n overflow: hidden;\n\n width: max-content;\n min-width: 160px;\n border: 1px solid ${cssVar.colorBorderSecondary};\n border-radius: ${cssVar.borderRadiusLG};\n\n background: ${cssVar.colorBgElevated};\n box-shadow: ${cssVar.boxShadow};\n `,\n}));\n\nexport const ChartTooltipFrame = memo<FlexboxProps>(({ children, ...rest }) => {\n return (\n <Flexbox className={styles.container} {...rest}>\n {children}\n </Flexbox>\n );\n});\n\nexport default ChartTooltipFrame;\n"],"mappings":";;;;;AAIA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc,EAC7D,WAAW,GAAG;;;;;wBAKQ,OAAO,qBAAqB;qBAC/B,OAAO,eAAe;;kBAEzB,OAAO,gBAAgB;kBACvB,OAAO,UAAU;IAEnC,EAAE;AAEF,MAAa,oBAAoB,MAAoB,EAAE,UAAU,GAAG,WAAW;CAC7E,OACE,oBAAC,SAAD;EAAS,WAAW,OAAO;EAAW,GAAI;EACvC;CACM,CAAA;AAEb,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/common/ChartTooltip/ChartTooltipRow.d.ts
|
|
2
|
+
export interface ChartTooltipRowProps {
|
|
3
|
+
color: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
declare const ChartTooltipRow: import("react").NamedExoticComponent<ChartTooltipRowProps>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ChartTooltipRow as default };
|
|
10
|
+
//# sourceMappingURL=ChartTooltipRow.d.mts.map
|