@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
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _templateObject, _templateObject2;
|
|
5
|
-
var _excluded = ["data", "index", "series", "yAxisLeft", "yAxisRight", "colors", "xAxisLabelFormatter", "startEndOnly", "animationDuration", "showAnimation", "showXAxis", "showYAxis", "intervalType", "showTooltip", "showLegend", "showGridLines", "allowDecimals", "noDataText", "enableLegendSlider", "rotateLabelX", "tickGap", "loading", "xAxisLabel", "className", "width", "height", "style"];
|
|
6
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
7
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
-
import { Flexbox, Skeleton, css, cssVar, cx } from '@lobehub/ui';
|
|
21
|
-
import { forwardRef, useMemo, useState } from 'react';
|
|
22
|
-
import { Bar, CartesianGrid, Label, Legend, Line, ComposedChart as ReChartsComposedChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
|
23
|
-
import ChartLegend from "../common/ChartLegend";
|
|
24
|
-
import ChartTooltip from "../common/ChartTooltip";
|
|
25
|
-
import CustomYAxisTick from "../common/CustomYAxisTick";
|
|
26
|
-
import NoData from "../common/NoData";
|
|
27
|
-
import { useThemeColorRange } from "../hooks/useThemeColorRange";
|
|
28
|
-
import { defaultValueFormatter } from "../utils";
|
|
29
|
-
import { getMaxLabelLength } from "../utils/getMaxLabelLength";
|
|
30
|
-
import { styles } from "./styles";
|
|
31
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
-
var ComposedChart = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
|
-
var _data$at, _yAxisLeft$valueForma3, _yAxisRight$valueForm3;
|
|
35
|
-
var themeColorRange = useThemeColorRange();
|
|
36
|
-
var _props$data = props.data,
|
|
37
|
-
data = _props$data === void 0 ? [] : _props$data,
|
|
38
|
-
index = props.index,
|
|
39
|
-
_props$series = props.series,
|
|
40
|
-
series = _props$series === void 0 ? [] : _props$series,
|
|
41
|
-
yAxisLeft = props.yAxisLeft,
|
|
42
|
-
yAxisRight = props.yAxisRight,
|
|
43
|
-
_props$colors = props.colors,
|
|
44
|
-
colors = _props$colors === void 0 ? themeColorRange : _props$colors,
|
|
45
|
-
_props$xAxisLabelForm = props.xAxisLabelFormatter,
|
|
46
|
-
xAxisLabelFormatter = _props$xAxisLabelForm === void 0 ? defaultValueFormatter : _props$xAxisLabelForm,
|
|
47
|
-
_props$startEndOnly = props.startEndOnly,
|
|
48
|
-
startEndOnly = _props$startEndOnly === void 0 ? false : _props$startEndOnly,
|
|
49
|
-
_props$animationDurat = props.animationDuration,
|
|
50
|
-
animationDuration = _props$animationDurat === void 0 ? 900 : _props$animationDurat,
|
|
51
|
-
_props$showAnimation = props.showAnimation,
|
|
52
|
-
showAnimation = _props$showAnimation === void 0 ? false : _props$showAnimation,
|
|
53
|
-
_props$showXAxis = props.showXAxis,
|
|
54
|
-
showXAxis = _props$showXAxis === void 0 ? true : _props$showXAxis,
|
|
55
|
-
_props$showYAxis = props.showYAxis,
|
|
56
|
-
showYAxis = _props$showYAxis === void 0 ? true : _props$showYAxis,
|
|
57
|
-
_props$intervalType = props.intervalType,
|
|
58
|
-
intervalType = _props$intervalType === void 0 ? 'equidistantPreserveStart' : _props$intervalType,
|
|
59
|
-
_props$showTooltip = props.showTooltip,
|
|
60
|
-
showTooltip = _props$showTooltip === void 0 ? true : _props$showTooltip,
|
|
61
|
-
_props$showLegend = props.showLegend,
|
|
62
|
-
showLegend = _props$showLegend === void 0 ? true : _props$showLegend,
|
|
63
|
-
_props$showGridLines = props.showGridLines,
|
|
64
|
-
showGridLines = _props$showGridLines === void 0 ? true : _props$showGridLines,
|
|
65
|
-
_props$allowDecimals = props.allowDecimals,
|
|
66
|
-
allowDecimals = _props$allowDecimals === void 0 ? true : _props$allowDecimals,
|
|
67
|
-
noDataText = props.noDataText,
|
|
68
|
-
_props$enableLegendSl = props.enableLegendSlider,
|
|
69
|
-
enableLegendSlider = _props$enableLegendSl === void 0 ? false : _props$enableLegendSl,
|
|
70
|
-
rotateLabelX = props.rotateLabelX,
|
|
71
|
-
_props$tickGap = props.tickGap,
|
|
72
|
-
tickGap = _props$tickGap === void 0 ? 5 : _props$tickGap,
|
|
73
|
-
loading = props.loading,
|
|
74
|
-
xAxisLabel = props.xAxisLabel,
|
|
75
|
-
className = props.className,
|
|
76
|
-
_props$width = props.width,
|
|
77
|
-
width = _props$width === void 0 ? '100%' : _props$width,
|
|
78
|
-
_props$height = props.height,
|
|
79
|
-
height = _props$height === void 0 ? 280 : _props$height,
|
|
80
|
-
style = props.style,
|
|
81
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
82
|
-
var _useState = useState(60),
|
|
83
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
-
legendHeight = _useState2[0],
|
|
85
|
-
setLegendHeight = _useState2[1];
|
|
86
|
-
var seriesColorMap = useMemo(function () {
|
|
87
|
-
var map = new Map();
|
|
88
|
-
series.forEach(function (s, i) {
|
|
89
|
-
var _s$color;
|
|
90
|
-
map.set(s.key, (_s$color = s.color) !== null && _s$color !== void 0 ? _s$color : colors[i % colors.length]);
|
|
91
|
-
});
|
|
92
|
-
return map;
|
|
93
|
-
}, [series, colors]);
|
|
94
|
-
var categoryColors = seriesColorMap;
|
|
95
|
-
var customCategories = useMemo(function () {
|
|
96
|
-
return series.reduce(function (acc, item) {
|
|
97
|
-
if (item.name) acc[item.key] = item.name;
|
|
98
|
-
return acc;
|
|
99
|
-
}, {});
|
|
100
|
-
}, [series]);
|
|
101
|
-
var hasRightAxis = series.some(function (s) {
|
|
102
|
-
return s.axis === 'right';
|
|
103
|
-
});
|
|
104
|
-
var leftYAxisWidth = useMemo(function () {
|
|
105
|
-
var _yAxisLeft$valueForma;
|
|
106
|
-
if (yAxisLeft !== null && yAxisLeft !== void 0 && yAxisLeft.width) return yAxisLeft.width;
|
|
107
|
-
var leftFormatter = (_yAxisLeft$valueForma = yAxisLeft === null || yAxisLeft === void 0 ? void 0 : yAxisLeft.valueFormatter) !== null && _yAxisLeft$valueForma !== void 0 ? _yAxisLeft$valueForma : defaultValueFormatter;
|
|
108
|
-
return getMaxLabelLength({
|
|
109
|
-
data: data,
|
|
110
|
-
index: index,
|
|
111
|
-
layout: 'horizontal',
|
|
112
|
-
valueFormatter: leftFormatter
|
|
113
|
-
});
|
|
114
|
-
}, [yAxisLeft, data, index]);
|
|
115
|
-
var rightYAxisWidth = useMemo(function () {
|
|
116
|
-
var _yAxisRight$valueForm;
|
|
117
|
-
if (yAxisRight !== null && yAxisRight !== void 0 && yAxisRight.width) return yAxisRight.width;
|
|
118
|
-
var rightFormatter = (_yAxisRight$valueForm = yAxisRight === null || yAxisRight === void 0 ? void 0 : yAxisRight.valueFormatter) !== null && _yAxisRight$valueForm !== void 0 ? _yAxisRight$valueForm : defaultValueFormatter;
|
|
119
|
-
return getMaxLabelLength({
|
|
120
|
-
data: data,
|
|
121
|
-
index: index,
|
|
122
|
-
layout: 'horizontal',
|
|
123
|
-
valueFormatter: rightFormatter
|
|
124
|
-
});
|
|
125
|
-
}, [yAxisRight, data, index]);
|
|
126
|
-
if (loading || !data) return /*#__PURE__*/_jsx(Skeleton, {
|
|
127
|
-
height: height,
|
|
128
|
-
width: width
|
|
129
|
-
});
|
|
130
|
-
var paddingValue = !showXAxis && !showYAxis ? 0 : 20;
|
|
131
|
-
return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
|
|
132
|
-
className: className,
|
|
133
|
-
height: height,
|
|
134
|
-
ref: ref,
|
|
135
|
-
style: _objectSpread({
|
|
136
|
-
position: 'relative'
|
|
137
|
-
}, style),
|
|
138
|
-
width: width
|
|
139
|
-
}, rest), {}, {
|
|
140
|
-
children: /*#__PURE__*/_jsx(ResponsiveContainer, {
|
|
141
|
-
children: data !== null && data !== void 0 && data.length ? /*#__PURE__*/_jsxs(ReChartsComposedChart, {
|
|
142
|
-
data: data,
|
|
143
|
-
margin: {
|
|
144
|
-
bottom: xAxisLabel ? 30 : undefined,
|
|
145
|
-
left: yAxisLeft !== null && yAxisLeft !== void 0 && yAxisLeft.label ? 20 : undefined,
|
|
146
|
-
right: hasRightAxis ? yAxisRight !== null && yAxisRight !== void 0 && yAxisRight.label ? 20 : 5 : undefined,
|
|
147
|
-
top: 5
|
|
148
|
-
},
|
|
149
|
-
children: [showGridLines && /*#__PURE__*/_jsx(CartesianGrid, {
|
|
150
|
-
className: styles.gridLines,
|
|
151
|
-
horizontal: true,
|
|
152
|
-
vertical: false
|
|
153
|
-
}), /*#__PURE__*/_jsx(XAxis, {
|
|
154
|
-
angle: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.angle,
|
|
155
|
-
axisLine: false,
|
|
156
|
-
className: styles.label,
|
|
157
|
-
dataKey: index,
|
|
158
|
-
dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
|
|
159
|
-
fill: "",
|
|
160
|
-
hide: !showXAxis,
|
|
161
|
-
interval: startEndOnly ? 'preserveStartEnd' : intervalType,
|
|
162
|
-
minTickGap: tickGap,
|
|
163
|
-
padding: {
|
|
164
|
-
left: paddingValue,
|
|
165
|
-
right: paddingValue
|
|
166
|
-
},
|
|
167
|
-
stroke: "",
|
|
168
|
-
tick: {
|
|
169
|
-
transform: 'translate(0, 6)'
|
|
170
|
-
},
|
|
171
|
-
tickFormatter: xAxisLabelFormatter,
|
|
172
|
-
tickLine: false,
|
|
173
|
-
ticks: startEndOnly ? [data[0][index], (_data$at = data.at(-1)) === null || _data$at === void 0 ? void 0 : _data$at[index]] : undefined,
|
|
174
|
-
children: xAxisLabel && /*#__PURE__*/_jsx(Label, {
|
|
175
|
-
className: cx(styles.strongLabel, styles.emphasis),
|
|
176
|
-
offset: -20,
|
|
177
|
-
position: "insideBottom",
|
|
178
|
-
style: {
|
|
179
|
-
fill: cssVar.colorTextSecondary,
|
|
180
|
-
fontWeight: 500,
|
|
181
|
-
textAnchor: 'middle'
|
|
182
|
-
},
|
|
183
|
-
children: xAxisLabel
|
|
184
|
-
})
|
|
185
|
-
}), /*#__PURE__*/_jsx(YAxis, {
|
|
186
|
-
allowDecimals: allowDecimals,
|
|
187
|
-
axisLine: false,
|
|
188
|
-
className: styles.label,
|
|
189
|
-
domain: yAxisLeft === null || yAxisLeft === void 0 ? void 0 : yAxisLeft.domain,
|
|
190
|
-
fill: "",
|
|
191
|
-
hide: !showYAxis,
|
|
192
|
-
orientation: "left",
|
|
193
|
-
stroke: "",
|
|
194
|
-
tick: function tick(tickProps) {
|
|
195
|
-
var _yAxisLeft$valueForma2;
|
|
196
|
-
return /*#__PURE__*/_jsx(CustomYAxisTick, _objectSpread(_objectSpread({}, tickProps), {}, {
|
|
197
|
-
align: "left",
|
|
198
|
-
formatter: (_yAxisLeft$valueForma2 = yAxisLeft === null || yAxisLeft === void 0 ? void 0 : yAxisLeft.valueFormatter) !== null && _yAxisLeft$valueForma2 !== void 0 ? _yAxisLeft$valueForma2 : defaultValueFormatter,
|
|
199
|
-
yAxisLabel: Boolean(yAxisLeft === null || yAxisLeft === void 0 ? void 0 : yAxisLeft.label)
|
|
200
|
-
}));
|
|
201
|
-
},
|
|
202
|
-
tickFormatter: (_yAxisLeft$valueForma3 = yAxisLeft === null || yAxisLeft === void 0 ? void 0 : yAxisLeft.valueFormatter) !== null && _yAxisLeft$valueForma3 !== void 0 ? _yAxisLeft$valueForma3 : defaultValueFormatter,
|
|
203
|
-
tickLine: false,
|
|
204
|
-
type: "number",
|
|
205
|
-
width: leftYAxisWidth,
|
|
206
|
-
yAxisId: "left",
|
|
207
|
-
children: (yAxisLeft === null || yAxisLeft === void 0 ? void 0 : yAxisLeft.label) && /*#__PURE__*/_jsx(Label, {
|
|
208
|
-
angle: -90,
|
|
209
|
-
className: styles.emphasis,
|
|
210
|
-
offset: -15,
|
|
211
|
-
position: "insideLeft",
|
|
212
|
-
style: {
|
|
213
|
-
fill: cssVar.colorTextSecondary,
|
|
214
|
-
fontWeight: 500,
|
|
215
|
-
textAnchor: 'middle'
|
|
216
|
-
},
|
|
217
|
-
children: yAxisLeft.label
|
|
218
|
-
})
|
|
219
|
-
}), hasRightAxis && /*#__PURE__*/_jsx(YAxis, {
|
|
220
|
-
allowDecimals: allowDecimals,
|
|
221
|
-
axisLine: false,
|
|
222
|
-
className: styles.label,
|
|
223
|
-
domain: yAxisRight === null || yAxisRight === void 0 ? void 0 : yAxisRight.domain,
|
|
224
|
-
fill: "",
|
|
225
|
-
hide: !showYAxis,
|
|
226
|
-
orientation: "right",
|
|
227
|
-
stroke: "",
|
|
228
|
-
tick: function tick(tickProps) {
|
|
229
|
-
var _yAxisRight$valueForm2;
|
|
230
|
-
return /*#__PURE__*/_jsx(CustomYAxisTick, _objectSpread(_objectSpread({}, tickProps), {}, {
|
|
231
|
-
align: "right",
|
|
232
|
-
anchor: "start",
|
|
233
|
-
formatter: (_yAxisRight$valueForm2 = yAxisRight === null || yAxisRight === void 0 ? void 0 : yAxisRight.valueFormatter) !== null && _yAxisRight$valueForm2 !== void 0 ? _yAxisRight$valueForm2 : defaultValueFormatter,
|
|
234
|
-
yAxisLabel: Boolean(yAxisRight === null || yAxisRight === void 0 ? void 0 : yAxisRight.label)
|
|
235
|
-
}));
|
|
236
|
-
},
|
|
237
|
-
tickFormatter: (_yAxisRight$valueForm3 = yAxisRight === null || yAxisRight === void 0 ? void 0 : yAxisRight.valueFormatter) !== null && _yAxisRight$valueForm3 !== void 0 ? _yAxisRight$valueForm3 : defaultValueFormatter,
|
|
238
|
-
tickLine: false,
|
|
239
|
-
type: "number",
|
|
240
|
-
width: rightYAxisWidth,
|
|
241
|
-
yAxisId: "right",
|
|
242
|
-
children: (yAxisRight === null || yAxisRight === void 0 ? void 0 : yAxisRight.label) && /*#__PURE__*/_jsx(Label, {
|
|
243
|
-
angle: 90,
|
|
244
|
-
className: styles.emphasis,
|
|
245
|
-
offset: -15,
|
|
246
|
-
position: "insideRight",
|
|
247
|
-
style: {
|
|
248
|
-
fill: cssVar.colorTextSecondary,
|
|
249
|
-
fontWeight: 500,
|
|
250
|
-
textAnchor: 'middle'
|
|
251
|
-
},
|
|
252
|
-
children: yAxisRight.label
|
|
253
|
-
})
|
|
254
|
-
}), showLegend && /*#__PURE__*/_jsx(Legend, {
|
|
255
|
-
content: function content(_ref) {
|
|
256
|
-
var payload = _ref.payload;
|
|
257
|
-
return ChartLegend({
|
|
258
|
-
payload: payload
|
|
259
|
-
}, categoryColors, setLegendHeight, undefined, undefined, enableLegendSlider, customCategories);
|
|
260
|
-
},
|
|
261
|
-
height: legendHeight,
|
|
262
|
-
verticalAlign: "top"
|
|
263
|
-
}), series.map(function (s) {
|
|
264
|
-
var _seriesColorMap$get, _s$axis;
|
|
265
|
-
var color = (_seriesColorMap$get = seriesColorMap.get(s.key)) !== null && _seriesColorMap$get !== void 0 ? _seriesColorMap$get : cssVar.colorPrimary;
|
|
266
|
-
var axisId = (_s$axis = s.axis) !== null && _s$axis !== void 0 ? _s$axis : 'left';
|
|
267
|
-
if (s.type === 'bar') {
|
|
268
|
-
return /*#__PURE__*/_jsx(Bar, {
|
|
269
|
-
animationDuration: animationDuration,
|
|
270
|
-
className: cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fill: ", ";\n "])), color)),
|
|
271
|
-
dataKey: s.key,
|
|
272
|
-
fill: "",
|
|
273
|
-
isAnimationActive: showAnimation,
|
|
274
|
-
name: s.key,
|
|
275
|
-
yAxisId: axisId
|
|
276
|
-
}, s.key);
|
|
277
|
-
}
|
|
278
|
-
if (s.type === 'line') {
|
|
279
|
-
return /*#__PURE__*/_jsx(Line, {
|
|
280
|
-
animationDuration: animationDuration,
|
|
281
|
-
className: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n stroke: ", ";\n "])), color)),
|
|
282
|
-
dataKey: s.key,
|
|
283
|
-
dot: false,
|
|
284
|
-
isAnimationActive: showAnimation,
|
|
285
|
-
name: s.key,
|
|
286
|
-
stroke: "",
|
|
287
|
-
strokeWidth: 2,
|
|
288
|
-
type: "monotone",
|
|
289
|
-
yAxisId: axisId
|
|
290
|
-
}, s.key);
|
|
291
|
-
}
|
|
292
|
-
return null;
|
|
293
|
-
}), showTooltip && /*#__PURE__*/_jsx(Tooltip, {
|
|
294
|
-
content: function content(_ref2) {
|
|
295
|
-
var active = _ref2.active,
|
|
296
|
-
payload = _ref2.payload,
|
|
297
|
-
label = _ref2.label;
|
|
298
|
-
return /*#__PURE__*/_jsx(ChartTooltip, {
|
|
299
|
-
active: active,
|
|
300
|
-
categoryColors: categoryColors,
|
|
301
|
-
customCategories: customCategories,
|
|
302
|
-
label: label,
|
|
303
|
-
payload: payload,
|
|
304
|
-
valueFormatter: function valueFormatter(value, name) {
|
|
305
|
-
var _ref3, _currentSeries$valueF;
|
|
306
|
-
var currentSeries = series.find(function (item) {
|
|
307
|
-
return item.key === name;
|
|
308
|
-
});
|
|
309
|
-
var formatter = (_ref3 = (_currentSeries$valueF = currentSeries === null || currentSeries === void 0 ? void 0 : currentSeries.valueFormatter) !== null && _currentSeries$valueF !== void 0 ? _currentSeries$valueF : (currentSeries === null || currentSeries === void 0 ? void 0 : currentSeries.axis) === 'right' ? yAxisRight === null || yAxisRight === void 0 ? void 0 : yAxisRight.valueFormatter : yAxisLeft === null || yAxisLeft === void 0 ? void 0 : yAxisLeft.valueFormatter) !== null && _ref3 !== void 0 ? _ref3 : defaultValueFormatter;
|
|
310
|
-
return formatter(value);
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
},
|
|
314
|
-
cursor: {
|
|
315
|
-
stroke: cssVar.colorTextSecondary,
|
|
316
|
-
strokeWidth: 1
|
|
317
|
-
},
|
|
318
|
-
isAnimationActive: false,
|
|
319
|
-
position: {
|
|
320
|
-
y: 0
|
|
321
|
-
},
|
|
322
|
-
wrapperStyle: {
|
|
323
|
-
outline: 'none'
|
|
324
|
-
}
|
|
325
|
-
})]
|
|
326
|
-
}) : /*#__PURE__*/_jsx(NoData, {
|
|
327
|
-
noDataText: noDataText
|
|
328
|
-
})
|
|
329
|
-
})
|
|
330
|
-
}));
|
|
331
|
-
});
|
|
332
|
-
ComposedChart.displayName = 'ComposedChart';
|
|
333
|
-
export default ComposedChart;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ComposedChart
|
|
3
|
-
description: ComposedChart renders bar and line series on the same chart with independent left and right y-axes, sharing a single x-axis and a unified tooltip.
|
|
4
|
-
category: Charts
|
|
5
|
-
order: 2
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
import DemoAxis from './demos/axis.tsx?demo';
|
|
9
|
-
import DemoDomain from './demos/domain.tsx?demo';
|
|
10
|
-
import DemoExample from './demos/example.tsx?demo';
|
|
11
|
-
import DemoIndex from './demos/index.tsx?demo';
|
|
12
|
-
import DemoLoading from './demos/loading.tsx?demo';
|
|
13
|
-
import DemoNoData from './demos/noData.tsx?demo';
|
|
14
|
-
|
|
15
|
-
<Demo of={DemoIndex} layout="bare" />
|
|
16
|
-
|
|
17
|
-
## Usage example
|
|
18
|
-
|
|
19
|
-
A classic dual-axes chart: request count (bar, left axis) + average cost (line, right axis).
|
|
20
|
-
|
|
21
|
-
<Demo of={DemoExample} />
|
|
22
|
-
|
|
23
|
-
## Usage example with axis labels
|
|
24
|
-
|
|
25
|
-
<Demo of={DemoAxis} />
|
|
26
|
-
|
|
27
|
-
## Custom y-axis domain
|
|
28
|
-
|
|
29
|
-
Recharts defaults number axes to `[0, auto]`, which flattens series in a narrow range (e.g. success rate 80–95%). Pass `domain` on `yAxisLeft` / `yAxisRight` to control the scale — same values as [recharts `YAxis.domain`](https://recharts.org/en-US/api/YAxis#domain).
|
|
30
|
-
|
|
31
|
-
<Demo of={DemoDomain} />
|
|
32
|
-
|
|
33
|
-
## No Data
|
|
34
|
-
|
|
35
|
-
<Demo of={DemoNoData} />
|
|
36
|
-
|
|
37
|
-
## Loading
|
|
38
|
-
|
|
39
|
-
<Demo of={DemoLoading} />
|
|
40
|
-
|
|
41
|
-
## API
|
|
42
|
-
|
|
43
|
-
<Api name="ComposedChart" />
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
2
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import { createStaticStyles } from '@lobehub/ui';
|
|
4
|
-
export var styles = createStaticStyles(function (_ref) {
|
|
5
|
-
var css = _ref.css,
|
|
6
|
-
cssVar = _ref.cssVar;
|
|
7
|
-
return {
|
|
8
|
-
emphasis: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
|
|
9
|
-
gridLines: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n stroke: ", ";\n stroke-width: 1;\n "])), cssVar.colorBorderSecondary),
|
|
10
|
-
label: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 12px;\n line-height: 16px;\n fill: ", ";\n "])), cssVar.colorTextDescription),
|
|
11
|
-
strongLabel: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n fill: ", ";\n "])), cssVar.colorTextSecondary)
|
|
12
|
-
};
|
|
13
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
2
|
-
import type { AxisDomain } from 'recharts/types/util/types';
|
|
3
|
-
import type { NoDataProps } from "../common/NoData";
|
|
4
|
-
import type { IntervalType, LabelFormatter, ValueFormatter } from "../types/charts";
|
|
5
|
-
import type BaseAnimationTimingProps from '../common/BaseAnimationTimingProps';
|
|
6
|
-
export interface SeriesItem {
|
|
7
|
-
/**
|
|
8
|
-
* Which y-axis this series is bound to.
|
|
9
|
-
* @default 'left'
|
|
10
|
-
*/
|
|
11
|
-
axis?: 'left' | 'right';
|
|
12
|
-
/** Override color for this series. Falls back to the chart-level `colors` array. */
|
|
13
|
-
color?: string;
|
|
14
|
-
/** Data key in the `data` array */
|
|
15
|
-
key: string;
|
|
16
|
-
/** Display name shown in legend / tooltip. Defaults to `key`. */
|
|
17
|
-
name?: string;
|
|
18
|
-
/** Chart type for this series */
|
|
19
|
-
type: 'bar' | 'line';
|
|
20
|
-
/** Per-series value formatter used in tooltip */
|
|
21
|
-
valueFormatter?: ValueFormatter;
|
|
22
|
-
}
|
|
23
|
-
export interface YAxisConfig {
|
|
24
|
-
/**
|
|
25
|
-
* Forward to recharts `YAxis.domain`.
|
|
26
|
-
* Accepts numbers or `'auto'` / `'dataMin'` / `'dataMax'` / `'dataMin - N'` etc.
|
|
27
|
-
*/
|
|
28
|
-
domain?: AxisDomain;
|
|
29
|
-
/** Label string rendered alongside the axis */
|
|
30
|
-
label?: string;
|
|
31
|
-
/** Custom tick formatter */
|
|
32
|
-
valueFormatter?: ValueFormatter;
|
|
33
|
-
/** Fixed axis width in pixels */
|
|
34
|
-
width?: number;
|
|
35
|
-
}
|
|
36
|
-
export interface ComposedChartProps extends BaseAnimationTimingProps, HTMLAttributes<HTMLDivElement> {
|
|
37
|
-
allowDecimals?: boolean;
|
|
38
|
-
colors?: string[];
|
|
39
|
-
data: any[];
|
|
40
|
-
enableLegendSlider?: boolean;
|
|
41
|
-
height?: string | number;
|
|
42
|
-
/** The key in `data` used as the shared x-axis category */
|
|
43
|
-
index: string;
|
|
44
|
-
intervalType?: IntervalType;
|
|
45
|
-
loading?: boolean;
|
|
46
|
-
noDataText?: NoDataProps['noDataText'];
|
|
47
|
-
rotateLabelX?: {
|
|
48
|
-
angle: number;
|
|
49
|
-
verticalShift?: number;
|
|
50
|
-
xAxisHeight?: number;
|
|
51
|
-
};
|
|
52
|
-
/** Series definitions — each item maps to a Bar or Line renderer */
|
|
53
|
-
series: SeriesItem[];
|
|
54
|
-
showGridLines?: boolean;
|
|
55
|
-
showLegend?: boolean;
|
|
56
|
-
showTooltip?: boolean;
|
|
57
|
-
showXAxis?: boolean;
|
|
58
|
-
showYAxis?: boolean;
|
|
59
|
-
startEndOnly?: boolean;
|
|
60
|
-
tickGap?: number;
|
|
61
|
-
width?: string | number;
|
|
62
|
-
xAxisLabel?: string;
|
|
63
|
-
xAxisLabelFormatter?: LabelFormatter;
|
|
64
|
-
/** Left y-axis configuration */
|
|
65
|
-
yAxisLeft?: YAxisConfig;
|
|
66
|
-
/** Right y-axis configuration */
|
|
67
|
-
yAxisRight?: YAxisConfig;
|
|
68
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FlexboxProps } from '@lobehub/ui';
|
|
3
|
-
import { ValueFormatter } from "../types/charts";
|
|
4
|
-
export interface CategoryBarProps extends FlexboxProps {
|
|
5
|
-
colors?: string[];
|
|
6
|
-
markerValue?: number;
|
|
7
|
-
showAnimation?: boolean;
|
|
8
|
-
showLabels?: boolean;
|
|
9
|
-
size?: number;
|
|
10
|
-
tooltip?: string;
|
|
11
|
-
valueFormatter?: ValueFormatter;
|
|
12
|
-
values: number[];
|
|
13
|
-
}
|
|
14
|
-
declare const CategoryBar: import("react").ForwardRefExoticComponent<Omit<CategoryBarProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
-
export default CategoryBar;
|