@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,31 @@
|
|
|
1
|
+
//#region src/FunnelChart/types.d.ts
|
|
2
|
+
export type Tooltip = {
|
|
3
|
+
data?: {
|
|
4
|
+
className?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
dataKey: string;
|
|
7
|
+
fill?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
payload?: any;
|
|
10
|
+
value: number;
|
|
11
|
+
};
|
|
12
|
+
index?: number;
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
export type DataT = {
|
|
17
|
+
name: string;
|
|
18
|
+
value: number;
|
|
19
|
+
};
|
|
20
|
+
export type FormattedDataT = DataT & {
|
|
21
|
+
barHeight: number;
|
|
22
|
+
nextBarHeight: number;
|
|
23
|
+
nextNormalizedValue: number;
|
|
24
|
+
nextStartX: number;
|
|
25
|
+
nextValue: number;
|
|
26
|
+
normalizedValue: number;
|
|
27
|
+
startX: number;
|
|
28
|
+
startY: number;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=types.d.mts.map
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Activity, Labels, Week } from "../types/charts.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/Heatmaps/Calendar.d.ts
|
|
4
|
+
interface CalendarProps {
|
|
5
|
+
blockMargin: number;
|
|
6
|
+
blockRadius: number;
|
|
7
|
+
blockSize: number;
|
|
8
|
+
colorScale: string[];
|
|
9
|
+
customTooltip?: (activity: Activity) => ReactNode;
|
|
10
|
+
enableAnimation: boolean;
|
|
11
|
+
labelHeight: number;
|
|
12
|
+
labels: Labels;
|
|
13
|
+
maxLevel: number;
|
|
14
|
+
onValueChange?: (value: Activity) => void;
|
|
15
|
+
showTooltip: boolean;
|
|
16
|
+
weeks: Week[];
|
|
17
|
+
}
|
|
18
|
+
declare const Calendar: import("react").NamedExoticComponent<CalendarProps>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Calendar as default };
|
|
21
|
+
//# sourceMappingURL=Calendar.d.mts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Tooltip } from "@lobehub/ui/base-ui";
|
|
2
|
+
import { keyframes } from "antd-style";
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
5
|
+
import isEqual from "fast-deep-equal";
|
|
6
|
+
//#region src/Heatmaps/Calendar.tsx
|
|
7
|
+
const loadingAnimation = keyframes`
|
|
8
|
+
0% {
|
|
9
|
+
fill: var(--lobe-heatmaps-loading);
|
|
10
|
+
}
|
|
11
|
+
50% {
|
|
12
|
+
fill: var(--lobe-heatmaps-loading-active);
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
fill: var(--lobe-heatmaps-loading);
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const getTooltipTitle = (activity, customTooltip, labels) => {
|
|
19
|
+
if (customTooltip) return customTooltip(activity);
|
|
20
|
+
if (labels?.tooltip) return labels.tooltip.replace("{{count}}", String(activity.count)).replace("{{date}}", String(activity.date));
|
|
21
|
+
return `${activity.count} activities on ${activity.date}`;
|
|
22
|
+
};
|
|
23
|
+
const CalendarBlock = memo(({ activity, blockSize, blockRadius, color, labelHeight, blockMargin, dayIndex, enableAnimation, animationDelay, onValueChange, showTooltip, customTooltip, labels }) => {
|
|
24
|
+
const style = useMemo(() => ({
|
|
25
|
+
cursor: onValueChange ? "pointer" : void 0,
|
|
26
|
+
...enableAnimation && {
|
|
27
|
+
animation: `${loadingAnimation} 1.75s ease-in-out infinite`,
|
|
28
|
+
animationDelay: `${animationDelay}ms`
|
|
29
|
+
}
|
|
30
|
+
}), [
|
|
31
|
+
enableAnimation,
|
|
32
|
+
animationDelay,
|
|
33
|
+
onValueChange
|
|
34
|
+
]);
|
|
35
|
+
const y = labelHeight + (blockSize + blockMargin) * dayIndex;
|
|
36
|
+
const tooltipTitle = useMemo(() => getTooltipTitle(activity, customTooltip, labels), [
|
|
37
|
+
activity,
|
|
38
|
+
customTooltip,
|
|
39
|
+
labels
|
|
40
|
+
]);
|
|
41
|
+
const block = /* @__PURE__ */ jsx("rect", {
|
|
42
|
+
"data-date": activity.date,
|
|
43
|
+
"data-level": activity.level,
|
|
44
|
+
fill: color,
|
|
45
|
+
height: blockSize,
|
|
46
|
+
onClick: onValueChange ? () => onValueChange(activity) : void 0,
|
|
47
|
+
rx: blockRadius,
|
|
48
|
+
ry: blockRadius,
|
|
49
|
+
style,
|
|
50
|
+
width: blockSize,
|
|
51
|
+
x: 0,
|
|
52
|
+
y
|
|
53
|
+
});
|
|
54
|
+
return showTooltip ? /* @__PURE__ */ jsx(Tooltip, {
|
|
55
|
+
title: tooltipTitle,
|
|
56
|
+
children: block
|
|
57
|
+
}) : block;
|
|
58
|
+
}, isEqual);
|
|
59
|
+
CalendarBlock.displayName = "CalendarBlock";
|
|
60
|
+
const CalendarWeek = memo(({ week, weekIndex, blockMargin, blockRadius, blockSize, colorScale, customTooltip, enableAnimation, labelHeight, labels, maxLevel, onValueChange, showTooltip }) => {
|
|
61
|
+
return /* @__PURE__ */ jsx("g", {
|
|
62
|
+
transform: `translate(${(blockSize + blockMargin) * weekIndex}, 0)`,
|
|
63
|
+
children: week.map((activity, dayIndex) => {
|
|
64
|
+
if (!activity) return null;
|
|
65
|
+
if (activity.level < 0 || activity.level > maxLevel) throw new RangeError(`Provided activity level ${activity.level} for ${activity.date} is out of range. It must be between 0 and ${maxLevel}.`);
|
|
66
|
+
const animationDelay = weekIndex * 20 + dayIndex * 20;
|
|
67
|
+
const color = colorScale[activity.level];
|
|
68
|
+
return /* @__PURE__ */ jsx(CalendarBlock, {
|
|
69
|
+
activity,
|
|
70
|
+
animationDelay,
|
|
71
|
+
blockMargin,
|
|
72
|
+
blockRadius,
|
|
73
|
+
blockSize,
|
|
74
|
+
color,
|
|
75
|
+
customTooltip,
|
|
76
|
+
dayIndex,
|
|
77
|
+
enableAnimation,
|
|
78
|
+
labelHeight,
|
|
79
|
+
labels,
|
|
80
|
+
onValueChange,
|
|
81
|
+
showTooltip
|
|
82
|
+
}, activity.date);
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}, isEqual);
|
|
86
|
+
CalendarWeek.displayName = "CalendarWeek";
|
|
87
|
+
const Calendar = memo(({ weeks, maxLevel, enableAnimation, colorScale, blockSize, blockRadius, blockMargin, labelHeight, showTooltip, customTooltip, labels, onValueChange }) => {
|
|
88
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: weeks.map((week, weekIndex) => /* @__PURE__ */ jsx(CalendarWeek, {
|
|
89
|
+
blockMargin,
|
|
90
|
+
blockRadius,
|
|
91
|
+
blockSize,
|
|
92
|
+
colorScale,
|
|
93
|
+
customTooltip,
|
|
94
|
+
enableAnimation,
|
|
95
|
+
labelHeight,
|
|
96
|
+
labels,
|
|
97
|
+
maxLevel,
|
|
98
|
+
onValueChange,
|
|
99
|
+
showTooltip,
|
|
100
|
+
week,
|
|
101
|
+
weekIndex
|
|
102
|
+
}, weekIndex)) });
|
|
103
|
+
}, isEqual);
|
|
104
|
+
Calendar.displayName = "Calendar";
|
|
105
|
+
//#endregion
|
|
106
|
+
export { Calendar as default };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=Calendar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.mjs","names":[],"sources":["../../src/Heatmaps/Calendar.tsx"],"sourcesContent":["import { Tooltip } from '@lobehub/ui/base-ui';\nimport { keyframes } from 'antd-style';\nimport isEqual from 'fast-deep-equal';\nimport { CSSProperties, ReactNode, memo, useMemo } from 'react';\n\nimport type { Activity, Labels, Week } from '@/types/charts';\n\n// Move keyframes outside component to avoid recreation on each render\nconst loadingAnimation = keyframes`\n 0% {\n fill: var(--lobe-heatmaps-loading);\n }\n 50% {\n fill: var(--lobe-heatmaps-loading-active);\n }\n 100% {\n fill: var(--lobe-heatmaps-loading);\n }\n`;\n\n// Helper function to generate tooltip title (moved outside component)\nconst getTooltipTitle = (\n activity: Activity,\n customTooltip?: (activity: Activity) => ReactNode,\n labels?: Labels,\n): ReactNode => {\n if (customTooltip) {\n return customTooltip(activity);\n }\n if (labels?.tooltip) {\n return labels.tooltip\n .replace('{{count}}', String(activity.count))\n .replace('{{date}}', String(activity.date));\n }\n return `${activity.count} activities on ${activity.date}`;\n};\n\ninterface CalendarBlockProps {\n activity: Activity;\n animationDelay: number;\n blockMargin: number;\n blockRadius: number;\n blockSize: number;\n color: string;\n customTooltip?: (activity: Activity) => ReactNode;\n dayIndex: number;\n enableAnimation: boolean;\n labelHeight: number;\n labels?: Labels;\n onValueChange?: (value: Activity) => void;\n showTooltip: boolean;\n}\n\n// Memoized block component - only re-renders when its own props change\nconst CalendarBlock = memo<CalendarBlockProps>(\n ({\n activity,\n blockSize,\n blockRadius,\n color,\n labelHeight,\n blockMargin,\n dayIndex,\n enableAnimation,\n animationDelay,\n onValueChange,\n showTooltip,\n customTooltip,\n labels,\n }) => {\n const style = useMemo<CSSProperties>(\n () => ({\n cursor: onValueChange ? 'pointer' : undefined,\n ...(enableAnimation && {\n animation: `${loadingAnimation} 1.75s ease-in-out infinite`,\n animationDelay: `${animationDelay}ms`,\n }),\n }),\n [enableAnimation, animationDelay, onValueChange],\n );\n\n const y = labelHeight + (blockSize + blockMargin) * dayIndex;\n const tooltipTitle = useMemo(\n () => getTooltipTitle(activity, customTooltip, labels),\n [activity, customTooltip, labels],\n );\n\n const block = (\n <rect\n data-date={activity.date}\n data-level={activity.level}\n fill={color}\n height={blockSize}\n onClick={onValueChange ? () => onValueChange(activity) : undefined}\n rx={blockRadius}\n ry={blockRadius}\n style={style}\n width={blockSize}\n x={0}\n y={y}\n />\n );\n\n return showTooltip ? <Tooltip title={tooltipTitle}>{block}</Tooltip> : block;\n },\n isEqual,\n);\n\nCalendarBlock.displayName = 'CalendarBlock';\n\ninterface CalendarWeekProps {\n blockMargin: number;\n blockRadius: number;\n blockSize: number;\n colorScale: string[];\n customTooltip?: (activity: Activity) => ReactNode;\n enableAnimation: boolean;\n labelHeight: number;\n labels: Labels;\n maxLevel: number;\n onValueChange?: (value: Activity) => void;\n showTooltip: boolean;\n week: Week;\n weekIndex: number;\n}\n\n// Memoized week component - only re-renders when its own week data changes\nconst CalendarWeek = memo<CalendarWeekProps>(\n ({\n week,\n weekIndex,\n blockMargin,\n blockRadius,\n blockSize,\n colorScale,\n customTooltip,\n enableAnimation,\n labelHeight,\n labels,\n maxLevel,\n onValueChange,\n showTooltip,\n }) => {\n return (\n <g transform={`translate(${(blockSize + blockMargin) * weekIndex}, 0)`}>\n {week.map((activity, dayIndex) => {\n if (!activity) {\n return null;\n }\n\n if (activity.level < 0 || activity.level > maxLevel) {\n throw new RangeError(\n `Provided activity level ${activity.level} for ${activity.date} is out of range. It must be between 0 and ${maxLevel}.`,\n );\n }\n\n const animationDelay = weekIndex * 20 + dayIndex * 20;\n const color = colorScale[activity.level];\n\n return (\n <CalendarBlock\n activity={activity}\n animationDelay={animationDelay}\n blockMargin={blockMargin}\n blockRadius={blockRadius}\n blockSize={blockSize}\n color={color}\n customTooltip={customTooltip}\n dayIndex={dayIndex}\n enableAnimation={enableAnimation}\n key={activity.date}\n labelHeight={labelHeight}\n labels={labels}\n onValueChange={onValueChange}\n showTooltip={showTooltip}\n />\n );\n })}\n </g>\n );\n },\n isEqual,\n);\n\nCalendarWeek.displayName = 'CalendarWeek';\n\ninterface CalendarProps {\n blockMargin: number;\n blockRadius: number;\n blockSize: number;\n colorScale: string[];\n customTooltip?: (activity: Activity) => ReactNode;\n enableAnimation: boolean;\n labelHeight: number;\n labels: Labels;\n maxLevel: number;\n onValueChange?: (value: Activity) => void;\n showTooltip: boolean;\n weeks: Week[];\n}\n\nconst Calendar = memo<CalendarProps>(\n ({\n weeks,\n maxLevel,\n enableAnimation,\n colorScale,\n blockSize,\n blockRadius,\n blockMargin,\n labelHeight,\n showTooltip,\n customTooltip,\n labels,\n onValueChange,\n }) => {\n return (\n <>\n {weeks.map((week, weekIndex) => (\n <CalendarWeek\n blockMargin={blockMargin}\n blockRadius={blockRadius}\n blockSize={blockSize}\n colorScale={colorScale}\n customTooltip={customTooltip}\n enableAnimation={enableAnimation}\n key={weekIndex}\n labelHeight={labelHeight}\n labels={labels}\n maxLevel={maxLevel}\n onValueChange={onValueChange}\n showTooltip={showTooltip}\n week={week}\n weekIndex={weekIndex}\n />\n ))}\n </>\n );\n },\n isEqual,\n);\n\nCalendar.displayName = 'Calendar';\n\nexport default Calendar;\n"],"mappings":";;;;;;AAQA,MAAM,mBAAmB,SAAS;;;;;;;;;;;AAalC,MAAM,mBACJ,UACA,eACA,WACc;CACd,IAAI,eACF,OAAO,cAAc,QAAQ;CAE/B,IAAI,QAAQ,SACV,OAAO,OAAO,QACX,QAAQ,aAAa,OAAO,SAAS,KAAK,CAAC,CAAC,CAC5C,QAAQ,YAAY,OAAO,SAAS,IAAI,CAAC;CAE9C,OAAO,GAAG,SAAS,MAAM,iBAAiB,SAAS;AACrD;AAmBA,MAAM,gBAAgB,MACnB,EACC,UACA,WACA,aACA,OACA,aACA,aACA,UACA,iBACA,gBACA,eACA,aACA,eACA,aACI;CACJ,MAAM,QAAQ,eACL;EACL,QAAQ,gBAAgB,YAAY,KAAA;EACpC,GAAI,mBAAmB;GACrB,WAAW,GAAG,iBAAiB;GAC/B,gBAAgB,GAAG,eAAe;EACpC;CACF,IACA;EAAC;EAAiB;EAAgB;CAAa,CACjD;CAEA,MAAM,IAAI,eAAe,YAAY,eAAe;CACpD,MAAM,eAAe,cACb,gBAAgB,UAAU,eAAe,MAAM,GACrD;EAAC;EAAU;EAAe;CAAM,CAClC;CAEA,M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Week } from "../types/charts.mjs";
|
|
2
|
+
//#region src/Heatmaps/ChartLabels.d.ts
|
|
3
|
+
interface ChartLabelsProps {
|
|
4
|
+
blockMargin: number;
|
|
5
|
+
blockSize: number;
|
|
6
|
+
hideMonthLabels: boolean;
|
|
7
|
+
labelHeight: number;
|
|
8
|
+
labelMargin: number;
|
|
9
|
+
labels: Labels;
|
|
10
|
+
showWeekdayLabels: boolean;
|
|
11
|
+
weekStart: number;
|
|
12
|
+
weeks: Week[];
|
|
13
|
+
}
|
|
14
|
+
declare const ChartLabels: import("react").NamedExoticComponent<ChartLabelsProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ChartLabels as default };
|
|
17
|
+
//# sourceMappingURL=ChartLabels.d.mts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { getMonthLabels } from "../utils/calendar.mjs";
|
|
2
|
+
import { cx } from "antd-style";
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import isEqual from "fast-deep-equal";
|
|
6
|
+
//#region src/Heatmaps/ChartLabels.tsx
|
|
7
|
+
const WeekdayLabels = ({ blockMargin, blockSize, firstWeek, labelHeight, labelMargin, weekStart, weekdays }) => {
|
|
8
|
+
const labels = useMemo(() => {
|
|
9
|
+
const maxLength = Math.floor((blockSize * 7 + blockMargin * 6) / 12);
|
|
10
|
+
return firstWeek.map((_, index) => {
|
|
11
|
+
if (index % 2 === 0) return null;
|
|
12
|
+
const dayIndex = (index + weekStart) % 7;
|
|
13
|
+
const label = weekdays?.[dayIndex] || "";
|
|
14
|
+
return {
|
|
15
|
+
dayIndex,
|
|
16
|
+
index,
|
|
17
|
+
label: label.length > maxLength ? label.slice(0, maxLength) + "..." : label,
|
|
18
|
+
y: labelHeight + (blockSize + blockMargin) * index + blockSize / 2
|
|
19
|
+
};
|
|
20
|
+
}).filter((item) => item !== null);
|
|
21
|
+
}, [
|
|
22
|
+
firstWeek,
|
|
23
|
+
weekStart,
|
|
24
|
+
blockSize,
|
|
25
|
+
blockMargin,
|
|
26
|
+
labelHeight,
|
|
27
|
+
weekdays
|
|
28
|
+
]);
|
|
29
|
+
if (labels.length === 0) return null;
|
|
30
|
+
return /* @__PURE__ */ jsx("g", {
|
|
31
|
+
className: cx("legend-weekday"),
|
|
32
|
+
children: labels.map((item) => /* @__PURE__ */ jsx("text", {
|
|
33
|
+
dominantBaseline: "middle",
|
|
34
|
+
textAnchor: "end",
|
|
35
|
+
x: -labelMargin,
|
|
36
|
+
y: item.y,
|
|
37
|
+
children: item.label
|
|
38
|
+
}, item.index))
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
WeekdayLabels.displayName = "WeekdayLabels";
|
|
42
|
+
const MonthLabels = ({ blockMargin, blockSize, monthNames, weeks }) => {
|
|
43
|
+
const labels = useMemo(() => {
|
|
44
|
+
if (weeks.length === 0) return [];
|
|
45
|
+
return getMonthLabels(weeks, monthNames);
|
|
46
|
+
}, [weeks, monthNames]);
|
|
47
|
+
const maxLength = useMemo(() => {
|
|
48
|
+
return Math.floor((blockSize * 4 + blockMargin * 3) / 12);
|
|
49
|
+
}, [blockSize, blockMargin]);
|
|
50
|
+
if (labels.length === 0) return null;
|
|
51
|
+
return /* @__PURE__ */ jsx("g", {
|
|
52
|
+
className: cx("legend-month"),
|
|
53
|
+
children: labels.map(({ label, weekIndex }) => {
|
|
54
|
+
const truncatedLabel = label.length > maxLength ? label.slice(0, maxLength) + "..." : label;
|
|
55
|
+
return /* @__PURE__ */ jsx("text", {
|
|
56
|
+
dominantBaseline: "hanging",
|
|
57
|
+
x: (blockSize + blockMargin) * weekIndex,
|
|
58
|
+
children: truncatedLabel
|
|
59
|
+
}, weekIndex);
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
MonthLabels.displayName = "MonthLabels";
|
|
64
|
+
const ChartLabels = memo(({ labels, blockSize, labelHeight, blockMargin, labelMargin, showWeekdayLabels, hideMonthLabels, weeks, weekStart }) => {
|
|
65
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [showWeekdayLabels && weeks[0] && /* @__PURE__ */ jsx(WeekdayLabels, {
|
|
66
|
+
blockMargin,
|
|
67
|
+
blockSize,
|
|
68
|
+
firstWeek: weeks[0],
|
|
69
|
+
labelHeight,
|
|
70
|
+
labelMargin,
|
|
71
|
+
weekStart,
|
|
72
|
+
weekdays: labels.weekdays
|
|
73
|
+
}), !hideMonthLabels && /* @__PURE__ */ jsx(MonthLabels, {
|
|
74
|
+
blockMargin,
|
|
75
|
+
blockSize,
|
|
76
|
+
monthNames: labels.months,
|
|
77
|
+
weeks
|
|
78
|
+
})] });
|
|
79
|
+
}, isEqual);
|
|
80
|
+
ChartLabels.displayName = "ChartLabels";
|
|
81
|
+
//#endregion
|
|
82
|
+
export { ChartLabels as default };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=ChartLabels.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartLabels.mjs","names":[],"sources":["../../src/Heatmaps/ChartLabels.tsx"],"sourcesContent":["import { cx } from 'antd-style';\nimport isEqual from 'fast-deep-equal';\nimport { memo, useMemo } from 'react';\n\nimport type { Labels, Week } from '@/types/charts';\nimport { getMonthLabels } from '@/utils/calendar';\n\ninterface WeekdayLabelItem {\n dayIndex: number;\n index: number;\n label: string;\n y: number;\n}\n\ninterface WeekdayLabelsProps {\n blockMargin: number;\n blockSize: number;\n firstWeek: Week;\n labelHeight: number;\n labelMargin: number;\n weekStart: number;\n weekdays?: string[];\n}\n\n// Simple component - ChartLabels already memoized, so this doesn't need memo\nconst WeekdayLabels = ({\n blockMargin,\n blockSize,\n firstWeek,\n labelHeight,\n labelMargin,\n weekStart,\n weekdays,\n}: WeekdayLabelsProps) => {\n const labels = useMemo(() => {\n const maxLength = Math.floor((blockSize * 7 + blockMargin * 6) / 12);\n\n return firstWeek\n .map((_, index) => {\n if (index % 2 === 0) return null;\n const dayIndex = (index + weekStart) % 7;\n const label = weekdays?.[dayIndex] || '';\n const truncatedLabel = label.length > maxLength ? label.slice(0, maxLength) + '...' : label;\n return {\n dayIndex,\n index,\n label: truncatedLabel,\n y: labelHeight + (blockSize + blockMargin) * index + blockSize / 2,\n };\n })\n .filter((item): item is WeekdayLabelItem => item !== null);\n }, [firstWeek, weekStart, blockSize, blockMargin, labelHeight, weekdays]);\n\n if (labels.length === 0) return null;\n\n return (\n <g className={cx('legend-weekday')}>\n {labels.map((item) => (\n <text\n dominantBaseline=\"middle\"\n key={item.index}\n textAnchor=\"end\"\n x={-labelMargin}\n y={item.y}\n >\n {item.label}\n </text>\n ))}\n </g>\n );\n};\n\nWeekdayLabels.displayName = 'WeekdayLabels';\n\ninterface MonthLabelsProps {\n blockMargin: number;\n blockSize: number;\n monthNames?: string[];\n weeks: Week[];\n}\n\n// Simple component - ChartLabels already memoized, so this doesn't need memo\nconst MonthLabels = ({ blockMargin, blockSize, monthNames, weeks }: MonthLabelsProps) => {\n const labels = useMemo(() => {\n if (weeks.length === 0) return [];\n return getMonthLabels(weeks, monthNames);\n }, [weeks, monthNames]);\n\n const maxLength = useMemo(() => {\n return Math.floor((blockSize * 4 + blockMargin * 3) / 12);\n }, [blockSize, blockMargin]);\n\n if (labels.length === 0) return null;\n\n return (\n <g className={cx('legend-month')}>\n {labels.map(({ label, weekIndex }) => {\n const truncatedLabel = label.length > maxLength ? label.slice(0, maxLength) + '...' : label;\n return (\n <text\n dominantBaseline=\"hanging\"\n key={weekIndex}\n x={(blockSize + blockMargin) * weekIndex}\n >\n {truncatedLabel}\n </text>\n );\n })}\n </g>\n );\n};\n\nMonthLabels.displayName = 'MonthLabels';\n\ninterface ChartLabelsProps {\n blockMargin: number;\n blockSize: number;\n hideMonthLabels: boolean;\n labelHeight: number;\n labelMargin: number;\n labels: Labels;\n showWeekdayLabels: boolean;\n weekStart: number;\n weeks: Week[];\n}\n\nconst ChartLabels = memo<ChartLabelsProps>(\n ({\n labels,\n blockSize,\n labelHeight,\n blockMargin,\n labelMargin,\n showWeekdayLabels,\n hideMonthLabels,\n weeks,\n weekStart,\n }) => {\n return (\n <>\n {showWeekdayLabels && weeks[0] && (\n <WeekdayLabels\n blockMargin={blockMargin}\n blockSize={blockSize}\n firstWeek={weeks[0]}\n labelHeight={labelHeight}\n labelMargin={labelMargin}\n weekStart={weekStart}\n weekdays={labels.weekdays}\n />\n )}\n {!hideMonthLabels && (\n <MonthLabels\n blockMargin={blockMargin}\n blockSize={blockSize}\n monthNames={labels.months}\n weeks={weeks}\n />\n )}\n </>\n );\n },\n isEqual,\n);\n\nChartLabels.displayName = 'ChartLabels';\n\nexport default ChartLabels;\n"],"mappings":";;;;;;AAyBA,MAAM,iBAAiB,EACrB,aACA,WACA,WACA,aACA,aACA,WACA,eACwB;CACxB,MAAM,SAAS,cAAc;EAC3B,MAAM,YAAY,KAAK,OAAO,YAAY,IAAI,cAAc,KAAK,EAAE;EAEnE,OAAO,UACJ,KAAK,GAAG,UAAU;GACjB,IAAI,QAAQ,MAAM,GAAG,OAAO;GAC5B,MAAM,YAAY,QAAQ,aAAa;GACvC,MAAM,QAAQ,WAAW,aAAa;GAEtC,OAAO;IACL;IACA;IACA,OAJqB,MAAM,SAAS,YAAY,MAAM,MAAM,GAAG,SAAS,IAAI,QAAQ;IAKpF,GAAG,eAAe,YAAY,eAAe,QAAQ,YAAY;GACnE;EACF,CAAC,CAAC,CACD,QAAQ,SAAmC,SAAS,IAAI;CAC7D,GAAG;EAAC;EAAW;EAAW;EAAW;EAAa;EAAa;CAAQ,CAAC;CAExE,IAAI,OAAO,WAAW,GAAG,OAAO;CAEhC,OACE,oBAAC,KAAD;EAAG,WAAW,GAAG,gBAAgB;EAC9B,UAAA,OAAO,KAAK,SACX,oBAAC,QAAD;GACE,kBAAiB;GAEjB,YAAW;GACX,GAAG,CAAC;GACJ,GAAG,KAAK;GAEP,UAAA,KAAK;EACF,GANC,KAAK,KAMN,CACP;CACA,CAAA;AAEP;AAEA,cAAc,cAAc;AAU5B,MAAM,eAAe,EAAE,aAAa,WAAW,YAAY,YAA8B;CACvF,MAAM,SAAS,cAAc;EAC3B,IAAI,MAAM,WAAW,GAAG,OAAO,CAAC;EAChC,OAAO,eAAe,OAAO,UAAU;CACzC,GAAG,CAAC,OAAO,UAAU,CAAC;CAEtB,MAAM,YAAY,cAAc;EAC9B,OAAO,KAAK,OAAO,YAAY,IAAI,cAAc,KAAK,EAAE;CAC1D,GAAG,CAAC,WAAW,WAAW,CAAC;CAE3B,IAAI,OAAO,WAAW,GAAG,OAAO;CAEhC,OACE,oBAAC,KAAD;EAAG,WAAW,GAAG,cAAc;EAC5B,UAAA,OAAO,KAAK,EAAE,OAAO,gBAAgB;GACpC,MAAM,iBAAiB,MAAM,SAAS,YAAY,MAAM,MAAM,GAAG,SAAS,IAAI,QAAQ;GACtF,OACE,oBAAC,QAAD;IACE,kBAAiB;IAEjB,IAAI,YAAY,eAAe;IAE9B,UAAA;GACG,GAJC,SAID;EAEV,CAAC;CACA,CAAA;AAEP;AAEA,YAAY,cAAc;AAc1B,MAAM,cAAc,MACjB,EACC,QACA,WACA,aACA,aACA,aACA,mBACA,iBACA,OACA,gBACI;CACJ,OACE,qBAAA,YAAA,EAAA,UAAA,CACG,qBAAqB,MAAM,MAC1B,oBAAC,eAAD;EACe;EACF;EACX,WAAW,MAAM;EACJ;EACA;EACF;EACX,UAAU,OAAO;CAClB,CAAA,GAEF,CAAC,mBACA,oBAAC,aAAD;EACe;EACF;EACX,YAAY,OAAO;EACZ;CACR,CAAA,CAEH,EAAA,CAAA;AAEN,GACA,OACF;AAEA,YAAY,cAAc"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/Heatmaps/Footer.d.ts
|
|
2
|
+
interface FooterProps {
|
|
3
|
+
blockRadius: number;
|
|
4
|
+
blockSize: number;
|
|
5
|
+
colorScale: string[];
|
|
6
|
+
hideColorLegend?: boolean;
|
|
7
|
+
hideTotalCount?: boolean;
|
|
8
|
+
labels: {
|
|
9
|
+
legend: {
|
|
10
|
+
less: string;
|
|
11
|
+
more: string;
|
|
12
|
+
};
|
|
13
|
+
totalCount?: string;
|
|
14
|
+
};
|
|
15
|
+
loading: boolean;
|
|
16
|
+
maxLevel: number;
|
|
17
|
+
totalCount: number;
|
|
18
|
+
weekdayLabelOffset?: number;
|
|
19
|
+
year: number;
|
|
20
|
+
}
|
|
21
|
+
declare const Footer: import("react").NamedExoticComponent<FooterProps>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Footer as default };
|
|
24
|
+
//# sourceMappingURL=Footer.d.mts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { styles } from "./styles.mjs";
|
|
2
|
+
import { cx } from "antd-style";
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import isEqual from "fast-deep-equal";
|
|
6
|
+
//#region src/Heatmaps/Footer.tsx
|
|
7
|
+
const TotalCount = ({ totalCount, year, totalCountText }) => {
|
|
8
|
+
const text = useMemo(() => {
|
|
9
|
+
if (totalCountText) return totalCountText.replace("{{count}}", String(totalCount)).replace("{{year}}", String(year));
|
|
10
|
+
return `${totalCount} activities in ${year}`;
|
|
11
|
+
}, [
|
|
12
|
+
totalCountText,
|
|
13
|
+
totalCount,
|
|
14
|
+
year
|
|
15
|
+
]);
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: cx("count"),
|
|
18
|
+
children: text
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
TotalCount.displayName = "TotalCount";
|
|
22
|
+
const ColorLegend = ({ blockSize, blockRadius, colorScale, maxLevel, lessLabel, moreLabel }) => {
|
|
23
|
+
const colorLevels = useMemo(() => {
|
|
24
|
+
return Array.from({ length: maxLevel + 1 }, (_, level) => level);
|
|
25
|
+
}, [maxLevel]);
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
27
|
+
className: cx("legend-colors", styles.legendColors),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", {
|
|
30
|
+
style: { marginRight: "0.4em" },
|
|
31
|
+
children: lessLabel
|
|
32
|
+
}),
|
|
33
|
+
colorLevels.map((level) => /* @__PURE__ */ jsx("svg", {
|
|
34
|
+
height: blockSize,
|
|
35
|
+
width: blockSize,
|
|
36
|
+
children: /* @__PURE__ */ jsx("rect", {
|
|
37
|
+
fill: colorScale[level],
|
|
38
|
+
height: blockSize,
|
|
39
|
+
rx: blockRadius,
|
|
40
|
+
ry: blockRadius,
|
|
41
|
+
width: blockSize
|
|
42
|
+
})
|
|
43
|
+
}, level)),
|
|
44
|
+
/* @__PURE__ */ jsx("span", {
|
|
45
|
+
style: { marginLeft: "0.4em" },
|
|
46
|
+
children: moreLabel
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
ColorLegend.displayName = "ColorLegend";
|
|
52
|
+
const Footer = memo(({ hideTotalCount, hideColorLegend, weekdayLabelOffset, loading, labels, year, maxLevel, blockSize, colorScale, blockRadius, totalCount }) => {
|
|
53
|
+
const footerStyle = useMemo(() => {
|
|
54
|
+
return { marginLeft: weekdayLabelOffset };
|
|
55
|
+
}, [weekdayLabelOffset]);
|
|
56
|
+
return /* @__PURE__ */ jsxs("footer", {
|
|
57
|
+
className: cx("footer", styles.footer),
|
|
58
|
+
style: footerStyle,
|
|
59
|
+
children: [
|
|
60
|
+
loading && /* @__PURE__ */ jsx("div", { children: "\xA0" }),
|
|
61
|
+
!loading && !hideTotalCount && /* @__PURE__ */ jsx(TotalCount, {
|
|
62
|
+
totalCount,
|
|
63
|
+
totalCountText: labels.totalCount,
|
|
64
|
+
year
|
|
65
|
+
}),
|
|
66
|
+
!loading && !hideColorLegend && /* @__PURE__ */ jsx(ColorLegend, {
|
|
67
|
+
blockRadius,
|
|
68
|
+
blockSize,
|
|
69
|
+
colorScale,
|
|
70
|
+
lessLabel: labels.legend.less,
|
|
71
|
+
maxLevel,
|
|
72
|
+
moreLabel: labels.legend.more
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}, isEqual);
|
|
77
|
+
Footer.displayName = "Footer";
|
|
78
|
+
//#endregion
|
|
79
|
+
export { Footer as default };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=Footer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.mjs","names":[],"sources":["../../src/Heatmaps/Footer.tsx"],"sourcesContent":["import { cx } from 'antd-style';\nimport isEqual from 'fast-deep-equal';\nimport { memo, useMemo } from 'react';\n\nimport { styles } from './styles';\n\ninterface TotalCountProps {\n totalCount: number;\n totalCountText?: string;\n year: number;\n}\n\n// Simple component - memo not needed as props are primitives and component is lightweight\nconst TotalCount = ({ totalCount, year, totalCountText }: TotalCountProps) => {\n const text = useMemo(() => {\n if (totalCountText) {\n return totalCountText\n .replace('{{count}}', String(totalCount))\n .replace('{{year}}', String(year));\n }\n return `${totalCount} activities in ${year}`;\n }, [totalCountText, totalCount, year]);\n\n return <div className={cx('count')}>{text}</div>;\n};\n\nTotalCount.displayName = 'TotalCount';\n\ninterface ColorLegendProps {\n blockRadius: number;\n blockSize: number;\n colorScale: string[];\n lessLabel: string;\n maxLevel: number;\n moreLabel: string;\n}\n\n// Simple component - Footer already memoized, so this doesn't need memo\nconst ColorLegend = ({\n blockSize,\n blockRadius,\n colorScale,\n maxLevel,\n lessLabel,\n moreLabel,\n}: ColorLegendProps) => {\n const colorLevels = useMemo(() => {\n return Array.from({ length: maxLevel + 1 }, (_, level) => level);\n }, [maxLevel]);\n\n return (\n <div className={cx('legend-colors', styles.legendColors)}>\n <span style={{ marginRight: '0.4em' }}>{lessLabel}</span>\n {colorLevels.map((level) => (\n <svg height={blockSize} key={level} width={blockSize}>\n <rect\n fill={colorScale[level]}\n height={blockSize}\n rx={blockRadius}\n ry={blockRadius}\n width={blockSize}\n />\n </svg>\n ))}\n <span style={{ marginLeft: '0.4em' }}>{moreLabel}</span>\n </div>\n );\n};\n\nColorLegend.displayName = 'ColorLegend';\n\ninterface FooterProps {\n blockRadius: number;\n blockSize: number;\n colorScale: string[];\n hideColorLegend?: boolean;\n hideTotalCount?: boolean;\n labels: {\n legend: {\n less: string;\n more: string;\n };\n totalCount?: string;\n };\n loading: boolean;\n maxLevel: number;\n totalCount: number;\n weekdayLabelOffset?: number;\n year: number;\n}\n\nconst Footer = memo<FooterProps>(\n ({\n hideTotalCount,\n hideColorLegend,\n weekdayLabelOffset,\n loading,\n labels,\n year,\n maxLevel,\n blockSize,\n colorScale,\n blockRadius,\n totalCount,\n }) => {\n // Memoize footer style\n const footerStyle = useMemo(() => {\n return { marginLeft: weekdayLabelOffset };\n }, [weekdayLabelOffset]);\n\n return (\n <footer className={cx('footer', styles.footer)} style={footerStyle}>\n {/* Placeholder */}\n {loading && <div> </div>}\n\n {!loading && !hideTotalCount && (\n <TotalCount totalCount={totalCount} totalCountText={labels.totalCount} year={year} />\n )}\n\n {!loading && !hideColorLegend && (\n <ColorLegend\n blockRadius={blockRadius}\n blockSize={blockSize}\n colorScale={colorScale}\n lessLabel={labels.legend.less}\n maxLevel={maxLevel}\n moreLabel={labels.legend.more}\n />\n )}\n </footer>\n );\n },\n isEqual,\n);\n\nFooter.displayName = 'Footer';\n\nexport default Footer;\n"],"mappings":";;;;;;AAaA,MAAM,cAAc,EAAE,YAAY,MAAM,qBAAsC;CAC5E,MAAM,OAAO,cAAc;EACzB,IAAI,gBACF,OAAO,eACJ,QAAQ,aAAa,OAAO,UAAU,CAAC,CAAC,CACxC,QAAQ,YAAY,OAAO,IAAI,CAAC;EAErC,OAAO,GAAG,WAAW,iBAAiB;CACxC,GAAG;EAAC;EAAgB;EAAY;CAAI,CAAC;CAErC,OAAO,oBAAC,OAAD;EAAK,WAAW,GAAG,OAAO;EAAI,UAAA;CAAU,CAAA;AACjD;AAEA,WAAW,cAA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@
|
|
|
1
|
+
import { NoDataProps } from "../common/NoData.mjs";
|
|
2
|
+
import { Activity, Labels } from "../types/charts.mjs";
|
|
3
|
+
import { FlexboxProps } from "@lobehub/ui";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import { Day } from "date-fns";
|
|
6
|
+
//#region src/Heatmaps/index.d.ts
|
|
7
|
+
export interface HeatmapsProps extends FlexboxProps {
|
|
8
|
+
blockMargin?: number;
|
|
9
|
+
blockRadius?: number;
|
|
10
|
+
blockSize?: number;
|
|
11
|
+
colors?: string[];
|
|
12
|
+
customTooltip?: (activity: Activity) => ReactNode;
|
|
13
|
+
data: Array<Activity>;
|
|
14
|
+
fontSize?: number;
|
|
15
|
+
hideColorLegend?: boolean;
|
|
16
|
+
hideMonthLabels?: boolean;
|
|
17
|
+
hideTotalCount?: boolean;
|
|
18
|
+
labels?: Labels;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
maxLevel?: number;
|
|
21
|
+
noDataText?: NoDataProps['noDataText'];
|
|
22
|
+
onValueChange?: (value: Activity) => void;
|
|
23
|
+
showTooltip?: boolean;
|
|
24
|
+
showWeekdayLabels?: boolean;
|
|
25
|
+
totalCount?: number;
|
|
26
|
+
weekStart?: Day;
|
|
27
|
+
}
|
|
28
|
+
declare const Heatmaps: import("react").ForwardRefExoticComponent<Omit<HeatmapsProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Heatmaps as default };
|
|
31
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { isOnSeverSide } from "../utils/index.mjs";
|
|
3
|
+
import NoData from "../common/NoData.mjs";
|
|
4
|
+
import { usePrefersReducedMotion } from "../hooks/usePrefersReducedMotion.mjs";
|
|
5
|
+
import { DEFAULT_LABELS, generateEmptyData, groupByWeeks, maxWeekdayLabelLength } from "../utils/calendar.mjs";
|
|
6
|
+
import { createTheme } from "../utils/theme.mjs";
|
|
7
|
+
import Calendar from "./Calendar.mjs";
|
|
8
|
+
import ChartLabels from "./ChartLabels.mjs";
|
|
9
|
+
import { styles } from "./styles.mjs";
|
|
10
|
+
import Footer from "./Footer.mjs";
|
|
11
|
+
import { Flexbox } from "@lobehub/ui";
|
|
12
|
+
import { TooltipGroup } from "@lobehub/ui/base-ui";
|
|
13
|
+
import { cx, useTheme, useThemeMode } from "antd-style";
|
|
14
|
+
import { forwardRef, useMemo } from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { getYear, parseISO } from "date-fns";
|
|
17
|
+
//#region src/Heatmaps/index.tsx
|
|
18
|
+
const LABEL_MARGIN = 8;
|
|
19
|
+
const Heatmaps = forwardRef((props, ref) => {
|
|
20
|
+
const { data, blockMargin = 4, blockRadius = 2, blockSize = 12, onValueChange, fontSize = 12, hideColorLegend = false, hideMonthLabels = false, hideTotalCount = false, labels: labelsProp, maxLevel = Math.max(1, props.maxLevel || 4), loading = false, showTooltip = true, customTooltip, showWeekdayLabels = false, style = {}, colors, totalCount: totalCountProp, weekStart = 0, className, noDataText, ...rest } = props;
|
|
21
|
+
const activities = useMemo(() => {
|
|
22
|
+
if (loading) return generateEmptyData();
|
|
23
|
+
return data.map((item) => ({
|
|
24
|
+
...item,
|
|
25
|
+
level: item.level > maxLevel ? maxLevel : item.level
|
|
26
|
+
}));
|
|
27
|
+
}, [
|
|
28
|
+
data,
|
|
29
|
+
maxLevel,
|
|
30
|
+
loading
|
|
31
|
+
]);
|
|
32
|
+
const { isDarkMode } = useThemeMode();
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
const defaultColors = useMemo(() => {
|
|
35
|
+
switch (maxLevel) {
|
|
36
|
+
case 1: return [theme.colorFillSecondary, isDarkMode ? theme.lime8 : theme.green8];
|
|
37
|
+
case 2: return [
|
|
38
|
+
theme.colorFillSecondary,
|
|
39
|
+
isDarkMode ? theme.lime4 : theme.green4,
|
|
40
|
+
isDarkMode ? theme.lime8 : theme.green8
|
|
41
|
+
];
|
|
42
|
+
case 3: return [
|
|
43
|
+
theme.colorFillSecondary,
|
|
44
|
+
isDarkMode ? theme.lime3 : theme.green3,
|
|
45
|
+
isDarkMode ? theme.lime6 : theme.green6,
|
|
46
|
+
isDarkMode ? theme.lime9 : theme.green9
|
|
47
|
+
];
|
|
48
|
+
case 4: return [
|
|
49
|
+
theme.colorFillSecondary,
|
|
50
|
+
isDarkMode ? theme.lime2 : theme.green2,
|
|
51
|
+
isDarkMode ? theme.lime4 : theme.green4,
|
|
52
|
+
isDarkMode ? theme.lime6 : theme.green6,
|
|
53
|
+
isDarkMode ? theme.lime8 : theme.green8
|
|
54
|
+
];
|
|
55
|
+
default: return [theme.colorFillSecondary, theme.colorSuccess];
|
|
56
|
+
}
|
|
57
|
+
}, [
|
|
58
|
+
theme,
|
|
59
|
+
isDarkMode,
|
|
60
|
+
maxLevel
|
|
61
|
+
]);
|
|
62
|
+
const useAnimation = !usePrefersReducedMotion();
|
|
63
|
+
const weeks = useMemo(() => {
|
|
64
|
+
if (activities.length === 0) return [];
|
|
65
|
+
return groupByWeeks(activities, weekStart);
|
|
66
|
+
}, [activities, weekStart]);
|
|
67
|
+
const colorScale = useMemo(() => {
|
|
68
|
+
return createTheme(colors || defaultColors, maxLevel + 1);
|
|
69
|
+
}, [
|
|
70
|
+
colors,
|
|
71
|
+
defaultColors,
|
|
72
|
+
maxLevel
|
|
73
|
+
]);
|
|
74
|
+
const year = useMemo(() => {
|
|
75
|
+
if (activities.length === 0) return (/* @__PURE__ */ new Date()).getFullYear();
|
|
76
|
+
const firstActivity = activities[0];
|
|
77
|
+
return getYear(parseISO(firstActivity.date));
|
|
78
|
+
}, [activities]);
|
|
79
|
+
const labels = useMemo(() => {
|
|
80
|
+
return Object.assign({}, DEFAULT_LABELS, labelsProp);
|
|
81
|
+
}, [labelsProp]);
|
|
82
|
+
const labelHeight = useMemo(() => {
|
|
83
|
+
return hideMonthLabels ? 0 : fontSize + LABEL_MARGIN;
|
|
84
|
+
}, [hideMonthLabels, fontSize]);
|
|
85
|
+
const weekdayLabelOffset = useMemo(() => {
|
|
86
|
+
if (!showWeekdayLabels || weeks.length === 0) return void 0;
|
|
87
|
+
const firstWeek = weeks[0];
|
|
88
|
+
return maxWeekdayLabelLength(firstWeek, weekStart, labels.weekdays, fontSize) + LABEL_MARGIN;
|
|
89
|
+
}, [
|
|
90
|
+
showWeekdayLabels,
|
|
91
|
+
weeks,
|
|
92
|
+
weekStart,
|
|
93
|
+
labels.weekdays,
|
|
94
|
+
fontSize
|
|
95
|
+
]);
|
|
96
|
+
const { width, height } = useMemo(() => {
|
|
97
|
+
return {
|
|
98
|
+
height: labelHeight + (blockSize + blockMargin) * 7 - blockMargin,
|
|
99
|
+
width: weeks.length * (blockSize + blockMargin) - blockMargin
|
|
100
|
+
};
|
|
101
|
+
}, [
|
|
102
|
+
labelHeight,
|
|
103
|
+
blockSize,
|
|
104
|
+
blockMargin,
|
|
105
|
+
weeks.length
|
|
106
|
+
]);
|
|
107
|
+
const totalCount = useMemo(() => {
|
|
108
|
+
if (typeof totalCountProp === "number") return totalCountProp;
|
|
109
|
+
return activities.reduce((sum, activity) => sum + activity.count, 0);
|
|
110
|
+
}, [totalCountProp, activities]);
|
|
111
|
+
const containerStyles = useMemo(() => {
|
|
112
|
+
const zeroColor = colorScale[0];
|
|
113
|
+
return {
|
|
114
|
+
fontSize,
|
|
115
|
+
...useAnimation && {
|
|
116
|
+
[`--lobe-heatmaps-loading`]: zeroColor,
|
|
117
|
+
[`--lobe-heatmaps-loading-active`]: theme.colorFill
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}, [
|
|
121
|
+
fontSize,
|
|
122
|
+
useAnimation,
|
|
123
|
+
colorScale,
|
|
124
|
+
theme.colorFill
|
|
125
|
+
]);
|
|
126
|
+
if (activities.length === 0) return /* @__PURE__ */ jsx(NoData, { noDataText });
|
|
127
|
+
if (showWeekdayLabels && isOnSeverSide) return null;
|
|
128
|
+
return /* @__PURE__ */ jsx(TooltipGroup, { children: /* @__PURE__ */ jsxs(Flexbox, {
|
|
129
|
+
className: cx(styles.container, className),
|
|
130
|
+
ref,
|
|
131
|
+
style: {
|
|
132
|
+
...style,
|
|
133
|
+
...containerStyles
|
|
134
|
+
},
|
|
135
|
+
...rest,
|
|
136
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
137
|
+
className: styles.scrollContainer,
|
|
138
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
139
|
+
className: styles.calendar,
|
|
140
|
+
height,
|
|
141
|
+
style: { marginLeft: weekdayLabelOffset },
|
|
142
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
143
|
+
width,
|
|
144
|
+
children: [!loading && !showWeekdayLabels && hideMonthLabels ? void 0 : /* @__PURE__ */ jsx(ChartLabels, {
|
|
145
|
+
blockMargin,
|
|
146
|
+
blockSize,
|
|
147
|
+
hideMonthLabels,
|
|
148
|
+
labelHeight,
|
|
149
|
+
labelMargin: LABEL_MARGIN,
|
|
150
|
+
labels,
|
|
151
|
+
showWeekdayLabels,
|
|
152
|
+
weekStart,
|
|
153
|
+
weeks
|
|
154
|
+
}), /* @__PURE__ */ jsx(Calendar, {
|
|
155
|
+
blockMargin,
|
|
156
|
+
blockRadius,
|
|
157
|
+
blockSize,
|
|
158
|
+
colorScale,
|
|
159
|
+
customTooltip,
|
|
160
|
+
enableAnimation: loading && useAnimation,
|
|
161
|
+
labelHeight,
|
|
162
|
+
labels,
|
|
163
|
+
maxLevel,
|
|
164
|
+
onValueChange,
|
|
165
|
+
showTooltip,
|
|
166
|
+
weeks
|
|
167
|
+
})]
|
|
168
|
+
})
|
|
169
|
+
}), hideTotalCount && hideColorLegend ? void 0 : /* @__PURE__ */ jsx(Footer, {
|
|
170
|
+
blockRadius,
|
|
171
|
+
blockSize,
|
|
172
|
+
colorScale,
|
|
173
|
+
hideColorLegend,
|
|
174
|
+
hideTotalCount,
|
|
175
|
+
labels,
|
|
176
|
+
loading,
|
|
177
|
+
maxLevel,
|
|
178
|
+
totalCount,
|
|
179
|
+
weekdayLabelOffset,
|
|
180
|
+
year
|
|
181
|
+
})]
|
|
182
|
+
}) });
|
|
183
|
+
});
|
|
184
|
+
Heatmaps.displayName = "Heatmaps";
|
|
185
|
+
//#endregion
|
|
186
|
+
export { Heatmaps as default };
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/Heatmaps/index.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { TooltipGroup } from '@lobehub/ui/base-ui';\nimport { cx, useTheme, useThemeMode } from 'antd-style';\nimport type { Day as WeekDay } from 'date-fns';\nimport { getYear, parseISO } from 'date-fns';\nimport { ReactNode, forwardRef, useMemo } from 'react';\n\nimport NoData, { NoDataProps } from '@/common/NoData';\nimport { usePrefersReducedMotion } from '@/hooks/usePrefersReducedMotion';\nimport type { Activity, Labels, Week } from '@/types/charts';\nimport { isOnSeverSide } from '@/utils';\nimport {\n DEFAULT_LABELS,\n generateEmptyData,\n groupByWeeks,\n maxWeekdayLabelLength,\n} from '@/utils/calendar';\nimport { createTheme } from '@/utils/theme';\n\nimport Calendar from './Calendar';\nimport ChartLabels from './ChartLabels';\nimport Footer from './Footer';\nimport { styles } from './styles';\n\nconst LABEL_MARGIN = 8;\n\nexport interface HeatmapsProps extends FlexboxProps {\n blockMargin?: number;\n blockRadius?: number;\n blockSize?: number;\n colors?: string[];\n customTooltip?: (activity: Activity) => ReactNode;\n data: Array<Activity>;\n fontSize?: number;\n hideColorLegend?: boolean;\n hideMonthLabels?: boolean;\n hideTotalCount?: boolean;\n labels?: Labels;\n loading?: boolean;\n maxLevel?: number;\n noDataText?: NoDataProps['noDataText'];\n onValueChange?: (value: Activity) => void;\n showTooltip?: boolean;\n showWeekdayLabels?: boolean;\n totalCount?: number;\n weekStart?: WeekDay;\n}\n\nconst Heatmaps = forwardRef<HTMLDivElement, HeatmapsProps>((props, ref) => {\n const {\n data,\n blockMargin = 4,\n blockRadius = 2,\n blockSize = 12,\n onValueChange,\n fontSize = 12,\n hideColorLegend = false,\n hideMonthLabels = false,\n hideTotalCount = false,\n labels: labelsProp,\n maxLevel = Math.max(1, props.maxLevel || 4),\n loading = false,\n showTooltip = true,\n customTooltip,\n showWeekdayLabels = false,\n style = {},\n colors,\n totalCount: totalCountProp,\n weekStart = 0, // Sunday\n className,\n noDataText,\n ...rest\n } = props;\n\n const activities = useMemo(() => {\n if (loading) return generateEmptyData();\n return data.map((item) => ({\n ...item,\n level: item.level > maxLevel ? maxLevel : item.level,\n }));\n }, [data, maxLevel, loading]);\n\n const { isDarkMode } = useThemeMode();\n const theme = useTheme();\n\n // Note: defaultColors must use theme (actual color values) instead of cssVar\n // because createTheme() uses chroma.valid() which requires actual color values, not CSS variables\n const defaultColors = useMemo(() => {\n switch (maxLevel) {\n case 1: {\n return [theme.colorFillSecondary, isDarkMode ? theme.lime8 : theme.green8];\n }\n case 2: {\n return [\n theme.colorFillSecondary,\n isDarkMode ? theme.lime4 : theme.green4,\n isDarkMode ? theme.lime8 : theme.green8,\n ];\n }\n case 3: {\n return [\n theme.colorFillSecondary,\n isDarkMode ? theme.lime3 : theme.green3,\n isDarkMode ? theme.lime6 : theme.green6,\n isDarkMode ? theme.lime9 : theme.green9,\n ];\n }\n case 4: {\n return [\n theme.colorFillSecondary,\n isDarkMode ? theme.lime2 : theme.green2,\n isDarkMode ? theme.lime4 : theme.green4,\n isDarkMode ? theme.lime6 : theme.green6,\n isDarkMode ? theme.lime8 : theme.green8,\n ];\n }\n default: {\n return [theme.colorFillSecondary, theme.colorSuccess];\n }\n }\n }, [theme, isDarkMode, maxLevel]);\n\n const useAnimation = !usePrefersReducedMotion();\n\n // Memoize weeks calculation - expensive operation\n const weeks = useMemo(() => {\n if (activities.length === 0) return [];\n return groupByWeeks(activities, weekStart);\n }, [activities, weekStart]);\n\n // Memoize color scale calculation\n const colorScale = useMemo(() => {\n return createTheme(colors || defaultColors, maxLevel + 1);\n }, [colors, defaultColors, maxLevel]);\n\n // Memoize year calculation\n const year = useMemo(() => {\n if (activities.length === 0) return new Date().getFullYear();\n const firstActivity = activities[0] as Activity;\n return getYear(parseISO(firstActivity.date));\n }, [activities]);\n\n // Memoize labels object merge\n const labels = useMemo(() => {\n return Object.assign({}, DEFAULT_LABELS, labelsProp);\n }, [labelsProp]);\n\n // Memoize label height calculation\n const labelHeight = useMemo(() => {\n return hideMonthLabels ? 0 : fontSize + LABEL_MARGIN;\n }, [hideMonthLabels, fontSize]);\n\n // Memoize weekday label offset calculation\n const weekdayLabelOffset = useMemo(() => {\n if (!showWeekdayLabels || weeks.length === 0) return undefined;\n const firstWeek = weeks[0] as Week;\n return maxWeekdayLabelLength(firstWeek, weekStart, labels.weekdays, fontSize) + LABEL_MARGIN;\n }, [showWeekdayLabels, weeks, weekStart, labels.weekdays, fontSize]);\n\n // Memoize dimensions calculation\n const dimensions = useMemo(() => {\n return {\n height: labelHeight + (blockSize + blockMargin) * 7 - blockMargin,\n width: weeks.length * (blockSize + blockMargin) - blockMargin,\n };\n }, [labelHeight, blockSize, blockMargin, weeks.length]);\n\n const { width, height } = dimensions;\n\n // Memoize total count calculation\n const totalCount = useMemo(() => {\n if (typeof totalCountProp === 'number') return totalCountProp;\n return activities.reduce((sum, activity) => sum + activity.count, 0);\n }, [totalCountProp, activities]);\n\n // Memoize container styles\n const containerStyles = useMemo(() => {\n const zeroColor = colorScale[0];\n return {\n fontSize,\n ...(useAnimation && {\n [`--lobe-heatmaps-loading`]: zeroColor,\n [`--lobe-heatmaps-loading-active`]: theme.colorFill,\n }),\n };\n }, [fontSize, useAnimation, colorScale, theme.colorFill]);\n\n if (activities.length === 0) return <NoData noDataText={noDataText} />;\n\n if (showWeekdayLabels && isOnSeverSide) return null;\n\n return (\n <TooltipGroup>\n <Flexbox\n className={cx(styles.container, className)}\n ref={ref}\n style={{ ...style, ...containerStyles }}\n {...rest}\n >\n <div className={styles.scrollContainer}>\n <svg\n className={styles.calendar}\n height={height}\n style={{ marginLeft: weekdayLabelOffset }}\n viewBox={`0 0 ${width} ${height}`}\n width={width}\n >\n {!loading && !showWeekdayLabels && hideMonthLabels ? undefined : (\n <ChartLabels\n blockMargin={blockMargin}\n blockSize={blockSize}\n hideMonthLabels={hideMonthLabels}\n labelHeight={labelHeight}\n labelMargin={LABEL_MARGIN}\n labels={labels}\n showWeekdayLabels={showWeekdayLabels}\n weekStart={weekStart}\n weeks={weeks}\n />\n )}\n <Calendar\n blockMargin={blockMargin}\n blockRadius={blockRadius}\n blockSize={blockSize}\n colorScale={colorScale}\n customTooltip={customTooltip}\n enableAnimation={loading && useAnimation}\n labelHeight={labelHeight}\n labels={labels}\n maxLevel={maxLevel}\n onValueChange={onValueChange}\n showTooltip={showTooltip}\n weeks={weeks}\n />\n </svg>\n </div>\n {hideTotalCount && hideColorLegend ? undefined : (\n <Footer\n blockRadius={blockRadius}\n blockSize={blockSize}\n colorScale={colorScale}\n hideColorLegend={hideColorLegend}\n hideTotalCount={hideTotalCount}\n labels={labels}\n loading={loading}\n maxLevel={maxLevel}\n totalCount={totalCount}\n weekdayLabelOffset={weekdayLabelOffset}\n year={year}\n />\n )}\n </Flexbox>\n </TooltipGroup>\n );\n});\n\nHeatmaps.displayName = 'Heatmaps';\n\nexport default Heatmaps;\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,MAAM,eAAe;AAwBrB,MAAM,WAAW,YAA2C,OAAO,QAAQ;CACzE,MAAM,EACJ,MACA,cAAc,GACd,cAAc,GACd,YAAY,IACZ,eACA,WAAW,IACX,kBAAkB,OAClB,kBAAkB,OAClB,iBAAiB,OACjB,QAAQ,YACR,WAAW,KAAK,IAAI,GAAG,MAAM,YAAY,CAAC,GAC1C,UAAU,OACV,cAAc,MACd,eACA,oBAAoB,OACpB,QAAQ,CAAC,GACT,QACA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