@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,452 +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;
|
|
5
|
-
var _excluded = ["data", "category", "customCategories", "index", "yAxisAlign", "colors", "valueFormatter", "xAxisLabelFormatter", "layout", "startEndOnly", "animationDuration", "showAnimation", "showXAxis", "showYAxis", "yAxisWidth", "intervalType", "showTooltip", "showLegend", "showGridLines", "autoMinValue", "minValue", "maxValue", "allowDecimals", "noDataText", "onValueChange", "enableLegendSlider", "showPercentage", "customTooltip", "rotateLabelX", "barCategoryGap", "tickGap", "loading", "xAxisLabel", "yAxisLabel", "className", "width", "height", "style", "showErrorBars", "errorFormatter", "errorKey", "accuracyFormatter"];
|
|
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, ErrorBar, Label, LabelList, Legend, BarChart as ReChartsBarChart, 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 { constructCategoryColors, deepEqual, getYAxisDomain } from "../common/utils";
|
|
28
|
-
import { useThemeColorRange } from "../hooks/useThemeColorRange";
|
|
29
|
-
import { defaultValueFormatter } from "../utils";
|
|
30
|
-
import { getMaxLabelLength, getTextWidth } from "../utils/getMaxLabelLength";
|
|
31
|
-
import { styles } from "./styles";
|
|
32
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
35
|
-
var AccuracyBarChart = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
|
-
var _categoryColors$get;
|
|
37
|
-
var themeColorRange = useThemeColorRange();
|
|
38
|
-
var _props$data = props.data,
|
|
39
|
-
data = _props$data === void 0 ? [] : _props$data,
|
|
40
|
-
_props$category = props.category,
|
|
41
|
-
category = _props$category === void 0 ? 'accuracy' : _props$category,
|
|
42
|
-
customCategories = props.customCategories,
|
|
43
|
-
index = props.index,
|
|
44
|
-
_props$yAxisAlign = props.yAxisAlign,
|
|
45
|
-
yAxisAlign = _props$yAxisAlign === void 0 ? 'left' : _props$yAxisAlign,
|
|
46
|
-
_props$colors = props.colors,
|
|
47
|
-
colors = _props$colors === void 0 ? themeColorRange : _props$colors,
|
|
48
|
-
_props$valueFormatter = props.valueFormatter,
|
|
49
|
-
valueFormatter = _props$valueFormatter === void 0 ? defaultValueFormatter : _props$valueFormatter,
|
|
50
|
-
_props$xAxisLabelForm = props.xAxisLabelFormatter,
|
|
51
|
-
xAxisLabelFormatter = _props$xAxisLabelForm === void 0 ? defaultValueFormatter : _props$xAxisLabelForm,
|
|
52
|
-
_props$layout = props.layout,
|
|
53
|
-
layout = _props$layout === void 0 ? 'vertical' : _props$layout,
|
|
54
|
-
_props$startEndOnly = props.startEndOnly,
|
|
55
|
-
startEndOnly = _props$startEndOnly === void 0 ? false : _props$startEndOnly,
|
|
56
|
-
_props$animationDurat = props.animationDuration,
|
|
57
|
-
animationDuration = _props$animationDurat === void 0 ? 900 : _props$animationDurat,
|
|
58
|
-
_props$showAnimation = props.showAnimation,
|
|
59
|
-
showAnimation = _props$showAnimation === void 0 ? false : _props$showAnimation,
|
|
60
|
-
_props$showXAxis = props.showXAxis,
|
|
61
|
-
showXAxis = _props$showXAxis === void 0 ? true : _props$showXAxis,
|
|
62
|
-
_props$showYAxis = props.showYAxis,
|
|
63
|
-
showYAxis = _props$showYAxis === void 0 ? true : _props$showYAxis,
|
|
64
|
-
yAxisWidth = props.yAxisWidth,
|
|
65
|
-
_props$intervalType = props.intervalType,
|
|
66
|
-
intervalType = _props$intervalType === void 0 ? 'equidistantPreserveStart' : _props$intervalType,
|
|
67
|
-
_props$showTooltip = props.showTooltip,
|
|
68
|
-
showTooltip = _props$showTooltip === void 0 ? true : _props$showTooltip,
|
|
69
|
-
_props$showLegend = props.showLegend,
|
|
70
|
-
showLegend = _props$showLegend === void 0 ? false : _props$showLegend,
|
|
71
|
-
_props$showGridLines = props.showGridLines,
|
|
72
|
-
showGridLines = _props$showGridLines === void 0 ? true : _props$showGridLines,
|
|
73
|
-
_props$autoMinValue = props.autoMinValue,
|
|
74
|
-
autoMinValue = _props$autoMinValue === void 0 ? true : _props$autoMinValue,
|
|
75
|
-
_props$minValue = props.minValue,
|
|
76
|
-
minValue = _props$minValue === void 0 ? 0 : _props$minValue,
|
|
77
|
-
_props$maxValue = props.maxValue,
|
|
78
|
-
maxValue = _props$maxValue === void 0 ? 100 : _props$maxValue,
|
|
79
|
-
_props$allowDecimals = props.allowDecimals,
|
|
80
|
-
allowDecimals = _props$allowDecimals === void 0 ? true : _props$allowDecimals,
|
|
81
|
-
noDataText = props.noDataText,
|
|
82
|
-
onValueChange = props.onValueChange,
|
|
83
|
-
_props$enableLegendSl = props.enableLegendSlider,
|
|
84
|
-
enableLegendSlider = _props$enableLegendSl === void 0 ? false : _props$enableLegendSl,
|
|
85
|
-
_props$showPercentage = props.showPercentage,
|
|
86
|
-
showPercentage = _props$showPercentage === void 0 ? true : _props$showPercentage,
|
|
87
|
-
customTooltip = props.customTooltip,
|
|
88
|
-
rotateLabelX = props.rotateLabelX,
|
|
89
|
-
_props$barCategoryGap = props.barCategoryGap,
|
|
90
|
-
barCategoryGap = _props$barCategoryGap === void 0 ? '20%' : _props$barCategoryGap,
|
|
91
|
-
_props$tickGap = props.tickGap,
|
|
92
|
-
tickGap = _props$tickGap === void 0 ? 5 : _props$tickGap,
|
|
93
|
-
loading = props.loading,
|
|
94
|
-
xAxisLabel = props.xAxisLabel,
|
|
95
|
-
yAxisLabel = props.yAxisLabel,
|
|
96
|
-
className = props.className,
|
|
97
|
-
_props$width = props.width,
|
|
98
|
-
width = _props$width === void 0 ? '100%' : _props$width,
|
|
99
|
-
_props$height = props.height,
|
|
100
|
-
height = _props$height === void 0 ? 400 : _props$height,
|
|
101
|
-
style = props.style,
|
|
102
|
-
_props$showErrorBars = props.showErrorBars,
|
|
103
|
-
showErrorBars = _props$showErrorBars === void 0 ? true : _props$showErrorBars,
|
|
104
|
-
_props$errorFormatter = props.errorFormatter,
|
|
105
|
-
errorFormatter = _props$errorFormatter === void 0 ? function (value) {
|
|
106
|
-
return value.toFixed(1);
|
|
107
|
-
} : _props$errorFormatter,
|
|
108
|
-
_props$errorKey = props.errorKey,
|
|
109
|
-
errorKey = _props$errorKey === void 0 ? 'error' : _props$errorKey,
|
|
110
|
-
_props$accuracyFormat = props.accuracyFormatter,
|
|
111
|
-
accuracyFormatter = _props$accuracyFormat === void 0 ? function (value) {
|
|
112
|
-
return "".concat(value.toFixed(1), "%");
|
|
113
|
-
} : _props$accuracyFormat,
|
|
114
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
115
|
-
var _useState = useState(),
|
|
116
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
117
|
-
activeBar = _useState2[0],
|
|
118
|
-
setActiveBar = _useState2[1];
|
|
119
|
-
var _useState3 = useState(),
|
|
120
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
121
|
-
activeLegend = _useState4[0],
|
|
122
|
-
setActiveLegend = _useState4[1];
|
|
123
|
-
var _useState5 = useState(60),
|
|
124
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
125
|
-
legendHeight = _useState6[0],
|
|
126
|
-
setLegendHeight = _useState6[1];
|
|
127
|
-
var calculatedYAxisWidth = useMemo(function () {
|
|
128
|
-
if (yAxisWidth) return yAxisWidth;
|
|
129
|
-
return getMaxLabelLength({
|
|
130
|
-
data: data,
|
|
131
|
-
index: index,
|
|
132
|
-
layout: layout,
|
|
133
|
-
valueFormatter: xAxisLabelFormatter
|
|
134
|
-
});
|
|
135
|
-
}, [yAxisWidth, layout, data, xAxisLabelFormatter, index]);
|
|
136
|
-
if (loading || !data) return /*#__PURE__*/_jsx(Skeleton, {
|
|
137
|
-
height: height,
|
|
138
|
-
width: width
|
|
139
|
-
});
|
|
140
|
-
var CustomTooltip = customTooltip;
|
|
141
|
-
var paddingValue = !showXAxis && !showYAxis ? 0 : 20;
|
|
142
|
-
var categoryColors = constructCategoryColors([category], colors);
|
|
143
|
-
var hasOnValueChange = !!onValueChange;
|
|
144
|
-
var onBarClick = function onBarClick(data, idx, event) {
|
|
145
|
-
event.stopPropagation();
|
|
146
|
-
if (!onValueChange) return;
|
|
147
|
-
if (deepEqual(activeBar, _objectSpread(_objectSpread({}, data.payload), {}, {
|
|
148
|
-
value: data.value
|
|
149
|
-
}))) {
|
|
150
|
-
setActiveLegend(undefined);
|
|
151
|
-
setActiveBar(undefined);
|
|
152
|
-
onValueChange === null || onValueChange === void 0 || onValueChange(null);
|
|
153
|
-
} else {
|
|
154
|
-
var _data$tooltipPayload, _data$tooltipPayload2;
|
|
155
|
-
setActiveLegend((_data$tooltipPayload = data.tooltipPayload) === null || _data$tooltipPayload === void 0 || (_data$tooltipPayload = _data$tooltipPayload[0]) === null || _data$tooltipPayload === void 0 ? void 0 : _data$tooltipPayload.dataKey);
|
|
156
|
-
setActiveBar(_objectSpread(_objectSpread({}, data.payload), {}, {
|
|
157
|
-
value: data.value
|
|
158
|
-
}));
|
|
159
|
-
onValueChange === null || onValueChange === void 0 || onValueChange(_objectSpread({
|
|
160
|
-
categoryClicked: (_data$tooltipPayload2 = data.tooltipPayload) === null || _data$tooltipPayload2 === void 0 || (_data$tooltipPayload2 = _data$tooltipPayload2[0]) === null || _data$tooltipPayload2 === void 0 ? void 0 : _data$tooltipPayload2.dataKey,
|
|
161
|
-
eventType: 'bar'
|
|
162
|
-
}, data.payload));
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
var onCategoryClick = function onCategoryClick(dataKey) {
|
|
166
|
-
if (!hasOnValueChange) return;
|
|
167
|
-
if (dataKey === activeLegend && !activeBar) {
|
|
168
|
-
setActiveLegend(undefined);
|
|
169
|
-
onValueChange === null || onValueChange === void 0 || onValueChange(null);
|
|
170
|
-
} else {
|
|
171
|
-
setActiveLegend(dataKey);
|
|
172
|
-
onValueChange === null || onValueChange === void 0 || onValueChange({
|
|
173
|
-
categoryClicked: dataKey,
|
|
174
|
-
eventType: 'category'
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
setActiveBar(undefined);
|
|
178
|
-
};
|
|
179
|
-
var yAxisDomain = getYAxisDomain(autoMinValue, minValue, maxValue);
|
|
180
|
-
|
|
181
|
-
// Custom accuracy formatter for display
|
|
182
|
-
var displayFormatter = accuracyFormatter || valueFormatter;
|
|
183
|
-
return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
|
|
184
|
-
className: className,
|
|
185
|
-
height: height,
|
|
186
|
-
ref: ref,
|
|
187
|
-
style: _objectSpread({
|
|
188
|
-
position: 'relative'
|
|
189
|
-
}, style),
|
|
190
|
-
width: width
|
|
191
|
-
}, rest), {}, {
|
|
192
|
-
children: /*#__PURE__*/_jsx(ResponsiveContainer, {
|
|
193
|
-
children: data !== null && data !== void 0 && data.length ? /*#__PURE__*/_jsxs(ReChartsBarChart, {
|
|
194
|
-
barCategoryGap: barCategoryGap,
|
|
195
|
-
data: data,
|
|
196
|
-
layout: layout === 'vertical' ? 'vertical' : 'horizontal',
|
|
197
|
-
margin: {
|
|
198
|
-
bottom: xAxisLabel ? 30 : undefined,
|
|
199
|
-
left: yAxisLabel ? 20 : undefined,
|
|
200
|
-
right: showErrorBars && layout === 'vertical' ? 40 : yAxisLabel ? 5 : undefined,
|
|
201
|
-
top: 5
|
|
202
|
-
},
|
|
203
|
-
onClick: hasOnValueChange && (activeLegend || activeBar) ? function () {
|
|
204
|
-
setActiveBar(undefined);
|
|
205
|
-
setActiveLegend(undefined);
|
|
206
|
-
onValueChange === null || onValueChange === void 0 || onValueChange(null);
|
|
207
|
-
} : undefined,
|
|
208
|
-
children: [showGridLines ? /*#__PURE__*/_jsx(CartesianGrid, {
|
|
209
|
-
className: styles.gridLines,
|
|
210
|
-
horizontal: layout !== 'vertical',
|
|
211
|
-
vertical: layout === 'vertical'
|
|
212
|
-
}) : undefined, layout === 'vertical' ? /*#__PURE__*/_jsx(XAxis, {
|
|
213
|
-
allowDecimals: allowDecimals,
|
|
214
|
-
angle: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.angle,
|
|
215
|
-
axisLine: false,
|
|
216
|
-
className: styles.label,
|
|
217
|
-
domain: yAxisDomain,
|
|
218
|
-
dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
|
|
219
|
-
fill: "",
|
|
220
|
-
hide: !showXAxis,
|
|
221
|
-
minTickGap: tickGap,
|
|
222
|
-
stroke: "",
|
|
223
|
-
tick: {
|
|
224
|
-
transform: 'translate(-3, 0)'
|
|
225
|
-
},
|
|
226
|
-
tickFormatter: displayFormatter,
|
|
227
|
-
tickLine: false,
|
|
228
|
-
type: "number",
|
|
229
|
-
children: xAxisLabel && /*#__PURE__*/_jsx(Label, {
|
|
230
|
-
className: cx(styles.strongLabel, styles.emphasis),
|
|
231
|
-
offset: -20,
|
|
232
|
-
position: "insideBottom",
|
|
233
|
-
style: {
|
|
234
|
-
fill: cssVar.colorTextSecondary,
|
|
235
|
-
fontWeight: 500,
|
|
236
|
-
textAnchor: 'middle'
|
|
237
|
-
},
|
|
238
|
-
children: xAxisLabel
|
|
239
|
-
})
|
|
240
|
-
}) : /*#__PURE__*/_jsx(XAxis, {
|
|
241
|
-
angle: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.angle,
|
|
242
|
-
axisLine: false,
|
|
243
|
-
className: styles.label,
|
|
244
|
-
dataKey: index,
|
|
245
|
-
dy: rotateLabelX === null || rotateLabelX === void 0 ? void 0 : rotateLabelX.verticalShift,
|
|
246
|
-
fill: "",
|
|
247
|
-
hide: !showXAxis,
|
|
248
|
-
interval: startEndOnly ? 'preserveStartEnd' : intervalType,
|
|
249
|
-
minTickGap: tickGap,
|
|
250
|
-
padding: {
|
|
251
|
-
left: paddingValue,
|
|
252
|
-
right: paddingValue
|
|
253
|
-
},
|
|
254
|
-
stroke: "",
|
|
255
|
-
tick: {
|
|
256
|
-
transform: 'translate(0, 6)'
|
|
257
|
-
},
|
|
258
|
-
tickFormatter: xAxisLabelFormatter,
|
|
259
|
-
tickLine: false,
|
|
260
|
-
ticks: startEndOnly ? [data[0][index], data.at(-1)[index]] : undefined,
|
|
261
|
-
children: xAxisLabel && /*#__PURE__*/_jsx(Label, {
|
|
262
|
-
className: cx(styles.strongLabel, styles.emphasis),
|
|
263
|
-
offset: -20,
|
|
264
|
-
position: "insideBottom",
|
|
265
|
-
style: {
|
|
266
|
-
fill: cssVar.colorTextSecondary,
|
|
267
|
-
fontWeight: 500,
|
|
268
|
-
textAnchor: 'middle'
|
|
269
|
-
},
|
|
270
|
-
children: xAxisLabel
|
|
271
|
-
})
|
|
272
|
-
}), layout === 'vertical' ? /*#__PURE__*/_jsx(YAxis, {
|
|
273
|
-
axisLine: false,
|
|
274
|
-
className: styles.label,
|
|
275
|
-
dataKey: index,
|
|
276
|
-
fill: "",
|
|
277
|
-
hide: !showYAxis,
|
|
278
|
-
interval: "preserveStartEnd",
|
|
279
|
-
stroke: "",
|
|
280
|
-
tick: function tick(props) {
|
|
281
|
-
return /*#__PURE__*/_jsx(CustomYAxisTick, _objectSpread(_objectSpread({}, props), {}, {
|
|
282
|
-
align: yAxisAlign,
|
|
283
|
-
formatter: xAxisLabelFormatter,
|
|
284
|
-
textAnchor: yAxisAlign === 'left' ? 'start' : 'end',
|
|
285
|
-
yAxisLabel: Boolean(yAxisLabel)
|
|
286
|
-
}));
|
|
287
|
-
},
|
|
288
|
-
tickFormatter: xAxisLabelFormatter,
|
|
289
|
-
tickLine: false,
|
|
290
|
-
ticks: startEndOnly ? [data[0][index], data.at(-1)[index]] : undefined,
|
|
291
|
-
type: "category",
|
|
292
|
-
width: calculatedYAxisWidth,
|
|
293
|
-
children: yAxisLabel && /*#__PURE__*/_jsx(Label, {
|
|
294
|
-
angle: -90,
|
|
295
|
-
className: styles.emphasis,
|
|
296
|
-
offset: -15,
|
|
297
|
-
position: "insideLeft",
|
|
298
|
-
style: {
|
|
299
|
-
fill: cssVar.colorTextSecondary,
|
|
300
|
-
fontWeight: 500,
|
|
301
|
-
textAnchor: 'middle'
|
|
302
|
-
},
|
|
303
|
-
children: yAxisLabel
|
|
304
|
-
})
|
|
305
|
-
}) : /*#__PURE__*/_jsx(YAxis, {
|
|
306
|
-
allowDecimals: allowDecimals,
|
|
307
|
-
axisLine: false,
|
|
308
|
-
className: styles.label,
|
|
309
|
-
domain: yAxisDomain,
|
|
310
|
-
fill: "",
|
|
311
|
-
hide: !showYAxis,
|
|
312
|
-
stroke: "",
|
|
313
|
-
tick: function tick(props) {
|
|
314
|
-
return /*#__PURE__*/_jsx(CustomYAxisTick, _objectSpread(_objectSpread({}, props), {}, {
|
|
315
|
-
align: yAxisAlign,
|
|
316
|
-
formatter: displayFormatter,
|
|
317
|
-
textAnchor: yAxisAlign === 'left' ? 'start' : 'end',
|
|
318
|
-
yAxisLabel: Boolean(yAxisLabel)
|
|
319
|
-
}));
|
|
320
|
-
},
|
|
321
|
-
tickFormatter: displayFormatter,
|
|
322
|
-
tickLine: false,
|
|
323
|
-
type: "number",
|
|
324
|
-
width: calculatedYAxisWidth,
|
|
325
|
-
children: yAxisLabel && /*#__PURE__*/_jsx(Label, {
|
|
326
|
-
angle: -90,
|
|
327
|
-
className: styles.emphasis,
|
|
328
|
-
offset: -15,
|
|
329
|
-
position: "insideLeft",
|
|
330
|
-
style: {
|
|
331
|
-
fill: cssVar.colorTextSecondary,
|
|
332
|
-
fontWeight: 500,
|
|
333
|
-
textAnchor: 'middle'
|
|
334
|
-
},
|
|
335
|
-
children: yAxisLabel
|
|
336
|
-
})
|
|
337
|
-
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
338
|
-
content: showTooltip ? function (_ref) {
|
|
339
|
-
var active = _ref.active,
|
|
340
|
-
payload = _ref.payload,
|
|
341
|
-
label = _ref.label;
|
|
342
|
-
return CustomTooltip ? /*#__PURE__*/_jsx(CustomTooltip, {
|
|
343
|
-
active: active,
|
|
344
|
-
customCategories: customCategories,
|
|
345
|
-
label: label,
|
|
346
|
-
payload: payload === null || payload === void 0 ? void 0 : payload.map(function (payloadItem) {
|
|
347
|
-
var record = data.find(function (item) {
|
|
348
|
-
return item[index] === label;
|
|
349
|
-
});
|
|
350
|
-
var errVal = record === null || record === void 0 ? void 0 : record[errorKey];
|
|
351
|
-
var combined = errVal === undefined || errVal === null ? accuracyFormatter(Number(payloadItem.value)) : "".concat(accuracyFormatter(Number(payloadItem.value)), " \xB1 ").concat(errorFormatter(Number(errVal)));
|
|
352
|
-
return _objectSpread(_objectSpread({}, payloadItem), {}, {
|
|
353
|
-
formattedValue: combined
|
|
354
|
-
});
|
|
355
|
-
}),
|
|
356
|
-
valueFormatter: displayFormatter
|
|
357
|
-
}) : /*#__PURE__*/_jsx(ChartTooltip, {
|
|
358
|
-
active: active,
|
|
359
|
-
categoryColors: categoryColors,
|
|
360
|
-
customCategories: customCategories,
|
|
361
|
-
label: label,
|
|
362
|
-
payload: payload,
|
|
363
|
-
valueFormatter: function valueFormatter(val) {
|
|
364
|
-
var record = data.find(function (item) {
|
|
365
|
-
return item[index] === label;
|
|
366
|
-
});
|
|
367
|
-
var errVal = record === null || record === void 0 ? void 0 : record[errorKey];
|
|
368
|
-
if (!showErrorBars || errVal === undefined || errVal === null) return accuracyFormatter(Number(val));
|
|
369
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
370
|
-
children: [accuracyFormatter(Number(val)), /*#__PURE__*/_jsxs("span", {
|
|
371
|
-
style: {
|
|
372
|
-
color: cssVar.colorTextSecondary
|
|
373
|
-
},
|
|
374
|
-
children: [' ', "\xB1 ", errorFormatter(Number(errVal))]
|
|
375
|
-
})]
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
} : undefined,
|
|
380
|
-
cursor: {
|
|
381
|
-
fill: cssVar.colorFillTertiary
|
|
382
|
-
},
|
|
383
|
-
isAnimationActive: false,
|
|
384
|
-
position: {
|
|
385
|
-
y: 0
|
|
386
|
-
},
|
|
387
|
-
wrapperStyle: {
|
|
388
|
-
outline: 'none'
|
|
389
|
-
}
|
|
390
|
-
}), showLegend ? /*#__PURE__*/_jsx(Legend, {
|
|
391
|
-
content: function content(_ref2) {
|
|
392
|
-
var payload = _ref2.payload;
|
|
393
|
-
return ChartLegend({
|
|
394
|
-
payload: payload
|
|
395
|
-
}, categoryColors, setLegendHeight, activeLegend, hasOnValueChange ? function (clickedLegendItem) {
|
|
396
|
-
return onCategoryClick(clickedLegendItem);
|
|
397
|
-
} : undefined, enableLegendSlider, customCategories);
|
|
398
|
-
},
|
|
399
|
-
height: legendHeight,
|
|
400
|
-
verticalAlign: "top"
|
|
401
|
-
}) : undefined, /*#__PURE__*/_jsxs(Bar, {
|
|
402
|
-
animationDuration: animationDuration,
|
|
403
|
-
className: cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fill: ", ";\n "])), (_categoryColors$get = categoryColors.get(category)) !== null && _categoryColors$get !== void 0 ? _categoryColors$get : cssVar.colorPrimary)),
|
|
404
|
-
dataKey: category,
|
|
405
|
-
fill: '',
|
|
406
|
-
isAnimationActive: showAnimation,
|
|
407
|
-
name: category,
|
|
408
|
-
onClick: onBarClick,
|
|
409
|
-
style: {
|
|
410
|
-
cursor: onValueChange ? 'pointer' : undefined
|
|
411
|
-
},
|
|
412
|
-
type: "linear",
|
|
413
|
-
children: [showPercentage && layout === 'vertical' ? /*#__PURE__*/_jsx(LabelList, {
|
|
414
|
-
content: function content(labelProps) {
|
|
415
|
-
var lx = labelProps.x,
|
|
416
|
-
ly = labelProps.y,
|
|
417
|
-
lh = labelProps.height,
|
|
418
|
-
lw = labelProps.width,
|
|
419
|
-
value = labelProps.value;
|
|
420
|
-
if (lx === null || lx === undefined || ly === null || ly === undefined || lh === null || lh === undefined || lw === null || lw === undefined) return null;
|
|
421
|
-
var text = accuracyFormatter(Number(value !== null && value !== void 0 ? value : 0));
|
|
422
|
-
var textWidth = getTextWidth(text);
|
|
423
|
-
var horizontalPadding = 16; // 8px left padding + 8px safe space
|
|
424
|
-
if (Number(lw) <= textWidth + horizontalPadding) return null;
|
|
425
|
-
return /*#__PURE__*/_jsx("text", {
|
|
426
|
-
className: styles.percentageLabel,
|
|
427
|
-
dominantBaseline: "central",
|
|
428
|
-
style: {
|
|
429
|
-
fill: cssVar.colorTextLightSolid
|
|
430
|
-
},
|
|
431
|
-
x: Number(lx) + 8,
|
|
432
|
-
y: Number(ly) + Number(lh) / 2,
|
|
433
|
-
children: text
|
|
434
|
-
});
|
|
435
|
-
},
|
|
436
|
-
dataKey: category,
|
|
437
|
-
offset: 8,
|
|
438
|
-
position: "insideLeft"
|
|
439
|
-
}) : null, showErrorBars ? /*#__PURE__*/_jsx(ErrorBar, {
|
|
440
|
-
dataKey: errorKey,
|
|
441
|
-
direction: layout === 'vertical' ? 'x' : 'y',
|
|
442
|
-
stroke: cssVar.colorTextSecondary
|
|
443
|
-
}) : null]
|
|
444
|
-
}, category)]
|
|
445
|
-
}) : /*#__PURE__*/_jsx(NoData, {
|
|
446
|
-
noDataText: noDataText
|
|
447
|
-
})
|
|
448
|
-
})
|
|
449
|
-
}));
|
|
450
|
-
});
|
|
451
|
-
AccuracyBarChart.displayName = 'AccuracyBarChart';
|
|
452
|
-
export default AccuracyBarChart;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: AccuracyBarChart
|
|
3
|
-
description: Accuracy bar charts visualize model or system performance metrics with intelligent color coding and percentage display.
|
|
4
|
-
category: Charts
|
|
5
|
-
order: 1
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
import DemoIndex from './demos/index.tsx?demo';
|
|
9
|
-
|
|
10
|
-
<Demo of={DemoIndex} layout="bare" />
|
|
11
|
-
|
|
12
|
-
{/* ## Usage example
|
|
13
|
-
|
|
14
|
-
The example below shows a chart composition displaying accuracy metrics for different models or systems.
|
|
15
|
-
|
|
16
|
-
<code src="./demos/example.tsx"></code>
|
|
17
|
-
|
|
18
|
-
## Usage example with color schemes
|
|
19
|
-
|
|
20
|
-
The example below shows different color schemes for accuracy visualization.
|
|
21
|
-
|
|
22
|
-
<code src="./demos/colorSchemes.tsx"></code>
|
|
23
|
-
|
|
24
|
-
## Usage example with thresholds
|
|
25
|
-
|
|
26
|
-
The example below shows threshold-based color coding for accuracy levels.
|
|
27
|
-
|
|
28
|
-
<code src="./demos/thresholds.tsx"></code>
|
|
29
|
-
|
|
30
|
-
## Usage example with custom formatting
|
|
31
|
-
|
|
32
|
-
The example below shows custom accuracy formatting and display options.
|
|
33
|
-
|
|
34
|
-
<code src="./demos/customFormatting.tsx"></code>
|
|
35
|
-
|
|
36
|
-
## Usage example with click events
|
|
37
|
-
|
|
38
|
-
The example below shows an interactive chart using the `onValueChange` prop.
|
|
39
|
-
|
|
40
|
-
<code src="./demos/clickEvent.tsx"></code>
|
|
41
|
-
|
|
42
|
-
## No Data
|
|
43
|
-
|
|
44
|
-
<code src="./demos/noData.tsx"></code>
|
|
45
|
-
|
|
46
|
-
## Loading
|
|
47
|
-
|
|
48
|
-
<code src="./demos/loading.tsx"></code>
|
|
49
|
-
|
|
50
|
-
## API
|
|
51
|
-
|
|
52
|
-
<API></API> */}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
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
|
-
accuracyText: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 11px;\n font-weight: 500;\n\n dominant-baseline: central;\n text-anchor: middle;\n fill: ", ";\n "])), cssVar.colorText),
|
|
9
|
-
accuracyTextLight: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: 11px;\n font-weight: 500;\n\n dominant-baseline: central;\n text-anchor: middle;\n fill: ", ";\n "])), cssVar.colorTextLightSolid),
|
|
10
|
-
emphasis: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
|
|
11
|
-
gridLines: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n stroke: ", ";\n stroke-width: 1;\n "])), cssVar.colorBorderSecondary),
|
|
12
|
-
label: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: 12px;\n line-height: 16px;\n fill: ", ";\n "])), cssVar.colorTextDescription),
|
|
13
|
-
leftValue: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: flex-end;\n\n padding-right: 8px;\n "]))),
|
|
14
|
-
leftValueContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 10;\n top: 0;\n bottom: 0;\n left: 0;\n\n display: flex;\n flex-direction: column;\n\n width: 80px;\n "]))),
|
|
15
|
-
percentageLabel: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 2px 4px;\n border-radius: 4px;\n font-size: 12px;\n "]))),
|
|
16
|
-
strongLabel: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n fill: ", ";\n "])), cssVar.colorTextSecondary)
|
|
17
|
-
};
|
|
18
|
-
});
|
package/es/AreaChart/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import BaseChartProps from "../common/BaseChartProps";
|
|
3
|
-
import { CurveType } from "../types/charts";
|
|
4
|
-
export interface AreaChartProps extends BaseChartProps {
|
|
5
|
-
connectNulls?: boolean;
|
|
6
|
-
curveType?: CurveType;
|
|
7
|
-
showGradient?: boolean;
|
|
8
|
-
stack?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const AreaChart: import("react").ForwardRefExoticComponent<AreaChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export default AreaChart;
|