@lobehub/charts 6.0.0-beta.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/es/AccuracyBarChart/index.d.mts +62 -0
- package/es/AccuracyBarChart/index.mjs +324 -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 +306 -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 +288 -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 +126 -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 +512 -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 +345 -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 +666 -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 +252 -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 +144 -0
- package/es/DataBars/CategoryBar.mjs.map +1 -0
- package/es/DataBars/DeltaBar.d.mts +16 -0
- package/es/DataBars/DeltaBar.mjs +100 -0
- package/es/DataBars/DeltaBar.mjs.map +1 -0
- package/es/DataBars/MarkerBar.d.mts +19 -0
- package/es/DataBars/MarkerBar.mjs +72 -0
- package/es/DataBars/MarkerBar.mjs.map +1 -0
- package/es/DataBars/ProgressBar.d.mts +15 -0
- package/es/DataBars/ProgressBar.mjs +51 -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 +158 -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 +419 -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 +107 -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 +186 -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 +63 -0
- package/es/Legend/LegendItem.mjs.map +1 -0
- package/es/Legend/ScrollButton.d.mts +11 -0
- package/es/Legend/ScrollButton.mjs +49 -0
- package/es/Legend/ScrollButton.mjs.map +1 -0
- package/es/Legend/index.d.mts +16 -0
- package/es/Legend/index.mjs +151 -0
- package/es/Legend/index.mjs.map +1 -0
- package/es/LineChart/index.d.mts +11 -0
- package/es/LineChart/index.mjs +269 -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 +155 -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 +50 -0
- package/es/ScatterChart/ScatterChartTooltip.mjs.map +1 -0
- package/es/ScatterChart/ScatterChartTooltipRow.d.mts +10 -0
- package/es/ScatterChart/ScatterChartTooltipRow.mjs +34 -0
- package/es/ScatterChart/ScatterChartTooltipRow.mjs.map +1 -0
- package/es/ScatterChart/index.d.mts +58 -0
- package/es/ScatterChart/index.mjs +239 -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 +107 -0
- package/es/SparkChart/SparkAreaChart.mjs.map +1 -0
- package/es/SparkChart/SparkBarChart.d.mts +11 -0
- package/es/SparkChart/SparkBarChart.mjs +67 -0
- package/es/SparkChart/SparkBarChart.mjs.map +1 -0
- package/es/SparkChart/SparkLineChart.d.mts +12 -0
- package/es/SparkChart/SparkLineChart.mjs +71 -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 +50 -0
- package/es/Tracker/TrackerBlock.mjs.map +1 -0
- package/es/Tracker/index.d.mts +21 -0
- package/es/Tracker/index.mjs +67 -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 +26 -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 +49 -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 +48 -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 -5
- package/es/AccuracyBarChart/index.d.ts +0 -60
- package/es/AccuracyBarChart/index.js +0 -452
- 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 -428
- 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 -390
- 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 -172
- 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 -684
- 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 -453
- 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 -855
- 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 -333
- 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 -199
- package/es/DataBars/DeltaBar.d.ts +0 -13
- package/es/DataBars/DeltaBar.js +0 -115
- package/es/DataBars/MarkerBar.d.ts +0 -16
- package/es/DataBars/MarkerBar.js +0 -92
- package/es/DataBars/ProgressBar.d.ts +0 -12
- package/es/DataBars/ProgressBar.js +0 -69
- 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 -230
- 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 -497
- 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 -154
- 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 -225
- 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 -56
- package/es/Legend/ScrollButton.d.ts +0 -9
- package/es/Legend/ScrollButton.js +0 -62
- package/es/Legend/index.d.ts +0 -14
- package/es/Legend/index.js +0 -183
- package/es/Legend/index.mdx +0 -13
- package/es/LineChart/index.d.ts +0 -9
- package/es/LineChart/index.js +0 -386
- 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 -252
- 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 -74
- package/es/ScatterChart/ScatterChartTooltipRow.d.ts +0 -7
- package/es/ScatterChart/ScatterChartTooltipRow.js +0 -38
- package/es/ScatterChart/index.d.ts +0 -56
- package/es/ScatterChart/index.js +0 -340
- 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 -146
- package/es/SparkChart/SparkBarChart.d.ts +0 -9
- package/es/SparkChart/SparkBarChart.js +0 -104
- package/es/SparkChart/SparkLineChart.d.ts +0 -10
- package/es/SparkChart/SparkLineChart.js +0 -108
- 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 -62
- package/es/Tracker/index.d.ts +0 -18
- package/es/Tracker/index.js +0 -103
- 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 -31
- package/es/common/ChartTooltip/ChartTooltipRow.d.ts +0 -8
- package/es/common/ChartTooltip/ChartTooltipRow.js +0 -53
- package/es/common/ChartTooltip/index.d.ts +0 -15
- package/es/common/ChartTooltip/index.js +0 -64
- 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/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,22 @@
|
|
|
1
|
+
import { Sector } from "recharts";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/DonutChart/renderInactiveShape.tsx
|
|
4
|
+
const renderInactiveShape = (props) => {
|
|
5
|
+
const { cx, cy, innerRadius, outerRadius, startAngle, endAngle, className } = props;
|
|
6
|
+
return /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(Sector, {
|
|
7
|
+
className,
|
|
8
|
+
cx,
|
|
9
|
+
cy,
|
|
10
|
+
endAngle,
|
|
11
|
+
fill: "",
|
|
12
|
+
innerRadius,
|
|
13
|
+
opacity: .3,
|
|
14
|
+
outerRadius,
|
|
15
|
+
startAngle,
|
|
16
|
+
style: { outline: "none" }
|
|
17
|
+
}) });
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { renderInactiveShape };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=renderInactiveShape.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderInactiveShape.mjs","names":[],"sources":["../../src/DonutChart/renderInactiveShape.tsx"],"sourcesContent":["import { Sector } from 'recharts';\n\nexport const renderInactiveShape = (props: any) => {\n const { cx, cy, innerRadius, outerRadius, startAngle, endAngle, className } = props;\n\n return (\n <g>\n <Sector\n className={className}\n cx={cx}\n cy={cy}\n endAngle={endAngle}\n fill=\"\"\n innerRadius={innerRadius}\n opacity={0.3}\n outerRadius={outerRadius}\n startAngle={startAngle}\n style={{ outline: 'none' }}\n />\n </g>\n );\n};\n"],"mappings":";;;AAEA,MAAa,uBAAuB,UAAe;CACjD,MAAM,EAAE,IAAI,IAAI,aAAa,aAAa,YAAY,UAAU,cAAc;CAE9E,OACE,oBAAC,KAAD,EAAA,UACE,oBAAC,QAAD;EACa;EACP;EACA;EACM;EACV,MAAK;EACQ;EACb,SAAS;EACI;EACD;EACZ,OAAO,EAAE,SAAS,OAAO;CAC1B,CAAA,EACA,CAAA;AAEP"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createStaticStyles } from "@lobehub/ui";
|
|
2
|
+
//#region src/DonutChart/styles.ts
|
|
3
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
4
|
+
emphasis: css`
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
text-overflow: ellipsis;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
`,
|
|
9
|
+
gridLines: css`
|
|
10
|
+
stroke: ${cssVar.colorBorderSecondary};
|
|
11
|
+
stroke-width: 1;
|
|
12
|
+
`,
|
|
13
|
+
label: css`
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
line-height: 16px;
|
|
16
|
+
fill: ${cssVar.colorTextDescription};
|
|
17
|
+
`,
|
|
18
|
+
strongLabel: css`
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 16px;
|
|
22
|
+
fill: ${cssVar.colorTextSecondary};
|
|
23
|
+
`
|
|
24
|
+
}));
|
|
25
|
+
//#endregion
|
|
26
|
+
export { styles };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=styles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.mjs","names":[],"sources":["../../src/DonutChart/styles.ts"],"sourcesContent":["import { createStaticStyles } from '@lobehub/ui';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n emphasis: css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n gridLines: css`\n stroke: ${cssVar.colorBorderSecondary};\n stroke-width: 1;\n `,\n label: css`\n font-size: 12px;\n line-height: 16px;\n fill: ${cssVar.colorTextDescription};\n `,\n strongLabel: css`\n font-size: 16px;\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,WAAW,GAAG;cACF,OAAO,qBAAqB;;;CAGxC,OAAO,GAAG;;;YAGA,OAAO,qBAAqB;;CAEtC,aAAa,GAAG;;;;YAIN,OAAO,mBAAmB;;AAEtC,EAAE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
//#region src/FunnelChart/ArrowRightIcon.d.ts
|
|
3
|
+
declare const ArrowRightIcon: ({ ...props }: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { ArrowRightIcon as default };
|
|
8
|
+
//# sourceMappingURL=ArrowRightIcon.d.mts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/FunnelChart/ArrowRightIcon.tsx
|
|
4
|
+
const ArrowRightIcon = ({ ...props }) => /* @__PURE__ */ jsx("svg", {
|
|
5
|
+
fill: "currentColor",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
...props,
|
|
9
|
+
children: /* @__PURE__ */ jsx("path", { d: "M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z" })
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ArrowRightIcon as default };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=ArrowRightIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowRightIcon.mjs","names":[],"sources":["../../src/FunnelChart/ArrowRightIcon.tsx"],"sourcesContent":["import React from 'react';\n\nconst ArrowRightIcon = ({ ...props }) => (\n <svg fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z\" />\n </svg>\n);\n\nexport default ArrowRightIcon;\n"],"mappings":";;;AAEA,MAAM,kBAAkB,EAAE,GAAG,YAC3B,oBAAC,OAAD;CAAK,MAAK;CAAe,SAAQ;CAAY,OAAM;CAA6B,GAAI;CAClF,UAAA,oBAAC,QAAD,EAAM,GAAE,gIAAiI,CAAA;AACtI,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import BaseChartProps from "../common/BaseChartProps.mjs";
|
|
2
|
+
//#region src/FunnelChart/index.d.ts
|
|
3
|
+
type CalculateFrom = 'first' | 'previous';
|
|
4
|
+
type DataT = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: number;
|
|
7
|
+
};
|
|
8
|
+
export interface FunnelChartProps extends Omit<BaseChartProps, 'categories' | 'index'> {
|
|
9
|
+
barGap?: number | `${number}%`;
|
|
10
|
+
calculateFrom?: CalculateFrom;
|
|
11
|
+
data: DataT[];
|
|
12
|
+
evolutionGradient?: boolean;
|
|
13
|
+
gradient?: boolean;
|
|
14
|
+
showArrow?: boolean;
|
|
15
|
+
variant?: 'base' | 'center';
|
|
16
|
+
yAxisPadding?: number;
|
|
17
|
+
}
|
|
18
|
+
declare const FunnelChart: import("react").ForwardRefExoticComponent<FunnelChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { FunnelChart as default };
|
|
21
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useThemeColorRange } from "../hooks/useThemeColorRange.mjs";
|
|
3
|
+
import { defaultValueFormatter } from "../utils/index.mjs";
|
|
4
|
+
import ChartTooltip from "../common/ChartTooltip/index.mjs";
|
|
5
|
+
import NoData from "../common/NoData.mjs";
|
|
6
|
+
import { getMaxLabelLength } from "../utils/getMaxLabelLength.mjs";
|
|
7
|
+
import ArrowRightIcon from "./ArrowRightIcon.mjs";
|
|
8
|
+
import { styles } from "./styles.mjs";
|
|
9
|
+
import { Flexbox, Skeleton, css, cssVar, cx } from "@lobehub/ui";
|
|
10
|
+
import { Fragment, forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
11
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { useSize } from "ahooks";
|
|
13
|
+
//#region src/FunnelChart/index.tsx
|
|
14
|
+
const GLOBAL_PADDING = 10;
|
|
15
|
+
const HALF_PADDING = GLOBAL_PADDING / 2;
|
|
16
|
+
const Y_AXIS_LABELS = [
|
|
17
|
+
"100%",
|
|
18
|
+
"75%",
|
|
19
|
+
"50%",
|
|
20
|
+
"25%",
|
|
21
|
+
"0%"
|
|
22
|
+
];
|
|
23
|
+
const validateData = (data, calculatedFrom) => {
|
|
24
|
+
if (data && data.length > 0) {
|
|
25
|
+
if (calculatedFrom === "previous" && data[0].value <= 0) return `The value of the first item "${data[0].name}" is not greater than 0. This is not allowed when setting the "calculateFrom" prop to "previous". Please enter a value greater than 0.`;
|
|
26
|
+
for (const item of data) if (item.value < 0) return `Item "${item.name}" has a negative value: ${item.value}. This is not allowed. The value must be greater than or equal to 0.`;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
};
|
|
30
|
+
const FunnelChart = forwardRef((props, ref) => {
|
|
31
|
+
const themeColorRange = useThemeColorRange();
|
|
32
|
+
const { data = [], evolutionGradient = true, gradient = false, valueFormatter = defaultValueFormatter, calculateFrom = "first", color = themeColorRange[0], variant = "base", showGridLines = true, showYAxis = calculateFrom === "previous" ? false : true, showXAxis = true, showArrow = true, xAxisLabel = "", yAxisLabel = "", yAxisAlign = "left", showTooltip = true, onValueChange, customTooltip, noDataText, rotateLabelX, barGap = "20%", loading, width = "100%", height = 280, className, style, yAxisWidth, ...rest } = props;
|
|
33
|
+
const svgRef = useRef(ref);
|
|
34
|
+
const size = useSize(svgRef);
|
|
35
|
+
const tooltipRef = useRef(null);
|
|
36
|
+
const [svgWidth, setSvgWidth] = useState(0);
|
|
37
|
+
const [svgHeight, setSvgHeight] = useState(0);
|
|
38
|
+
const [tooltip, setTooltip] = useState({
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0
|
|
41
|
+
});
|
|
42
|
+
const [activeBar, setActiveBar] = useState();
|
|
43
|
+
const DEFAULT_X_AXIS_HEIGHT = showXAxis && xAxisLabel ? 25 : 15;
|
|
44
|
+
const CustomTooltip = customTooltip;
|
|
45
|
+
const calculatedYAxisWidth = useMemo(() => {
|
|
46
|
+
if (yAxisWidth) return yAxisWidth;
|
|
47
|
+
return getMaxLabelLength({
|
|
48
|
+
data,
|
|
49
|
+
index: "value",
|
|
50
|
+
valueFormatter
|
|
51
|
+
}) / 4 + (yAxisLabel ? 24 : 0);
|
|
52
|
+
}, [
|
|
53
|
+
yAxisWidth,
|
|
54
|
+
data,
|
|
55
|
+
valueFormatter,
|
|
56
|
+
yAxisLabel
|
|
57
|
+
]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const handleResize = () => {
|
|
60
|
+
setSvgWidth(size?.width || 0);
|
|
61
|
+
setSvgHeight(size?.height || 0);
|
|
62
|
+
};
|
|
63
|
+
handleResize();
|
|
64
|
+
}, [size]);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const handleTooltipOverflows = () => {
|
|
67
|
+
if (tooltipRef.current) {
|
|
68
|
+
const boundingBox = tooltipRef.current.getBoundingClientRect();
|
|
69
|
+
if (boundingBox.right > window.innerWidth) tooltipRef.current.style.left = `${svgWidth - boundingBox.width}px`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
handleTooltipOverflows();
|
|
73
|
+
window.addEventListener("resize", handleTooltipOverflows);
|
|
74
|
+
return () => window.removeEventListener("resize", handleTooltipOverflows);
|
|
75
|
+
}, [tooltip, svgWidth]);
|
|
76
|
+
const maxValue = useMemo(() => Math.max(...data.map((item) => item.value)), [data]);
|
|
77
|
+
const widthWithoutPadding = svgWidth - GLOBAL_PADDING - calculatedYAxisWidth;
|
|
78
|
+
const gap = useMemo(() => {
|
|
79
|
+
if (typeof barGap === "number") return barGap;
|
|
80
|
+
else if (typeof barGap === "string" && barGap.endsWith("%")) {
|
|
81
|
+
const percentage = Number.parseFloat(barGap.slice(0, -1));
|
|
82
|
+
return widthWithoutPadding * percentage / 100 / (data.length - 1);
|
|
83
|
+
} else {
|
|
84
|
+
console.error("Invalid barGap value. It must be a number or a percentage string (e.g., \"10%\").");
|
|
85
|
+
return 30;
|
|
86
|
+
}
|
|
87
|
+
}, [
|
|
88
|
+
widthWithoutPadding,
|
|
89
|
+
data.length,
|
|
90
|
+
barGap
|
|
91
|
+
]);
|
|
92
|
+
const barWidth = useMemo(() => (widthWithoutPadding - (data.length - 1) * gap - gap) / data.length, [
|
|
93
|
+
widthWithoutPadding,
|
|
94
|
+
gap,
|
|
95
|
+
data.length
|
|
96
|
+
]);
|
|
97
|
+
const realHeight = svgHeight - GLOBAL_PADDING - (showXAxis ? (rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT) + (showXAxis && xAxisLabel ? 30 : 10) : 0);
|
|
98
|
+
const isPreviousCalculation = calculateFrom === "previous";
|
|
99
|
+
const isVariantCenter = variant === "center";
|
|
100
|
+
const formattedData = useMemo(() => {
|
|
101
|
+
if (realHeight <= 0) return [];
|
|
102
|
+
return data.reduce((acc, item, index) => {
|
|
103
|
+
const prev = acc[index - 1];
|
|
104
|
+
const value = item.value;
|
|
105
|
+
const valueToCompareWith = isPreviousCalculation ? prev?.value ?? maxValue : maxValue;
|
|
106
|
+
const calculationHeight = isPreviousCalculation ? prev?.barHeight ?? realHeight : realHeight;
|
|
107
|
+
const normalizedValue = value / valueToCompareWith;
|
|
108
|
+
const barHeight = normalizedValue * calculationHeight;
|
|
109
|
+
const startX = index * (barWidth + gap) + .5 * gap;
|
|
110
|
+
const startY = calculationHeight - barHeight + (isPreviousCalculation ? realHeight - (prev?.barHeight ?? realHeight) : 0);
|
|
111
|
+
const nextValue = data[index + 1]?.value;
|
|
112
|
+
const nextNormalizedValue = nextValue / valueToCompareWith;
|
|
113
|
+
const nextBarHeight = nextNormalizedValue * calculationHeight;
|
|
114
|
+
const nextStartX = (index + 1) * (barWidth + gap) + .5 * gap;
|
|
115
|
+
acc.push({
|
|
116
|
+
barHeight,
|
|
117
|
+
name: item.name,
|
|
118
|
+
nextBarHeight,
|
|
119
|
+
nextNormalizedValue,
|
|
120
|
+
nextStartX,
|
|
121
|
+
nextValue,
|
|
122
|
+
normalizedValue,
|
|
123
|
+
startX,
|
|
124
|
+
startY,
|
|
125
|
+
value
|
|
126
|
+
});
|
|
127
|
+
return acc;
|
|
128
|
+
}, []);
|
|
129
|
+
}, [
|
|
130
|
+
data,
|
|
131
|
+
realHeight,
|
|
132
|
+
isPreviousCalculation,
|
|
133
|
+
barWidth,
|
|
134
|
+
gap,
|
|
135
|
+
maxValue
|
|
136
|
+
]);
|
|
137
|
+
const handleTooltip = (touch) => {
|
|
138
|
+
const chartBoundingRect = svgRef.current?.getBoundingClientRect();
|
|
139
|
+
if (!chartBoundingRect) return;
|
|
140
|
+
const chartX = chartBoundingRect.x;
|
|
141
|
+
if (formattedData.length === 0) return setTooltip({
|
|
142
|
+
x: 0,
|
|
143
|
+
y: 0
|
|
144
|
+
});
|
|
145
|
+
const pageX = touch.pageX - chartX - barWidth / 2 - calculatedYAxisWidth - HALF_PADDING;
|
|
146
|
+
const closestBar = formattedData.reduce((acc, current) => {
|
|
147
|
+
return Math.abs(current.startX - pageX) < Math.abs(acc.startX - pageX) ? current : acc;
|
|
148
|
+
}, formattedData[0]);
|
|
149
|
+
const closestBarIndex = formattedData.indexOf(closestBar);
|
|
150
|
+
setTooltip({
|
|
151
|
+
data: {
|
|
152
|
+
className: cx(css`
|
|
153
|
+
cursor: ${onValueChange ? "pointer" : void 0};
|
|
154
|
+
color: ${color ?? cssVar.colorPrimary};
|
|
155
|
+
`),
|
|
156
|
+
color: color ?? cssVar.colorPrimary,
|
|
157
|
+
dataKey: closestBar.name,
|
|
158
|
+
fill: "",
|
|
159
|
+
name: closestBar.name,
|
|
160
|
+
payload: closestBar,
|
|
161
|
+
value: closestBar.value
|
|
162
|
+
},
|
|
163
|
+
index: closestBarIndex,
|
|
164
|
+
x: closestBar.startX,
|
|
165
|
+
y: closestBar.startY
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
if (loading || !data) return /* @__PURE__ */ jsx(Skeleton, {
|
|
169
|
+
height,
|
|
170
|
+
width
|
|
171
|
+
});
|
|
172
|
+
const errorMessage = data ? validateData(data, calculateFrom) : null;
|
|
173
|
+
if (errorMessage) return /* @__PURE__ */ jsx(NoData, { noDataText: errorMessage });
|
|
174
|
+
const onBarClick = (data, idx, event) => {
|
|
175
|
+
event.stopPropagation();
|
|
176
|
+
if (!onValueChange) return;
|
|
177
|
+
if (idx === activeBar?.index) {
|
|
178
|
+
setActiveBar(void 0);
|
|
179
|
+
onValueChange?.(null);
|
|
180
|
+
} else {
|
|
181
|
+
setActiveBar({
|
|
182
|
+
data,
|
|
183
|
+
index: idx
|
|
184
|
+
});
|
|
185
|
+
onValueChange?.({
|
|
186
|
+
categoryClicked: data.name,
|
|
187
|
+
eventType: "bar",
|
|
188
|
+
...data
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
return /* @__PURE__ */ jsx(Flexbox, {
|
|
193
|
+
className,
|
|
194
|
+
height,
|
|
195
|
+
ref: svgRef,
|
|
196
|
+
style: {
|
|
197
|
+
position: "relative",
|
|
198
|
+
...style
|
|
199
|
+
},
|
|
200
|
+
width,
|
|
201
|
+
...rest,
|
|
202
|
+
children: data?.length ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("svg", {
|
|
203
|
+
onMouseLeave: () => setTooltip({
|
|
204
|
+
x: 0,
|
|
205
|
+
y: 0
|
|
206
|
+
}),
|
|
207
|
+
onMouseMove: (e) => {
|
|
208
|
+
const fakeTouch = {
|
|
209
|
+
clientX: e.clientX,
|
|
210
|
+
clientY: e.clientY,
|
|
211
|
+
pageX: e.pageX,
|
|
212
|
+
pageY: e.pageY
|
|
213
|
+
};
|
|
214
|
+
handleTooltip(fakeTouch);
|
|
215
|
+
},
|
|
216
|
+
onTouchEnd: () => setTooltip({
|
|
217
|
+
x: 0,
|
|
218
|
+
y: 0
|
|
219
|
+
}),
|
|
220
|
+
onTouchMove: (e) => {
|
|
221
|
+
const touch = e.touches[0];
|
|
222
|
+
handleTooltip(touch);
|
|
223
|
+
},
|
|
224
|
+
style: {
|
|
225
|
+
height: "100%",
|
|
226
|
+
width: "100%"
|
|
227
|
+
},
|
|
228
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
229
|
+
children: [
|
|
230
|
+
Y_AXIS_LABELS.map((label, index) => /* @__PURE__ */ jsxs(Fragment, { children: [showGridLines && /* @__PURE__ */ jsx("line", {
|
|
231
|
+
className: styles.gridLines,
|
|
232
|
+
x1: calculatedYAxisWidth + HALF_PADDING,
|
|
233
|
+
x2: svgWidth - HALF_PADDING,
|
|
234
|
+
y1: index * realHeight / 4 + HALF_PADDING,
|
|
235
|
+
y2: index * realHeight / 4 + HALF_PADDING
|
|
236
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
237
|
+
className: styles.label,
|
|
238
|
+
textAnchor: yAxisAlign === "left" ? "start" : "end",
|
|
239
|
+
x: yAxisAlign === "left" ? yAxisLabel ? 24 : 0 : calculatedYAxisWidth - 10 + HALF_PADDING,
|
|
240
|
+
y: index * realHeight / 4 + 5 + HALF_PADDING,
|
|
241
|
+
children: label
|
|
242
|
+
})] }, `y-axis-${index}`)),
|
|
243
|
+
formattedData.map((item, index) => /* @__PURE__ */ jsxs("g", { children: [
|
|
244
|
+
/* @__PURE__ */ jsx("rect", {
|
|
245
|
+
height: realHeight,
|
|
246
|
+
style: {
|
|
247
|
+
fill: tooltip.index === index ? cssVar.colorFillTertiary : "transparent",
|
|
248
|
+
zIndex: 0
|
|
249
|
+
},
|
|
250
|
+
width: barWidth + gap,
|
|
251
|
+
x: item.startX - gap * .5 + HALF_PADDING + calculatedYAxisWidth,
|
|
252
|
+
y: HALF_PADDING
|
|
253
|
+
}),
|
|
254
|
+
gradient && /* @__PURE__ */ jsx("rect", {
|
|
255
|
+
fill: `url(#base-gradient)`,
|
|
256
|
+
height: (realHeight - item.barHeight - (isPreviousCalculation ? realHeight - formattedData[index - 1]?.barHeight || 0 : 0)) / (isVariantCenter ? 2 : 1),
|
|
257
|
+
style: { opacity: activeBar && activeBar.index !== index ? .3 : 1 },
|
|
258
|
+
width: barWidth,
|
|
259
|
+
x: item.startX + HALF_PADDING + calculatedYAxisWidth,
|
|
260
|
+
y: realHeight - (isPreviousCalculation ? formattedData[index - 1]?.barHeight || realHeight : realHeight) + HALF_PADDING
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx("rect", {
|
|
263
|
+
height: item.barHeight,
|
|
264
|
+
onClick: (e) => onBarClick(item, index, e),
|
|
265
|
+
style: {
|
|
266
|
+
cursor: onValueChange ? "pointer" : void 0,
|
|
267
|
+
fill: color ?? cssVar.colorPrimary,
|
|
268
|
+
opacity: activeBar && activeBar.index !== index ? .3 : 1
|
|
269
|
+
},
|
|
270
|
+
width: barWidth,
|
|
271
|
+
x: item.startX + HALF_PADDING + calculatedYAxisWidth,
|
|
272
|
+
y: (isVariantCenter ? realHeight / 2 - item.barHeight / 2 : item.startY) + HALF_PADDING
|
|
273
|
+
}),
|
|
274
|
+
gradient && isVariantCenter && /* @__PURE__ */ jsx("rect", {
|
|
275
|
+
fill: `url(#base-gradient-revert)`,
|
|
276
|
+
height: (realHeight - item.barHeight) / 2,
|
|
277
|
+
style: { opacity: activeBar && activeBar.index !== index ? .3 : 1 },
|
|
278
|
+
width: barWidth,
|
|
279
|
+
x: item.startX + HALF_PADDING + calculatedYAxisWidth,
|
|
280
|
+
y: realHeight / 2 + item.barHeight / 2 + HALF_PADDING
|
|
281
|
+
}),
|
|
282
|
+
showXAxis && /* @__PURE__ */ jsx("foreignObject", {
|
|
283
|
+
height: rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT,
|
|
284
|
+
transform: rotateLabelX ? `rotate(${rotateLabelX?.angle}, ${item.startX + barWidth / 2 + HALF_PADDING + calculatedYAxisWidth}, ${realHeight + (rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT) / 2 + HALF_PADDING + (rotateLabelX?.verticalShift || 0)})` : void 0,
|
|
285
|
+
width: barWidth,
|
|
286
|
+
x: item.startX + HALF_PADDING + calculatedYAxisWidth,
|
|
287
|
+
y: realHeight + HALF_PADDING + 10,
|
|
288
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
289
|
+
className: cx(styles.strongLabel, styles.emphasis),
|
|
290
|
+
title: item.name,
|
|
291
|
+
children: item.name
|
|
292
|
+
})
|
|
293
|
+
})
|
|
294
|
+
] }, `bar-${index}`)),
|
|
295
|
+
formattedData.map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [index < data.length - 1 && evolutionGradient && (isVariantCenter ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("polygon", {
|
|
296
|
+
fill: `url(#base-gradient)`,
|
|
297
|
+
points: `
|
|
298
|
+
${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 + item.nextBarHeight / 4 + HALF_PADDING}
|
|
299
|
+
${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 + item.nextBarHeight / 4 + HALF_PADDING}
|
|
300
|
+
${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 - item.nextBarHeight / 2 + HALF_PADDING}
|
|
301
|
+
${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 - item.barHeight / 2 + HALF_PADDING}
|
|
302
|
+
`,
|
|
303
|
+
style: {
|
|
304
|
+
opacity: activeBar && activeBar.index !== index ? .3 : 1,
|
|
305
|
+
zIndex: 10
|
|
306
|
+
}
|
|
307
|
+
}), /* @__PURE__ */ jsx("polygon", {
|
|
308
|
+
fill: `url(#base-gradient-revert)`,
|
|
309
|
+
points: `
|
|
310
|
+
${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 + item.barHeight / 2 + HALF_PADDING}
|
|
311
|
+
${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 + item.nextBarHeight / 2 + HALF_PADDING}
|
|
312
|
+
${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 - item.nextBarHeight / 4 + HALF_PADDING}
|
|
313
|
+
${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${realHeight / 2 - item.nextBarHeight / 4 + HALF_PADDING}
|
|
314
|
+
`,
|
|
315
|
+
style: {
|
|
316
|
+
opacity: activeBar && activeBar.index !== index ? .3 : 1,
|
|
317
|
+
zIndex: 10
|
|
318
|
+
}
|
|
319
|
+
})] }) : /* @__PURE__ */ jsx("polygon", {
|
|
320
|
+
fill: `url(#base-gradient)`,
|
|
321
|
+
points: `
|
|
322
|
+
${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${item.startY + HALF_PADDING}
|
|
323
|
+
${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${realHeight - item.nextBarHeight + HALF_PADDING}
|
|
324
|
+
${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${realHeight + HALF_PADDING}
|
|
325
|
+
${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${realHeight + HALF_PADDING}
|
|
326
|
+
`,
|
|
327
|
+
style: {
|
|
328
|
+
opacity: activeBar && activeBar.index !== index ? .3 : 1,
|
|
329
|
+
zIndex: 10
|
|
330
|
+
}
|
|
331
|
+
})), index < data.length - 1 && showXAxis && showArrow && gap >= 14 && /* @__PURE__ */ jsx("foreignObject", {
|
|
332
|
+
height: rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT,
|
|
333
|
+
width: 12,
|
|
334
|
+
x: item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth - 6 + gap / 2,
|
|
335
|
+
y: realHeight + HALF_PADDING + 11,
|
|
336
|
+
children: /* @__PURE__ */ jsx(ArrowRightIcon, {})
|
|
337
|
+
})] }, `gradient-${index}`)),
|
|
338
|
+
/* @__PURE__ */ jsxs("linearGradient", {
|
|
339
|
+
className: cx(css`
|
|
340
|
+
stop {
|
|
341
|
+
stop-color: ${color ?? cssVar.colorPrimary};
|
|
342
|
+
}
|
|
343
|
+
`),
|
|
344
|
+
id: "base-gradient",
|
|
345
|
+
x1: "0%",
|
|
346
|
+
x2: "0%",
|
|
347
|
+
y1: "0%",
|
|
348
|
+
y2: "100%",
|
|
349
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
350
|
+
offset: "5%",
|
|
351
|
+
stopOpacity: .4
|
|
352
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
353
|
+
offset: "95%",
|
|
354
|
+
stopOpacity: 0
|
|
355
|
+
})]
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ jsxs("linearGradient", {
|
|
358
|
+
className: cx(css`
|
|
359
|
+
stop {
|
|
360
|
+
stop-color: ${color ?? cssVar.colorPrimary};
|
|
361
|
+
}
|
|
362
|
+
`),
|
|
363
|
+
id: "base-gradient-revert",
|
|
364
|
+
x1: "0%",
|
|
365
|
+
x2: "0%",
|
|
366
|
+
y1: "0%",
|
|
367
|
+
y2: "100%",
|
|
368
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
369
|
+
offset: "5%",
|
|
370
|
+
stopOpacity: 0
|
|
371
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
372
|
+
offset: "95%",
|
|
373
|
+
stopOpacity: .4
|
|
374
|
+
})]
|
|
375
|
+
}),
|
|
376
|
+
showXAxis && xAxisLabel && /* @__PURE__ */ jsx("text", {
|
|
377
|
+
className: cx(styles.strongLabel, styles.emphasis),
|
|
378
|
+
x: svgWidth / 2 + calculatedYAxisWidth / 2,
|
|
379
|
+
y: realHeight + HALF_PADDING + 50,
|
|
380
|
+
children: xAxisLabel
|
|
381
|
+
}),
|
|
382
|
+
showYAxis && yAxisLabel && /* @__PURE__ */ jsx("text", {
|
|
383
|
+
className: cx(styles.strongLabel, styles.emphasis),
|
|
384
|
+
transform: `rotate(-90, 0, ${realHeight / 2})`,
|
|
385
|
+
x: -5,
|
|
386
|
+
y: realHeight / 2 + 10,
|
|
387
|
+
children: yAxisLabel
|
|
388
|
+
})
|
|
389
|
+
]
|
|
390
|
+
}), showTooltip && /* @__PURE__ */ jsx("div", {
|
|
391
|
+
ref: tooltipRef,
|
|
392
|
+
style: {
|
|
393
|
+
display: tooltip.data ? "block" : "none",
|
|
394
|
+
left: tooltip.x + barWidth * .66,
|
|
395
|
+
pointerEvents: "none",
|
|
396
|
+
position: "absolute",
|
|
397
|
+
top: 0
|
|
398
|
+
},
|
|
399
|
+
tabIndex: -1,
|
|
400
|
+
children: CustomTooltip ? /* @__PURE__ */ jsx(CustomTooltip, {
|
|
401
|
+
active: !!tooltip.data,
|
|
402
|
+
label: tooltip.data?.name,
|
|
403
|
+
payload: tooltip.data ? [tooltip.data] : [],
|
|
404
|
+
valueFormatter
|
|
405
|
+
}) : /* @__PURE__ */ jsx(ChartTooltip, {
|
|
406
|
+
active: !!tooltip.data,
|
|
407
|
+
categoryColors: /* @__PURE__ */ new Map([[tooltip.data?.name ?? "", tooltip.data?.color ?? ""]]),
|
|
408
|
+
label: tooltip.data?.name || "",
|
|
409
|
+
payload: tooltip.data ? [tooltip.data] : [],
|
|
410
|
+
valueFormatter
|
|
411
|
+
})
|
|
412
|
+
})] }) : /* @__PURE__ */ jsx(NoData, { noDataText })
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
FunnelChart.displayName = "FunnelChart";
|
|
416
|
+
//#endregion
|
|
417
|
+
export { FunnelChart as default };
|
|
418
|
+
|
|
419
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/FunnelChart/index.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, Skeleton, css, cssVar, cx } from '@lobehub/ui';\nimport { useSize } from 'ahooks';\nimport {\n Fragment,\n MouseEvent,\n Touch,\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport ArrowRightIcon from '@/FunnelChart/ArrowRightIcon';\nimport BaseChartProps from '@/common/BaseChartProps';\nimport ChartTooltip from '@/common/ChartTooltip';\nimport NoData from '@/common/NoData';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { defaultValueFormatter } from '@/utils';\nimport { getMaxLabelLength } from '@/utils/getMaxLabelLength';\n\nimport { styles } from './styles';\n\ntype FormattedDataT = DataT & {\n barHeight: number;\n nextBarHeight: number;\n nextNormalizedValue: number;\n nextStartX: number;\n nextValue: number;\n normalizedValue: number;\n startX: number;\n startY: number;\n};\n\ntype CalculateFrom = 'first' | 'previous';\n\ntype Tooltip = {\n data?: {\n className?: string;\n color?: string;\n dataKey: string;\n fill?: string;\n name: string;\n payload?: any;\n value: number;\n };\n index?: number;\n x: number;\n y: number;\n};\n\ntype DataT = {\n name: string;\n value: number;\n};\n\nconst GLOBAL_PADDING = 10;\nconst HALF_PADDING = GLOBAL_PADDING / 2;\nconst Y_AXIS_LABELS = ['100%', '75%', '50%', '25%', '0%'];\n\nconst validateData = (data: DataT[], calculatedFrom?: CalculateFrom): string | null => {\n if (data && data.length > 0) {\n if (calculatedFrom === 'previous' && data[0].value <= 0) {\n return `The value of the first item \"${data[0].name}\" is not greater than 0. This is not allowed when setting the \"calculateFrom\" prop to \"previous\". Please enter a value greater than 0.`;\n }\n\n for (const item of data) {\n if (item.value < 0) {\n return `Item \"${item.name}\" has a negative value: ${item.value}. This is not allowed. The value must be greater than or equal to 0.`;\n }\n }\n }\n return null;\n};\n\nexport interface FunnelChartProps extends Omit<BaseChartProps, 'categories' | 'index'> {\n barGap?: number | `${number}%`;\n calculateFrom?: CalculateFrom;\n data: DataT[];\n evolutionGradient?: boolean;\n gradient?: boolean;\n showArrow?: boolean;\n variant?: 'base' | 'center';\n yAxisPadding?: number;\n}\n\nconst FunnelChart = forwardRef<HTMLDivElement, FunnelChartProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n\n const {\n data = [],\n evolutionGradient = true,\n gradient = false,\n valueFormatter = defaultValueFormatter,\n calculateFrom = 'first',\n color = themeColorRange[0],\n variant = 'base',\n showGridLines = true,\n showYAxis = calculateFrom === 'previous' ? false : true,\n showXAxis = true,\n showArrow = true,\n xAxisLabel = '',\n yAxisLabel = '',\n yAxisAlign = 'left',\n showTooltip = true,\n onValueChange,\n customTooltip,\n noDataText,\n rotateLabelX,\n barGap = '20%',\n loading,\n width = '100%',\n height = 280,\n className,\n style,\n yAxisWidth,\n ...rest\n } = props;\n\n const svgRef = useRef<HTMLDivElement>(ref as any);\n const size = useSize(svgRef);\n\n const tooltipRef = useRef<HTMLDivElement>(null);\n\n const [svgWidth, setSvgWidth] = useState(0);\n const [svgHeight, setSvgHeight] = useState(0);\n const [tooltip, setTooltip] = useState<Tooltip>({ x: 0, y: 0 });\n const [activeBar, setActiveBar] = useState<any | undefined>();\n\n const DEFAULT_X_AXIS_HEIGHT = showXAxis && xAxisLabel ? 25 : 15;\n\n const CustomTooltip = customTooltip;\n\n const calculatedYAxisWidth: number | string = useMemo(() => {\n if (yAxisWidth) return yAxisWidth;\n return getMaxLabelLength({ data, index: 'value', valueFormatter }) / 4 + (yAxisLabel ? 24 : 0);\n }, [yAxisWidth, data, valueFormatter, yAxisLabel]);\n\n useEffect(() => {\n const handleResize = () => {\n setSvgWidth(size?.width || 0);\n setSvgHeight(size?.height || 0);\n };\n handleResize();\n }, [size]);\n\n useEffect(() => {\n const handleTooltipOverflows = () => {\n if (tooltipRef.current) {\n const boundingBox = tooltipRef.current.getBoundingClientRect();\n if (boundingBox.right > window.innerWidth) {\n tooltipRef.current.style.left = `${svgWidth - boundingBox.width}px`;\n }\n }\n };\n\n handleTooltipOverflows();\n window.addEventListener('resize', handleTooltipOverflows);\n return () => window.removeEventListener('resize', handleTooltipOverflows);\n }, [tooltip, svgWidth]);\n\n const maxValue = useMemo(() => Math.max(...data.map((item) => item.value)), [data]);\n\n const widthWithoutPadding = svgWidth - GLOBAL_PADDING - calculatedYAxisWidth;\n const gap = useMemo(() => {\n if (typeof barGap === 'number') {\n return barGap;\n } else if (typeof barGap === 'string' && barGap.endsWith('%')) {\n const percentage = Number.parseFloat(barGap.slice(0, -1));\n const totalWidthForGaps = (widthWithoutPadding * percentage) / 100;\n const numberOfGaps = data.length - 1;\n return totalWidthForGaps / numberOfGaps;\n } else {\n console.error(\n 'Invalid barGap value. It must be a number or a percentage string (e.g., \"10%\").',\n );\n return 30;\n }\n }, [widthWithoutPadding, data.length, barGap]);\n\n const barWidth = useMemo(\n () => (widthWithoutPadding - (data.length - 1) * gap - gap) / data.length,\n [widthWithoutPadding, gap, data.length],\n );\n\n const realHeight =\n svgHeight -\n GLOBAL_PADDING -\n (showXAxis\n ? (rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT) + (showXAxis && xAxisLabel ? 30 : 10)\n : 0);\n\n const isPreviousCalculation = calculateFrom === 'previous';\n const isVariantCenter = variant === 'center';\n\n const formattedData = useMemo(() => {\n if (realHeight <= 0) return [];\n return data.reduce((acc: FormattedDataT[], item, index) => {\n const prev = acc[index - 1];\n const value = item.value;\n const valueToCompareWith = isPreviousCalculation ? (prev?.value ?? maxValue) : maxValue;\n const calculationHeight = isPreviousCalculation\n ? (prev?.barHeight ?? realHeight)\n : realHeight;\n\n const normalizedValue = value / valueToCompareWith;\n const barHeight = normalizedValue * calculationHeight;\n const startX = index * (barWidth + gap) + 0.5 * gap;\n const startY =\n calculationHeight -\n barHeight +\n (isPreviousCalculation ? realHeight - (prev?.barHeight ?? realHeight) : 0);\n const nextValue = data[index + 1]?.value;\n const nextNormalizedValue = nextValue / valueToCompareWith;\n const nextBarHeight = nextNormalizedValue * calculationHeight;\n const nextStartX = (index + 1) * (barWidth + gap) + 0.5 * gap;\n\n acc.push({\n barHeight,\n name: item.name,\n nextBarHeight,\n nextNormalizedValue,\n nextStartX,\n nextValue,\n normalizedValue,\n startX,\n startY,\n value,\n });\n\n return acc;\n }, []);\n }, [data, realHeight, isPreviousCalculation, barWidth, gap, maxValue]);\n\n const handleTooltip = (touch: Touch) => {\n const chartBoundingRect = svgRef.current?.getBoundingClientRect();\n if (!chartBoundingRect) return;\n const chartX = chartBoundingRect.x;\n\n if (formattedData.length === 0) {\n return setTooltip({ x: 0, y: 0 });\n }\n\n const pageX = touch.pageX - chartX - barWidth / 2 - calculatedYAxisWidth - HALF_PADDING;\n const closestBar = formattedData.reduce((acc, current) => {\n const currentDistance = Math.abs(current.startX - pageX);\n const accDistance = Math.abs(acc.startX - pageX);\n return currentDistance < accDistance ? current : acc;\n }, formattedData[0]); // 提供初始值\n\n const closestBarIndex = formattedData.indexOf(closestBar);\n\n setTooltip({\n data: {\n className: cx(css`\n cursor: ${onValueChange ? 'pointer' : undefined};\n color: ${color ?? cssVar.colorPrimary};\n `),\n color: color ?? cssVar.colorPrimary,\n dataKey: closestBar.name,\n fill: '',\n name: closestBar.name,\n payload: closestBar,\n value: closestBar.value,\n },\n index: closestBarIndex,\n x: closestBar.startX,\n y: closestBar.startY,\n });\n };\n\n if (loading || !data) return <Skeleton height={height} width={width} />;\n\n const errorMessage = data ? validateData(data, calculateFrom) : null;\n\n if (errorMessage) {\n return <NoData noDataText={errorMessage} />;\n }\n\n const onBarClick = (data: any, idx: number, event: MouseEvent) => {\n event.stopPropagation();\n if (!onValueChange) return;\n if (idx === activeBar?.index) {\n setActiveBar(undefined);\n onValueChange?.(null);\n } else {\n setActiveBar({ data, index: idx });\n onValueChange?.({\n categoryClicked: data.name,\n eventType: 'bar',\n ...data,\n });\n }\n };\n\n return (\n <Flexbox\n className={className}\n height={height}\n ref={svgRef}\n style={{ position: 'relative', ...style }}\n width={width}\n {...rest}\n >\n {data?.length ? (\n <>\n <svg\n onMouseLeave={() => setTooltip({ x: 0, y: 0 })}\n onMouseMove={(e) => {\n const fakeTouch = {\n clientX: e.clientX,\n clientY: e.clientY,\n pageX: e.pageX,\n pageY: e.pageY,\n } as Touch;\n handleTooltip(fakeTouch);\n }}\n onTouchEnd={() => setTooltip({ x: 0, y: 0 })}\n onTouchMove={(e) => {\n const touch = e.touches[0];\n handleTooltip(touch);\n }}\n style={{\n height: '100%',\n width: '100%',\n }}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {/* Y axis labels and lines */}\n {Y_AXIS_LABELS.map((label, index) => (\n <Fragment key={`y-axis-${index}`}>\n {showGridLines && (\n <line\n className={styles.gridLines}\n x1={calculatedYAxisWidth + HALF_PADDING}\n x2={svgWidth - HALF_PADDING}\n y1={(index * realHeight) / 4 + HALF_PADDING}\n y2={(index * realHeight) / 4 + HALF_PADDING}\n />\n )}\n <text\n className={styles.label}\n textAnchor={yAxisAlign === 'left' ? 'start' : 'end'}\n x={\n yAxisAlign === 'left'\n ? yAxisLabel\n ? 24\n : 0\n : calculatedYAxisWidth - 10 + HALF_PADDING\n }\n y={(index * realHeight) / 4 + 5 + HALF_PADDING}\n >\n {label}\n </text>\n </Fragment>\n ))}\n {/* Bars and labels */}\n {formattedData.map((item, index) => (\n <g key={`bar-${index}`}>\n {/* Hover gray rect */}\n <rect\n height={realHeight}\n style={{\n fill: tooltip.index === index ? cssVar.colorFillTertiary : 'transparent',\n zIndex: 0,\n }}\n width={barWidth + gap}\n x={item.startX - gap * 0.5 + HALF_PADDING + calculatedYAxisWidth}\n y={HALF_PADDING}\n />\n {/* Gradient bar */}\n {gradient && (\n <rect\n fill={`url(#base-gradient)`}\n height={\n (realHeight -\n item.barHeight -\n (isPreviousCalculation\n ? realHeight - formattedData[index - 1]?.barHeight || 0\n : 0)) /\n (isVariantCenter ? 2 : 1)\n }\n style={{\n opacity: activeBar && activeBar.index !== index ? 0.3 : 1,\n }}\n width={barWidth}\n x={item.startX + HALF_PADDING + calculatedYAxisWidth}\n y={\n realHeight -\n (isPreviousCalculation\n ? formattedData[index - 1]?.barHeight || realHeight\n : realHeight) +\n HALF_PADDING\n }\n />\n )}\n {/* Main bar */}\n <rect\n height={item.barHeight}\n onClick={(e) => onBarClick(item, index, e)}\n style={{\n cursor: onValueChange ? 'pointer' : undefined,\n fill: color ?? cssVar.colorPrimary,\n opacity: activeBar && activeBar.index !== index ? 0.3 : 1,\n }}\n width={barWidth}\n x={item.startX + HALF_PADDING + calculatedYAxisWidth}\n y={\n (isVariantCenter ? realHeight / 2 - item.barHeight / 2 : item.startY) +\n HALF_PADDING\n }\n />\n {/* Bottom gradient bar */}\n {gradient && isVariantCenter && (\n <rect\n fill={`url(#base-gradient-revert)`}\n height={(realHeight - item.barHeight) / 2}\n style={{\n opacity: activeBar && activeBar.index !== index ? 0.3 : 1,\n }}\n width={barWidth}\n x={item.startX + HALF_PADDING + calculatedYAxisWidth}\n y={realHeight / 2 + item.barHeight / 2 + HALF_PADDING}\n />\n )}\n {/* X axis label */}\n {showXAxis && (\n <foreignObject\n height={rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT}\n transform={\n rotateLabelX\n ? `rotate(${rotateLabelX?.angle}, ${\n item.startX + barWidth / 2 + HALF_PADDING + calculatedYAxisWidth\n }, ${\n realHeight +\n (rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT) / 2 +\n HALF_PADDING +\n (rotateLabelX?.verticalShift || 0)\n })`\n : undefined\n }\n width={barWidth}\n x={item.startX + HALF_PADDING + calculatedYAxisWidth}\n y={realHeight + HALF_PADDING + 10}\n >\n <div className={cx(styles.strongLabel, styles.emphasis)} title={item.name}>\n {item.name}\n </div>\n </foreignObject>\n )}\n </g>\n ))}\n {/* Gradient polygons between bars */}\n {formattedData.map((item, index) => (\n <Fragment key={`gradient-${index}`}>\n {index < data.length - 1 &&\n evolutionGradient &&\n (isVariantCenter ? (\n <>\n <polygon\n fill={`url(#base-gradient)`}\n points={`\n ${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 + item.nextBarHeight / 4 + HALF_PADDING\n }\n ${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 + item.nextBarHeight / 4 + HALF_PADDING\n }\n ${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 - item.nextBarHeight / 2 + HALF_PADDING\n }\n ${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 - item.barHeight / 2 + HALF_PADDING\n }\n `}\n style={{\n opacity: activeBar && activeBar.index !== index ? 0.3 : 1,\n zIndex: 10,\n }}\n />\n <polygon\n fill={`url(#base-gradient-revert)`}\n points={`\n ${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 + item.barHeight / 2 + HALF_PADDING\n }\n ${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 + item.nextBarHeight / 2 + HALF_PADDING\n }\n ${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 - item.nextBarHeight / 4 + HALF_PADDING\n }\n ${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight / 2 - item.nextBarHeight / 4 + HALF_PADDING\n }\n `}\n style={{\n opacity: activeBar && activeBar.index !== index ? 0.3 : 1,\n zIndex: 10,\n }}\n />\n </>\n ) : (\n <polygon\n fill={`url(#base-gradient)`}\n points={`\n ${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${\n item.startY + HALF_PADDING\n }\n ${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight - item.nextBarHeight + HALF_PADDING\n }\n ${item.nextStartX + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight + HALF_PADDING\n }\n ${item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth}, ${\n realHeight + HALF_PADDING\n }\n `}\n style={{\n opacity: activeBar && activeBar.index !== index ? 0.3 : 1,\n zIndex: 10,\n }}\n />\n ))}\n {/* Arrow between labels */}\n {index < data.length - 1 && showXAxis && showArrow && gap >= 14 && (\n <foreignObject\n height={rotateLabelX?.xAxisHeight || DEFAULT_X_AXIS_HEIGHT}\n width={12}\n x={item.startX + barWidth + HALF_PADDING + calculatedYAxisWidth - 6 + gap / 2}\n y={realHeight + HALF_PADDING + 11}\n >\n <ArrowRightIcon />\n </foreignObject>\n )}\n </Fragment>\n ))}\n {/* Gradients */}\n <linearGradient\n className={cx(css`\n stop {\n stop-color: ${color ?? cssVar.colorPrimary};\n }\n `)}\n id={'base-gradient'}\n x1=\"0%\"\n x2=\"0%\"\n y1=\"0%\"\n y2=\"100%\"\n >\n <stop offset=\"5%\" stopOpacity={0.4} />\n <stop offset=\"95%\" stopOpacity={0} />\n </linearGradient>\n <linearGradient\n className={cx(css`\n stop {\n stop-color: ${color ?? cssVar.colorPrimary};\n }\n `)}\n id={'base-gradient-revert'}\n x1=\"0%\"\n x2=\"0%\"\n y1=\"0%\"\n y2=\"100%\"\n >\n <stop offset=\"5%\" stopOpacity={0} />\n <stop offset=\"95%\" stopOpacity={0.4} />\n </linearGradient>\n {/* X and Y axis labels */}\n {showXAxis && xAxisLabel && (\n <text\n className={cx(styles.strongLabel, styles.emphasis)}\n x={svgWidth / 2 + calculatedYAxisWidth / 2}\n y={realHeight + HALF_PADDING + 50}\n >\n {xAxisLabel}\n </text>\n )}\n {showYAxis && yAxisLabel && (\n <text\n className={cx(styles.strongLabel, styles.emphasis)}\n transform={`rotate(-90, 0, ${realHeight / 2})`}\n x={-5}\n y={realHeight / 2 + 10}\n >\n {yAxisLabel}\n </text>\n )}\n </svg>\n {/* Tooltip */}\n {showTooltip && (\n <div\n ref={tooltipRef}\n style={{\n display: tooltip.data ? 'block' : 'none',\n left: tooltip.x + barWidth * 0.66,\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n }}\n tabIndex={-1}\n >\n {CustomTooltip ? (\n <CustomTooltip\n active={!!tooltip.data}\n label={tooltip.data?.name}\n payload={tooltip.data ? [tooltip.data] : []}\n valueFormatter={valueFormatter}\n />\n ) : (\n <ChartTooltip\n active={!!tooltip.data}\n categoryColors={new Map([[tooltip.data?.name ?? '', tooltip.data?.color ?? '']])}\n label={tooltip.data?.name || ''}\n payload={tooltip.data ? [tooltip.data] : []}\n valueFormatter={valueFormatter}\n />\n )}\n </div>\n )}\n </>\n ) : (\n <NoData noDataText={noDataText} />\n )}\n </Flexbox>\n );\n});\n\nFunnelChart.displayName = 'FunnelChart';\n\nexport default FunnelChart;\n"],"mappings":";;;;;;;;;;;;;AA0DA,MAAM,iBAAiB;AACvB,MAAM,eAAe,iBAAiB;AACtC,MAAM,gBAAgB;CAAC;CAAQ;CAAO;CAAO;CAAO;AAAI;AAExD,MAAM,gBAAgB,MAAe,mBAAkD;CACrF,IAAI,QAAQ,KAAK,SAAS,GAAG;EAC3B,IAAI,mBAAmB,cAAc,KAAK,EAAE,CAAC,SAAS,GACpD,OAAO,gCAAgC,KAAK,EAAE,CAAC,KAAK;EAGtD,KAAK,MAAM,QAAQ,MACjB,IAAI,KAAK,QAAQ,GACf,OAAO,SAAS,KAAK,KAAK,0BAA0B,KAAK,MAAM;CAGrE;CACA,OAAO;AACT;AAaA,MAAM,cAAc,YAA8C,OAAO,QAAQ;CAC/E,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,EACJ,OAAO,CAAC,GACR,oBAAoB,MACpB,WAAW,OACX,iBAAiB,uBACjB,gBAAgB,SAChB,QAAQ,gBAAgB,IACxB,UAAU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,oBAAC,QAAD;KACE,WAAW,GAAG,OAAO,aAAa,OAAO,QAAQ;KACjD,GAAG,WAAW,IAAI,uBAAuB;KACzC,GAAG,aAAa,eAAe;KAE9B,UAAA;IACG,CAAA;IAEP,aAAa,cACZ,oBAAC,QAAD;KACE,WAAW,GAAG,OAAO,aAAa,OAAO,QAAQ;KACjD,WAAW,kBAAkB,aAAa,EAAE;KAC5C,GAAG;KACH,GAAG,aAAa,IAAI;KAEnB,UAAA;IACG,CAAA;GAEL;EAEJ,CAAA,GAAA,eACC,oBAAC,OAAD;GACE,KAAK;GACL,OAAO;IACL,SAAS,QAAQ,OAAO,UAAU;IAClC,MAAM,QAAQ,IAAI,WAAW;IAC7B,eAAe;IACf,UAAU;IACV,KAAK;GACP;GACA,UAAU;GAET,UAAA,gBACC,oBAAC,eAAD;IACE,QAAQ,CAAC,CAAC,QAAQ;IAClB,OAAO,QAAQ,MAAM;IACrB,SAAS,QAAQ,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC;IAC1B;GACjB,CAAA,IAED,oBAAC,cAAD;IACE,QAAQ,CAAC,CAAC,QAAQ;IAClB,gCAAgB,IAAI,IAAI,CAAC,CAAC,QAAQ,MAAM,QAAQ,IAAI,QAAQ,MAAM,SAAS,EAAE,CAAC,CAAC;IAC/E,OAAO,QAAQ,MAAM,QAAQ;IAC7B,SAAS,QAAQ,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC;IAC1B;GACjB,CAAA;EAEA,CAAA,CAEP,EAAA,CAAA,IAEF,oBAAC,QAAD,EAAoB,WAAa,CAAA;CAE5B,CAAA;AAEb,CAAC;AAED,YAAY,cAAc"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createStaticStyles } from "@lobehub/ui";
|
|
2
|
+
//#region src/FunnelChart/styles.ts
|
|
3
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
4
|
+
emphasis: css`
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
text-overflow: ellipsis;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
`,
|
|
9
|
+
gridLines: css`
|
|
10
|
+
stroke: ${cssVar.colorBorderSecondary};
|
|
11
|
+
stroke-width: 1;
|
|
12
|
+
`,
|
|
13
|
+
label: css`
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
line-height: 16px;
|
|
16
|
+
fill: ${cssVar.colorTextDescription};
|
|
17
|
+
`,
|
|
18
|
+
strongLabel: css`
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 16px;
|
|
22
|
+
fill: ${cssVar.colorTextSecondary};
|
|
23
|
+
`
|
|
24
|
+
}));
|
|
25
|
+
//#endregion
|
|
26
|
+
export { styles };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=styles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.mjs","names":[],"sources":["../../src/FunnelChart/styles.ts"],"sourcesContent":["import { createStaticStyles } from '@lobehub/ui';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n emphasis: css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n gridLines: css`\n stroke: ${cssVar.colorBorderSecondary};\n stroke-width: 1;\n `,\n label: css`\n font-size: 12px;\n line-height: 16px;\n fill: ${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,WAAW,GAAG;cACF,OAAO,qBAAqB;;;CAGxC,OAAO,GAAG;;;YAGA,OAAO,qBAAqB;;CAEtC,aAAa,GAAG;;;;YAIN,OAAO,mBAAmB;;AAEtC,EAAE"}
|